mirror of
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git
synced 2024-11-15 14:05:22 +08:00
ff619e4fd3
This adds iproute2 support for mptcp event monitoring, e.g. creation, establishment, address announcements from the peer, subflow establishment and so on. While the kernel-generated events are primarily aimed at mptcpd (e.g. for subflow management), this is also useful for debugging. This adds print support for the existing events. Sample output of 'ip mptcp monitor': [ CREATED] token=83f3a692 remid=0 locid=0 saddr4=10.0.1.2 daddr4=10.0.1.1 sport=58710 dport=10011 [ ESTABLISHED] token=83f3a692 remid=0 locid=0 saddr4=10.0.1.2 daddr4=10.0.1.1 sport=58710 dport=10011 [SF_ESTABLISHED] token=83f3a692 remid=0 locid=1 saddr4=10.0.2.2 daddr4=10.0.1.1 sport=40195 dport=10011 backup=0 [ CLOSED] token=83f3a692 Signed-off-by: Florian Westphal <fw@strlen.de>
30 lines
841 B
C
30 lines
841 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __LIBGENL_H__
|
|
#define __LIBGENL_H__
|
|
|
|
#include "libnetlink.h"
|
|
|
|
#define GENL_REQUEST(_req, _bufsiz, _family, _hdrsiz, _ver, _cmd, _flags) \
|
|
struct { \
|
|
struct nlmsghdr n; \
|
|
struct genlmsghdr g; \
|
|
char buf[NLMSG_ALIGN(_hdrsiz) + (_bufsiz)]; \
|
|
} _req = { \
|
|
.n = { \
|
|
.nlmsg_type = (_family), \
|
|
.nlmsg_flags = (_flags), \
|
|
.nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN + (_hdrsiz)), \
|
|
}, \
|
|
.g = { \
|
|
.cmd = (_cmd), \
|
|
.version = (_ver), \
|
|
}, \
|
|
}
|
|
|
|
int genl_add_mcast_grp(struct rtnl_handle *grth, __u16 genl_family, const char *group);
|
|
int genl_resolve_family(struct rtnl_handle *grth, const char *family);
|
|
int genl_init_handle(struct rtnl_handle *grth, const char *family,
|
|
int *genl_family);
|
|
|
|
#endif /* __LIBGENL_H__ */
|