]> git.proxmox.com Git - mirror_frr.git/blame - eigrpd/eigrp_packet.h
eigrpd: Make code a bit easier to read in eigrp_update.c
[mirror_frr.git] / eigrpd / eigrp_packet.h
CommitLineData
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 36extern int eigrp_read(struct thread *);
37extern int eigrp_write(struct thread *);
38
907b4303 39extern struct eigrp_packet *eigrp_packet_new(size_t, struct eigrp_neighbor *);
d62a17ae 40extern struct eigrp_packet *eigrp_packet_duplicate(struct eigrp_packet *,
41 struct eigrp_neighbor *);
42extern void eigrp_packet_free(struct eigrp_packet *);
43extern void eigrp_packet_delete(struct eigrp_interface *);
cf2f4dae 44extern void eigrp_packet_header_init(int, struct eigrp *,
d62a17ae 45 struct stream *, u_int32_t, u_int32_t,
46 u_int32_t);
47extern void eigrp_packet_checksum(struct eigrp_interface *, struct stream *,
48 u_int16_t);
49
50extern struct eigrp_fifo *eigrp_fifo_new(void);
f90f65a2 51extern struct eigrp_packet *eigrp_fifo_next(struct eigrp_fifo *);
d62a17ae 52extern struct eigrp_packet *eigrp_fifo_pop(struct eigrp_fifo *);
f90f65a2 53extern void eigrp_fifo_push(struct eigrp_fifo *, struct eigrp_packet *);
d62a17ae 54extern void eigrp_fifo_free(struct eigrp_fifo *);
55extern void eigrp_fifo_reset(struct eigrp_fifo *);
56
57extern void eigrp_send_packet_reliably(struct eigrp_neighbor *);
58
59extern struct TLV_IPv4_Internal_type *eigrp_read_ipv4_tlv(struct stream *);
60extern u_int16_t eigrp_add_internalTLV_to_stream(struct stream *,
61 struct eigrp_prefix_entry *);
62extern u_int16_t eigrp_add_authTLV_MD5_to_stream(struct stream *,
63 struct eigrp_interface *);
64extern u_int16_t eigrp_add_authTLV_SHA256_to_stream(struct stream *,
65 struct eigrp_interface *);
66
67extern int eigrp_unack_packet_retrans(struct thread *);
68extern int eigrp_unack_multicast_packet_retrans(struct thread *);
7f57883e
DS
69
70/*
71 * untill there is reason to have their own header, these externs are found in
72 * eigrp_hello.c
73 */
01cbe587 74extern void eigrp_sw_version_initialize(void);
d62a17ae 75extern void eigrp_hello_send(struct eigrp_interface *, u_char,
76 struct in_addr *);
77extern void eigrp_hello_send_ack(struct eigrp_neighbor *);
78extern void eigrp_hello_receive(struct eigrp *, struct ip *,
79 struct eigrp_header *, struct stream *,
80 struct eigrp_interface *, int);
81extern int eigrp_hello_timer(struct thread *);
7f57883e
DS
82
83/*
84 * These externs are found in eigrp_update.c
85 */
d62a17ae 86extern void eigrp_update_send(struct eigrp_interface *);
87extern void eigrp_update_receive(struct eigrp *, struct ip *,
88 struct eigrp_header *, struct stream *,
89 struct eigrp_interface *, int);
90extern void eigrp_update_send_all(struct eigrp *, struct eigrp_interface *);
91extern void eigrp_update_send_init(struct eigrp_neighbor *);
92extern void eigrp_update_send_EOT(struct eigrp_neighbor *);
7f57883e 93extern int eigrp_update_send_GR_thread(struct thread *);
d62a17ae 94extern void eigrp_update_send_GR(struct eigrp_neighbor *, enum GR_type,
95 struct vty *);
96extern void eigrp_update_send_interface_GR(struct eigrp_interface *,
97 enum GR_type, struct vty *);
98extern void eigrp_update_send_process_GR(struct eigrp *, enum GR_type,
99 struct vty *);
7f57883e
DS
100
101/*
102 * These externs are found in eigrp_query.c
103 */
104
d62a17ae 105extern void eigrp_send_query(struct eigrp_interface *);
106extern void eigrp_query_receive(struct eigrp *, struct ip *,
107 struct eigrp_header *, struct stream *,
108 struct eigrp_interface *, int);
109extern u_int32_t eigrp_query_send_all(struct eigrp *);
7f57883e
DS
110
111/*
112 * These externs are found in eigrp_reply.c
113 */
d62a17ae 114extern void eigrp_send_reply(struct eigrp_neighbor *,
115 struct eigrp_prefix_entry *);
116extern void eigrp_reply_receive(struct eigrp *, struct ip *,
117 struct eigrp_header *, struct stream *,
118 struct eigrp_interface *, int);
7f57883e
DS
119
120/*
121 * These externs are found in eigrp_siaquery.c
122 */
d62a17ae 123extern void eigrp_send_siaquery(struct eigrp_neighbor *,
124 struct eigrp_prefix_entry *);
125extern void eigrp_siaquery_receive(struct eigrp *, struct ip *,
126 struct eigrp_header *, struct stream *,
127 struct eigrp_interface *, int);
7f57883e
DS
128
129/*
130 * These externs are found in eigrp_siareply.c
131 */
d62a17ae 132extern void eigrp_send_siareply(struct eigrp_neighbor *,
133 struct eigrp_prefix_entry *);
134extern void eigrp_siareply_receive(struct eigrp *, struct ip *,
135 struct eigrp_header *, struct stream *,
136 struct eigrp_interface *, int);
137
138extern struct TLV_MD5_Authentication_Type *eigrp_authTLV_MD5_new(void);
139extern void eigrp_authTLV_MD5_free(struct TLV_MD5_Authentication_Type *);
140extern struct TLV_SHA256_Authentication_Type *eigrp_authTLV_SHA256_new(void);
141extern void eigrp_authTLV_SHA256_free(struct TLV_SHA256_Authentication_Type *);
142
143extern int eigrp_make_md5_digest(struct eigrp_interface *, struct stream *,
144 u_char);
145extern int eigrp_check_md5_digest(struct stream *,
146 struct TLV_MD5_Authentication_Type *,
147 struct eigrp_neighbor *, u_char);
148extern int eigrp_make_sha256_digest(struct eigrp_interface *, struct stream *,
149 u_char);
150extern int eigrp_check_sha256_digest(struct stream *,
151 struct TLV_SHA256_Authentication_Type *,
152 struct eigrp_neighbor *, u_char);
153
154
d62a17ae 155extern void eigrp_IPv4_InternalTLV_free(struct TLV_IPv4_Internal_type *);
156
157extern struct TLV_Sequence_Type *eigrp_SequenceTLV_new(void);
7f57883e
DS
158
159extern const struct message eigrp_packet_type_str[];
160extern const size_t eigrp_packet_type_str_max;
161
162#endif /* _ZEBRA_EIGRP_PACKET_H */