Added few route attributes.

This commit is contained in:
Martin Mares 1998-04-23 08:09:39 +00:00
parent 58ef912c6b
commit 481f69854a

View file

@ -60,8 +60,9 @@ typedef struct rte {
struct rte *next; struct rte *next;
struct rtattr *attrs; struct rtattr *attrs;
byte flags; /* Flags (REF_...) */ byte flags; /* Flags (REF_...) */
byte rfu; byte pflags; /* Protocol-specific flags */
word pref; /* Route preference */ word pref; /* Route preference */
u32 lastmod; /* Last modified (time) */
union { /* Protocol-dependent data (metrics etc.) */ union { /* Protocol-dependent data (metrics etc.) */
#ifdef CONFIG_STATIC #ifdef CONFIG_STATIC
struct { struct {
@ -70,11 +71,13 @@ typedef struct rte {
#ifdef CONFIG_RIP #ifdef CONFIG_RIP
struct { struct {
byte metric; /* RIP metric */ byte metric; /* RIP metric */
u16 tag; /* External route tag */
} rip; } rip;
#endif #endif
#ifdef CONFIG_OSPF #ifdef CONFIG_OSPF
struct { struct {
u32 metric1, metric2; /* OSPF Type 1 and Type 2 metrics */ u32 metric1, metric2; /* OSPF Type 1 and Type 2 metrics */
u32 tag; /* External route tag */
} ospf; } ospf;
#endif #endif
#ifdef CONFIG_BGP #ifdef CONFIG_BGP
@ -107,7 +110,6 @@ struct rtattr {
byte dest; /* Route destination type (RTD_...) */ byte dest; /* Route destination type (RTD_...) */
byte tos; /* TOS of this route */ byte tos; /* TOS of this route */
byte flags; /* Route flags (RTF_...) */ byte flags; /* Route flags (RTF_...) */
word source_as; /* Source AS of this route (0=local) */
ip_addr gw; /* Next hop */ ip_addr gw; /* Next hop */
struct iface *iface; /* Outgoing interface */ struct iface *iface; /* Outgoing interface */
struct ea_list *attrs; /* Extended Attribute chain */ struct ea_list *attrs; /* Extended Attribute chain */
@ -123,13 +125,13 @@ struct rtattr {
#define RTS_OSPF 8 /* OSPF route */ #define RTS_OSPF 8 /* OSPF route */
#define RTS_OSPF_EXT 9 /* OSPF external route */ #define RTS_OSPF_EXT 9 /* OSPF external route */
#define RTS_OSPF_IA 10 /* OSPF inter-area route */ #define RTS_OSPF_IA 10 /* OSPF inter-area route */
#define RTS_OSPF_BOUNDARY 11 /* OSPF route to boundary router */ #define RTS_OSPF_BOUNDARY 11 /* OSPF route to boundary router (???) */
#define RTS_BGP 12 /* BGP route */ #define RTS_BGP 12 /* BGP route */
#define SCOPE_HOST 0 /* Address scope */ #define SCOPE_HOST 0 /* Address scope */
#define SCOPE_LINK 0x10 #define SCOPE_LINK 1
#define SCOPE_SITE 0x80 #define SCOPE_SITE 2
#define SCOPE_UNIVERSE 0xff #define SCOPE_UNIVERSE 3
#define RTC_UNICAST 0 #define RTC_UNICAST 0
#define RTC_BROADCAST 1 #define RTC_BROADCAST 1
@ -142,6 +144,9 @@ struct rtattr {
#define RTD_UNREACHABLE 3 /* Reject as unreachable */ #define RTD_UNREACHABLE 3 /* Reject as unreachable */
#define RTD_PROHIBIT 4 /* Administratively prohibited */ #define RTD_PROHIBIT 4 /* Administratively prohibited */
#define RTF_EXTERIOR 1 /* Learned via exterior protocol */
#define RTF_TAGGED 2 /* Tagged route learned via IGP */
/* /*
* Extended Route Attributes * Extended Route Attributes
*/ */