]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
veth: use kernel header file
authorStephen Hemminger <shemminger@linux-foundation.org>
Fri, 21 Dec 2007 17:37:30 +0000 (09:37 -0800)
committerStephen Hemminger <shemminger@linux-foundation.org>
Fri, 21 Dec 2007 17:37:30 +0000 (09:37 -0800)
Use santized kernel header for veth.h and put in correct place
to prevent possible future problems with API.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
include/net/veth.h [moved from ip/veth.h with 71% similarity]
ip/link_veth.c

similarity index 71%
rename from ip/veth.h
rename to include/net/veth.h
index aa2e6f9101058b3207be508a1718dcf60fd67157..3354c1eb424e6a7813ef1f1f6eb90c899cded6fe 100644 (file)
--- a/ip/veth.h
@@ -1,5 +1,5 @@
-#ifndef __NET_VETH_H__
-#define __NET_VETH_H__
+#ifndef __NET_VETH_H_
+#define __NET_VETH_H_
 
 enum {
        VETH_INFO_UNSPEC,
index 226b4ef4c7b54f5beef4a2014bd4d8207704985c..9dfb78f6019bcea7d725c603c27d65d0c38d2cfe 100644 (file)
  */
 
 #include <string.h>
+#include <net/if.h>
+#include <net/veth.h>
 
 #include "utils.h"
 #include "ip_common.h"
-#include "veth.h"
-
-#define        IFNAMSIZ        16
 
 static void usage(void)
 {
        printf("Usage: ip link <options> type veth "
-               "[peer <options>]\nTo get <options> type "
-               "'ip link add help'\n");
+              "[peer <options>]\nTo get <options> type "
+              "'ip link add help'\n");
 }
 
 static int veth_parse_opt(struct link_util *lu, int argc, char **argv,
-               struct nlmsghdr *hdr)
+                         struct nlmsghdr *hdr)
 {
        char *name, *type, *link, *dev;
        int err, len;
@@ -43,7 +42,7 @@ static int veth_parse_opt(struct link_util *lu, int argc, char **argv,
        hdr->nlmsg_len += sizeof(struct ifinfomsg);
 
        err = iplink_parse(argc - 1, argv + 1, (struct iplink_req *)hdr,
-                       &name, &type, &link, &dev);
+                          &name, &type, &link, &dev);
        if (err < 0)
                return err;