-- --------------------------------------------------------------------------------------
-- PKT-STORM-CTRL-MIB 
-- --------------------------------------------------------------------------------------
-- Version 1.1  
-- 2008/9/3 14:44
-- (1)Modify swPktStormRecover and swPktStormCtrlShutdownForever descriptions for
-- function change
-- (2)expand some mib node description
-- --------------------------------------------------------------------------------------
-- Version 1.0  
-- 2005/8/3 11:44
-- Added swPktStormCtrldlfStatus object into swPktStormCtrlTable
-- --------------------------------------------------------------------------------------
-- 0.9 Draft 
-- 2005/7/11 11:49
-- Create PKT-STORM-CTRL-MIB 
-- --------------------------------------------------------------------------------------

PKT-STORM-CTRL-MIB DEFINITIONS ::= BEGIN

    IMPORTS
        MODULE-IDENTITY,OBJECT-TYPE,IpAddress, Unsigned32,Integer32
                                        FROM SNMPv2-SMI
        MacAddress, RowStatus           FROM SNMPv2-TC
        DisplayString                   FROM RFC1213-MIB
    	SnmpAdminString					FROM SNMP-FRAMEWORK-MIB

        dlink-common-mgmt				FROM DLINK-ID-REC-MIB;
        
		 
    	
    swPktStormMIB MODULE-IDENTITY
	    LAST-UPDATED "0809030000Z"
	    ORGANIZATION " "
	    CONTACT-INFO
	        "    "
	    DESCRIPTION
		    "The Structure of packet storm control management for the
		    proprietary enterprise."
        ::= { dlink-common-mgmt 25 }

   PortList                ::= OCTET STRING(SIZE (0..127))
        
   swPktStormCtrl            OBJECT IDENTIFIER ::= { swPktStormMIB 1 }   
   swPktStormInfo			 OBJECT IDENTIFIER ::= { swPktStormMIB 2 } 
   swPktStormMgmt            OBJECT IDENTIFIER ::= { swPktStormMIB 3}  
   swPktStormNotify			 OBJECT IDENTIFIER ::= { swPktStormMIB 5 }  

-- -----------------------------------------------------------------------------
--swPktStormCtrl  OBJECT IDENTIFIER ::= { swPktStormMIB 1 }
-- -----------------------------------------------------------------------------
-- swPktStormRecover  OBJECT-TYPE
--         SYNTAX  PortList
--         MAX-ACCESS  read-write
--         STATUS  current
--         DESCRIPTION
--             "Manually recover port from shutdown state. If a port has encountered a packet
--              storm continuously for a long period of time as indicated by swPktStormCtrlCountDown, 
--             this port will be shut down forever. This command recovers it manually. If the 
--             auto-recover mechanism is supported, this object is of no use."
--         ::= { swPktStormCtrl 1 }
        
swPktStormTrapCtrl OBJECT-TYPE
	    SYNTAX  INTEGER {
	                     none          (1),
		 		 		 stormOccurred (2),
		 		 		 stormCleared  (3),
		 		 		 both          (4)
	            }
	    MAX-ACCESS  read-write
	    STATUS  current
	    DESCRIPTION
	        "This object controls when a storm control notification will be generated.

		    If the object is set to
		    none (1): No notifications will be generated.
			stormOccurred(2):
			stormCleared(3):A notification will be generated when a storm event is
			                detected or cleared  respectively.
		    both (4): A notification  will be generated both when a storm event is detected and
		             cleared. 

		    NOTE:The default value of this object is none(1). "
	    ::= { swPktStormCtrl 2}
	    
-- -----------------------------------------------------------------------------
--  swPktStormCtrlTable            OBJECT IDENTIFIER ::= { swPktStormMIB 2 }
-- -----------------------------------------------------------------------------
    swPktStormCtrlTable OBJECT-TYPE
        SYNTAX  SEQUENCE OF SwPktStormCtrlEntry
        MAX-ACCESS  not-accessible
        STATUS  current
        DESCRIPTION
            "A table that contains information about packet storm control.
           A S/W mechanism is provided to monitor the traffic rate in addition
            to the H/W storm control mechanism. If the traffic rate is too high,
            this port will be shut down."
        ::= { swPktStormMgmt 1 }

    swPktStormCtrlEntry OBJECT-TYPE
        SYNTAX  SwPktStormCtrlEntry
        MAX-ACCESS  not-accessible
        STATUS  current
        DESCRIPTION
            "A list of information for each port of the device."
        INDEX   { swPktStormCtrlPortIndex }
        ::= { swPktStormCtrlTable 1 }

    SwPktStormCtrlEntry ::=
        SEQUENCE {
            swPktStormCtrlPortIndex
                INTEGER,
            swPktStormCtrlthreshold
                Integer32,
            swPktStormCtrlBroadcastStatus
                INTEGER,
            swPktStormCtrlMulticastStatus
                INTEGER,
            swPktStormCtrlUnicastStatus
                INTEGER,                
            swPktStormCtrlActionStatus
                INTEGER,
            swPktStormCtrlCountDown
                INTEGER,
            swPktStormCtrlTimeinterval
                INTEGER
--             ,swPktStormCtrlShutdownForever
--                 INTEGER
--            swPktStormCtrlZombie
--                INTEGER
        }
        
    swPktStormCtrlPortIndex  OBJECT-TYPE
        SYNTAX  INTEGER (0..65535)
        MAX-ACCESS  read-only
        STATUS  current
        DESCRIPTION
        "This object indicates the device's port number.(1..Max port
        number in the device).It is used to specify a range of ports to be
        configured."
    ::= { swPktStormCtrlEntry 1 }
    
    swPktStormCtrlthreshold  OBJECT-TYPE
        SYNTAX  Integer32
        MAX-ACCESS  read-write
        STATUS  current
        DESCRIPTION
        "This object is the upper threshold at which the specified storm control will turn on."
    ::= { swPktStormCtrlEntry 2 }
    
    swPktStormCtrlBroadcastStatus  OBJECT-TYPE
        SYNTAX  INTEGER
                {
                    disabled(1),
                    enabled(2)
                }
        MAX-ACCESS  read-write
        STATUS  current
        DESCRIPTION
        "This object indicates whether the broadcast storm control is enabled or disabled."
    ::= { swPktStormCtrlEntry 3 }
    
    swPktStormCtrlMulticastStatus  OBJECT-TYPE
        SYNTAX  INTEGER
                {
                    disabled(1),
                    enabled(2)
                }
        MAX-ACCESS  read-write
        STATUS  current
        DESCRIPTION
        "This object indicates whether the multicast storm control is enabled or disabled."
    ::= { swPktStormCtrlEntry 4 }
    
    swPktStormCtrlUnicastStatus  OBJECT-TYPE
        SYNTAX  INTEGER
                {
                    disabled(1),
                    enabled(2)
                }
        MAX-ACCESS  read-write
        STATUS  current
        DESCRIPTION
        "This object indicates whether the unicast (Destination Loopback Fail) storm control is enabled
         or disabled."
    ::= { swPktStormCtrlEntry 5 }
    
   swPktStormCtrlActionStatus  OBJECT-TYPE
        SYNTAX  INTEGER
                {
                    shutdown(1),
                    drop(2)
                }
        MAX-ACCESS  read-write
        STATUS  current
        DESCRIPTION
        "There are two actions to take for storm control, shutdown and drop. The
        former is implemented in S/W, and the latter is implemented in H/W. If a user
        chooses shutdown, they will need to configure both the back_off and the time_interval."
    ::= { swPktStormCtrlEntry 6 }

    swPktStormCtrlCountDown  OBJECT-TYPE
        SYNTAX  INTEGER (0..30)
        MAX-ACCESS  read-write
        STATUS  current
        DESCRIPTION
        "If a packet storm has been encountered continuously on a given port for a long
        period of time (indicated by the value of this object), the port will be shut 
        down forever until it's recovered manually.The range of the countdown time is 
        5 to 30 minutes. A user can configure the countdown to 0 to disable the function of shutdown
        forever. If this value is set from 1 to 4,  a 'bad value' return code will be indicated"
    ::= { swPktStormCtrlEntry 7 }
    
    swPktStormCtrlTimeinterval  OBJECT-TYPE
        SYNTAX  INTEGER (5..30)
        MAX-ACCESS  read-write
        STATUS  current
        DESCRIPTION
        "This object is the sampling interval of received packet counts. The possible value will be from 5 to 30 seconds."
    ::= { swPktStormCtrlEntry 8 }
    
--     swPktStormCtrlShutdownForever  OBJECT-TYPE
--         SYNTAX  INTEGER
--                 {
--                     yes(1),
--                     no(2)
--                 }
--         MAX-ACCESS  read-only
--         STATUS  current
--         DESCRIPTION
--         "This object indicates whether the storm control is shut down forever or not.
--         This command recover it manually. If support auto-recover mechanism, the object is no use."
--     ::= { swPktStormCtrlEntry 9 }
   
--    swPktStormCtrlZombie  OBJECT-TYPE
--        SYNTAX  INTEGER
--                {
--                    other(1),
--                    disable(2),
--                    enable(3)
--                }
--        MAX-ACCESS  read-write
--        STATUS  current
--        DESCRIPTION
--        "This object indicates thestrom control whether or not shutted down forever."
--    ::= { swPktStormCtrlEntry 10 }
    
    

-- -----------------------------------------------------------------------------
	swPktStormNotifyPrefix OBJECT IDENTIFIER ::= { swPktStormNotify 0 }   
	
    swPktStormOccurred NOTIFICATION-TYPE
        OBJECTS         { swPktStormCtrlPortIndex        					
                        }        
        STATUS  current
        DESCRIPTION
            "This trap is sent when a packet storm is detected by a packet storm mechanism and a shutdown action is taken. "
             
        ::= { swPktStormNotifyPrefix 1 }   	
  
    swPktStormCleared NOTIFICATION-TYPE
        OBJECTS         { swPktStormCtrlPortIndex        				
                        }        
        STATUS  current
        DESCRIPTION
            "The trap is sent when the packet storm is cleared by the packet storm mechanism."
             
        ::= { swPktStormNotifyPrefix 2 }   	       
		
END		
