| .. | .. |
|---|
| 1 | 1 | /* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) */ |
|---|
| 2 | | -/* Copyright (C) 2007-2018 B.A.T.M.A.N. contributors: |
|---|
| 2 | +/* Copyright (C) 2007-2020 B.A.T.M.A.N. contributors: |
|---|
| 3 | 3 | * |
|---|
| 4 | 4 | * Marek Lindner, Simon Wunderlich |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or |
|---|
| 7 | | - * modify it under the terms of version 2 of the GNU General Public |
|---|
| 8 | | - * License as published by the Free Software Foundation. |
|---|
| 9 | | - * |
|---|
| 10 | | - * This program is distributed in the hope that it will be useful, but |
|---|
| 11 | | - * WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 12 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 13 | | - * General Public License for more details. |
|---|
| 14 | | - * |
|---|
| 15 | | - * You should have received a copy of the GNU General Public License |
|---|
| 16 | | - * along with this program; if not, see <http://www.gnu.org/licenses/>. |
|---|
| 17 | 5 | */ |
|---|
| 18 | 6 | |
|---|
| 19 | 7 | #ifndef _UAPI_LINUX_BATADV_PACKET_H_ |
|---|
| .. | .. |
|---|
| 84 | 72 | |
|---|
| 85 | 73 | /** |
|---|
| 86 | 74 | * enum batadv_iv_flags - flags used in B.A.T.M.A.N. IV OGM packets |
|---|
| 87 | | - * @BATADV_NOT_BEST_NEXT_HOP: flag is set when ogm packet is forwarded and was |
|---|
| 88 | | - * previously received from someone else than the best neighbor. |
|---|
| 75 | + * @BATADV_NOT_BEST_NEXT_HOP: flag is set when the ogm packet is forwarded and |
|---|
| 76 | + * was previously received from someone other than the best neighbor. |
|---|
| 89 | 77 | * @BATADV_PRIMARIES_FIRST_HOP: flag unused. |
|---|
| 90 | 78 | * @BATADV_DIRECTLINK: flag is for the first hop or if rebroadcasted from a |
|---|
| 91 | 79 | * one hop neighbor on the interface where it was originally received. |
|---|
| .. | .. |
|---|
| 119 | 107 | * @BATADV_MCAST_WANT_ALL_UNSNOOPABLES: we want all packets destined for |
|---|
| 120 | 108 | * 224.0.0.0/24 or ff02::1 |
|---|
| 121 | 109 | * @BATADV_MCAST_WANT_ALL_IPV4: we want all IPv4 multicast packets |
|---|
| 110 | + * (both link-local and routable ones) |
|---|
| 122 | 111 | * @BATADV_MCAST_WANT_ALL_IPV6: we want all IPv6 multicast packets |
|---|
| 112 | + * (both link-local and routable ones) |
|---|
| 113 | + * @BATADV_MCAST_WANT_NO_RTR4: we have no IPv4 multicast router and therefore |
|---|
| 114 | + * only need routable IPv4 multicast packets we signed up for explicitly |
|---|
| 115 | + * @BATADV_MCAST_WANT_NO_RTR6: we have no IPv6 multicast router and therefore |
|---|
| 116 | + * only need routable IPv6 multicast packets we signed up for explicitly |
|---|
| 123 | 117 | */ |
|---|
| 124 | 118 | enum batadv_mcast_flags { |
|---|
| 125 | 119 | BATADV_MCAST_WANT_ALL_UNSNOOPABLES = 1UL << 0, |
|---|
| 126 | 120 | BATADV_MCAST_WANT_ALL_IPV4 = 1UL << 1, |
|---|
| 127 | 121 | BATADV_MCAST_WANT_ALL_IPV6 = 1UL << 2, |
|---|
| 122 | + BATADV_MCAST_WANT_NO_RTR4 = 1UL << 3, |
|---|
| 123 | + BATADV_MCAST_WANT_NO_RTR6 = 1UL << 4, |
|---|
| 128 | 124 | }; |
|---|
| 129 | 125 | |
|---|
| 130 | 126 | /* tt data subtypes */ |
|---|
| .. | .. |
|---|
| 199 | 195 | /** |
|---|
| 200 | 196 | * struct batadv_ogm_packet - ogm (routing protocol) packet |
|---|
| 201 | 197 | * @packet_type: batman-adv packet type, part of the general header |
|---|
| 202 | | - * @version: batman-adv protocol version, part of the genereal header |
|---|
| 203 | | - * @ttl: time to live for this packet, part of the genereal header |
|---|
| 198 | + * @version: batman-adv protocol version, part of the general header |
|---|
| 199 | + * @ttl: time to live for this packet, part of the general header |
|---|
| 204 | 200 | * @flags: contains routing relevant flags - see enum batadv_iv_flags |
|---|
| 205 | 201 | * @seqno: sequence identification |
|---|
| 206 | 202 | * @orig: address of the source node |
|---|
| .. | .. |
|---|
| 229 | 225 | * @packet_type: batman-adv packet type, part of the general header |
|---|
| 230 | 226 | * @version: batman-adv protocol version, part of the general header |
|---|
| 231 | 227 | * @ttl: time to live for this packet, part of the general header |
|---|
| 232 | | - * @flags: reseved for routing relevant flags - currently always 0 |
|---|
| 228 | + * @flags: reserved for routing relevant flags - currently always 0 |
|---|
| 233 | 229 | * @seqno: sequence number |
|---|
| 234 | 230 | * @orig: originator mac address |
|---|
| 235 | 231 | * @tvlv_len: length of the appended tvlv buffer (in bytes) |
|---|
| .. | .. |
|---|
| 251 | 247 | /** |
|---|
| 252 | 248 | * struct batadv_elp_packet - elp (neighbor discovery) packet |
|---|
| 253 | 249 | * @packet_type: batman-adv packet type, part of the general header |
|---|
| 254 | | - * @version: batman-adv protocol version, part of the genereal header |
|---|
| 250 | + * @version: batman-adv protocol version, part of the general header |
|---|
| 255 | 251 | * @orig: originator mac address |
|---|
| 256 | 252 | * @seqno: sequence number |
|---|
| 257 | 253 | * @elp_interval: currently used ELP sending interval in ms |
|---|
| .. | .. |
|---|
| 269 | 265 | /** |
|---|
| 270 | 266 | * struct batadv_icmp_header - common members among all the ICMP packets |
|---|
| 271 | 267 | * @packet_type: batman-adv packet type, part of the general header |
|---|
| 272 | | - * @version: batman-adv protocol version, part of the genereal header |
|---|
| 273 | | - * @ttl: time to live for this packet, part of the genereal header |
|---|
| 268 | + * @version: batman-adv protocol version, part of the general header |
|---|
| 269 | + * @ttl: time to live for this packet, part of the general header |
|---|
| 274 | 270 | * @msg_type: ICMP packet type |
|---|
| 275 | 271 | * @dst: address of the destination node |
|---|
| 276 | 272 | * @orig: address of the source node |
|---|
| 277 | 273 | * @uid: local ICMP socket identifier |
|---|
| 278 | 274 | * @align: not used - useful for alignment purposes only |
|---|
| 279 | 275 | * |
|---|
| 280 | | - * This structure is used for ICMP packets parsing only and it is never sent |
|---|
| 276 | + * This structure is used for ICMP packet parsing only and it is never sent |
|---|
| 281 | 277 | * over the wire. The alignment field at the end is there to ensure that |
|---|
| 282 | 278 | * members are padded the same way as they are in real packets. |
|---|
| 283 | 279 | */ |
|---|
| .. | .. |
|---|
| 295 | 291 | /** |
|---|
| 296 | 292 | * struct batadv_icmp_packet - ICMP packet |
|---|
| 297 | 293 | * @packet_type: batman-adv packet type, part of the general header |
|---|
| 298 | | - * @version: batman-adv protocol version, part of the genereal header |
|---|
| 299 | | - * @ttl: time to live for this packet, part of the genereal header |
|---|
| 294 | + * @version: batman-adv protocol version, part of the general header |
|---|
| 295 | + * @ttl: time to live for this packet, part of the general header |
|---|
| 300 | 296 | * @msg_type: ICMP packet type |
|---|
| 301 | 297 | * @dst: address of the destination node |
|---|
| 302 | 298 | * @orig: address of the source node |
|---|
| .. | .. |
|---|
| 319 | 315 | /** |
|---|
| 320 | 316 | * struct batadv_icmp_tp_packet - ICMP TP Meter packet |
|---|
| 321 | 317 | * @packet_type: batman-adv packet type, part of the general header |
|---|
| 322 | | - * @version: batman-adv protocol version, part of the genereal header |
|---|
| 323 | | - * @ttl: time to live for this packet, part of the genereal header |
|---|
| 318 | + * @version: batman-adv protocol version, part of the general header |
|---|
| 319 | + * @ttl: time to live for this packet, part of the general header |
|---|
| 324 | 320 | * @msg_type: ICMP packet type |
|---|
| 325 | 321 | * @dst: address of the destination node |
|---|
| 326 | 322 | * @orig: address of the source node |
|---|
| .. | .. |
|---|
| 362 | 358 | /** |
|---|
| 363 | 359 | * struct batadv_icmp_packet_rr - ICMP RouteRecord packet |
|---|
| 364 | 360 | * @packet_type: batman-adv packet type, part of the general header |
|---|
| 365 | | - * @version: batman-adv protocol version, part of the genereal header |
|---|
| 366 | | - * @ttl: time to live for this packet, part of the genereal header |
|---|
| 361 | + * @version: batman-adv protocol version, part of the general header |
|---|
| 362 | + * @ttl: time to live for this packet, part of the general header |
|---|
| 367 | 363 | * @msg_type: ICMP packet type |
|---|
| 368 | 364 | * @dst: address of the destination node |
|---|
| 369 | 365 | * @orig: address of the source node |
|---|
| .. | .. |
|---|
| 401 | 397 | /** |
|---|
| 402 | 398 | * struct batadv_unicast_packet - unicast packet for network payload |
|---|
| 403 | 399 | * @packet_type: batman-adv packet type, part of the general header |
|---|
| 404 | | - * @version: batman-adv protocol version, part of the genereal header |
|---|
| 405 | | - * @ttl: time to live for this packet, part of the genereal header |
|---|
| 400 | + * @version: batman-adv protocol version, part of the general header |
|---|
| 401 | + * @ttl: time to live for this packet, part of the general header |
|---|
| 406 | 402 | * @ttvn: translation table version number |
|---|
| 407 | 403 | * @dest: originator destination of the unicast packet |
|---|
| 408 | 404 | */ |
|---|
| .. | .. |
|---|
| 437 | 433 | /** |
|---|
| 438 | 434 | * struct batadv_frag_packet - fragmented packet |
|---|
| 439 | 435 | * @packet_type: batman-adv packet type, part of the general header |
|---|
| 440 | | - * @version: batman-adv protocol version, part of the genereal header |
|---|
| 441 | | - * @ttl: time to live for this packet, part of the genereal header |
|---|
| 436 | + * @version: batman-adv protocol version, part of the general header |
|---|
| 437 | + * @ttl: time to live for this packet, part of the general header |
|---|
| 442 | 438 | * @dest: final destination used when routing fragments |
|---|
| 443 | 439 | * @orig: originator of the fragment used when merging the packet |
|---|
| 444 | 440 | * @no: fragment number within this sequence |
|---|
| .. | .. |
|---|
| 471 | 467 | /** |
|---|
| 472 | 468 | * struct batadv_bcast_packet - broadcast packet for network payload |
|---|
| 473 | 469 | * @packet_type: batman-adv packet type, part of the general header |
|---|
| 474 | | - * @version: batman-adv protocol version, part of the genereal header |
|---|
| 475 | | - * @ttl: time to live for this packet, part of the genereal header |
|---|
| 470 | + * @version: batman-adv protocol version, part of the general header |
|---|
| 471 | + * @ttl: time to live for this packet, part of the general header |
|---|
| 476 | 472 | * @reserved: reserved byte for alignment |
|---|
| 477 | 473 | * @seqno: sequence identification |
|---|
| 478 | 474 | * @orig: originator of the broadcast packet |
|---|
| .. | .. |
|---|
| 492 | 488 | /** |
|---|
| 493 | 489 | * struct batadv_coded_packet - network coded packet |
|---|
| 494 | 490 | * @packet_type: batman-adv packet type, part of the general header |
|---|
| 495 | | - * @version: batman-adv protocol version, part of the genereal header |
|---|
| 496 | | - * @ttl: time to live for this packet, part of the genereal header |
|---|
| 491 | + * @version: batman-adv protocol version, part of the general header |
|---|
| 492 | + * @ttl: time to live for this packet, part of the general header |
|---|
| 497 | 493 | * @first_source: original source of first included packet |
|---|
| 498 | | - * @first_orig_dest: original destinal of first included packet |
|---|
| 494 | + * @first_orig_dest: original destination of first included packet |
|---|
| 499 | 495 | * @first_crc: checksum of first included packet |
|---|
| 500 | 496 | * @first_ttvn: tt-version number of first included packet |
|---|
| 501 | 497 | * @second_ttl: ttl of second packet |
|---|
| .. | .. |
|---|
| 527 | 523 | /** |
|---|
| 528 | 524 | * struct batadv_unicast_tvlv_packet - generic unicast packet with tvlv payload |
|---|
| 529 | 525 | * @packet_type: batman-adv packet type, part of the general header |
|---|
| 530 | | - * @version: batman-adv protocol version, part of the genereal header |
|---|
| 531 | | - * @ttl: time to live for this packet, part of the genereal header |
|---|
| 526 | + * @version: batman-adv protocol version, part of the general header |
|---|
| 527 | + * @ttl: time to live for this packet, part of the general header |
|---|
| 532 | 528 | * @reserved: reserved field (for packet alignment) |
|---|
| 533 | 529 | * @src: address of the source |
|---|
| 534 | 530 | * @dst: address of the destination |
|---|