From d7955867a79e8aed8058a2a69953c6005bb9ef5a Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Sun, 24 Nov 2013 21:01:49 +0100 Subject: src: consolidate netlink build header function Add new function nft_nlmsg_build_hdr which consolidates all existing functions to build headers per object. They basically look the same. This patch still provides aliases for consistency in the naming approach. Signed-off-by: Pablo Neira Ayuso --- src/table.c | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'src/table.c') diff --git a/src/table.c b/src/table.c index cf24cae..9e20768 100644 --- a/src/table.c +++ b/src/table.c @@ -152,27 +152,6 @@ const char *nft_table_attr_get_str(struct nft_table *t, uint16_t attr) } EXPORT_SYMBOL(nft_table_attr_get_str); -struct nlmsghdr * -nft_table_nlmsg_build_hdr(char *buf, uint16_t cmd, uint16_t family, - uint16_t type, uint32_t seq) -{ - struct nlmsghdr *nlh; - struct nfgenmsg *nfh; - - nlh = mnl_nlmsg_put_header(buf); - nlh->nlmsg_type = (NFNL_SUBSYS_NFTABLES << 8) | cmd; - nlh->nlmsg_flags = NLM_F_REQUEST | type; - nlh->nlmsg_seq = seq; - - nfh = mnl_nlmsg_put_extra_header(nlh, sizeof(struct nfgenmsg)); - nfh->nfgen_family = family; - nfh->version = NFNETLINK_V0; - nfh->res_id = 0; - - return nlh; -} -EXPORT_SYMBOL(nft_table_nlmsg_build_hdr); - void nft_table_nlmsg_build_payload(struct nlmsghdr *nlh, const struct nft_table *t) { if (t->flags & (1 << NFT_TABLE_ATTR_NAME)) -- cgit v1.2.3