Introduced by Linux commit v4.19-rc1~140^2~285^2~4.
* xlat/smc_diag_mode.in: New file.
* netlink_smc_diag.c: Include "xlat/smc_diag_mode.h".
(decode_smc_diag_msg): Print diag_fallback field using smc_diag_mode
xlat.
* tests/netlink_sock_diag.c (test_smc_diag_msg): Update expected output.
* tests/nlattr_smc_diag_msg.c (print_smc_diag_msg): Likewise.
#include "xlat/smc_diag_attrs.h"
#include "xlat/smc_diag_extended_flags.h"
+#include "xlat/smc_diag_mode.h"
#include "xlat/smc_link_group_roles.h"
#include "xlat/smc_states.h"
(void *) &msg + offset)) {
PRINT_FIELD_XVAL("", msg, diag_state,
smc_states, "SMC_???");
- PRINT_FIELD_U(", ", msg, diag_fallback);
+ PRINT_FIELD_XVAL_INDEX(", ", msg, diag_fallback,
+ smc_diag_mode,
+ "SMC_DIAG_MODE_???");
PRINT_FIELD_U(", ", msg, diag_shutdown);
/*
* AF_SMC protocol family socket handler
struct smc_diag_msg msg = {
.diag_family = AF_SMC,
.diag_state = SMC_ACTIVE,
- .diag_fallback = 0xde,
+ .diag_fallback = 0x1,
.diag_shutdown = 0xba,
.id = {
.idiag_sport = 0xdead,
SOCK_DIAG_BY_FAMILY, NLM_F_DUMP, msg,
printf("{diag_family=AF_SMC"),
printf(", diag_state=SMC_ACTIVE");
- PRINT_FIELD_U(", ", msg, diag_fallback);
+ printf(", diag_fallback=SMC_DIAG_MODE_FALLBACK_TCP");
PRINT_FIELD_U(", ", msg, diag_shutdown);
printf(", id={idiag_sport=htons(%u)"
", idiag_dport=htons(%u)"
printf("{len=%u, type=SOCK_DIAG_BY_FAMILY"
", flags=NLM_F_DUMP, seq=0, pid=0}"
", {diag_family=AF_SMC, diag_state=SMC_ACTIVE"
- ", diag_fallback=0, diag_shutdown=0"
+ ", diag_fallback=SMC_DIAG_MODE_SMCR, diag_shutdown=0"
", id={idiag_sport=htons(0), idiag_dport=htons(0)"
", idiag_src=inet_addr(\"%s\")"
", idiag_dst=inet_addr(\"%s\")"
--- /dev/null
+#value_indexed
+SMC_DIAG_MODE_SMCR 0
+SMC_DIAG_MODE_FALLBACK_TCP 1
+SMC_DIAG_MODE_SMCD 2