2 * Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
4 * Marek Lindner, Simon Wunderlich
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.
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.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 #define ETH_P_BATMAN 0x4305 /* unofficial/not registered Ethertype */
24 #define BAT_PACKET 0x01
26 #define BAT_UNICAST 0x03
27 #define BAT_BCAST 0x04
30 /* this file is included by batctl which needs these defines */
31 #define COMPAT_VERSION 8
32 #define DIRECTLINK 0x40
33 #define VIS_SERVER 0x20
35 /* ICMP message types */
37 #define DESTINATION_UNREACHABLE 3
38 #define ECHO_REQUEST 8
39 #define TTL_EXCEEDED 11
40 #define PARAMETER_PROBLEM 12
43 #define VIS_TYPE_SERVER_SYNC 0
44 #define VIS_TYPE_CLIENT_UPDATE 1
46 struct batman_packet {
48 uint8_t version; /* batman version field */
49 uint8_t flags; /* 0x40: DIRECTLINK flag, 0x20 VIS_SERVER flag... */
53 uint8_t prev_sender[6];
56 } __attribute__((packed));
58 #define BAT_PACKET_LEN sizeof(struct batman_packet)
62 uint8_t version; /* batman version field */
63 uint8_t msg_type; /* see ICMP message types above */
69 } __attribute__((packed));
71 struct unicast_packet {
73 uint8_t version; /* batman version field */
76 } __attribute__((packed));
80 uint8_t version; /* batman version field */
83 } __attribute__((packed));
87 uint8_t version; /* batman version field */
88 uint8_t vis_type; /* which type of vis-participant sent this? */
89 uint8_t seqno; /* sequence number */
90 uint8_t entries; /* number of entries behind this struct */
91 uint8_t ttl; /* TTL */
92 uint8_t vis_orig[6]; /* originator that informs about its
94 uint8_t target_orig[6]; /* who should receive this packet */
95 uint8_t sender_orig[6]; /* who sent or rebroadcasted this packet */
96 } __attribute__((packed));