2 * Structures for RIP protocol
4 FIXME: in V6, they insert additional entry whenever next hop differs. Such entry is identified by 0xff in metric.
7 #include "nest/route.h"
8 #include "nest/password.h"
10 #define EA_RIP_TAG EA_CODE(EAP_RIP, 0)
11 #define EA_RIP_METRIC EA_CODE(EAP_RIP, 1)
14 #define PACKET_MD5_MAX 18 /* FIXME */
16 struct rip_connection
{
23 struct rip_interface
*rif
;
24 struct fib_iterator iter
;
31 struct rip_packet_heading
{
33 #define RIPCMD_REQUEST 1 /* want info */
34 #define RIPCMD_RESPONSE 2 /* responding to request */
35 #define RIPCMD_TRACEON 3 /* turn tracing on */
36 #define RIPCMD_TRACEOFF 4 /* turn it off */
46 u16 family
; /* 0xffff on first message means this is authentication */
62 struct rip_block_auth
{
87 bird_clock_t updated
, changed
;
89 #define RIP_F_EXTERNAL 1
93 struct rip_packet_heading heading
;
94 struct rip_block block
[25];
97 struct rip_interface
{
102 struct rip_connection
*busy
;
103 struct rip_patt
*patt
;
112 #define IM_MULTICAST 1
113 #define IM_BROADCAST 2
115 #define IM_NOLISTEN 8
116 #define IM_VERSION1 16
119 struct rip_proto_config
{
120 struct proto_config c
;
121 list iface_list
; /* Patterns configured */
123 int infinity
; /* User configurable data */
129 struct password_item
*passwords
;
132 #define AT_PLAINTEXT 2
136 #define HO_NEIGHBOUR 1
141 struct proto inherited
;
146 list interfaces
; /* Interfaces we really know about */
148 int tx_count
; /* Do one regular update once in a while */
152 #define RIP_MAGIC 81861253
153 #define CHK_MAGIC do { if (P->magic != RIP_MAGIC) bug( "Not enough magic\n" ); } while (0)
155 void rip_init_instance(struct proto
*p
);
156 void rip_init_config(struct rip_proto_config
*c
);
158 /* Authentication functions */
160 int rip_incoming_authentication( struct proto
*p
, struct rip_block_auth
*block
, struct rip_packet
*packet
, int num
);
161 void rip_outgoing_authentication( struct proto
*p
, struct rip_block_auth
*block
, struct rip_packet
*packet
, int num
);