]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
rtnl: non-functional changes
authorChristian Brauner <christian.brauner@ubuntu.com>
Fri, 25 Aug 2017 05:07:43 +0000 (07:07 +0200)
committerStéphane Graber <stgraber@ubuntu.com>
Tue, 29 Aug 2017 18:15:04 +0000 (14:15 -0400)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/rtnl.c
src/lxc/rtnl.h

index 186c788a01344b6ebda9eb8a7a832b5af616126e..dd8f095f17d05fa237c27f0d219b0ff9d0212683 100644 (file)
@@ -54,20 +54,24 @@ extern int rtnetlink_send(struct rtnl_handler *handler, struct rtnlmsg *rtnlmsg)
 }
 
 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); }
index d9ad45d71b3ff635c320836609b963471777b766..5d6e5a852dfed7d40ed3539a0cc47bc19feff50d 100644 (file)
@@ -20,6 +20,7 @@
  * 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
 
@@ -35,8 +36,7 @@
  *
  * @nlh: the netlink socket handler
  */
-struct rtnl_handler
-{
+struct rtnl_handler {
        struct nl_handler nlh;
 };
 
@@ -59,7 +59,7 @@ struct rtnlmsg {
  *
  * 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
@@ -68,7 +68,7 @@ int rtnetlink_open(struct rtnl_handler *handler);
  *
  * 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
@@ -79,7 +79,7 @@ int rtnetlink_close(struct rtnl_handler *handler);
  *
  * 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
@@ -90,11 +90,12 @@ int rtnetlink_rcv(struct rtnl_handler *handler, struct rtnlmsg *rtnlmsg);
  *
  * 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
@@ -105,6 +106,8 @@ void rtnlmsg_free(struct rtnlmsg *rtnlmsg);
  *
  * 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 */