diff options
| author | Pascal Mathis <mail@pascalmathis.com> | 2018-06-13 02:34:43 +0200 | 
|---|---|---|
| committer | Pascal Mathis <mail@pascalmathis.com> | 2018-06-14 18:55:30 +0200 | 
| commit | b90a8e13eea49404d72dd0cdf94343d8a1831d69 (patch) | |
| tree | 43e7622848ad0e82fe3a7c0b50791e7e8b7fa393 /bgpd/bgp_snmp.c | |
| parent | 598a3d428806fe3b48089952d703027548cf3405 (diff) | |
bgpd: Implement group-overrides for peer timers
This commit implements BGP peer-group overrides for the timer flags,
which control the value of the hold, keepalive, advertisement-interval
and connect connect timers. It was kept separated on purpose as the
whole timer implementation is quite complex and merging this commit
together with with the other flag implementations did not seem right.
Basically three new peer flags were introduced, namely
*PEER_FLAG_ROUTEADV*, *PEER_FLAG_TIMER* and *PEER_FLAG_TIMER_CONNECT*.
The overrides work exactly the same way as they did before, but
introducing these flags made a few conditionals simpler as they no
longer had to compare internal data structures against eachother.
Last but not least, the test suite has been adjusted accordingly to test
the newly implemented flag overrides.
Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
Diffstat (limited to 'bgpd/bgp_snmp.c')
| -rw-r--r-- | bgpd/bgp_snmp.c | 10 | 
1 files changed, 5 insertions, 5 deletions
diff --git a/bgpd/bgp_snmp.c b/bgpd/bgp_snmp.c index 241b23a62d..0700e0ac24 100644 --- a/bgpd/bgp_snmp.c +++ b/bgpd/bgp_snmp.c @@ -487,17 +487,17 @@ static int write_bgpPeerTable(int action, uint8_t *var_val,  			return SNMP_ERR_NOSUCHNAME;  		break;  	case BGPPEERCONNECTRETRYINTERVAL: -		SET_FLAG(peer->config, PEER_CONFIG_CONNECT); +		peer_flag_set(peer, PEER_FLAG_TIMER_CONNECT);  		peer->connect = intval;  		peer->v_connect = intval;  		break;  	case BGPPEERHOLDTIMECONFIGURED: -		SET_FLAG(peer->config, PEER_CONFIG_TIMER); +		peer_flag_set(peer, PEER_FLAG_TIMER);  		peer->holdtime = intval;  		peer->v_holdtime = intval;  		break;  	case BGPPEERKEEPALIVECONFIGURED: -		SET_FLAG(peer->config, PEER_CONFIG_TIMER); +		peer_flag_set(peer, PEER_FLAG_TIMER);  		peer->keepalive = intval;  		peer->v_keepalive = intval;  		break; @@ -617,14 +617,14 @@ static uint8_t *bgpPeerTable(struct variable *v, oid name[], size_t *length,  		break;  	case BGPPEERHOLDTIMECONFIGURED:  		*write_method = write_bgpPeerTable; -		if (PEER_OR_GROUP_TIMER_SET(peer)) +		if (CHECK_FLAG(peer->flags, PEER_FLAG_TIMER))  			return SNMP_INTEGER(peer->holdtime);  		else  			return SNMP_INTEGER(peer->v_holdtime);  		break;  	case BGPPEERKEEPALIVECONFIGURED:  		*write_method = write_bgpPeerTable; -		if (PEER_OR_GROUP_TIMER_SET(peer)) +		if (CHECK_FLAG(peer->flags, PEER_FLAG_TIMER))  			return SNMP_INTEGER(peer->keepalive);  		else  			return SNMP_INTEGER(peer->v_keepalive);  | 
