veth: use kernel header file
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>
This commit is contained in:
parent
f9329ccaf9
commit
c595fda55b
|
|
@ -1,5 +1,5 @@
|
||||||
#ifndef __NET_VETH_H__
|
#ifndef __NET_VETH_H_
|
||||||
#define __NET_VETH_H__
|
#define __NET_VETH_H_
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
VETH_INFO_UNSPEC,
|
VETH_INFO_UNSPEC,
|
||||||
|
|
@ -11,22 +11,21 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <net/if.h>
|
||||||
|
#include <net/veth.h>
|
||||||
|
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "ip_common.h"
|
#include "ip_common.h"
|
||||||
#include "veth.h"
|
|
||||||
|
|
||||||
#define IFNAMSIZ 16
|
|
||||||
|
|
||||||
static void usage(void)
|
static void usage(void)
|
||||||
{
|
{
|
||||||
printf("Usage: ip link <options> type veth "
|
printf("Usage: ip link <options> type veth "
|
||||||
"[peer <options>]\nTo get <options> type "
|
"[peer <options>]\nTo get <options> type "
|
||||||
"'ip link add help'\n");
|
"'ip link add help'\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static int veth_parse_opt(struct link_util *lu, int argc, char **argv,
|
static int veth_parse_opt(struct link_util *lu, int argc, char **argv,
|
||||||
struct nlmsghdr *hdr)
|
struct nlmsghdr *hdr)
|
||||||
{
|
{
|
||||||
char *name, *type, *link, *dev;
|
char *name, *type, *link, *dev;
|
||||||
int err, len;
|
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);
|
hdr->nlmsg_len += sizeof(struct ifinfomsg);
|
||||||
|
|
||||||
err = iplink_parse(argc - 1, argv + 1, (struct iplink_req *)hdr,
|
err = iplink_parse(argc - 1, argv + 1, (struct iplink_req *)hdr,
|
||||||
&name, &type, &link, &dev);
|
&name, &type, &link, &dev);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue