diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2004-01-06 18:01:28 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2004-01-06 18:01:28 +0000 |
commit | ab887c8281f080ebfe9a32f82732ee386c0f6869 (patch) | |
tree | 92da1d4a585bcf10c88b99166b8236f3c312cdfe | |
parent | 401fa3b54b2101e3c2f24105fd68e172efc83eeb (diff) |
rename our StartTimer to IdleHoldTimer as per draft-ietf-idr-bgp4-23
-rw-r--r-- | usr.sbin/bgpd/session.c | 27 | ||||
-rw-r--r-- | usr.sbin/bgpd/session.h | 8 |
2 files changed, 17 insertions, 18 deletions
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c index ca62016d702..44794b4c0ba 100644 --- a/usr.sbin/bgpd/session.c +++ b/usr.sbin/bgpd/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.66 2004/01/06 03:43:50 henning Exp $ */ +/* $OpenBSD: session.c,v 1.67 2004/01/06 18:01:26 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -213,7 +213,7 @@ session_main(struct bgpd_config *config, struct peer *cpeers, int pipe_m2s[2], /* reinit due? */ if (p->conf.reconf_action == RECONF_REINIT) { bgp_fsm(p, EVNT_STOP); - p->StartTimer = time(NULL); + p->IdleHoldTimer = time(NULL); } /* deletion due? */ @@ -238,7 +238,7 @@ session_main(struct bgpd_config *config, struct peer *cpeers, int pipe_m2s[2], bgp_fsm(p, EVNT_TIMER_CONNRETRY); if (timer_due(p->KeepaliveTimer)) bgp_fsm(p, EVNT_TIMER_KEEPALIVE); - if (timer_due(p->StartTimer)) + if (timer_due(p->IdleHoldTimer)) bgp_fsm(p, EVNT_START); /* set nextaction to the first expiring timer */ @@ -249,8 +249,8 @@ session_main(struct bgpd_config *config, struct peer *cpeers, int pipe_m2s[2], nextaction = p->HoldTimer; if (p->KeepaliveTimer && p->KeepaliveTimer < nextaction) nextaction = p->KeepaliveTimer; - if (p->StartTimer && p->StartTimer < nextaction) - nextaction = p->StartTimer; + if (p->IdleHoldTimer && p->IdleHoldTimer < nextaction) + nextaction = p->IdleHoldTimer; /* are we waiting for a write? */ if (p->wbuf.queued > 0) @@ -337,7 +337,7 @@ init_peers(void) for (p = peers; p != NULL; p = p->next) { if (p->state == STATE_NONE) { change_state(p, STATE_IDLE, EVNT_NONE); - p->StartTimer = time(NULL); /* start ASAP */ + p->IdleHoldTimer = time(NULL); /* start ASAP */ } } } @@ -355,7 +355,7 @@ bgp_fsm(struct peer *peer, enum session_events event) peer->HoldTimer = 0; peer->KeepaliveTimer = 0; peer->events = 0; - peer->StartTimer = 0; + peer->IdleHoldTimer = 0; /* allocate read buffer */ peer->rbuf = calloc(1, sizeof(struct buf_read)); @@ -619,8 +619,8 @@ change_state(struct peer *peer, enum session_state state, * starttimerinterval needs to be exponentially increased */ peer->events = 0; - if (peer->StartTimerInterval == 0) - peer->StartTimerInterval = INTERVAL_START; + if (peer->IdleHoldTime == 0) + peer->IdleHoldTime = INTERVAL_IDLE_HOLD_INITIAL; peer->holdtime = INTERVAL_HOLD_INITIAL; peer->ConnectRetryTimer = 0; peer->KeepaliveTimer = 0; @@ -632,10 +632,9 @@ change_state(struct peer *peer, enum session_state state, if (peer->state == STATE_ESTABLISHED) session_down(peer); if (event != EVNT_STOP) { - peer->StartTimer = time(NULL) + - peer->StartTimerInterval; - if (peer->StartTimerInterval < UINT_MAX / 2) - peer->StartTimerInterval *= 2; + peer->IdleHoldTimer = time(NULL) + peer->IdleHoldTime; + if (peer->IdleHoldTime < UINT_MAX / 2) + peer->IdleHoldTime *= 2; } break; case STATE_CONNECT: @@ -652,7 +651,7 @@ change_state(struct peer *peer, enum session_state state, break; case STATE_ESTABLISHED: peer->events = POLLIN; - peer->StartTimerInterval = INTERVAL_START; + peer->IdleHoldTime = INTERVAL_IDLE_HOLD_INITIAL; session_up(peer); break; default: /* something seriously fucked */ diff --git a/usr.sbin/bgpd/session.h b/usr.sbin/bgpd/session.h index 2eefc4c6c60..4e0200eab55 100644 --- a/usr.sbin/bgpd/session.h +++ b/usr.sbin/bgpd/session.h @@ -1,4 +1,4 @@ -/* $OpenBSD: session.h,v 1.12 2004/01/06 03:43:51 henning Exp $ */ +/* $OpenBSD: session.h,v 1.13 2004/01/06 18:01:27 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -23,7 +23,7 @@ #define INTERVAL_CONNECTRETRY 120 #define INTERVAL_HOLD_INITIAL 240 #define INTERVAL_HOLD 90 -#define INTERVAL_START 90 +#define INTERVAL_IDLE_HOLD_INITIAL 90 #define MSGSIZE_HEADER 19 #define MSGSIZE_HEADER_MARKER 16 #define MSGSIZE_NOTIFICATION_MIN 21 /* 19 hdr + 1 code + 1 sub */ @@ -138,8 +138,8 @@ struct peer { time_t ConnectRetryTimer; time_t KeepaliveTimer; time_t HoldTimer; - time_t StartTimer; - u_int StartTimerInterval; + time_t IdleHoldTimer; + u_int IdleHoldTime; int sock; int events; struct msgbuf wbuf; |