]>
git.proxmox.com Git - mirror_frr.git/blob - isisd/isis_pdu.h
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; see the file COPYING; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 #ifndef _ZEBRA_ISIS_PDU_H
25 #define _ZEBRA_ISIS_PDU_H
27 #include "isisd/isis_tx_queue.h"
36 * ES to IS Fixed Header
37 * +-------+-------+-------+-------+-------+-------+-------+-------+
38 * | Intradomain Routeing Protocol Discriminator |
39 * +-------+-------+-------+-------+-------+-------+-------+-------+
40 * | Length Indicator |
41 * +-------+-------+-------+-------+-------+-------+-------+-------+
42 * | Version/Protocol ID extension |
43 * +-------+-------+-------+-------+-------+-------+-------+-------+
45 * +-------+-------+-------+-------+-------+-------+-------+-------+
46 * | 0 | 0 | 0 | PDU Type |
47 * +-------+-------+-------+-------+-------+-------+-------+-------+
49 * +-------+-------+-------+-------+-------+-------+-------+-------+
51 * +-------+-------+-------+-------+-------+-------+-------+-------+
54 struct esis_fixed_hdr
{
62 } __attribute__((packed
));
64 #define ESIS_FIXED_HDR_LEN 9
70 #define ISIS_FIXED_HDR_LEN 8
76 #define L1_LAN_HELLO 15
77 #define L2_LAN_HELLO 16
79 * L1 and L2 LAN IS to IS Hello PDU header
80 * +-------+-------+-------+-------+-------+-------+-------+-------+
81 * | Reserved | Circuit Type | 1
82 * +-------+-------+-------+-------+-------+-------+-------+-------+
83 * + Source ID + id_len
84 * +-------+-------+-------+-------+-------+-------+-------+-------+
86 * +-------+-------+-------+-------+-------+-------+-------+-------+
88 * +-------+-------+-------+-------+-------+-------+-------+-------+
90 * +-------+-------+-------+-------+-------+-------+-------+-------+
91 * | LAN ID | id_len + 1
92 * +-------+-------+-------+-------+-------+-------+-------+-------+
94 struct isis_lan_hello_hdr
{
96 uint8_t source_id
[ISIS_SYS_ID_LEN
];
100 uint8_t lan_id
[ISIS_SYS_ID_LEN
+ 1];
101 } __attribute__((packed
));
102 #define ISIS_LANHELLO_HDRLEN 19
106 * Point-to-point IS to IS hello PDU header
107 * +-------+-------+-------+-------+-------+-------+-------+-------+
108 * | Reserved | Circuit Type | 1
109 * +-------+-------+-------+-------+-------+-------+-------+-------+
110 * + Source ID + id_len
111 * +-------+-------+-------+-------+-------+-------+-------+-------+
113 * +-------+-------+-------+-------+-------+-------+-------+-------+
115 * +-------+-------+-------+-------+-------+-------+-------+-------+
116 * | Local Circuit ID | 1
117 * +-------+-------+-------+-------+-------+-------+-------+-------+
119 struct isis_p2p_hello_hdr
{
121 uint8_t source_id
[ISIS_SYS_ID_LEN
];
125 } __attribute__((packed
));
126 #define ISIS_P2PHELLO_HDRLEN 12
128 #define L1_LINK_STATE 18
129 #define L2_LINK_STATE 20
130 #define FS_LINK_STATE 10
131 #define L2_CIRCUIT_FLOODING_SCOPE 2
132 struct isis_lsp_hdr
{
134 uint16_t rem_lifetime
;
135 uint8_t lsp_id
[ISIS_SYS_ID_LEN
+ 2];
140 #define ISIS_LSP_HDR_LEN 19
143 * Since the length field of LSP Entries TLV is one byte long, and each LSP
144 * entry is LSP_ENTRIES_LEN (16) bytes long, the maximum number of LSP entries
145 * can be accomodated in a TLV is
148 * Therefore, the maximum length of the LSP Entries TLV is
149 * 16 * 15 + 2 (header) = 242 bytes.
151 #define MAX_LSP_ENTRIES_TLV_SIZE 242
153 #define L1_COMPLETE_SEQ_NUM 24
154 #define L2_COMPLETE_SEQ_NUM 25
156 * L1 and L2 IS to IS complete sequence numbers PDU header
157 * +-------+-------+-------+-------+-------+-------+-------+-------+
159 * +-------+-------+-------+-------+-------+-------+-------+-------+
160 * + Source ID + id_len + 1
161 * +-------+-------+-------+-------+-------+-------+-------+-------+
162 * + Start LSP ID + id_len + 2
163 * +-------+-------+-------+-------+-------+-------+-------+-------+
164 * + End LSP ID + id_len + 2
165 * +-------+-------+-------+-------+-------+-------+-------+-------+
167 struct isis_complete_seqnum_hdr
{
169 uint8_t source_id
[ISIS_SYS_ID_LEN
+ 1];
170 uint8_t start_lsp_id
[ISIS_SYS_ID_LEN
+ 2];
171 uint8_t stop_lsp_id
[ISIS_SYS_ID_LEN
+ 2];
173 #define ISIS_CSNP_HDRLEN 25
175 #define L1_PARTIAL_SEQ_NUM 26
176 #define L2_PARTIAL_SEQ_NUM 27
178 * L1 and L2 IS to IS partial sequence numbers PDU header
179 * +-------+-------+-------+-------+-------+-------+-------+-------+
181 * +-------+-------+-------+-------+-------+-------+-------+-------+
182 * + Source ID + id_len + 1
183 * +---------------------------------------------------------------+
185 struct isis_partial_seqnum_hdr
{
187 uint8_t source_id
[ISIS_SYS_ID_LEN
+ 1];
189 #define ISIS_PSNP_HDRLEN 9
196 * Function for receiving IS-IS PDUs
198 int isis_receive(struct thread
*thread
);
201 * calling arguments for snp_process ()
203 #define ISIS_SNP_PSNP_FLAG 0
204 #define ISIS_SNP_CSNP_FLAG 1
206 #define ISIS_AUTH_MD5_SIZE 16U
211 void send_hello_sched(struct isis_circuit
*circuit
, int level
, long delay
);
212 int send_csnp(struct isis_circuit
*circuit
, int level
);
213 int send_l1_csnp(struct thread
*thread
);
214 int send_l2_csnp(struct thread
*thread
);
215 int send_l1_psnp(struct thread
*thread
);
216 int send_l2_psnp(struct thread
*thread
);
217 void send_lsp(struct isis_circuit
*circuit
,
218 struct isis_lsp
*lsp
, enum isis_tx_type tx_type
);
219 void fill_fixed_hdr(uint8_t pdu_type
, struct stream
*stream
);
220 int send_hello(struct isis_circuit
*circuit
, int level
);
221 int isis_handle_pdu(struct isis_circuit
*circuit
, uint8_t *ssnpa
);
222 #endif /* _ZEBRA_ISIS_PDU_H */