MCPcopy Create free account
hub / github.com/F-Stack/f-stack / print_one_ip4_rule

Function print_one_ip4_rule

dpdk/examples/ipsec-secgw/sp4.c:432–457  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

430}
431
432static void
433print_one_ip4_rule(const struct acl4_rules *rule, int32_t extra)
434{
435 uint8_t a, b, c, d;
436
437 uint32_t_to_char(rule->field[SRC_FIELD_IPV4].value.u32,
438 &a, &b, &c, &d);
439 printf("%hhu.%hhu.%hhu.%hhu/%u ", a, b, c, d,
440 rule->field[SRC_FIELD_IPV4].mask_range.u32);
441 uint32_t_to_char(rule->field[DST_FIELD_IPV4].value.u32,
442 &a, &b, &c, &d);
443 printf("%hhu.%hhu.%hhu.%hhu/%u ", a, b, c, d,
444 rule->field[DST_FIELD_IPV4].mask_range.u32);
445 printf("%hu : %hu %hu : %hu 0x%hhx/0x%hhx ",
446 rule->field[SRCP_FIELD_IPV4].value.u16,
447 rule->field[SRCP_FIELD_IPV4].mask_range.u16,
448 rule->field[DSTP_FIELD_IPV4].value.u16,
449 rule->field[DSTP_FIELD_IPV4].mask_range.u16,
450 rule->field[PROTO_FIELD_IPV4].value.u8,
451 rule->field[PROTO_FIELD_IPV4].mask_range.u8);
452 if (extra)
453 printf("0x%x-0x%x-0x%x ",
454 rule->data.category_mask,
455 rule->data.priority,
456 rule->data.userdata);
457}
458
459static inline void
460dump_ip4_rules(const struct acl4_rules *rule, int32_t num, int32_t extra)

Callers 1

dump_ip4_rulesFunction · 0.85

Calls 1

printfFunction · 0.50

Tested by

no test coverage detected