diff options
author | Marek Lindner <lindner_marek@yahoo.de> | 2012-03-01 02:35:17 -0500 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-05-11 04:08:10 -0400 |
commit | ffa995e036bef734ea40cbbccda574d1df3a8a58 (patch) | |
tree | 396d7c202f1b0d82dce905e7d70c32708886f404 /net/batman-adv/main.h | |
parent | 75cd33f86396c446f84c4bb620be70c36a2a54f6 (diff) |
batman-adv: introduce packet type handler array for incoming packets
The packet handler array replaces the growing switch statement, thus
dealing with incoming packets in a more efficient way. It also adds
to possibility to register packet handlers on the fly.
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Acked-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net/batman-adv/main.h')
-rw-r--r-- | net/batman-adv/main.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h index d9832acf558d..fd83acd48b28 100644 --- a/net/batman-adv/main.h +++ b/net/batman-adv/main.h | |||
@@ -155,6 +155,12 @@ void mesh_free(struct net_device *soft_iface); | |||
155 | void inc_module_count(void); | 155 | void inc_module_count(void); |
156 | void dec_module_count(void); | 156 | void dec_module_count(void); |
157 | int is_my_mac(const uint8_t *addr); | 157 | int is_my_mac(const uint8_t *addr); |
158 | int batman_skb_recv(struct sk_buff *skb, struct net_device *dev, | ||
159 | struct packet_type *ptype, struct net_device *orig_dev); | ||
160 | int recv_handler_register(uint8_t packet_type, | ||
161 | int (*recv_handler)(struct sk_buff *, | ||
162 | struct hard_iface *)); | ||
163 | void recv_handler_unregister(uint8_t packet_type); | ||
158 | int bat_algo_register(struct bat_algo_ops *bat_algo_ops); | 164 | int bat_algo_register(struct bat_algo_ops *bat_algo_ops); |
159 | int bat_algo_select(struct bat_priv *bat_priv, char *name); | 165 | int bat_algo_select(struct bat_priv *bat_priv, char *name); |
160 | int bat_algo_seq_print_text(struct seq_file *seq, void *offset); | 166 | int bat_algo_seq_print_text(struct seq_file *seq, void *offset); |