Home | History | Annotate | Download | only in link
      1 /*
      2  * netlink/route/link/bridge.h		Bridge
      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) 2013 Thomas Graf <tgraf (at) suug.ch>
     10  */
     11 
     12 #ifndef NETLINK_LINK_BRIDGE_H_
     13 #define NETLINK_LINK_BRIDGE_H_
     14 
     15 #include <netlink/netlink.h>
     16 #include <netlink/route/link.h>
     17 
     18 #ifdef __cplusplus
     19 extern "C" {
     20 #endif
     21 
     22 /**
     23  * Bridge flags
     24  * @ingroup bridge
     25  */
     26 enum rtnl_link_bridge_flags {
     27 	RTNL_BRIDGE_HAIRPIN_MODE	= 0x0001,
     28 	RTNL_BRIDGE_BPDU_GUARD		= 0x0002,
     29 	RTNL_BRIDGE_ROOT_BLOCK		= 0x0004,
     30 	RTNL_BRIDGE_FAST_LEAVE		= 0x0008,
     31 };
     32 
     33 extern struct rtnl_link *rtnl_link_bridge_alloc(void);
     34 
     35 extern int	rtnl_link_is_bridge(struct rtnl_link *);
     36 extern int	rtnl_link_bridge_has_ext_info(struct rtnl_link *);
     37 
     38 extern int	rtnl_link_bridge_set_port_state(struct rtnl_link *, uint8_t );
     39 extern int	rtnl_link_bridge_get_port_state(struct rtnl_link *);
     40 
     41 extern int	rtnl_link_bridge_set_priority(struct rtnl_link *, uint16_t);
     42 extern int	rtnl_link_bridge_get_priority(struct rtnl_link *);
     43 
     44 extern int	rtnl_link_bridge_set_cost(struct rtnl_link *, uint32_t);
     45 extern int	rtnl_link_bridge_get_cost(struct rtnl_link *, uint32_t *);
     46 
     47 extern int	rtnl_link_bridge_unset_flags(struct rtnl_link *, unsigned int);
     48 extern int	rtnl_link_bridge_set_flags(struct rtnl_link *, unsigned int);
     49 extern int	rtnl_link_bridge_get_flags(struct rtnl_link *);
     50 
     51 extern char * rtnl_link_bridge_flags2str(int, char *, size_t);
     52 extern int	rtnl_link_bridge_str2flags(const char *);
     53 
     54 extern int	rtnl_link_bridge_add(struct nl_sock *sk, const char *name);
     55 #ifdef __cplusplus
     56 }
     57 #endif
     58 
     59 #endif
     60 
     61