aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/bridge_loop_avoidance.c
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2012-05-11 20:09:43 -0400
committerAntonio Quartulli <ordex@autistici.org>2012-06-20 16:15:33 -0400
commit9cfc7bd608b97463993b4f3e4775d99022253f8d (patch)
treefcfcf1e714a91943a740dcaa2744ee66448f9f73 /net/batman-adv/bridge_loop_avoidance.c
parent3193e8fdfa355289892661d206d1954114a7be95 (diff)
batman-adv: Reformat multiline comments to consistent style
batman-adv doesn't follow the style for multiline comments that David S. Miller prefers. All comments should be reformatted to follow this consistent style to make the code slightly more readable. Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net/batman-adv/bridge_loop_avoidance.c')
-rw-r--r--net/batman-adv/bridge_loop_avoidance.c67
1 files changed, 19 insertions, 48 deletions
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c
index 27f451a64ad0..52c0d637d581 100644
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -1,5 +1,4 @@
1/* 1/* Copyright (C) 2011-2012 B.A.T.M.A.N. contributors:
2 * Copyright (C) 2011-2012 B.A.T.M.A.N. contributors:
3 * 2 *
4 * Simon Wunderlich 3 * Simon Wunderlich
5 * 4 *
@@ -16,7 +15,6 @@
16 * along with this program; if not, write to the Free Software 15 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 * 02110-1301, USA 17 * 02110-1301, USA
19 *
20 */ 18 */
21 19
22#include "main.h" 20#include "main.h"
@@ -123,8 +121,7 @@ static void claim_free_ref(struct claim *claim)
123 call_rcu(&claim->rcu, claim_free_rcu); 121 call_rcu(&claim->rcu, claim_free_rcu);
124} 122}
125 123
126/** 124/* @bat_priv: the bat priv with all the soft interface information
127 * @bat_priv: the bat priv with all the soft interface information
128 * @data: search data (may be local/static data) 125 * @data: search data (may be local/static data)
129 * 126 *
130 * looks for a claim in the hash, and returns it if found 127 * looks for a claim in the hash, and returns it if found
@@ -162,8 +159,7 @@ static struct claim *claim_hash_find(struct bat_priv *bat_priv,
162 return claim_tmp; 159 return claim_tmp;
163} 160}
164 161
165/** 162/* @bat_priv: the bat priv with all the soft interface information
166 * @bat_priv: the bat priv with all the soft interface information
167 * @addr: the address of the originator 163 * @addr: the address of the originator
168 * @vid: the VLAN ID 164 * @vid: the VLAN ID
169 * 165 *
@@ -241,8 +237,7 @@ static void bla_del_backbone_claims(struct backbone_gw *backbone_gw)
241 backbone_gw->crc = BLA_CRC_INIT; 237 backbone_gw->crc = BLA_CRC_INIT;
242} 238}
243 239
244/** 240/* @bat_priv: the bat priv with all the soft interface information
245 * @bat_priv: the bat priv with all the soft interface information
246 * @orig: the mac address to be announced within the claim 241 * @orig: the mac address to be announced within the claim
247 * @vid: the VLAN ID 242 * @vid: the VLAN ID
248 * @claimtype: the type of the claim (CLAIM, UNCLAIM, ANNOUNCE, ...) 243 * @claimtype: the type of the claim (CLAIM, UNCLAIM, ANNOUNCE, ...)
@@ -347,8 +342,7 @@ out:
347 hardif_free_ref(primary_if); 342 hardif_free_ref(primary_if);
348} 343}
349 344
350/** 345/* @bat_priv: the bat priv with all the soft interface information
351 * @bat_priv: the bat priv with all the soft interface information
352 * @orig: the mac address of the originator 346 * @orig: the mac address of the originator
353 * @vid: the VLAN ID 347 * @vid: the VLAN ID
354 * 348 *
@@ -422,8 +416,7 @@ static void bla_update_own_backbone_gw(struct bat_priv *bat_priv,
422 backbone_gw_free_ref(backbone_gw); 416 backbone_gw_free_ref(backbone_gw);
423} 417}
424 418
425/** 419/* @bat_priv: the bat priv with all the soft interface information
426 * @bat_priv: the bat priv with all the soft interface information
427 * @vid: the vid where the request came on 420 * @vid: the vid where the request came on
428 * 421 *
429 * Repeat all of our own claims, and finally send an ANNOUNCE frame 422 * Repeat all of our own claims, and finally send an ANNOUNCE frame
@@ -468,8 +461,7 @@ static void bla_answer_request(struct bat_priv *bat_priv,
468 backbone_gw_free_ref(backbone_gw); 461 backbone_gw_free_ref(backbone_gw);
469} 462}
470 463
471/** 464/* @backbone_gw: the backbone gateway from whom we are out of sync
472 * @backbone_gw: the backbone gateway from whom we are out of sync
473 * 465 *
474 * When the crc is wrong, ask the backbone gateway for a full table update. 466 * When the crc is wrong, ask the backbone gateway for a full table update.
475 * After the request, it will repeat all of his own claims and finally 467 * After the request, it will repeat all of his own claims and finally
@@ -495,8 +487,7 @@ static void bla_send_request(struct backbone_gw *backbone_gw)
495 } 487 }
496} 488}
497 489
498/** 490/* @bat_priv: the bat priv with all the soft interface information
499 * @bat_priv: the bat priv with all the soft interface information
500 * @backbone_gw: our backbone gateway which should be announced 491 * @backbone_gw: our backbone gateway which should be announced
501 * 492 *
502 * This function sends an announcement. It is called from multiple 493 * This function sends an announcement. It is called from multiple
@@ -516,8 +507,7 @@ static void bla_send_announce(struct bat_priv *bat_priv,
516 507
517} 508}
518 509
519/** 510/* @bat_priv: the bat priv with all the soft interface information
520 * @bat_priv: the bat priv with all the soft interface information
521 * @mac: the mac address of the claim 511 * @mac: the mac address of the claim
522 * @vid: the VLAN ID of the frame 512 * @vid: the VLAN ID of the frame
523 * @backbone_gw: the backbone gateway which claims it 513 * @backbone_gw: the backbone gateway which claims it
@@ -731,8 +721,7 @@ static int handle_claim(struct bat_priv *bat_priv,
731 return 1; 721 return 1;
732} 722}
733 723
734/** 724/* @bat_priv: the bat priv with all the soft interface information
735 * @bat_priv: the bat priv with all the soft interface information
736 * @hw_src: the Hardware source in the ARP Header 725 * @hw_src: the Hardware source in the ARP Header
737 * @hw_dst: the Hardware destination in the ARP Header 726 * @hw_dst: the Hardware destination in the ARP Header
738 * @ethhdr: pointer to the Ethernet header of the claim frame 727 * @ethhdr: pointer to the Ethernet header of the claim frame
@@ -810,8 +799,7 @@ static int check_claim_group(struct bat_priv *bat_priv,
810} 799}
811 800
812 801
813/** 802/* @bat_priv: the bat priv with all the soft interface information
814 * @bat_priv: the bat priv with all the soft interface information
815 * @skb: the frame to be checked 803 * @skb: the frame to be checked
816 * 804 *
817 * Check if this is a claim frame, and process it accordingly. 805 * Check if this is a claim frame, and process it accordingly.
@@ -860,7 +848,6 @@ static int bla_process_claim(struct bat_priv *bat_priv,
860 /* Check whether the ARP frame carries a valid 848 /* Check whether the ARP frame carries a valid
861 * IP information 849 * IP information
862 */ 850 */
863
864 if (arphdr->ar_hrd != htons(ARPHRD_ETHER)) 851 if (arphdr->ar_hrd != htons(ARPHRD_ETHER))
865 return 0; 852 return 0;
866 if (arphdr->ar_pro != htons(ETH_P_IP)) 853 if (arphdr->ar_pro != htons(ETH_P_IP))
@@ -963,8 +950,7 @@ purge_now:
963 } 950 }
964} 951}
965 952
966/** 953/* @bat_priv: the bat priv with all the soft interface information
967 * @bat_priv: the bat priv with all the soft interface information
968 * @primary_if: the selected primary interface, may be NULL if now is set 954 * @primary_if: the selected primary interface, may be NULL if now is set
969 * @now: whether the whole hash shall be wiped now 955 * @now: whether the whole hash shall be wiped now
970 * 956 *
@@ -1011,13 +997,11 @@ purge_now:
1011 } 997 }
1012} 998}
1013 999
1014/** 1000/* @bat_priv: the bat priv with all the soft interface information
1015 * @bat_priv: the bat priv with all the soft interface information
1016 * @primary_if: the new selected primary_if 1001 * @primary_if: the new selected primary_if
1017 * @oldif: the old primary interface, may be NULL 1002 * @oldif: the old primary interface, may be NULL
1018 * 1003 *
1019 * Update the backbone gateways when the own orig address changes. 1004 * Update the backbone gateways when the own orig address changes.
1020 *
1021 */ 1005 */
1022void batadv_bla_update_orig_address(struct bat_priv *bat_priv, 1006void batadv_bla_update_orig_address(struct bat_priv *bat_priv,
1023 struct hard_iface *primary_if, 1007 struct hard_iface *primary_if,
@@ -1183,8 +1167,7 @@ int batadv_bla_init(struct bat_priv *bat_priv)
1183 return 0; 1167 return 0;
1184} 1168}
1185 1169
1186/** 1170/* @bat_priv: the bat priv with all the soft interface information
1187 * @bat_priv: the bat priv with all the soft interface information
1188 * @bcast_packet: originator mac address 1171 * @bcast_packet: originator mac address
1189 * @hdr_size: maximum length of the frame 1172 * @hdr_size: maximum length of the frame
1190 * 1173 *
@@ -1196,9 +1179,7 @@ int batadv_bla_init(struct bat_priv *bat_priv)
1196 * with a good chance that it is the same packet. If it is furthermore 1179 * with a good chance that it is the same packet. If it is furthermore
1197 * sent by another host, drop it. We allow equal packets from 1180 * sent by another host, drop it. We allow equal packets from
1198 * the same host however as this might be intended. 1181 * the same host however as this might be intended.
1199 * 1182 */
1200 **/
1201
1202int batadv_bla_check_bcast_duplist(struct bat_priv *bat_priv, 1183int batadv_bla_check_bcast_duplist(struct bat_priv *bat_priv,
1203 struct bcast_packet *bcast_packet, 1184 struct bcast_packet *bcast_packet,
1204 int hdr_size) 1185 int hdr_size)
@@ -1250,16 +1231,13 @@ int batadv_bla_check_bcast_duplist(struct bat_priv *bat_priv,
1250 1231
1251 1232
1252 1233
1253/** 1234/* @bat_priv: the bat priv with all the soft interface information
1254 * @bat_priv: the bat priv with all the soft interface information
1255 * @orig: originator mac address 1235 * @orig: originator mac address
1256 * 1236 *
1257 * check if the originator is a gateway for any VLAN ID. 1237 * check if the originator is a gateway for any VLAN ID.
1258 * 1238 *
1259 * returns 1 if it is found, 0 otherwise 1239 * returns 1 if it is found, 0 otherwise
1260 *
1261 */ 1240 */
1262
1263int batadv_bla_is_backbone_gw_orig(struct bat_priv *bat_priv, uint8_t *orig) 1241int batadv_bla_is_backbone_gw_orig(struct bat_priv *bat_priv, uint8_t *orig)
1264{ 1242{
1265 struct hashtable_t *hash = bat_priv->backbone_hash; 1243 struct hashtable_t *hash = bat_priv->backbone_hash;
@@ -1291,15 +1269,13 @@ int batadv_bla_is_backbone_gw_orig(struct bat_priv *bat_priv, uint8_t *orig)
1291} 1269}
1292 1270
1293 1271
1294/** 1272/* @skb: the frame to be checked
1295 * @skb: the frame to be checked
1296 * @orig_node: the orig_node of the frame 1273 * @orig_node: the orig_node of the frame
1297 * @hdr_size: maximum length of the frame 1274 * @hdr_size: maximum length of the frame
1298 * 1275 *
1299 * bla_is_backbone_gw inspects the skb for the VLAN ID and returns 1 1276 * bla_is_backbone_gw inspects the skb for the VLAN ID and returns 1
1300 * if the orig_node is also a gateway on the soft interface, otherwise it 1277 * if the orig_node is also a gateway on the soft interface, otherwise it
1301 * returns 0. 1278 * returns 0.
1302 *
1303 */ 1279 */
1304int batadv_bla_is_backbone_gw(struct sk_buff *skb, 1280int batadv_bla_is_backbone_gw(struct sk_buff *skb,
1305 struct orig_node *orig_node, int hdr_size) 1281 struct orig_node *orig_node, int hdr_size)
@@ -1328,7 +1304,6 @@ int batadv_bla_is_backbone_gw(struct sk_buff *skb,
1328 } 1304 }
1329 1305
1330 /* see if this originator is a backbone gw for this VLAN */ 1306 /* see if this originator is a backbone gw for this VLAN */
1331
1332 backbone_gw = backbone_hash_find(orig_node->bat_priv, 1307 backbone_gw = backbone_hash_find(orig_node->bat_priv,
1333 orig_node->orig, vid); 1308 orig_node->orig, vid);
1334 if (!backbone_gw) 1309 if (!backbone_gw)
@@ -1360,8 +1335,7 @@ void batadv_bla_free(struct bat_priv *bat_priv)
1360 hardif_free_ref(primary_if); 1335 hardif_free_ref(primary_if);
1361} 1336}
1362 1337
1363/** 1338/* @bat_priv: the bat priv with all the soft interface information
1364 * @bat_priv: the bat priv with all the soft interface information
1365 * @skb: the frame to be checked 1339 * @skb: the frame to be checked
1366 * @vid: the VLAN ID of the frame 1340 * @vid: the VLAN ID of the frame
1367 * 1341 *
@@ -1372,7 +1346,6 @@ void batadv_bla_free(struct bat_priv *bat_priv)
1372 * in these cases, the skb is further handled by this function and 1346 * in these cases, the skb is further handled by this function and
1373 * returns 1, otherwise it returns 0 and the caller shall further 1347 * returns 1, otherwise it returns 0 and the caller shall further
1374 * process the skb. 1348 * process the skb.
1375 *
1376 */ 1349 */
1377int batadv_bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid) 1350int batadv_bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid)
1378{ 1351{
@@ -1449,8 +1422,7 @@ out:
1449 return ret; 1422 return ret;
1450} 1423}
1451 1424
1452/** 1425/* @bat_priv: the bat priv with all the soft interface information
1453 * @bat_priv: the bat priv with all the soft interface information
1454 * @skb: the frame to be checked 1426 * @skb: the frame to be checked
1455 * @vid: the VLAN ID of the frame 1427 * @vid: the VLAN ID of the frame
1456 * 1428 *
@@ -1461,7 +1433,6 @@ out:
1461 * in these cases, the skb is further handled by this function and 1433 * in these cases, the skb is further handled by this function and
1462 * returns 1, otherwise it returns 0 and the caller shall further 1434 * returns 1, otherwise it returns 0 and the caller shall further
1463 * process the skb. 1435 * process the skb.
1464 *
1465 */ 1436 */
1466int batadv_bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid) 1437int batadv_bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid)
1467{ 1438{