Lines Matching full:info
143 hmark_parse(const char *type, size_t len, struct xt_hmark_info *info, in hmark_parse() argument
147 info->flags |= XT_HMARK_FLAG(XT_HMARK_CT); in hmark_parse()
150 memset(&info->src_mask, 0xff, sizeof(info->src_mask)); in hmark_parse()
151 info->flags |= XT_HMARK_FLAG(XT_HMARK_SADDR_MASK); in hmark_parse()
154 memset(&info->dst_mask, 0xff, sizeof(info->dst_mask)); in hmark_parse()
155 info->flags |= XT_HMARK_FLAG(XT_HMARK_DADDR_MASK); in hmark_parse()
158 memset(&info->port_mask.p16.src, 0xff, in hmark_parse()
159 sizeof(info->port_mask.p16.src)); in hmark_parse()
160 info->flags |= XT_HMARK_FLAG(XT_HMARK_SPORT_MASK); in hmark_parse()
163 memset(&info->port_mask.p16.dst, 0xff, in hmark_parse()
164 sizeof(info->port_mask.p16.dst)); in hmark_parse()
165 info->flags |= XT_HMARK_FLAG(XT_HMARK_DPORT_MASK); in hmark_parse()
168 memset(&info->proto_mask, 0xff, sizeof(info->proto_mask)); in hmark_parse()
169 info->flags |= XT_HMARK_FLAG(XT_HMARK_PROTO_MASK); in hmark_parse()
172 memset(&info->port_mask.v32, 0xff, sizeof(info->port_mask.v32)); in hmark_parse()
173 info->flags |= XT_HMARK_FLAG(XT_HMARK_SPI_MASK); in hmark_parse()
185 struct xt_hmark_info *info = cb->data; in hmark_parse_type() local
190 !hmark_parse(arg, comma-arg, info, &cb->xflags)) in hmark_parse_type()
200 !hmark_parse(arg, strlen(arg), info, &cb->xflags)) in hmark_parse_type()
206 struct xt_hmark_info *info = cb->data; in HMARK_parse() local
215 info->flags |= XT_HMARK_FLAG(XT_HMARK_SADDR_MASK); in HMARK_parse()
218 info->flags |= XT_HMARK_FLAG(XT_HMARK_DADDR_MASK); in HMARK_parse()
221 info->port_set.v32 = htonl(cb->val.u32); in HMARK_parse()
222 info->flags |= XT_HMARK_FLAG(XT_HMARK_SPI); in HMARK_parse()
225 info->port_set.p16.src = htons(cb->val.u16); in HMARK_parse()
226 info->flags |= XT_HMARK_FLAG(XT_HMARK_SPORT); in HMARK_parse()
229 info->port_set.p16.dst = htons(cb->val.u16); in HMARK_parse()
230 info->flags |= XT_HMARK_FLAG(XT_HMARK_DPORT); in HMARK_parse()
233 info->port_mask.p16.src = htons(cb->val.u16); in HMARK_parse()
234 info->flags |= XT_HMARK_FLAG(XT_HMARK_SPORT_MASK); in HMARK_parse()
237 info->port_mask.p16.dst = htons(cb->val.u16); in HMARK_parse()
238 info->flags |= XT_HMARK_FLAG(XT_HMARK_DPORT_MASK); in HMARK_parse()
241 info->port_mask.v32 = htonl(cb->val.u32); in HMARK_parse()
242 info->flags |= XT_HMARK_FLAG(XT_HMARK_SPI_MASK); in HMARK_parse()
245 info->flags |= XT_HMARK_FLAG(XT_HMARK_PROTO_MASK); in HMARK_parse()
248 info->flags |= XT_HMARK_FLAG(XT_HMARK_RND); in HMARK_parse()
251 info->flags |= XT_HMARK_FLAG(XT_HMARK_MODULUS); in HMARK_parse()
254 info->flags |= XT_HMARK_FLAG(XT_HMARK_OFFSET); in HMARK_parse()
257 info->flags |= XT_HMARK_FLAG(XT_HMARK_CT); in HMARK_parse()
290 static void HMARK_print(const struct xt_hmark_info *info) in HMARK_print() argument
292 if (info->flags & XT_HMARK_FLAG(XT_HMARK_SPORT_MASK)) in HMARK_print()
293 printf("sport-mask 0x%x ", htons(info->port_mask.p16.src)); in HMARK_print()
294 if (info->flags & XT_HMARK_FLAG(XT_HMARK_DPORT_MASK)) in HMARK_print()
295 printf("dport-mask 0x%x ", htons(info->port_mask.p16.dst)); in HMARK_print()
296 if (info->flags & XT_HMARK_FLAG(XT_HMARK_SPI_MASK)) in HMARK_print()
297 printf("spi-mask 0x%x ", htonl(info->port_mask.v32)); in HMARK_print()
298 if (info->flags & XT_HMARK_FLAG(XT_HMARK_SPORT)) in HMARK_print()
299 printf("sport 0x%x ", htons(info->port_set.p16.src)); in HMARK_print()
300 if (info->flags & XT_HMARK_FLAG(XT_HMARK_DPORT)) in HMARK_print()
301 printf("dport 0x%x ", htons(info->port_set.p16.dst)); in HMARK_print()
302 if (info->flags & XT_HMARK_FLAG(XT_HMARK_SPI)) in HMARK_print()
303 printf("spi 0x%x ", htonl(info->port_set.v32)); in HMARK_print()
304 if (info->flags & XT_HMARK_FLAG(XT_HMARK_PROTO_MASK)) in HMARK_print()
305 printf("proto-mask 0x%x ", info->proto_mask); in HMARK_print()
306 if (info->flags & XT_HMARK_FLAG(XT_HMARK_RND)) in HMARK_print()
307 printf("rnd 0x%x ", info->hashrnd); in HMARK_print()
313 const struct xt_hmark_info *info = in HMARK_ip6_print() local
317 if (info->flags & XT_HMARK_FLAG(XT_HMARK_MODULUS)) in HMARK_ip6_print()
318 printf("mod %u ", info->hmodulus); in HMARK_ip6_print()
319 if (info->flags & XT_HMARK_FLAG(XT_HMARK_OFFSET)) in HMARK_ip6_print()
320 printf("+ 0x%x ", info->hoffset); in HMARK_ip6_print()
321 if (info->flags & XT_HMARK_FLAG(XT_HMARK_CT)) in HMARK_ip6_print()
323 if (info->flags & XT_HMARK_FLAG(XT_HMARK_SADDR_MASK)) in HMARK_ip6_print()
325 xtables_ip6mask_to_numeric(&info->src_mask.in6) + 1); in HMARK_ip6_print()
326 if (info->flags & XT_HMARK_FLAG(XT_HMARK_DADDR_MASK)) in HMARK_ip6_print()
328 xtables_ip6mask_to_numeric(&info->dst_mask.in6) + 1); in HMARK_ip6_print()
329 HMARK_print(info); in HMARK_ip6_print()
334 const struct xt_hmark_info *info = in HMARK_ip4_print() local
338 if (info->flags & XT_HMARK_FLAG(XT_HMARK_MODULUS)) in HMARK_ip4_print()
339 printf("mod %u ", info->hmodulus); in HMARK_ip4_print()
340 if (info->flags & XT_HMARK_FLAG(XT_HMARK_OFFSET)) in HMARK_ip4_print()
341 printf("+ 0x%x ", info->hoffset); in HMARK_ip4_print()
342 if (info->flags & XT_HMARK_FLAG(XT_HMARK_CT)) in HMARK_ip4_print()
344 if (info->flags & XT_HMARK_FLAG(XT_HMARK_SADDR_MASK)) in HMARK_ip4_print()
346 xtables_ipmask_to_cidr(&info->src_mask.in)); in HMARK_ip4_print()
347 if (info->flags & XT_HMARK_FLAG(XT_HMARK_DADDR_MASK)) in HMARK_ip4_print()
349 xtables_ipmask_to_cidr(&info->dst_mask.in)); in HMARK_ip4_print()
350 HMARK_print(info); in HMARK_ip4_print()
353 static void HMARK_save(const struct xt_hmark_info *info) in HMARK_save() argument
355 if (info->flags & XT_HMARK_FLAG(XT_HMARK_SPORT_MASK)) in HMARK_save()
357 htons(info->port_mask.p16.src)); in HMARK_save()
358 if (info->flags & XT_HMARK_FLAG(XT_HMARK_DPORT_MASK)) in HMARK_save()
360 htons(info->port_mask.p16.dst)); in HMARK_save()
361 if (info->flags & XT_HMARK_FLAG(XT_HMARK_SPI_MASK)) in HMARK_save()
363 htonl(info->port_mask.v32)); in HMARK_save()
364 if (info->flags & XT_HMARK_FLAG(XT_HMARK_SPORT)) in HMARK_save()
366 htons(info->port_set.p16.src)); in HMARK_save()
367 if (info->flags & XT_HMARK_FLAG(XT_HMARK_DPORT)) in HMARK_save()
369 htons(info->port_set.p16.dst)); in HMARK_save()
370 if (info->flags & XT_HMARK_FLAG(XT_HMARK_SPI)) in HMARK_save()
371 printf(" --hmark-spi 0x%08x", htonl(info->port_set.v32)); in HMARK_save()
372 if (info->flags & XT_HMARK_FLAG(XT_HMARK_PROTO_MASK)) in HMARK_save()
373 printf(" --hmark-proto-mask 0x%02x", info->proto_mask); in HMARK_save()
374 if (info->flags & XT_HMARK_FLAG(XT_HMARK_RND)) in HMARK_save()
375 printf(" --hmark-rnd 0x%08x", info->hashrnd); in HMARK_save()
376 if (info->flags & XT_HMARK_FLAG(XT_HMARK_MODULUS)) in HMARK_save()
377 printf(" --hmark-mod %u", info->hmodulus); in HMARK_save()
378 if (info->flags & XT_HMARK_FLAG(XT_HMARK_OFFSET)) in HMARK_save()
379 printf(" --hmark-offset %u", info->hoffset); in HMARK_save()
380 if (info->flags & XT_HMARK_FLAG(XT_HMARK_CT)) in HMARK_save()
386 const struct xt_hmark_info *info = in HMARK_ip6_save() local
390 if (info->flags & XT_HMARK_FLAG(XT_HMARK_SADDR_MASK)) { in HMARK_ip6_save()
391 ret = xtables_ip6mask_to_cidr(&info->src_mask.in6); in HMARK_ip6_save()
394 if (info->flags & XT_HMARK_FLAG(XT_HMARK_DADDR_MASK)) { in HMARK_ip6_save()
395 ret = xtables_ip6mask_to_cidr(&info->dst_mask.in6); in HMARK_ip6_save()
398 HMARK_save(info); in HMARK_ip6_save()
403 const struct xt_hmark_info *info = in HMARK_ip4_save() local
407 if (info->flags & XT_HMARK_FLAG(XT_HMARK_SADDR_MASK)) { in HMARK_ip4_save()
408 ret = xtables_ipmask_to_cidr(&info->src_mask.in); in HMARK_ip4_save()
411 if (info->flags & XT_HMARK_FLAG(XT_HMARK_DADDR_MASK)) { in HMARK_ip4_save()
412 ret = xtables_ipmask_to_cidr(&info->dst_mask.in); in HMARK_ip4_save()
415 HMARK_save(info); in HMARK_ip4_save()