BGP4V2-MIB DEFINITIONS ::= BEGIN

    IMPORTS

        MODULE-IDENTITY, OBJECT-TYPE, NOTIFICATION-TYPE,
        mib-2, Counter32, Gauge32, Unsigned32
            FROM SNMPv2-SMI
        InetAddressType, InetAddress, InetPortNumber,
        InetAutonomousSystemNumber, InetAddressPrefixLength
            FROM INET-ADDRESS-MIB
        TruthValue, RowPointer, TimeStamp
            FROM SNMPv2-TC
        MODULE-COMPLIANCE, OBJECT-GROUP, NOTIFICATION-GROUP
            FROM SNMPv2-CONF
        SnmpAdminString
            FROM SNMP-FRAMEWORK-MIB
        Bgp4V2IdentifierTC, Bgp4V2AddressFamilyIdentifierTC,
        Bgp4V2SubsequentAddressFamilyIdentifierTC
            FROM BGP4V2-TC-MIB
	  bgp4V2Root
		FROM FOUNDRY-SN-ROOT-MIB;
        bgp4V2 MODULE-IDENTITY
            LAST-UPDATED "201101170000Z"
            ORGANIZATION "IETF IDR Working Group"
            CONTACT-INFO "E-mail:  idr@ietf.org"

            DESCRIPTION
                    "The MIB module for the BGP-4 protocol.

                     Copyright (C) The IETF Trust (2011).  This
                     version of this MIB module is part of RFC XXX;
                     see the RFC itself for full legal notices."
-- RFC Editor - replace XXX with RFC number

            REVISION "201101170000Z"
            DESCRIPTION
                   "This MIB updates and replaces the BGP MIB defined in
                    RFC 4273."
            ::= { bgp4V2Root      1 }


-- Notifications
    bgp4V2Notifications OBJECT IDENTIFIER ::= { bgp4V2 0 }

    -- Objects

    bgp4V2Objects OBJECT IDENTIFIER ::= { bgp4V2 1 }

 --
    -- Per-peer session management information.
    --

    bgp4V2PeerTable OBJECT-TYPE
        SYNTAX     SEQUENCE OF Bgp4V2PeerEntry
        MAX-ACCESS not-accessible
        STATUS     current
        DESCRIPTION
            "BGP peer table.  This table contains, one entry per BGP
             peer, information about the connections with BGP peers."
        ::= { bgp4V2Objects 2 }

    bgp4V2PeerEntry OBJECT-TYPE
        SYNTAX     Bgp4V2PeerEntry
        MAX-ACCESS not-accessible
        STATUS     current
        DESCRIPTION
            "Entry containing information about the connection with
             a remote BGP peer."
        INDEX {
            bgp4V2PeerInstance,
            bgp4V2PeerRemoteAddrType,
            bgp4V2PeerRemoteAddr
        }
        ::= { bgp4V2PeerTable 1 }

    Bgp4V2PeerEntry ::= SEQUENCE {
        -- INDEX information
        bgp4V2PeerInstance
            Unsigned32,
        bgp4V2PeerLocalAddrType
            InetAddressType,
        bgp4V2PeerLocalAddr
            InetAddress,
        bgp4V2PeerRemoteAddrType
            InetAddressType,
        bgp4V2PeerRemoteAddr
            InetAddress,

        -- Local
        bgp4V2PeerLocalPort
            InetPortNumber,
        bgp4V2PeerLocalAs
            InetAutonomousSystemNumber,
        bgp4V2PeerLocalIdentifier
            Bgp4V2IdentifierTC,

        -- Remote
        bgp4V2PeerRemotePort
            InetPortNumber,
        bgp4V2PeerRemoteAs
            InetAutonomousSystemNumber,
        bgp4V2PeerRemoteIdentifier
            Bgp4V2IdentifierTC,

        -- Session status
        bgp4V2PeerAdminStatus
            INTEGER,
        bgp4V2PeerState
            INTEGER,
        bgp4V2PeerDescription
            SnmpAdminString
    }

    bgp4V2PeerInstance OBJECT-TYPE
        SYNTAX     Unsigned32 (1..4294967295)
        MAX-ACCESS not-accessible
        STATUS     current
        DESCRIPTION
            "The routing instance index.

             Some BGP implementations permit the creation of
             multiple instances of a BGP routing process. An
             example includes routers running BGP/MPLS IP Virtual
             Private Networks.

             Implementations that do not support multiple
             routing instances should return 1 for this object."
        ::= { bgp4V2PeerEntry 1 }

    bgp4V2PeerLocalAddrType OBJECT-TYPE
        SYNTAX     InetAddressType
        MAX-ACCESS not-accessible
        STATUS     current
        DESCRIPTION
            "The address family of the local end of the peering
             session."
        ::= { bgp4V2PeerEntry 2 }

    bgp4V2PeerLocalAddr OBJECT-TYPE
        SYNTAX     InetAddress
        MAX-ACCESS not-accessible
        STATUS     current
        DESCRIPTION
            "The local IP address of this entry's BGP connection."
        ::= { bgp4V2PeerEntry 3 }

    bgp4V2PeerRemoteAddrType OBJECT-TYPE
        SYNTAX     InetAddressType
        MAX-ACCESS not-accessible
        STATUS     current
        DESCRIPTION
            "The address family of the remote end of the peering
             session."
        ::= { bgp4V2PeerEntry 4 }

    bgp4V2PeerRemoteAddr OBJECT-TYPE
        SYNTAX     InetAddress
        MAX-ACCESS not-accessible
        STATUS     current
        DESCRIPTION
            "The remote IP address of this entry's BGP peer."
        ::= { bgp4V2PeerEntry 5 }

    bgp4V2PeerLocalPort OBJECT-TYPE
        SYNTAX     InetPortNumber
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "The local port for the TCP connection between the BGP
             peers."
        ::= { bgp4V2PeerEntry 6 }

    bgp4V2PeerLocalAs OBJECT-TYPE
        SYNTAX     InetAutonomousSystemNumber
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "Some implementations of BGP can represent themselves
             as multiple ASes. This is the AS that this peering
             session is representing itself as to the remote peer."
        ::= { bgp4V2PeerEntry 7 }

    bgp4V2PeerLocalIdentifier OBJECT-TYPE
        SYNTAX     Bgp4V2IdentifierTC
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "The BGP Identifier of the local system for this peering
             session.  It is REQUIRED that all bgp4V2PeerLocalIdentifier
             values for the same bgp4V2PeerInstance be identical."
        REFERENCE
            "RFC 4271, Section 4.2, 'BGP Identifier'."
        ::= { bgp4V2PeerEntry 8 }

    bgp4V2PeerRemotePort OBJECT-TYPE
        SYNTAX     InetPortNumber
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "The remote port for the TCP connection between the BGP
             peers.

             Note that the objects bgp4V2PeerLocalAddr,
             bgp4V2PeerLocalPort, bgp4V2PeerRemoteAddr and
             bgp4V2PeerRemotePort provide the appropriate reference to
             the standard MIB TCP connection table, or even the ipv6
             TCP MIB as in RFC 4022."
        REFERENCE
            "RFC 2012 - SNMPv2 Management Information Base for the
             Transmission Control Protocol using SMIv2.
             RFC 4022 - IP Version 6 Management Information Base
             for the Transmission Control Protocol."
        ::= { bgp4V2PeerEntry 9 }

    bgp4V2PeerRemoteAs OBJECT-TYPE
        SYNTAX     InetAutonomousSystemNumber
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "The remote autonomous system number received in the BGP
             OPEN message."
        REFERENCE
            "RFC 4271, Section 4.2."
        ::= { bgp4V2PeerEntry 10 }

    bgp4V2PeerRemoteIdentifier OBJECT-TYPE
        SYNTAX     Bgp4V2IdentifierTC
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "The BGP Identifier of this entry's remote BGP peer.

             This entry should be 0.0.0.0 unless the
             bgp4V2PeerState is in the openconfirm or the
             established state."
        REFERENCE
            "RFC 4271, Section 4.2, 'BGP Identifier'."
        ::= { bgp4V2PeerEntry 11 }

    bgp4V2PeerAdminStatus OBJECT-TYPE
        SYNTAX     INTEGER {
            halted(1),
            running(2)
        }
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "Whether or not the BGP FSM for this remote peer is
             halted or running. The BGP FSM for a remote peer is
             halted after processing a Stop event. Likewise, it is
             in the running state after a Start event.

             The bgp4V2PeerState will generally be in the idle state
             when the FSM is halted, although some extensions such
             as Graceful Restart will leave the peer in the Idle
             state but with the FSM running."
        REFERENCE
            "RFC 4271, Section 8.1.2."
        ::= { bgp4V2PeerEntry 12 }

    bgp4V2PeerState OBJECT-TYPE
        SYNTAX     INTEGER {
            idle(1),
            connect(2),
            active(3),
            opensent(4),
            openconfirm(5),
            established(6)
        }
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "The BGP peer connection state."
        REFERENCE
            "RFC 4271, Section 8.2.2."
        ::= { bgp4V2PeerEntry 13 }


    bgp4V2PeerDescription OBJECT-TYPE
        SYNTAX     SnmpAdminString
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "A user configured description identifying this peer.  When
             this object is not the empty string, this object SHOULD
             contain a description that is unique within a given BGP
             instance for this peer."
        ::= { bgp4V2PeerEntry 14 }

    --
    -- Per-peer error management information.
    --

    bgp4V2PeerErrorsTable OBJECT-TYPE
        SYNTAX     SEQUENCE OF Bgp4V2PeerErrorsEntry
	   MAX-ACCESS not-accessible
        STATUS     current
        DESCRIPTION
            "On a per-peer basis, this table reflects the last
             protocol-defined error encountered and reported on
             the peer session."
        ::= { bgp4V2Objects 3 }

    bgp4V2PeerErrorsEntry OBJECT-TYPE
        SYNTAX     Bgp4V2PeerErrorsEntry
        MAX-ACCESS not-accessible
        STATUS     current
        DESCRIPTION
            "Each entry contains information about errors sent
             and received for a particular BGP peer."
        AUGMENTS {
            bgp4V2PeerEntry
        }
        ::= { bgp4V2PeerErrorsTable 1 }

    Bgp4V2PeerErrorsEntry ::= SEQUENCE {
        bgp4V2PeerLastErrorCodeReceived
            Unsigned32,
        bgp4V2PeerLastErrorSubCodeReceived
            Unsigned32,
        bgp4V2PeerLastErrorReceivedTime
            TimeStamp,
        bgp4V2PeerLastErrorReceivedText
            SnmpAdminString,
        bgp4V2PeerLastErrorReceivedData
            OCTET STRING,
        bgp4V2PeerLastErrorCodeSent
            Unsigned32,
        bgp4V2PeerLastErrorSubCodeSent
            Unsigned32,
        bgp4V2PeerLastErrorSentTime
            TimeStamp,
        bgp4V2PeerLastErrorSentText
            SnmpAdminString,
        bgp4V2PeerLastErrorSentData
            OCTET STRING
    }

    bgp4V2PeerLastErrorCodeReceived OBJECT-TYPE
        SYNTAX     Unsigned32 (0..255)
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
		"The last error code received from this peer via
            NOTIFICATION message on this connection.  If no 			 error has occurred, this field is zero."
        REFERENCE
            "RFC 4271, Section 4.5.
             RFC 4486 optionally supported.
             RFC 3362, Section 5 optionally supported."
        ::= { bgp4V2PeerErrorsEntry 1 }

    bgp4V2PeerLastErrorSubCodeReceived OBJECT-TYPE
        SYNTAX     Unsigned32 (0..255)
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "The last subcode received from this peer via NOTIFICATION
             message on this connection.  If no error has occurred, this
             field is zero."
        REFERENCE
            "RFC 4271, Section 4.5.
             RFC 4486 optionally supported.
             RFC 3362, Section 5 optionally supported."
        ::= { bgp4V2PeerErrorsEntry 2 }

    bgp4V2PeerLastErrorReceivedTime OBJECT-TYPE
        SYNTAX     TimeStamp
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "The timestamp that the last NOTIFICATION was received from
             this peer."
        REFERENCE
            "RFC 4271, Section 4.5."
        ::= { bgp4V2PeerErrorsEntry 3 }

    bgp4V2PeerLastErrorReceivedText OBJECT-TYPE
        SYNTAX     SnmpAdminString
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "This object contains an implementation specific
             explanation of the error that was reported."
        ::= { bgp4V2PeerErrorsEntry 4 }

    bgp4V2PeerLastErrorReceivedData OBJECT-TYPE
        SYNTAX     OCTET STRING (SIZE(0..4075))
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
		"The last error code's data seen by this peer.

             Per RFC 2578, some implementations may have limitations
             dealing with OCTET STRINGS larger than 255.  Thus, this
             data may be truncated."
        REFERENCE
            "RFC 4271, Section 4.5,
             RFC 2578, Section 7.1.2,
             RFC 4486 optionally supported.
             RFC 3362, Section 5 optionally supported."
        ::= { bgp4V2PeerErrorsEntry 5 }

    bgp4V2PeerLastErrorCodeSent OBJECT-TYPE
        SYNTAX     Unsigned32 (0..255)
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "The last error code sent to this peer via NOTIFICATION
             message on this connection.  If no error has occurred, this
             field is zero."
        REFERENCE
            "RFC 4271, Section 4.5.
             RFC 4486 optionally supported.
             RFC 3362, Section 5 optionally supported."
        ::= { bgp4V2PeerErrorsEntry 6 }

    bgp4V2PeerLastErrorSubCodeSent OBJECT-TYPE
        SYNTAX     Unsigned32 (0..255)
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "The last subcode sent to this peer via NOTIFICATION
             message on this connection.  If no error has 				  occurred, this field is zero."
        REFERENCE
            "RFC 4271, Section 4.5.
             RFC 4486 optionally supported.
             RFC 3362, Section 5 optionally supported."
        ::= { bgp4V2PeerErrorsEntry 7 }

    bgp4V2PeerLastErrorSentTime OBJECT-TYPE
        SYNTAX     TimeStamp
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "The timestamp that the last NOTIFICATION was sent to
             this peer."
        REFERENCE

  "RFC 4271, Section 4.5."
        ::= { bgp4V2PeerErrorsEntry 8 }

    bgp4V2PeerLastErrorSentText OBJECT-TYPE
        SYNTAX     SnmpAdminString
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "This object contains an implementation specific
             explanation of the error that is being reported."
        ::= { bgp4V2PeerErrorsEntry 9 }

    bgp4V2PeerLastErrorSentData OBJECT-TYPE
        SYNTAX     OCTET STRING (SIZE(0..4075))
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "The last error code's data sent to this peer.

             Per RFC 2578, some implementations may have limitations
             dealing with OCTET STRINGS larger than 255.  Thus, this
             data may be truncated."
        REFERENCE
            "RFC 4271, Section 4.5,
             RFC 2578, Section 7.1.2
             RFC 4486 optionally supported.
             RFC 3362, Section 5 optionally supported."
        ::= { bgp4V2PeerErrorsEntry 10 }
 --
    -- Per-peer Event Times
    --

    bgp4V2PeerEventTimesTable OBJECT-TYPE
        SYNTAX     SEQUENCE OF Bgp4V2PeerEventTimesEntry
        MAX-ACCESS not-accessible
        STATUS     current
        DESCRIPTION
            "A table reporting the per-peering session amount
             of time elapsed and update events since the peering
             session advanced into the established state."
        ::= { bgp4V2Objects 4 }

    bgp4V2PeerEventTimesEntry OBJECT-TYPE
        SYNTAX     Bgp4V2PeerEventTimesEntry
        MAX-ACCESS not-accessible
        STATUS     current
        DESCRIPTION
            "Each row contains a set of statistics about time
             spent and events encountered in the peer session
             established state."
        AUGMENTS {
            bgp4V2PeerEntry
        }
        ::= { bgp4V2PeerEventTimesTable 1 }

    Bgp4V2PeerEventTimesEntry ::= SEQUENCE {
        bgp4V2PeerFsmEstablishedTime
            Gauge32,
        bgp4V2PeerInUpdatesElapsedTime
            Gauge32
    }

    bgp4V2PeerFsmEstablishedTime OBJECT-TYPE
        SYNTAX     Gauge32
        UNITS      "seconds"
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "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 when the router is
             booted.  If the peer has never reached the established
             state, the value remains zero."
        REFERENCE
            "RFC 4271, Section 8."
        ::= { bgp4V2PeerEventTimesEntry 1 }

    bgp4V2PeerInUpdatesElapsedTime OBJECT-TYPE
        SYNTAX     Gauge32
        UNITS      "seconds"
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "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)."
        REFERENCE
            "RFC 4271, Section 4.3.
             RFC 4271, Section 8.2.2, Established state."

        ::= { bgp4V2PeerEventTimesEntry 2 }

--
    -- BGP NLRI
    --

    bgp4V2NlriTable OBJECT-TYPE
        SYNTAX     SEQUENCE OF Bgp4V2NlriEntry
        MAX-ACCESS not-accessible
        STATUS     current
        DESCRIPTION
            "The BGP-4 Received Path Attribute Table contains
             information about paths to destination networks
             received from all BGP4 peers. Collectively, this
             represents the Adj-Ribs-In. The route where
             bgp4V2NlriBest is true represents, for this NLRI,
             the route that is installed in the LocRib from the
             Adj-Ribs-In."
        REFERENCE
            "RFC 4271, Sections 3.2 and 9."
        ::= { bgp4V2Objects 9 }

    bgp4V2NlriEntry OBJECT-TYPE
        SYNTAX     Bgp4V2NlriEntry
        MAX-ACCESS not-accessible
        STATUS     current
        DESCRIPTION
            "Information about a path to a network."
        INDEX {
            bgp4V2PeerInstance,
            bgp4V2NlriAfi,
            bgp4V2NlriSafi,
            bgp4V2NlriPrefixType,
            bgp4V2NlriPrefix,
            bgp4V2NlriPrefixLen,
            bgp4V2PeerRemoteAddrType,
            bgp4V2PeerRemoteAddr,
            bgp4V2NlriIndex
        }
        ::= { bgp4V2NlriTable 1 }

    Bgp4V2NlriEntry ::= SEQUENCE {
        bgp4V2NlriIndex
            Unsigned32,
        bgp4V2NlriAfi
            Bgp4V2AddressFamilyIdentifierTC,
        bgp4V2NlriSafi
            Bgp4V2SubsequentAddressFamilyIdentifierTC,
         bgp4V2NlriPrefixType
             InetAddressType,
        bgp4V2NlriPrefix
            InetAddress,
        bgp4V2NlriPrefixLen
            InetAddressPrefixLength,
        bgp4V2NlriBest
            TruthValue,
        bgp4V2NlriCalcLocalPref
            Unsigned32,
        bgp4V2NlriOrigin
            INTEGER,
        bgp4V2NlriNextHopAddrType
            InetAddressType,
        bgp4V2NlriNextHopAddr
            InetAddress,
        bgp4V2NlriLinkLocalNextHopAddrType
            InetAddressType,
        bgp4V2NlriLinkLocalNextHopAddr
            InetAddress,
        bgp4V2NlriLocalPrefPresent
            TruthValue,
        bgp4V2NlriLocalPref
            Unsigned32,
        bgp4V2NlriMedPresent
            TruthValue,
        bgp4V2NlriMed
            Unsigned32,
        bgp4V2NlriAtomicAggregate
            TruthValue,
        bgp4V2NlriAggregatorPresent
            TruthValue,
        bgp4V2NlriAggregatorAS
            InetAutonomousSystemNumber,
        bgp4V2NlriAggregatorAddr
            Bgp4V2IdentifierTC,
        bgp4V2NlriAsPathCalcLength
            Unsigned32,
        bgp4V2NlriAsPathString
            SnmpAdminString,
        bgp4V2NlriAsPath
            OCTET STRING,
        bgp4V2NlriPathAttrUnknown
            OCTET STRING
    }

    bgp4V2NlriIndex OBJECT-TYPE
        SYNTAX     Unsigned32
        MAX-ACCESS not-accessible
        STATUS     current
        DESCRIPTION
            "This index allows for multiple instances of a base
             prefix for a certain AFI-SAFI from a given peer.
             This is currently useful for two things:
             1. Allowing for a peer in future implementations to
                send more than a single route instance.
             2. Allow for extensions which extend the NLRI field
                to send the same prefix while utilizing other
                extension specific information. An example of
                this is RFC 3107 - Carrying MPLS labels in BGP."
        REFERENCE
            "RFC 3107 - Carrying Label Information in BGP-4."
        ::= { bgp4V2NlriEntry 1 }

    bgp4V2NlriAfi OBJECT-TYPE
        SYNTAX     Bgp4V2AddressFamilyIdentifierTC
        MAX-ACCESS not-accessible
        STATUS     current
        DESCRIPTION
            "The address family of the prefix for this NLRI.

             Note that the AFI is not necessarily equivalent to
             the an InetAddressType."
        REFERENCE
            "RFC 4760 - Multiprotocol Extensions for BGP-4"
        ::= { bgp4V2NlriEntry 2 }

    bgp4V2NlriSafi OBJECT-TYPE
        SYNTAX     Bgp4V2SubsequentAddressFamilyIdentifierTC
        MAX-ACCESS not-accessible
        STATUS     current
        DESCRIPTION
            "The subsequent address family of the prefix for
             this NLRI"
        REFERENCE
            "RFC 4760 - Multiprotocol Extensions for BGP-4"
        ::= { bgp4V2NlriEntry 3 }

    bgp4V2NlriPrefixType OBJECT-TYPE
        SYNTAX     InetAddressType
        MAX-ACCESS not-accessible
     STATUS     current
        DESCRIPTION
            "The type of the IP address prefix in the
             Network Layer Reachability Information field.
             The value of this object is derived from the
             appropriate value from the bgp4V2NlriAfi field.
             Where an appropriate InetAddressType is not
             available, the value of the object must be
             unknown(0)."
        ::= { bgp4V2NlriEntry 4 }

    bgp4V2NlriPrefix OBJECT-TYPE
        SYNTAX     InetAddress
        MAX-ACCESS not-accessible
        STATUS     current
        DESCRIPTION
            "An IP address prefix in the Network Layer
             Reachability Information field. This object
             is an IP address containing the prefix with
             length specified by bgp4V2NlriPrefixLen.
             Any bits beyond the length specified by
             bgp4V2NlriPrefixLen are zeroed."
        REFERENCE
            "RFC 4271, Section 4.3."
        ::= { bgp4V2NlriEntry 5 }

    bgp4V2NlriPrefixLen OBJECT-TYPE
        SYNTAX     InetAddressPrefixLength
        MAX-ACCESS not-accessible
        STATUS     current
        DESCRIPTION
            "Length in bits of the address prefix in
             the Network Layer Reachability Information field."
        ::= { bgp4V2NlriEntry 6 }

    bgp4V2NlriBest OBJECT-TYPE
        SYNTAX     TruthValue
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "An indication of whether or not this route
             was chosen as the best BGP4 route for this
             destination."
        REFERENCE
            "RFC 4271, Section 9.1.2."
        ::= { bgp4V2NlriEntry 7 }

    bgp4V2NlriCalcLocalPref OBJECT-TYPE
        SYNTAX     Unsigned32
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "The degree of preference calculated by the
             receiving BGP4 speaker for an advertised
             route.

             In the case where this prefix is ineligible, the
             value of this object will be zero (0)."
        REFERENCE
            "RFC 4271, Section 9.1.1"
        ::= { bgp4V2NlriEntry 8 }

    bgp4V2NlriOrigin OBJECT-TYPE
        SYNTAX     INTEGER {
            igp(1),-- networks are interior
            egp(2),-- networks learned via the EGP protocol
            incomplete(3) -- networks that
                          -- are learned by some other
                          -- means
            }
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "The ultimate origin of the path information."
        REFERENCE
            "RFC 4271, Section 4.3.
             RFC 4271, Section 5.1.1."
        ::= { bgp4V2NlriEntry 9 }

    bgp4V2NlriNextHopAddrType OBJECT-TYPE
        SYNTAX     InetAddressType
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "The address family of the address for
             the border router that should be used
             to access the destination network."
        ::= { bgp4V2NlriEntry 10 }

    bgp4V2NlriNextHopAddr OBJECT-TYPE
        SYNTAX     InetAddress (SIZE(4..20))
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "The address of the border router that
             should be used to access the destination
             network. This address is the nexthop
             address received in the UPDATE packet associated with
             this prefix.

             Note that for RFC2545 style double nexthops,
             this object will always contain the global scope
             nexthop. bgpPathAttrLinkLocalNextHop will contain
             the linklocal scope nexthop, if it is present.

             In the case a mechanism is developed to use only a link
             local nexthop, bgp4V2NlriNextHopAddr will contain the
             link local nexthop."
        REFERENCE
            "RFC 4271, Section 4.3,
             RFC 4271, Section 5.1.3,
             RFC 2545, Section 3."
        ::= { bgp4V2NlriEntry 11 }

    bgp4V2NlriLinkLocalNextHopAddrType OBJECT-TYPE
        SYNTAX     InetAddressType
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "The address type for IPv6 link local addresses.
             This is present only when receiving RFC 2545
             style double nexthops.

             This object is optionally present in BGP
             implementations that do not support IPv6.

             When no IPv6 link local nexthop is present, the value of
             this object should be unknown(0)."
        REFERENCE
            "RFC 2545, Section 3."
        ::= { bgp4V2NlriEntry 12 }

    bgp4V2NlriLinkLocalNextHopAddr OBJECT-TYPE
        SYNTAX     InetAddress
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "This value contains an IPv6 link local address
             and is present only when receiving RFC 2545 style
             double nexthops.

             This object is optionally present in BGP
             implementations that do not support IPv6.
             When no IPv6 link local nexthop is present, the length of
             this object should be zero."
        REFERENCE
            "RFC 2545, Section 3."
        ::= { bgp4V2NlriEntry 13 }

    bgp4V2NlriLocalPrefPresent OBJECT-TYPE
        SYNTAX     TruthValue
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "This value is true when the LOCAL_PREF value was sent in
             the UPDATE message."
        ::= { bgp4V2NlriEntry 14 }

    bgp4V2NlriLocalPref OBJECT-TYPE
        SYNTAX     Unsigned32
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "The originating BGP4 speakers degree of preference for an
             advertised route."
        REFERENCE
            "RFC 4271, Section 4.3.
             RFC 4271, Section 5.1.5."
        ::= { bgp4V2NlriEntry 15 }

    bgp4V2NlriMedPresent OBJECT-TYPE
        SYNTAX     TruthValue
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "This value is true when the MED value was sent in
             the UPDATE message."
        ::= { bgp4V2NlriEntry 16 }

    bgp4V2NlriMed OBJECT-TYPE
        SYNTAX     Unsigned32
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "This metric is used to discriminate between multiple
             exit points to an adjacent autonomous system.  When the MED
             value is absent but has a calculated default value, this
             object will contain the calculated value."
        REFERENCE
            "RFC 4271, Section 4.3.
             RFC 4271, Section 5.1.4."

        ::= { bgp4V2NlriEntry 17 }

    bgp4V2NlriAtomicAggregate OBJECT-TYPE
        SYNTAX     TruthValue
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "This value is true when the ATOMIC_AGGREGATE Path Attribute
             is present and indicates that the NLRI MUST NOT be made
             more specific."
        REFERENCE
            "RFC 4271, Sections 5.1.6 and 9.1.4."
        ::= { bgp4V2NlriEntry 18 }

    bgp4V2NlriAggregatorPresent OBJECT-TYPE
        SYNTAX     TruthValue
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "This value is true when the AGGREGATOR path attribute
             was sent in the UPDATE message."
        ::= { bgp4V2NlriEntry 19 }

    bgp4V2NlriAggregatorAS OBJECT-TYPE
        SYNTAX     InetAutonomousSystemNumber
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "The AS number of the last BGP4 speaker that performed route
             aggregation. When bgp4V2NlriAggregatorPresent is
             false, the value of this object should be zero (0)."
        REFERENCE
            "RFC 4271, Section 5.1.7.
             RFC 4271, Section 9.2.2.2."
        ::= { bgp4V2NlriEntry 20 }

    bgp4V2NlriAggregatorAddr OBJECT-TYPE
        SYNTAX     Bgp4V2IdentifierTC
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "The IP address of the last BGP4 speaker that performed
             route aggregation.  When bgp4V2NlriAggregatorPresent is
             false, the value of this object should be 0.0.0.0"
        REFERENCE
            "RFC 4271, Section 5.1.7.
             RFC 4271, Section 9.2.2.2."
        ::= { bgp4V2NlriEntry 21 }

    bgp4V2NlriAsPathCalcLength OBJECT-TYPE
        SYNTAX     Unsigned32
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "This value represents the calculated length of the
             AS Path according to the rules of the BGP
             specification.  This value is used in route selection."
        REFERENCE
            "RFC 4271, Section 9.1.2.2.a"
        ::= { bgp4V2NlriEntry 22 }

    bgp4V2NlriAsPathString OBJECT-TYPE
        SYNTAX     SnmpAdminString
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "This is a string depicting the autonomous system
             path to this network which was received from the
             peer which advertised it. The format of the string
             is implementation-dependent, and should be designed
             for operator readability.

             Note that SnmpAdminString is only capable of representing a
             maximum of 255 characters.  This may lead to the string
             being truncated in the presence of a large AS Path.  It is
             RECOMMENDED that when this object's contents will be
             truncated that the final 3 octets be reserved for the
             ellipses string, '...'.  bgp4V2NlriAsPath may give access
             to the full AS Path."
         ::= { bgp4V2NlriEntry 23 }

    -- Maximum size of the following is derived as
    -- 4096 max message size
    -- - 16 BGP message marker bytes
    -- - 2 BGP message size
    -- - 1 BGP message type (UPDATE with unknown attr)
    -- - 2 UPDATE routes length (even assuming no routes)
    -- - 2 UPDATE path attributes length
    -- - 1 path attribute flag octet
    -- ---------
    -- 4072 bytes maximum per-message attribute value data

    bgp4V2NlriAsPath OBJECT-TYPE
        SYNTAX     OCTET STRING (SIZE(2..4072))
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
         "In order to provide a canonicalized form of the BGP-4
             AS_PATH along with the human-readable
             bgp4V2NlriAsPathString, which may be truncated, this object
             contains the contents of the BGP-4 AS_PATH Path Attribute.
             This object may be parsed using the rules defined for
             Four-octet ASes as defined in RFC 4893.  RFC 4271, Section
             4.3, 'Path Attributes: b) AS_PATH' as amended by RFC 5065,
             Section 3 defines the general format of the AS_PATH path
             attribute and its code points.

             In brief, the AS_PATH is composed of a sequence of AS
             Segments.  Each AS Segment is represented by a triple:
             <path segment type, path segment length,
             path segment value>.

             The path segment type and path segment length fields are
             one octet in length each.

             The path segment type field may be one of:
               1 - AS_SET (RFC 4721, Section 4.3)
               2 - AS_SEQUENCE (RFC 4721, Section 4.3)
               3 - AS_CONFED_SEQUENCE (RFC 3065, Section 5)
               4 - AS_CONFED_SET (RFC 3065, Section 5)

             The path segment length field contains the number of ASes
             (not the number of octets) in the path segment value field.

             The path segment value field contains one or more AS
             numbers, each encoded as a 4-octet length field in network
             byte order.

             Note that since an SNMP agent may truncate this object to
             less than its maximum theoretical length of 4072 octets
             users of this object should be prepared to deal with a
             truncated and thus malformed AS_PATH.  It is RECOMMENDED
             that when such truncation would occur on the boundary of an
             encoded AS that the partial AS be discarded from this
             object and the object's size be adjusted accordingly.
             Further, it is also RECOMMENDED that when such truncation,
             either alone or in conjuction with the truncation of a
             partially encoded AS described previously, would yield an
             empty path segment value field that the path segment type
             and path segment length components of the truncated AS_PATH
             also be discarded and the object's size be adjusted
             accordingly."
         REFERENCE
             "RFC 4271, Section 4.3.
              RFC 5065, Section 5.
              RFC 4893."
         ::= { bgp4V2NlriEntry 24 }

    bgp4V2NlriPathAttrUnknown OBJECT-TYPE
        SYNTAX     OCTET STRING (SIZE(0..4072))
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "Path Attributes not understood by this implementation
             SHOULD be be presented in this object.  Those Path
             Attributes use the type, length, value encoding documented
             in RFC 4271, Section 4.3, 'Path Attributes'.

             Note that since an SNMP agent may truncate this object to
             less than its maximum theoretical length of 4072 octets
             users of this object should be prepared to deal with a
             truncated and thus malformed Path Attribute."
         REFERENCE
             "RFC 4271, Section 4.3."
         ::= { bgp4V2NlriEntry 25 }

--
    -- Notifications
    --

    bgp4V2EstablishedNotification NOTIFICATION-TYPE
        OBJECTS {
            bgp4V2PeerState,
            bgp4V2PeerLocalPort,
            bgp4V2PeerRemotePort
        }
        STATUS current
        DESCRIPTION
            "The BGP Established event is generated when
             the BGP FSM enters the established state."
        ::= { bgp4V2Notifications 1 }

    bgp4V2BackwardTransitionNotification NOTIFICATION-TYPE
        OBJECTS {
            bgp4V2PeerState,
            bgp4V2PeerLocalPort,
            bgp4V2PeerRemotePort,
            bgp4V2PeerLastErrorCodeReceived,
            bgp4V2PeerLastErrorSubCodeReceived,
            bgp4V2PeerLastErrorReceivedText
        }
        STATUS current
        DESCRIPTION
            "The BGPBackwardTransition Event is generated
             when the BGP FSM moves from a higher numbered
             state to a lower numbered state.

             Due to the nature of the BGP state machine, an
             implementation MAY rate limit the generation of this event.
             An implementation MAY also generate this notification ONLY
             when the state machine moves out of the established state.
             An implementation should document its specific behavior."
        ::= { bgp4V2Notifications 2 }

END
