]>
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
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 * +-------+-------+-------+-------+-------+-------+-------+-------+
52 struct esis_fixed_hdr
{
60 } __attribute__((packed
));
62 #define ESIS_FIXED_HDR_LEN 9
68 #define ISIS_FIXED_HDR_LEN 8
74 #define L1_LAN_HELLO 15
75 #define L2_LAN_HELLO 16
77 * L1 and L2 LAN IS to IS Hello PDU header
78 * +-------+-------+-------+-------+-------+-------+-------+-------+
79 * | Reserved | Circuit Type | 1
80 * +-------+-------+-------+-------+-------+-------+-------+-------+
81 * + Source ID + id_len
82 * +-------+-------+-------+-------+-------+-------+-------+-------+
84 * +-------+-------+-------+-------+-------+-------+-------+-------+
86 * +-------+-------+-------+-------+-------+-------+-------+-------+
88 * +-------+-------+-------+-------+-------+-------+-------+-------+
89 * | LAN ID | id_len + 1
90 * +-------+-------+-------+-------+-------+-------+-------+-------+
92 struct isis_lan_hello_hdr
{
94 uint8_t source_id
[ISIS_SYS_ID_LEN
];
98 uint8_t lan_id
[ISIS_SYS_ID_LEN
+ 1];
99 } __attribute__((packed
));
100 #define ISIS_LANHELLO_HDRLEN 19
104 * Point-to-point IS to IS hello PDU header
105 * +-------+-------+-------+-------+-------+-------+-------+-------+
106 * | Reserved | Circuit Type | 1
107 * +-------+-------+-------+-------+-------+-------+-------+-------+
108 * + Source ID + id_len
109 * +-------+-------+-------+-------+-------+-------+-------+-------+
111 * +-------+-------+-------+-------+-------+-------+-------+-------+
113 * +-------+-------+-------+-------+-------+-------+-------+-------+
114 * | Local Circuit ID | 1
115 * +-------+-------+-------+-------+-------+-------+-------+-------+
117 struct isis_p2p_hello_hdr
{
119 uint8_t source_id
[ISIS_SYS_ID_LEN
];
123 } __attribute__((packed
));
124 #define ISIS_P2PHELLO_HDRLEN 12
126 #define L1_LINK_STATE 18
127 #define L2_LINK_STATE 20
128 struct isis_lsp_hdr
{
130 uint16_t rem_lifetime
;
131 uint8_t lsp_id
[ISIS_SYS_ID_LEN
+ 2];
136 #define ISIS_LSP_HDR_LEN 19
139 * Since the length field of LSP Entries TLV is one byte long, and each LSP
140 * entry is LSP_ENTRIES_LEN (16) bytes long, the maximum number of LSP entries
141 * can be accomodated in a TLV is
144 * Therefore, the maximum length of the LSP Entries TLV is
145 * 16 * 15 + 2 (header) = 242 bytes.
147 #define MAX_LSP_ENTRIES_TLV_SIZE 242
149 #define L1_COMPLETE_SEQ_NUM 24
150 #define L2_COMPLETE_SEQ_NUM 25
152 * L1 and L2 IS to IS complete sequence numbers PDU header
153 * +-------+-------+-------+-------+-------+-------+-------+-------+
155 * +-------+-------+-------+-------+-------+-------+-------+-------+
156 * + Source ID + id_len + 1
157 * +-------+-------+-------+-------+-------+-------+-------+-------+
158 * + Start LSP ID + id_len + 2
159 * +-------+-------+-------+-------+-------+-------+-------+-------+
160 * + End LSP ID + id_len + 2
161 * +-------+-------+-------+-------+-------+-------+-------+-------+
163 struct isis_complete_seqnum_hdr
{
165 uint8_t source_id
[ISIS_SYS_ID_LEN
+ 1];
166 uint8_t start_lsp_id
[ISIS_SYS_ID_LEN
+ 2];
167 uint8_t stop_lsp_id
[ISIS_SYS_ID_LEN
+ 2];
169 #define ISIS_CSNP_HDRLEN 25
171 #define L1_PARTIAL_SEQ_NUM 26
172 #define L2_PARTIAL_SEQ_NUM 27
174 * L1 and L2 IS to IS partial sequence numbers PDU header
175 * +-------+-------+-------+-------+-------+-------+-------+-------+
177 * +-------+-------+-------+-------+-------+-------+-------+-------+
178 * + Source ID + id_len + 1
179 * +---------------------------------------------------------------+
181 struct isis_partial_seqnum_hdr
{
183 uint8_t source_id
[ISIS_SYS_ID_LEN
+ 1];
185 #define ISIS_PSNP_HDRLEN 9
192 * Function for receiving IS-IS PDUs
194 int isis_receive(struct thread
*thread
);
197 * calling arguments for snp_process ()
199 #define ISIS_SNP_PSNP_FLAG 0
200 #define ISIS_SNP_CSNP_FLAG 1
202 #define ISIS_AUTH_MD5_SIZE 16U
207 int send_lan_l1_hello(struct thread
*thread
);
208 int send_lan_l2_hello(struct thread
*thread
);
209 int send_p2p_hello(struct thread
*thread
);
210 int send_csnp(struct isis_circuit
*circuit
, int level
);
211 int send_l1_csnp(struct thread
*thread
);
212 int send_l2_csnp(struct thread
*thread
);
213 int send_l1_psnp(struct thread
*thread
);
214 int send_l2_psnp(struct thread
*thread
);
215 int send_lsp(struct thread
*thread
);
216 void fill_fixed_hdr(uint8_t pdu_type
, struct stream
*stream
);
217 int send_hello(struct isis_circuit
*circuit
, int level
);
218 int isis_handle_pdu(struct isis_circuit
*circuit
, uint8_t *ssnpa
);
219 #endif /* _ZEBRA_ISIS_PDU_H */