libnl 3.5.0

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_protocol(struct rtnl_link *link, uint16_t);
38 extern int rtnl_link_vlan_get_protocol(struct rtnl_link *link);
39
40 extern int rtnl_link_vlan_set_id(struct rtnl_link *, uint16_t);
41 extern int rtnl_link_vlan_get_id(struct rtnl_link *);
42
43 extern int rtnl_link_vlan_set_flags(struct rtnl_link *,
44 unsigned int);
45 extern int rtnl_link_vlan_unset_flags(struct rtnl_link *,
46 unsigned int);
47 extern int rtnl_link_vlan_get_flags(struct rtnl_link *);
48
49 extern int rtnl_link_vlan_set_ingress_map(struct rtnl_link *,
50 int, uint32_t);
51 extern uint32_t * rtnl_link_vlan_get_ingress_map(struct rtnl_link *);
52
53 extern int rtnl_link_vlan_set_egress_map(struct rtnl_link *,
54 uint32_t, int);
55 extern struct vlan_map *rtnl_link_vlan_get_egress_map(struct rtnl_link *,
56 int *);
57
58 #ifdef __cplusplus
59 }
60 #endif
61
62 #endif
rtnl_link_vlan_set_flags
int rtnl_link_vlan_set_flags(struct rtnl_link *, unsigned int)
Set VLAN flags.
Definition: vlan.c:502
rtnl_link_vlan_alloc
struct rtnl_link * rtnl_link_vlan_alloc(void)
Allocate link object of type VLAN.
Definition: vlan.c:392
rtnl_link_vlan_get_flags
int rtnl_link_vlan_get_flags(struct rtnl_link *)
Get VLAN flags.
Definition: vlan.c:541
rtnl_link
Link object.
rtnl_link_vlan_get_id
int rtnl_link_vlan_get_id(struct rtnl_link *)
Get VLAN Id.
Definition: vlan.c:444
rtnl_link_vlan_get_protocol
int rtnl_link_vlan_get_protocol(struct rtnl_link *link)
Get VLAN protocol.
Definition: vlan.c:483
rtnl_link_vlan_unset_flags
int rtnl_link_vlan_unset_flags(struct rtnl_link *, unsigned int)
Unset VLAN flags.
Definition: vlan.c:522
vlan_map
Definition: vlan.h:22
rtnl_link_vlan_set_protocol
int rtnl_link_vlan_set_protocol(struct rtnl_link *link, uint16_t)
Set VLAN protocol.
Definition: vlan.c:464
rtnl_link_is_vlan
int rtnl_link_is_vlan(struct rtnl_link *)
Check if link is a VLAN link.
Definition: vlan.c:414
rtnl_link_vlan_set_id
int rtnl_link_vlan_set_id(struct rtnl_link *, uint16_t)
Set VLAN ID.
Definition: vlan.c:426