]> git.proxmox.com Git - mirror_frr.git/blame - eigrpd/eigrp_packet.h
Merge pull request #531 from qlyoung/fix-stack-ref
[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 *
27 * You should have received a copy of the GNU General Public License
28 * along with GNU Zebra; see the file COPYING. If not, write to the Free
29 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
30 * 02111-1307, USA.
31 */
32
33#ifndef _ZEBRA_EIGRP_PACKET_H
34#define _ZEBRA_EIGRP_PACKET_H
35
36/*Prototypes*/
37extern int eigrp_read (struct thread *);
38extern int eigrp_write (struct thread *);
39
40extern struct eigrp_packet *eigrp_packet_new (size_t);
41extern struct eigrp_packet *eigrp_packet_duplicate (struct eigrp_packet *, struct eigrp_neighbor *);
42extern void eigrp_packet_free (struct eigrp_packet *);
43extern void eigrp_packet_delete (struct eigrp_interface *);
44extern void eigrp_packet_header_init (int, struct eigrp_interface *, struct stream *,
45 u_int32_t, u_int32_t, u_int32_t);
46extern void eigrp_packet_checksum (struct eigrp_interface *, struct stream *, u_int16_t);
47
48extern struct eigrp_fifo *eigrp_fifo_new (void);
49extern struct eigrp_packet *eigrp_fifo_head (struct eigrp_fifo *);
50extern struct eigrp_packet *eigrp_fifo_tail (struct eigrp_fifo *);
51extern struct eigrp_packet *eigrp_fifo_pop (struct eigrp_fifo *);
52extern struct eigrp_packet *eigrp_fifo_pop_tail (struct eigrp_fifo *);
53extern void eigrp_fifo_push_head (struct eigrp_fifo *, struct eigrp_packet *);
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 *, struct eigrp_prefix_entry *);
61extern u_int16_t eigrp_add_authTLV_MD5_to_stream (struct stream *, struct eigrp_interface *);
62extern u_int16_t eigrp_add_authTLV_SHA256_to_stream (struct stream *, struct eigrp_interface *);
63
64extern int eigrp_unack_packet_retrans (struct thread *);
65extern int eigrp_unack_multicast_packet_retrans (struct thread *);
66
67/*
68 * untill there is reason to have their own header, these externs are found in
69 * eigrp_hello.c
70 */
71extern void eigrp_hello_send (struct eigrp_interface *, u_char, struct in_addr *);
72extern void eigrp_hello_send_ack (struct eigrp_neighbor *);
73extern void eigrp_hello_receive (struct eigrp *, struct ip *, struct eigrp_header *,
74 struct stream *, struct eigrp_interface *, int);
75extern int eigrp_hello_timer (struct thread *);
76
77/*
78 * These externs are found in eigrp_update.c
79 */
80extern void eigrp_update_send (struct eigrp_interface *);
81extern void eigrp_update_receive (struct eigrp *, struct ip *, struct eigrp_header *,
82 struct stream *, struct eigrp_interface *, int);
83extern void eigrp_update_send_all (struct eigrp *, struct eigrp_interface *);
84extern void eigrp_update_send_init (struct eigrp_neighbor *);
85extern void eigrp_update_send_EOT (struct eigrp_neighbor *);
86extern int eigrp_update_send_GR_thread(struct thread *);
87extern void eigrp_update_send_GR (struct eigrp_neighbor *, enum GR_type, struct vty *);
88extern void eigrp_update_send_interface_GR (struct eigrp_interface *, enum GR_type, struct vty *);
89extern void eigrp_update_send_process_GR (struct eigrp *, enum GR_type, struct vty *);
90
91/*
92 * These externs are found in eigrp_query.c
93 */
94
95extern void eigrp_send_query (struct eigrp_interface *);
96extern void eigrp_query_receive (struct eigrp *, struct ip *, struct eigrp_header *,
97 struct stream *, struct eigrp_interface *, int);
98extern u_int32_t eigrp_query_send_all (struct eigrp *);
99
100/*
101 * These externs are found in eigrp_reply.c
102 */
103extern void eigrp_send_reply (struct eigrp_neighbor *, struct eigrp_prefix_entry *);
104extern void eigrp_reply_receive (struct eigrp *, struct ip *, struct eigrp_header *,
105 struct stream *, struct eigrp_interface *, int);
106
107/*
108 * These externs are found in eigrp_siaquery.c
109 */
110extern void eigrp_send_siaquery (struct eigrp_neighbor *, struct eigrp_prefix_entry *);
111extern void eigrp_siaquery_receive (struct eigrp *, struct ip *, struct eigrp_header *,
112 struct stream *, struct eigrp_interface *, int);
113
114/*
115 * These externs are found in eigrp_siareply.c
116 */
117extern void eigrp_send_siareply (struct eigrp_neighbor *, struct eigrp_prefix_entry *);
118extern void eigrp_siareply_receive (struct eigrp *, struct ip *, struct eigrp_header *,
119 struct stream *, struct eigrp_interface *, int);
120
121extern struct TLV_MD5_Authentication_Type *eigrp_authTLV_MD5_new (void);
122extern void eigrp_authTLV_MD5_free (struct TLV_MD5_Authentication_Type *);
123extern struct TLV_SHA256_Authentication_Type *eigrp_authTLV_SHA256_new (void);
124extern void eigrp_authTLV_SHA256_free (struct TLV_SHA256_Authentication_Type *);
125
126extern int eigrp_make_md5_digest (struct eigrp_interface *, struct stream *,
127 u_char);
128extern int eigrp_check_md5_digest (struct stream *, struct TLV_MD5_Authentication_Type *,
129 struct eigrp_neighbor *, u_char);
130extern int eigrp_make_sha256_digest (struct eigrp_interface *, struct stream *, u_char);
131extern int eigrp_check_sha256_digest (struct stream *, struct TLV_SHA256_Authentication_Type *,
132 struct eigrp_neighbor *, u_char );
133
134
135extern struct TLV_IPv4_Internal_type *eigrp_IPv4_InternalTLV_new (void);
136extern void eigrp_IPv4_InternalTLV_free (struct TLV_IPv4_Internal_type *);
137
138extern struct TLV_Sequence_Type *eigrp_SequenceTLV_new (void);
139
140extern const struct message eigrp_packet_type_str[];
141extern const size_t eigrp_packet_type_str_max;
142
143#endif /* _ZEBRA_EIGRP_PACKET_H */