]>
git.saurik.com Git - apple/network_cmds.git/blob - tcpdump.tproj/ospf.h
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * "Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7 * Reserved. This file contains Original Code and/or Modifications of
8 * Original Code as defined in and that are subject to the Apple Public
9 * Source License Version 1.0 (the 'License'). You may not use this file
10 * except in compliance with the License. Please obtain a copy of the
11 * License at http://www.apple.com/publicsource and read it before using
14 * The Original Code and all software distributed under the License are
15 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
19 * License for the specific language governing rights and limitations
22 * @APPLE_LICENSE_HEADER_END@
25 * Copyright (c) 1991, 1993, 1994, 1995, 1996
26 * The Regents of the University of California. All rights reserved.
28 * Redistribution and use in source and binary forms, with or without
29 * modification, are permitted provided that: (1) source code distributions
30 * retain the above copyright notice and this paragraph in its entirety, (2)
31 * distributions including binary code include the above copyright notice and
32 * this paragraph in its entirety in the documentation or other materials
33 * provided with the distribution, and (3) all advertising materials mentioning
34 * features or use of this software display the following acknowledgement:
35 * ``This product includes software developed by the University of California,
36 * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
37 * the University nor the names of its contributors may be used to endorse
38 * or promote products derived from this software without specific prior
40 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
41 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
42 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
44 * OSPF support contributed by Jeffrey Honig (jch@mitchell.cit.cornell.edu)
46 #define OSPF_TYPE_UMD 0 /* UMd's special monitoring packets */
47 #define OSPF_TYPE_HELLO 1 /* Hello */
48 #define OSPF_TYPE_DB 2 /* Database Description */
49 #define OSPF_TYPE_LSR 3 /* Link State Request */
50 #define OSPF_TYPE_LSU 4 /* Link State Update */
51 #define OSPF_TYPE_LSA 5 /* Link State Ack */
52 #define OSPF_TYPE_MAX 6
54 /* Options *_options */
55 #define OSPF_OPTION_T 0x01 /* T bit: TOS support */
56 #define OSPF_OPTION_E 0x02 /* E bit: External routes advertised */
57 #define OSPF_OPTION_MC 0x04 /* MC bit: Multicast capable */
60 #define OSPF_AUTH_NONE 0 /* No auth-data */
61 #define OSPF_AUTH_SIMPLE 1 /* Simple password */
64 #define OSPF_DB_INIT 0x04 /* */
65 #define OSPF_DB_MORE 0x02
66 #define OSPF_DB_MASTER 0x01
69 #define LS_TYPE_ROUTER 1 /* router link */
70 #define LS_TYPE_NETWORK 2 /* network link */
71 #define LS_TYPE_SUM_IP 3 /* summary link */
72 #define LS_TYPE_SUM_ABR 4 /* summary area link */
73 #define LS_TYPE_ASE 5 /* ASE */
74 #define LS_TYPE_GROUP 6 /* Group membership (multicast */
75 /* extensions 23 July 1991) */
78 /*************************************************
80 * is the above a bug in the documentation?
82 *************************************************/
85 /* rla_link.link_type */
86 #define RLA_TYPE_ROUTER 1 /* point-to-point to another router */
87 #define RLA_TYPE_TRANSIT 2 /* connection to transit network */
88 #define RLA_TYPE_STUB 3 /* connection to stub network */
89 #define RLA_TYPE_VIRTUAL 4 /* virtual link */
92 #define RLA_FLAG_B 0x01
93 #define RLA_FLAG_E 0x02
94 #define RLA_FLAG_W1 0x04
95 #define RLA_FLAG_W2 0x08
97 /* sla_tosmetric breakdown */
98 #define SLA_MASK_TOS 0x7f000000
99 #define SLA_MASK_METRIC 0x00ffffff
100 #define SLA_SHIFT_TOS 24
102 /* asla_tosmetric breakdown */
103 #define ASLA_FLAG_EXTERNAL 0x80000000
104 #define ASLA_MASK_TOS 0x7f000000
105 #define ASLA_SHIFT_TOS 24
106 #define ASLA_MASK_METRIC 0x00ffffff
108 /* multicast vertex type */
109 #define MCLA_VERTEX_ROUTER 1
110 #define MCLA_VERTEX_NETWORK 2
112 /* link state advertisement header */
117 struct in_addr ls_stateid
;
118 struct in_addr ls_router
;
124 /* link state advertisement */
126 struct lsa_hdr ls_hdr
;
128 /* Link state types */
130 /* Router links advertisements */
136 struct in_addr link_id
;
137 struct in_addr link_data
;
139 u_char link_toscount
;
140 u_short link_tos0metric
;
141 } rla_link
[1]; /* may repeat */
144 /* Network links advertisements */
146 struct in_addr nla_mask
;
147 struct in_addr nla_router
[1]; /* may repeat */
150 /* Summary links advertisements */
152 struct in_addr sla_mask
;
153 u_int32_t sla_tosmetric
[1]; /* may repeat */
156 /* AS external links advertisements */
158 struct in_addr asla_mask
;
160 u_int32_t asla_tosmetric
;
161 struct in_addr asla_forward
;
162 struct in_addr asla_tag
;
163 } asla_metric
[1]; /* may repeat */
166 /* Multicast group membership */
168 u_int32_t mcla_vtype
;
169 struct in_addr mcla_vid
;
176 * TOS metric struct (will be 0 or more in router links update)
184 #define OSPF_AUTH_SIZE 8
193 struct in_addr ospf_routerid
;
194 struct in_addr ospf_areaid
;
196 u_short ospf_authtype
;
197 u_char ospf_authdata
[OSPF_AUTH_SIZE
];
202 struct in_addr hello_mask
;
203 u_short hello_helloint
;
204 u_char hello_options
;
205 u_char hello_priority
;
206 u_int32_t hello_deadint
;
207 struct in_addr hello_dr
;
208 struct in_addr hello_bdr
;
209 struct in_addr hello_neighbor
[1]; /* may repeat */
212 /* Database Description packet */
218 struct lsa_hdr db_lshdr
[1]; /* may repeat */
221 /* Link State Request */
224 struct in_addr ls_stateid
;
225 struct in_addr ls_router
;
226 } un_lsr
[1]; /* may repeat */
228 /* Link State Update */
231 struct lsa lsu_lsa
[1]; /* may repeat */
234 /* Link State Acknowledgement */
236 struct lsa_hdr lsa_lshdr
[1]; /* may repeat */
241 #define ospf_hello ospf_un.un_hello
242 #define ospf_db ospf_un.un_db
243 #define ospf_lsr ospf_un.un_lsr
244 #define ospf_lsu ospf_un.un_lsu
245 #define ospf_lsa ospf_un.un_lsa