]>
Commit | Line | Data |
---|---|---|
7f57883e DS |
1 | /* |
2 | * EIGRP General Sending and Receiving of EIGRP Packets. | |
3 | * Copyright (C) 2013-2016 | |
4 | * Authors: | |
5 | * Donnie Savage | |
6 | * Jan Janovic | |
7 | * Matej Perina | |
8 | * Peter Orsag | |
9 | * Peter Paluch | |
10 | * Frantisek Gazo | |
11 | * Tomas Hvorkovy | |
12 | * Martin Kontsek | |
13 | * Lukas Koribsky | |
14 | * | |
15 | * This file is part of GNU Zebra. | |
16 | * | |
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 | |
20 | * later version. | |
21 | * | |
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. | |
26 | * | |
896014f4 DL |
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 | |
7f57883e DS |
30 | */ |
31 | ||
32 | #ifndef _ZEBRA_EIGRP_PACKET_H | |
33 | #define _ZEBRA_EIGRP_PACKET_H | |
34 | ||
35 | /*Prototypes*/ | |
d62a17ae | 36 | extern int eigrp_read(struct thread *); |
37 | extern int eigrp_write(struct thread *); | |
38 | ||
8e699447 DS |
39 | extern struct eigrp_packet *eigrp_packet_new(size_t size, |
40 | struct eigrp_neighbor *nbr); | |
41 | extern struct eigrp_packet *eigrp_packet_duplicate(struct eigrp_packet *old, | |
42 | struct eigrp_neighbor *nbr); | |
43 | extern void eigrp_packet_free(struct eigrp_packet *ep); | |
44 | extern void eigrp_packet_delete(struct eigrp_interface *ei); | |
45 | extern void eigrp_packet_header_init(int type, struct eigrp *eigrp, | |
46 | struct stream *s, uint32_t flags, | |
47 | uint32_t sequence, uint32_t ack); | |
48 | extern void eigrp_packet_checksum(struct eigrp_interface *ei, struct stream *s, | |
49 | uint16_t length); | |
d62a17ae | 50 | |
51 | extern struct eigrp_fifo *eigrp_fifo_new(void); | |
8e699447 DS |
52 | extern struct eigrp_packet *eigrp_fifo_next(struct eigrp_fifo *fifo); |
53 | extern struct eigrp_packet *eigrp_fifo_pop(struct eigrp_fifo *fifo); | |
54 | extern void eigrp_fifo_push(struct eigrp_fifo *fifo, struct eigrp_packet *ep); | |
55 | extern void eigrp_fifo_free(struct eigrp_fifo *fifo); | |
56 | extern void eigrp_fifo_reset(struct eigrp_fifo *fifo); | |
d62a17ae | 57 | |
8e699447 | 58 | extern void eigrp_send_packet_reliably(struct eigrp_neighbor *nbr); |
d62a17ae | 59 | |
8e699447 | 60 | extern struct TLV_IPv4_Internal_type *eigrp_read_ipv4_tlv(struct stream *s); |
dc4accdd DS |
61 | extern uint16_t |
62 | eigrp_add_internalTLV_to_stream(struct stream *s, | |
63 | struct eigrp_prefix_descriptor *pe); | |
8e699447 DS |
64 | extern uint16_t eigrp_add_authTLV_MD5_to_stream(struct stream *s, |
65 | struct eigrp_interface *ei); | |
66 | extern uint16_t eigrp_add_authTLV_SHA256_to_stream(struct stream *s, | |
67 | struct eigrp_interface *ei); | |
d62a17ae | 68 | |
8e699447 DS |
69 | extern int eigrp_unack_packet_retrans(struct thread *thread); |
70 | extern int eigrp_unack_multicast_packet_retrans(struct thread *thread); | |
7f57883e DS |
71 | |
72 | /* | |
73 | * untill there is reason to have their own header, these externs are found in | |
74 | * eigrp_hello.c | |
75 | */ | |
01cbe587 | 76 | extern void eigrp_sw_version_initialize(void); |
8e699447 DS |
77 | extern void eigrp_hello_send(struct eigrp_interface *ei, uint8_t flags, |
78 | struct in_addr *nbr_addr); | |
79 | extern void eigrp_hello_send_ack(struct eigrp_neighbor *nbr); | |
80 | extern void eigrp_hello_receive(struct eigrp *eigrp, struct ip *iph, | |
81 | struct eigrp_header *eigrph, struct stream *s, | |
82 | struct eigrp_interface *ei, int size); | |
83 | extern int eigrp_hello_timer(struct thread *thread); | |
7f57883e DS |
84 | |
85 | /* | |
86 | * These externs are found in eigrp_update.c | |
87 | */ | |
71b52ef2 | 88 | extern bool eigrp_update_prefix_apply(struct eigrp *eigrp, |
996c9314 | 89 | struct eigrp_interface *ei, int in, |
71b52ef2 | 90 | struct prefix *prefix); |
8e699447 DS |
91 | extern void eigrp_update_send(struct eigrp_interface *ei); |
92 | extern void eigrp_update_receive(struct eigrp *eigrp, struct ip *iph, | |
93 | struct eigrp_header *eigrph, struct stream *s, | |
94 | struct eigrp_interface *ei, int size); | |
95 | extern void eigrp_update_send_all(struct eigrp *eigrp, | |
96 | struct eigrp_interface *exception); | |
97 | extern void eigrp_update_send_init(struct eigrp_neighbor *nbr); | |
98 | extern void eigrp_update_send_EOT(struct eigrp_neighbor *nbr); | |
99 | extern int eigrp_update_send_GR_thread(struct thread *thread); | |
100 | extern void eigrp_update_send_GR(struct eigrp_neighbor *nbr, | |
101 | enum GR_type gr_type, struct vty *vty); | |
102 | extern void eigrp_update_send_interface_GR(struct eigrp_interface *ei, | |
103 | enum GR_type gr_type, | |
104 | struct vty *vty); | |
105 | extern void eigrp_update_send_process_GR(struct eigrp *eigrp, | |
106 | enum GR_type gr_type, struct vty *vty); | |
7f57883e DS |
107 | |
108 | /* | |
109 | * These externs are found in eigrp_query.c | |
110 | */ | |
111 | ||
8e699447 DS |
112 | extern void eigrp_send_query(struct eigrp_interface *ei); |
113 | extern void eigrp_query_receive(struct eigrp *eigrp, struct ip *iph, | |
114 | struct eigrp_header *eigrph, struct stream *s, | |
115 | struct eigrp_interface *ei, int size); | |
116 | extern uint32_t eigrp_query_send_all(struct eigrp *eigrp); | |
7f57883e DS |
117 | |
118 | /* | |
119 | * These externs are found in eigrp_reply.c | |
120 | */ | |
8e699447 | 121 | extern void eigrp_send_reply(struct eigrp_neighbor *nbr, |
dc4accdd | 122 | struct eigrp_prefix_descriptor *pe); |
8e699447 DS |
123 | extern void eigrp_reply_receive(struct eigrp *eigrp, struct ip *iph, |
124 | struct eigrp_header *eigrph, struct stream *s, | |
125 | struct eigrp_interface *ei, int size); | |
7f57883e DS |
126 | |
127 | /* | |
128 | * These externs are found in eigrp_siaquery.c | |
129 | */ | |
8e699447 | 130 | extern void eigrp_send_siaquery(struct eigrp_neighbor *nbr, |
dc4accdd | 131 | struct eigrp_prefix_descriptor *pe); |
8e699447 DS |
132 | extern void eigrp_siaquery_receive(struct eigrp *eigrp, struct ip *iph, |
133 | struct eigrp_header *eigrph, | |
134 | struct stream *s, struct eigrp_interface *ei, | |
135 | int size); | |
7f57883e DS |
136 | |
137 | /* | |
138 | * These externs are found in eigrp_siareply.c | |
139 | */ | |
8e699447 | 140 | extern void eigrp_send_siareply(struct eigrp_neighbor *nbr, |
dc4accdd | 141 | struct eigrp_prefix_descriptor *pe); |
8e699447 DS |
142 | extern void eigrp_siareply_receive(struct eigrp *eigrp, struct ip *iph, |
143 | struct eigrp_header *eigrph, | |
144 | struct stream *s, struct eigrp_interface *ei, | |
145 | int size); | |
d62a17ae | 146 | |
147 | extern struct TLV_MD5_Authentication_Type *eigrp_authTLV_MD5_new(void); | |
8e699447 | 148 | extern void eigrp_authTLV_MD5_free(struct TLV_MD5_Authentication_Type *authTLV); |
d62a17ae | 149 | extern struct TLV_SHA256_Authentication_Type *eigrp_authTLV_SHA256_new(void); |
8e699447 DS |
150 | extern void |
151 | eigrp_authTLV_SHA256_free(struct TLV_SHA256_Authentication_Type *authTLV); | |
152 | ||
153 | extern int eigrp_make_md5_digest(struct eigrp_interface *ei, struct stream *s, | |
154 | uint8_t flags); | |
155 | extern int eigrp_check_md5_digest(struct stream *s, | |
156 | struct TLV_MD5_Authentication_Type *authTLV, | |
157 | struct eigrp_neighbor *nbr, uint8_t flags); | |
158 | extern int eigrp_make_sha256_digest(struct eigrp_interface *ei, | |
159 | struct stream *s, uint8_t flags); | |
160 | extern int | |
161 | eigrp_check_sha256_digest(struct stream *s, | |
162 | struct TLV_SHA256_Authentication_Type *authTLV, | |
163 | struct eigrp_neighbor *nbr, uint8_t flags); | |
164 | ||
165 | ||
166 | extern void | |
167 | eigrp_IPv4_InternalTLV_free(struct TLV_IPv4_Internal_type *IPv4_InternalTLV); | |
d62a17ae | 168 | |
169 | extern struct TLV_Sequence_Type *eigrp_SequenceTLV_new(void); | |
7f57883e DS |
170 | |
171 | extern const struct message eigrp_packet_type_str[]; | |
172 | extern const size_t eigrp_packet_type_str_max; | |
173 | ||
174 | #endif /* _ZEBRA_EIGRP_PACKET_H */ |