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-2008 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 char *		rtnl_link_vlan_flags2str(int, char *, size_t);
31 extern int		rtnl_link_vlan_str2flags(const char *);
32 
33 extern int		rtnl_link_vlan_set_id(struct rtnl_link *, int);
34 extern int		rtnl_link_vlan_get_id(struct rtnl_link *);
35 
36 extern int		rtnl_link_vlan_set_flags(struct rtnl_link *,
37 						 unsigned int);
38 extern int		rtnl_link_vlan_unset_flags(struct rtnl_link *,
39 						   unsigned int);
40 extern unsigned int	rtnl_link_vlan_get_flags(struct rtnl_link *);
41 
42 extern int		rtnl_link_vlan_set_ingress_map(struct rtnl_link *,
43 						       int, uint32_t);
44 extern uint32_t *	rtnl_link_vlan_get_ingress_map(struct rtnl_link *);
45 
46 extern int		rtnl_link_vlan_set_egress_map(struct rtnl_link *,
47 						      uint32_t, int);
48 extern struct vlan_map *rtnl_link_vlan_get_egress_map(struct rtnl_link *,
49 						      int *);
50 
51 #ifdef __cplusplus
52 }
53 #endif
54 
55 #endif
56