1*433d6423SLionel Sambuc /* 2*433d6423SLionel Sambuc net/gen/rip.h 3*433d6423SLionel Sambuc 4*433d6423SLionel Sambuc Definitions for the Routing Information Protocol (RFC-1058). 5*433d6423SLionel Sambuc 6*433d6423SLionel Sambuc Created: Aug 16, 1993 by Philip Homburg <philip@cs.vu.nl> 7*433d6423SLionel Sambuc */ 8*433d6423SLionel Sambuc 9*433d6423SLionel Sambuc #ifndef NET__GEN__RIP_H 10*433d6423SLionel Sambuc #define NET__GEN__RIP_H 11*433d6423SLionel Sambuc 12*433d6423SLionel Sambuc typedef struct rip_hdr 13*433d6423SLionel Sambuc { 14*433d6423SLionel Sambuc u8_t rh_command; 15*433d6423SLionel Sambuc u8_t rh_version; 16*433d6423SLionel Sambuc u16_t rh_zero; 17*433d6423SLionel Sambuc } rip_hdr_t; 18*433d6423SLionel Sambuc 19*433d6423SLionel Sambuc #define RHC_REQUEST 1 20*433d6423SLionel Sambuc #define RHC_RESPONSE 2 21*433d6423SLionel Sambuc 22*433d6423SLionel Sambuc #define RIP_ENTRY_MAX 25 23*433d6423SLionel Sambuc 24*433d6423SLionel Sambuc typedef struct rip_entry 25*433d6423SLionel Sambuc { 26*433d6423SLionel Sambuc union 27*433d6423SLionel Sambuc { 28*433d6423SLionel Sambuc struct rip_entry_v1 29*433d6423SLionel Sambuc { 30*433d6423SLionel Sambuc u16_t re_family; 31*433d6423SLionel Sambuc u16_t re_zero0; 32*433d6423SLionel Sambuc u32_t re_address; 33*433d6423SLionel Sambuc u32_t re_zero1; 34*433d6423SLionel Sambuc u32_t re_zero2; 35*433d6423SLionel Sambuc u32_t re_metric; 36*433d6423SLionel Sambuc } v1; 37*433d6423SLionel Sambuc struct rip_entry_v2 38*433d6423SLionel Sambuc { 39*433d6423SLionel Sambuc u16_t re_family; 40*433d6423SLionel Sambuc u16_t re_tag; 41*433d6423SLionel Sambuc u32_t re_address; 42*433d6423SLionel Sambuc u32_t re_mask; 43*433d6423SLionel Sambuc u32_t re_nexthop; 44*433d6423SLionel Sambuc u32_t re_metric; 45*433d6423SLionel Sambuc } v2; 46*433d6423SLionel Sambuc } u; 47*433d6423SLionel Sambuc } rip_entry_t; 48*433d6423SLionel Sambuc 49*433d6423SLionel Sambuc #define RIP_FAMILY_IP 2 50*433d6423SLionel Sambuc #define RIP_INFINITY 16 51*433d6423SLionel Sambuc 52*433d6423SLionel Sambuc #define RIP_UDP_PORT 520 53*433d6423SLionel Sambuc #define RIP_PERIOD 30 /* A responce is sent once every 54*433d6423SLionel Sambuc * RIP_PERIOD seconds 55*433d6423SLionel Sambuc */ 56*433d6423SLionel Sambuc #define RIP_FUZZ 10 /* The actual value used is RIP_FREQUENCE - 57*433d6423SLionel Sambuc * a random number of at most RIP_FUZZ. 58*433d6423SLionel Sambuc */ 59*433d6423SLionel Sambuc #define RIP_TIMEOUT 180 /* A route is dead after RIP_TIMEOUT seconds */ 60*433d6423SLionel Sambuc #define RIP_DELETE_TO 120 /* A dead route is removed after RIP_DELETE_TO 61*433d6423SLionel Sambuc * seconds 62*433d6423SLionel Sambuc */ 63*433d6423SLionel Sambuc 64*433d6423SLionel Sambuc #ifdef __RIP_DEBUG 65*433d6423SLionel Sambuc #undef RIP_PERIOD 66*433d6423SLionel Sambuc #define RIP_PERIOD 15 67*433d6423SLionel Sambuc #undef RIP_TIMEOUT 68*433d6423SLionel Sambuc #define RIP_TIMEOUT 10 69*433d6423SLionel Sambuc #undef RIP_DELETE_TO 70*433d6423SLionel Sambuc #define RIP_DELETE_TO 10 71*433d6423SLionel Sambuc #endif /* __RIP_DEBUG */ 72*433d6423SLionel Sambuc 73*433d6423SLionel Sambuc #endif /* NET__GEN__RIP_H */ 74*433d6423SLionel Sambuc 75*433d6423SLionel Sambuc /* 76*433d6423SLionel Sambuc * $PchId: rip.h,v 1.3 1995/11/17 22:21:16 philip Exp $ 77*433d6423SLionel Sambuc */ 78