rtnl_link: implement IFLA_EVENT_* decoding
* rtnl_link.c (decode_ifla_event): New function. (ifinfomsg_nla_decoders) <[IFLA_EVENT]>: Use it. * xlat/rtnl_ifla_events.in: New file. * NEWS: Mention it.
This commit is contained in:
parent
2e5510da5f
commit
53ebefe984
1
NEWS
1
NEWS
@ -7,6 +7,7 @@ Noteworthy changes in release ?.?? (????-??-??)
|
|||||||
* Improvements
|
* Improvements
|
||||||
* IPv6 addresses shown in socket information in -yy mode are now printed
|
* IPv6 addresses shown in socket information in -yy mode are now printed
|
||||||
in brackets.
|
in brackets.
|
||||||
|
* Enhanced NETLINK_ROUTE protocol decoding.
|
||||||
* Updated the list of RWF_* constants.
|
* Updated the list of RWF_* constants.
|
||||||
|
|
||||||
* Bug fixes
|
* Bug fixes
|
||||||
|
19
rtnl_link.c
19
rtnl_link.c
@ -39,6 +39,7 @@
|
|||||||
#include <linux/rtnetlink.h>
|
#include <linux/rtnetlink.h>
|
||||||
|
|
||||||
#include "xlat/rtnl_ifla_brport_attrs.h"
|
#include "xlat/rtnl_ifla_brport_attrs.h"
|
||||||
|
#include "xlat/rtnl_ifla_events.h"
|
||||||
#include "xlat/rtnl_ifla_info_attrs.h"
|
#include "xlat/rtnl_ifla_info_attrs.h"
|
||||||
#include "xlat/rtnl_ifla_port_attrs.h"
|
#include "xlat/rtnl_ifla_port_attrs.h"
|
||||||
#include "xlat/rtnl_ifla_vf_port_attrs.h"
|
#include "xlat/rtnl_ifla_vf_port_attrs.h"
|
||||||
@ -375,6 +376,22 @@ decode_ifla_xdp(struct tcb *const tcp,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool
|
||||||
|
decode_ifla_event(struct tcb *const tcp,
|
||||||
|
const kernel_ulong_t addr,
|
||||||
|
const unsigned int len,
|
||||||
|
const void *const opaque_data)
|
||||||
|
{
|
||||||
|
uint32_t ev;
|
||||||
|
|
||||||
|
if (len < sizeof(ev))
|
||||||
|
return false;
|
||||||
|
else if (!umove_or_printaddr(tcp, addr, &ev))
|
||||||
|
printxval(rtnl_ifla_events, ev, "IFLA_EVENT_???");
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
static const nla_decoder_t ifinfomsg_nla_decoders[] = {
|
static const nla_decoder_t ifinfomsg_nla_decoders[] = {
|
||||||
[IFLA_ADDRESS] = NULL, /* unimplemented */
|
[IFLA_ADDRESS] = NULL, /* unimplemented */
|
||||||
[IFLA_BROADCAST] = NULL, /* unimplemented */
|
[IFLA_BROADCAST] = NULL, /* unimplemented */
|
||||||
@ -419,7 +436,7 @@ static const nla_decoder_t ifinfomsg_nla_decoders[] = {
|
|||||||
[IFLA_GSO_MAX_SIZE] = decode_nla_u32,
|
[IFLA_GSO_MAX_SIZE] = decode_nla_u32,
|
||||||
[IFLA_PAD] = NULL,
|
[IFLA_PAD] = NULL,
|
||||||
[IFLA_XDP] = decode_ifla_xdp,
|
[IFLA_XDP] = decode_ifla_xdp,
|
||||||
[IFLA_EVENT] = decode_nla_u32
|
[IFLA_EVENT] = decode_ifla_event,
|
||||||
};
|
};
|
||||||
|
|
||||||
DECL_NETLINK_ROUTE_DECODER(decode_ifinfomsg)
|
DECL_NETLINK_ROUTE_DECODER(decode_ifinfomsg)
|
||||||
|
7
xlat/rtnl_ifla_events.in
Normal file
7
xlat/rtnl_ifla_events.in
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
IFLA_EVENT_NONE 0
|
||||||
|
IFLA_EVENT_REBOOT 1
|
||||||
|
IFLA_EVENT_FEATURES 2
|
||||||
|
IFLA_EVENT_BONDING_FAILOVER 3
|
||||||
|
IFLA_EVENT_NOTIFY_PEERS 4
|
||||||
|
IFLA_EVENT_IGMP_RESEND 5
|
||||||
|
IFLA_EVENT_BONDING_OPTIONS 6
|
Loading…
x
Reference in New Issue
Block a user