aboutsummaryrefslogtreecommitdiffstats
path: root/packet-ospf.h
blob: ccf1664563b1e3805448b63cfd65b9477ba04c4f (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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
/* packet-ospf.h
 *
 * $Id: packet-ospf.h,v 1.9 2000/08/11 13:34:04 deniel Exp $
 * 
 * (c) 1998 Hannes Boehm
 *
 * Ethereal - Network traffic analyzer
 * By Gerald Combs <gerald@zing.org>
 * Copyright 1998 Gerald Combs
 *
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

#ifndef __PACKET_OSPF_H__
#define __PACKET_OSPF_H__

#define OSPF_HEADER_LENGTH	24

#define OSPF_HELLO	1
#define OSPF_DB_DESC	2
#define OSPF_LS_REQ	3
#define OSPF_LS_UPD	4
#define OSPF_LS_ACK	5

#define OSPF_AUTH_NONE		0
#define OSPF_AUTH_SIMPLE	1
#define OSPF_AUTH_CRYPT		2

#define OSPF_OPTIONS_E		2
#define OSPF_OPTIONS_MC		4
#define OSPF_OPTIONS_NP		8
#define OSPF_OPTIONS_EA		16
#define OSPF_OPTIONS_DC		32

#define OSPF_DBD_FLAG_MS	1
#define OSPF_DBD_FLAG_M		2
#define OSPF_DBD_FLAG_I		4

#define OSPF_LS_REQ_LENGTH	12

#define OSPF_LSTYPE_ROUTER	1
#define OSPF_LSTYPE_NETWORK	2
#define OSPF_LSTYPE_SUMMERY	3
#define OSPF_LSTYPE_ASBR	4
#define OSPF_LSTYPE_ASEXT	5

/* Opaque LSA types */
#define OSPF_LSTYPE_OP_LINKLOCAL 9
#define OSPF_LSTYPE_OP_AREALOCAL 10
#define OSPF_LSTYPE_OP_ASWIDE    11

#define OSPF_LINK_PTP		1
#define OSPF_LINK_TRANSIT	2
#define OSPF_LINK_STUB		3
#define OSPF_LINK_VIRTUAL	4

#define OSPF_LSA_HEADER_LENGTH	20

/* Known opaque LSAs */
#define OSPF_LSA_MPLS_TE        1

typedef struct _e_ospfhdr {
    guint8  version;
    guint8  packet_type;
    guint16 length;
    guint32 routerid;
    guint32 area;
    guint16 checksum;
    guint16 auth_type;
    char auth_data[8];
} e_ospfhdr;

typedef struct _e_ospf_hello {
    guint32 network_mask;
    guint16 hellointervall;
    guint8  options;
    guint8  priority;
    guint32 dead_interval;
    guint32 drouter;
    guint32 bdrouter;
} e_ospf_hello ;

typedef struct _e_ospf_dbd {
   guint16 interface_mtu;
   guint8  options;
   guint8  flags;
   guint32 dd_sequence;
} e_ospf_dbd;

typedef struct _e_ospf_ls_req {
    guint32	ls_type;
    guint32	ls_id;
    guint32	adv_router;
} e_ospf_ls_req;

typedef struct _e_ospf_lsa_hdr {
    guint16	ls_age;
    guint8	options;
    guint8	ls_type;
    guint32	ls_id;
    guint32	adv_router;
    guint32	ls_seq;
    guint16	ls_checksum;
    guint16	length;
} e_ospf_lsa_hdr;

typedef struct _e_ospf_router_lsa {
    guint8 flags;
    guint8 empfty;
    guint16 nr_links;
} e_ospf_router_lsa;

typedef struct _e_ospf_router_data {
    guint32 link_id;
    guint32 link_data;
    guint8 link_type;
    guint8 nr_tos;
    guint16 tos0_metric;
} e_ospf_router_data;

typedef struct _e_ospf_router_metric {
    guint8	tos;
    guint8	empty;
    guint16	metric;
} e_ospf_router_metric;

typedef struct  _e_ospf_network_lsa {
    guint32	network_mask;
} e_ospf_network_lsa;

typedef struct _e_ospf_lsa_upd_hdr {
    guint32	lsa_nr;
} e_ospf_lsa_upd_hdr;

typedef struct _e_ospf_summary_lsa {
    guint32	network_mask;
} e_ospf_summary_lsa;

typedef struct _e_ospf_asexternal_lsa {
    guint8	options;
    guint8      metric[3];
    guint32	gateway;
    guint32 	external_tag;
} e_ospf_asexternal_lsa;

typedef struct _e_ospf_crypto {
    guint16   mbz;
    guint8      key_id;
    guint8      length;
    guint32   sequence_num;
} e_ospf_crypto;

#endif