ip_log.c revision 1.5 1 1.5 christos /* $NetBSD: ip_log.c,v 1.5 2013/03/27 23:49:02 christos Exp $ */
2 1.1 christos
3 1.1 christos /*
4 1.3 darrenr * Copyright (C) 2012 by Darren Reed.
5 1.1 christos *
6 1.1 christos * See the IPFILTER.LICENCE file for details on licencing.
7 1.1 christos *
8 1.3 darrenr * Id: ip_log.c,v 1.1.1.2 2012/07/22 13:45:19 darrenr Exp
9 1.1 christos */
10 1.2 christos
11 1.2 christos #include <sys/cdefs.h>
12 1.5 christos __KERNEL_RCSID(0, "$NetBSD: ip_log.c,v 1.5 2013/03/27 23:49:02 christos Exp $");
13 1.2 christos
14 1.1 christos #include <sys/param.h>
15 1.1 christos #if defined(KERNEL) || defined(_KERNEL)
16 1.1 christos # undef KERNEL
17 1.1 christos # undef _KERNEL
18 1.1 christos # define KERNEL 1
19 1.1 christos # define _KERNEL 1
20 1.1 christos #endif
21 1.1 christos #if defined(__FreeBSD__) && !defined(_KERNEL)
22 1.1 christos # include <osreldate.h>
23 1.1 christos #endif
24 1.4 plunky #ifndef SOLARIS
25 1.4 plunky # if (defined(sun) && (defined(__svr4__) || defined(__SVR4)))
26 1.4 plunky # define SOLARIS 1
27 1.4 plunky # else
28 1.4 plunky # define SOLARIS 0
29 1.4 plunky # endif
30 1.1 christos #endif
31 1.1 christos #include <sys/errno.h>
32 1.1 christos #include <sys/types.h>
33 1.1 christos #include <sys/file.h>
34 1.1 christos #ifndef _KERNEL
35 1.1 christos # include <stdio.h>
36 1.1 christos # include <string.h>
37 1.1 christos # include <stdlib.h>
38 1.1 christos # include <ctype.h>
39 1.1 christos # define _KERNEL
40 1.1 christos # define KERNEL
41 1.1 christos # ifdef __OpenBSD__
42 1.1 christos struct file;
43 1.1 christos # endif
44 1.1 christos # include <sys/uio.h>
45 1.1 christos # undef _KERNEL
46 1.1 christos # undef KERNEL
47 1.1 christos #endif
48 1.1 christos #if (defined(__FreeBSD_version) && (__FreeBSD_version >= 220000)) && \
49 1.1 christos defined(_KERNEL)
50 1.1 christos # include <sys/fcntl.h>
51 1.1 christos # include <sys/filio.h>
52 1.1 christos #else
53 1.1 christos # include <sys/ioctl.h>
54 1.1 christos #endif
55 1.1 christos #include <sys/time.h>
56 1.1 christos #if defined(_KERNEL)
57 1.1 christos # include <sys/systm.h>
58 1.1 christos # if (defined(NetBSD) && (__NetBSD_Version__ >= 104000000))
59 1.1 christos # include <sys/proc.h>
60 1.1 christos # endif
61 1.1 christos #endif /* _KERNEL */
62 1.1 christos #if !SOLARIS && !defined(__hpux) && !defined(linux)
63 1.1 christos # if (defined(NetBSD) && (NetBSD > 199609)) || \
64 1.1 christos (defined(OpenBSD) && (OpenBSD > 199603)) || \
65 1.1 christos (defined(__FreeBSD_version) && (__FreeBSD_version >= 300000))
66 1.1 christos # include <sys/dirent.h>
67 1.1 christos # else
68 1.1 christos # include <sys/dir.h>
69 1.1 christos # endif
70 1.1 christos # include <sys/mbuf.h>
71 1.1 christos # include <sys/select.h>
72 1.1 christos # if __FreeBSD_version >= 500000
73 1.1 christos # include <sys/selinfo.h>
74 1.1 christos # endif
75 1.1 christos #else
76 1.1 christos # if !defined(__hpux) && defined(_KERNEL)
77 1.1 christos # include <sys/filio.h>
78 1.1 christos # include <sys/cred.h>
79 1.1 christos # include <sys/ddi.h>
80 1.1 christos # include <sys/sunddi.h>
81 1.1 christos # include <sys/ksynch.h>
82 1.1 christos # include <sys/kmem.h>
83 1.1 christos # include <sys/mkdev.h>
84 1.1 christos # include <sys/dditypes.h>
85 1.1 christos # include <sys/cmn_err.h>
86 1.1 christos # endif /* !__hpux */
87 1.1 christos #endif /* !SOLARIS && !__hpux */
88 1.1 christos #if !defined(linux)
89 1.1 christos # include <sys/protosw.h>
90 1.1 christos #endif
91 1.1 christos #include <sys/socket.h>
92 1.1 christos
93 1.1 christos #include <net/if.h>
94 1.1 christos #ifdef sun
95 1.1 christos # include <net/af.h>
96 1.1 christos #endif
97 1.1 christos #if __FreeBSD_version >= 300000
98 1.1 christos # include <net/if_var.h>
99 1.1 christos #endif
100 1.1 christos #include <netinet/in.h>
101 1.1 christos #ifdef __sgi
102 1.1 christos # include <sys/ddi.h>
103 1.1 christos # ifdef IFF_DRVRLOCK /* IRIX6 */
104 1.1 christos # include <sys/hashing.h>
105 1.1 christos # endif
106 1.1 christos #endif
107 1.1 christos #if !defined(__hpux) && !defined(linux) && \
108 1.1 christos !(defined(__sgi) && !defined(IFF_DRVRLOCK)) /*IRIX<6*/
109 1.1 christos # include <netinet/in_var.h>
110 1.1 christos #endif
111 1.1 christos #include <netinet/in_systm.h>
112 1.1 christos #include <netinet/ip.h>
113 1.1 christos #include <netinet/tcp.h>
114 1.1 christos #include <netinet/udp.h>
115 1.1 christos #include <netinet/ip_icmp.h>
116 1.1 christos #ifdef USE_INET6
117 1.1 christos # include <netinet/icmp6.h>
118 1.1 christos #endif
119 1.1 christos #if !defined(linux)
120 1.1 christos # include <netinet/ip_var.h>
121 1.1 christos #endif
122 1.1 christos #ifndef _KERNEL
123 1.1 christos # include <syslog.h>
124 1.1 christos #endif
125 1.1 christos #include "netinet/ip_compat.h"
126 1.1 christos #include <netinet/tcpip.h>
127 1.1 christos #include "netinet/ip_fil.h"
128 1.1 christos #include "netinet/ip_nat.h"
129 1.1 christos #include "netinet/ip_frag.h"
130 1.1 christos #include "netinet/ip_state.h"
131 1.1 christos #include "netinet/ip_auth.h"
132 1.1 christos #if (__FreeBSD_version >= 300000) || defined(__NetBSD__)
133 1.1 christos # include <sys/malloc.h>
134 1.1 christos #endif
135 1.1 christos /* END OF INCLUDES */
136 1.1 christos
137 1.1 christos #ifdef IPFILTER_LOG
138 1.1 christos
139 1.1 christos # if defined(IPL_SELECT)
140 1.1 christos # include <machine/sys/user.h>
141 1.1 christos # include <sys/kthread_iface.h>
142 1.1 christos # define READ_COLLISION 0x001
143 1.1 christos extern int selwait;
144 1.1 christos # endif /* IPL_SELECT */
145 1.1 christos
146 1.1 christos typedef struct ipf_log_softc_s {
147 1.1 christos ipfmutex_t ipl_mutex[IPL_LOGSIZE];
148 1.1 christos # if SOLARIS && defined(_KERNEL)
149 1.1 christos kcondvar_t ipl_wait[IPL_LOGSIZE];
150 1.1 christos # endif
151 1.1 christos # if defined(linux) && defined(_KERNEL)
152 1.1 christos wait_queue_head_t iplh_linux[IPL_LOGSIZE];
153 1.1 christos # endif
154 1.1 christos # if defined(__hpux) && defined(_KERNEL)
155 1.1 christos iplog_select_t ipl_ss[IPL_LOGSIZE];
156 1.1 christos # endif
157 1.1 christos iplog_t **iplh[IPL_LOGSIZE];
158 1.1 christos iplog_t *iplt[IPL_LOGSIZE];
159 1.1 christos iplog_t *ipll[IPL_LOGSIZE];
160 1.1 christos u_long ipl_logfail[IPL_LOGSIZE];
161 1.1 christos u_long ipl_logok[IPL_LOGSIZE];
162 1.1 christos fr_info_t ipl_crc[IPL_LOGSIZE];
163 1.1 christos u_32_t ipl_counter[IPL_LOGSIZE];
164 1.1 christos int ipl_suppress;
165 1.1 christos int ipl_logall;
166 1.1 christos int ipl_log_init;
167 1.1 christos int ipl_logsize;
168 1.1 christos int ipl_used[IPL_LOGSIZE];
169 1.1 christos int ipl_magic[IPL_LOGSIZE];
170 1.1 christos ipftuneable_t *ipf_log_tune;
171 1.3 darrenr int ipl_readers[IPL_LOGSIZE];
172 1.1 christos } ipf_log_softc_t;
173 1.1 christos
174 1.1 christos static int magic[IPL_LOGSIZE] = { IPL_MAGIC, IPL_MAGIC_NAT, IPL_MAGIC_STATE,
175 1.1 christos IPL_MAGIC, IPL_MAGIC, IPL_MAGIC,
176 1.1 christos IPL_MAGIC, IPL_MAGIC };
177 1.1 christos
178 1.1 christos static ipftuneable_t ipf_log_tuneables[] = {
179 1.1 christos /* log */
180 1.1 christos { { (void *)offsetof(ipf_log_softc_t, ipl_suppress) },
181 1.1 christos "log_suppress", 0, 1,
182 1.1 christos stsizeof(ipf_log_softc_t, ipl_suppress),
183 1.1 christos 0, NULL, NULL },
184 1.1 christos { { (void *)offsetof(ipf_log_softc_t, ipl_logall) },
185 1.1 christos "log_all", 0, 1,
186 1.1 christos stsizeof(ipf_log_softc_t, ipl_logall),
187 1.1 christos 0, NULL, NULL },
188 1.1 christos { { (void *)offsetof(ipf_log_softc_t, ipl_logsize) },
189 1.1 christos "log_size", 0, 0x80000,
190 1.1 christos stsizeof(ipf_log_softc_t, ipl_logsize),
191 1.1 christos 0, NULL, NULL },
192 1.1 christos { { NULL }, NULL, 0, 0,
193 1.1 christos 0,
194 1.1 christos 0, NULL, NULL }
195 1.1 christos };
196 1.1 christos
197 1.1 christos
198 1.1 christos int
199 1.2 christos ipf_log_main_load(void)
200 1.1 christos {
201 1.1 christos return 0;
202 1.1 christos }
203 1.1 christos
204 1.1 christos
205 1.1 christos int
206 1.2 christos ipf_log_main_unload(void)
207 1.1 christos {
208 1.1 christos return 0;
209 1.1 christos }
210 1.1 christos
211 1.3 darrenr /* ------------------------------------------------------------------------ */
212 1.3 darrenr /* Function: ipf_log_soft_create */
213 1.3 darrenr /* Returns: void * - NULL = failure, else pointer to log context data */
214 1.3 darrenr /* Parameters: softc(I) - pointer to soft context main structure */
215 1.3 darrenr /* */
216 1.3 darrenr /* Initialise log buffers & pointers. Also iniialised the CRC to a local */
217 1.3 darrenr /* secret for use in calculating the "last log checksum". */
218 1.3 darrenr /* ------------------------------------------------------------------------ */
219 1.1 christos void *
220 1.2 christos ipf_log_soft_create(ipf_main_softc_t *softc)
221 1.1 christos {
222 1.1 christos ipf_log_softc_t *softl;
223 1.1 christos
224 1.1 christos KMALLOC(softl, ipf_log_softc_t *);
225 1.1 christos if (softl == NULL)
226 1.1 christos return NULL;
227 1.1 christos
228 1.1 christos bzero((char *)softl, sizeof(*softl));
229 1.1 christos bcopy((char *)magic, (char *)softl->ipl_magic, sizeof(magic));
230 1.1 christos
231 1.1 christos softl->ipf_log_tune = ipf_tune_array_copy(softl,
232 1.1 christos sizeof(ipf_log_tuneables),
233 1.1 christos ipf_log_tuneables);
234 1.1 christos if (softl->ipf_log_tune == NULL) {
235 1.1 christos ipf_log_soft_destroy(softc, softl);
236 1.1 christos return NULL;
237 1.1 christos }
238 1.1 christos if (ipf_tune_array_link(softc, softl->ipf_log_tune) == -1) {
239 1.1 christos ipf_log_soft_destroy(softc, softl);
240 1.1 christos return NULL;
241 1.1 christos }
242 1.1 christos
243 1.1 christos softl->ipl_suppress = 1;
244 1.1 christos softl->ipl_logall = 0;
245 1.1 christos softl->ipl_log_init = 0;
246 1.1 christos softl->ipl_logsize = IPFILTER_LOGSIZE;
247 1.1 christos
248 1.1 christos return softl;
249 1.1 christos }
250 1.1 christos
251 1.1 christos /* ------------------------------------------------------------------------ */
252 1.3 darrenr /* Function: ipf_log_soft_init */
253 1.1 christos /* Returns: int - 0 == success (always returned) */
254 1.3 darrenr /* Parameters: softc(I) - pointer to soft context main structure */
255 1.1 christos /* */
256 1.1 christos /* Initialise log buffers & pointers. Also iniialised the CRC to a local */
257 1.1 christos /* secret for use in calculating the "last log checksum". */
258 1.1 christos /* ------------------------------------------------------------------------ */
259 1.1 christos int
260 1.2 christos ipf_log_soft_init(ipf_main_softc_t *softc, void *arg)
261 1.1 christos {
262 1.1 christos ipf_log_softc_t *softl = arg;
263 1.3 darrenr int i;
264 1.1 christos
265 1.1 christos for (i = IPL_LOGMAX; i >= 0; i--) {
266 1.1 christos softl->iplt[i] = NULL;
267 1.1 christos softl->ipll[i] = NULL;
268 1.1 christos softl->iplh[i] = &softl->iplt[i];
269 1.1 christos bzero((char *)&softl->ipl_crc[i], sizeof(softl->ipl_crc[i]));
270 1.1 christos # ifdef IPL_SELECT
271 1.1 christos softl->iplog_ss[i].read_waiter = 0;
272 1.1 christos softl->iplog_ss[i].state = 0;
273 1.1 christos # endif
274 1.1 christos # if defined(linux) && defined(_KERNEL)
275 1.1 christos init_waitqueue_head(softl->iplh_linux + i);
276 1.1 christos # endif
277 1.1 christos # if SOLARIS && defined(_KERNEL)
278 1.1 christos cv_init(&softl->ipl_wait[i], NULL, CV_DRIVER, NULL);
279 1.1 christos # endif
280 1.1 christos MUTEX_INIT(&softl->ipl_mutex[i], "ipf log mutex");
281 1.1 christos }
282 1.1 christos
283 1.1 christos
284 1.1 christos softl->ipl_log_init = 1;
285 1.1 christos
286 1.1 christos return 0;
287 1.1 christos }
288 1.1 christos
289 1.1 christos
290 1.1 christos /* ------------------------------------------------------------------------ */
291 1.3 darrenr /* Function: ipf_log_soft_fini */
292 1.3 darrenr /* Parameters: softc(I) - pointer to soft context main structure */
293 1.3 darrenr /* arg(I) - pointer to log context structure */
294 1.1 christos /* */
295 1.1 christos /* Clean up any log data that has accumulated without being read. */
296 1.1 christos /* ------------------------------------------------------------------------ */
297 1.1 christos int
298 1.2 christos ipf_log_soft_fini(ipf_main_softc_t *softc, void *arg)
299 1.1 christos {
300 1.1 christos ipf_log_softc_t *softl = arg;
301 1.1 christos int i;
302 1.1 christos
303 1.1 christos if (softl->ipl_log_init == 0)
304 1.1 christos return 0;
305 1.1 christos
306 1.3 darrenr softl->ipl_log_init = 0;
307 1.3 darrenr
308 1.1 christos for (i = IPL_LOGMAX; i >= 0; i--) {
309 1.1 christos (void) ipf_log_clear(softc, i);
310 1.1 christos
311 1.3 darrenr /*
312 1.3 darrenr * This is a busy-wait loop so as to avoid yet another lock
313 1.3 darrenr * to wait on.
314 1.3 darrenr */
315 1.3 darrenr MUTEX_ENTER(&softl->ipl_mutex[i]);
316 1.3 darrenr while (softl->ipl_readers[i] > 0) {
317 1.1 christos # if SOLARIS && defined(_KERNEL)
318 1.3 darrenr cv_broadcast(&softl->ipl_wait[i]);
319 1.3 darrenr MUTEX_EXIT(&softl->ipl_mutex[i]);
320 1.3 darrenr delay(100);
321 1.3 darrenr pollwakeup(&softc->ipf_poll_head[i], POLLRDNORM);
322 1.3 darrenr # else
323 1.3 darrenr MUTEX_EXIT(&softl->ipl_mutex[i]);
324 1.3 darrenr WAKEUP(softl->iplh, i);
325 1.3 darrenr POLLWAKEUP(i);
326 1.1 christos # endif
327 1.3 darrenr MUTEX_ENTER(&softl->ipl_mutex[i]);
328 1.3 darrenr }
329 1.3 darrenr MUTEX_EXIT(&softl->ipl_mutex[i]);
330 1.5 christos MUTEX_DESTROY(&softl->ipl_mutex[i]);
331 1.1 christos }
332 1.1 christos
333 1.1 christos return 0;
334 1.1 christos }
335 1.1 christos
336 1.1 christos
337 1.3 darrenr /* ------------------------------------------------------------------------ */
338 1.3 darrenr /* Function: ipf_log_soft_destroy */
339 1.3 darrenr /* Parameters: softc(I) - pointer to soft context main structure */
340 1.3 darrenr /* arg(I) - pointer to log context structure */
341 1.3 darrenr /* */
342 1.3 darrenr /* When this function is called, it is expected that there are no longer */
343 1.3 darrenr /* any threads active in the reading code path or the logging code path. */
344 1.3 darrenr /* ------------------------------------------------------------------------ */
345 1.1 christos void
346 1.2 christos ipf_log_soft_destroy(ipf_main_softc_t *softc, void *arg)
347 1.1 christos {
348 1.1 christos ipf_log_softc_t *softl = arg;
349 1.3 darrenr int i;
350 1.3 darrenr
351 1.3 darrenr for (i = IPL_LOGMAX; i >= 0; i--) {
352 1.3 darrenr # if SOLARIS && defined(_KERNEL)
353 1.3 darrenr cv_destroy(&softl->ipl_wait[i]);
354 1.3 darrenr # endif
355 1.3 darrenr MUTEX_DESTROY(&softl->ipl_mutex[i]);
356 1.3 darrenr }
357 1.1 christos
358 1.1 christos if (softl->ipf_log_tune != NULL) {
359 1.1 christos ipf_tune_array_unlink(softc, softl->ipf_log_tune);
360 1.1 christos KFREES(softl->ipf_log_tune, sizeof(ipf_log_tuneables));
361 1.1 christos softl->ipf_log_tune = NULL;
362 1.1 christos }
363 1.1 christos
364 1.1 christos KFREE(softl);
365 1.1 christos }
366 1.1 christos
367 1.1 christos
368 1.1 christos /* ------------------------------------------------------------------------ */
369 1.1 christos /* Function: ipf_log_pkt */
370 1.1 christos /* Returns: int - 0 == success, -1 == failure */
371 1.1 christos /* Parameters: fin(I) - pointer to packet information */
372 1.1 christos /* flags(I) - flags from filter rules */
373 1.1 christos /* */
374 1.1 christos /* Create a log record for a packet given that it has been triggered by a */
375 1.1 christos /* rule (or the default setting). Calculate the transport protocol header */
376 1.1 christos /* size using predetermined size of a couple of popular protocols and thus */
377 1.1 christos /* how much data to copy into the log, including part of the data body if */
378 1.1 christos /* requested. */
379 1.1 christos /* ------------------------------------------------------------------------ */
380 1.1 christos int
381 1.2 christos ipf_log_pkt(fr_info_t *fin, u_int flags)
382 1.1 christos {
383 1.1 christos ipf_main_softc_t *softc = fin->fin_main_soft;
384 1.1 christos ipf_log_softc_t *softl = softc->ipf_log_soft;
385 1.1 christos register size_t hlen;
386 1.1 christos int types[2], mlen;
387 1.1 christos size_t sizes[2];
388 1.1 christos void *ptrs[2];
389 1.1 christos ipflog_t ipfl;
390 1.1 christos u_char p;
391 1.1 christos mb_t *m;
392 1.1 christos # if (SOLARIS || defined(__hpux)) && defined(_KERNEL) && !defined(FW_HOOKS)
393 1.1 christos qif_t *ifp;
394 1.1 christos # else
395 1.1 christos struct ifnet *ifp;
396 1.1 christos # endif /* SOLARIS || __hpux */
397 1.1 christos
398 1.1 christos m = fin->fin_m;
399 1.1 christos if (m == NULL)
400 1.1 christos return -1;
401 1.1 christos
402 1.1 christos ipfl.fl_nattag.ipt_num[0] = 0;
403 1.1 christos ifp = fin->fin_ifp;
404 1.1 christos hlen = (char *)fin->fin_dp - (char *)fin->fin_ip;
405 1.1 christos
406 1.1 christos /*
407 1.1 christos * calculate header size.
408 1.1 christos */
409 1.1 christos if (fin->fin_off == 0) {
410 1.1 christos p = fin->fin_fi.fi_p;
411 1.1 christos if (p == IPPROTO_TCP)
412 1.1 christos hlen += MIN(sizeof(tcphdr_t), fin->fin_dlen);
413 1.1 christos else if (p == IPPROTO_UDP)
414 1.1 christos hlen += MIN(sizeof(udphdr_t), fin->fin_dlen);
415 1.1 christos else if (p == IPPROTO_ICMP) {
416 1.1 christos struct icmp *icmp;
417 1.1 christos
418 1.1 christos icmp = (struct icmp *)fin->fin_dp;
419 1.1 christos
420 1.1 christos /*
421 1.1 christos * For ICMP, if the packet is an error packet, also
422 1.1 christos * include the information about the packet which
423 1.1 christos * caused the error.
424 1.1 christos */
425 1.1 christos switch (icmp->icmp_type)
426 1.1 christos {
427 1.1 christos case ICMP_UNREACH :
428 1.1 christos case ICMP_SOURCEQUENCH :
429 1.1 christos case ICMP_REDIRECT :
430 1.1 christos case ICMP_TIMXCEED :
431 1.1 christos case ICMP_PARAMPROB :
432 1.1 christos hlen += MIN(sizeof(struct icmp) + 8,
433 1.1 christos fin->fin_dlen);
434 1.1 christos break;
435 1.1 christos default :
436 1.1 christos hlen += MIN(sizeof(struct icmp),
437 1.1 christos fin->fin_dlen);
438 1.1 christos break;
439 1.1 christos }
440 1.1 christos }
441 1.1 christos # ifdef USE_INET6
442 1.1 christos else if (p == IPPROTO_ICMPV6) {
443 1.1 christos struct icmp6_hdr *icmp;
444 1.1 christos
445 1.1 christos icmp = (struct icmp6_hdr *)fin->fin_dp;
446 1.1 christos
447 1.1 christos /*
448 1.1 christos * For ICMPV6, if the packet is an error packet, also
449 1.1 christos * include the information about the packet which
450 1.1 christos * caused the error.
451 1.1 christos */
452 1.1 christos if (icmp->icmp6_type < 128) {
453 1.1 christos hlen += MIN(sizeof(struct icmp6_hdr) + 8,
454 1.1 christos fin->fin_dlen);
455 1.1 christos } else {
456 1.1 christos hlen += MIN(sizeof(struct icmp6_hdr),
457 1.1 christos fin->fin_dlen);
458 1.1 christos }
459 1.1 christos }
460 1.1 christos # endif
461 1.1 christos }
462 1.1 christos /*
463 1.1 christos * Get the interface number and name to which this packet is
464 1.1 christos * currently associated.
465 1.1 christos */
466 1.1 christos # if (SOLARIS || defined(__hpux)) && defined(_KERNEL)
467 1.1 christos # if !defined(FW_HOOKS)
468 1.1 christos ipfl.fl_unit = (u_int)ifp->qf_ppa;
469 1.1 christos # endif
470 1.1 christos COPYIFNAME(fin->fin_v, ifp, ipfl.fl_ifname);
471 1.1 christos # else
472 1.1 christos # if (defined(NetBSD) && (NetBSD <= 1991011) && (NetBSD >= 199603)) || \
473 1.1 christos OPENBSD_GE_REV(199603) || defined(linux) || FREEBSD_GE_REV(501113)
474 1.1 christos COPYIFNAME(fin->fin_v, ifp, ipfl.fl_ifname);
475 1.1 christos # else
476 1.1 christos ipfl.fl_unit = (u_int)ifp->if_unit;
477 1.1 christos # if defined(_KERNEL)
478 1.1 christos if ((ipfl.fl_ifname[0] = ifp->if_name[0]))
479 1.1 christos if ((ipfl.fl_ifname[1] = ifp->if_name[1]))
480 1.1 christos if ((ipfl.fl_ifname[2] = ifp->if_name[2]))
481 1.1 christos ipfl.fl_ifname[3] = ifp->if_name[3];
482 1.1 christos # else
483 1.1 christos (void) strncpy(ipfl.fl_ifname, IFNAME(ifp), sizeof(ipfl.fl_ifname));
484 1.1 christos ipfl.fl_ifname[sizeof(ipfl.fl_ifname) - 1] = '\0';
485 1.1 christos # endif
486 1.1 christos # endif
487 1.1 christos # endif /* __hpux || SOLARIS */
488 1.1 christos mlen = fin->fin_plen - hlen;
489 1.1 christos if (!softl->ipl_logall) {
490 1.1 christos mlen = (flags & FR_LOGBODY) ? MIN(mlen, 128) : 0;
491 1.1 christos } else if ((flags & FR_LOGBODY) == 0) {
492 1.1 christos mlen = 0;
493 1.1 christos }
494 1.1 christos if (mlen < 0)
495 1.1 christos mlen = 0;
496 1.1 christos ipfl.fl_plen = (u_char)mlen;
497 1.1 christos ipfl.fl_hlen = (u_char)hlen;
498 1.1 christos ipfl.fl_rule = fin->fin_rule;
499 1.1 christos (void) strncpy(ipfl.fl_group, fin->fin_group, FR_GROUPLEN);
500 1.1 christos if (fin->fin_fr != NULL) {
501 1.1 christos ipfl.fl_loglevel = fin->fin_fr->fr_loglevel;
502 1.1 christos ipfl.fl_logtag = fin->fin_fr->fr_logtag;
503 1.1 christos } else {
504 1.1 christos ipfl.fl_loglevel = 0xffff;
505 1.1 christos ipfl.fl_logtag = FR_NOLOGTAG;
506 1.1 christos }
507 1.1 christos if (fin->fin_nattag != NULL)
508 1.1 christos bcopy(fin->fin_nattag, (void *)&ipfl.fl_nattag,
509 1.1 christos sizeof(ipfl.fl_nattag));
510 1.1 christos ipfl.fl_flags = flags;
511 1.1 christos ipfl.fl_breason = (fin->fin_reason & 0xff);
512 1.1 christos ipfl.fl_dir = fin->fin_out;
513 1.1 christos ipfl.fl_lflags = fin->fin_flx;
514 1.1 christos ipfl.fl_family = fin->fin_family;
515 1.1 christos ptrs[0] = (void *)&ipfl;
516 1.1 christos sizes[0] = sizeof(ipfl);
517 1.1 christos types[0] = 0;
518 1.1 christos # if defined(MENTAT) && defined(_KERNEL)
519 1.1 christos /*
520 1.1 christos * Are we copied from the mblk or an aligned array ?
521 1.1 christos */
522 1.1 christos if (fin->fin_ip == (ip_t *)m->b_rptr) {
523 1.1 christos ptrs[1] = m;
524 1.1 christos sizes[1] = hlen + mlen;
525 1.1 christos types[1] = 1;
526 1.1 christos } else {
527 1.1 christos ptrs[1] = fin->fin_ip;
528 1.1 christos sizes[1] = hlen + mlen;
529 1.1 christos types[1] = 0;
530 1.1 christos }
531 1.1 christos # else
532 1.1 christos ptrs[1] = m;
533 1.1 christos sizes[1] = hlen + mlen;
534 1.1 christos types[1] = 1;
535 1.1 christos # endif /* MENTAT */
536 1.1 christos return ipf_log_items(softc, IPL_LOGIPF, fin, ptrs, sizes, types, 2);
537 1.1 christos }
538 1.1 christos
539 1.1 christos
540 1.1 christos /* ------------------------------------------------------------------------ */
541 1.1 christos /* Function: ipf_log_items */
542 1.1 christos /* Returns: int - 0 == success, -1 == failure */
543 1.1 christos /* Parameters: softc(I) - pointer to main soft context */
544 1.1 christos /* unit(I) - device we are reading from */
545 1.1 christos /* fin(I) - pointer to packet information */
546 1.1 christos /* items(I) - array of pointers to log data */
547 1.1 christos /* itemsz(I) - array of size of valid memory pointed to */
548 1.1 christos /* types(I) - type of data pointed to by items pointers */
549 1.1 christos /* cnt(I) - number of elements in arrays items/itemsz/types */
550 1.1 christos /* */
551 1.1 christos /* Takes an array of parameters and constructs one record to include the */
552 1.1 christos /* miscellaneous packet information, as well as packet data, for reading */
553 1.1 christos /* from the log device. */
554 1.1 christos /* ------------------------------------------------------------------------ */
555 1.1 christos int
556 1.2 christos ipf_log_items(ipf_main_softc_t *softc, int unit, fr_info_t *fin,
557 1.2 christos void **items, size_t *itemsz, int *types, int cnt)
558 1.1 christos {
559 1.1 christos ipf_log_softc_t *softl = softc->ipf_log_soft;
560 1.2 christos char *buf, *ptr;
561 1.1 christos iplog_t *ipl;
562 1.1 christos size_t len;
563 1.1 christos int i;
564 1.1 christos SPL_INT(s);
565 1.1 christos
566 1.1 christos /*
567 1.1 christos * Get the total amount of data to be logged.
568 1.1 christos */
569 1.1 christos for (i = 0, len = sizeof(iplog_t); i < cnt; i++)
570 1.1 christos len += itemsz[i];
571 1.1 christos
572 1.1 christos SPL_NET(s);
573 1.1 christos MUTEX_ENTER(&softl->ipl_mutex[unit]);
574 1.1 christos softl->ipl_counter[unit]++;
575 1.1 christos /*
576 1.1 christos * check that we have space to record this information and can
577 1.1 christos * allocate that much.
578 1.1 christos */
579 1.1 christos if ((softl->ipl_used[unit] + len) > softl->ipl_logsize) {
580 1.1 christos softl->ipl_logfail[unit]++;
581 1.1 christos MUTEX_EXIT(&softl->ipl_mutex[unit]);
582 1.1 christos return -1;
583 1.1 christos }
584 1.1 christos
585 1.2 christos KMALLOCS(buf, char *, len);
586 1.1 christos if (buf == NULL) {
587 1.1 christos softl->ipl_logfail[unit]++;
588 1.1 christos MUTEX_EXIT(&softl->ipl_mutex[unit]);
589 1.1 christos return -1;
590 1.1 christos }
591 1.1 christos ipl = (iplog_t *)buf;
592 1.1 christos ipl->ipl_magic = softl->ipl_magic[unit];
593 1.1 christos ipl->ipl_count = 1;
594 1.1 christos ipl->ipl_seqnum = softl->ipl_counter[unit];
595 1.1 christos ipl->ipl_next = NULL;
596 1.1 christos ipl->ipl_dsize = len;
597 1.1 christos #ifdef _KERNEL
598 1.1 christos GETKTIME(&ipl->ipl_sec);
599 1.1 christos #else
600 1.1 christos ipl->ipl_sec = 0;
601 1.1 christos ipl->ipl_usec = 0;
602 1.1 christos #endif
603 1.1 christos
604 1.1 christos /*
605 1.1 christos * Loop through all the items to be logged, copying each one to the
606 1.1 christos * buffer. Use bcopy for normal data or the mb_t copyout routine.
607 1.1 christos */
608 1.1 christos for (i = 0, ptr = buf + sizeof(*ipl); i < cnt; i++) {
609 1.1 christos if (types[i] == 0) {
610 1.2 christos memcpy(ptr, items[i], itemsz[i]);
611 1.1 christos } else if (types[i] == 1) {
612 1.1 christos COPYDATA(items[i], 0, itemsz[i], ptr);
613 1.1 christos }
614 1.1 christos ptr += itemsz[i];
615 1.1 christos }
616 1.1 christos /*
617 1.1 christos * Check to see if this log record has a CRC which matches the last
618 1.1 christos * record logged. If it does, just up the count on the previous one
619 1.1 christos * rather than create a new one.
620 1.1 christos */
621 1.1 christos if (softl->ipl_suppress) {
622 1.1 christos if ((fin != NULL) && (fin->fin_off == 0)) {
623 1.1 christos if ((softl->ipll[unit] != NULL) &&
624 1.1 christos (fin->fin_crc == softl->ipl_crc[unit].fin_crc) &&
625 1.1 christos bcmp((char *)fin, (char *)&softl->ipl_crc[unit],
626 1.1 christos FI_LCSIZE) == 0) {
627 1.1 christos softl->ipll[unit]->ipl_count++;
628 1.1 christos MUTEX_EXIT(&softl->ipl_mutex[unit]);
629 1.1 christos SPL_X(s);
630 1.1 christos KFREES(buf, len);
631 1.1 christos return 0;
632 1.1 christos }
633 1.1 christos bcopy((char *)fin, (char *)&softl->ipl_crc[unit],
634 1.1 christos FI_LCSIZE);
635 1.1 christos softl->ipl_crc[unit].fin_crc = fin->fin_crc;
636 1.1 christos } else
637 1.1 christos bzero((char *)&softl->ipl_crc[unit], FI_CSIZE);
638 1.1 christos }
639 1.1 christos
640 1.1 christos /*
641 1.1 christos * advance the log pointer to the next empty record and deduct the
642 1.1 christos * amount of space we're going to use.
643 1.1 christos */
644 1.1 christos softl->ipl_logok[unit]++;
645 1.1 christos softl->ipll[unit] = ipl;
646 1.1 christos *softl->iplh[unit] = ipl;
647 1.1 christos softl->iplh[unit] = &ipl->ipl_next;
648 1.1 christos softl->ipl_used[unit] += len;
649 1.1 christos
650 1.1 christos /*
651 1.1 christos * Now that the log record has been completed and added to the queue,
652 1.1 christos * wake up any listeners who may want to read it.
653 1.1 christos */
654 1.1 christos # if SOLARIS && defined(_KERNEL)
655 1.1 christos cv_signal(&softl->ipl_wait[unit]);
656 1.1 christos MUTEX_EXIT(&softl->ipl_mutex[unit]);
657 1.1 christos pollwakeup(&softc->ipf_poll_head[unit], POLLRDNORM);
658 1.1 christos # else
659 1.1 christos MUTEX_EXIT(&softl->ipl_mutex[unit]);
660 1.1 christos WAKEUP(softl->iplh, unit);
661 1.1 christos POLLWAKEUP(unit);
662 1.1 christos # endif
663 1.1 christos SPL_X(s);
664 1.1 christos # ifdef IPL_SELECT
665 1.1 christos iplog_input_ready(unit);
666 1.1 christos # endif
667 1.1 christos return 0;
668 1.1 christos }
669 1.1 christos
670 1.1 christos
671 1.1 christos /* ------------------------------------------------------------------------ */
672 1.1 christos /* Function: ipf_log_read */
673 1.1 christos /* Returns: int - 0 == success, else error value. */
674 1.1 christos /* Parameters: softc(I) - pointer to main soft context */
675 1.1 christos /* unit(I) - device we are reading from */
676 1.1 christos /* uio(O) - pointer to information about where to store data */
677 1.1 christos /* */
678 1.1 christos /* Called to handle a read on an IPFilter device. Returns only complete */
679 1.1 christos /* log messages - will not partially copy a log record out to userland. */
680 1.1 christos /* */
681 1.1 christos /* NOTE: This function will block and wait for a signal to return data if */
682 1.1 christos /* there is none present. Asynchronous I/O is not implemented. */
683 1.1 christos /* ------------------------------------------------------------------------ */
684 1.1 christos int
685 1.2 christos ipf_log_read(ipf_main_softc_t *softc, minor_t unit, struct uio *uio)
686 1.1 christos {
687 1.1 christos ipf_log_softc_t *softl = softc->ipf_log_soft;
688 1.1 christos size_t dlen, copied;
689 1.1 christos int error = 0;
690 1.1 christos iplog_t *ipl;
691 1.1 christos SPL_INT(s);
692 1.1 christos
693 1.3 darrenr if (softl->ipl_log_init == 0) {
694 1.3 darrenr IPFERROR(40007);
695 1.3 darrenr return 0;
696 1.3 darrenr }
697 1.3 darrenr
698 1.1 christos /*
699 1.1 christos * Sanity checks. Make sure the minor # is valid and we're copying
700 1.1 christos * a valid chunk of data.
701 1.1 christos */
702 1.1 christos if (IPL_LOGMAX < unit) {
703 1.1 christos IPFERROR(40001);
704 1.1 christos return ENXIO;
705 1.1 christos }
706 1.1 christos if (uio->uio_resid == 0)
707 1.1 christos return 0;
708 1.1 christos
709 1.1 christos if (uio->uio_resid < sizeof(iplog_t)) {
710 1.1 christos IPFERROR(40002);
711 1.1 christos return EINVAL;
712 1.1 christos }
713 1.1 christos if (uio->uio_resid > softl->ipl_logsize) {
714 1.1 christos IPFERROR(40005);
715 1.1 christos return EINVAL;
716 1.1 christos }
717 1.1 christos
718 1.1 christos /*
719 1.1 christos * Lock the log so we can snapshot the variables. Wait for a signal
720 1.1 christos * if the log is empty.
721 1.1 christos */
722 1.1 christos SPL_NET(s);
723 1.1 christos MUTEX_ENTER(&softl->ipl_mutex[unit]);
724 1.3 darrenr softl->ipl_readers[unit]++;
725 1.1 christos
726 1.3 darrenr while (softl->ipl_log_init == 1 && softl->iplt[unit] == NULL) {
727 1.1 christos # if SOLARIS && defined(_KERNEL)
728 1.3 darrenr if (!cv_wait_sig(&softl->ipl_wait[unit],
729 1.3 darrenr &softl->ipl_mutex[unit].ipf_lk)) {
730 1.3 darrenr softl->ipl_readers[unit]--;
731 1.1 christos MUTEX_EXIT(&softl->ipl_mutex[unit]);
732 1.1 christos IPFERROR(40003);
733 1.1 christos return EINTR;
734 1.1 christos }
735 1.1 christos # else
736 1.1 christos # if defined(__hpux) && defined(_KERNEL)
737 1.1 christos lock_t *l;
738 1.1 christos
739 1.1 christos # ifdef IPL_SELECT
740 1.1 christos if (uio->uio_fpflags & (FNBLOCK|FNDELAY)) {
741 1.1 christos /* this is no blocking system call */
742 1.3 darrenr softl->ipl_readers[unit]--;
743 1.1 christos MUTEX_EXIT(&softl->ipl_mutex[unit]);
744 1.1 christos return 0;
745 1.1 christos }
746 1.1 christos # endif
747 1.1 christos
748 1.1 christos MUTEX_EXIT(&softl->ipl_mutex[unit]);
749 1.1 christos l = get_sleep_lock(&softl->iplh[unit]);
750 1.1 christos error = sleep(&softl->iplh[unit], PZERO+1);
751 1.1 christos spinunlock(l);
752 1.1 christos # else
753 1.1 christos # if defined(__osf__) && defined(_KERNEL)
754 1.1 christos error = mpsleep(&softl->iplh[unit], PSUSP|PCATCH, "ipfread", 0,
755 1.1 christos &softl->ipl_mutex, MS_LOCK_SIMPLE);
756 1.1 christos # else
757 1.1 christos MUTEX_EXIT(&softl->ipl_mutex[unit]);
758 1.1 christos SPL_X(s);
759 1.1 christos error = SLEEP(unit + softl->iplh, "ipl sleep");
760 1.1 christos # endif /* __osf__ */
761 1.1 christos # endif /* __hpux */
762 1.3 darrenr SPL_NET(s);
763 1.3 darrenr MUTEX_ENTER(&softl->ipl_mutex[unit]);
764 1.1 christos if (error) {
765 1.3 darrenr softl->ipl_readers[unit]--;
766 1.3 darrenr MUTEX_EXIT(&softl->ipl_mutex[unit]);
767 1.1 christos IPFERROR(40004);
768 1.1 christos return error;
769 1.1 christos }
770 1.1 christos # endif /* SOLARIS */
771 1.1 christos }
772 1.3 darrenr if (softl->ipl_log_init != 1) {
773 1.3 darrenr softl->ipl_readers[unit]--;
774 1.3 darrenr MUTEX_EXIT(&softl->ipl_mutex[unit]);
775 1.3 darrenr IPFERROR(40008);
776 1.3 darrenr return EIO;
777 1.3 darrenr }
778 1.1 christos
779 1.1 christos # if (defined(BSD) && (BSD >= 199101)) || defined(__FreeBSD__) || \
780 1.1 christos defined(__osf__)
781 1.1 christos uio->uio_rw = UIO_READ;
782 1.1 christos # endif
783 1.1 christos
784 1.1 christos for (copied = 0; (ipl = softl->iplt[unit]) != NULL; copied += dlen) {
785 1.1 christos dlen = ipl->ipl_dsize;
786 1.1 christos if (dlen > uio->uio_resid)
787 1.1 christos break;
788 1.1 christos /*
789 1.1 christos * Don't hold the mutex over the uiomove call.
790 1.1 christos */
791 1.1 christos softl->iplt[unit] = ipl->ipl_next;
792 1.1 christos softl->ipl_used[unit] -= dlen;
793 1.1 christos MUTEX_EXIT(&softl->ipl_mutex[unit]);
794 1.1 christos SPL_X(s);
795 1.2 christos error = UIOMOVE((void *)ipl, dlen, UIO_READ, uio);
796 1.1 christos if (error) {
797 1.1 christos SPL_NET(s);
798 1.1 christos MUTEX_ENTER(&softl->ipl_mutex[unit]);
799 1.1 christos IPFERROR(40006);
800 1.1 christos ipl->ipl_next = softl->iplt[unit];
801 1.1 christos softl->iplt[unit] = ipl;
802 1.1 christos softl->ipl_used[unit] += dlen;
803 1.1 christos break;
804 1.1 christos }
805 1.1 christos MUTEX_ENTER(&softl->ipl_mutex[unit]);
806 1.2 christos KFREES((void *)ipl, dlen);
807 1.1 christos SPL_NET(s);
808 1.1 christos }
809 1.1 christos if (!softl->iplt[unit]) {
810 1.1 christos softl->ipl_used[unit] = 0;
811 1.1 christos softl->iplh[unit] = &softl->iplt[unit];
812 1.1 christos softl->ipll[unit] = NULL;
813 1.1 christos }
814 1.1 christos
815 1.3 darrenr softl->ipl_readers[unit]--;
816 1.1 christos MUTEX_EXIT(&softl->ipl_mutex[unit]);
817 1.1 christos SPL_X(s);
818 1.1 christos return error;
819 1.1 christos }
820 1.1 christos
821 1.1 christos
822 1.1 christos /* ------------------------------------------------------------------------ */
823 1.1 christos /* Function: ipf_log_clear */
824 1.1 christos /* Returns: int - number of log bytes cleared. */
825 1.1 christos /* Parameters: softc(I) - pointer to main soft context */
826 1.1 christos /* unit(I) - device we are reading from */
827 1.1 christos /* */
828 1.1 christos /* Deletes all queued up log records for a given output device. */
829 1.1 christos /* ------------------------------------------------------------------------ */
830 1.1 christos int
831 1.2 christos ipf_log_clear(ipf_main_softc_t *softc, minor_t unit)
832 1.1 christos {
833 1.1 christos ipf_log_softc_t *softl = softc->ipf_log_soft;
834 1.1 christos iplog_t *ipl;
835 1.1 christos int used;
836 1.1 christos SPL_INT(s);
837 1.1 christos
838 1.1 christos SPL_NET(s);
839 1.1 christos MUTEX_ENTER(&softl->ipl_mutex[unit]);
840 1.1 christos while ((ipl = softl->iplt[unit]) != NULL) {
841 1.1 christos softl->iplt[unit] = ipl->ipl_next;
842 1.2 christos KFREES((void *)ipl, ipl->ipl_dsize);
843 1.1 christos }
844 1.1 christos softl->iplh[unit] = &softl->iplt[unit];
845 1.1 christos softl->ipll[unit] = NULL;
846 1.1 christos used = softl->ipl_used[unit];
847 1.1 christos softl->ipl_used[unit] = 0;
848 1.1 christos bzero((char *)&softl->ipl_crc[unit], FI_CSIZE);
849 1.1 christos MUTEX_EXIT(&softl->ipl_mutex[unit]);
850 1.1 christos SPL_X(s);
851 1.1 christos return used;
852 1.1 christos }
853 1.1 christos
854 1.1 christos
855 1.1 christos /* ------------------------------------------------------------------------ */
856 1.1 christos /* Function: ipf_log_canread */
857 1.1 christos /* Returns: int - 0 == no data to read, 1 = data present */
858 1.1 christos /* Parameters: softc(I) - pointer to main soft context */
859 1.1 christos /* unit(I) - device we are reading from */
860 1.1 christos /* */
861 1.1 christos /* Returns an indication of whether or not there is data present in the */
862 1.1 christos /* current buffer for the selected ipf device. */
863 1.1 christos /* ------------------------------------------------------------------------ */
864 1.1 christos int
865 1.2 christos ipf_log_canread(ipf_main_softc_t *softc, int unit)
866 1.1 christos {
867 1.1 christos ipf_log_softc_t *softl = softc->ipf_log_soft;
868 1.1 christos
869 1.1 christos return softl->iplt[unit] != NULL;
870 1.1 christos }
871 1.1 christos
872 1.1 christos
873 1.1 christos /* ------------------------------------------------------------------------ */
874 1.1 christos /* Function: ipf_log_canread */
875 1.1 christos /* Returns: int - 0 == no data to read, 1 = data present */
876 1.1 christos /* Parameters: softc(I) - pointer to main soft context */
877 1.1 christos /* unit(I) - device we are reading from */
878 1.1 christos /* */
879 1.1 christos /* Returns how many bytes are currently held in log buffers for the */
880 1.1 christos /* selected ipf device. */
881 1.1 christos /* ------------------------------------------------------------------------ */
882 1.1 christos int
883 1.2 christos ipf_log_bytesused(ipf_main_softc_t *softc, int unit)
884 1.1 christos {
885 1.1 christos ipf_log_softc_t *softl = softc->ipf_log_soft;
886 1.1 christos
887 1.1 christos if (softl == NULL)
888 1.1 christos return 0;
889 1.1 christos
890 1.1 christos return softl->ipl_used[unit];
891 1.1 christos }
892 1.1 christos
893 1.1 christos
894 1.1 christos /* ------------------------------------------------------------------------ */
895 1.1 christos /* Function: ipf_log_failures */
896 1.1 christos /* Returns: U_QUAD_T - number of log failures */
897 1.1 christos /* Parameters: softc(I) - pointer to main soft context */
898 1.1 christos /* unit(I) - device we are reading from */
899 1.1 christos /* */
900 1.1 christos /* Returns how many times we've tried to log a packet but failed to do so */
901 1.1 christos /* for the selected ipf device. */
902 1.1 christos /* ------------------------------------------------------------------------ */
903 1.1 christos u_long
904 1.2 christos ipf_log_failures(ipf_main_softc_t *softc, int unit)
905 1.1 christos {
906 1.1 christos ipf_log_softc_t *softl = softc->ipf_log_soft;
907 1.1 christos
908 1.1 christos if (softl == NULL)
909 1.1 christos return 0;
910 1.1 christos
911 1.1 christos return softl->ipl_logfail[unit];
912 1.1 christos }
913 1.1 christos
914 1.1 christos
915 1.1 christos /* ------------------------------------------------------------------------ */
916 1.1 christos /* Function: ipf_log_logok */
917 1.1 christos /* Returns: U_QUAD_T - number of packets logged */
918 1.1 christos /* Parameters: softc(I) - pointer to main soft context */
919 1.1 christos /* unit(I) - device we are reading from */
920 1.1 christos /* */
921 1.1 christos /* Returns how many times we've successfully logged a packet for the */
922 1.1 christos /* selected ipf device. */
923 1.1 christos /* ------------------------------------------------------------------------ */
924 1.1 christos u_long
925 1.2 christos ipf_log_logok(ipf_main_softc_t *softc, int unit)
926 1.1 christos {
927 1.1 christos ipf_log_softc_t *softl = softc->ipf_log_soft;
928 1.1 christos
929 1.1 christos if (softl == NULL)
930 1.1 christos return 0;
931 1.1 christos
932 1.1 christos return softl->ipl_logok[unit];
933 1.1 christos }
934 1.1 christos #endif /* IPFILTER_LOG */
935