summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2010-06-25 15:05:38 +0200
committerpablo <pablo@dune.localdomain>2010-06-25 15:05:38 +0200
commit5d51315f5263f9cbda18f70e2d340a66cf1bf1f9 (patch)
tree1ef351f4055e63ec4dd2d39101ff409e252236c5
parentff088fc0d88ef97fe9559880643def6fe40ae086 (diff)
socket: remove mnl_socket_sendmsg() and mnl_socket_recvmsg()
These functions are too simple wrappers that bloat the library. We can use mnl_socket_get_fd() to obtain the file descriptor and invoke message-oriented system call instead. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--include/libmnl/libmnl.h2
-rw-r--r--src/socket.c30
2 files changed, 0 insertions, 32 deletions
diff --git a/include/libmnl/libmnl.h b/include/libmnl/libmnl.h
index 8c3815d..09099a1 100644
--- a/include/libmnl/libmnl.h
+++ b/include/libmnl/libmnl.h
@@ -20,9 +20,7 @@ extern int mnl_socket_close(struct mnl_socket *nl);
extern int mnl_socket_get_fd(const struct mnl_socket *nl);
extern unsigned int mnl_socket_get_portid(const struct mnl_socket *nl);
extern int mnl_socket_sendto(const struct mnl_socket *nl, const void *req, size_t siz);
-extern int mnl_socket_sendmsg(const struct mnl_socket *nl, const struct msghdr *msg, int flags);
extern int mnl_socket_recvfrom(const struct mnl_socket *nl, void *buf, size_t siz);
-extern int mnl_socket_recvmsg(const struct mnl_socket *nl, struct msghdr *msg, int flags);
extern int mnl_socket_setsockopt(const struct mnl_socket *nl, int type, void *buf, socklen_t len);
extern int mnl_socket_getsockopt(const struct mnl_socket *nl, int type, void *buf, socklen_t *len);
diff --git a/src/socket.c b/src/socket.c
index 7fd3a5c..cf8f251 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -127,21 +127,6 @@ int mnl_socket_sendto(const struct mnl_socket *nl, const void *buf, size_t len)
}
/**
- * mnl_socket_sendmsg - send a netlink message of a certain size
- * @nl: netlink socket obtained via mnl_socket_open()
- * @msg: pointer to struct msghdr (must be initialized appropriately)
- * @flags: flags passed to sendmsg()
- *
- * On error, it returns -1 and errno is appropriately set. Otherwise, it
- * returns the number of bytes sent.
- */
-int mnl_socket_sendmsg(const struct mnl_socket *nl,
- const struct msghdr *msg, int flags)
-{
- return sendmsg(nl->fd, msg, flags);
-}
-
-/**
* mnl_socket_recvfrom - receive a netlink message
* @nl: netlink socket obtained via mnl_socket_open()
* @buf: buffer that you want to use to store the netlink message
@@ -185,21 +170,6 @@ int mnl_socket_recvfrom(const struct mnl_socket *nl, void *buf, size_t bufsiz)
}
/**
- * mnl_socket_recvmsg- receive a netlink message
- * @nl: netlink socket obtained via mnl_socket_open()
- * @msg: pointer to struct msghdr (must be initialized appropriately)
- * @flags: flags passed to recvmsg()
- *
- * On error, this function returns -1 and errno is appropriately set.
- * On sucess, this function returns the number of bytes received.
- */
-int mnl_socket_recvmsg(const struct mnl_socket *nl,
- struct msghdr *msg, int flags)
-{
- return recvmsg(nl->fd, msg, flags);
-}
-
-/**
* mnl_socket_close - close a given netlink socket
* @nl: netlink socket obtained via mnl_socket_open()
*