]>
Commit | Line | Data |
---|---|---|
0ef4bcdc OD |
1 | /* |
2 | * This is an implementation of RFC4970 Router Information | |
3 | * with support of RFC5088 PCE Capabilites announcement | |
4 | * | |
5 | * Module name: Router Information | |
6 | * Version: 0.99.22 | |
7 | * Created: 2012-02-01 by Olivier Dugeon | |
8 | * Copyright (C) 2012 Orange Labs http://www.orange.com/ | |
9 | * | |
10 | * This file is part of GNU Zebra. | |
11 | * | |
12 | * GNU Zebra is free software; you can redistribute it and/or modify it | |
13 | * under the terms of the GNU General Public License as published by the | |
14 | * Free Software Foundation; either version 2, or (at your option) any | |
15 | * later version. | |
16 | * | |
17 | * GNU Zebra is distributed in the hope that it will be useful, but | |
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
20 | * General Public License for more details. | |
21 | * | |
896014f4 DL |
22 | * You should have received a copy of the GNU General Public License along |
23 | * with this program; see the file COPYING; if not, write to the Free Software | |
24 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
0ef4bcdc OD |
25 | */ |
26 | ||
27 | #ifndef _ZEBRA_OSPF_ROUTER_INFO_H | |
28 | #define _ZEBRA_OSPF_ROUTER_INFO_H | |
29 | ||
30 | /* | |
31 | * Opaque LSA's link state ID for Router Information is | |
32 | * structured as follows. | |
33 | * | |
34 | * 24 16 8 0 | |
35 | * +--------+--------+--------+--------+ | |
36 | * | 1 | MBZ |........|........| | |
37 | * +--------+--------+--------+--------+ | |
38 | * |<-Type->|<Resv'd>|<-- Instance --->| | |
39 | * | |
40 | * | |
41 | * Type: IANA has assigned '4' for Router Information. | |
42 | * MBZ: Reserved, must be set to zero. | |
43 | * Instance: User may select an arbitrary 16-bit value. | |
44 | * | |
45 | */ | |
46 | ||
47 | /* | |
48 | * 24 16 8 0 | |
49 | * +--------+--------+--------+--------+ --- | |
50 | * | LS age |Options | 9,10,11| A | |
51 | * +--------+--------+--------+--------+ | | |
52 | * | 4 | 0 | Instance | | | |
53 | * +--------+--------+--------+--------+ | | |
54 | * | Advertising router | | Standard (Opaque) LSA header; | |
55 | * +--------+--------+--------+--------+ | Type 9,10 or 11 are used. | |
56 | * | LS sequence number | | | |
57 | * +--------+--------+--------+--------+ | | |
58 | * | LS checksum | Length | V | |
59 | * +--------+--------+--------+--------+ --- | |
60 | * | Type | Length | A | |
d62a17ae | 61 | * +--------+--------+--------+--------+ | TLV part for Router Information; |
62 | * Values might be | |
0ef4bcdc OD |
63 | * | Values ... | V structured as a set of sub-TLVs. |
64 | * +--------+--------+--------+--------+ --- | |
65 | */ | |
66 | ||
0ef4bcdc OD |
67 | /* |
68 | * Following section defines TLV body parts. | |
69 | */ | |
70 | ||
71 | /* Up to now, 8 code point have been assigned to Router Information */ | |
72 | /* Only type 1 Router Capabilities and 6 PCE are supported with this code */ | |
73 | #define RI_IANA_MAX_TYPE 8 | |
74 | ||
75 | /* RFC4970: Router Information Capabilities TLV */ /* Mandatory */ | |
76 | #define RI_TLV_CAPABILITIES 1 | |
77 | ||
d62a17ae | 78 | struct ri_tlv_router_cap { |
ead99d5f | 79 | struct tlv_header header; /* Value length is 4 bytes. */ |
d62a17ae | 80 | u_int32_t value; |
0ef4bcdc OD |
81 | }; |
82 | ||
83 | #define RI_GRACE_RESTART 0x01 | |
84 | #define RI_GRACE_HELPER 0x02 | |
85 | #define RI_STUB_SUPPORT 0x04 | |
86 | #define RI_TE_SUPPORT 0x08 | |
87 | #define RI_P2P_OVER_LAN 0x10 | |
88 | #define RI_TE_EXPERIMENTAL 0x20 | |
89 | ||
90 | #define RI_TLV_LENGTH 4 | |
91 | ||
92 | /* RFC5088: PCE Capabilities TLV */ /* Optional */ | |
93 | /* RI PCE TLV */ | |
94 | #define RI_TLV_PCE 6 | |
95 | ||
d62a17ae | 96 | struct ri_tlv_pce { |
ead99d5f | 97 | struct tlv_header header; |
d62a17ae | 98 | /* A set of PCE-sub-TLVs will follow. */ |
0ef4bcdc OD |
99 | }; |
100 | ||
101 | /* PCE Address Sub-TLV */ /* Mandatory */ | |
102 | #define RI_PCE_SUBTLV_ADDRESS 1 | |
d62a17ae | 103 | struct ri_pce_subtlv_address { |
ead99d5f OD |
104 | /* Type = 1; Length is 8 (IPv4) or 20 (IPv6) bytes. */ |
105 | struct tlv_header header; | |
0ef4bcdc OD |
106 | #define PCE_ADDRESS_LENGTH_IPV4 8 |
107 | #define PCE_ADDRESS_LENGTH_IPV6 20 | |
d62a17ae | 108 | struct { |
109 | u_int16_t type; /* Address type: 1 = IPv4, 2 = IPv6 */ | |
0ef4bcdc OD |
110 | #define PCE_ADDRESS_TYPE_IPV4 1 |
111 | #define PCE_ADDRESS_TYPE_IPV6 2 | |
d62a17ae | 112 | u_int16_t reserved; |
113 | struct in_addr value; /* PCE address */ | |
114 | } address; | |
0ef4bcdc OD |
115 | }; |
116 | ||
117 | /* PCE Path-Scope Sub-TLV */ /* Mandatory */ | |
118 | #define RI_PCE_SUBTLV_PATH_SCOPE 2 | |
d62a17ae | 119 | struct ri_pce_subtlv_path_scope { |
ead99d5f OD |
120 | struct tlv_header header; /* Type = 2; Length = 4 bytes. */ |
121 | /* | |
122 | * L, R, Rd, S, Sd, Y, PrefL, PrefR, PrefS and PrefY bits: | |
123 | * see RFC5088 page 9 | |
124 | */ | |
125 | u_int32_t value; | |
0ef4bcdc OD |
126 | }; |
127 | ||
128 | /* PCE Domain Sub-TLV */ /* Optional */ | |
129 | #define RI_PCE_SUBTLV_DOMAIN 3 | |
130 | ||
131 | #define PCE_DOMAIN_TYPE_AREA 1 | |
132 | #define PCE_DOMAIN_TYPE_AS 2 | |
133 | ||
d62a17ae | 134 | struct ri_pce_subtlv_domain { |
ead99d5f | 135 | struct tlv_header header; /* Type = 3; Length = 8 bytes. */ |
d62a17ae | 136 | u_int16_t type; /* Domain type: 1 = OSPF Area ID, 2 = AS Number */ |
137 | u_int16_t reserved; | |
138 | u_int32_t value; | |
0ef4bcdc OD |
139 | }; |
140 | ||
141 | /* PCE Neighbor Sub-TLV */ /* Mandatory if R or S bit is set */ | |
142 | #define RI_PCE_SUBTLV_NEIGHBOR 4 | |
d62a17ae | 143 | struct ri_pce_subtlv_neighbor { |
ead99d5f | 144 | struct tlv_header header; /* Type = 4; Length = 8 bytes. */ |
d62a17ae | 145 | u_int16_t type; /* Domain type: 1 = OSPF Area ID, 2 = AS Number */ |
146 | u_int16_t reserved; | |
147 | u_int32_t value; | |
0ef4bcdc OD |
148 | }; |
149 | ||
150 | /* PCE Capabilities Flags Sub-TLV */ /* Optional */ | |
151 | #define RI_PCE_SUBTLV_CAP_FLAG 5 | |
152 | ||
153 | #define PCE_CAP_GMPLS_LINK 0x0001 | |
154 | #define PCE_CAP_BIDIRECTIONAL 0x0002 | |
155 | #define PCE_CAP_DIVERSE_PATH 0x0004 | |
156 | #define PCE_CAP_LOAD_BALANCE 0x0008 | |
157 | #define PCE_CAP_SYNCHRONIZED 0x0010 | |
158 | #define PCE_CAP_OBJECTIVES 0x0020 | |
159 | #define PCE_CAP_ADDITIVE 0x0040 | |
160 | #define PCE_CAP_PRIORIZATION 0x0080 | |
161 | #define PCE_CAP_MULTIPLE_REQ 0x0100 | |
162 | ||
d62a17ae | 163 | struct ri_pce_subtlv_cap_flag { |
ead99d5f | 164 | struct tlv_header header; /* Type = 5; Length = n x 4 bytes. */ |
d62a17ae | 165 | u_int32_t value; |
0ef4bcdc OD |
166 | }; |
167 | ||
168 | /* Prototypes. */ | |
d62a17ae | 169 | extern int ospf_router_info_init(void); |
170 | extern void ospf_router_info_term(void); | |
0ef4bcdc OD |
171 | |
172 | #endif /* _ZEBRA_OSPF_ROUTER_INFO_H */ |