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

libnl 3.12.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
13extern "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
24extern struct rtnl_link *rtnl_link_vlan_alloc(void);
25
26extern int rtnl_link_is_vlan(struct rtnl_link *);
27
28extern char * rtnl_link_vlan_flags2str(int, char *, size_t);
29extern int rtnl_link_vlan_str2flags(const char *);
30
31extern int rtnl_link_vlan_set_protocol(struct rtnl_link *link, uint16_t);
32extern int rtnl_link_vlan_get_protocol(struct rtnl_link *link);
33
34extern int rtnl_link_vlan_set_id(struct rtnl_link *, uint16_t);
35extern int rtnl_link_vlan_get_id(struct rtnl_link *);
36
37extern int rtnl_link_vlan_set_flags(struct rtnl_link *,
38 unsigned int);
39extern int rtnl_link_vlan_unset_flags(struct rtnl_link *,
40 unsigned int);
41extern int rtnl_link_vlan_get_flags(struct rtnl_link *);
42
43extern int rtnl_link_vlan_set_ingress_map(struct rtnl_link *,
44 int, uint32_t);
45extern uint32_t * rtnl_link_vlan_get_ingress_map(struct rtnl_link *);
46
47extern int rtnl_link_vlan_set_egress_map(struct rtnl_link *,
48 uint32_t, int);
49extern 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:490
rtnl_link_vlan_unset_flags
int rtnl_link_vlan_unset_flags(struct rtnl_link *, unsigned int)
Unset VLAN flags.
Definition vlan.c:529
rtnl_link_vlan_set_id
int rtnl_link_vlan_set_id(struct rtnl_link *, uint16_t)
Set VLAN ID.
Definition vlan.c:433
rtnl_link_vlan_set_protocol
int rtnl_link_vlan_set_protocol(struct rtnl_link *link, uint16_t)
Set VLAN protocol.
Definition vlan.c:471
rtnl_link_is_vlan
int rtnl_link_is_vlan(struct rtnl_link *)
Check if link is a VLAN link.
Definition vlan.c:421
rtnl_link_vlan_get_id
int rtnl_link_vlan_get_id(struct rtnl_link *)
Get VLAN Id.
Definition vlan.c:451
rtnl_link_vlan_alloc
struct rtnl_link * rtnl_link_vlan_alloc(void)
Allocate link object of type VLAN.
Definition vlan.c:400
rtnl_link_vlan_set_flags
int rtnl_link_vlan_set_flags(struct rtnl_link *, unsigned int)
Set VLAN flags.
Definition vlan.c:509
rtnl_link_vlan_get_flags
int rtnl_link_vlan_get_flags(struct rtnl_link *)
Get VLAN flags.
Definition vlan.c:548
rtnl_link
Link object.
Definition nl-route.h:29
vlan_map
Definition vlan.h:17