Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
bridge_loop_avoidance.c File Reference
#include "main.h"
#include "hash.h"
#include "hard-interface.h"
#include "originator.h"
#include "bridge_loop_avoidance.h"
#include "translation-table.h"
#include "send.h"
#include <linux/etherdevice.h>
#include <linux/crc16.h>
#include <linux/if_arp.h>
#include <net/arp.h>
#include <linux/if_vlan.h>

Go to the source code of this file.

Functions

void batadv_bla_update_orig_address (struct batadv_priv *bat_priv, struct batadv_hard_iface *primary_if, struct batadv_hard_iface *oldif)
 
int batadv_bla_init (struct batadv_priv *bat_priv)
 
int batadv_bla_check_bcast_duplist (struct batadv_priv *bat_priv, struct batadv_bcast_packet *bcast_packet, int bcast_packet_len)
 
int batadv_bla_is_backbone_gw_orig (struct batadv_priv *bat_priv, uint8_t *orig)
 
int batadv_bla_is_backbone_gw (struct sk_buff *skb, struct batadv_orig_node *orig_node, int hdr_size)
 
void batadv_bla_free (struct batadv_priv *bat_priv)
 
int batadv_bla_rx (struct batadv_priv *bat_priv, struct sk_buff *skb, short vid, bool is_bcast)
 
int batadv_bla_tx (struct batadv_priv *bat_priv, struct sk_buff *skb, short vid)
 
int batadv_bla_claim_table_seq_print_text (struct seq_file *seq, void *offset)
 
int batadv_bla_backbone_table_seq_print_text (struct seq_file *seq, void *offset)
 

Function Documentation

int batadv_bla_backbone_table_seq_print_text ( struct seq_file seq,
void offset 
)

Definition at line 1634 of file bridge_loop_avoidance.c.

int batadv_bla_check_bcast_duplist ( struct batadv_priv bat_priv,
struct batadv_bcast_packet bcast_packet,
int  bcast_packet_len 
)

batadv_bla_check_bcast_duplist : the bat priv with all the soft interface information : encapsulated broadcast frame plus batman header : length of encapsulated broadcast frame plus batman header

check if it is on our broadcast list. Another gateway might have sent the same packet because it is connected to the same backbone, so we have to remove this duplicate.

This is performed by checking the CRC, which will tell us with a good chance that it is the same packet. If it is furthermore sent by another host, drop it. We allow equal packets from the same host however as this might be intended.

Definition at line 1227 of file bridge_loop_avoidance.c.

int batadv_bla_claim_table_seq_print_text ( struct seq_file seq,
void offset 
)

Definition at line 1577 of file bridge_loop_avoidance.c.

void batadv_bla_free ( struct batadv_priv bat_priv)

Definition at line 1372 of file bridge_loop_avoidance.c.

int batadv_bla_init ( struct batadv_priv bat_priv)

Definition at line 1162 of file bridge_loop_avoidance.c.

int batadv_bla_is_backbone_gw ( struct sk_buff skb,
struct batadv_orig_node orig_node,
int  hdr_size 
)

batadv_bla_is_backbone_gw : the frame to be checked : the orig_node of the frame : maximum length of the frame

bla_is_backbone_gw inspects the skb for the VLAN ID and returns 1 if the orig_node is also a gateway on the soft interface, otherwise it returns 0.

Definition at line 1336 of file bridge_loop_avoidance.c.

int batadv_bla_is_backbone_gw_orig ( struct batadv_priv bat_priv,
uint8_t orig 
)

Definition at line 1295 of file bridge_loop_avoidance.c.

int batadv_bla_rx ( struct batadv_priv bat_priv,
struct sk_buff skb,
short  vid,
bool  is_bcast 
)

batadv_bla_rx : the bat priv with all the soft interface information : the frame to be checked : the VLAN ID of the frame : the packet came in a broadcast packet type.

bla_rx avoidance checks if:

  • we have to race for a claim
  • if the frame is allowed on the LAN

in these cases, the skb is further handled by this function and returns 1, otherwise it returns 0 and the caller shall further process the skb.

Definition at line 1408 of file bridge_loop_avoidance.c.

int batadv_bla_tx ( struct batadv_priv bat_priv,
struct sk_buff skb,
short  vid 
)

batadv_bla_tx : the bat priv with all the soft interface information : the frame to be checked : the VLAN ID of the frame

bla_tx checks if:

  • a claim was received which has to be processed
  • the frame is allowed on the mesh

in these cases, the skb is further handled by this function and returns 1, otherwise it returns 0 and the caller shall further process the skb.

Definition at line 1503 of file bridge_loop_avoidance.c.

void batadv_bla_update_orig_address ( struct batadv_priv bat_priv,
struct batadv_hard_iface primary_if,
struct batadv_hard_iface oldif 
)

batadv_bla_update_orig_address : the bat priv with all the soft interface information : the new selected primary_if : the old primary interface, may be NULL

Update the backbone gateways when the own orig address changes.

Definition at line 1042 of file bridge_loop_avoidance.c.