}
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);
}
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;
}
-extern void rtnlmsg_free(struct rtnlmsg *rtnlmsg)
-{
- free(rtnlmsg);
-}
+extern void rtnlmsg_free(struct rtnlmsg *rtnlmsg) { free(rtnlmsg); }
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
#ifndef __LXC_RTNL_H
#define __LXC_RTNL_H
*
* @nlh: the netlink socket handler
*/
-struct rtnl_handler
-{
+struct rtnl_handler {
struct nl_handler nlh;
};
*
* 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
*
* 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
*
* 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
*
* 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);
-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
*
* Returns 0 on success, < 0 otherwise
*/
-int rtnetlink_transaction(struct rtnl_handler *handler,
- struct rtnlmsg *request, struct rtnlmsg *answer);
-#endif
+extern int rtnetlink_transaction(struct rtnl_handler *handler,
+ struct rtnlmsg *request,
+ struct rtnlmsg *answer);
+
+#endif /* __LXC_RTNL_H */