Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 255607
b: refs/heads/master
c: 3b27ffb
h: refs/heads/master
i:
  255605: e40cf6a
  255603: 5208601
  255599: 1b4600d
v: v3
  • Loading branch information
Antonio Quartulli authored and Sven Eckelmann committed Jun 20, 2011
1 parent 058e658 commit b60ee5c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b4e1705417c6cc7d46d9020259a2c8f457cf82bd
refs/heads/master: 3b27ffb00fbe9d9189715ea13ce8712e2f0cb0c5
30 changes: 18 additions & 12 deletions trunk/net/batman-adv/packet.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ enum bat_packettype {
};

/* this file is included by batctl which needs these defines */
#define COMPAT_VERSION 12
#define COMPAT_VERSION 14

enum batman_flags {
PRIMARIES_FIRST_HOP = 1 << 4,
Expand Down Expand Up @@ -66,28 +66,29 @@ enum unicast_frag_flags {
struct batman_packet {
uint8_t packet_type;
uint8_t version; /* batman version field */
uint8_t ttl;
uint8_t flags; /* 0x40: DIRECTLINK flag, 0x20 VIS_SERVER flag... */
uint8_t tq;
uint32_t seqno;
uint8_t orig[6];
uint8_t prev_sender[6];
uint8_t ttl;
uint8_t num_tt;
uint8_t gw_flags; /* flags related to gateway class */
uint8_t align;
uint8_t tq;
uint8_t num_tt;
uint8_t reserved;
} __packed;

#define BAT_PACKET_LEN sizeof(struct batman_packet)

struct icmp_packet {
uint8_t packet_type;
uint8_t version; /* batman version field */
uint8_t msg_type; /* see ICMP message types above */
uint8_t ttl;
uint8_t msg_type; /* see ICMP message types above */
uint8_t dst[6];
uint8_t orig[6];
uint16_t seqno;
uint8_t uid;
uint8_t reserved;
} __packed;

#define BAT_RR_LEN 16
Expand All @@ -97,8 +98,8 @@ struct icmp_packet {
struct icmp_packet_rr {
uint8_t packet_type;
uint8_t version; /* batman version field */
uint8_t msg_type; /* see ICMP message types above */
uint8_t ttl;
uint8_t msg_type; /* see ICMP message types above */
uint8_t dst[6];
uint8_t orig[6];
uint16_t seqno;
Expand All @@ -110,35 +111,40 @@ struct icmp_packet_rr {
struct unicast_packet {
uint8_t packet_type;
uint8_t version; /* batman version field */
uint8_t dest[6];
uint8_t ttl;
uint8_t reserved;
uint8_t dest[6];
} __packed;

struct unicast_frag_packet {
uint8_t packet_type;
uint8_t version; /* batman version field */
uint8_t dest[6];
uint8_t ttl;
uint8_t reserved;
uint8_t dest[6];
uint8_t flags;
uint8_t align;
uint8_t orig[6];
uint16_t seqno;
} __packed;

struct bcast_packet {
uint8_t packet_type;
uint8_t version; /* batman version field */
uint8_t orig[6];
uint8_t ttl;
uint8_t reserved;
uint32_t seqno;
uint8_t orig[6];
} __packed;

struct vis_packet {
uint8_t packet_type;
uint8_t version; /* batman version field */
uint8_t ttl; /* TTL */
uint8_t vis_type; /* which type of vis-participant sent this? */
uint8_t entries; /* number of entries behind this struct */
uint32_t seqno; /* sequence number */
uint8_t ttl; /* TTL */
uint8_t entries; /* number of entries behind this struct */
uint8_t reserved;
uint8_t vis_orig[6]; /* originator that announces its neighbors */
uint8_t target_orig[6]; /* who should receive this packet */
uint8_t sender_orig[6]; /* who sent or rebroadcasted this packet */
Expand Down

0 comments on commit b60ee5c

Please sign in to comment.