A class for performing SNMP V2 BGP queries

see \OSS_SNMP\MIBS\http://tools.cisco.com/Support/SNMP/do/BrowseOID.do?local=en&translate=Translate&objectInput=1.3.6.1.2.1.15
copyright Copyright (c) 2012, Open Source Solutions Limited, Dublin, Ireland
author Barry O'Donovan

 Methods

Returns the local BGP identifier

identifier() : string

"The BGP Identifier of local system."

Returns

stringThe BGP Identifier of local system.

Returns the local BGP AS number

localASN() : int

"The local autonomous system number."

Returns

intThe local autonomous system number.

Returns the BGP peer admin states (see `self::$BGP_PEER_ADMIN_STATES`)

peerAdminStates(bool $translate) : array

"The desired state of the BGP connection. A transition from 'stop' to 'start' will cause the BGP Start Event to be generated. A transition from 'start' to 'stop' will cause the BGP Stop Event to be generated. This parameter can be used to restart BGP peer connections. Care should be used in providing write access to this object without adequate authentication."

Parameters

$translate

bool

If true, use the $BGP_PEER_ADMIN_STATES array to return textual representation

Returns

arrayThe BGP peer admin states (see `self::$BGP_PEER_ADMIN_STATES`)

Returns Time interval in seconds for the ConnectRetry timer.

peerConnectRetryIntervals() : array

"Time interval in seconds for the ConnectRetry timer. The suggested value for this timer is 120 seconds."

Returns

arrayTime interval in seconds for the ConnectRetry timer.

Returns the BGP peer connection state (see `self::$BGP_PEER_CONNECTION_STATES`)

peerConnectionStates(bool $translate) : array

"The BGP peer connection state."

Parameters

$translate

bool

If true, use the $BGP_PEER_CONNECTION_STATES array to return textual representation

Returns

arrayThe BGP peer connection state (see `self::$BGP_PEER_CONNECTION_STATES`)

Utility function to gather all peer information into a single array.

peerDetails(bool $translate) : array

For example, this would return something like:

Array
(
    ....
    [192.0.2.126] => Array
    (
        [identity] => 192.0.2.45
        [connectionState] => established
        [adminState] => start
        [negotiatedVersion] => 4
        [localAddress] => 193.242.111.74
        [localPort] => 26789
        [remoteAddress] => 192.0.2.126
        [remotePort] => 179
        [remoteASN] => 65505
        [inUpdates] => 4
        [outUpdates] => 2
        [inTotalMessages] => 180988
        [outTotalMessages] => 181012
        [lastError] => 0000
        [establishedTransitions] => 1
        [establishedTime] => 9867469
        [connectRetryInterval] => 60
        [holdTime] => 180
        [keepAlive] => 60
        [holdTimeConfigured] => 180
        [keepAliveConfigured] => 60
        [minASOriginationInterval] => 30
        [minRouteAdvertisementInterval] => 30
        [inUpdateElapsedTime] => 0
    )
    ....
)

Parameters

$translate

bool

Where a called function supports translation, if true then translate

Returns

arrayArray of peer details - see example above.

Returns The total number of times the BGP FSM transitioned into the established state.

peerEstabledTransitions() : array

"The total number of times the BGP FSM transitioned into the established state."

Returns

arrayThe total number of times the BGP FSM transitioned into the established state.

Returns how long (in seconds) this peer has been in the Established state or how long since this peer was last in the Established state

peerEstablishedTimes() : array

"This timer indicates how long (in seconds) this peer has been in the Established state or how long since this peer was last in the Established state. It is set to zero when a new peer is configured or the router is booted"

Returns

arrayHow long (secs) this peer has been in (or since it was last in) the Established state

Returns Time interval in seconds for the Hold Timer established with the peer.

peerHoldTimes() : array

"Time interval in seconds for the Hold Timer established with the peer. The value of this object is calculated by this BGP speaker by using the smaller of the value in bgpPeerHoldTimeConfigured and the Hold Time received in the OPEN message. This value must be at lease three seconds if it is not zero (0) in which case the Hold Timer has not been established with the peer, or, the value of bgpPeerHoldTimeConfigured is zero (0)."

Returns

arrayTime interval in seconds for the Hold Timer established with the peer.

Returns Time interval in seconds for the Hold Time configured for this BGP speaker with this peer.

peerHoleTimesConfigured() : array

"Time interval in seconds for the Hold Time configured for this BGP speaker with this peer. This value is placed in an OPEN message sent to this peer by this BGP speaker, and is compared with the Hold Time field in an OPEN message received from the peer when determining the Hold Time (bgpPeerHoldTime) with the peer. This value must not be less than three seconds if it is not zero (0) in which case the Hold Time is NOT to be established with the peer. The suggested value for this timer is 90 seconds."

Returns

arrayTime interval in seconds for the Hold Time configured for this BGP speaker with this peer.

Returns the BGP identifier of all peers indexed by neighbour IPv4 address

peerIdentifiers() : array

"The BGP Identifier of this entry's BGP peer."

Returns

arrayReturns the BGP identifier of all peers indexed by neighbour IPv4 address

Returns The total number of messages received from the remote peer on this connection.

peerInTotalMessages() : array

"The total number of messages received from the remote peer on this connection. This object should be initialized to zero when the connection is established."

Returns

arrayThe total number of messages received from the remote peer on this connection.

Returns Elapsed time in seconds since the last BGP UPDATE message was received from the peer.

peerInUpdateElapsedTimes() : array

"Elapsed time in seconds since the last BGP UPDATE message was received from the peer. Each time bgpPeerInUpdates is incremented, the value of this object is set to zero (0)."

Returns

arrayElapsed time in seconds since the last BGP UPDATE message was received from the peer.

Returns The number of BGP UPDATE messages received on this connection.

peerInUpdates() : array

"The number of BGP UPDATE messages received on this connection. This object should be initialized to zero (0) when the connection is established."

Returns

arrayThe number of BGP UPDATE messages received on this connection.

Returns Time interval in seconds for the KeepAlive timer established with the peer.

peerKeepAlives() : array

"Time interval in seconds for the KeepAlive timer established with the peer. The value of this object is calculated by this BGP speaker such that, when compared with bgpPeerHoldTime, it has the same proportion as what bgpPeerKeepAliveConfigured has when compared with bgpPeerHoldTimeConfigured. If the value of this object is zero (0), it indicates that the KeepAlive timer has not been established with the peer, or, the value of bgpPeerKeepAliveConfigured is zero (0)."

Returns

arrayTime interval in seconds for the KeepAlive timer established with the peer.

Returns Time interval in seconds for the KeepAlive timer configured for this BGP speaker with this peer.

peerKeepAlivesConfigured() : array

"Time interval in seconds for the KeepAlive timer configured for this BGP speaker with this peer. The value of this object will only determine the KEEPALIVE messages' frequency relative to the value specified in bgpPeerHoldTimeConfigured; the actual time interval for the KEEPALIVE messages is indicated by bgpPeerKeepAlive. A reasonable maximum value for this timer would be configured to be one third of that of bgpPeerHoldTimeConfigured. If the value of this object is zero (0), no periodical KEEPALIVE messages are sent to the peer after the BGP connection has been established. The suggested value for this timer is 30 seconds"

Returns

arrayTime interval in seconds for the KeepAlive timer configured for this BGP speaker with this peer.

Returns The last error code and subcode seen by this peer on this connection.

peerLastErrors() : array

"The last error code and subcode seen by this peer on this connection. If no error has occurred, this field is zero. Otherwise, the first byte of this two byte OCTET STRING contains the error code, and the second byte contains the subcode."

Returns

arrayThe last error code and subcode seen by this peer on this connection.

Returns the local IP address of this entry's BGP connection.

peerLocalAddresses() : array

"The local IP address of this entry's BGP connection."

Returns

arrayThe local IP address of this entry's BGP connection.

Returns the local ports for the TCP connections between the BGP peers.

peerLocalPorts() : array

"The local port for the TCP connection between the BGP peers."

Returns

arrayThe local ports for the TCP connections between the BGP peers.

Returns Time interval in seconds for the MinASOriginationInterval timer.

peerMinASOriginationIntervals() : array

"Time interval in seconds for the MinASOriginationInterval timer. The suggested value for this timer is 15 seconds."

Returns

arrayTime interval in seconds for the MinASOriginationInterval timer.

Returns Time interval in seconds for the MinRouteAdvertisementInterval timer.

peerMinRouteAdvertisementIntervals() : array

"Time interval in seconds for the MinRouteAdvertisementInterval timer. The suggested value for this timer is 30 seconds"

Returns

arrayTime interval in seconds for the MinRouteAdvertisementInterval timer.

Returns the negotiated version of BGP running between the two peers

peerNegotiatedVersions() : array

"The negotiated version of BGP running between the two peers"

Returns

arrayThe negotiated version of BGP running between the two peers

Returns The total number of messages transmitted to the remote peer on this connection.

peerOutTotalMessages() : array

"The total number of messages transmitted to the remote peer on this connection. This object should be initialized to zero when the connection is established."

Returns

arrayThe total number of messages transmitted to the remote peer on this connection.

Returns The number of BGP UPDATE messages transmitted on this connection.

peerOutUpdates() : array

"The number of BGP UPDATE messages transmitted on this connection. This object should be initialized to zero (0) when the connection is established."

Returns

arrayThe number of BGP UPDATE messages transmitted on this connection.

Returns The remote autonomous system number.

peerRemoteASNs() : array

"The remote autonomous system number."

Returns

arrayThe remote autonomous system number.

Returns the local IP address of this entry's BGP peer.

peerRemoteAddresses() : array

"The remote IP address of this entry's BGP peer."

Returns

arrayThe remote IP address of this entry's BGP peer.

Returns the remote ports for the TCP connections between the BGP peers.

peerRemotePorts() : array

"The remote port for the TCP connection between the BGP peers."

Returns

arrayThe remote ports for the TCP connections between the BGP peers.

Returns the BGP version

version() : string

"Vector of supported BGP protocol version numbers. Each peer negotiates the version from this vector. Versions are identified via the string of bits contained within this object. The first octet contains bits 0 to 7, the second octet contains bits 8 to 15, and so on, with the most significant bit referring to the lowest bit number in the octet (e.g., the MSB of the first octet refers to bit 0). If a bit, i, is present and set, then the version (i+1) of the BGP is supported."

Returns

stringReturns the BGP version

 Properties

 

$BGP_PEER_ADMIN_STATES

$BGP_PEER_ADMIN_STATES 

 

$BGP_PEER_CONNECTION_STATES

$BGP_PEER_CONNECTION_STATES 

 Constants

 

BGP_PEER_ADMIN_STATE_START

BGP_PEER_ADMIN_STATE_START 

 

BGP_PEER_ADMIN_STATE_STOP

BGP_PEER_ADMIN_STATE_STOP 

 

BGP_PEER_CONNECTION_STATE_ACTIVE

BGP_PEER_CONNECTION_STATE_ACTIVE 

 

BGP_PEER_CONNECTION_STATE_CONNECT

BGP_PEER_CONNECTION_STATE_CONNECT 

 

BGP_PEER_CONNECTION_STATE_ESTABLISHED

BGP_PEER_CONNECTION_STATE_ESTABLISHED 

 

BGP_PEER_CONNECTION_STATE_IDLE

BGP_PEER_CONNECTION_STATE_IDLE 

 

BGP_PEER_CONNECTION_STATE_OPENCONFIRM

BGP_PEER_CONNECTION_STATE_OPENCONFIRM 

 

BGP_PEER_CONNECTION_STATE_OPENSENT

BGP_PEER_CONNECTION_STATE_OPENSENT 

 

OID_BGP_IDENTIFIER

OID_BGP_IDENTIFIER 

 

OID_BGP_LOCAL_ASN

OID_BGP_LOCAL_ASN 

 

OID_BGP_PATH_ATTR_ADDR_PREFIX

OID_BGP_PATH_ATTR_ADDR_PREFIX 

 

OID_BGP_PATH_ATTR_ADDR_PREFIX_LENGTH

OID_BGP_PATH_ATTR_ADDR_PREFIX_LENGTH 

 

OID_BGP_PATH_ATTR_AGGREGATOR_ADDR

OID_BGP_PATH_ATTR_AGGREGATOR_ADDR 

 

OID_BGP_PATH_ATTR_AGGREGATOR_AS

OID_BGP_PATH_ATTR_AGGREGATOR_AS 

 

OID_BGP_PATH_ATTR_AS_PATH_SEGMENT

OID_BGP_PATH_ATTR_AS_PATH_SEGMENT 

 

OID_BGP_PATH_ATTR_ATOMIC_AGGREGATE

OID_BGP_PATH_ATTR_ATOMIC_AGGREGATE 

 

OID_BGP_PATH_ATTR_BEST

OID_BGP_PATH_ATTR_BEST 

 

OID_BGP_PATH_ATTR_CALC_LOCAL_PREF

OID_BGP_PATH_ATTR_CALC_LOCAL_PREF 

 

OID_BGP_PATH_ATTR_LOCAL_PREF

OID_BGP_PATH_ATTR_LOCAL_PREF 

 

OID_BGP_PATH_ATTR_MED

OID_BGP_PATH_ATTR_MED 

 

OID_BGP_PATH_ATTR_NEXT_HOP

OID_BGP_PATH_ATTR_NEXT_HOP 

 

OID_BGP_PATH_ATTR_ORIGIN

OID_BGP_PATH_ATTR_ORIGIN 

 

OID_BGP_PATH_ATTR_PEER

OID_BGP_PATH_ATTR_PEER 

 

OID_BGP_PATH_ATTR_UNKNOWN

OID_BGP_PATH_ATTR_UNKNOWN 

 

OID_BGP_PEER_ADMIN_STATE

OID_BGP_PEER_ADMIN_STATE 

 

OID_BGP_PEER_CONNECTION_STATE

OID_BGP_PEER_CONNECTION_STATE 

 

OID_BGP_PEER_CONNECT_RETRY_INTERVAL

OID_BGP_PEER_CONNECT_RETRY_INTERVAL 

 

OID_BGP_PEER_FSM_ESTABLISHED_TIME

OID_BGP_PEER_FSM_ESTABLISHED_TIME 

 

OID_BGP_PEER_FSM_ESTABLISHED_TRANSITIONS

OID_BGP_PEER_FSM_ESTABLISHED_TRANSITIONS 

 

OID_BGP_PEER_HOLD_TIME

OID_BGP_PEER_HOLD_TIME 

 

OID_BGP_PEER_HOLD_TIME_CONFIGURED

OID_BGP_PEER_HOLD_TIME_CONFIGURED 

 

OID_BGP_PEER_IDENTIFIER

OID_BGP_PEER_IDENTIFIER 

 

OID_BGP_PEER_IN_TOTAL_MESSAGES

OID_BGP_PEER_IN_TOTAL_MESSAGES 

 

OID_BGP_PEER_IN_UPDATES

OID_BGP_PEER_IN_UPDATES 

 

OID_BGP_PEER_IN_UPDATE_ELAPSED_TIME

OID_BGP_PEER_IN_UPDATE_ELAPSED_TIME 

 

OID_BGP_PEER_KEEP_ALIVE

OID_BGP_PEER_KEEP_ALIVE 

 

OID_BGP_PEER_KEEP_ALIVE_CONFIGURED

OID_BGP_PEER_KEEP_ALIVE_CONFIGURED 

 

OID_BGP_PEER_LAST_ERROR

OID_BGP_PEER_LAST_ERROR 

 

OID_BGP_PEER_LOCAL_ADDRESS

OID_BGP_PEER_LOCAL_ADDRESS 

 

OID_BGP_PEER_LOCAL_PORT

OID_BGP_PEER_LOCAL_PORT 

 

OID_BGP_PEER_MIN_AS_ORIGINATION_INTERVAL

OID_BGP_PEER_MIN_AS_ORIGINATION_INTERVAL 

 

OID_BGP_PEER_MIN_ROUTE_ADVERTISEMENT_INTERVAL

OID_BGP_PEER_MIN_ROUTE_ADVERTISEMENT_INTERVAL 

 

OID_BGP_PEER_NEGOTIATED_VERSION

OID_BGP_PEER_NEGOTIATED_VERSION 

 

OID_BGP_PEER_OUT_TOTAL_MESSAGES

OID_BGP_PEER_OUT_TOTAL_MESSAGES 

 

OID_BGP_PEER_OUT_UPDATES

OID_BGP_PEER_OUT_UPDATES 

 

OID_BGP_PEER_REMOTE_ADDR

OID_BGP_PEER_REMOTE_ADDR 

 

OID_BGP_PEER_REMOTE_ASN

OID_BGP_PEER_REMOTE_ASN 

 

OID_BGP_PEER_REMOTE_PORT

OID_BGP_PEER_REMOTE_PORT 

 

OID_BGP_VERSION

OID_BGP_VERSION