]>
git.proxmox.com Git - mirror_frr.git/blob - isisd/isis_pdu.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * IS-IS Rout(e)ing protocol - isis_pdu.h
6 * Copyright (C) 2001,2002 Sampo Saaristo
7 * Tampere University of Technology
8 * Institute of Communications Engineering
11 #ifndef _ZEBRA_ISIS_PDU_H
12 #define _ZEBRA_ISIS_PDU_H
14 #include "isisd/isis_tx_queue.h"
23 * ES to IS Fixed Header
24 * +-------+-------+-------+-------+-------+-------+-------+-------+
25 * | Intradomain Routeing Protocol Discriminator |
26 * +-------+-------+-------+-------+-------+-------+-------+-------+
27 * | Length Indicator |
28 * +-------+-------+-------+-------+-------+-------+-------+-------+
29 * | Version/Protocol ID extension |
30 * +-------+-------+-------+-------+-------+-------+-------+-------+
32 * +-------+-------+-------+-------+-------+-------+-------+-------+
33 * | 0 | 0 | 0 | PDU Type |
34 * +-------+-------+-------+-------+-------+-------+-------+-------+
36 * +-------+-------+-------+-------+-------+-------+-------+-------+
38 * +-------+-------+-------+-------+-------+-------+-------+-------+
41 struct esis_fixed_hdr
{
49 } __attribute__((packed
));
51 #define ESIS_FIXED_HDR_LEN 9
57 #define ISIS_FIXED_HDR_LEN 8
63 #define L1_LAN_HELLO 15
64 #define L2_LAN_HELLO 16
66 * L1 and L2 LAN IS to IS Hello PDU header
67 * +-------+-------+-------+-------+-------+-------+-------+-------+
68 * | Reserved | Circuit Type | 1
69 * +-------+-------+-------+-------+-------+-------+-------+-------+
70 * + Source ID + id_len
71 * +-------+-------+-------+-------+-------+-------+-------+-------+
73 * +-------+-------+-------+-------+-------+-------+-------+-------+
75 * +-------+-------+-------+-------+-------+-------+-------+-------+
77 * +-------+-------+-------+-------+-------+-------+-------+-------+
78 * | LAN ID | id_len + 1
79 * +-------+-------+-------+-------+-------+-------+-------+-------+
81 struct isis_lan_hello_hdr
{
83 uint8_t source_id
[ISIS_SYS_ID_LEN
];
87 uint8_t lan_id
[ISIS_SYS_ID_LEN
+ 1];
88 } __attribute__((packed
));
89 #define ISIS_LANHELLO_HDRLEN 19
93 * Point-to-point IS to IS hello PDU header
94 * +-------+-------+-------+-------+-------+-------+-------+-------+
95 * | Reserved | Circuit Type | 1
96 * +-------+-------+-------+-------+-------+-------+-------+-------+
97 * + Source ID + id_len
98 * +-------+-------+-------+-------+-------+-------+-------+-------+
100 * +-------+-------+-------+-------+-------+-------+-------+-------+
102 * +-------+-------+-------+-------+-------+-------+-------+-------+
103 * | Local Circuit ID | 1
104 * +-------+-------+-------+-------+-------+-------+-------+-------+
106 struct isis_p2p_hello_hdr
{
108 uint8_t source_id
[ISIS_SYS_ID_LEN
];
112 } __attribute__((packed
));
113 #define ISIS_P2PHELLO_HDRLEN 12
115 #define L1_LINK_STATE 18
116 #define L2_LINK_STATE 20
117 #define FS_LINK_STATE 10
118 #define L2_CIRCUIT_FLOODING_SCOPE 2
119 struct isis_lsp_hdr
{
121 uint16_t rem_lifetime
;
122 uint8_t lsp_id
[ISIS_SYS_ID_LEN
+ 2];
127 #define ISIS_LSP_HDR_LEN 19
130 * Since the length field of LSP Entries TLV is one byte long, and each LSP
131 * entry is LSP_ENTRIES_LEN (16) bytes long, the maximum number of LSP entries
132 * can be accommodated in a TLV is
135 * Therefore, the maximum length of the LSP Entries TLV is
136 * 16 * 15 + 2 (header) = 242 bytes.
138 #define MAX_LSP_ENTRIES_TLV_SIZE 242
140 #define L1_COMPLETE_SEQ_NUM 24
141 #define L2_COMPLETE_SEQ_NUM 25
143 * L1 and L2 IS to IS complete sequence numbers PDU header
144 * +-------+-------+-------+-------+-------+-------+-------+-------+
146 * +-------+-------+-------+-------+-------+-------+-------+-------+
147 * + Source ID + id_len + 1
148 * +-------+-------+-------+-------+-------+-------+-------+-------+
149 * + Start LSP ID + id_len + 2
150 * +-------+-------+-------+-------+-------+-------+-------+-------+
151 * + End LSP ID + id_len + 2
152 * +-------+-------+-------+-------+-------+-------+-------+-------+
154 struct isis_complete_seqnum_hdr
{
156 uint8_t source_id
[ISIS_SYS_ID_LEN
+ 1];
157 uint8_t start_lsp_id
[ISIS_SYS_ID_LEN
+ 2];
158 uint8_t stop_lsp_id
[ISIS_SYS_ID_LEN
+ 2];
160 #define ISIS_CSNP_HDRLEN 25
162 #define L1_PARTIAL_SEQ_NUM 26
163 #define L2_PARTIAL_SEQ_NUM 27
165 * L1 and L2 IS to IS partial sequence numbers PDU header
166 * +-------+-------+-------+-------+-------+-------+-------+-------+
168 * +-------+-------+-------+-------+-------+-------+-------+-------+
169 * + Source ID + id_len + 1
170 * +---------------------------------------------------------------+
172 struct isis_partial_seqnum_hdr
{
174 uint8_t source_id
[ISIS_SYS_ID_LEN
+ 1];
176 #define ISIS_PSNP_HDRLEN 9
183 * Function for receiving IS-IS PDUs
185 void isis_receive(struct thread
*thread
);
188 * calling arguments for snp_process ()
190 #define ISIS_SNP_PSNP_FLAG 0
191 #define ISIS_SNP_CSNP_FLAG 1
193 #define ISIS_AUTH_MD5_SIZE 16U
198 void send_hello_sched(struct isis_circuit
*circuit
, int level
, long delay
);
199 int send_csnp(struct isis_circuit
*circuit
, int level
);
200 void send_l1_csnp(struct thread
*thread
);
201 void send_l2_csnp(struct thread
*thread
);
202 void send_l1_psnp(struct thread
*thread
);
203 void send_l2_psnp(struct thread
*thread
);
204 void send_lsp(struct isis_circuit
*circuit
,
205 struct isis_lsp
*lsp
, enum isis_tx_type tx_type
);
206 void fill_fixed_hdr(uint8_t pdu_type
, struct stream
*stream
);
207 int send_hello(struct isis_circuit
*circuit
, int level
);
208 int isis_handle_pdu(struct isis_circuit
*circuit
, uint8_t *ssnpa
);
209 #endif /* _ZEBRA_ISIS_PDU_H */