aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/unicast.c
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2012-06-05 16:31:31 -0400
committerAntonio Quartulli <ordex@autistici.org>2012-07-01 16:47:21 -0400
commit56303d34a332be8e2f4daf7891ebc12cb7900529 (patch)
treebc972916771e698bd8a88fd66917950ce0bd48c1 /net/batman-adv/unicast.c
parent96412690116afcc1b2705615b5a7c8dc6c5e905f (diff)
batman-adv: Prefix types structs with batadv_
Reported-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net/batman-adv/unicast.c')
-rw-r--r--net/batman-adv/unicast.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/net/batman-adv/unicast.c b/net/batman-adv/unicast.c
index 8a2a3df17fff..c42b81d7e282 100644
--- a/net/batman-adv/unicast.c
+++ b/net/batman-adv/unicast.c
@@ -31,7 +31,7 @@
31 31
32static struct sk_buff * 32static struct sk_buff *
33batadv_frag_merge_packet(struct list_head *head, 33batadv_frag_merge_packet(struct list_head *head,
34 struct frag_packet_list_entry *tfp, 34 struct batadv_frag_packet_list_entry *tfp,
35 struct sk_buff *skb) 35 struct sk_buff *skb)
36{ 36{
37 struct batadv_unicast_frag_packet *up; 37 struct batadv_unicast_frag_packet *up;
@@ -80,7 +80,7 @@ err:
80static void batadv_frag_create_entry(struct list_head *head, 80static void batadv_frag_create_entry(struct list_head *head,
81 struct sk_buff *skb) 81 struct sk_buff *skb)
82{ 82{
83 struct frag_packet_list_entry *tfp; 83 struct batadv_frag_packet_list_entry *tfp;
84 struct batadv_unicast_frag_packet *up; 84 struct batadv_unicast_frag_packet *up;
85 85
86 up = (struct batadv_unicast_frag_packet *)skb->data; 86 up = (struct batadv_unicast_frag_packet *)skb->data;
@@ -98,7 +98,7 @@ static void batadv_frag_create_entry(struct list_head *head,
98static int batadv_frag_create_buffer(struct list_head *head) 98static int batadv_frag_create_buffer(struct list_head *head)
99{ 99{
100 int i; 100 int i;
101 struct frag_packet_list_entry *tfp; 101 struct batadv_frag_packet_list_entry *tfp;
102 102
103 for (i = 0; i < BATADV_FRAG_BUFFER_SIZE; i++) { 103 for (i = 0; i < BATADV_FRAG_BUFFER_SIZE; i++) {
104 tfp = kmalloc(sizeof(*tfp), GFP_ATOMIC); 104 tfp = kmalloc(sizeof(*tfp), GFP_ATOMIC);
@@ -115,11 +115,11 @@ static int batadv_frag_create_buffer(struct list_head *head)
115 return 0; 115 return 0;
116} 116}
117 117
118static struct frag_packet_list_entry * 118static struct batadv_frag_packet_list_entry *
119batadv_frag_search_packet(struct list_head *head, 119batadv_frag_search_packet(struct list_head *head,
120 const struct batadv_unicast_frag_packet *up) 120 const struct batadv_unicast_frag_packet *up)
121{ 121{
122 struct frag_packet_list_entry *tfp; 122 struct batadv_frag_packet_list_entry *tfp;
123 struct batadv_unicast_frag_packet *tmp_up = NULL; 123 struct batadv_unicast_frag_packet *tmp_up = NULL;
124 uint16_t search_seqno; 124 uint16_t search_seqno;
125 125
@@ -156,7 +156,7 @@ mov_tail:
156 156
157void batadv_frag_list_free(struct list_head *head) 157void batadv_frag_list_free(struct list_head *head)
158{ 158{
159 struct frag_packet_list_entry *pf, *tmp_pf; 159 struct batadv_frag_packet_list_entry *pf, *tmp_pf;
160 160
161 if (!list_empty(head)) { 161 if (!list_empty(head)) {
162 162
@@ -175,11 +175,12 @@ void batadv_frag_list_free(struct list_head *head)
175 * or the skb could be reassembled (skb_new will point to the new packet and 175 * or the skb could be reassembled (skb_new will point to the new packet and
176 * skb was freed) 176 * skb was freed)
177 */ 177 */
178int batadv_frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv, 178int batadv_frag_reassemble_skb(struct sk_buff *skb,
179 struct batadv_priv *bat_priv,
179 struct sk_buff **new_skb) 180 struct sk_buff **new_skb)
180{ 181{
181 struct orig_node *orig_node; 182 struct batadv_orig_node *orig_node;
182 struct frag_packet_list_entry *tmp_frag_entry; 183 struct batadv_frag_packet_list_entry *tmp_frag_entry;
183 int ret = NET_RX_DROP; 184 int ret = NET_RX_DROP;
184 struct batadv_unicast_frag_packet *unicast_packet; 185 struct batadv_unicast_frag_packet *unicast_packet;
185 186
@@ -219,11 +220,12 @@ out:
219 return ret; 220 return ret;
220} 221}
221 222
222int batadv_frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv, 223int batadv_frag_send_skb(struct sk_buff *skb, struct batadv_priv *bat_priv,
223 struct hard_iface *hard_iface, const uint8_t dstaddr[]) 224 struct batadv_hard_iface *hard_iface,
225 const uint8_t dstaddr[])
224{ 226{
225 struct batadv_unicast_packet tmp_uc, *unicast_packet; 227 struct batadv_unicast_packet tmp_uc, *unicast_packet;
226 struct hard_iface *primary_if; 228 struct batadv_hard_iface *primary_if;
227 struct sk_buff *frag_skb; 229 struct sk_buff *frag_skb;
228 struct batadv_unicast_frag_packet *frag1, *frag2; 230 struct batadv_unicast_frag_packet *frag1, *frag2;
229 int uc_hdr_len = sizeof(*unicast_packet); 231 int uc_hdr_len = sizeof(*unicast_packet);
@@ -286,12 +288,12 @@ out:
286 return ret; 288 return ret;
287} 289}
288 290
289int batadv_unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv) 291int batadv_unicast_send_skb(struct sk_buff *skb, struct batadv_priv *bat_priv)
290{ 292{
291 struct ethhdr *ethhdr = (struct ethhdr *)skb->data; 293 struct ethhdr *ethhdr = (struct ethhdr *)skb->data;
292 struct batadv_unicast_packet *unicast_packet; 294 struct batadv_unicast_packet *unicast_packet;
293 struct orig_node *orig_node; 295 struct batadv_orig_node *orig_node;
294 struct neigh_node *neigh_node; 296 struct batadv_neigh_node *neigh_node;
295 int data_len = skb->len; 297 int data_len = skb->len;
296 int ret = 1; 298 int ret = 1;
297 299
@@ -307,12 +309,14 @@ int batadv_unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv)
307 */ 309 */
308 orig_node = batadv_transtable_search(bat_priv, ethhdr->h_source, 310 orig_node = batadv_transtable_search(bat_priv, ethhdr->h_source,
309 ethhdr->h_dest); 311 ethhdr->h_dest);
312
310find_router: 313find_router:
311 /* find_router(): 314 /* find_router():
312 * - if orig_node is NULL it returns NULL 315 * - if orig_node is NULL it returns NULL
313 * - increases neigh_nodes refcount if found. 316 * - increases neigh_nodes refcount if found.
314 */ 317 */
315 neigh_node = batadv_find_router(bat_priv, orig_node, NULL); 318 neigh_node = batadv_find_router(bat_priv, orig_node, NULL);
319
316 if (!neigh_node) 320 if (!neigh_node)
317 goto out; 321 goto out;
318 322