summaryrefslogtreecommitdiff
path: root/netlink_smc_diag.c
diff options
context:
space:
mode:
authorEugene Syromyatnikov <evgsyr@gmail.com>2018-08-19 10:48:06 +0200
committerDmitry V. Levin <ldv@altlinux.org>2018-08-27 23:41:41 +0000
commitcf174ac87a04d386513b5af9bf5cc08dc333febf (patch)
tree5f0b36970747473d43e73b076506048a5ab5d6d7 /netlink_smc_diag.c
parentf9578731fcabf329c1d5deb05afd12d2b8c61974 (diff)
downloadstrace-cf174ac87a04d386513b5af9bf5cc08dc333febf.tar.gz
netlink_smc_diag: implement SMC_DIAG_DMBINFO decoding
The message has been added by Linux commit v4.19-rc1~140^2~507^2~1. * linux/smc_diag.h: Include "gcc_compat.h". (enum): Add SMC_DIAG_DMBINFO. (struct smcd_diag_dmbinfo): New type definition. * xlat/smc_diag_attrs.in (SMC_DIAG_DMBINFO): New constant. * netlink_smc_diag.c (decode_smc_diag_dmbinfo): New function. (smc_diag_msg_nla_decoders) [SMC_DIAG_DMBINFO]: New decoder, calls decode_smc_diag_dmbinfo. * tests/nlattr_smc_diag_msg.c: Add SMC_DIAG_DMBINFO check.
Diffstat (limited to 'netlink_smc_diag.c')
-rw-r--r--netlink_smc_diag.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/netlink_smc_diag.c b/netlink_smc_diag.c
index 4ce31e792..42369ad89 100644
--- a/netlink_smc_diag.c
+++ b/netlink_smc_diag.c
@@ -146,10 +146,34 @@ decode_smc_diag_lgrinfo(struct tcb *const tcp,
return true;
}
+static bool
+decode_smc_diag_dmbinfo(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct smcd_diag_dmbinfo dinfo;
+
+ if (len < sizeof(dinfo))
+ return false;
+ if (umove_or_printaddr(tcp, addr, &dinfo))
+ return true;
+
+ PRINT_FIELD_U("{", dinfo, linkid);
+ PRINT_FIELD_X(", ", dinfo, peer_gid);
+ PRINT_FIELD_X(", ", dinfo, my_gid);
+ PRINT_FIELD_X(", ", dinfo, token);
+ PRINT_FIELD_X(", ", dinfo, peer_token);
+ tprints("}");
+
+ return true;
+}
+
static const nla_decoder_t smc_diag_msg_nla_decoders[] = {
[SMC_DIAG_CONNINFO] = decode_smc_diag_conninfo,
[SMC_DIAG_LGRINFO] = decode_smc_diag_lgrinfo,
- [SMC_DIAG_SHUTDOWN] = decode_nla_u8
+ [SMC_DIAG_SHUTDOWN] = decode_nla_u8,
+ [SMC_DIAG_DMBINFO] = decode_smc_diag_dmbinfo,
};
DECL_NETLINK_DIAG_DECODER(decode_smc_diag_msg)