Lines Matching refs:fp

19 void	printfr(fp, iocfunc)  in printfr()  argument
20 struct frentry *fp; in printfr()
31 type = fp->fr_type & ~FR_T_BUILTIN;
33 if ((fp->fr_type & FR_T_BUILTIN) != 0)
36 if (fp->fr_collect != 0)
37 printf("%u ", fp->fr_collect);
39 if (fp->fr_type == FR_T_CALLFUNC) {
41 } else if (fp->fr_func != NULL) {
43 if ((fp->fr_flags & FR_CALLNOW) != 0)
45 s = kvatoname(fp->fr_func, iocfunc);
46 printf(" %s/%u", s ? s : "?", fp->fr_arg);
47 } else if (FR_ISPASS(fp->fr_flags))
49 else if (FR_ISBLOCK(fp->fr_flags)) {
51 if (fp->fr_flags & FR_RETICMP) {
52 if ((fp->fr_flags & FR_RETMASK) == FR_FAKEICMP)
54 else if ((fp->fr_flags & FR_RETMASK) == FR_RETICMP)
56 if (fp->fr_icode) {
57 if (fp->fr_icode <= MAX_ICMPCODE)
59 icmpcodes[(int)fp->fr_icode]);
61 printf("(%d)", fp->fr_icode);
63 } else if ((fp->fr_flags & FR_RETMASK) == FR_RETRST)
65 } else if ((fp->fr_flags & FR_LOGMASK) == FR_LOG) {
66 printlog(fp);
67 } else if (FR_ISACCOUNT(fp->fr_flags))
69 else if (FR_ISAUTH(fp->fr_flags))
71 else if (FR_ISPREAUTH(fp->fr_flags))
73 else if (FR_ISNOMATCH(fp->fr_flags))
75 else if (FR_ISSKIP(fp->fr_flags))
76 printf("skip %u", fp->fr_arg);
78 printf("%x", fp->fr_flags);
81 if (fp->fr_flags & FR_OUTQUE)
86 if (((fp->fr_flags & FR_LOGB) == FR_LOGB) ||
87 ((fp->fr_flags & FR_LOGP) == FR_LOGP)) {
88 printlog(fp);
92 if (fp->fr_flags & FR_QUICK)
95 if (*fp->fr_ifname) {
96 printifname("on ", fp->fr_ifname, fp->fr_ifa);
97 if (*fp->fr_ifnames[1] && strcmp(fp->fr_ifnames[1], "*"))
98 printifname(",", fp->fr_ifnames[1], fp->fr_ifas[1]);
102 if (*fp->fr_dif.fd_ifname || (fp->fr_flags & FR_DUP))
103 print_toif("dup-to", &fp->fr_dif);
104 if (*fp->fr_tif.fd_ifname)
105 print_toif("to", &fp->fr_tif);
106 if (*fp->fr_rif.fd_ifname)
107 print_toif("reply-to", &fp->fr_rif);
108 if (fp->fr_flags & FR_FASTROUTE)
111 if ((*fp->fr_ifnames[2] && strcmp(fp->fr_ifnames[2], "*")) ||
112 (*fp->fr_ifnames[3] && strcmp(fp->fr_ifnames[3], "*"))) {
113 if (fp->fr_flags & FR_OUTQUE)
118 if (*fp->fr_ifnames[2]) {
119 printifname("", fp->fr_ifnames[2],
120 fp->fr_ifas[2]);
123 if (*fp->fr_ifnames[3]) {
124 printifname(",", fp->fr_ifnames[3],
125 fp->fr_ifas[3]);
131 if (fp->fr_mip.fi_tos)
132 printf("tos %#x ", fp->fr_tos);
133 if (fp->fr_mip.fi_ttl)
134 printf("ttl %d ", fp->fr_ttl);
135 if (fp->fr_flx & FI_TCPUDP) {
138 } else if (fp->fr_mip.fi_p) {
139 pr = fp->fr_ip.fi_p;
150 printf("from %s", fp->fr_flags & FR_NOTSRCIP ? "!" : "");
151 printaddr(fp->fr_v, fp->fr_satype, fp->fr_ifname,
152 &fp->fr_src.s_addr, &fp->fr_smsk.s_addr);
153 if (fp->fr_scmp)
154 printportcmp(pr, &fp->fr_tuc.ftu_src);
156 printf(" to %s", fp->fr_flags & FR_NOTDSTIP ? "!" : "");
157 printaddr(fp->fr_v, fp->fr_datype, fp->fr_ifname,
158 &fp->fr_dst.s_addr, &fp->fr_dmsk.s_addr);
159 if (fp->fr_dcmp)
160 printportcmp(pr, &fp->fr_tuc.ftu_dst);
162 if ((fp->fr_proto == IPPROTO_ICMP
164 || fp->fr_proto == IPPROTO_ICMPV6
166 ) && fp->fr_icmpm) {
167 int type = fp->fr_icmp, code;
169 type = ntohs(fp->fr_icmp);
173 icmptypes[type] && fp->fr_proto == IPPROTO_ICMP)
177 if (ntohs(fp->fr_icmpm) & 0xff)
180 if ((fp->fr_proto == IPPROTO_TCP) &&
181 (fp->fr_tcpf || fp->fr_tcpfm)) {
183 if (fp->fr_tcpf & ~TCPF_ALL)
184 printf("0x%x", fp->fr_tcpf);
187 if (fp->fr_tcpf & *t)
189 if (fp->fr_tcpfm) {
191 if (fp->fr_tcpfm & ~TCPF_ALL)
192 printf("0x%x", fp->fr_tcpfm);
196 if (fp->fr_tcpfm & *t)
204 printf("bpf-v%d { \"", fp->fr_v);
205 i = fp->fr_dsize / sizeof(*fb);
207 for (fb = fp->fr_data, s = ""; i; i--, fb++, s = " ")
215 printf("call function at %p", fp->fr_data);
217 printf("[unknown filter type %#x]", fp->fr_type);
221 ((fp->fr_flx & FI_WITH) || (fp->fr_mflx & FI_WITH) ||
222 fp->fr_optbits || fp->fr_optmask ||
223 fp->fr_secbits || fp->fr_secmask)) {
227 if (fp->fr_optbits || fp->fr_optmask ||
228 fp->fr_secbits || fp->fr_secmask) {
229 sec[0] = fp->fr_secmask;
230 sec[1] = fp->fr_secbits;
231 if (fp->fr_v == 4)
232 optprint(sec, fp->fr_optmask, fp->fr_optbits);
235 optprintv6(sec, fp->fr_optmask,
236 fp->fr_optbits);
238 } else if (fp->fr_mflx & FI_OPTIONS) {
240 if (!(fp->fr_flx & FI_OPTIONS))
245 if (fp->fr_mflx & FI_SHORT) {
247 if (!(fp->fr_flx & FI_SHORT))
252 if (fp->fr_mflx & FI_FRAG) {
254 if (!(fp->fr_flx & FI_FRAG))
259 if (fp->fr_mflx & FI_FRAGBODY) {
261 if (!(fp->fr_flx & FI_FRAGBODY))
266 if (fp->fr_mflx & FI_NATED) {
268 if (!(fp->fr_flx & FI_NATED))
273 if (fp->fr_mflx & FI_LOWTTL) {
275 if (!(fp->fr_flx & FI_LOWTTL))
280 if (fp->fr_mflx & FI_BAD) {
282 if (!(fp->fr_flx & FI_BAD))
287 if (fp->fr_mflx & FI_BADSRC) {
289 if (!(fp->fr_flx & FI_BADSRC))
294 if (fp->fr_mflx & FI_BADNAT) {
296 if (!(fp->fr_flx & FI_BADNAT))
301 if (fp->fr_mflx & FI_OOW) {
303 if (!(fp->fr_flx & FI_OOW))
307 if (fp->fr_mflx & FI_MULTICAST) {
309 if (!(fp->fr_flx & FI_MULTICAST))
314 if (fp->fr_mflx & FI_BROADCAST) {
316 if (!(fp->fr_flx & FI_BROADCAST))
321 if (fp->fr_mflx & FI_MBCAST) {
323 if (!(fp->fr_flx & FI_MBCAST))
328 if (fp->fr_mflx & FI_STATE) {
330 if (!(fp->fr_flx & FI_STATE))
337 if (fp->fr_flags & FR_KEEPSTATE) {
339 if ((fp->fr_flags & (FR_STSTRICT|FR_NEWISN|FR_NOICMPERR|FR_STATESYNC)) ||
340 (fp->fr_statemax != 0) || (fp->fr_age[0] != 0)) {
343 if (fp->fr_statemax != 0) {
344 printf("limit %u", fp->fr_statemax);
347 if (fp->fr_flags & FR_STSTRICT) {
351 if (fp->fr_flags & FR_NEWISN) {
355 if (fp->fr_flags & FR_NOICMPERR) {
359 if (fp->fr_flags & FR_STATESYNC) {
363 if (fp->fr_age[0] || fp->fr_age[1])
364 printf("%sage %d/%d", comma, fp->fr_age[0],
365 fp->fr_age[1]);
369 if (fp->fr_flags & FR_KEEPFRAG) {
371 if (fp->fr_flags & (FR_FRSTRICT)) {
373 if (fp->fr_flags & FR_FRSTRICT)
379 if (fp->fr_isc != (struct ipscan *)-1) {
380 if (fp->fr_isctag[0])
381 printf(" scan %s", fp->fr_isctag);
385 if (*fp->fr_grhead != '\0')
386 printf(" head %s", fp->fr_grhead);
387 if (*fp->fr_group != '\0')
388 printf(" group %s", fp->fr_group);
389 if (fp->fr_logtag != FR_NOLOGTAG || *fp->fr_nattag.ipt_tag) {
393 if (fp->fr_logtag != FR_NOLOGTAG) {
394 printf("log=%u", fp->fr_logtag);
397 if (*fp->fr_nattag.ipt_tag) {
399 fp->fr_nattag.ipt_tag);
403 if (fp->fr_pps)
404 printf(" pps %d", fp->fr_pps);