~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/net/batman-adv/bridge_loop_avoidance.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /* Copyright (C) B.A.T.M.A.N. contributors:
  3  *
  4  * Simon Wunderlich
  5  */
  6 
  7 #ifndef _NET_BATMAN_ADV_BLA_H_
  8 #define _NET_BATMAN_ADV_BLA_H_
  9 
 10 #include "main.h"
 11 
 12 #include <linux/compiler.h>
 13 #include <linux/netdevice.h>
 14 #include <linux/netlink.h>
 15 #include <linux/skbuff.h>
 16 #include <linux/stddef.h>
 17 #include <linux/types.h>
 18 
 19 /**
 20  * batadv_bla_is_loopdetect_mac() - check if the mac address is from a loop
 21  *  detect frame sent by bridge loop avoidance
 22  * @mac: mac address to check
 23  *
 24  * Return: true if the it looks like a loop detect frame
 25  * (mac starts with BA:BE), false otherwise
 26  */
 27 static inline bool batadv_bla_is_loopdetect_mac(const uint8_t *mac)
 28 {
 29         if (mac[0] == 0xba && mac[1] == 0xbe)
 30                 return true;
 31 
 32         return false;
 33 }
 34 
 35 #ifdef CONFIG_BATMAN_ADV_BLA
 36 bool batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb,
 37                    unsigned short vid, int packet_type);
 38 bool batadv_bla_tx(struct batadv_priv *bat_priv, struct sk_buff *skb,
 39                    unsigned short vid);
 40 bool batadv_bla_is_backbone_gw(struct sk_buff *skb,
 41                                struct batadv_orig_node *orig_node,
 42                                int hdr_size);
 43 int batadv_bla_claim_dump(struct sk_buff *msg, struct netlink_callback *cb);
 44 int batadv_bla_backbone_dump(struct sk_buff *msg, struct netlink_callback *cb);
 45 bool batadv_bla_is_backbone_gw_orig(struct batadv_priv *bat_priv, u8 *orig,
 46                                     unsigned short vid);
 47 bool batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv,
 48                                     struct sk_buff *skb);
 49 void batadv_bla_update_orig_address(struct batadv_priv *bat_priv,
 50                                     struct batadv_hard_iface *primary_if,
 51                                     struct batadv_hard_iface *oldif);
 52 void batadv_bla_status_update(struct net_device *net_dev);
 53 int batadv_bla_init(struct batadv_priv *bat_priv);
 54 void batadv_bla_free(struct batadv_priv *bat_priv);
 55 #ifdef CONFIG_BATMAN_ADV_DAT
 56 bool batadv_bla_check_claim(struct batadv_priv *bat_priv, u8 *addr,
 57                             unsigned short vid);
 58 #endif
 59 #define BATADV_BLA_CRC_INIT     0
 60 #else /* ifdef CONFIG_BATMAN_ADV_BLA */
 61 
 62 static inline bool batadv_bla_rx(struct batadv_priv *bat_priv,
 63                                  struct sk_buff *skb, unsigned short vid,
 64                                  int packet_type)
 65 {
 66         return false;
 67 }
 68 
 69 static inline bool batadv_bla_tx(struct batadv_priv *bat_priv,
 70                                  struct sk_buff *skb, unsigned short vid)
 71 {
 72         return false;
 73 }
 74 
 75 static inline bool batadv_bla_is_backbone_gw(struct sk_buff *skb,
 76                                              struct batadv_orig_node *orig_node,
 77                                              int hdr_size)
 78 {
 79         return false;
 80 }
 81 
 82 static inline bool batadv_bla_is_backbone_gw_orig(struct batadv_priv *bat_priv,
 83                                                   u8 *orig, unsigned short vid)
 84 {
 85         return false;
 86 }
 87 
 88 static inline bool
 89 batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv,
 90                                struct sk_buff *skb)
 91 {
 92         return false;
 93 }
 94 
 95 static inline void
 96 batadv_bla_update_orig_address(struct batadv_priv *bat_priv,
 97                                struct batadv_hard_iface *primary_if,
 98                                struct batadv_hard_iface *oldif)
 99 {
100 }
101 
102 static inline int batadv_bla_init(struct batadv_priv *bat_priv)
103 {
104         return 1;
105 }
106 
107 static inline void batadv_bla_free(struct batadv_priv *bat_priv)
108 {
109 }
110 
111 static inline int batadv_bla_claim_dump(struct sk_buff *msg,
112                                         struct netlink_callback *cb)
113 {
114         return -EOPNOTSUPP;
115 }
116 
117 static inline int batadv_bla_backbone_dump(struct sk_buff *msg,
118                                            struct netlink_callback *cb)
119 {
120         return -EOPNOTSUPP;
121 }
122 
123 static inline
124 bool batadv_bla_check_claim(struct batadv_priv *bat_priv, u8 *addr,
125                             unsigned short vid)
126 {
127         return true;
128 }
129 
130 #endif /* ifdef CONFIG_BATMAN_ADV_BLA */
131 
132 #endif /* ifndef _NET_BATMAN_ADV_BLA_H_ */
133 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php