summaryrefslogtreecommitdiffstats
path: root/src/nlmsg.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2010-04-12 18:06:28 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2010-04-12 18:06:28 +0200
commit1f09fdccb75005a53ba2bb90fb61d4e6f45e8e14 (patch)
treeb24b4a6d6eb7da977d2c1a493d4f8cd3d4a2deba /src/nlmsg.c
parent0f53ba01cd326130bdf68c2ed69e13007fe75fa3 (diff)
remove mnl_nlmsg_get_len() function
Remove mnl_nlmsg_get_len() since it returns a field of a structure that is public (struct nlmsghdr). We can directly access the header fields and they are not likely to change in the future (at least for this version of Netlink I think). Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/nlmsg.c')
-rw-r--r--src/nlmsg.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/nlmsg.c b/src/nlmsg.c
index 4450cf5..de41be6 100644
--- a/src/nlmsg.c
+++ b/src/nlmsg.c
@@ -113,21 +113,6 @@ void *mnl_nlmsg_put_extra_header(struct nlmsghdr *nlh, int size)
}
/**
- * mnl_nlmsg_get_len - get the length field from the netlink message
- * @nlh: pointer to a netlink header
- *
- * This function returns the full length of the Netlink message (including the
- * length of the Netlink header) by return the field nlmsg_len of the message.
- *
- * XXX: This function is likely to be deleted soon since the structure of the
- * Netlink header is public.
- */
-uint16_t mnl_nlmsg_get_len(const struct nlmsghdr *nlh)
-{
- return nlh->nlmsg_len;
-}
-
-/**
* mnl_nlmsg_get_payload - get a pointer to the payload of the netlink message
* @nlh: pointer to a netlink header
*
@@ -248,7 +233,7 @@ void mnl_nlmsg_print(const struct nlmsghdr *nlh)
printf("port ID(32 bits)=%.08u\n", nlh->nlmsg_pid);
printf("===================================\n");
- for (i=sizeof(struct nlmsghdr); i<mnl_nlmsg_get_len(nlh); i+=4) {
+ for (i=sizeof(struct nlmsghdr); i<nlh->nlmsg_len; i+=4) {
char *b = (char *) nlh;
printf("(%.3d) %.2x %.2x %.2x %.2x | ", i,