aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/packet.h
diff options
context:
space:
mode:
authorMartin Hundebøll <martin@hundeboll.net>2013-05-23 10:53:02 -0400
committerAntonio Quartulli <antonio@meshcoding.com>2013-10-12 05:58:34 -0400
commit610bfc6bc99bc83680d190ebc69359a05fc7f605 (patch)
tree355ae39e185e72ca129360037525fd5f7f5ff875 /net/batman-adv/packet.h
parentf097e25dbe9144447f46b6b61ca3da1a2ba432d4 (diff)
batman-adv: Receive fragmented packets and merge
Fragments arriving at their destination are buffered for later merge. Merged packets are passed to the main receive function as had they never been fragmented. Fragments are forwarded without merging if the MTU of the outgoing interface is smaller than the size of the merged packet. Signed-off-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
Diffstat (limited to 'net/batman-adv/packet.h')
-rw-r--r--net/batman-adv/packet.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/net/batman-adv/packet.h b/net/batman-adv/packet.h
index 5e3b1026b509..aa46c2778ad8 100644
--- a/net/batman-adv/packet.h
+++ b/net/batman-adv/packet.h
@@ -249,6 +249,33 @@ struct batadv_unicast_4addr_packet {
249 */ 249 */
250}; 250};
251 251
252/**
253 * struct batadv_frag_packet - fragmented packet
254 * @header: common batman packet header with type, compatversion, and ttl
255 * @dest: final destination used when routing fragments
256 * @orig: originator of the fragment used when merging the packet
257 * @no: fragment number within this sequence
258 * @reserved: reserved byte for alignment
259 * @seqno: sequence identification
260 * @total_size: size of the merged packet
261 */
262struct batadv_frag_packet {
263 struct batadv_header header;
264#if defined(__BIG_ENDIAN_BITFIELD)
265 uint8_t no:4;
266 uint8_t reserved:4;
267#elif defined(__LITTLE_ENDIAN_BITFIELD)
268 uint8_t reserved:4;
269 uint8_t no:4;
270#else
271#error "unknown bitfield endianess"
272#endif
273 uint8_t dest[ETH_ALEN];
274 uint8_t orig[ETH_ALEN];
275 __be16 seqno;
276 __be16 total_size;
277};
278
252struct batadv_bcast_packet { 279struct batadv_bcast_packet {
253 struct batadv_header header; 280 struct batadv_header header;
254 uint8_t reserved; 281 uint8_t reserved;