- add ipv6.addr for the source and destination addresses (like ipv4)
[obnox/wireshark/wip.git] / packet-ospf.h
1 /* packet-ospf.h
2  *
3  * $Id: packet-ospf.h,v 1.9 2000/08/11 13:34:04 deniel 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
60 /* Opaque LSA types */
61 #define OSPF_LSTYPE_OP_LINKLOCAL 9
62 #define OSPF_LSTYPE_OP_AREALOCAL 10
63 #define OSPF_LSTYPE_OP_ASWIDE    11
64
65 #define OSPF_LINK_PTP           1
66 #define OSPF_LINK_TRANSIT       2
67 #define OSPF_LINK_STUB          3
68 #define OSPF_LINK_VIRTUAL       4
69
70 #define OSPF_LSA_HEADER_LENGTH  20
71
72 /* Known opaque LSAs */
73 #define OSPF_LSA_MPLS_TE        1
74
75 typedef struct _e_ospfhdr {
76     guint8  version;
77     guint8  packet_type;
78     guint16 length;
79     guint32 routerid;
80     guint32 area;
81     guint16 checksum;
82     guint16 auth_type;
83     char auth_data[8];
84 } e_ospfhdr;
85
86 typedef struct _e_ospf_hello {
87     guint32 network_mask;
88     guint16 hellointervall;
89     guint8  options;
90     guint8  priority;
91     guint32 dead_interval;
92     guint32 drouter;
93     guint32 bdrouter;
94 } e_ospf_hello ;
95
96 typedef struct _e_ospf_dbd {
97    guint16 interface_mtu;
98    guint8  options;
99    guint8  flags;
100    guint32 dd_sequence;
101 } e_ospf_dbd;
102
103 typedef struct _e_ospf_ls_req {
104     guint32     ls_type;
105     guint32     ls_id;
106     guint32     adv_router;
107 } e_ospf_ls_req;
108
109 typedef struct _e_ospf_lsa_hdr {
110     guint16     ls_age;
111     guint8      options;
112     guint8      ls_type;
113     guint32     ls_id;
114     guint32     adv_router;
115     guint32     ls_seq;
116     guint16     ls_checksum;
117     guint16     length;
118 } e_ospf_lsa_hdr;
119
120 typedef struct _e_ospf_router_lsa {
121     guint8 flags;
122     guint8 empfty;
123     guint16 nr_links;
124 } e_ospf_router_lsa;
125
126 typedef struct _e_ospf_router_data {
127     guint32 link_id;
128     guint32 link_data;
129     guint8 link_type;
130     guint8 nr_tos;
131     guint16 tos0_metric;
132 } e_ospf_router_data;
133
134 typedef struct _e_ospf_router_metric {
135     guint8      tos;
136     guint8      empty;
137     guint16     metric;
138 } e_ospf_router_metric;
139
140 typedef struct  _e_ospf_network_lsa {
141     guint32     network_mask;
142 } e_ospf_network_lsa;
143
144 typedef struct _e_ospf_lsa_upd_hdr {
145     guint32     lsa_nr;
146 } e_ospf_lsa_upd_hdr;
147
148 typedef struct _e_ospf_summary_lsa {
149     guint32     network_mask;
150 } e_ospf_summary_lsa;
151
152 typedef struct _e_ospf_asexternal_lsa {
153     guint8      options;
154     guint8      metric[3];
155     guint32     gateway;
156     guint32     external_tag;
157 } e_ospf_asexternal_lsa;
158
159 typedef struct _e_ospf_crypto {
160     guint16   mbz;
161     guint8      key_id;
162     guint8      length;
163     guint32   sequence_num;
164 } e_ospf_crypto;
165
166 #endif