3 static void printport __P((int *));
4 static void printhosts __P((int *));
5 static void printsingle __P((int *));
7 static void printhostsv6 __P((int *));
14 int i, nelems, j, not;
19 for (i = 1; i < nelems; ) {
20 ipfe = (ipfexp_t *)(array + i);
21 if (ipfe->ipfe_cmd == IPF_EXP_END)
26 switch (ipfe->ipfe_cmd)
28 case IPF_EXP_IP_ADDR :
29 PRINTF("ip.addr %s= ", not ? "!" : "");
30 printhosts(array + i);
34 PRINTF("ip.p %s= ", not ? "!" : "");
35 printsingle(array + i);
38 case IPF_EXP_IP_SRCADDR :
39 PRINTF("ip.src %s= ", not ? "!" : "");
40 printhosts(array + i);
43 case IPF_EXP_IP_DSTADDR :
44 PRINTF("ip.dst %s= ", not ? "!" : "");
45 printhosts(array + i);
48 case IPF_EXP_TCP_PORT :
49 PRINTF("tcp.port %s= ", not ? "!" : "");
53 case IPF_EXP_TCP_DPORT :
54 PRINTF("tcp.dport %s= ", not ? "!" : "");
58 case IPF_EXP_TCP_SPORT :
59 PRINTF("tcp.sport %s= ", not ? "!" : "");
63 case IPF_EXP_TCP_FLAGS :
64 PRINTF("tcp.flags %s= ", not ? "!" : "");
66 for (j = 0; j < ipfe->ipfe_narg; ) {
67 printtcpflags(array[i + 4], array[i + 5]);
74 case IPF_EXP_UDP_PORT :
75 PRINTF("udp.port %s= ", not ? "!" : "");
79 case IPF_EXP_UDP_DPORT :
80 PRINTF("udp.dport %s= ", not ? "!" : "");
84 case IPF_EXP_UDP_SPORT :
85 PRINTF("udp.sport %s= ", not ? "!" : "");
89 case IPF_EXP_IDLE_GT :
90 PRINTF("idle-gt %s= ", not ? "!" : "");
91 printsingle(array + i);
94 case IPF_EXP_TCP_STATE :
95 PRINTF("tcp-state %s= ", not ? "!" : "");
96 printsingle(array + i);
100 case IPF_EXP_IP6_ADDR :
101 PRINTF("ip6.addr %s= ", not ? "!" : "");
102 printhostsv6(array + i);
105 case IPF_EXP_IP6_SRCADDR :
106 PRINTF("ip6.src %s= ", not ? "!" : "");
107 printhostsv6(array + i);
110 case IPF_EXP_IP6_DSTADDR :
111 PRINTF("ip6.dst %s= ", not ? "!" : "");
112 printhostsv6(array + i);
120 PRINTF("#%#x,len=%d;",
121 ipfe->ipfe_cmd, ipfe->ipfe_narg);
124 if (array[i] != IPF_EXP_END)
127 i += ipfe->ipfe_size;
128 if (array[i] != IPF_EXP_END)
138 ipfexp_t *ipfe = (ipfexp_t *)array;
141 for (i = 0; i < ipfe->ipfe_narg; ) {
142 PRINTF("%d", array[i + 4]);
144 if (i < ipfe->ipfe_narg)
154 ipfexp_t *ipfe = (ipfexp_t *)array;
157 for (i = 0; i < ipfe->ipfe_narg; ) {
158 PRINTF("%d", ntohs(array[i + 4]));
160 if (i < ipfe->ipfe_narg)
170 ipfexp_t *ipfe = (ipfexp_t *)array;
173 for (i = 0, j = 0; i < ipfe->ipfe_narg; j++) {
174 printhostmask(AF_INET, (u_32_t *)ipfe->ipfe_arg0 + j * 2,
175 (u_32_t *)ipfe->ipfe_arg0 + j * 2 + 1);
177 if (i < ipfe->ipfe_narg)
188 ipfexp_t *ipfe = (ipfexp_t *)array;
191 for (i = 4, j= 0; i < ipfe->ipfe_size; j++) {
192 printhostmask(AF_INET6, (u_32_t *)ipfe->ipfe_arg0 + j * 8,
193 (u_32_t *)ipfe->ipfe_arg0 + j * 8 + 4);
195 if (i < ipfe->ipfe_size)