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

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

Version: ~ [ linux-5.11-rc3 ] ~ [ linux-5.10.7 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.89 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.167 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.215 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.251 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.251 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ 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.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

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

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

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | 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.

osdn.jp