3 static void printport __P((int *));
4 static void printhosts __P((int *));
5 static void printsingle __P((int *));
6 static void printhostsv6 __P((int *));
12 int i, nelems, j, not;
17 for (i = 1; i < nelems; ) {
18 ipfe = (ipfexp_t *)(array + i);
19 if (ipfe->ipfe_cmd == IPF_EXP_END)
24 switch (ipfe->ipfe_cmd)
26 case IPF_EXP_IP_ADDR :
27 PRINTF("ip.addr %s= ", not ? "!" : "");
28 printhosts(array + i);
32 PRINTF("ip.p %s= ", not ? "!" : "");
33 printsingle(array + i);
36 case IPF_EXP_IP_SRCADDR :
37 PRINTF("ip.src %s= ", not ? "!" : "");
38 printhosts(array + i);
41 case IPF_EXP_IP_DSTADDR :
42 PRINTF("ip.dst %s= ", not ? "!" : "");
43 printhosts(array + i);
46 case IPF_EXP_TCP_PORT :
47 PRINTF("tcp.port %s= ", not ? "!" : "");
51 case IPF_EXP_TCP_DPORT :
52 PRINTF("tcp.dport %s= ", not ? "!" : "");
56 case IPF_EXP_TCP_SPORT :
57 PRINTF("tcp.sport %s= ", not ? "!" : "");
61 case IPF_EXP_TCP_FLAGS :
62 PRINTF("tcp.flags %s= ", not ? "!" : "");
64 for (j = 0; j < ipfe->ipfe_narg; ) {
65 printtcpflags(array[i + 4], array[i + 5]);
72 case IPF_EXP_UDP_PORT :
73 PRINTF("udp.port %s= ", not ? "!" : "");
77 case IPF_EXP_UDP_DPORT :
78 PRINTF("udp.dport %s= ", not ? "!" : "");
82 case IPF_EXP_UDP_SPORT :
83 PRINTF("udp.sport %s= ", not ? "!" : "");
87 case IPF_EXP_IDLE_GT :
88 PRINTF("idle-gt %s= ", not ? "!" : "");
89 printsingle(array + i);
92 case IPF_EXP_TCP_STATE :
93 PRINTF("tcp-state %s= ", not ? "!" : "");
94 printsingle(array + i);
98 case IPF_EXP_IP6_ADDR :
99 PRINTF("ip6.addr %s= ", not ? "!" : "");
100 printhostsv6(array + i);
103 case IPF_EXP_IP6_SRCADDR :
104 PRINTF("ip6.src %s= ", not ? "!" : "");
105 printhostsv6(array + i);
108 case IPF_EXP_IP6_DSTADDR :
109 PRINTF("ip6.dst %s= ", not ? "!" : "");
110 printhostsv6(array + i);
118 PRINTF("#%#x,len=%d;",
119 ipfe->ipfe_cmd, ipfe->ipfe_narg);
122 if (array[i] != IPF_EXP_END)
125 i += ipfe->ipfe_size;
126 if (array[i] != IPF_EXP_END)
136 ipfexp_t *ipfe = (ipfexp_t *)array;
139 for (i = 0; i < ipfe->ipfe_narg; ) {
140 PRINTF("%d", array[i + 4]);
142 if (i < ipfe->ipfe_narg)
152 ipfexp_t *ipfe = (ipfexp_t *)array;
155 for (i = 0; i < ipfe->ipfe_narg; ) {
156 PRINTF("%d", ntohs(array[i + 4]));
158 if (i < ipfe->ipfe_narg)
168 ipfexp_t *ipfe = (ipfexp_t *)array;
171 for (i = 0, j = 0; i < ipfe->ipfe_narg; j++) {
172 printhostmask(AF_INET, (u_32_t *)ipfe->ipfe_arg0 + j * 2,
173 (u_32_t *)ipfe->ipfe_arg0 + j * 2 + 1);
175 if (i < ipfe->ipfe_narg)
186 ipfexp_t *ipfe = (ipfexp_t *)array;
189 for (i = 4, j= 0; i < ipfe->ipfe_size; j++) {
190 printhostmask(AF_INET6, (u_32_t *)ipfe->ipfe_arg0 + j * 8,
191 (u_32_t *)ipfe->ipfe_arg0 + j * 8 + 4);
193 if (i < ipfe->ipfe_size)