Lines Matching full:np
20 printnat(ipnat_t *np, int opts) in printnat() argument
27 if (np->in_v[0] == 4) in printnat()
30 else if (np->in_v[0] == 6) in printnat()
36 if (np->in_flags & IPN_NO) in printnat()
39 switch (np->in_redir) in printnat()
43 proto = np->in_pr[0]; in printnat()
47 proto = np->in_pr[1]; in printnat()
51 proto = np->in_pr[0]; in printnat()
55 proto = np->in_pr[1]; in printnat()
59 proto = np->in_pr[0]; in printnat()
63 proto = np->in_pr[1]; in printnat()
67 proto = np->in_pr[0]; in printnat()
71 proto = np->in_pr[1]; in printnat()
75 proto = np->in_pr[1]; in printnat()
79 proto = np->in_pr[0]; in printnat()
83 np->in_redir); in printnat()
84 proto = np->in_pr[0]; in printnat()
90 base = np->in_names; in printnat()
91 if (!strcmp(base + np->in_ifnames[0], "-")) in printnat()
92 PRINTF(" \"%s\"", base + np->in_ifnames[0]); in printnat()
94 PRINTF(" %s", base + np->in_ifnames[0]); in printnat()
95 if ((np->in_ifnames[1] != -1) && in printnat()
96 (strcmp(base + np->in_ifnames[0], base + np->in_ifnames[1]) != 0)) { in printnat()
97 if (!strcmp(base + np->in_ifnames[1], "-")) in printnat()
98 PRINTF(",\"%s\"", base + np->in_ifnames[1]); in printnat()
100 PRINTF(",%s", base + np->in_ifnames[1]); in printnat()
107 if (np->in_redir & (NAT_REWRITE|NAT_ENCAP|NAT_DIVERTUDP)) { in printnat()
108 if ((proto != 0) || (np->in_flags & IPN_TCPUDP)) { in printnat()
110 printproto(pr, proto, np); in printnat()
115 if (np->in_flags & IPN_FILTER) { in printnat()
116 if (np->in_flags & IPN_NOTSRC) in printnat()
119 printnataddr(np->in_v[0], np->in_names, &np->in_osrc, in printnat()
120 np->in_ifnames[0]); in printnat()
121 if (np->in_scmp) in printnat()
122 printportcmp(proto, &np->in_tuc.ftu_src); in printnat()
124 if (np->in_flags & IPN_NOTDST) in printnat()
127 printnataddr(np->in_v[0], np->in_names, &np->in_odst, in printnat()
128 np->in_ifnames[0]); in printnat()
129 if (np->in_dcmp) in printnat()
130 printportcmp(proto, &np->in_tuc.ftu_dst); in printnat()
133 if (np->in_redir & (NAT_ENCAP|NAT_DIVERTUDP)) { in printnat()
135 printnataddr(np->in_v[1], np->in_names, &np->in_nsrc, in printnat()
136 np->in_ifnames[0]); in printnat()
137 if ((np->in_redir & NAT_DIVERTUDP) != 0) in printnat()
138 PRINTF(",%u", np->in_spmin); in printnat()
140 printnataddr(np->in_v[1], np->in_names, &np->in_ndst, in printnat()
141 np->in_ifnames[0]); in printnat()
142 if ((np->in_redir & NAT_DIVERTUDP) != 0) in printnat()
143 PRINTF(",%u udp", np->in_dpmin); in printnat()
144 if ((np->in_flags & IPN_PURGE) != 0) in printnat()
148 } else if (np->in_redir & NAT_REWRITE) { in printnat()
150 if (np->in_nsrc.na_atype == FRI_LOOKUP && in printnat()
151 np->in_nsrc.na_type == IPLT_DSTLIST) { in printnat()
153 if (np->in_nsrc.na_subtype == 0) in printnat()
154 PRINTF("%d", np->in_nsrc.na_num); in printnat()
156 PRINTF("%s", base + np->in_nsrc.na_num); in printnat()
158 printnataddr(np->in_v[1], np->in_names, &np->in_nsrc, in printnat()
159 np->in_ifnames[0]); in printnat()
161 if ((((np->in_flags & IPN_TCPUDP) != 0)) && in printnat()
162 (np->in_spmin != 0)) { in printnat()
163 if ((np->in_flags & IPN_FIXEDSPORT) != 0) { in printnat()
164 PRINTF(",port = %u", np->in_spmin); in printnat()
166 PRINTF(",%u", np->in_spmin); in printnat()
167 if (np->in_spmax != np->in_spmin) in printnat()
168 PRINTF("-%u", np->in_spmax); in printnat()
172 if (np->in_ndst.na_atype == FRI_LOOKUP && in printnat()
173 np->in_ndst.na_type == IPLT_DSTLIST) { in printnat()
175 if (np->in_ndst.na_subtype == 0) in printnat()
176 PRINTF("%d", np->in_nsrc.na_num); in printnat()
178 PRINTF("%s", base + np->in_ndst.na_num); in printnat()
180 printnataddr(np->in_v[1], np->in_names, &np->in_ndst, in printnat()
181 np->in_ifnames[0]); in printnat()
183 if ((((np->in_flags & IPN_TCPUDP) != 0)) && in printnat()
184 (np->in_dpmin != 0)) { in printnat()
185 if ((np->in_flags & IPN_FIXEDDPORT) != 0) { in printnat()
186 PRINTF(",port = %u", np->in_dpmin); in printnat()
188 PRINTF(",%u", np->in_dpmin); in printnat()
189 if (np->in_dpmax != np->in_dpmin) in printnat()
190 PRINTF("-%u", np->in_dpmax); in printnat()
193 if ((np->in_flags & IPN_PURGE) != 0) in printnat()
197 } else if (np->in_redir == NAT_REDIRECT) { in printnat()
198 if (!(np->in_flags & IPN_FILTER)) { in printnat()
199 printnataddr(np->in_v[0], np->in_names, &np->in_odst, in printnat()
200 np->in_ifnames[0]); in printnat()
201 if (np->in_flags & IPN_TCPUDP) { in printnat()
202 PRINTF(" port %d", np->in_odport); in printnat()
203 if (np->in_odport != np->in_dtop) in printnat()
204 PRINTF("-%d", np->in_dtop); in printnat()
207 if (np->in_flags & IPN_NO) { in printnat()
209 printproto(pr, proto, np); in printnat()
214 printnataddr(np->in_v[1], np->in_names, &np->in_ndst, in printnat()
215 np->in_ifnames[0]); in printnat()
216 if (np->in_flags & IPN_TCPUDP) { in printnat()
217 if ((np->in_flags & IPN_FIXEDDPORT) != 0) in printnat()
218 PRINTF(" port = %d", np->in_dpmin); in printnat()
220 PRINTF(" port %d", np->in_dpmin); in printnat()
221 if (np->in_dpmin != np->in_dpmax) in printnat()
222 PRINTF("-%d", np->in_dpmax); in printnat()
226 printproto(pr, proto, np); in printnat()
227 if (np->in_flags & IPN_ROUNDR) in printnat()
229 if (np->in_flags & IPN_FRAG) in printnat()
231 if (np->in_age[0] != 0 || np->in_age[1] != 0) { in printnat()
232 PRINTF(" age %d/%d", np->in_age[0], np->in_age[1]); in printnat()
234 if (np->in_flags & IPN_STICKY) in printnat()
236 if (np->in_mssclamp != 0) in printnat()
237 PRINTF(" mssclamp %d", np->in_mssclamp); in printnat()
238 if (np->in_plabel != -1) in printnat()
239 PRINTF(" proxy %s", np->in_names + np->in_plabel); in printnat()
240 if (np->in_tag.ipt_tag[0] != '\0') in printnat()
241 PRINTF(" tag %-.*s", IPFTAG_LEN, np->in_tag.ipt_tag); in printnat()
242 if ((np->in_flags & IPN_PURGE) != 0) in printnat()
246 PRINTF("\tpmax %u\n", np->in_dpmax); in printnat()
251 if (!(np->in_flags & IPN_FILTER)) { in printnat()
252 printnataddr(np->in_v[0], np->in_names, &np->in_osrc, in printnat()
253 np->in_ifnames[0]); in printnat()
255 if (np->in_flags & IPN_NO) { in printnat()
257 printproto(pr, proto, np); in printnat()
262 if (np->in_flags & IPN_SIPRANGE) { in printnat()
264 printnataddr(np->in_v[1], np->in_names, &np->in_nsrc, in printnat()
265 np->in_ifnames[0]); in printnat()
267 printnataddr(np->in_v[1], np->in_names, &np->in_nsrc, in printnat()
268 np->in_ifnames[0]); in printnat()
270 if (np->in_plabel != -1) { in printnat()
272 if (np->in_odport != 0) { in printnat()
275 s = portname(proto, np->in_odport); in printnat()
281 PRINTF(" %s/", np->in_names + np->in_plabel); in printnat()
284 } else if (np->in_redir == NAT_MAPBLK) { in printnat()
285 if ((np->in_spmin == 0) && in printnat()
286 (np->in_flags & IPN_AUTOPORTMAP)) in printnat()
289 PRINTF(" ports %d", np->in_spmin); in printnat()
291 PRINTF("\n\tip modulous %d", np->in_spmax); in printnat()
293 } else if (np->in_spmin || np->in_spmax) { in printnat()
294 if (np->in_flags & IPN_ICMPQUERY) { in printnat()
299 printproto(pr, proto, np); in printnat()
301 if (np->in_flags & IPN_AUTOPORTMAP) { in printnat()
305 np->in_spmin, np->in_spmax, in printnat()
306 np->in_ippip, np->in_ppip); in printnat()
308 PRINTF(" %d:%d", np->in_spmin, np->in_spmax); in printnat()
310 if (np->in_flags & IPN_SEQUENTIAL) in printnat()
314 if (np->in_flags & IPN_FRAG) in printnat()
316 if (np->in_age[0] != 0 || np->in_age[1] != 0) { in printnat()
317 PRINTF(" age %d/%d", np->in_age[0], np->in_age[1]); in printnat()
319 if (np->in_mssclamp != 0) in printnat()
320 PRINTF(" mssclamp %d", np->in_mssclamp); in printnat()
321 if (np->in_tag.ipt_tag[0] != '\0') in printnat()
322 PRINTF(" tag %s", np->in_tag.ipt_tag); in printnat()
323 if (!protoprinted && (np->in_flags & IPN_TCPUDP || proto)) { in printnat()
325 printproto(pr, proto, np); in printnat()
327 if ((np->in_flags & IPN_PURGE) != 0) in printnat()
332 printip(family, &np->in_snip); in printnat()
333 PRINTF(" pnext %d\n", np->in_spnext); in printnat()
339 np->in_space, np->in_use, np->in_hits, in printnat()
340 np->in_flags, np->in_pr[0], np->in_pr[1]); in printnat()
341 PRINTF(" hv %u/%u\n", np->in_hv[0], np->in_hv[1]); in printnat()
343 np->in_ifps[0], np->in_ifps[1], np->in_apr); in printnat()
345 np->in_tqehead[0], np->in_tqehead[1], np->in_comment); in printnat()