libnl: /data/src/libnl3/include/netlink/route/link/vlan.h Source File

libnl 3.7.0

vlan.h
1 /* SPDX-License-Identifier: LGPL-2.1-only */
2 /*
3 * Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch>
4 */
5
6 #ifndef NETLINK_LINK_VLAN_H_
7 #define NETLINK_LINK_VLAN_H_
8
9 #include <netlink/netlink.h>
10 #include <netlink/route/link.h>
11
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15
16 struct vlan_map
17 {
18 uint32_t vm_from;
19 uint32_t vm_to;
20 };
21
22 #define VLAN_PRIO_MAX 7
23
24 extern struct rtnl_link *rtnl_link_vlan_alloc(void);
25
26 extern int rtnl_link_is_vlan(struct rtnl_link *);
27
28 extern char * rtnl_link_vlan_flags2str(int, char *, size_t);
29 extern int rtnl_link_vlan_str2flags(const char *);
30
31 extern int rtnl_link_vlan_set_protocol(struct rtnl_link *link, uint16_t);
32 extern int rtnl_link_vlan_get_protocol(struct rtnl_link *link);
33
34 extern int rtnl_link_vlan_set_id(struct rtnl_link *, uint16_t);
35 extern int rtnl_link_vlan_get_id(struct rtnl_link *);
36
37 extern int rtnl_link_vlan_set_flags(struct rtnl_link *,
38 unsigned int);
39 extern int rtnl_link_vlan_unset_flags(struct rtnl_link *,
40 unsigned int);
41 extern int rtnl_link_vlan_get_flags(struct rtnl_link *);
42
43 extern int rtnl_link_vlan_set_ingress_map(struct rtnl_link *,
44 int, uint32_t);
45 extern uint32_t * rtnl_link_vlan_get_ingress_map(struct rtnl_link *);
46
47 extern int rtnl_link_vlan_set_egress_map(struct rtnl_link *,
48 uint32_t, int);
49 extern struct vlan_map *rtnl_link_vlan_get_egress_map(struct rtnl_link *,
50 int *);
51
52 #ifdef __cplusplus
53 }
54 #endif
55
56 #endif
rtnl_link_vlan_get_protocol
int rtnl_link_vlan_get_protocol(struct rtnl_link *link)
Get VLAN protocol.
Definition: vlan.c:476
rtnl_link_vlan_alloc
struct rtnl_link * rtnl_link_vlan_alloc(void)
Allocate link object of type VLAN.
Definition: vlan.c:386
rtnl_link_vlan_unset_flags
int rtnl_link_vlan_unset_flags(struct rtnl_link *, unsigned int)
Unset VLAN flags.
Definition: vlan.c:515
rtnl_link_vlan_set_id
int rtnl_link_vlan_set_id(struct rtnl_link *, uint16_t)
Set VLAN ID.
Definition: vlan.c:419
rtnl_link_vlan_set_protocol
int rtnl_link_vlan_set_protocol(struct rtnl_link *link, uint16_t)
Set VLAN protocol.
Definition: vlan.c:457
rtnl_link_is_vlan
int rtnl_link_is_vlan(struct rtnl_link *)
Check if link is a VLAN link.
Definition: vlan.c:407
rtnl_link_vlan_get_id
int rtnl_link_vlan_get_id(struct rtnl_link *)
Get VLAN Id.
Definition: vlan.c:437
rtnl_link_vlan_set_flags
int rtnl_link_vlan_set_flags(struct rtnl_link *, unsigned int)
Set VLAN flags.
Definition: vlan.c:495
rtnl_link_vlan_get_flags
int rtnl_link_vlan_get_flags(struct rtnl_link *)
Get VLAN flags.
Definition: vlan.c:534
rtnl_link
Link object.
vlan_map
Definition: vlan.h:17