vlan.h

00001 /*
00002  * netlink/route/link/vlan.h            VLAN interface
00003  *
00004  *      This library is free software; you can redistribute it and/or
00005  *      modify it under the terms of the GNU Lesser General Public
00006  *      License as published by the Free Software Foundation version 2.1
00007  *      of the License.
00008  *
00009  * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch>
00010  */
00011 
00012 #ifndef NETLINK_LINK_VLAN_H_
00013 #define NETLINK_LINK_VLAN_H_
00014 
00015 #include <netlink/netlink.h>
00016 #include <netlink/route/link.h>
00017 
00018 #ifdef __cplusplus
00019 extern "C" {
00020 #endif
00021 
00022 struct vlan_map
00023 {
00024         uint32_t                vm_from;
00025         uint32_t                vm_to;
00026 };
00027 
00028 #define VLAN_PRIO_MAX 7
00029 
00030 extern char *           rtnl_link_vlan_flags2str(int, char *, size_t);
00031 extern int              rtnl_link_vlan_str2flags(const char *);
00032 
00033 extern int              rtnl_link_vlan_set_id(struct rtnl_link *, int);
00034 extern int              rtnl_link_vlan_get_id(struct rtnl_link *);
00035 
00036 extern int              rtnl_link_vlan_set_flags(struct rtnl_link *,
00037                                                  unsigned int);
00038 extern int              rtnl_link_vlan_unset_flags(struct rtnl_link *,
00039                                                    unsigned int);
00040 extern unsigned int     rtnl_link_vlan_get_flags(struct rtnl_link *);
00041 
00042 extern int              rtnl_link_vlan_set_ingress_map(struct rtnl_link *,
00043                                                        int, uint32_t);
00044 extern uint32_t *       rtnl_link_vlan_get_ingress_map(struct rtnl_link *);
00045 
00046 extern int              rtnl_link_vlan_set_egress_map(struct rtnl_link *,
00047                                                       uint32_t, int);
00048 extern struct vlan_map *rtnl_link_vlan_get_egress_map(struct rtnl_link *,
00049                                                       int *);
00050 
00051 #ifdef __cplusplus
00052 }
00053 #endif
00054 
00055 #endif