aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-bat.h
blob: 62bb72c2edddafbaedc85d192d22b4a719f75cde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/* packet-bat.h
 * Routines for B.A.T.M.A.N. Layer 3 dissection
 * Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
 * Marek Lindner
 *
 * $Id$
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of version 2 of the GNU General Public
 * License as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301, USA
 *
 */

#ifndef _PACKET_BAT_H
#define _PACKET_BAT_H

#define BAT_BATMAN_PORT  4305
#define BAT_GW_PORT  4306
#define BAT_VIS_PORT  4307

#define UNIDIRECTIONAL 0x80
#define DIRECTLINK 0x40

struct batman_packet_v5 {
	guint8  version;  /* batman version field */
	guint8  flags;    /* 0x80: UNIDIRECTIONAL link, 0x40: DIRECTLINK flag, ... */
	guint8  ttl;
	guint8  gwflags;  /* flags related to gateway functions: gateway class */
	guint16 seqno;
	guint16 gwport;
	address orig;
	address old_orig;
	guint8 tq;
	guint8 hna_len;
};
#define BATMAN_PACKET_V5_SIZE 18

struct gw_packet {
	guint8  type;
};
#define GW_PACKET_SIZE 1

#define TUNNEL_DATA 0x01
#define TUNNEL_IP_REQUEST 0x02
#define TUNNEL_IP_INVALID 0x03
#define TUNNEL_KEEPALIVE_REQUEST 0x04
#define TUNNEL_KEEPALIVE_REPLY 0x05

#define DATA_TYPE_NEIGH 1
#define DATA_TYPE_SEC_IF 2
#define DATA_TYPE_HNA 3



struct vis_packet_v22 {
	address sender_ip;
	guint8 version;
	guint8 gw_class;
	guint16 tq_max;
};
#define VIS_PACKET_V22_SIZE 8

struct vis_data_v22 {
	guint8 type;
	guint16 data;
	address ip;
};
#define VIS_PACKET_V22_DATA_SIZE 7

struct vis_packet_v23 {
	address sender_ip;
	guint8 version;
	guint8 gw_class;
	guint8 tq_max;
};
#define VIS_PACKET_V23_SIZE 7

struct vis_data_v23 {
	guint8 type;
	guint8 data;
	address ip;
};
#define VIS_PACKET_V23_DATA_SIZE 6

#endif /* _PACKET_BAT_H */