diff options
author | Chris Hall <chris.hall@highwayman.com> | 2011-03-29 00:29:35 +0100 |
---|---|---|
committer | Chris Hall <chris.hall@highwayman.com> | 2011-03-29 00:29:35 +0100 |
commit | e20f7ccd9e110fcd5deb945f8d23922efd8b0822 (patch) | |
tree | 89b61ee61ac306817dc19b9313806bf2562b1c1b /bgpd/bgpd.h | |
parent | 6481583be322b0ba223a0140500a0a6d50546dd9 (diff) | |
download | quagga-ex14.tar.bz2 quagga-ex14.tar.xz |
Bring "ex" version up to date with 0.99.18ex14
Release: 0.99.18ex14
Also fixes issue with unknown attributes -- does not release them prematurely.
Contains the "bgpd: New show commands for improved view and address family support", which is post 0.99.18. (But not RFC 5082 GTSM.)
Diffstat (limited to 'bgpd/bgpd.h')
-rw-r--r-- | bgpd/bgpd.h | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index ee8efa1b..f6e12fb4 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -28,6 +28,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA #include "bgpd/bgp_peer.h" #include "plist.h" +#include "qtime.h" /* For union sockunion. */ #include "sockunion.h" @@ -401,6 +402,9 @@ enum bgp_clear_type #define BGP_ERR_PEER_EXISTS -30 #define BGP_ERR_MAX -31 +/*------------------------------------------------------------------------------ + * Globals. + */ extern struct bgp_master *bm; extern struct thread_master *master; @@ -409,7 +413,46 @@ extern qpn_nexus cli_nexus; extern qpn_nexus bgp_nexus; extern qpn_nexus routing_nexus; -/* Prototypes. */ +/*------------------------------------------------------------------------------ + * For many purposes BGP requires a CLOCK_MONOTONIC type time, in seconds. + */ +Inline time_t +bgp_clock(void) +{ + return qt_get_mono_secs() ; +} + +/*------------------------------------------------------------------------------ + * For some purposes BGP requires a Wall Clock version of a time returned by + * bgp_clock() above. + * + * This is calculated from the current Wall Clock, the current bgp_clock and + * the bgp_clock time of some moment in the past. + * + * The fundamental problem is that the Wall Clock *may* (just may) be altered + * by the operator or automatically, if the system clock is wrong. So there + * are, potentially, two versions of a past moment: + * + * 1) according to the Wall Clock at the time. + * + * 2) according to the Wall Clock now. + * + * There doesn't seem to be a good way of selecting between these if they are + * different... Here we take (2), which (a) doesn't require us to fetch and + * store both bgp_clock() and Wall Clock times every time we record the time + * of some event, and (b) assumes that if the Wall Clock has been adjusted, + * it was wrong before. This can still cause confusion, because the Wall + * Clock time calculated now may differ from any logged Wall Clock times !! + */ +Inline time_t +bgp_wall_clock(time_t bgp_time) +{ + return time(NULL) + (bgp_time - bgp_clock()) ; +} ; + +/*------------------------------------------------------------------------------ + * Prototypes. + */ extern void bgp_terminate (int, int); extern void bgp_reset (void); |