2
* IS-IS Rout(e)ing protocol - isis_pdu.h
5
* Copyright (C) 2001,2002 Sampo Saaristo
6
* Tampere University of Technology
7
* Institute of Communications Engineering
9
* This program is free software; you can redistribute it and/or modify it
10
* under the terms of the GNU General Public Licenseas published by the Free
11
* Software Foundation; either version 2 of the License, or (at your option)
14
* This program is distributed in the hope that it will be useful,but WITHOUT
15
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
19
* You should have received a copy of the GNU General Public License along
20
* with this program; if not, write to the Free Software Foundation, Inc.,
21
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24
#ifndef _ZEBRA_ISIS_PDU_H
25
#define _ZEBRA_ISIS_PDU_H
30
* ES to IS Fixed Header
31
* +-------+-------+-------+-------+-------+-------+-------+-------+
32
* | Intradomain Routeing Protocol Discriminator |
33
* +-------+-------+-------+-------+-------+-------+-------+-------+
34
* | Length Indicator |
35
* +-------+-------+-------+-------+-------+-------+-------+-------+
36
* | Version/Protocol ID extension |
37
* +-------+-------+-------+-------+-------+-------+-------+-------+
39
* +-------+-------+-------+-------+-------+-------+-------+-------+
40
* | 0 | 0 | 0 | PDU Type |
41
* +-------+-------+-------+-------+-------+-------+-------+-------+
43
* +-------+-------+-------+-------+-------+-------+-------+-------+
45
* +-------+-------+-------+-------+-------+-------+-------+-------+
57
} __attribute__((packed));
59
#define ESIS_FIXED_HDR_LEN 9
66
* IS to IS Fixed Header
67
* +-------+-------+-------+-------+-------+-------+-------+-------+
68
* | Intradomain Routeing Protocol Discriminator |
69
* +-------+-------+-------+-------+-------+-------+-------+-------+
70
* | Length Indicator |
71
* +-------+-------+-------+-------+-------+-------+-------+-------+
72
* | Version/Protocol ID extension |
73
* +-------+-------+-------+-------+-------+-------+-------+-------+
74
* | R | R | R | PDU Type |
75
* +-------+-------+-------+-------+-------+-------+-------+-------+
77
* +-------+-------+-------+-------+-------+-------+-------+-------+
79
* +-------+-------+-------+-------+-------+-------+-------+-------+
80
* | Maximum Area Addresses |
81
* +-------+-------+-------+-------+-------+-------+-------+-------+
93
u_char max_area_addrs;
96
#define ISIS_FIXED_HDR_LEN 8
102
#define L1_LAN_HELLO 15
103
#define L2_LAN_HELLO 16
105
* L1 and L2 LAN IS to IS Hello PDU header
106
* +-------+-------+-------+-------+-------+-------+-------+-------+
107
* | Reserved | Circuit Type | 1
108
* +-------+-------+-------+-------+-------+-------+-------+-------+
109
* + Source ID + id_len
110
* +-------+-------+-------+-------+-------+-------+-------+-------+
112
* +-------+-------+-------+-------+-------+-------+-------+-------+
114
* +-------+-------+-------+-------+-------+-------+-------+-------+
116
* +-------+-------+-------+-------+-------+-------+-------+-------+
117
* | LAN ID | id_len + 1
118
* +-------+-------+-------+-------+-------+-------+-------+-------+
120
struct isis_lan_hello_hdr {
122
u_char source_id[ISIS_SYS_ID_LEN];
126
u_char lan_id[ISIS_SYS_ID_LEN + 1];
127
} __attribute__((packed));
128
#define ISIS_LANHELLO_HDRLEN 19
132
* Point-to-point IS to IS hello PDU header
133
* +-------+-------+-------+-------+-------+-------+-------+-------+
134
* | Reserved | Circuit Type | 1
135
* +-------+-------+-------+-------+-------+-------+-------+-------+
136
* + Source ID + id_len
137
* +-------+-------+-------+-------+-------+-------+-------+-------+
139
* +-------+-------+-------+-------+-------+-------+-------+-------+
141
* +-------+-------+-------+-------+-------+-------+-------+-------+
142
* | Local Circuit ID | 1
143
* +-------+-------+-------+-------+-------+-------+-------+-------+
145
struct isis_p2p_hello_hdr {
147
u_char source_id[ISIS_SYS_ID_LEN];
151
} __attribute__((packed));
152
#define ISIS_P2PHELLO_HDRLEN 12
154
#define L1_LINK_STATE 18
155
#define L2_LINK_STATE 20
157
* L1 and L2 IS to IS link state PDU header
158
* +-------+-------+-------+-------+-------+-------+-------+-------+
160
* +-------+-------+-------+-------+-------+-------+-------+-------+
161
* + Remaining Lifetime + 2
162
* +-------+-------+-------+-------+-------+-------+-------+-------+
163
* | LSP ID | id_len + 2
164
* +-------+-------+-------+-------+-------+-------+-------+-------+
165
* + Sequence Number + 4
166
* +-------+-------+-------+-------+-------+-------+-------+-------+
168
* +-------+-------+-------+-------+-------+-------+-------+-------+
169
* | P | ATT |LSPDBOL| ISTYPE |
170
* +-------+-------+-------+-------+-------+-------+-------+-------+
172
struct isis_link_state_hdr {
174
u_int16_t rem_lifetime;
175
u_char lsp_id[ISIS_SYS_ID_LEN + 2];
179
} __attribute__((packed));
180
#define ISIS_LSP_HDR_LEN 19
182
#define L1_COMPLETE_SEQ_NUM 24
183
#define L2_COMPLETE_SEQ_NUM 25
185
* L1 and L2 IS to IS complete sequence numbers PDU header
186
* +-------+-------+-------+-------+-------+-------+-------+-------+
188
* +-------+-------+-------+-------+-------+-------+-------+-------+
189
* + Source ID + id_len + 1
190
* +-------+-------+-------+-------+-------+-------+-------+-------+
191
* + Start LSP ID + id_len + 2
192
* +-------+-------+-------+-------+-------+-------+-------+-------+
193
* + End LSP ID + id_len + 2
194
* +-------+-------+-------+-------+-------+-------+-------+-------+
196
struct isis_complete_seqnum_hdr {
198
u_char source_id[ISIS_SYS_ID_LEN + 1];
199
u_char start_lsp_id[ISIS_SYS_ID_LEN + 2];
200
u_char stop_lsp_id[ISIS_SYS_ID_LEN + 2];
202
#define ISIS_CSNP_HDRLEN 25
204
#define L1_PARTIAL_SEQ_NUM 26
205
#define L2_PARTIAL_SEQ_NUM 27
207
* L1 and L2 IS to IS partial sequence numbers PDU header
208
* +-------+-------+-------+-------+-------+-------+-------+-------+
210
* +-------+-------+-------+-------+-------+-------+-------+-------+
211
* + Source ID + id_len + 1
212
* +---------------------------------------------------------------+
214
struct isis_partial_seqnum_hdr {
216
u_char source_id[ISIS_SYS_ID_LEN + 1];
218
#define ISIS_PSNP_HDRLEN 9
221
* Function for receiving IS-IS PDUs
223
int isis_receive (struct thread *thread);
226
* calling arguments for snp_process ()
228
#define ISIS_SNP_PSNP_FLAG 0
229
#define ISIS_SNP_CSNP_FLAG 1
234
int send_lan_l1_hello (struct thread *thread);
235
int send_lan_l2_hello (struct thread *thread);
236
int send_p2p_hello (struct thread *thread);
237
int send_csnp (struct isis_circuit *circuit, int level);
238
int send_l1_csnp (struct thread *thread);
239
int send_l2_csnp (struct thread *thread);
240
int send_l1_psnp (struct thread *thread);
241
int send_l2_psnp (struct thread *thread);
242
int send_lsp (struct thread *thread);
243
int ack_lsp (struct isis_link_state_hdr *hdr,
244
struct isis_circuit *circuit, int level);
245
void fill_fixed_hdr (struct isis_fixed_hdr *hdr, u_char pdu_type);
246
int send_hello (struct isis_circuit *circuit, int level);
249
int authentication_check (struct isis_passwd *one,
250
struct isis_passwd *theother);
252
#endif /* _ZEBRA_ISIS_PDU_H */