2002-12-13 21:15:29 +01:00
|
|
|
/* RIP related values and structures.
|
|
|
|
* Copyright (C) 1997, 1998, 1999 Kunihiro Ishiguro <kunihiro@zebra.org>
|
|
|
|
*
|
|
|
|
* This file is part of GNU Zebra.
|
|
|
|
*
|
|
|
|
* GNU Zebra is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation; either version 2, or (at your option) any
|
|
|
|
* later version.
|
|
|
|
*
|
|
|
|
* GNU Zebra is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
2017-05-13 10:25:29 +02:00
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; see the file COPYING; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
2002-12-13 21:15:29 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _ZEBRA_RIP_H
|
|
|
|
#define _ZEBRA_RIP_H
|
|
|
|
|
2016-12-07 16:01:47 +01:00
|
|
|
#include "qobj.h"
|
2016-06-12 17:32:23 +02:00
|
|
|
#include "hook.h"
|
2017-11-15 15:50:32 +01:00
|
|
|
#include "nexthop.h"
|
2015-05-29 05:48:31 +02:00
|
|
|
#include "rip_memory.h"
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* RIP version number. */
|
|
|
|
#define RIPv1 1
|
|
|
|
#define RIPv2 2
|
2003-06-07 03:10:00 +02:00
|
|
|
/* N.B. stuff will break if
|
|
|
|
(RIPv1 != RI_RIP_VERSION_1) || (RIPv2 != RI_RIP_VERSION_2) */
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
/* RIP command list. */
|
|
|
|
#define RIP_REQUEST 1
|
|
|
|
#define RIP_RESPONSE 2
|
|
|
|
#define RIP_TRACEON 3 /* Obsolete */
|
|
|
|
#define RIP_TRACEOFF 4 /* Obsolete */
|
|
|
|
#define RIP_POLL 5
|
|
|
|
#define RIP_POLL_ENTRY 6
|
|
|
|
#define RIP_COMMAND_MAX 7
|
|
|
|
|
|
|
|
/* RIP metric infinity value.*/
|
|
|
|
#define RIP_METRIC_INFINITY 16
|
|
|
|
|
|
|
|
/* Normal RIP packet min and max size. */
|
|
|
|
#define RIP_PACKET_MINSIZ 4
|
|
|
|
#define RIP_PACKET_MAXSIZ 512
|
|
|
|
|
|
|
|
#define RIP_HEADER_SIZE 4
|
|
|
|
#define RIP_RTE_SIZE 20
|
|
|
|
|
|
|
|
/* Max count of routing table entry in one rip packet. */
|
2014-06-25 09:43:15 +02:00
|
|
|
#define RIP_MAX_RTE ((RIP_PACKET_MAXSIZ - RIP_HEADER_SIZE) / RIP_RTE_SIZE)
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
/* RIP version 2 multicast address. */
|
|
|
|
#ifndef INADDR_RIP_GROUP
|
|
|
|
#define INADDR_RIP_GROUP 0xe0000009 /* 224.0.0.9 */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* RIP timers */
|
|
|
|
#define RIP_UPDATE_TIMER_DEFAULT 30
|
|
|
|
#define RIP_TIMEOUT_TIMER_DEFAULT 180
|
|
|
|
#define RIP_GARBAGE_TIMER_DEFAULT 120
|
|
|
|
|
|
|
|
/* RIP peer timeout value. */
|
|
|
|
#define RIP_PEER_TIMER_DEFAULT 180
|
|
|
|
|
|
|
|
/* RIP port number. */
|
|
|
|
#define RIP_PORT_DEFAULT 520
|
|
|
|
#define RIP_VTY_PORT 2602
|
|
|
|
|
|
|
|
/* Default configuration file name. */
|
|
|
|
#define RIPD_DEFAULT_CONFIG "ripd.conf"
|
|
|
|
|
|
|
|
/* RIP route types. */
|
|
|
|
#define RIP_ROUTE_RTE 0
|
|
|
|
#define RIP_ROUTE_STATIC 1
|
|
|
|
#define RIP_ROUTE_DEFAULT 2
|
|
|
|
#define RIP_ROUTE_REDISTRIBUTE 3
|
|
|
|
#define RIP_ROUTE_INTERFACE 4
|
|
|
|
|
2004-06-07 00:06:33 +02:00
|
|
|
/* RIPv2 special RTE family types */
|
|
|
|
#define RIP_FAMILY_AUTH 0xffff
|
|
|
|
|
|
|
|
/* RIPv2 authentication types, for RIP_FAMILY_AUTH RTE's */
|
|
|
|
#define RIP_NO_AUTH 0
|
|
|
|
#define RIP_AUTH_DATA 1
|
|
|
|
#define RIP_AUTH_SIMPLE_PASSWORD 2
|
|
|
|
#define RIP_AUTH_MD5 3
|
|
|
|
|
2005-02-05 00:42:41 +01:00
|
|
|
/* RIPv2 Simple authentication */
|
|
|
|
#define RIP_AUTH_SIMPLE_SIZE 16
|
|
|
|
|
2004-06-07 00:06:33 +02:00
|
|
|
/* RIPv2 MD5 authentication. */
|
2002-12-13 21:15:29 +01:00
|
|
|
#define RIP_AUTH_MD5_SIZE 16
|
2004-06-07 00:06:33 +02:00
|
|
|
#define RIP_AUTH_MD5_COMPAT_SIZE RIP_RTE_SIZE
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2018-05-09 06:34:57 +02:00
|
|
|
/* YANG paths */
|
|
|
|
#define RIP_INSTANCE "/frr-ripd:ripd/instance"
|
|
|
|
#define RIP_IFACE "/frr-interface:lib/interface/frr-ripd:rip"
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* RIP structure. */
|
2017-07-17 14:03:14 +02:00
|
|
|
struct rip {
|
|
|
|
/* RIP socket. */
|
|
|
|
int sock;
|
|
|
|
|
|
|
|
/* Default version of rip instance. */
|
|
|
|
int version_send; /* version 1 or 2 (but not both) */
|
|
|
|
int version_recv; /* version 1 or 2 or both */
|
|
|
|
|
|
|
|
/* Output buffer of RIP. */
|
|
|
|
struct stream *obuf;
|
|
|
|
|
|
|
|
/* RIP routing information base. */
|
|
|
|
struct route_table *table;
|
|
|
|
|
|
|
|
/* RIP only static routing information. */
|
|
|
|
struct route_table *route;
|
|
|
|
|
|
|
|
/* RIP neighbor. */
|
|
|
|
struct route_table *neighbor;
|
|
|
|
|
|
|
|
/* RIP threads. */
|
|
|
|
struct thread *t_read;
|
|
|
|
|
|
|
|
/* Update and garbage timer. */
|
|
|
|
struct thread *t_update;
|
|
|
|
|
|
|
|
/* Triggered update hack. */
|
|
|
|
int trigger;
|
|
|
|
struct thread *t_triggered_update;
|
|
|
|
struct thread *t_triggered_interval;
|
|
|
|
|
|
|
|
/* RIP timer values. */
|
|
|
|
unsigned long update_time;
|
|
|
|
unsigned long timeout_time;
|
|
|
|
unsigned long garbage_time;
|
|
|
|
|
|
|
|
/* RIP default metric. */
|
2018-05-09 06:34:59 +02:00
|
|
|
uint8_t default_metric;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
|
|
|
/* RIP default distance. */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t distance;
|
2017-07-17 14:03:14 +02:00
|
|
|
struct route_table *distance_table;
|
|
|
|
|
|
|
|
/* RIP ECMP flag */
|
2018-05-09 06:34:58 +02:00
|
|
|
bool ecmp;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
|
|
|
/* For redistribute route map. */
|
|
|
|
struct {
|
|
|
|
char *name;
|
|
|
|
struct route_map *map;
|
|
|
|
int metric_config;
|
2018-03-27 21:13:34 +02:00
|
|
|
uint32_t metric;
|
2017-07-17 14:03:14 +02:00
|
|
|
} route_map[ZEBRA_ROUTE_MAX];
|
|
|
|
|
|
|
|
QOBJ_FIELDS
|
2002-12-13 21:15:29 +01:00
|
|
|
};
|
2016-12-07 16:01:47 +01:00
|
|
|
DECLARE_QOBJ_TYPE(rip)
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
/* RIP routing table entry which belong to rip_packet. */
|
2017-07-17 14:03:14 +02:00
|
|
|
struct rte {
|
2018-03-27 21:13:34 +02:00
|
|
|
uint16_t family; /* Address family of this route. */
|
|
|
|
uint16_t tag; /* Route Tag which included in RIP2 packet. */
|
2017-07-17 14:03:14 +02:00
|
|
|
struct in_addr prefix; /* Prefix of rip route. */
|
|
|
|
struct in_addr mask; /* Netmask of rip route. */
|
|
|
|
struct in_addr nexthop; /* Next hop of rip route. */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint32_t metric; /* Metric value of rip route. */
|
2002-12-13 21:15:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/* RIP packet structure. */
|
2017-07-17 14:03:14 +02:00
|
|
|
struct rip_packet {
|
|
|
|
unsigned char command; /* Command type of RIP packet. */
|
|
|
|
unsigned char version; /* RIP version which coming from peer. */
|
|
|
|
unsigned char pad1; /* Padding of RIP packet header. */
|
|
|
|
unsigned char pad2; /* Same as above. */
|
|
|
|
struct rte rte[1]; /* Address structure. */
|
2002-12-13 21:15:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Buffer to read RIP packet. */
|
2017-07-17 14:03:14 +02:00
|
|
|
union rip_buf {
|
|
|
|
struct rip_packet rip_packet;
|
|
|
|
char buf[RIP_PACKET_MAXSIZ];
|
2002-12-13 21:15:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/* RIP route information. */
|
2017-07-17 14:03:14 +02:00
|
|
|
struct rip_info {
|
|
|
|
/* This route's type. */
|
|
|
|
int type;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/* Sub type. */
|
|
|
|
int sub_type;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/* RIP nexthop. */
|
2017-11-15 15:50:32 +01:00
|
|
|
struct nexthop nh;
|
2017-07-17 14:03:14 +02:00
|
|
|
struct in_addr from;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/* Metric of this route. */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint32_t metric;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/* External metric of this route.
|
|
|
|
if learnt from an externalm proto */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint32_t external_metric;
|
2005-09-29 13:25:50 +02:00
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/* Tag information of this route. */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint16_t tag;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/* Flags of RIP route. */
|
2002-12-13 21:15:29 +01:00
|
|
|
#define RIP_RTF_FIB 1
|
|
|
|
#define RIP_RTF_CHANGED 2
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t flags;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/* Garbage collect timer. */
|
|
|
|
struct thread *t_timeout;
|
|
|
|
struct thread *t_garbage_collect;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/* Route-map futures - this variables can be changed. */
|
|
|
|
struct in_addr nexthop_out;
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t metric_set;
|
|
|
|
uint32_t metric_out;
|
|
|
|
uint16_t tag_out;
|
2017-07-17 14:03:14 +02:00
|
|
|
ifindex_t ifindex_out;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
struct route_node *rp;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t distance;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
#ifdef NEW_RIP_TABLE
|
2017-07-17 14:03:14 +02:00
|
|
|
struct rip_info *next;
|
|
|
|
struct rip_info *prev;
|
2002-12-13 21:15:29 +01:00
|
|
|
#endif /* NEW_RIP_TABLE */
|
|
|
|
};
|
|
|
|
|
2003-05-25 16:49:19 +02:00
|
|
|
typedef enum {
|
2017-07-17 14:03:14 +02:00
|
|
|
RIP_NO_SPLIT_HORIZON = 0,
|
|
|
|
RIP_SPLIT_HORIZON,
|
|
|
|
RIP_SPLIT_HORIZON_POISONED_REVERSE
|
2003-05-25 16:49:19 +02:00
|
|
|
} split_horizon_policy_t;
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* RIP specific interface configuration. */
|
2017-07-17 14:03:14 +02:00
|
|
|
struct rip_interface {
|
|
|
|
/* RIP is enabled on this interface. */
|
|
|
|
int enable_network;
|
|
|
|
int enable_interface;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/* RIP is running on this interface. */
|
|
|
|
int running;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/* RIP version control. */
|
|
|
|
int ri_send;
|
|
|
|
int ri_receive;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/* RIPv2 broadcast mode */
|
|
|
|
int v2_broadcast;
|
2016-11-10 15:55:09 +01:00
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/* RIPv2 authentication type. */
|
|
|
|
int auth_type;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/* RIPv2 authentication string. */
|
|
|
|
char *auth_str;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/* RIPv2 authentication key chain. */
|
|
|
|
char *key_chain;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/* value to use for md5->auth_len */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t md5_auth_len;
|
2004-06-07 00:06:33 +02:00
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/* Split horizon flag. */
|
|
|
|
split_horizon_policy_t split_horizon;
|
|
|
|
split_horizon_policy_t split_horizon_default;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/* For filter type slot. */
|
2002-12-13 21:15:29 +01:00
|
|
|
#define RIP_FILTER_IN 0
|
|
|
|
#define RIP_FILTER_OUT 1
|
|
|
|
#define RIP_FILTER_MAX 2
|
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/* Access-list. */
|
|
|
|
struct access_list *list[RIP_FILTER_MAX];
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/* Prefix-list. */
|
|
|
|
struct prefix_list *prefix[RIP_FILTER_MAX];
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/* Route-map. */
|
|
|
|
struct route_map *routemap[RIP_FILTER_MAX];
|
2003-05-25 16:49:19 +02:00
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/* Wake up thread. */
|
|
|
|
struct thread *t_wakeup;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/* Interface statistics. */
|
|
|
|
int recv_badpackets;
|
|
|
|
int recv_badroutes;
|
|
|
|
int sent_updates;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/* Passive interface. */
|
|
|
|
int passive;
|
2002-12-13 21:15:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/* RIP peer information. */
|
2017-07-17 14:03:14 +02:00
|
|
|
struct rip_peer {
|
|
|
|
/* Peer address. */
|
|
|
|
struct in_addr addr;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/* Peer RIP tag value. */
|
|
|
|
int domain;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/* Last update time. */
|
|
|
|
time_t uptime;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/* Peer RIP version. */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t version;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/* Statistics. */
|
|
|
|
int recv_badpackets;
|
|
|
|
int recv_badroutes;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/* Timeout thread. */
|
|
|
|
struct thread *t_timeout;
|
2002-12-13 21:15:29 +01:00
|
|
|
};
|
|
|
|
|
2018-05-09 06:34:59 +02:00
|
|
|
struct rip_distance {
|
|
|
|
/* Distance value for the IP source prefix. */
|
|
|
|
uint8_t distance;
|
|
|
|
|
|
|
|
/* Name of the access-list to be matched. */
|
|
|
|
char *access_list;
|
|
|
|
};
|
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
struct rip_md5_info {
|
2018-03-27 21:13:34 +02:00
|
|
|
uint16_t family;
|
|
|
|
uint16_t type;
|
|
|
|
uint16_t packet_len;
|
|
|
|
uint8_t keyid;
|
|
|
|
uint8_t auth_len;
|
|
|
|
uint32_t sequence;
|
|
|
|
uint32_t reserv1;
|
|
|
|
uint32_t reserv2;
|
2002-12-13 21:15:29 +01:00
|
|
|
};
|
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
struct rip_md5_data {
|
2018-03-27 21:13:34 +02:00
|
|
|
uint16_t family;
|
|
|
|
uint16_t type;
|
|
|
|
uint8_t digest[16];
|
2002-12-13 21:15:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/* RIP accepet/announce methods. */
|
|
|
|
#define RI_RIP_UNSPEC 0
|
|
|
|
#define RI_RIP_VERSION_1 1
|
|
|
|
#define RI_RIP_VERSION_2 2
|
|
|
|
#define RI_RIP_VERSION_1_AND_2 3
|
2016-11-10 16:15:43 +01:00
|
|
|
#define RI_RIP_VERSION_NONE 4
|
2003-06-07 03:10:00 +02:00
|
|
|
/* N.B. stuff will break if
|
|
|
|
(RIPv1 != RI_RIP_VERSION_1) || (RIPv2 != RI_RIP_VERSION_2) */
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
/* RIP event. */
|
2017-07-17 14:03:14 +02:00
|
|
|
enum rip_event {
|
|
|
|
RIP_READ,
|
|
|
|
RIP_UPDATE_EVENT,
|
|
|
|
RIP_TRIGGERED_UPDATE,
|
2002-12-13 21:15:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Macro for timer turn on. */
|
2017-04-25 00:33:25 +02:00
|
|
|
#define RIP_TIMER_ON(T,F,V) thread_add_timer (master, (F), rinfo, (V), &(T))
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
/* Macro for timer turn off. */
|
2016-11-12 22:34:37 +01:00
|
|
|
#define RIP_TIMER_OFF(X) THREAD_TIMER_OFF(X)
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2018-05-09 06:35:00 +02:00
|
|
|
#define RIP_OFFSET_LIST_IN 0
|
|
|
|
#define RIP_OFFSET_LIST_OUT 1
|
|
|
|
#define RIP_OFFSET_LIST_MAX 2
|
|
|
|
|
|
|
|
struct rip_offset_list {
|
|
|
|
char *ifname;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
char *alist_name;
|
|
|
|
/* struct access_list *alist; */
|
|
|
|
uint8_t metric;
|
|
|
|
} direct[RIP_OFFSET_LIST_MAX];
|
|
|
|
};
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Prototypes. */
|
2017-07-17 14:03:14 +02:00
|
|
|
extern void rip_init(void);
|
|
|
|
extern void rip_reset(void);
|
|
|
|
extern void rip_clean(void);
|
|
|
|
extern void rip_clean_network(void);
|
|
|
|
extern void rip_interfaces_clean(void);
|
|
|
|
extern void rip_interfaces_reset(void);
|
|
|
|
extern void rip_passive_nondefault_clean(void);
|
|
|
|
extern void rip_if_init(void);
|
|
|
|
extern void rip_if_down_all(void);
|
|
|
|
extern void rip_route_map_init(void);
|
|
|
|
extern void rip_route_map_reset(void);
|
2015-09-23 22:26:56 +02:00
|
|
|
extern void rip_zclient_init(struct thread_master *);
|
2017-06-30 16:32:26 +02:00
|
|
|
extern void rip_zclient_stop(void);
|
2017-07-17 14:03:14 +02:00
|
|
|
extern void rip_zclient_reset(void);
|
|
|
|
extern int if_check_address(struct in_addr addr);
|
2018-05-09 06:34:58 +02:00
|
|
|
extern int rip_create(int socket);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2018-03-27 21:13:34 +02:00
|
|
|
extern int rip_request_send(struct sockaddr_in *, struct interface *, uint8_t,
|
2017-07-17 14:03:14 +02:00
|
|
|
struct connected *);
|
|
|
|
extern int rip_neighbor_lookup(struct sockaddr_in *);
|
2018-05-09 06:34:59 +02:00
|
|
|
extern int rip_neighbor_add(struct prefix_ipv4 *p);
|
|
|
|
extern int rip_neighbor_delete(struct prefix_ipv4 *p);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2018-05-09 06:35:00 +02:00
|
|
|
extern int rip_enable_network_add(struct prefix *p);
|
|
|
|
extern int rip_enable_network_delete(struct prefix *p);
|
|
|
|
extern int rip_enable_if_add(const char *ifname);
|
|
|
|
extern int rip_enable_if_delete(const char *ifname);
|
|
|
|
|
2018-05-09 06:34:58 +02:00
|
|
|
extern void rip_ecmp_disable(void);
|
|
|
|
|
2018-05-09 06:34:58 +02:00
|
|
|
extern int rip_create_socket(void);
|
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
extern int rip_redistribute_check(int);
|
2018-03-06 20:02:52 +01:00
|
|
|
extern void rip_redistribute_add(int type, int sub_type, struct prefix_ipv4 *p,
|
|
|
|
struct nexthop *nh, unsigned int metric,
|
|
|
|
unsigned char distance, route_tag_t tag);
|
2017-07-17 14:03:14 +02:00
|
|
|
extern void rip_redistribute_delete(int, int, struct prefix_ipv4 *, ifindex_t);
|
|
|
|
extern void rip_redistribute_withdraw(int);
|
|
|
|
extern void rip_zebra_ipv4_add(struct route_node *);
|
|
|
|
extern void rip_zebra_ipv4_delete(struct route_node *);
|
|
|
|
extern void rip_interface_multicast_set(int, struct connected *);
|
|
|
|
extern void rip_distribute_update_interface(struct interface *);
|
|
|
|
extern void rip_if_rmap_update_interface(struct interface *);
|
|
|
|
|
|
|
|
extern int config_write_rip_network(struct vty *, int);
|
|
|
|
extern int config_write_rip_redistribute(struct vty *, int);
|
|
|
|
|
|
|
|
extern void rip_peer_init(void);
|
2018-03-27 21:13:34 +02:00
|
|
|
extern void rip_peer_update(struct sockaddr_in *, uint8_t);
|
2017-07-17 14:03:14 +02:00
|
|
|
extern void rip_peer_bad_route(struct sockaddr_in *);
|
|
|
|
extern void rip_peer_bad_packet(struct sockaddr_in *);
|
|
|
|
extern void rip_peer_display(struct vty *);
|
|
|
|
extern struct rip_peer *rip_peer_lookup(struct in_addr *);
|
|
|
|
extern struct rip_peer *rip_peer_lookup_next(struct in_addr *);
|
|
|
|
|
|
|
|
extern void rip_info_free(struct rip_info *);
|
2018-05-09 06:34:59 +02:00
|
|
|
extern struct rip_distance *rip_distance_new(void);
|
|
|
|
extern void rip_distance_free(struct rip_distance *rdistance);
|
2018-03-27 21:13:34 +02:00
|
|
|
extern uint8_t rip_distance_apply(struct rip_info *);
|
2017-07-17 14:03:14 +02:00
|
|
|
extern void rip_redistribute_clean(void);
|
|
|
|
|
|
|
|
extern struct rip_info *rip_ecmp_add(struct rip_info *);
|
|
|
|
extern struct rip_info *rip_ecmp_replace(struct rip_info *);
|
|
|
|
extern struct rip_info *rip_ecmp_delete(struct rip_info *);
|
2014-07-18 08:13:18 +02:00
|
|
|
|
2018-05-09 06:35:00 +02:00
|
|
|
extern struct rip_offset_list *rip_offset_list_new(const char *ifname);
|
|
|
|
extern void offset_list_del(struct rip_offset_list *offset);
|
|
|
|
extern struct rip_offset_list *rip_offset_list_lookup(const char *ifname);
|
|
|
|
extern int rip_offset_list_apply_in(struct prefix_ipv4 *, struct interface *,
|
|
|
|
uint32_t *);
|
|
|
|
extern int rip_offset_list_apply_out(struct prefix_ipv4 *, struct interface *,
|
|
|
|
uint32_t *);
|
|
|
|
extern void rip_offset_init(void);
|
|
|
|
extern void rip_offset_clean(void);
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* There is only one rip strucutre. */
|
|
|
|
extern struct rip *rip;
|
|
|
|
|
2017-10-11 16:20:15 +02:00
|
|
|
extern struct zebra_privs_t ripd_privs;
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Master thread strucutre. */
|
|
|
|
extern struct thread_master *master;
|
|
|
|
|
|
|
|
/* RIP statistics for SNMP. */
|
|
|
|
extern long rip_global_route_changes;
|
|
|
|
extern long rip_global_queries;
|
2016-06-12 17:32:23 +02:00
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
DECLARE_HOOK(rip_ifaddr_add, (struct connected * ifc), (ifc))
|
|
|
|
DECLARE_HOOK(rip_ifaddr_del, (struct connected * ifc), (ifc))
|
2016-06-12 17:32:23 +02:00
|
|
|
|
2018-05-09 06:34:59 +02:00
|
|
|
extern struct route_table *rip_distance_table;
|
|
|
|
|
2018-05-09 06:34:57 +02:00
|
|
|
/* Northbound. */
|
|
|
|
extern void rip_cli_init(void);
|
|
|
|
extern const struct frr_yang_module_info frr_ripd_info;
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
#endif /* _ZEBRA_RIP_H */
|