TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen,
init_AF_INET_msg, print_AF_INET_msg,
0, "IFLA_INET_UNSPEC", pattern,
- unknown_msg, 2,
+ unknown_msg, print_quoted_hex, 2,
printf("\"\\xab\\xac\\xdb\\xcd\""));
TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen,
init_AF_INET_msg, print_AF_INET_msg,
2, "0x2 /* IFLA_INET_??? */", pattern,
- unknown_msg, 2,
+ unknown_msg, print_quoted_hex, 2,
printf("\"\\xab\\xac\\xdb\\xcd\""));
/* AF_INET: IFLA_INET_CONF */
TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen,
init_AF_INET6_msg, print_AF_INET6_msg,
0, "IFLA_INET6_UNSPEC", pattern,
- unknown_msg, 2,
+ unknown_msg, print_quoted_hex, 2,
printf("\"\\xab\\xac\\xdb\\xcd\""));
TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen,
init_AF_INET6_msg, print_AF_INET6_msg,
9, "0x9 /* IFLA_INET6_??? */", pattern,
- unknown_msg, 2,
+ unknown_msg, print_quoted_hex, 2,
printf("\"\\xab\\xac\\xdb\\xcd\""));
/* AF_INET6: IFLA_INET6_FLAGS */
init_AF_INET6_msg,
print_AF_INET6_msg,
1, "IFLA_INET6_FLAGS", pattern,
- inet6_flags[i].flags, 2,
+ inet6_flags[i].flags,
+ print_quoted_hex, 2,
printf("%s", inet6_flags[i].str));
}
TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen,
init_AF_INET6_msg, print_AF_INET6_msg,
4, "IFLA_INET6_MCAST", pattern,
- unknown_msg, 2,
+ unknown_msg, print_quoted_hex, 2,
printf("\"\\xab\\xac\\xdb\\xcd\""));
/* AF_INET6: IFLA_INET6_CACHEINFO */
TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen,
init_AF_INET6_msg, print_AF_INET6_msg,
5, "IFLA_INET6_CACHEINFO", pattern,
- ci, 2,
+ ci, print_quoted_hex, 2,
PRINT_FIELD_U("{", ci, max_reasm_len);
PRINT_FIELD_U(", ", ci, tstamp);
PRINT_FIELD_U(", ", ci, reachable_time);
TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen,
init_AF_INET6_msg, print_AF_INET6_msg,
7, "IFLA_INET6_TOKEN", pattern,
- inet6_addr, 2,
+ inet6_addr, print_quoted_hex, 2,
printf("badc:ded:face:beef:deca:feed"
":dead:feed"));
init_AF_INET6_msg,
print_AF_INET6_msg,
8, "IFLA_INET6_ADDR_GEN_MODE",
- pattern, agms[i].flags, 2,
+ pattern, agms[i].flags,
+ print_quoted_hex, 2,
printf("%s", agms[i].str));
}
#define TEST_NESTED_NLATTR_OBJECT_EX_(fd_, nlh0_, hdrlen_, \
init_msg_, print_msg_, \
nla_type_, nla_type_str_, \
- pattern_, obj_, depth_, ...) \
+ pattern_, obj_, fallback_func, \
+ depth_, ...) \
do { \
const unsigned int plen = \
sizeof(obj_) - 1 > DEFAULT_STRLEN \
(init_msg_), (print_msg_), \
(nla_type_), (nla_type_str_), \
plen, (pattern_), plen, \
- print_quoted_hex((pattern_), plen); \
+ (fallback_func)((pattern_), plen); \
size_t i; \
for (i = 0; i < depth_; ++i) \
printf("}")); \
TEST_NESTED_NLATTR_OBJECT_EX_((fd_), (nlh0_), (hdrlen_), \
(init_msg_), (print_msg_), \
(nla_type_), #nla_type_, \
- (pattern_), (obj_), (depth_), \
+ (pattern_), (obj_), \
+ print_quoted_hex, (depth_), \
__VA_ARGS__)
#define TEST_NESTED_NLATTR_OBJECT(fd_, nlh0_, hdrlen_, \
TEST_NESTED_NLATTR_OBJECT_EX_((fd_), (nlh0_), (hdrlen_), \
(init_msg_), (print_msg_), \
(nla_type_), #nla_type_, \
- (pattern_), (obj_), 1, \
+ (pattern_), (obj_), \
+ print_quoted_hex, 1, \
__VA_ARGS__)
#define TEST_NESTED_NLATTR_ARRAY_EX(fd_, nlh0_, hdrlen_, \