2 * EIGRP General Sending and Receiving of EIGRP Packets.
3 * Copyright (C) 2013-2016
15 * This file is part of GNU Zebra.
17 * GNU Zebra is free software; you can redistribute it and/or modify it
18 * under the terms of the GNU General Public License as published by the
19 * Free Software Foundation; either version 2, or (at your option) any
22 * GNU Zebra is distributed in the hope that it will be useful, but
23 * WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 * General Public License for more details.
27 * You should have received a copy of the GNU General Public License along
28 * with this program; see the file COPYING; if not, write to the Free Software
29 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
32 #ifndef _ZEBRA_EIGRP_PACKET_H
33 #define _ZEBRA_EIGRP_PACKET_H
36 extern int eigrp_read (struct thread
*);
37 extern int eigrp_write (struct thread
*);
39 extern struct eigrp_packet
*eigrp_packet_new (size_t);
40 extern struct eigrp_packet
*eigrp_packet_duplicate (struct eigrp_packet
*, struct eigrp_neighbor
*);
41 extern void eigrp_packet_free (struct eigrp_packet
*);
42 extern void eigrp_packet_delete (struct eigrp_interface
*);
43 extern void eigrp_packet_header_init (int, struct eigrp_interface
*, struct stream
*,
44 u_int32_t
, u_int32_t
, u_int32_t
);
45 extern void eigrp_packet_checksum (struct eigrp_interface
*, struct stream
*, u_int16_t
);
47 extern struct eigrp_fifo
*eigrp_fifo_new (void);
48 extern struct eigrp_packet
*eigrp_fifo_head (struct eigrp_fifo
*);
49 extern struct eigrp_packet
*eigrp_fifo_tail (struct eigrp_fifo
*);
50 extern struct eigrp_packet
*eigrp_fifo_pop (struct eigrp_fifo
*);
51 extern struct eigrp_packet
*eigrp_fifo_pop_tail (struct eigrp_fifo
*);
52 extern void eigrp_fifo_push_head (struct eigrp_fifo
*, struct eigrp_packet
*);
53 extern void eigrp_fifo_free (struct eigrp_fifo
*);
54 extern void eigrp_fifo_reset (struct eigrp_fifo
*);
56 extern void eigrp_send_packet_reliably (struct eigrp_neighbor
*);
58 extern struct TLV_IPv4_Internal_type
*eigrp_read_ipv4_tlv (struct stream
*);
59 extern u_int16_t
eigrp_add_internalTLV_to_stream (struct stream
*, struct eigrp_prefix_entry
*);
60 extern u_int16_t
eigrp_add_authTLV_MD5_to_stream (struct stream
*, struct eigrp_interface
*);
61 extern u_int16_t
eigrp_add_authTLV_SHA256_to_stream (struct stream
*, struct eigrp_interface
*);
63 extern int eigrp_unack_packet_retrans (struct thread
*);
64 extern int eigrp_unack_multicast_packet_retrans (struct thread
*);
67 * untill there is reason to have their own header, these externs are found in
70 extern void eigrp_hello_send (struct eigrp_interface
*, u_char
, struct in_addr
*);
71 extern void eigrp_hello_send_ack (struct eigrp_neighbor
*);
72 extern void eigrp_hello_receive (struct eigrp
*, struct ip
*, struct eigrp_header
*,
73 struct stream
*, struct eigrp_interface
*, int);
74 extern int eigrp_hello_timer (struct thread
*);
77 * These externs are found in eigrp_update.c
79 extern void eigrp_update_send (struct eigrp_interface
*);
80 extern void eigrp_update_receive (struct eigrp
*, struct ip
*, struct eigrp_header
*,
81 struct stream
*, struct eigrp_interface
*, int);
82 extern void eigrp_update_send_all (struct eigrp
*, struct eigrp_interface
*);
83 extern void eigrp_update_send_init (struct eigrp_neighbor
*);
84 extern void eigrp_update_send_EOT (struct eigrp_neighbor
*);
85 extern int eigrp_update_send_GR_thread(struct thread
*);
86 extern void eigrp_update_send_GR (struct eigrp_neighbor
*, enum GR_type
, struct vty
*);
87 extern void eigrp_update_send_interface_GR (struct eigrp_interface
*, enum GR_type
, struct vty
*);
88 extern void eigrp_update_send_process_GR (struct eigrp
*, enum GR_type
, struct vty
*);
91 * These externs are found in eigrp_query.c
94 extern void eigrp_send_query (struct eigrp_interface
*);
95 extern void eigrp_query_receive (struct eigrp
*, struct ip
*, struct eigrp_header
*,
96 struct stream
*, struct eigrp_interface
*, int);
97 extern u_int32_t
eigrp_query_send_all (struct eigrp
*);
100 * These externs are found in eigrp_reply.c
102 extern void eigrp_send_reply (struct eigrp_neighbor
*, struct eigrp_prefix_entry
*);
103 extern void eigrp_reply_receive (struct eigrp
*, struct ip
*, struct eigrp_header
*,
104 struct stream
*, struct eigrp_interface
*, int);
107 * These externs are found in eigrp_siaquery.c
109 extern void eigrp_send_siaquery (struct eigrp_neighbor
*, struct eigrp_prefix_entry
*);
110 extern void eigrp_siaquery_receive (struct eigrp
*, struct ip
*, struct eigrp_header
*,
111 struct stream
*, struct eigrp_interface
*, int);
114 * These externs are found in eigrp_siareply.c
116 extern void eigrp_send_siareply (struct eigrp_neighbor
*, struct eigrp_prefix_entry
*);
117 extern void eigrp_siareply_receive (struct eigrp
*, struct ip
*, struct eigrp_header
*,
118 struct stream
*, struct eigrp_interface
*, int);
120 extern struct TLV_MD5_Authentication_Type
*eigrp_authTLV_MD5_new (void);
121 extern void eigrp_authTLV_MD5_free (struct TLV_MD5_Authentication_Type
*);
122 extern struct TLV_SHA256_Authentication_Type
*eigrp_authTLV_SHA256_new (void);
123 extern void eigrp_authTLV_SHA256_free (struct TLV_SHA256_Authentication_Type
*);
125 extern int eigrp_make_md5_digest (struct eigrp_interface
*, struct stream
*,
127 extern int eigrp_check_md5_digest (struct stream
*, struct TLV_MD5_Authentication_Type
*,
128 struct eigrp_neighbor
*, u_char
);
129 extern int eigrp_make_sha256_digest (struct eigrp_interface
*, struct stream
*, u_char
);
130 extern int eigrp_check_sha256_digest (struct stream
*, struct TLV_SHA256_Authentication_Type
*,
131 struct eigrp_neighbor
*, u_char
);
134 extern struct TLV_IPv4_Internal_type
*eigrp_IPv4_InternalTLV_new (void);
135 extern void eigrp_IPv4_InternalTLV_free (struct TLV_IPv4_Internal_type
*);
137 extern struct TLV_Sequence_Type
*eigrp_SequenceTLV_new (void);
139 extern const struct message eigrp_packet_type_str
[];
140 extern const size_t eigrp_packet_type_str_max
;
142 #endif /* _ZEBRA_EIGRP_PACKET_H */