-- *****************************************************************
-- gbnServiceMAC-NOTIFICATION-MIB.mi2:  MAC Notification MIB 

-- *****************************************************************

MAC-NOTIFICATION-MIB DEFINITIONS ::= BEGIN

IMPORTS
        MODULE-IDENTITY, OBJECT-TYPE, Counter32, NOTIFICATION-TYPE,
        Unsigned32, Integer32
                FROM SNMPv2-SMI
        MODULE-COMPLIANCE, OBJECT-GROUP, NOTIFICATION-GROUP
                FROM SNMPv2-CONF
        TruthValue, TimeStamp, MacAddress, TEXTUAL-CONVENTION
                FROM SNMPv2-TC
        ifIndex
                FROM IF-MIB
        VlanId
                FROM Q-BRIDGE-MIB
        gbnServiceMACNotification
	            FROM ADMIN-MASTER-MIB;


macNotificationMIB MODULE-IDENTITY
    LAST-UPDATED    "201204080000Z"
    ORGANIZATION    "New admin, Inc."
    CONTACT-INFO    "http://www.admin.com"
    DESCRIPTION
        "This MIB module is for configuration of the MAC notification
        feature. MAC notification is a mechanism to inform monitoring
        devices when there are MAC addresses learnt or removed from
        the forwarding database of the monitored devices." 

    REVISION   "201204080000Z"
    DESCRIPTION
        "Initial version of this MIB module."
    ::= { gbnServiceMACNotification 1 }

-- Textual Conventions

Percent ::= TEXTUAL-CONVENTION
    STATUS   current
    DESCRIPTION
            "An integer that is in the range of a percent value."
    SYNTAX Integer32 (1..100)

PhysicalIndex ::= TEXTUAL-CONVENTION
    DISPLAY-HINT     "d"
    STATUS            current
    DESCRIPTION
            "An arbitrary value that uniquely identifies the physical
            entity.  The value should be a small, positive integer.
            Index values for different physical entities are not
            necessarily contiguous."
    SYNTAX Integer32 (1..2147483647)


-- MAC Notification MIB object definitions

macNotificationMIBObjects OBJECT IDENTIFIER
    ::= { macNotificationMIB 1 }

-- MAC Notification MIB consists of the following groups
-- [1] Mac Notification Global Group (mnGlobalObjects).
-- [2] Mac Notification Interface Group (mnInterfaceObjects).
mnGlobalObjects     OBJECT IDENTIFIER
    ::= { macNotificationMIBObjects 1 }
mnInterfaceObjects     OBJECT IDENTIFIER
    ::= { macNotificationMIBObjects 2 }
--**********************************************************************
-- Mac Notification Global Group
--**********************************************************************

mnGlobalFeatureEnabled  OBJECT-TYPE
    SYNTAX        TruthValue
    MAX-ACCESS    read-write
    STATUS        current
    DESCRIPTION
        "Indicates whether the MAC notification feature is currently 
        running in the device.

        Setting this object to false(2) disables the MAC notification
        feature globally thus disabling the feature at each interface.

        Setting this object to true(1) will start the MAC notification
        feature running in the device. If the feature is already
        running, setting to true(1) has no effect. Once the MAC
        notification is enabled, whether the feature is running at each
        interface is controlled by the mnIfConfigTable."   
    ::= { mnGlobalObjects 1 }

mnNotificationInterval  OBJECT-TYPE
    SYNTAX        Unsigned32 (0..4294967295)
    UNITS         "seconds"
    MAX-ACCESS    read-write
    STATUS        current
    DESCRIPTION
        "This object specifies the maximum interval of time between
        mnMacChangedNotifications being generated by the device.
        If the value of mnNotificationsEnabled is true(1), the
        device will send out the generated mnMacChangedNotifications
        and archive the MAC change notification events in the
        mnHistoryTable. If the value of mnNotificationsEnabled is
        false(2), the device will not send out the generated
        mnMacChangedNotifications but it will archive these events
        in the mnHistoryTable.   
        
        If the value of this object is equal to 0, the device will 
        generate mnMacChangedNotifications and archive the MAC 
        change notification events in the mnHistoryTable as soon as
        there is MAC address learnt or removed by the device.

        If the value of this object is greater than 0, the device will
        wait for a period of time equal to the value of this object
        before generate the mnMacChangedNotifications and archive
        the MAC change notification events in the mnHistoryTable."
    ::= { mnGlobalObjects 2 }

mnMacAddressesLearnt OBJECT-TYPE
    SYNTAX        Counter32 
    MAX-ACCESS    read-only
    STATUS        current
    DESCRIPTION
        "Indicates the number of MAC addresses learnt by the
        device." 
    ::= { mnGlobalObjects 3 }

mnMacAddressesRemoved OBJECT-TYPE
    SYNTAX        Counter32 
    MAX-ACCESS    read-only
    STATUS        current
    DESCRIPTION
        "Indicates the number of MAC addresses removed from the
        forwarding database." 
    ::= { mnGlobalObjects 4 }

mnNotificationsEnabled OBJECT-TYPE
     SYNTAX          TruthValue
     MAX-ACCESS      read-write
     STATUS          current
     DESCRIPTION
         "Indicates whether mnMacChangedNotification notifications
          will or will not be sent when there are MAC addresses
          learnt or removed from the device's forwarding database. 
          Disabling notifications does not prevent the MAC address
          info from being added to the mnHistoryTable."
     DEFVAL { false }
     ::= { mnGlobalObjects 5 }

mnNotificationsSent OBJECT-TYPE
    SYNTAX         Counter32 
    MAX-ACCESS     read-only
    STATUS         current
    DESCRIPTION
        "Indicates the number of mnMacChangedNotifications sent out
        by the device."
    ::= { mnGlobalObjects 6 }

mnHistTableMaxLength OBJECT-TYPE
    SYNTAX          Unsigned32 (0..500)
    UNITS           "entries"
    MAX-ACCESS      read-write
    STATUS          current
    DESCRIPTION
        "The upper limit on the number of entries that the
        mnHistoryTable may contain.  A value of 0 will
        prevent any history from being retained. When this
        table is full, the oldest entry will be deleted and
        a new one will be created."
    DEFVAL  { 1 }
    ::= { mnGlobalObjects 7 }

mnHistoryTable OBJECT-TYPE
    SYNTAX     SEQUENCE OF MnHistoryEntry
    MAX-ACCESS not-accessible
    STATUS     current
    DESCRIPTION
        "This table will archive the MAC change notification events 
        generated by this device. The MAC change notification
        events are archived here even if mnMacChangesNotifications 
        are not actually sent."
    ::= { mnGlobalObjects 8 }

mnHistoryEntry OBJECT-TYPE
    SYNTAX     MnHistoryEntry
    MAX-ACCESS not-accessible
    STATUS     current
    DESCRIPTION
        "A MAC change notification message that was previously
        generated by this device.  Each entry is indexed by a message
        index."
    INDEX   { mnHistIndex }
    ::= { mnHistoryTable 1 }

MnHistoryEntry ::=
    SEQUENCE {
        mnHistIndex
                Unsigned32,
        mnHistMacChangedMsg
                OCTET STRING,
        mnHistTimestamp
                TimeStamp
    }

mnHistIndex OBJECT-TYPE
    SYNTAX          Unsigned32 (1..4294967295)
    MAX-ACCESS      not-accessible
    STATUS          current
    DESCRIPTION
        "An index that uniquely identifies a MAC change notification
        event previously generated by the device. This index starts at
        1 and increases by one when a MAC change notification is 
        generated.  When it reaches the maximum value, the agent wraps
        the value back to 1."
    ::= { mnHistoryEntry 1 }

mnHistMacChangedMsg OBJECT-TYPE
    SYNTAX        OCTET STRING (SIZE(1..254))
    MAX-ACCESS    read-only
    STATUS        current
    DESCRIPTION
        "This object contains the information of a MAC change
        notification event. It consists of several tuples packed
        together in the format of '<tuple1><tuple2>...'.
        
        Each tuple consist of 11 octets in the format of
        '<operation><VLAN><MAC><dot1dBasePort>' where 

        <operation> is of size 1 octet and supports the following values
          0 - End of MIB object.
          1 - MAC learnt.
          2 - MAC removed.

        <VLAN> is VLAN number of the VLAN which the MAC address is
        belonged to and has size of 2 octet.

        <MAC> is the Layer2 Mac Address and has size of 6 octets.

        <dot1dBasePort> is the value of dot1dBasePort for the
        interface from which the MAC address is learnt and has size
        of 2 octets."
    ::= { mnHistoryEntry 2 }

mnHistTimestamp  OBJECT-TYPE
    SYNTAX          TimeStamp
    MAX-ACCESS      read-only
    STATUS          current
    DESCRIPTION
        "The value of sysUpTime when the mnMacChangedNotification
        containing the information denoted by the mnHistMacChangedMsg
        object in this entry was generated."
    ::= { mnHistoryEntry 3 }

--*********************************************************************
-- Mac Notification Interface Group
--*********************************************************************

--
-- mnIfConfigTable
--

mnIfConfigTable  OBJECT-TYPE
    SYNTAX        SEQUENCE OF MnIfConfigEntry
    MAX-ACCESS    not-accessible
    STATUS        current
    DESCRIPTION
        "This table enables or disables the generation of notification
        at each interface when MAC address is learnt or removed." 
    ::= { mnInterfaceObjects 1 }

mnIfConfigEntry  OBJECT-TYPE
    SYNTAX        MnIfConfigEntry
    MAX-ACCESS    not-accessible
    STATUS        current
    DESCRIPTION
        "Each entry contains the configuration for enabling the
        MAC notification at each interface that supports this
        feature." 
    INDEX { ifIndex }
    ::= { mnIfConfigTable 1 }

MnIfConfigEntry  ::= SEQUENCE {
    mnMacAddrLearntEnable    TruthValue, 
    mnMacAddrRemovedEnable   TruthValue 
}

mnMacAddrLearntEnable OBJECT-TYPE
    SYNTAX        TruthValue 
    MAX-ACCESS    read-write
    STATUS        current
    DESCRIPTION
        "Indicates whether this interface is enabled to send 
        mnMacChangedNotification when it learns a new MAC address. This
        variable has no effect when the value of mnGlobalFeatureEnabled
        object is false(2).

        Setting this object to true(1) enables the sending of
        mnMacChangedNotification when this interface learns a 
        new MAC address.

        Setting this object to false(2) disables the sending
        of mnMacChangedNotification when this interface learns
        a new MAC address."      
    DEFVAL { false }
    ::= { mnIfConfigEntry 1 }

mnMacAddrRemovedEnable OBJECT-TYPE
    SYNTAX        TruthValue 
    MAX-ACCESS    read-write
    STATUS        current
    DESCRIPTION
        "Indicates whether this interface is enabled to send 
        mnMacChangedNotification when a MAC address which it learnt
        previously is removed from the forwarding table. This variable
        has no effect when the value of mnGlobalFeatureEnabled object
        is false(2). 

        Setting this object to true(1) enables the sending of
        mnMacChangedNotification when a MAC address which this
        interface learnt previously is removed from the forwarding
        table.

        Setting this object to false(2) disables the sending of
        mnMacChangedNotification when a MAC address which this
        interface learnt previously is removed from the forwarding
        table."
    DEFVAL { false }
    ::= { mnIfConfigEntry 2 }



--
--
-- Notification 
--

mnMIBNotificationPrefix OBJECT IDENTIFIER
    ::= { macNotificationMIB 2 }

mnMIBNotifications
    OBJECT IDENTIFIER ::= { mnMIBNotificationPrefix 0 }

mnMacChangedNotification NOTIFICATION-TYPE
    OBJECTS { mnHistMacChangedMsg, mnHistTimestamp } 
    STATUS  current
    DESCRIPTION
        "This notification is generated when there is enough MAC
        address information to fully occupy a maximum size SNMP trap
        message. This notification is also generated when there
        is at least one MAC address changed or removed and the amount
        of time elapsed from the previous notification is greater
        than the maximum wait time denoted by 
        mnNotificationInterval object. 

        If there are more MAC addresses information than can fit into
        one mmHistTrapContent object, then multiple notifications
        will be generated." 
    ::= { mnMIBNotifications 1 }

--
-- Conformance
--

mnMIBConformance OBJECT IDENTIFIER ::= { macNotificationMIB 3 }

mnMIBCompliances OBJECT IDENTIFIER
    ::= { mnMIBConformance 1 }

mnMIBGroups      OBJECT IDENTIFIER
    ::= { mnMIBConformance 2 }


-- Compliance

mnMIBCompliance MODULE-COMPLIANCE
     STATUS deprecated
     DESCRIPTION
         "The compliance statement for the MAC-NOTIFICATION-MIB."
     MODULE
     MANDATORY-GROUPS { mnGlobalGroup,
                        mnInterfaceGroup,
                        mnNotificationGroup }
     ::= { mnMIBCompliances 1 }

mnMIBComplianceVer1 MODULE-COMPLIANCE
     STATUS current
     DESCRIPTION
         "The compliance statement for the MAC-NOTIFICATION-MIB."
     MODULE
     MANDATORY-GROUPS { mnGlobalGroup,
                        mnInterfaceGroup,
                        mnNotificationGroup 
                      }

     ::= { mnMIBCompliances 2 }

--
-- Units of Conformance
--
-- Units of Conformance
--
mnGlobalGroup OBJECT-GROUP
    OBJECTS {
      mnGlobalFeatureEnabled,
      mnNotificationInterval,
      mnMacAddressesLearnt,
      mnMacAddressesRemoved,
      mnNotificationsEnabled,
      mnHistTableMaxLength,
      mnHistMacChangedMsg,
      mnHistTimestamp,
      mnNotificationsSent
    }
    STATUS current
    DESCRIPTION
        "A collection of objects providing the global configuration
        and information for MAC notification." 
    ::= { mnMIBGroups 1 }

mnInterfaceGroup OBJECT-GROUP
    OBJECTS {
      mnMacAddrLearntEnable,
      mnMacAddrRemovedEnable
    }
    STATUS current
    DESCRIPTION
        "A collection of objects providing the configuration information
        for MAC notification at each interface." 
    ::= { mnMIBGroups 2 }

mnNotificationGroup NOTIFICATION-GROUP
    NOTIFICATIONS { mnMacChangedNotification }
    STATUS current
    DESCRIPTION
        "The notification generated by the MAC-NOTIFICATION-MIB."
    ::= { mnMIBGroups 3 }
END
