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
34 * ES to IS Fixed Header
35 * +-------+-------+-------+-------+-------+-------+-------+-------+
36 * | Intradomain Routeing Protocol Discriminator |
37 * +-------+-------+-------+-------+-------+-------+-------+-------+
38 * | Length Indicator |
39 * +-------+-------+-------+-------+-------+-------+-------+-------+
40 * | Version/Protocol ID extension |
41 * +-------+-------+-------+-------+-------+-------+-------+-------+
43 * +-------+-------+-------+-------+-------+-------+-------+-------+
44 * | 0 | 0 | 0 | PDU Type |
45 * +-------+-------+-------+-------+-------+-------+-------+-------+
47 * +-------+-------+-------+-------+-------+-------+-------+-------+
49 * +-------+-------+-------+-------+-------+-------+-------+-------+
61 } __attribute__ ((packed
));
63 #define ESIS_FIXED_HDR_LEN 9
70 * IS to IS Fixed Header
71 * +-------+-------+-------+-------+-------+-------+-------+-------+
72 * | Intradomain Routeing Protocol Discriminator |
73 * +-------+-------+-------+-------+-------+-------+-------+-------+
74 * | Length Indicator |
75 * +-------+-------+-------+-------+-------+-------+-------+-------+
76 * | Version/Protocol ID extension |
77 * +-------+-------+-------+-------+-------+-------+-------+-------+
78 * | R | R | R | PDU Type |
79 * +-------+-------+-------+-------+-------+-------+-------+-------+
81 * +-------+-------+-------+-------+-------+-------+-------+-------+
83 * +-------+-------+-------+-------+-------+-------+-------+-------+
84 * | Maximum Area Addresses |
85 * +-------+-------+-------+-------+-------+-------+-------+-------+
97 u_char max_area_addrs
;
100 #define ISIS_FIXED_HDR_LEN 8
106 #define L1_LAN_HELLO 15
107 #define L2_LAN_HELLO 16
109 * L1 and L2 LAN IS to IS Hello PDU header
110 * +-------+-------+-------+-------+-------+-------+-------+-------+
111 * | Reserved | Circuit Type | 1
112 * +-------+-------+-------+-------+-------+-------+-------+-------+
113 * + Source ID + id_len
114 * +-------+-------+-------+-------+-------+-------+-------+-------+
116 * +-------+-------+-------+-------+-------+-------+-------+-------+
118 * +-------+-------+-------+-------+-------+-------+-------+-------+
120 * +-------+-------+-------+-------+-------+-------+-------+-------+
121 * | LAN ID | id_len + 1
122 * +-------+-------+-------+-------+-------+-------+-------+-------+
124 struct isis_lan_hello_hdr
127 u_char source_id
[ISIS_SYS_ID_LEN
];
131 u_char lan_id
[ISIS_SYS_ID_LEN
+ 1];
132 } __attribute__ ((packed
));
133 #define ISIS_LANHELLO_HDRLEN 19
137 * Point-to-point IS to IS hello PDU header
138 * +-------+-------+-------+-------+-------+-------+-------+-------+
139 * | Reserved | Circuit Type | 1
140 * +-------+-------+-------+-------+-------+-------+-------+-------+
141 * + Source ID + id_len
142 * +-------+-------+-------+-------+-------+-------+-------+-------+
144 * +-------+-------+-------+-------+-------+-------+-------+-------+
146 * +-------+-------+-------+-------+-------+-------+-------+-------+
147 * | Local Circuit ID | 1
148 * +-------+-------+-------+-------+-------+-------+-------+-------+
150 struct isis_p2p_hello_hdr
153 u_char source_id
[ISIS_SYS_ID_LEN
];
157 } __attribute__ ((packed
));
158 #define ISIS_P2PHELLO_HDRLEN 12
160 #define L1_LINK_STATE 18
161 #define L2_LINK_STATE 20
163 * L1 and L2 IS to IS link state PDU header
164 * +-------+-------+-------+-------+-------+-------+-------+-------+
166 * +-------+-------+-------+-------+-------+-------+-------+-------+
167 * + Remaining Lifetime + 2
168 * +-------+-------+-------+-------+-------+-------+-------+-------+
169 * | LSP ID | id_len + 2
170 * +-------+-------+-------+-------+-------+-------+-------+-------+
171 * + Sequence Number + 4
172 * +-------+-------+-------+-------+-------+-------+-------+-------+
174 * +-------+-------+-------+-------+-------+-------+-------+-------+
175 * | P | ATT |LSPDBOL| ISTYPE |
176 * +-------+-------+-------+-------+-------+-------+-------+-------+
178 struct isis_link_state_hdr
181 u_int16_t rem_lifetime
;
182 u_char lsp_id
[ISIS_SYS_ID_LEN
+ 2];
186 } __attribute__ ((packed
));
187 #define ISIS_LSP_HDR_LEN 19
189 #define L1_COMPLETE_SEQ_NUM 24
190 #define L2_COMPLETE_SEQ_NUM 25
192 * L1 and L2 IS to IS complete sequence numbers PDU header
193 * +-------+-------+-------+-------+-------+-------+-------+-------+
195 * +-------+-------+-------+-------+-------+-------+-------+-------+
196 * + Source ID + id_len + 1
197 * +-------+-------+-------+-------+-------+-------+-------+-------+
198 * + Start LSP ID + id_len + 2
199 * +-------+-------+-------+-------+-------+-------+-------+-------+
200 * + End LSP ID + id_len + 2
201 * +-------+-------+-------+-------+-------+-------+-------+-------+
203 struct isis_complete_seqnum_hdr
206 u_char source_id
[ISIS_SYS_ID_LEN
+ 1];
207 u_char start_lsp_id
[ISIS_SYS_ID_LEN
+ 2];
208 u_char stop_lsp_id
[ISIS_SYS_ID_LEN
+ 2];
210 #define ISIS_CSNP_HDRLEN 25
212 #define L1_PARTIAL_SEQ_NUM 26
213 #define L2_PARTIAL_SEQ_NUM 27
215 * L1 and L2 IS to IS partial sequence numbers PDU header
216 * +-------+-------+-------+-------+-------+-------+-------+-------+
218 * +-------+-------+-------+-------+-------+-------+-------+-------+
219 * + Source ID + id_len + 1
220 * +---------------------------------------------------------------+
222 struct isis_partial_seqnum_hdr
225 u_char source_id
[ISIS_SYS_ID_LEN
+ 1];
227 #define ISIS_PSNP_HDRLEN 9
234 * Function for receiving IS-IS PDUs
236 int isis_receive (struct thread
*thread
);
239 * calling arguments for snp_process ()
241 #define ISIS_SNP_PSNP_FLAG 0
242 #define ISIS_SNP_CSNP_FLAG 1
247 int send_lan_l1_hello (struct thread
*thread
);
248 int send_lan_l2_hello (struct thread
*thread
);
249 int send_p2p_hello (struct thread
*thread
);
250 int send_csnp (struct isis_circuit
*circuit
, int level
);
251 int send_l1_csnp (struct thread
*thread
);
252 int send_l2_csnp (struct thread
*thread
);
253 int send_l1_psnp (struct thread
*thread
);
254 int send_l2_psnp (struct thread
*thread
);
255 int send_lsp (struct thread
*thread
);
256 int ack_lsp (struct isis_link_state_hdr
*hdr
,
257 struct isis_circuit
*circuit
, int level
);
258 void fill_fixed_hdr (struct isis_fixed_hdr
*hdr
, u_char pdu_type
);
259 int send_hello (struct isis_circuit
*circuit
, int level
);
262 int authentication_check (struct isis_passwd
*one
,
263 struct isis_passwd
*theother
);
265 #endif /* _ZEBRA_ISIS_PDU_H */