Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Enumerations | Functions | Variables
main.h File Reference
#include <linux/mutex.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/if_ether.h>
#include <linux/poll.h>
#include <linux/kthread.h>
#include <linux/pkt_sched.h>
#include <linux/workqueue.h>
#include <linux/percpu.h>
#include <linux/slab.h>
#include <net/sock.h>
#include <linux/jiffies.h>
#include <linux/seq_file.h>
#include "types.h"

Go to the source code of this file.

Macros

#define BATADV_DRIVER_AUTHOR
 
#define BATADV_DRIVER_DESC   "B.A.T.M.A.N. advanced"
 
#define BATADV_DRIVER_DEVICE   "batman-adv"
 
#define BATADV_SOURCE_VERSION   "2012.4.0"
 
#define BATADV_TQ_MAX_VALUE   255
 
#define BATADV_JITTER   20
 
#define BATADV_TTL   50
 
#define BATADV_PURGE_TIMEOUT   200000 /* 200 seconds */
 
#define BATADV_TT_LOCAL_TIMEOUT   3600000 /* in milliseconds */
 
#define BATADV_TT_CLIENT_ROAM_TIMEOUT   600000 /* in milliseconds */
 
#define BATADV_TT_CLIENT_TEMP_TIMEOUT   600000 /* in milliseconds */
 
#define BATADV_TQ_LOCAL_WINDOW_SIZE   64
 
#define BATADV_TT_REQUEST_TIMEOUT   3000
 
#define BATADV_TQ_GLOBAL_WINDOW_SIZE   5
 
#define BATADV_TQ_LOCAL_BIDRECT_SEND_MINIMUM   1
 
#define BATADV_TQ_LOCAL_BIDRECT_RECV_MINIMUM   1
 
#define BATADV_TQ_TOTAL_BIDRECT_LIMIT   1
 
#define BATADV_TT_OGM_APPEND_MAX   3
 
#define BATADV_ROAMING_MAX_TIME   20000
 
#define BATADV_ROAMING_MAX_COUNT   5
 
#define BATADV_NO_FLAGS   0
 
#define BATADV_NULL_IFINDEX   0 /* dummy ifindex used to avoid iface checks */
 
#define BATADV_NUM_WORDS   BITS_TO_LONGS(BATADV_TQ_LOCAL_WINDOW_SIZE)
 
#define BATADV_LOG_BUF_LEN   8192 /* has to be a power of 2 */
 
#define BATADV_VIS_INTERVAL   5000 /* 5 seconds */
 
#define BATADV_BONDING_TQ_THRESHOLD   50
 
#define BATADV_MAX_AGGREGATION_BYTES   512
 
#define BATADV_MAX_AGGREGATION_MS   100
 
#define BATADV_BLA_PERIOD_LENGTH   10000 /* 10 seconds */
 
#define BATADV_BLA_BACKBONE_TIMEOUT   (BATADV_BLA_PERIOD_LENGTH * 3)
 
#define BATADV_BLA_CLAIM_TIMEOUT   (BATADV_BLA_PERIOD_LENGTH * 10)
 
#define BATADV_DUPLIST_SIZE   16
 
#define BATADV_DUPLIST_TIMEOUT   500 /* 500 ms */
 
#define BATADV_RESET_PROTECTION_MS   30000
 
#define BATADV_EXPECTED_SEQNO_RANGE   65536
 
#define BATADV_BCAST_QUEUE_LEN   256
 
#define BATADV_BATMAN_QUEUE_LEN   256
 
#define BATADV_GW_THRESHOLD   50
 
#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define batadv_info(net_dev, fmt, arg...)
 
#define batadv_err(net_dev, fmt, arg...)
 
#define batadv_atomic_dec_not_zero(v)   atomic_add_unless((v), -1, 0)
 
#define batadv_smallest_signed_int(x)   (1u << (7u + 8u * (sizeof(x) - 1u)))
 
#define batadv_seq_before(x, y)
 
#define batadv_seq_after(x, y)   batadv_seq_before(y, x)
 
#define batadv_inc_counter(b, i)   batadv_add_counter(b, i, 1)
 

Enumerations

enum  batadv_mesh_state { BATADV_MESH_INACTIVE, BATADV_MESH_ACTIVE, BATADV_MESH_DEACTIVATING }
 
enum  batadv_uev_action { BATADV_UEV_ADD = 0, BATADV_UEV_DEL, BATADV_UEV_CHANGE }
 
enum  batadv_uev_type { BATADV_UEV_GW = 0 }
 
enum  batadv_dbg_level {
  BATADV_DBG_BATMAN = BIT(0), BATADV_DBG_ROUTES = BIT(1), BATADV_DBG_TT = BIT(2), BATADV_DBG_BLA = BIT(3),
  BATADV_DBG_ALL = 15
}
 

Functions

int batadv_mesh_init (struct net_device *soft_iface)
 
void batadv_mesh_free (struct net_device *soft_iface)
 
void batadv_inc_module_count (void)
 
void batadv_dec_module_count (void)
 
int batadv_is_my_mac (const uint8_t *addr)
 
int batadv_batman_skb_recv (struct sk_buff *skb, struct net_device *dev, struct packet_type *ptype, struct net_device *orig_dev)
 
int batadv_recv_handler_register (uint8_t packet_type, int(*recv_handler)(struct sk_buff *, struct batadv_hard_iface *))
 
void batadv_recv_handler_unregister (uint8_t packet_type)
 
int batadv_algo_register (struct batadv_algo_ops *bat_algo_ops)
 
int batadv_algo_select (struct batadv_priv *bat_priv, char *name)
 
int batadv_algo_seq_print_text (struct seq_file *seq, void *offset)
 
 __printf (3, 4) static inline void batadv_dbg(int type __always_unused
 

Variables

char batadv_routing_algo []
 
struct list_head batadv_hardif_list
 
unsigned char batadv_broadcast_addr []
 
struct workqueue_structbatadv_event_workqueue
 
struct batadv_priv *bat_priv __always_unused
 

Macro Definition Documentation

#define batadv_atomic_dec_not_zero (   v)    atomic_add_unless((v), -1, 0)
#define BATADV_BATMAN_QUEUE_LEN   256

Definition at line 106 of file main.h.

#define BATADV_BCAST_QUEUE_LEN   256

Definition at line 105 of file main.h.

#define BATADV_BLA_BACKBONE_TIMEOUT   (BATADV_BLA_PERIOD_LENGTH * 3)

Definition at line 90 of file main.h.

#define BATADV_BLA_CLAIM_TIMEOUT   (BATADV_BLA_PERIOD_LENGTH * 10)

Definition at line 91 of file main.h.

#define BATADV_BLA_PERIOD_LENGTH   10000 /* 10 seconds */

Definition at line 89 of file main.h.

#define BATADV_BONDING_TQ_THRESHOLD   50

Definition at line 81 of file main.h.

#define BATADV_DRIVER_AUTHOR
Value:
"Marek Lindner <[email protected]>, " \
"Simon Wunderlich <[email protected]>"

Definition at line 23 of file main.h.

#define BATADV_DRIVER_DESC   "B.A.T.M.A.N. advanced"

Definition at line 25 of file main.h.

#define BATADV_DRIVER_DEVICE   "batman-adv"

Definition at line 26 of file main.h.

#define BATADV_DUPLIST_SIZE   16

Definition at line 93 of file main.h.

#define BATADV_DUPLIST_TIMEOUT   500 /* 500 ms */

Definition at line 94 of file main.h.

#define batadv_err (   net_dev,
  fmt,
  arg... 
)
Value:
do { \
struct net_device *_netdev = (net_dev); \
struct batadv_priv *_batpriv = netdev_priv(_netdev); \
batadv_dbg(BATADV_DBG_ALL, _batpriv, fmt, ## arg); \
pr_err("%s: " fmt, _netdev->name, ## arg); \
} while (0)
#define BATADV_EXPECTED_SEQNO_RANGE   65536

Definition at line 97 of file main.h.

#define BATADV_GW_THRESHOLD   50

Definition at line 118 of file main.h.

#define batadv_inc_counter (   b,
  i 
)    batadv_add_counter(b, i, 1)
#define batadv_info (   net_dev,
  fmt,
  arg... 
)
Value:
do { \
struct net_device *_netdev = (net_dev); \
struct batadv_priv *_batpriv = netdev_priv(_netdev); \
batadv_dbg(BATADV_DBG_ALL, _batpriv, fmt, ## arg); \
pr_info("%s: " fmt, _netdev->name, ## arg); \
} while (0)
#define BATADV_JITTER   20

Definition at line 35 of file main.h.

#define BATADV_LOG_BUF_LEN   8192 /* has to be a power of 2 */

Definition at line 74 of file main.h.

#define BATADV_MAX_AGGREGATION_BYTES   512

Definition at line 86 of file main.h.

#define BATADV_MAX_AGGREGATION_MS   100

Definition at line 87 of file main.h.

#define BATADV_NO_FLAGS   0

Definition at line 68 of file main.h.

#define BATADV_NULL_IFINDEX   0 /* dummy ifindex used to avoid iface checks */

Definition at line 70 of file main.h.

#define BATADV_NUM_WORDS   BITS_TO_LONGS(BATADV_TQ_LOCAL_WINDOW_SIZE)

Definition at line 72 of file main.h.

#define BATADV_PURGE_TIMEOUT   200000 /* 200 seconds */

Definition at line 43 of file main.h.

#define BATADV_RESET_PROTECTION_MS   30000

Definition at line 96 of file main.h.

#define BATADV_ROAMING_MAX_COUNT   5

Definition at line 66 of file main.h.

#define BATADV_ROAMING_MAX_TIME   20000

Definition at line 65 of file main.h.

#define batadv_seq_after (   x,
  y 
)    batadv_seq_before(y, x)
#define batadv_seq_before (   x,
  y 
)
Value:
({typeof(x) _d1 = (x); \
typeof(y) _d2 = (y); \
typeof(x) _dummy = (_d1 - _d2); \
(void) (&_d1 == &_d2); \
_dummy > batadv_smallest_signed_int(_dummy); })
#define batadv_smallest_signed_int (   x)    (1u << (7u + 8u * (sizeof(x) - 1u)))
#define BATADV_SOURCE_VERSION   "2012.4.0"

Definition at line 29 of file main.h.

#define BATADV_TQ_GLOBAL_WINDOW_SIZE   5

Definition at line 54 of file main.h.

#define BATADV_TQ_LOCAL_BIDRECT_RECV_MINIMUM   1

Definition at line 56 of file main.h.

#define BATADV_TQ_LOCAL_BIDRECT_SEND_MINIMUM   1

Definition at line 55 of file main.h.

#define BATADV_TQ_LOCAL_WINDOW_SIZE   64

Definition at line 50 of file main.h.

#define BATADV_TQ_MAX_VALUE   255

Definition at line 34 of file main.h.

#define BATADV_TQ_TOTAL_BIDRECT_LIMIT   1

Definition at line 57 of file main.h.

#define BATADV_TT_CLIENT_ROAM_TIMEOUT   600000 /* in milliseconds */

Definition at line 45 of file main.h.

#define BATADV_TT_CLIENT_TEMP_TIMEOUT   600000 /* in milliseconds */

Definition at line 46 of file main.h.

#define BATADV_TT_LOCAL_TIMEOUT   3600000 /* in milliseconds */

Definition at line 44 of file main.h.

#define BATADV_TT_OGM_APPEND_MAX   3

Definition at line 60 of file main.h.

#define BATADV_TT_REQUEST_TIMEOUT   3000

Definition at line 52 of file main.h.

#define BATADV_TTL   50

Definition at line 38 of file main.h.

#define BATADV_VIS_INTERVAL   5000 /* 5 seconds */

Definition at line 76 of file main.h.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 125 of file main.h.

Enumeration Type Documentation

Enumerator:
BATADV_DBG_BATMAN 
BATADV_DBG_ROUTES 
BATADV_DBG_TT 
BATADV_DBG_BLA 
BATADV_DBG_ALL 

Definition at line 169 of file main.h.

Enumerator:
BATADV_MESH_INACTIVE 
BATADV_MESH_ACTIVE 
BATADV_MESH_DEACTIVATING 

Definition at line 99 of file main.h.

Enumerator:
BATADV_UEV_ADD 
BATADV_UEV_DEL 
BATADV_UEV_CHANGE 

Definition at line 108 of file main.h.

Enumerator:
BATADV_UEV_GW 

Definition at line 114 of file main.h.

Function Documentation

__printf ( ,
 
)
int batadv_algo_register ( struct batadv_algo_ops bat_algo_ops)

Definition at line 324 of file main.c.

int batadv_algo_select ( struct batadv_priv bat_priv,
char name 
)

Definition at line 358 of file main.c.

int batadv_algo_seq_print_text ( struct seq_file seq,
void offset 
)

Definition at line 374 of file main.c.

int batadv_batman_skb_recv ( struct sk_buff skb,
struct net_device dev,
struct packet_type ptype,
struct net_device orig_dev 
)

Definition at line 200 of file main.c.

void batadv_dec_module_count ( void  )

Definition at line 168 of file main.c.

void batadv_inc_module_count ( void  )

Definition at line 163 of file main.c.

int batadv_is_my_mac ( const uint8_t addr)

Definition at line 173 of file main.c.

void batadv_mesh_free ( struct net_device soft_iface)

Definition at line 141 of file main.c.

int batadv_mesh_init ( struct net_device soft_iface)

Definition at line 90 of file main.c.

int batadv_recv_handler_register ( uint8_t  packet_type,
int(*)(struct sk_buff *, struct batadv_hard_iface *)  recv_handler 
)

Definition at line 292 of file main.c.

void batadv_recv_handler_unregister ( uint8_t  packet_type)

Definition at line 303 of file main.c.

Variable Documentation

struct batadv_priv* bat_priv const char* fmt __always_unused

Definition at line 190 of file main.h.

unsigned char batadv_broadcast_addr[]

Definition at line 46 of file main.c.

struct workqueue_struct* batadv_event_workqueue

Definition at line 48 of file main.c.

struct list_head batadv_hardif_list

Definition at line 40 of file main.c.

char batadv_routing_algo[]

Definition at line 43 of file main.c.