Unverified Commit 9de45f8f by Christian Brauner Committed by Stéphane Graber

rtnl: non-functional changes

parent f23b538c
...@@ -54,20 +54,24 @@ extern int rtnetlink_send(struct rtnl_handler *handler, struct rtnlmsg *rtnlmsg) ...@@ -54,20 +54,24 @@ extern int rtnetlink_send(struct rtnl_handler *handler, struct rtnlmsg *rtnlmsg)
} }
extern int rtnetlink_transaction(struct rtnl_handler *handler, extern int rtnetlink_transaction(struct rtnl_handler *handler,
struct rtnlmsg *request, struct rtnlmsg *answer) struct rtnlmsg *request,
struct rtnlmsg *answer)
{ {
return netlink_transaction(&handler->nlh, (struct nlmsg *)&request->nlmsghdr, return netlink_transaction(&handler->nlh,
(struct nlmsg *)&request->nlmsghdr,
(struct nlmsg *)&answer->nlmsghdr); (struct nlmsg *)&answer->nlmsghdr);
} }
extern struct rtnlmsg *rtnlmsg_alloc(size_t size) extern struct rtnlmsg *rtnlmsg_alloc(size_t size)
{ {
/* size_t len = NLMSG_LENGTH(NLMSG_ALIGN(sizeof(struct rtnlmsghdr))) + size; */ /*
/* return (struct rtnlmsg *)nlmsg_alloc(len); */ size_t len;
len = NLMSG_LENGTH(NLMSG_ALIGN(sizeof(struct rtnlmsghdr))) + size;
return (struct rtnlmsg *)nlmsg_alloc(len);
*/
return NULL; return NULL;
} }
extern void rtnlmsg_free(struct rtnlmsg *rtnlmsg) extern void rtnlmsg_free(struct rtnlmsg *rtnlmsg) { free(rtnlmsg); }
{
free(rtnlmsg);
}
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifndef __LXC_RTNL_H #ifndef __LXC_RTNL_H
#define __LXC_RTNL_H #define __LXC_RTNL_H
...@@ -35,8 +36,7 @@ ...@@ -35,8 +36,7 @@
* *
* @nlh: the netlink socket handler * @nlh: the netlink socket handler
*/ */
struct rtnl_handler struct rtnl_handler {
{
struct nl_handler nlh; struct nl_handler nlh;
}; };
...@@ -59,7 +59,7 @@ struct rtnlmsg { ...@@ -59,7 +59,7 @@ struct rtnlmsg {
* *
* Returns 0 on success, < 0 otherwise * Returns 0 on success, < 0 otherwise
*/ */
int rtnetlink_open(struct rtnl_handler *handler); extern int rtnetlink_open(struct rtnl_handler *handler);
/* /*
* genetlink_close : close a route netlink socket * genetlink_close : close a route netlink socket
...@@ -68,7 +68,7 @@ int rtnetlink_open(struct rtnl_handler *handler); ...@@ -68,7 +68,7 @@ int rtnetlink_open(struct rtnl_handler *handler);
* *
* Returns 0 on success, < 0 otherwise * Returns 0 on success, < 0 otherwise
*/ */
int rtnetlink_close(struct rtnl_handler *handler); extern int rtnetlink_close(struct rtnl_handler *handler);
/* /*
* rtnetlink_rcv : receive a route netlink socket, it is up * rtnetlink_rcv : receive a route netlink socket, it is up
...@@ -79,7 +79,7 @@ int rtnetlink_close(struct rtnl_handler *handler); ...@@ -79,7 +79,7 @@ int rtnetlink_close(struct rtnl_handler *handler);
* *
* Returns 0 on success, < 0 otherwise * Returns 0 on success, < 0 otherwise
*/ */
int rtnetlink_rcv(struct rtnl_handler *handler, struct rtnlmsg *rtnlmsg); extern int rtnetlink_rcv(struct rtnl_handler *handler, struct rtnlmsg *rtnlmsg);
/* /*
* rtnetlink_send : send a route netlink socket, it is up * rtnetlink_send : send a route netlink socket, it is up
...@@ -90,11 +90,12 @@ int rtnetlink_rcv(struct rtnl_handler *handler, struct rtnlmsg *rtnlmsg); ...@@ -90,11 +90,12 @@ int rtnetlink_rcv(struct rtnl_handler *handler, struct rtnlmsg *rtnlmsg);
* *
* Returns 0 on success, < 0 otherwise * Returns 0 on success, < 0 otherwise
*/ */
int rtnetlink_send(struct rtnl_handler *handler, struct rtnlmsg *rtnlmsg); extern int rtnetlink_send(struct rtnl_handler *handler,
struct rtnlmsg *rtnlmsg);
struct genlmsg *genlmsg_alloc(size_t size); struct genlmsg *genlmsg_alloc(size_t size);
void rtnlmsg_free(struct rtnlmsg *rtnlmsg); extern void rtnlmsg_free(struct rtnlmsg *rtnlmsg);
/* /*
* rtnetlink_transaction : send and receive a route netlink message in one shot * rtnetlink_transaction : send and receive a route netlink message in one shot
...@@ -105,6 +106,8 @@ void rtnlmsg_free(struct rtnlmsg *rtnlmsg); ...@@ -105,6 +106,8 @@ void rtnlmsg_free(struct rtnlmsg *rtnlmsg);
* *
* Returns 0 on success, < 0 otherwise * Returns 0 on success, < 0 otherwise
*/ */
int rtnetlink_transaction(struct rtnl_handler *handler, extern int rtnetlink_transaction(struct rtnl_handler *handler,
struct rtnlmsg *request, struct rtnlmsg *answer); struct rtnlmsg *request,
#endif struct rtnlmsg *answer);
#endif /* __LXC_RTNL_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment