libnl  3.2.24-rc1
vlan.h
1 /*
2  * netlink/route/link/vlan.h VLAN interface
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation version 2.1
7  * of the License.
8  *
9  * Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch>
10  */
11 
12 #ifndef NETLINK_LINK_VLAN_H_
13 #define NETLINK_LINK_VLAN_H_
14 
15 #include <netlink/netlink.h>
16 #include <netlink/route/link.h>
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 struct vlan_map
23 {
24  uint32_t vm_from;
25  uint32_t vm_to;
26 };
27 
28 #define VLAN_PRIO_MAX 7
29 
30 extern struct rtnl_link *rtnl_link_vlan_alloc(void);
31 
32 extern int rtnl_link_is_vlan(struct rtnl_link *);
33 
34 extern char * rtnl_link_vlan_flags2str(int, char *, size_t);
35 extern int rtnl_link_vlan_str2flags(const char *);
36 
37 extern int rtnl_link_vlan_set_id(struct rtnl_link *, uint16_t);
38 extern int rtnl_link_vlan_get_id(struct rtnl_link *);
39 
40 extern int rtnl_link_vlan_set_flags(struct rtnl_link *,
41  unsigned int);
42 extern int rtnl_link_vlan_unset_flags(struct rtnl_link *,
43  unsigned int);
44 extern int rtnl_link_vlan_get_flags(struct rtnl_link *);
45 
46 extern int rtnl_link_vlan_set_ingress_map(struct rtnl_link *,
47  int, uint32_t);
48 extern uint32_t * rtnl_link_vlan_get_ingress_map(struct rtnl_link *);
49 
50 extern int rtnl_link_vlan_set_egress_map(struct rtnl_link *,
51  uint32_t, int);
52 extern struct vlan_map *rtnl_link_vlan_get_egress_map(struct rtnl_link *,
53  int *);
54 
55 #ifdef __cplusplus
56 }
57 #endif
58 
59 #endif