10 #ifndef MPTCPD_COMMANDS_H
11 #define MPTCPD_COMMANDS_H
14 # include <mptcpd/private/config.h>
20 #include <sys/socket.h>
21 #include <netinet/in.h>
22 #include <linux/netlink.h>
29 #define MPTCPD_NLA_ALIGN(v) (NLA_HDRLEN + NLA_ALIGN(sizeof(v)))
40 #define MPTCPD_NLA_ALIGN_OPT(v) ((v) == 0 ? 0 : (MPTCPD_NLA_ALIGN(v)))
52 #define MPTCPD_NLA_ALIGN_ADDR(v) \
53 (NLA_HDRLEN + NLA_ALIGN(mptcpd_get_addr_size(v)))
72 return addr->sa_family == AF_INET || addr->sa_family == AF_INET6;
87 return addr->sa_family == AF_INET
88 ?
sizeof(
struct in_addr)
89 : sizeof(struct in6_addr);
105 sa_family_t
const family = (addr == NULL ? 0 : addr->sa_family);
uint16_t mptcpd_get_addr_family(struct sockaddr const *addr)
Get network address family.
Definition: commands.h:103
struct mptcpd_pm_cmd_ops const * mptcpd_get_mptcp_org_cmd_ops(void)
Get multipath-tcp.org kernel MPTCP generic netlink command operations.
bool mptcpd_is_inet_family(struct sockaddr const *addr)
Check for internet address family.
Definition: commands.h:70
struct mptcpd_pm_cmd_ops const * mptcpd_get_upstream_cmd_ops(void)
Get upstream kernel MPTCP generic netlink command operations.
size_t mptcpd_get_addr_size(struct sockaddr const *addr)
Get the underlying internet address size.
Definition: commands.h:83
uint16_t mptcpd_get_port_number(struct sockaddr const *addr)
Get IP port number.
Definition: commands.c:25
bool mptcpd_check_genl_error(struct l_genl_msg *msg, char const *fname)
Check for genl operation failure.
Definition: commands.c:48
void mptcpd_family_send_callback(struct l_genl_msg *msg, void *user_data)
Generic error reporting callback.
Definition: commands.c:81
MPTCP path management generic netlink command functions.
Definition: path_manager.h:123