|| !decoders[nla->nla_type](tcp, addr + NLA_HDRLEN,
nla_len - NLA_HDRLEN,
opaque_data))
- printstrn(tcp, addr + NLA_HDRLEN, len - NLA_HDRLEN);
+ printstr_ex(tcp, addr + NLA_HDRLEN,
+ len - NLA_HDRLEN, QUOTE_FORCE_HEX);
tprints("}");
}
}
", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX"
", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1"
", udiag_ino=0, udiag_cookie=[0, 0]}, {{nla_len=%u"
- ", nla_type=%#x /* UNIX_DIAG_??? */}, \"1234\"}}"
+ ", nla_type=%#x /* UNIX_DIAG_??? */}"
+ ", \"\\x31\\x32\\x33\\x34\"}}"
", %u, MSG_DONTWAIT, NULL, 0) = %s\n",
fd, msg_len, nla->nla_len, UNIX_DIAG_SHUTDOWN + 1,
msg_len, sprintrc(rc));
init_msg_, print_msg_, \
nla_type_, pattern_, obj_, ...) \
do { \
- const int plen = sizeof(obj_) - 1 > DEFAULT_STRLEN \
+ const unsigned int plen = \
+ sizeof(obj_) - 1 > DEFAULT_STRLEN \
? DEFAULT_STRLEN : (int) sizeof(obj_) - 1; \
/* len < sizeof(obj_) */ \
TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \
(nla_type_), #nla_type_, \
sizeof(obj_) - 1, \
(pattern_), sizeof(obj_) - 1, \
- printf("\"%.*s\"", plen, (pattern_))); \
+ print_quoted_hex((pattern_), plen)); \
/* short read of sizeof(obj_) */ \
TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \
(init_msg_), (print_msg_), \
init_msg_, print_msg_, \
nla_type_, pattern_, obj_, print_elem_) \
do { \
- const int plen = \
+ const unsigned int plen = \
sizeof((obj_)[0]) - 1 > DEFAULT_STRLEN \
? DEFAULT_STRLEN : (int) sizeof((obj_)[0]) - 1; \
/* len < sizeof((obj_)[0]) */ \
(nla_type_), #nla_type_, \
sizeof((obj_)[0]) - 1, \
(pattern_), sizeof((obj_)[0]) - 1, \
- printf("\"%.*s\"", plen, (pattern_))); \
+ print_quoted_hex((pattern_), plen)); \
/* sizeof((obj_)[0]) < len < sizeof(obj_) */ \
TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \
(init_msg_), (print_msg_), \
/* Print memory in a quoted form. */
void print_quoted_memory(const char *, size_t);
+/* Print memory in a hexquoted form. */
+void print_quoted_hex(const char *, size_t);
+
/* Print time_t and nanoseconds in symbolic format. */
void print_time_t_nsec(time_t, unsigned long long, int);