14 #ifndef NETLINK_NFNL_H_
15 #define NETLINK_NFNL_H_
17 #include <netlink/netlink.h>
23 #define NFNL_HDRLEN NLMSG_ALIGN(sizeof(struct nfgenmsg))
24 #define NFNLMSG_TYPE(subsys, subtype) (((subsys) << 8) | (subtype))
34 int, uint8_t, uint16_t);
37 extern int nfnlmsg_put(
struct nl_msg *, uint32_t, uint32_t,
38 uint8_t, uint8_t,
int, uint8_t, uint16_t);
uint8_t nfnlmsg_subsys(struct nlmsghdr *nlh)
Get netfilter subsystem id from message.
uint8_t nfnlmsg_subtype(struct nlmsghdr *nlh)
Get netfilter message type from message.
int nfnlmsg_put(struct nl_msg *msg, uint32_t pid, uint32_t seq, uint8_t subsys_id, uint8_t type, int flags, uint8_t family, uint16_t res_id)
Add netlink and netfilter netlink headers to netlink message.
int nfnl_connect(struct nl_handle *handle)
Create and connect netfilter netlink socket.
uint8_t nfnlmsg_family(struct nlmsghdr *nlh)
Get netfilter family from message.
int nfnl_send_simple(struct nl_handle *handle, uint8_t subsys_id, uint8_t type, int flags, uint8_t family, uint16_t res_id)
Send trivial netfilter netlink message.
struct nl_msg * nfnlmsg_alloc_simple(uint8_t subsys_id, uint8_t type, int flags, uint8_t family, uint16_t res_id)
Allocate a new netfilter netlink message.
uint16_t nfnlmsg_res_id(struct nlmsghdr *nlh)
Get netfilter resource id from message.