1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * EIGRP General Sending and Receiving of EIGRP Packets.
4 * Copyright (C) 2013-2016
17 #ifndef _ZEBRA_EIGRP_PACKET_H
18 #define _ZEBRA_EIGRP_PACKET_H
21 extern void eigrp_read(struct event
*thread
);
22 extern void eigrp_write(struct event
*thread
);
24 extern struct eigrp_packet
*eigrp_packet_new(size_t size
,
25 struct eigrp_neighbor
*nbr
);
26 extern struct eigrp_packet
*eigrp_packet_duplicate(struct eigrp_packet
*old
,
27 struct eigrp_neighbor
*nbr
);
28 extern void eigrp_packet_free(struct eigrp_packet
*ep
);
29 extern void eigrp_packet_delete(struct eigrp_interface
*ei
);
30 extern void eigrp_packet_header_init(int type
, struct eigrp
*eigrp
,
31 struct stream
*s
, uint32_t flags
,
32 uint32_t sequence
, uint32_t ack
);
33 extern void eigrp_packet_checksum(struct eigrp_interface
*ei
, struct stream
*s
,
36 extern struct eigrp_fifo
*eigrp_fifo_new(void);
37 extern struct eigrp_packet
*eigrp_fifo_next(struct eigrp_fifo
*fifo
);
38 extern struct eigrp_packet
*eigrp_fifo_pop(struct eigrp_fifo
*fifo
);
39 extern void eigrp_fifo_push(struct eigrp_fifo
*fifo
, struct eigrp_packet
*ep
);
40 extern void eigrp_fifo_free(struct eigrp_fifo
*fifo
);
41 extern void eigrp_fifo_reset(struct eigrp_fifo
*fifo
);
43 extern void eigrp_send_packet_reliably(struct eigrp_neighbor
*nbr
);
45 extern struct TLV_IPv4_Internal_type
*eigrp_read_ipv4_tlv(struct stream
*s
);
47 eigrp_add_internalTLV_to_stream(struct stream
*s
,
48 struct eigrp_prefix_descriptor
*pe
);
49 extern uint16_t eigrp_add_authTLV_MD5_to_stream(struct stream
*s
,
50 struct eigrp_interface
*ei
);
51 extern uint16_t eigrp_add_authTLV_SHA256_to_stream(struct stream
*s
,
52 struct eigrp_interface
*ei
);
54 extern void eigrp_unack_packet_retrans(struct event
*thread
);
55 extern void eigrp_unack_multicast_packet_retrans(struct event
*thread
);
58 * untill there is reason to have their own header, these externs are found in
61 extern void eigrp_sw_version_initialize(void);
62 extern void eigrp_hello_send(struct eigrp_interface
*ei
, uint8_t flags
,
63 struct in_addr
*nbr_addr
);
64 extern void eigrp_hello_send_ack(struct eigrp_neighbor
*nbr
);
65 extern void eigrp_hello_receive(struct eigrp
*eigrp
, struct ip
*iph
,
66 struct eigrp_header
*eigrph
, struct stream
*s
,
67 struct eigrp_interface
*ei
, int size
);
68 extern void eigrp_hello_timer(struct event
*thread
);
71 * These externs are found in eigrp_update.c
73 extern bool eigrp_update_prefix_apply(struct eigrp
*eigrp
,
74 struct eigrp_interface
*ei
, int in
,
75 struct prefix
*prefix
);
76 extern void eigrp_update_send(struct eigrp_interface
*ei
);
77 extern void eigrp_update_receive(struct eigrp
*eigrp
, struct ip
*iph
,
78 struct eigrp_header
*eigrph
, struct stream
*s
,
79 struct eigrp_interface
*ei
, int size
);
80 extern void eigrp_update_send_all(struct eigrp
*eigrp
,
81 struct eigrp_interface
*exception
);
82 extern void eigrp_update_send_init(struct eigrp_neighbor
*nbr
);
83 extern void eigrp_update_send_EOT(struct eigrp_neighbor
*nbr
);
84 extern void eigrp_update_send_GR_thread(struct event
*thread
);
85 extern void eigrp_update_send_GR(struct eigrp_neighbor
*nbr
,
86 enum GR_type gr_type
, struct vty
*vty
);
87 extern void eigrp_update_send_interface_GR(struct eigrp_interface
*ei
,
90 extern void eigrp_update_send_process_GR(struct eigrp
*eigrp
,
91 enum GR_type gr_type
, struct vty
*vty
);
94 * These externs are found in eigrp_query.c
97 extern void eigrp_send_query(struct eigrp_interface
*ei
);
98 extern void eigrp_query_receive(struct eigrp
*eigrp
, struct ip
*iph
,
99 struct eigrp_header
*eigrph
, struct stream
*s
,
100 struct eigrp_interface
*ei
, int size
);
101 extern uint32_t eigrp_query_send_all(struct eigrp
*eigrp
);
104 * These externs are found in eigrp_reply.c
106 extern void eigrp_send_reply(struct eigrp_neighbor
*nbr
,
107 struct eigrp_prefix_descriptor
*pe
);
108 extern void eigrp_reply_receive(struct eigrp
*eigrp
, struct ip
*iph
,
109 struct eigrp_header
*eigrph
, struct stream
*s
,
110 struct eigrp_interface
*ei
, int size
);
113 * These externs are found in eigrp_siaquery.c
115 extern void eigrp_send_siaquery(struct eigrp_neighbor
*nbr
,
116 struct eigrp_prefix_descriptor
*pe
);
117 extern void eigrp_siaquery_receive(struct eigrp
*eigrp
, struct ip
*iph
,
118 struct eigrp_header
*eigrph
,
119 struct stream
*s
, struct eigrp_interface
*ei
,
123 * These externs are found in eigrp_siareply.c
125 extern void eigrp_send_siareply(struct eigrp_neighbor
*nbr
,
126 struct eigrp_prefix_descriptor
*pe
);
127 extern void eigrp_siareply_receive(struct eigrp
*eigrp
, struct ip
*iph
,
128 struct eigrp_header
*eigrph
,
129 struct stream
*s
, struct eigrp_interface
*ei
,
132 extern struct TLV_MD5_Authentication_Type
*eigrp_authTLV_MD5_new(void);
133 extern void eigrp_authTLV_MD5_free(struct TLV_MD5_Authentication_Type
*authTLV
);
134 extern struct TLV_SHA256_Authentication_Type
*eigrp_authTLV_SHA256_new(void);
136 eigrp_authTLV_SHA256_free(struct TLV_SHA256_Authentication_Type
*authTLV
);
138 extern int eigrp_make_md5_digest(struct eigrp_interface
*ei
, struct stream
*s
,
140 extern int eigrp_check_md5_digest(struct stream
*s
,
141 struct TLV_MD5_Authentication_Type
*authTLV
,
142 struct eigrp_neighbor
*nbr
, uint8_t flags
);
143 extern int eigrp_make_sha256_digest(struct eigrp_interface
*ei
,
144 struct stream
*s
, uint8_t flags
);
146 eigrp_check_sha256_digest(struct stream
*s
,
147 struct TLV_SHA256_Authentication_Type
*authTLV
,
148 struct eigrp_neighbor
*nbr
, uint8_t flags
);
152 eigrp_IPv4_InternalTLV_free(struct TLV_IPv4_Internal_type
*IPv4_InternalTLV
);
154 extern struct TLV_Sequence_Type
*eigrp_SequenceTLV_new(void);
156 extern const struct message eigrp_packet_type_str
[];
157 extern const size_t eigrp_packet_type_str_max
;
159 #endif /* _ZEBRA_EIGRP_PACKET_H */