version 1.1, 2012/02/21 17:26:12
|
version 1.1.1.5, 2016/11/02 10:09:12
|
Line 27
|
Line 27
|
|
|
/* OSPF LSA Range definition. */ |
/* OSPF LSA Range definition. */ |
#define OSPF_MIN_LSA 1 /* begin range here */ |
#define OSPF_MIN_LSA 1 /* begin range here */ |
#if defined (HAVE_OPAQUE_LSA) |
|
#define OSPF_MAX_LSA 12 |
#define OSPF_MAX_LSA 12 |
#else |
|
#define OSPF_MAX_LSA 8 |
|
#endif |
|
|
|
/* OSPF LSA Type definition. */ |
/* OSPF LSA Type definition. */ |
#define OSPF_UNKNOWN_LSA 0 |
#define OSPF_UNKNOWN_LSA 0 |
Line 153 struct router_lsa_link
|
Line 149 struct router_lsa_link
|
}; |
}; |
|
|
/* OSPF Router-LSAs structure. */ |
/* OSPF Router-LSAs structure. */ |
|
#define OSPF_ROUTER_LSA_MIN_SIZE 4U /* w/0 link descriptors */ |
|
/* There is an edge case, when number of links in a Router-LSA may be 0 without |
|
breaking the specification. A router, which has no other links to backbone |
|
area besides one virtual link, will not put any VL descriptor blocks into |
|
the Router-LSA generated for area 0 until a full adjacency over the VL is |
|
reached (RFC2328 12.4.1.3). In this case the Router-LSA initially received |
|
by the other end of the VL will have 0 link descriptor blocks, but soon will |
|
be replaced with the next revision having 1 descriptor block. */ |
struct router_lsa |
struct router_lsa |
{ |
{ |
struct lsa_header header; |
struct lsa_header header; |
Line 170 struct router_lsa
|
Line 174 struct router_lsa
|
}; |
}; |
|
|
/* OSPF Network-LSAs structure. */ |
/* OSPF Network-LSAs structure. */ |
|
#define OSPF_NETWORK_LSA_MIN_SIZE 8U /* w/1 router-ID */ |
struct network_lsa |
struct network_lsa |
{ |
{ |
struct lsa_header header; |
struct lsa_header header; |
Line 178 struct network_lsa
|
Line 183 struct network_lsa
|
}; |
}; |
|
|
/* OSPF Summary-LSAs structure. */ |
/* OSPF Summary-LSAs structure. */ |
|
#define OSPF_SUMMARY_LSA_MIN_SIZE 8U /* w/1 TOS metric block */ |
struct summary_lsa |
struct summary_lsa |
{ |
{ |
struct lsa_header header; |
struct lsa_header header; |
Line 187 struct summary_lsa
|
Line 193 struct summary_lsa
|
}; |
}; |
|
|
/* OSPF AS-external-LSAs structure. */ |
/* OSPF AS-external-LSAs structure. */ |
|
#define OSPF_AS_EXTERNAL_LSA_MIN_SIZE 16U /* w/1 TOS forwarding block */ |
struct as_external_lsa |
struct as_external_lsa |
{ |
{ |
struct lsa_header header; |
struct lsa_header header; |
Line 200 struct as_external_lsa
|
Line 207 struct as_external_lsa
|
} e[1]; |
} e[1]; |
}; |
}; |
|
|
#ifdef HAVE_OPAQUE_LSA |
|
#include "ospfd/ospf_opaque.h" |
#include "ospfd/ospf_opaque.h" |
#endif /* HAVE_OPAQUE_LSA */ |
|
|
|
/* Macros. */ |
/* Macros. */ |
#define GET_METRIC(x) get_metric(x) |
#define GET_METRIC(x) get_metric(x) |
Line 226 extern struct timeval tv_adjust (struct timeval);
|
Line 231 extern struct timeval tv_adjust (struct timeval);
|
extern int tv_ceil (struct timeval); |
extern int tv_ceil (struct timeval); |
extern int tv_floor (struct timeval); |
extern int tv_floor (struct timeval); |
extern struct timeval int2tv (int); |
extern struct timeval int2tv (int); |
|
extern struct timeval msec2tv (int); |
extern struct timeval tv_add (struct timeval, struct timeval); |
extern struct timeval tv_add (struct timeval, struct timeval); |
extern struct timeval tv_sub (struct timeval, struct timeval); |
extern struct timeval tv_sub (struct timeval, struct timeval); |
extern int tv_cmp (struct timeval, struct timeval); |
extern int tv_cmp (struct timeval, struct timeval); |
|
|
extern int get_age (struct ospf_lsa *); |
extern int get_age (struct ospf_lsa *); |
extern u_int16_t ospf_lsa_checksum (struct lsa_header *); |
extern u_int16_t ospf_lsa_checksum (struct lsa_header *); |
|
extern int ospf_lsa_checksum_valid (struct lsa_header *); |
extern int ospf_lsa_refresh_delay (struct ospf_lsa *); |
extern int ospf_lsa_refresh_delay (struct ospf_lsa *); |
|
|
extern const char *dump_lsa_key (struct ospf_lsa *); |
extern const char *dump_lsa_key (struct ospf_lsa *); |
Line 239 extern u_int32_t lsa_seqnum_increment (struct ospf_lsa
|
Line 246 extern u_int32_t lsa_seqnum_increment (struct ospf_lsa
|
extern void lsa_header_set (struct stream *, u_char, u_char, struct in_addr, |
extern void lsa_header_set (struct stream *, u_char, u_char, struct in_addr, |
struct in_addr); |
struct in_addr); |
extern struct ospf_neighbor *ospf_nbr_lookup_ptop (struct ospf_interface *); |
extern struct ospf_neighbor *ospf_nbr_lookup_ptop (struct ospf_interface *); |
|
extern int ospf_check_nbr_status (struct ospf *); |
|
|
/* Prototype for LSA primitive. */ |
/* Prototype for LSA primitive. */ |
extern struct ospf_lsa *ospf_lsa_new (void); |
extern struct ospf_lsa *ospf_lsa_new (void); |
Line 269 extern struct ospf_lsa *ospf_lsa_install (struct ospf
|
Line 277 extern struct ospf_lsa *ospf_lsa_install (struct ospf
|
|
|
extern void ospf_nssa_lsa_flush (struct ospf *ospf, struct prefix_ipv4 *p); |
extern void ospf_nssa_lsa_flush (struct ospf *ospf, struct prefix_ipv4 *p); |
extern void ospf_external_lsa_flush (struct ospf *, u_char, struct prefix_ipv4 *, |
extern void ospf_external_lsa_flush (struct ospf *, u_char, struct prefix_ipv4 *, |
unsigned int /* , struct in_addr nexthop */); | ifindex_t /* , struct in_addr nexthop */); |
|
|
extern struct in_addr ospf_get_ip_from_ifp (struct ospf_interface *); |
extern struct in_addr ospf_get_ip_from_ifp (struct ospf_interface *); |
|
|
extern struct ospf_lsa *ospf_external_lsa_originate (struct ospf *, struct external_info *); |
extern struct ospf_lsa *ospf_external_lsa_originate (struct ospf *, struct external_info *); |
extern int ospf_external_lsa_originate_timer (struct thread *); |
extern int ospf_external_lsa_originate_timer (struct thread *); |
|
extern int ospf_default_originate_timer (struct thread *); |
extern struct ospf_lsa *ospf_lsa_lookup (struct ospf_area *, u_int32_t, |
extern struct ospf_lsa *ospf_lsa_lookup (struct ospf_area *, u_int32_t, |
struct in_addr, struct in_addr); |
struct in_addr, struct in_addr); |
extern struct ospf_lsa *ospf_lsa_lookup_by_id (struct ospf_area *, |
extern struct ospf_lsa *ospf_lsa_lookup_by_id (struct ospf_area *, |