| 1 |
/* SPDX-License-Identifier: LGPL-2.1-only */ |
| 2 |
/* |
| 3 |
* Copyright (c) 2003-2013 Thomas Graf <[email protected]> |
| 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 |