--- embedaddon/quagga/ospfd/ospfd.h 2013/07/21 23:54:40 1.1.1.2 +++ embedaddon/quagga/ospfd/ospfd.h 2016/11/02 10:09:12 1.1.1.3 @@ -24,22 +24,13 @@ #define _ZEBRA_OSPFD_H #include +#include "libospf.h" #include "filter.h" #include "log.h" #define OSPF_VERSION 2 -/* Default protocol, port number. */ -#ifndef IPPROTO_OSPFIGP -#define IPPROTO_OSPFIGP 89 -#endif /* IPPROTO_OSPFIGP */ - -/* IP precedence. */ -#ifndef IPTOS_PREC_INTERNETCONTROL -#define IPTOS_PREC_INTERNETCONTROL 0xC0 -#endif /* IPTOS_PREC_INTERNETCONTROL */ - /* VTY port number. */ #define OSPF_VTY_PORT 2604 @@ -50,29 +41,11 @@ /* Default configuration file name for ospfd. */ #define OSPF_DEFAULT_CONFIG "ospfd.conf" -/* Architectual Constants */ -#ifdef DEBUG -#define OSPF_LS_REFRESH_TIME 60 -#else -#define OSPF_LS_REFRESH_TIME 1800 -#endif -#define OSPF_MIN_LS_INTERVAL 5 -#define OSPF_MIN_LS_ARRIVAL 1 -#define OSPF_LSA_INITIAL_AGE 0 /* useful for debug */ -#define OSPF_LSA_MAXAGE 3600 -#define OSPF_CHECK_AGE 300 -#define OSPF_LSA_MAXAGE_DIFF 900 -#define OSPF_LS_INFINITY 0xffffff -#define OSPF_DEFAULT_DESTINATION 0x00000000 /* 0.0.0.0 */ -#define OSPF_INITIAL_SEQUENCE_NUMBER 0x80000001 -#define OSPF_MAX_SEQUENCE_NUMBER 0x7fffffff - #define OSPF_NSSA_TRANS_STABLE_DEFAULT 40 #define OSPF_ALLSPFROUTERS 0xe0000005 /* 224.0.0.5 */ #define OSPF_ALLDROUTERS 0xe0000006 /* 224.0.0.6 */ -#define OSPF_AREA_BACKBONE 0x00000000 /* 0.0.0.0 */ /* OSPF Authentication Type. */ #define OSPF_AUTH_NULL 0 @@ -85,30 +58,6 @@ been given or not in VLink command handlers */ #define OSPF_AUTH_CMD_NOTSEEN -2 -/* OSPF SPF timer values. */ -#define OSPF_SPF_DELAY_DEFAULT 200 -#define OSPF_SPF_HOLDTIME_DEFAULT 1000 -#define OSPF_SPF_MAX_HOLDTIME_DEFAULT 10000 - -/* OSPF interface default values. */ -#define OSPF_OUTPUT_COST_DEFAULT 10 -#define OSPF_OUTPUT_COST_INFINITE UINT16_MAX -#define OSPF_ROUTER_DEAD_INTERVAL_DEFAULT 40 -#define OSPF_ROUTER_DEAD_INTERVAL_MINIMAL 1 -#define OSPF_HELLO_INTERVAL_DEFAULT 10 -#define OSPF_ROUTER_PRIORITY_DEFAULT 1 -#define OSPF_RETRANSMIT_INTERVAL_DEFAULT 5 -#define OSPF_TRANSMIT_DELAY_DEFAULT 1 -#define OSPF_DEFAULT_BANDWIDTH 10000 /* Kbps */ - -#define OSPF_DEFAULT_REF_BANDWIDTH 100000 /* Kbps */ - -#define OSPF_POLL_INTERVAL_DEFAULT 60 -#define OSPF_NEIGHBOR_PRIORITY_DEFAULT 0 - -#define OSPF_MTU_IGNORE_DEFAULT 0 -#define OSPF_FAST_HELLO_DEFAULT 0 - /* OSPF options. */ #define OSPF_OPTION_T 0x01 /* TOS. */ #define OSPF_OPTION_E 0x02 @@ -182,14 +131,9 @@ struct ospf #define OSPF_LOG_ADJACENCY_CHANGES (1 << 3) #define OSPF_LOG_ADJACENCY_DETAIL (1 << 4) -#ifdef HAVE_OPAQUE_LSA /* Opaque-LSA administrative flags. */ u_char opaque; #define OPAQUE_OPERATION_READY_BIT (1 << 0) -#define OPAQUE_BLOCK_TYPE_09_LSA_BIT (1 << 1) -#define OPAQUE_BLOCK_TYPE_10_LSA_BIT (1 << 2) -#define OPAQUE_BLOCK_TYPE_11_LSA_BIT (1 << 3) -#endif /* HAVE_OPAQUE_LSA */ /* RFC3137 stub router. Configured time to stay stub / max-metric */ unsigned int stub_router_startup_time; /* seconds */ @@ -201,6 +145,10 @@ struct ospf #define OSPF_STUB_MAX_METRIC_SUMMARY_COST 0x00ff0000 + /* LSA timers */ + unsigned int min_ls_interval; /* minimum delay between LSAs (in msec) */ + unsigned int min_ls_arrival; /* minimum interarrival time between LSAs (in msec) */ + /* SPF parameters */ unsigned int spf_delay; /* SPF delay time. */ unsigned int spf_holdtime; /* SPF hold time. */ @@ -228,9 +176,7 @@ struct ospf int external_origin; /* AS-external-LSA origin flag. */ int ase_calc; /* ASE calculation flag. */ -#ifdef HAVE_OPAQUE_LSA struct list *opaque_lsa_self; /* Type-11 Opaque-LSAs */ -#endif /* HAVE_OPAQUE_LSA */ /* Routing tables. */ struct route_table *old_table; /* Old routing table. */ @@ -245,8 +191,9 @@ struct ospf struct route_table *external_lsas; /* Database of external LSAs, prefix is LSA's adv. network*/ - /* Time stamps. */ + /* Time stamps */ struct timeval ts_spf; /* SPF calculation time stamp. */ + struct timeval ts_spf_duration; /* Execution time of last SPF */ struct route_table *maxage_lsa; /* List of MaxAge LSA for deletion. */ int redistribute; /* Num of redistributed protocols. */ @@ -258,14 +205,10 @@ struct ospf struct thread *t_spf_calc; /* SPF calculation timer. */ struct thread *t_ase_calc; /* ASE calculation timer. */ struct thread *t_external_lsa; /* AS-external-LSA origin timer. */ -#ifdef HAVE_OPAQUE_LSA struct thread *t_opaque_lsa_self; /* Type-11 Opaque-LSAs origin event. */ -#endif /* HAVE_OPAQUE_LSA */ -#define OSFP_LSA_MAXAGE_REMOVE_DELAY_DEFAULT 60 unsigned int maxage_delay; /* Delay on Maxage remover timer, sec */ struct thread *t_maxage; /* MaxAge LSA remover timer. */ -#define OSPF_LSA_MAXAGE_CHECK_INTERVAL 30 struct thread *t_maxage_walker; /* MaxAge LSA checking timer. */ struct thread *t_deferred_shutdown; /* deferred/stub-router shutdown timer*/ @@ -395,9 +338,7 @@ struct ospf_area /* Self-originated LSAs. */ struct ospf_lsa *router_lsa_self; -#ifdef HAVE_OPAQUE_LSA struct list *opaque_lsa_self; /* Type-10 Opaque-LSAs */ -#endif /* HAVE_OPAQUE_LSA */ /* Area announce list. */ struct @@ -439,13 +380,14 @@ struct ospf_area /* Threads. */ struct thread *t_stub_router; /* Stub-router timer */ -#ifdef HAVE_OPAQUE_LSA struct thread *t_opaque_lsa_self; /* Type-10 Opaque-LSAs origin. */ -#endif /* HAVE_OPAQUE_LSA */ /* Statistics field. */ u_int32_t spf_calculation; /* SPF Calculation Count. */ + /* Time stamps. */ + struct timeval ts_spf; /* SPF calculation time stamp. */ + /* Router count. */ u_int32_t abr_count; /* ABR router in this area. */ u_int32_t asbr_count; /* ASBR router in this area. */ @@ -610,6 +552,9 @@ extern struct ospf_area *ospf_area_lookup_by_area_id ( struct in_addr); extern void ospf_area_add_if (struct ospf_area *, struct ospf_interface *); extern void ospf_area_del_if (struct ospf_area *, struct ospf_interface *); + +extern void ospf_interface_area_set (struct interface *); +extern void ospf_interface_area_unset (struct interface *); extern void ospf_route_map_init (void); extern void ospf_snmp_init (void);