diff options
Diffstat (limited to 'isisd/isis_pdu.h')
| -rw-r--r-- | isisd/isis_pdu.h | 173 |
1 files changed, 83 insertions, 90 deletions
diff --git a/isisd/isis_pdu.h b/isisd/isis_pdu.h index e512b6b1b9..fa8006cda0 100644 --- a/isisd/isis_pdu.h +++ b/isisd/isis_pdu.h @@ -3,17 +3,17 @@ * PDU processing * * Copyright (C) 2001,2002 Sampo Saaristo - * Tampere University of Technology + * Tampere University of Technology * Institute of Communications Engineering * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public Licenseas published by the Free - * Software Foundation; either version 2 of the License, or (at your option) + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public Licenseas published by the Free + * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * This program is distributed in the hope that it will be useful,but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * This program is distributed in the hope that it will be useful,but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along @@ -49,16 +49,15 @@ * +-------+-------+-------+-------+-------+-------+-------+-------+ */ -struct esis_fixed_hdr -{ - u_char idrp; - u_char length; - u_char version; - u_char id_len; - u_char pdu_type; - u_int16_t holdtime; - u_int16_t checksum; -} __attribute__ ((packed)); +struct esis_fixed_hdr { + u_char idrp; + u_char length; + u_char version; + u_char id_len; + u_char pdu_type; + u_int16_t holdtime; + u_int16_t checksum; +} __attribute__((packed)); #define ESIS_FIXED_HDR_LEN 9 @@ -69,33 +68,32 @@ struct esis_fixed_hdr /* * IS to IS Fixed Header * +-------+-------+-------+-------+-------+-------+-------+-------+ - * | Intradomain Routeing Protocol Discriminator | + * | Intradomain Routeing Protocol Discriminator | * +-------+-------+-------+-------+-------+-------+-------+-------+ * | Length Indicator | * +-------+-------+-------+-------+-------+-------+-------+-------+ * | Version/Protocol ID extension | * +-------+-------+-------+-------+-------+-------+-------+-------+ - * | R | R | R | PDU Type | + * | R | R | R | PDU Type | * +-------+-------+-------+-------+-------+-------+-------+-------+ * | Version | * +-------+-------+-------+-------+-------+-------+-------+-------+ * | Reserved | * +-------+-------+-------+-------+-------+-------+-------+-------+ - * | Maximum Area Addresses | + * | Maximum Area Addresses | * +-------+-------+-------+-------+-------+-------+-------+-------+ */ -struct isis_fixed_hdr -{ - u_char idrp; - u_char length; - u_char version1; - u_char id_len; - u_char pdu_type; - u_char version2; - u_char reserved; - u_char max_area_addrs; -} __attribute__ ((packed)); +struct isis_fixed_hdr { + u_char idrp; + u_char length; + u_char version1; + u_char id_len; + u_char pdu_type; + u_char version2; + u_char reserved; + u_char max_area_addrs; +} __attribute__((packed)); #define ISIS_FIXED_HDR_LEN 8 @@ -110,26 +108,25 @@ struct isis_fixed_hdr * +-------+-------+-------+-------+-------+-------+-------+-------+ * | Reserved | Circuit Type | 1 * +-------+-------+-------+-------+-------+-------+-------+-------+ - * + Source ID + id_len + * + Source ID + id_len * +-------+-------+-------+-------+-------+-------+-------+-------+ - * | Holding Time | 2 + * | Holding Time | 2 * +-------+-------+-------+-------+-------+-------+-------+-------+ - * | PDU Length | 2 + * | PDU Length | 2 * +-------+-------+-------+-------+-------+-------+-------+-------+ * | R | Priority | 1 * +-------+-------+-------+-------+-------+-------+-------+-------+ * | LAN ID | id_len + 1 * +-------+-------+-------+-------+-------+-------+-------+-------+ */ -struct isis_lan_hello_hdr -{ - u_char circuit_t; - u_char source_id[ISIS_SYS_ID_LEN]; - u_int16_t hold_time; - u_int16_t pdu_len; - u_char prio; - u_char lan_id[ISIS_SYS_ID_LEN + 1]; -} __attribute__ ((packed)); +struct isis_lan_hello_hdr { + u_char circuit_t; + u_char source_id[ISIS_SYS_ID_LEN]; + u_int16_t hold_time; + u_int16_t pdu_len; + u_char prio; + u_char lan_id[ISIS_SYS_ID_LEN + 1]; +} __attribute__((packed)); #define ISIS_LANHELLO_HDRLEN 19 #define P2P_HELLO 17 @@ -138,23 +135,22 @@ struct isis_lan_hello_hdr * +-------+-------+-------+-------+-------+-------+-------+-------+ * | Reserved | Circuit Type | 1 * +-------+-------+-------+-------+-------+-------+-------+-------+ - * + Source ID + id_len + * + Source ID + id_len * +-------+-------+-------+-------+-------+-------+-------+-------+ - * + Holding Time + 2 + * + Holding Time + 2 * +-------+-------+-------+-------+-------+-------+-------+-------+ - * + PDU Length + 2 + * + PDU Length + 2 * +-------+-------+-------+-------+-------+-------+-------+-------+ * | Local Circuit ID | 1 * +-------+-------+-------+-------+-------+-------+-------+-------+ */ -struct isis_p2p_hello_hdr -{ - u_char circuit_t; - u_char source_id[ISIS_SYS_ID_LEN]; - u_int16_t hold_time; - u_int16_t pdu_len; - u_char local_id; -} __attribute__ ((packed)); +struct isis_p2p_hello_hdr { + u_char circuit_t; + u_char source_id[ISIS_SYS_ID_LEN]; + u_int16_t hold_time; + u_int16_t pdu_len; + u_char local_id; +} __attribute__((packed)); #define ISIS_P2PHELLO_HDRLEN 12 #define L1_LINK_STATE 18 @@ -164,7 +160,7 @@ struct isis_p2p_hello_hdr * +-------+-------+-------+-------+-------+-------+-------+-------+ * + PDU Length + 2 * +-------+-------+-------+-------+-------+-------+-------+-------+ - * + Remaining Lifetime + 2 + * + Remaining Lifetime + 2 * +-------+-------+-------+-------+-------+-------+-------+-------+ * | LSP ID | id_len + 2 * +-------+-------+-------+-------+-------+-------+-------+-------+ @@ -175,15 +171,14 @@ struct isis_p2p_hello_hdr * | P | ATT |LSPDBOL| ISTYPE | * +-------+-------+-------+-------+-------+-------+-------+-------+ */ -struct isis_link_state_hdr -{ - u_int16_t pdu_len; - u_int16_t rem_lifetime; - u_char lsp_id[ISIS_SYS_ID_LEN + 2]; - u_int32_t seq_num; - u_int16_t checksum; - u_int8_t lsp_bits; -} __attribute__ ((packed)); +struct isis_link_state_hdr { + u_int16_t pdu_len; + u_int16_t rem_lifetime; + u_char lsp_id[ISIS_SYS_ID_LEN + 2]; + u_int32_t seq_num; + u_int16_t checksum; + u_int8_t lsp_bits; +} __attribute__((packed)); #define ISIS_LSP_HDR_LEN 19 /* @@ -191,7 +186,7 @@ struct isis_link_state_hdr * entry is LSP_ENTRIES_LEN (16) bytes long, the maximum number of LSP entries * can be accomodated in a TLV is * 255 / 16 = 15. - * + * * Therefore, the maximum length of the LSP Entries TLV is * 16 * 15 + 2 (header) = 242 bytes. */ @@ -202,7 +197,7 @@ struct isis_link_state_hdr /* * L1 and L2 IS to IS complete sequence numbers PDU header * +-------+-------+-------+-------+-------+-------+-------+-------+ - * + PDU Length + 2 + * + PDU Length + 2 * +-------+-------+-------+-------+-------+-------+-------+-------+ * + Source ID + id_len + 1 * +-------+-------+-------+-------+-------+-------+-------+-------+ @@ -211,12 +206,11 @@ struct isis_link_state_hdr * + End LSP ID + id_len + 2 * +-------+-------+-------+-------+-------+-------+-------+-------+ */ -struct isis_complete_seqnum_hdr -{ - u_int16_t pdu_len; - u_char source_id[ISIS_SYS_ID_LEN + 1]; - u_char start_lsp_id[ISIS_SYS_ID_LEN + 2]; - u_char stop_lsp_id[ISIS_SYS_ID_LEN + 2]; +struct isis_complete_seqnum_hdr { + u_int16_t pdu_len; + u_char source_id[ISIS_SYS_ID_LEN + 1]; + u_char start_lsp_id[ISIS_SYS_ID_LEN + 2]; + u_char stop_lsp_id[ISIS_SYS_ID_LEN + 2]; }; #define ISIS_CSNP_HDRLEN 25 @@ -230,10 +224,9 @@ struct isis_complete_seqnum_hdr * + Source ID + id_len + 1 * +---------------------------------------------------------------+ */ -struct isis_partial_seqnum_hdr -{ - u_int16_t pdu_len; - u_char source_id[ISIS_SYS_ID_LEN + 1]; +struct isis_partial_seqnum_hdr { + u_int16_t pdu_len; + u_char source_id[ISIS_SYS_ID_LEN + 1]; }; #define ISIS_PSNP_HDRLEN 9 @@ -244,7 +237,7 @@ struct isis_partial_seqnum_hdr /* * Function for receiving IS-IS PDUs */ -int isis_receive (struct thread *thread); +int isis_receive(struct thread *thread); /* * calling arguments for snp_process () @@ -257,18 +250,18 @@ int isis_receive (struct thread *thread); /* * Sending functions */ -int send_lan_l1_hello (struct thread *thread); -int send_lan_l2_hello (struct thread *thread); -int send_p2p_hello (struct thread *thread); -int send_csnp (struct isis_circuit *circuit, int level); -int send_l1_csnp (struct thread *thread); -int send_l2_csnp (struct thread *thread); -int send_l1_psnp (struct thread *thread); -int send_l2_psnp (struct thread *thread); -int send_lsp (struct thread *thread); -int ack_lsp (struct isis_link_state_hdr *hdr, - struct isis_circuit *circuit, int level); -void fill_fixed_hdr (struct isis_fixed_hdr *hdr, u_char pdu_type); -int send_hello (struct isis_circuit *circuit, int level); +int send_lan_l1_hello(struct thread *thread); +int send_lan_l2_hello(struct thread *thread); +int send_p2p_hello(struct thread *thread); +int send_csnp(struct isis_circuit *circuit, int level); +int send_l1_csnp(struct thread *thread); +int send_l2_csnp(struct thread *thread); +int send_l1_psnp(struct thread *thread); +int send_l2_psnp(struct thread *thread); +int send_lsp(struct thread *thread); +int ack_lsp(struct isis_link_state_hdr *hdr, struct isis_circuit *circuit, + int level); +void fill_fixed_hdr(struct isis_fixed_hdr *hdr, u_char pdu_type); +int send_hello(struct isis_circuit *circuit, int level); #endif /* _ZEBRA_ISIS_PDU_H */ |
