Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
a5e3c2aa
Commit
a5e3c2aa
authored
Jan 31, 2011
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'batman-adv/next' of
git://git.open-mesh.org/ecsv/linux-merge
parents
6b28ff3b
091b9483
Changes
40
Show whitespace changes
Inline
Side-by-side
Showing
40 changed files
with
101 additions
and
102 deletions
+101
-102
Documentation/networking/batman-adv.txt
Documentation/networking/batman-adv.txt
+8
-8
net/batman-adv/Makefile
net/batman-adv/Makefile
+1
-1
net/batman-adv/aggregation.c
net/batman-adv/aggregation.c
+1
-1
net/batman-adv/aggregation.h
net/batman-adv/aggregation.h
+1
-1
net/batman-adv/bat_debugfs.c
net/batman-adv/bat_debugfs.c
+2
-4
net/batman-adv/bat_debugfs.h
net/batman-adv/bat_debugfs.h
+1
-1
net/batman-adv/bat_sysfs.c
net/batman-adv/bat_sysfs.c
+1
-1
net/batman-adv/bat_sysfs.h
net/batman-adv/bat_sysfs.h
+1
-1
net/batman-adv/bitarray.c
net/batman-adv/bitarray.c
+1
-1
net/batman-adv/bitarray.h
net/batman-adv/bitarray.h
+1
-1
net/batman-adv/gateway_client.c
net/batman-adv/gateway_client.c
+1
-1
net/batman-adv/gateway_client.h
net/batman-adv/gateway_client.h
+1
-1
net/batman-adv/gateway_common.c
net/batman-adv/gateway_common.c
+1
-1
net/batman-adv/gateway_common.h
net/batman-adv/gateway_common.h
+1
-1
net/batman-adv/hard-interface.c
net/batman-adv/hard-interface.c
+10
-3
net/batman-adv/hard-interface.h
net/batman-adv/hard-interface.h
+1
-5
net/batman-adv/hash.c
net/batman-adv/hash.c
+1
-1
net/batman-adv/hash.h
net/batman-adv/hash.h
+1
-6
net/batman-adv/icmp_socket.c
net/batman-adv/icmp_socket.c
+1
-1
net/batman-adv/icmp_socket.h
net/batman-adv/icmp_socket.h
+1
-1
net/batman-adv/main.c
net/batman-adv/main.c
+1
-1
net/batman-adv/main.h
net/batman-adv/main.h
+1
-16
net/batman-adv/originator.c
net/batman-adv/originator.c
+2
-2
net/batman-adv/originator.h
net/batman-adv/originator.h
+1
-1
net/batman-adv/packet.h
net/batman-adv/packet.h
+2
-1
net/batman-adv/ring_buffer.c
net/batman-adv/ring_buffer.c
+1
-1
net/batman-adv/ring_buffer.h
net/batman-adv/ring_buffer.h
+1
-1
net/batman-adv/routing.c
net/batman-adv/routing.c
+8
-18
net/batman-adv/routing.h
net/batman-adv/routing.h
+2
-3
net/batman-adv/send.c
net/batman-adv/send.c
+3
-3
net/batman-adv/send.h
net/batman-adv/send.h
+1
-1
net/batman-adv/soft-interface.c
net/batman-adv/soft-interface.c
+1
-1
net/batman-adv/soft-interface.h
net/batman-adv/soft-interface.h
+1
-1
net/batman-adv/translation-table.c
net/batman-adv/translation-table.c
+1
-1
net/batman-adv/translation-table.h
net/batman-adv/translation-table.h
+1
-1
net/batman-adv/types.h
net/batman-adv/types.h
+1
-1
net/batman-adv/unicast.c
net/batman-adv/unicast.c
+10
-5
net/batman-adv/unicast.h
net/batman-adv/unicast.h
+24
-1
net/batman-adv/vis.c
net/batman-adv/vis.c
+1
-1
net/batman-adv/vis.h
net/batman-adv/vis.h
+1
-1
No files found.
Documentation/networking/batman-adv.txt
View file @
a5e3c2aa
[state: 2
1-11-2010
]
[state: 2
7-01-2011
]
BATMAN-ADV
BATMAN-ADV
----------
----------
...
@@ -67,15 +67,16 @@ All mesh wide settings can be found in batman's own interface
...
@@ -67,15 +67,16 @@ All mesh wide settings can be found in batman's own interface
folder:
folder:
# ls /sys/class/net/bat0/mesh/
# ls /sys/class/net/bat0/mesh/
# aggregated_ogms bonding fragmentation orig_interval
# aggregated_ogms gw_bandwidth hop_penalty
# vis_mode
# bonding gw_mode orig_interval
# fragmentation gw_sel_class vis_mode
There is a special folder for debugging informations:
There is a special folder for debugging informations:
# ls /sys/kernel/debug/batman_adv/bat0/
# ls /sys/kernel/debug/batman_adv/bat0/
#
originators socket transtable_global transtable_local
#
gateways socket transtable_global vis_data
#
vis_data
#
originators softif_neigh transtable_local
Some of the files contain all sort of status information regard-
Some of the files contain all sort of status information regard-
...
@@ -230,9 +231,8 @@ CONTACT
...
@@ -230,9 +231,8 @@ CONTACT
Please send us comments, experiences, questions, anything :)
Please send us comments, experiences, questions, anything :)
IRC: #batman on irc.freenode.org
IRC: #batman on irc.freenode.org
Mailing-list: b.a.t.m.a.n@b.a.t.m.a.n@lists.open-mesh.org
Mailing-list: b.a.t.m.a.n@open-mesh.org (optional subscription
(optional subscription at
at https://lists.open-mesh.org/mm/listinfo/b.a.t.m.a.n)
https://lists.open-mesh.org/mm/listinfo/b.a.t.m.a.n)
You can also contact the Authors:
You can also contact the Authors:
...
...
net/batman-adv/Makefile
View file @
a5e3c2aa
#
#
# Copyright (C) 2007-201
0
B.A.T.M.A.N. contributors:
# Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
#
#
# Marek Lindner, Simon Wunderlich
# Marek Lindner, Simon Wunderlich
#
#
...
...
net/batman-adv/aggregation.c
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2007-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
*
*
* Marek Lindner, Simon Wunderlich
* Marek Lindner, Simon Wunderlich
*
*
...
...
net/batman-adv/aggregation.h
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2007-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
*
*
* Marek Lindner, Simon Wunderlich
* Marek Lindner, Simon Wunderlich
*
*
...
...
net/batman-adv/bat_debugfs.c
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2010 B.A.T.M.A.N. contributors:
* Copyright (C) 2010
-2011
B.A.T.M.A.N. contributors:
*
*
* Marek Lindner
* Marek Lindner
*
*
...
@@ -52,7 +52,6 @@ static void emit_log_char(struct debug_log *debug_log, char c)
...
@@ -52,7 +52,6 @@ static void emit_log_char(struct debug_log *debug_log, char c)
static
int
fdebug_log
(
struct
debug_log
*
debug_log
,
char
*
fmt
,
...)
static
int
fdebug_log
(
struct
debug_log
*
debug_log
,
char
*
fmt
,
...)
{
{
int
printed_len
;
va_list
args
;
va_list
args
;
static
char
debug_log_buf
[
256
];
static
char
debug_log_buf
[
256
];
char
*
p
;
char
*
p
;
...
@@ -62,8 +61,7 @@ static int fdebug_log(struct debug_log *debug_log, char *fmt, ...)
...
@@ -62,8 +61,7 @@ static int fdebug_log(struct debug_log *debug_log, char *fmt, ...)
spin_lock_bh
(
&
debug_log
->
lock
);
spin_lock_bh
(
&
debug_log
->
lock
);
va_start
(
args
,
fmt
);
va_start
(
args
,
fmt
);
printed_len
=
vscnprintf
(
debug_log_buf
,
sizeof
(
debug_log_buf
),
vscnprintf
(
debug_log_buf
,
sizeof
(
debug_log_buf
),
fmt
,
args
);
fmt
,
args
);
va_end
(
args
);
va_end
(
args
);
for
(
p
=
debug_log_buf
;
*
p
!=
0
;
p
++
)
for
(
p
=
debug_log_buf
;
*
p
!=
0
;
p
++
)
...
...
net/batman-adv/bat_debugfs.h
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2010 B.A.T.M.A.N. contributors:
* Copyright (C) 2010
-2011
B.A.T.M.A.N. contributors:
*
*
* Marek Lindner
* Marek Lindner
*
*
...
...
net/batman-adv/bat_sysfs.c
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2010 B.A.T.M.A.N. contributors:
* Copyright (C) 2010
-2011
B.A.T.M.A.N. contributors:
*
*
* Marek Lindner
* Marek Lindner
*
*
...
...
net/batman-adv/bat_sysfs.h
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2010 B.A.T.M.A.N. contributors:
* Copyright (C) 2010
-2011
B.A.T.M.A.N. contributors:
*
*
* Marek Lindner
* Marek Lindner
*
*
...
...
net/batman-adv/bitarray.c
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2006-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2006-201
1
B.A.T.M.A.N. contributors:
*
*
* Simon Wunderlich, Marek Lindner
* Simon Wunderlich, Marek Lindner
*
*
...
...
net/batman-adv/bitarray.h
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2006-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2006-201
1
B.A.T.M.A.N. contributors:
*
*
* Simon Wunderlich, Marek Lindner
* Simon Wunderlich, Marek Lindner
*
*
...
...
net/batman-adv/gateway_client.c
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2009-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2009-201
1
B.A.T.M.A.N. contributors:
*
*
* Marek Lindner
* Marek Lindner
*
*
...
...
net/batman-adv/gateway_client.h
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2009-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2009-201
1
B.A.T.M.A.N. contributors:
*
*
* Marek Lindner
* Marek Lindner
*
*
...
...
net/batman-adv/gateway_common.c
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2009-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2009-201
1
B.A.T.M.A.N. contributors:
*
*
* Marek Lindner
* Marek Lindner
*
*
...
...
net/batman-adv/gateway_common.h
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2009-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2009-201
1
B.A.T.M.A.N. contributors:
*
*
* Marek Lindner
* Marek Lindner
*
*
...
...
net/batman-adv/hard-interface.c
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2007-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
*
*
* Marek Lindner, Simon Wunderlich
* Marek Lindner, Simon Wunderlich
*
*
...
@@ -34,6 +34,12 @@
...
@@ -34,6 +34,12 @@
/* protect update critical side of if_list - but not the content */
/* protect update critical side of if_list - but not the content */
static
DEFINE_SPINLOCK
(
if_list_lock
);
static
DEFINE_SPINLOCK
(
if_list_lock
);
static
int
batman_skb_recv
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
,
struct
packet_type
*
ptype
,
struct
net_device
*
orig_dev
);
static
void
hardif_free_rcu
(
struct
rcu_head
*
rcu
)
static
void
hardif_free_rcu
(
struct
rcu_head
*
rcu
)
{
{
struct
batman_if
*
batman_if
;
struct
batman_if
*
batman_if
;
...
@@ -549,8 +555,9 @@ static int hard_if_event(struct notifier_block *this,
...
@@ -549,8 +555,9 @@ static int hard_if_event(struct notifier_block *this,
/* receive a packet with the batman ethertype coming on a hard
/* receive a packet with the batman ethertype coming on a hard
* interface */
* interface */
int
batman_skb_recv
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
,
static
int
batman_skb_recv
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
,
struct
packet_type
*
ptype
,
struct
net_device
*
orig_dev
)
struct
packet_type
*
ptype
,
struct
net_device
*
orig_dev
)
{
{
struct
bat_priv
*
bat_priv
;
struct
bat_priv
*
bat_priv
;
struct
batman_packet
*
batman_packet
;
struct
batman_packet
*
batman_packet
;
...
...
net/batman-adv/hard-interface.h
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2007-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
*
*
* Marek Lindner, Simon Wunderlich
* Marek Lindner, Simon Wunderlich
*
*
...
@@ -35,10 +35,6 @@ struct batman_if *get_batman_if_by_netdev(struct net_device *net_dev);
...
@@ -35,10 +35,6 @@ struct batman_if *get_batman_if_by_netdev(struct net_device *net_dev);
int
hardif_enable_interface
(
struct
batman_if
*
batman_if
,
char
*
iface_name
);
int
hardif_enable_interface
(
struct
batman_if
*
batman_if
,
char
*
iface_name
);
void
hardif_disable_interface
(
struct
batman_if
*
batman_if
);
void
hardif_disable_interface
(
struct
batman_if
*
batman_if
);
void
hardif_remove_interfaces
(
void
);
void
hardif_remove_interfaces
(
void
);
int
batman_skb_recv
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
,
struct
packet_type
*
ptype
,
struct
net_device
*
orig_dev
);
int
hardif_min_mtu
(
struct
net_device
*
soft_iface
);
int
hardif_min_mtu
(
struct
net_device
*
soft_iface
);
void
update_min_mtu
(
struct
net_device
*
soft_iface
);
void
update_min_mtu
(
struct
net_device
*
soft_iface
);
...
...
net/batman-adv/hash.c
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2006-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2006-201
1
B.A.T.M.A.N. contributors:
*
*
* Simon Wunderlich, Marek Lindner
* Simon Wunderlich, Marek Lindner
*
*
...
...
net/batman-adv/hash.h
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2006-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2006-201
1
B.A.T.M.A.N. contributors:
*
*
* Simon Wunderlich, Marek Lindner
* Simon Wunderlich, Marek Lindner
*
*
...
@@ -49,11 +49,6 @@ struct hashtable_t {
...
@@ -49,11 +49,6 @@ struct hashtable_t {
/* allocates and clears the hash */
/* allocates and clears the hash */
struct
hashtable_t
*
hash_new
(
int
size
);
struct
hashtable_t
*
hash_new
(
int
size
);
/* remove element if you already found the element you want to delete and don't
* need the overhead to find it again with hash_remove(). But usually, you
* don't want to use this function, as it fiddles with hash-internals. */
void
*
hash_remove_element
(
struct
hashtable_t
*
hash
,
struct
element_t
*
elem
);
/* free only the hashtable and the hash itself. */
/* free only the hashtable and the hash itself. */
void
hash_destroy
(
struct
hashtable_t
*
hash
);
void
hash_destroy
(
struct
hashtable_t
*
hash
);
...
...
net/batman-adv/icmp_socket.c
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2007-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
*
*
* Marek Lindner
* Marek Lindner
*
*
...
...
net/batman-adv/icmp_socket.h
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2007-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
*
*
* Marek Lindner
* Marek Lindner
*
*
...
...
net/batman-adv/main.c
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2007-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
*
*
* Marek Lindner, Simon Wunderlich
* Marek Lindner, Simon Wunderlich
*
*
...
...
net/batman-adv/main.h
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2007-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
*
*
* Marek Lindner, Simon Wunderlich
* Marek Lindner, Simon Wunderlich
*
*
...
@@ -22,9 +22,6 @@
...
@@ -22,9 +22,6 @@
#ifndef _NET_BATMAN_ADV_MAIN_H_
#ifndef _NET_BATMAN_ADV_MAIN_H_
#define _NET_BATMAN_ADV_MAIN_H_
#define _NET_BATMAN_ADV_MAIN_H_
/* Kernel Programming */
#define LINUX
#define DRIVER_AUTHOR "Marek Lindner <lindner_marek@yahoo.de>, " \
#define DRIVER_AUTHOR "Marek Lindner <lindner_marek@yahoo.de>, " \
"Simon Wunderlich <siwu@hrz.tu-chemnitz.de>"
"Simon Wunderlich <siwu@hrz.tu-chemnitz.de>"
#define DRIVER_DESC "B.A.T.M.A.N. advanced"
#define DRIVER_DESC "B.A.T.M.A.N. advanced"
...
@@ -54,7 +51,6 @@
...
@@ -54,7 +51,6 @@
#define NUM_WORDS (TQ_LOCAL_WINDOW_SIZE / WORD_BIT_SIZE)
#define NUM_WORDS (TQ_LOCAL_WINDOW_SIZE / WORD_BIT_SIZE)
#define PACKBUFF_SIZE 2000
#define LOG_BUF_LEN 8192
/* has to be a power of 2 */
#define LOG_BUF_LEN 8192
/* has to be a power of 2 */
#define VIS_INTERVAL 5000
/* 5 seconds */
#define VIS_INTERVAL 5000
/* 5 seconds */
...
@@ -96,15 +92,11 @@
...
@@ -96,15 +92,11 @@
#define DBG_ROUTES 2
/* route or hna added / changed / deleted */
#define DBG_ROUTES 2
/* route or hna added / changed / deleted */
#define DBG_ALL 3
#define DBG_ALL 3
#define LOG_BUF_LEN 8192
/* has to be a power of 2 */
/*
/*
* Vis
* Vis
*/
*/
/* #define VIS_SUBCLUSTERS_DISABLED */
/*
/*
* Kernel headers
* Kernel headers
*/
*/
...
@@ -158,13 +150,6 @@ static inline void bat_dbg(char type __always_unused,
...
@@ -158,13 +150,6 @@ static inline void bat_dbg(char type __always_unused,
}
}
#endif
#endif
#define bat_warning(net_dev, fmt, arg...) \
do { \
struct net_device *_netdev = (net_dev); \
struct bat_priv *_batpriv = netdev_priv(_netdev); \
bat_dbg(DBG_ALL, _batpriv, fmt, ## arg); \
pr_warning("%s: " fmt, _netdev->name, ## arg); \
} while (0)
#define bat_info(net_dev, fmt, arg...) \
#define bat_info(net_dev, fmt, arg...) \
do { \
do { \
struct net_device *_netdev = (net_dev); \
struct net_device *_netdev = (net_dev); \
...
...
net/batman-adv/originator.c
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2009-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2009-201
1
B.A.T.M.A.N. contributors:
*
*
* Marek Lindner, Simon Wunderlich
* Marek Lindner, Simon Wunderlich
*
*
...
@@ -247,7 +247,7 @@ static bool purge_orig_node(struct bat_priv *bat_priv,
...
@@ -247,7 +247,7 @@ static bool purge_orig_node(struct bat_priv *bat_priv,
orig_node
->
hna_buff_len
);
orig_node
->
hna_buff_len
);
/* update bonding candidates, we could have lost
/* update bonding candidates, we could have lost
* some candidates. */
* some candidates. */
update_bonding_candidates
(
bat_priv
,
orig_node
);
update_bonding_candidates
(
orig_node
);
}
}
}
}
...
...
net/batman-adv/originator.h
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2007-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
*
*
* Marek Lindner, Simon Wunderlich
* Marek Lindner, Simon Wunderlich
*
*
...
...
net/batman-adv/packet.h
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2007-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
*
*
* Marek Lindner, Simon Wunderlich
* Marek Lindner, Simon Wunderlich
*
*
...
@@ -50,6 +50,7 @@
...
@@ -50,6 +50,7 @@
/* fragmentation defines */
/* fragmentation defines */
#define UNI_FRAG_HEAD 0x01
#define UNI_FRAG_HEAD 0x01
#define UNI_FRAG_LARGETAIL 0x02
struct
batman_packet
{
struct
batman_packet
{
uint8_t
packet_type
;
uint8_t
packet_type
;
...
...
net/batman-adv/ring_buffer.c
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2007-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
*
*
* Marek Lindner
* Marek Lindner
*
*
...
...
net/batman-adv/ring_buffer.h
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2007-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
*
*
* Marek Lindner
* Marek Lindner
*
*
...
...
net/batman-adv/routing.c
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2007-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
*
*
* Marek Lindner, Simon Wunderlich
* Marek Lindner, Simon Wunderlich
*
*
...
@@ -433,8 +433,7 @@ static char count_real_packets(struct ethhdr *ethhdr,
...
@@ -433,8 +433,7 @@ static char count_real_packets(struct ethhdr *ethhdr,
}
}
/* copy primary address for bonding */
/* copy primary address for bonding */
static
void
mark_bonding_address
(
struct
bat_priv
*
bat_priv
,
static
void
mark_bonding_address
(
struct
orig_node
*
orig_node
,
struct
orig_node
*
orig_node
,
struct
orig_node
*
orig_neigh_node
,
struct
orig_node
*
orig_neigh_node
,
struct
batman_packet
*
batman_packet
)
struct
batman_packet
*
batman_packet
)
...
@@ -447,8 +446,7 @@ static void mark_bonding_address(struct bat_priv *bat_priv,
...
@@ -447,8 +446,7 @@ static void mark_bonding_address(struct bat_priv *bat_priv,
}
}
/* mark possible bond.candidates in the neighbor list */
/* mark possible bond.candidates in the neighbor list */
void
update_bonding_candidates
(
struct
bat_priv
*
bat_priv
,
void
update_bonding_candidates
(
struct
orig_node
*
orig_node
)
struct
orig_node
*
orig_node
)
{
{
int
candidates
;
int
candidates
;
int
interference_candidate
;
int
interference_candidate
;
...
@@ -730,9 +728,8 @@ void receive_bat_packet(struct ethhdr *ethhdr,
...
@@ -730,9 +728,8 @@ void receive_bat_packet(struct ethhdr *ethhdr,
update_orig
(
bat_priv
,
orig_node
,
ethhdr
,
batman_packet
,
update_orig
(
bat_priv
,
orig_node
,
ethhdr
,
batman_packet
,
if_incoming
,
hna_buff
,
hna_buff_len
,
is_duplicate
);
if_incoming
,
hna_buff
,
hna_buff_len
,
is_duplicate
);
mark_bonding_address
(
bat_priv
,
orig_node
,
mark_bonding_address
(
orig_node
,
orig_neigh_node
,
batman_packet
);
orig_neigh_node
,
batman_packet
);
update_bonding_candidates
(
orig_node
);
update_bonding_candidates
(
bat_priv
,
orig_node
);
/* is single hop (direct) neighbor */
/* is single hop (direct) neighbor */
if
(
is_single_hop_neigh
)
{
if
(
is_single_hop_neigh
)
{
...
@@ -810,13 +807,11 @@ static int recv_my_icmp_packet(struct bat_priv *bat_priv,
...
@@ -810,13 +807,11 @@ static int recv_my_icmp_packet(struct bat_priv *bat_priv,
{
{
struct
orig_node
*
orig_node
;
struct
orig_node
*
orig_node
;
struct
icmp_packet_rr
*
icmp_packet
;
struct
icmp_packet_rr
*
icmp_packet
;
struct
ethhdr
*
ethhdr
;
struct
batman_if
*
batman_if
;
struct
batman_if
*
batman_if
;
int
ret
;
int
ret
;
uint8_t
dstaddr
[
ETH_ALEN
];
uint8_t
dstaddr
[
ETH_ALEN
];
icmp_packet
=
(
struct
icmp_packet_rr
*
)
skb
->
data
;
icmp_packet
=
(
struct
icmp_packet_rr
*
)
skb
->
data
;
ethhdr
=
(
struct
ethhdr
*
)
skb_mac_header
(
skb
);
/* add data to device queue */
/* add data to device queue */
if
(
icmp_packet
->
msg_type
!=
ECHO_REQUEST
)
{
if
(
icmp_packet
->
msg_type
!=
ECHO_REQUEST
)
{
...
@@ -848,7 +843,6 @@ static int recv_my_icmp_packet(struct bat_priv *bat_priv,
...
@@ -848,7 +843,6 @@ static int recv_my_icmp_packet(struct bat_priv *bat_priv,
return
NET_RX_DROP
;
return
NET_RX_DROP
;
icmp_packet
=
(
struct
icmp_packet_rr
*
)
skb
->
data
;
icmp_packet
=
(
struct
icmp_packet_rr
*
)
skb
->
data
;
ethhdr
=
(
struct
ethhdr
*
)
skb_mac_header
(
skb
);
memcpy
(
icmp_packet
->
dst
,
icmp_packet
->
orig
,
ETH_ALEN
);
memcpy
(
icmp_packet
->
dst
,
icmp_packet
->
orig
,
ETH_ALEN
);
memcpy
(
icmp_packet
->
orig
,
memcpy
(
icmp_packet
->
orig
,
...
@@ -866,17 +860,15 @@ static int recv_my_icmp_packet(struct bat_priv *bat_priv,
...
@@ -866,17 +860,15 @@ static int recv_my_icmp_packet(struct bat_priv *bat_priv,
}
}
static
int
recv_icmp_ttl_exceeded
(
struct
bat_priv
*
bat_priv
,
static
int
recv_icmp_ttl_exceeded
(
struct
bat_priv
*
bat_priv
,
struct
sk_buff
*
skb
,
size_t
icmp_len
)
struct
sk_buff
*
skb
)
{
{
struct
orig_node
*
orig_node
;
struct
orig_node
*
orig_node
;
struct
icmp_packet
*
icmp_packet
;
struct
icmp_packet
*
icmp_packet
;
struct
ethhdr
*
ethhdr
;
struct
batman_if
*
batman_if
;
struct
batman_if
*
batman_if
;
int
ret
;
int
ret
;
uint8_t
dstaddr
[
ETH_ALEN
];
uint8_t
dstaddr
[
ETH_ALEN
];
icmp_packet
=
(
struct
icmp_packet
*
)
skb
->
data
;
icmp_packet
=
(
struct
icmp_packet
*
)
skb
->
data
;
ethhdr
=
(
struct
ethhdr
*
)
skb_mac_header
(
skb
);
/* send TTL exceeded if packet is an echo request (traceroute) */
/* send TTL exceeded if packet is an echo request (traceroute) */
if
(
icmp_packet
->
msg_type
!=
ECHO_REQUEST
)
{
if
(
icmp_packet
->
msg_type
!=
ECHO_REQUEST
)
{
...
@@ -909,7 +901,6 @@ static int recv_icmp_ttl_exceeded(struct bat_priv *bat_priv,
...
@@ -909,7 +901,6 @@ static int recv_icmp_ttl_exceeded(struct bat_priv *bat_priv,
return
NET_RX_DROP
;
return
NET_RX_DROP
;
icmp_packet
=
(
struct
icmp_packet
*
)
skb
->
data
;
icmp_packet
=
(
struct
icmp_packet
*
)
skb
->
data
;
ethhdr
=
(
struct
ethhdr
*
)
skb_mac_header
(
skb
);
memcpy
(
icmp_packet
->
dst
,
icmp_packet
->
orig
,
ETH_ALEN
);
memcpy
(
icmp_packet
->
dst
,
icmp_packet
->
orig
,
ETH_ALEN
);
memcpy
(
icmp_packet
->
orig
,
memcpy
(
icmp_packet
->
orig
,
...
@@ -978,7 +969,7 @@ int recv_icmp_packet(struct sk_buff *skb, struct batman_if *recv_if)
...
@@ -978,7 +969,7 @@ int recv_icmp_packet(struct sk_buff *skb, struct batman_if *recv_if)
/* TTL exceeded */
/* TTL exceeded */
if
(
icmp_packet
->
ttl
<
2
)
if
(
icmp_packet
->
ttl
<
2
)
return
recv_icmp_ttl_exceeded
(
bat_priv
,
skb
,
hdr_size
);
return
recv_icmp_ttl_exceeded
(
bat_priv
,
skb
);
ret
=
NET_RX_DROP
;
ret
=
NET_RX_DROP
;
...
@@ -1001,7 +992,6 @@ int recv_icmp_packet(struct sk_buff *skb, struct batman_if *recv_if)
...
@@ -1001,7 +992,6 @@ int recv_icmp_packet(struct sk_buff *skb, struct batman_if *recv_if)
return
NET_RX_DROP
;
return
NET_RX_DROP
;
icmp_packet
=
(
struct
icmp_packet_rr
*
)
skb
->
data
;
icmp_packet
=
(
struct
icmp_packet_rr
*
)
skb
->
data
;
ethhdr
=
(
struct
ethhdr
*
)
skb_mac_header
(
skb
);
/* decrement ttl */
/* decrement ttl */
icmp_packet
->
ttl
--
;
icmp_packet
->
ttl
--
;
...
@@ -1193,7 +1183,7 @@ int route_unicast_packet(struct sk_buff *skb, struct batman_if *recv_if,
...
@@ -1193,7 +1183,7 @@ int route_unicast_packet(struct sk_buff *skb, struct batman_if *recv_if,
dstaddr
);
dstaddr
);
if
(
unicast_packet
->
packet_type
==
BAT_UNICAST_FRAG
&&
if
(
unicast_packet
->
packet_type
==
BAT_UNICAST_FRAG
&&
2
*
skb
->
len
-
hdr_size
<=
batman_if
->
net_dev
->
mtu
)
{
frag_can_reassemble
(
skb
,
batman_if
->
net_dev
->
mtu
)
)
{
ret
=
frag_reassemble_skb
(
skb
,
bat_priv
,
&
new_skb
);
ret
=
frag_reassemble_skb
(
skb
,
bat_priv
,
&
new_skb
);
...
...
net/batman-adv/routing.h
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2007-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
*
*
* Marek Lindner, Simon Wunderlich
* Marek Lindner, Simon Wunderlich
*
*
...
@@ -42,7 +42,6 @@ int recv_vis_packet(struct sk_buff *skb, struct batman_if *recv_if);
...
@@ -42,7 +42,6 @@ int recv_vis_packet(struct sk_buff *skb, struct batman_if *recv_if);
int
recv_bat_packet
(
struct
sk_buff
*
skb
,
struct
batman_if
*
recv_if
);
int
recv_bat_packet
(
struct
sk_buff
*
skb
,
struct
batman_if
*
recv_if
);
struct
neigh_node
*
find_router
(
struct
bat_priv
*
bat_priv
,
struct
neigh_node
*
find_router
(
struct
bat_priv
*
bat_priv
,
struct
orig_node
*
orig_node
,
struct
batman_if
*
recv_if
);
struct
orig_node
*
orig_node
,
struct
batman_if
*
recv_if
);
void
update_bonding_candidates
(
struct
bat_priv
*
bat_priv
,
void
update_bonding_candidates
(
struct
orig_node
*
orig_node
);
struct
orig_node
*
orig_node
);
#endif
/* _NET_BATMAN_ADV_ROUTING_H_ */
#endif
/* _NET_BATMAN_ADV_ROUTING_H_ */
net/batman-adv/send.c
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2007-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
*
*
* Marek Lindner, Simon Wunderlich
* Marek Lindner, Simon Wunderlich
*
*
...
@@ -49,7 +49,7 @@ static unsigned long own_send_time(struct bat_priv *bat_priv)
...
@@ -49,7 +49,7 @@ static unsigned long own_send_time(struct bat_priv *bat_priv)
}
}
/* when do we schedule a forwarded packet to be sent */
/* when do we schedule a forwarded packet to be sent */
static
unsigned
long
forward_send_time
(
struct
bat_priv
*
bat_priv
)
static
unsigned
long
forward_send_time
(
void
)
{
{
return
jiffies
+
msecs_to_jiffies
(
random32
()
%
(
JITTER
/
2
));
return
jiffies
+
msecs_to_jiffies
(
random32
()
%
(
JITTER
/
2
));
}
}
...
@@ -356,7 +356,7 @@ void schedule_forward_packet(struct orig_node *orig_node,
...
@@ -356,7 +356,7 @@ void schedule_forward_packet(struct orig_node *orig_node,
else
else
batman_packet
->
flags
&=
~
DIRECTLINK
;
batman_packet
->
flags
&=
~
DIRECTLINK
;
send_time
=
forward_send_time
(
bat_priv
);
send_time
=
forward_send_time
();
add_bat_packet_to_list
(
bat_priv
,
add_bat_packet_to_list
(
bat_priv
,
(
unsigned
char
*
)
batman_packet
,
(
unsigned
char
*
)
batman_packet
,
sizeof
(
struct
batman_packet
)
+
hna_buff_len
,
sizeof
(
struct
batman_packet
)
+
hna_buff_len
,
...
...
net/batman-adv/send.h
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2007-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
*
*
* Marek Lindner, Simon Wunderlich
* Marek Lindner, Simon Wunderlich
*
*
...
...
net/batman-adv/soft-interface.c
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2007-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
*
*
* Marek Lindner, Simon Wunderlich
* Marek Lindner, Simon Wunderlich
*
*
...
...
net/batman-adv/soft-interface.h
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2007-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
*
*
* Marek Lindner
* Marek Lindner
*
*
...
...
net/batman-adv/translation-table.c
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2007-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
*
*
* Marek Lindner, Simon Wunderlich
* Marek Lindner, Simon Wunderlich
*
*
...
...
net/batman-adv/translation-table.h
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2007-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
*
*
* Marek Lindner, Simon Wunderlich
* Marek Lindner, Simon Wunderlich
*
*
...
...
net/batman-adv/types.h
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2007-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
*
*
* Marek Lindner, Simon Wunderlich
* Marek Lindner, Simon Wunderlich
*
*
...
...
net/batman-adv/unicast.c
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2010 B.A.T.M.A.N. contributors:
* Copyright (C) 2010
-2011
B.A.T.M.A.N. contributors:
*
*
* Andreas Langer
* Andreas Langer
*
*
...
@@ -224,7 +224,8 @@ int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
...
@@ -224,7 +224,8 @@ int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
struct
unicast_frag_packet
*
frag1
,
*
frag2
;
struct
unicast_frag_packet
*
frag1
,
*
frag2
;
int
uc_hdr_len
=
sizeof
(
struct
unicast_packet
);
int
uc_hdr_len
=
sizeof
(
struct
unicast_packet
);
int
ucf_hdr_len
=
sizeof
(
struct
unicast_frag_packet
);
int
ucf_hdr_len
=
sizeof
(
struct
unicast_frag_packet
);
int
data_len
=
skb
->
len
;
int
data_len
=
skb
->
len
-
uc_hdr_len
;
int
large_tail
=
0
;
if
(
!
bat_priv
->
primary_if
)
if
(
!
bat_priv
->
primary_if
)
goto
dropped
;
goto
dropped
;
...
@@ -232,10 +233,11 @@ int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
...
@@ -232,10 +233,11 @@ int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
frag_skb
=
dev_alloc_skb
(
data_len
-
(
data_len
/
2
)
+
ucf_hdr_len
);
frag_skb
=
dev_alloc_skb
(
data_len
-
(
data_len
/
2
)
+
ucf_hdr_len
);
if
(
!
frag_skb
)
if
(
!
frag_skb
)
goto
dropped
;
goto
dropped
;
skb_reserve
(
frag_skb
,
ucf_hdr_len
);
unicast_packet
=
(
struct
unicast_packet
*
)
skb
->
data
;
unicast_packet
=
(
struct
unicast_packet
*
)
skb
->
data
;
memcpy
(
&
tmp_uc
,
unicast_packet
,
uc_hdr_len
);
memcpy
(
&
tmp_uc
,
unicast_packet
,
uc_hdr_len
);
skb_split
(
skb
,
frag_skb
,
data_len
/
2
);
skb_split
(
skb
,
frag_skb
,
data_len
/
2
+
uc_hdr_len
);
if
(
my_skb_head_push
(
skb
,
ucf_hdr_len
-
uc_hdr_len
)
<
0
||
if
(
my_skb_head_push
(
skb
,
ucf_hdr_len
-
uc_hdr_len
)
<
0
||
my_skb_head_push
(
frag_skb
,
ucf_hdr_len
)
<
0
)
my_skb_head_push
(
frag_skb
,
ucf_hdr_len
)
<
0
)
...
@@ -253,8 +255,11 @@ int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
...
@@ -253,8 +255,11 @@ int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
memcpy
(
frag1
->
orig
,
bat_priv
->
primary_if
->
net_dev
->
dev_addr
,
ETH_ALEN
);
memcpy
(
frag1
->
orig
,
bat_priv
->
primary_if
->
net_dev
->
dev_addr
,
ETH_ALEN
);
memcpy
(
frag2
,
frag1
,
sizeof
(
struct
unicast_frag_packet
));
memcpy
(
frag2
,
frag1
,
sizeof
(
struct
unicast_frag_packet
));
frag1
->
flags
|=
UNI_FRAG_HEAD
;
if
(
data_len
&
1
)
frag2
->
flags
&=
~
UNI_FRAG_HEAD
;
large_tail
=
UNI_FRAG_LARGETAIL
;
frag1
->
flags
=
UNI_FRAG_HEAD
|
large_tail
;
frag2
->
flags
=
large_tail
;
frag1
->
seqno
=
htons
((
uint16_t
)
atomic_inc_return
(
frag1
->
seqno
=
htons
((
uint16_t
)
atomic_inc_return
(
&
batman_if
->
frag_seqno
));
&
batman_if
->
frag_seqno
));
...
...
net/batman-adv/unicast.h
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2010 B.A.T.M.A.N. contributors:
* Copyright (C) 2010
-2011
B.A.T.M.A.N. contributors:
*
*
* Andreas Langer
* Andreas Langer
*
*
...
@@ -22,6 +22,8 @@
...
@@ -22,6 +22,8 @@
#ifndef _NET_BATMAN_ADV_UNICAST_H_
#ifndef _NET_BATMAN_ADV_UNICAST_H_
#define _NET_BATMAN_ADV_UNICAST_H_
#define _NET_BATMAN_ADV_UNICAST_H_
#include "packet.h"
#define FRAG_TIMEOUT 10000
/* purge frag list entrys after time in ms */
#define FRAG_TIMEOUT 10000
/* purge frag list entrys after time in ms */
#define FRAG_BUFFER_SIZE 6
/* number of list elements in buffer */
#define FRAG_BUFFER_SIZE 6
/* number of list elements in buffer */
...
@@ -32,4 +34,25 @@ int unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv);
...
@@ -32,4 +34,25 @@ int unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv);
int
frag_send_skb
(
struct
sk_buff
*
skb
,
struct
bat_priv
*
bat_priv
,
int
frag_send_skb
(
struct
sk_buff
*
skb
,
struct
bat_priv
*
bat_priv
,
struct
batman_if
*
batman_if
,
uint8_t
dstaddr
[]);
struct
batman_if
*
batman_if
,
uint8_t
dstaddr
[]);
static
inline
int
frag_can_reassemble
(
struct
sk_buff
*
skb
,
int
mtu
)
{
struct
unicast_frag_packet
*
unicast_packet
;
int
uneven_correction
=
0
;
unsigned
int
merged_size
;
unicast_packet
=
(
struct
unicast_frag_packet
*
)
skb
->
data
;
if
(
unicast_packet
->
flags
&
UNI_FRAG_LARGETAIL
)
{
if
(
unicast_packet
->
flags
&
UNI_FRAG_HEAD
)
uneven_correction
=
1
;
else
uneven_correction
=
-
1
;
}
merged_size
=
(
skb
->
len
-
sizeof
(
struct
unicast_frag_packet
))
*
2
;
merged_size
+=
sizeof
(
struct
unicast_packet
)
+
uneven_correction
;
return
merged_size
<=
mtu
;
}
#endif
/* _NET_BATMAN_ADV_UNICAST_H_ */
#endif
/* _NET_BATMAN_ADV_UNICAST_H_ */
net/batman-adv/vis.c
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2008-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2008-201
1
B.A.T.M.A.N. contributors:
*
*
* Simon Wunderlich
* Simon Wunderlich
*
*
...
...
net/batman-adv/vis.h
View file @
a5e3c2aa
/*
/*
* Copyright (C) 2008-201
0
B.A.T.M.A.N. contributors:
* Copyright (C) 2008-201
1
B.A.T.M.A.N. contributors:
*
*
* Simon Wunderlich, Marek Lindner
* Simon Wunderlich, Marek Lindner
*
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment