-
Notifications
You must be signed in to change notification settings - Fork 906
Add support for B.A.T.M.A.N. Advanced #980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
T-X
wants to merge
2
commits into
the-tcpdump-group:master
Choose a base branch
from
T-X:batman-adv-support
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| /* SPDX-License-Identifier: BSD-3 */ | ||
| /* Copyright (C) 2020 Linus Lüssing */ | ||
|
|
||
| #ifndef _BATADV_LEGACY_PACKET_H_ | ||
| #define _BATADV_LEGACY_PACKET_H_ | ||
|
|
||
| enum batadv_legacy_packettype { | ||
| BATADV_LEGACY_IV_OGM = 0x01, | ||
| BATADV_LEGACY_ICMP = 0x02, | ||
| BATADV_LEGACY_UNICAST = 0x03, | ||
| BATADV_LEGACY_BCAST = 0x04, | ||
| BATADV_LEGACY_VIS = 0x05, | ||
| BATADV_LEGACY_UNICAST_FRAG = 0x06, | ||
| BATADV_LEGACY_TT_QUERY = 0x07, | ||
| BATADV_LEGACY_ROAM_ADV = 0x08, | ||
| BATADV_LEGACY_UNICAST_4ADDR = 0x09, | ||
| BATADV_LEGACY_CODED = 0x0a, | ||
| }; | ||
|
|
||
| #define ETH_ALEN 6 | ||
|
|
||
| struct batadv_legacy_unicast_packet { | ||
| uint8_t packet_type; | ||
| uint8_t version; | ||
| uint8_t ttl; | ||
| uint8_t ttvn; | ||
| uint8_t dest[ETH_ALEN]; | ||
| }; | ||
|
|
||
| struct batadv_legacy_unicast_4addr_packet { | ||
| uint8_t packet_type; | ||
| uint8_t version; | ||
| uint8_t ttl; | ||
| uint8_t src[ETH_ALEN]; | ||
| uint8_t subtype; | ||
| uint8_t reserved; | ||
| }; | ||
|
|
||
| struct batadv_legacy_unicast_frag_packet { | ||
| uint8_t packet_type; | ||
| uint8_t version; | ||
| uint8_t ttl; | ||
| uint8_t ttvn; | ||
| uint8_t dest[ETH_ALEN]; | ||
| uint8_t flags; | ||
| uint8_t align; | ||
| uint8_t orig[ETH_ALEN]; | ||
| uint8_t seqno[2]; /* 2-byte integral value */ | ||
| }; | ||
|
|
||
| struct batadv_legacy_bcast_packet { | ||
| uint8_t packet_type; | ||
| uint8_t version; | ||
| uint8_t ttl; | ||
| uint8_t reserved; | ||
| uint8_t seqno[4]; /* 4-byte integral value */ | ||
| uint8_t orig[ETH_ALEN]; | ||
| }; | ||
|
|
||
| struct batadv_legacy_coded_packet { | ||
| uint8_t packet_type; | ||
| uint8_t version; | ||
| uint8_t ttl; | ||
| uint8_t first_ttvn; | ||
| uint8_t first_source[ETH_ALEN]; | ||
| uint8_t first_orig_dest[ETH_ALEN]; | ||
| uint8_t first_crc[4]; /* 4-byte integral value */ | ||
| uint8_t second_ttl; | ||
| uint8_t second_ttvn; | ||
| uint8_t second_dest[ETH_ALEN]; | ||
| uint8_t second_source[ETH_ALEN]; | ||
| uint8_t second_orig_dest[ETH_ALEN]; | ||
| uint8_t second_crc[4]; /* 4-byte integral value */ | ||
| uint8_t coded_len[2]; /* 2-byte integral value */ | ||
| }; | ||
|
|
||
| #endif /* _BATADV_LEGACY_PACKET_H_ */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| /* SPDX-License-Identifier: BSD-3 */ | ||
| /* Copyright (C) 2024 Linus Lüssing */ | ||
|
|
||
| #ifndef _BATADV_PACKET_H_ | ||
| #define _BATADV_PACKET_H_ | ||
|
|
||
| /* For the definitive and most recent packet format definition, | ||
| * see the batadv_packet.h in the Linux kernel. | ||
| */ | ||
|
|
||
| enum batadv_packettype { | ||
| BATADV_IV_OGM = 0x00, | ||
| BATADV_BCAST = 0x01, | ||
| BATADV_CODED = 0x02, | ||
| BATADV_ELP = 0x03, | ||
| BATADV_OGM2 = 0x04, | ||
| BATADV_MCAST = 0x05, | ||
| BATADV_UNICAST = 0x40, | ||
| BATADV_UNICAST_FRAG = 0x41, | ||
| BATADV_UNICAST_4ADDR = 0x42, | ||
| BATADV_ICMP = 0x43, | ||
| BATADV_UNICAST_TVLV = 0x44, | ||
| }; | ||
|
|
||
| #define ETH_ALEN 6 | ||
|
|
||
| struct batadv_unicast_packet { | ||
| uint8_t packet_type; | ||
| uint8_t version; | ||
| uint8_t ttl; | ||
| uint8_t ttvn; | ||
| uint8_t dest[ETH_ALEN]; | ||
| }; | ||
|
|
||
| struct batadv_unicast_4addr_packet { | ||
| struct batadv_unicast_packet u; | ||
| uint8_t src[ETH_ALEN]; | ||
| uint8_t subtype; | ||
| uint8_t reserved; | ||
| }; | ||
|
|
||
| struct batadv_frag_packet { | ||
| uint8_t packet_type; | ||
| uint8_t version; | ||
| uint8_t ttl; | ||
| uint8_t num_pri; /* number and priority */ | ||
| uint8_t dest[ETH_ALEN]; | ||
| uint8_t orig[ETH_ALEN]; | ||
| uint8_t seqno[2]; /* 2-byte integral value */ | ||
| uint8_t total_size[2]; /* 2-byte integral value */ | ||
| }; | ||
|
|
||
| struct batadv_bcast_packet { | ||
| uint8_t packet_type; | ||
| uint8_t version; | ||
| uint8_t ttl; | ||
| uint8_t reserved; | ||
| uint8_t seqno[4]; /* 4-byte integral value */ | ||
| uint8_t orig[ETH_ALEN]; | ||
| }; | ||
|
|
||
| struct batadv_mcast_packet { | ||
| uint8_t packet_type; | ||
| uint8_t version; | ||
| uint8_t ttl; | ||
| uint8_t reserved; | ||
| uint8_t tvlv_len[2]; /* 2-byte integral value */ | ||
| }; | ||
|
|
||
| struct batadv_coded_packet { | ||
| uint8_t packet_type; | ||
| uint8_t version; | ||
| uint8_t ttl; | ||
| uint8_t first_ttvn; | ||
| uint8_t first_source[ETH_ALEN]; | ||
| uint8_t first_orig_dest[ETH_ALEN]; | ||
| uint8_t first_crc[4]; /* 4-byte integral value */ | ||
| uint8_t second_ttl; | ||
| uint8_t second_ttvn; | ||
| uint8_t second_dest[ETH_ALEN]; | ||
| uint8_t second_source[ETH_ALEN]; | ||
| uint8_t second_orig_dest[ETH_ALEN]; | ||
| uint8_t second_crc[4]; /* 4-byte integral value */ | ||
| uint8_t coded_len[2]; /* 2-byte integral value */ | ||
| }; | ||
|
|
||
| #endif /* _BATADV_PACKET_H_ */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The contents of these two new header files that is used only in
gencode.cshould go directly intogencode.c, and the remaining part (message types only, as far as I can see) should be in one header file used by bothgrammar.y.inandgencode.c(much likeieee80211.h). Also for clarity it may be better to useBATADV14_andBATADV15_for the packet types andbatadv14_andbatadv15_for the structures, in case there is yet another version in future.