Have the Etherenet and PPP dissectors register themselves, and have
[obnox/wireshark/wip.git] / packet-ospf.h
1 /* packet-ospf.h
2  *
3  * $Id: packet-ospf.h,v 1.10 2000/09/13 07:47:10 guy Exp $
4  * 
5  * (c) 1998 Hannes Boehm
6  *
7  * Ethereal - Network traffic analyzer
8  * By Gerald Combs <gerald@zing.org>
9  * Copyright 1998 Gerald Combs
10  *
11  * 
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License
14  * as published by the Free Software Foundation; either version 2
15  * of the License, or (at your option) any later version.
16  * 
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  * 
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
25  */
26
27 #ifndef __PACKET_OSPF_H__
28 #define __PACKET_OSPF_H__
29
30 #define OSPF_HEADER_LENGTH      24
31
32 #define OSPF_HELLO      1
33 #define OSPF_DB_DESC    2
34 #define OSPF_LS_REQ     3
35 #define OSPF_LS_UPD     4
36 #define OSPF_LS_ACK     5
37
38 #define OSPF_AUTH_NONE          0
39 #define OSPF_AUTH_SIMPLE        1
40 #define OSPF_AUTH_CRYPT         2
41
42 #define OSPF_OPTIONS_E          2
43 #define OSPF_OPTIONS_MC         4
44 #define OSPF_OPTIONS_NP         8
45 #define OSPF_OPTIONS_EA         16
46 #define OSPF_OPTIONS_DC         32
47
48 #define OSPF_DBD_FLAG_MS        1
49 #define OSPF_DBD_FLAG_M         2
50 #define OSPF_DBD_FLAG_I         4
51
52 #define OSPF_LS_REQ_LENGTH      12
53
54 #define OSPF_LSTYPE_ROUTER      1
55 #define OSPF_LSTYPE_NETWORK     2
56 #define OSPF_LSTYPE_SUMMERY     3
57 #define OSPF_LSTYPE_ASBR        4
58 #define OSPF_LSTYPE_ASEXT       5
59 #define OSPF_LSTYPE_ASEXT7      7
60
61 /* Opaque LSA types */
62 #define OSPF_LSTYPE_OP_LINKLOCAL 9
63 #define OSPF_LSTYPE_OP_AREALOCAL 10
64 #define OSPF_LSTYPE_OP_ASWIDE    11
65
66 #define OSPF_LINK_PTP           1
67 #define OSPF_LINK_TRANSIT       2
68 #define OSPF_LINK_STUB          3
69 #define OSPF_LINK_VIRTUAL       4
70
71 #define OSPF_LSA_HEADER_LENGTH  20
72
73 /* Known opaque LSAs */
74 #define OSPF_LSA_MPLS_TE        1
75
76 typedef struct _e_ospfhdr {
77     guint8  version;
78     guint8  packet_type;
79     guint16 length;
80     guint32 routerid;
81     guint32 area;
82     guint16 checksum;
83     guint16 auth_type;
84     char auth_data[8];
85 } e_ospfhdr;
86
87 typedef struct _e_ospf_hello {
88     guint32 network_mask;
89     guint16 hellointervall;
90     guint8  options;
91     guint8  priority;
92     guint32 dead_interval;
93     guint32 drouter;
94     guint32 bdrouter;
95 } e_ospf_hello ;
96
97 typedef struct _e_ospf_dbd {
98    guint16 interface_mtu;
99    guint8  options;
100    guint8  flags;
101    guint32 dd_sequence;
102 } e_ospf_dbd;
103
104 typedef struct _e_ospf_ls_req {
105     guint32     ls_type;
106     guint32     ls_id;
107     guint32     adv_router;
108 } e_ospf_ls_req;
109
110 typedef struct _e_ospf_lsa_hdr {
111     guint16     ls_age;
112     guint8      options;
113     guint8      ls_type;
114     guint32     ls_id;
115     guint32     adv_router;
116     guint32     ls_seq;
117     guint16     ls_checksum;
118     guint16     length;
119 } e_ospf_lsa_hdr;
120
121 typedef struct _e_ospf_router_lsa {
122     guint8 flags;
123     guint8 empfty;
124     guint16 nr_links;
125 } e_ospf_router_lsa;
126
127 typedef struct _e_ospf_router_data {
128     guint32 link_id;
129     guint32 link_data;
130     guint8 link_type;
131     guint8 nr_tos;
132     guint16 tos0_metric;
133 } e_ospf_router_data;
134
135 typedef struct _e_ospf_router_metric {
136     guint8      tos;
137     guint8      empty;
138     guint16     metric;
139 } e_ospf_router_metric;
140
141 typedef struct  _e_ospf_network_lsa {
142     guint32     network_mask;
143 } e_ospf_network_lsa;
144
145 typedef struct _e_ospf_lsa_upd_hdr {
146     guint32     lsa_nr;
147 } e_ospf_lsa_upd_hdr;
148
149 typedef struct _e_ospf_summary_lsa {
150     guint32     network_mask;
151 } e_ospf_summary_lsa;
152
153 typedef struct _e_ospf_asexternal_lsa {
154     guint8      options;
155     guint8      metric[3];
156     guint32     gateway;
157     guint32     external_tag;
158 } e_ospf_asexternal_lsa;
159
160 typedef struct _e_ospf_crypto {
161     guint16   mbz;
162     guint8      key_id;
163     guint8      length;
164     guint32   sequence_num;
165 } e_ospf_crypto;
166
167 #endif