-- *****************************************************************
-- WESTERMO-SW6-BRIDGE-MIB :
-- SNMP feature configuration of Westermo devices with SW6.
--
-- Copyright (c) 2020 by Westermo Network Technologies AB
-- All rights reserved.
-- *****************************************************************

-- *****************************************************************
-- This script has been tested using the SMI checker smilint
-- the tool can be downloaded at
-- http://www.ibr.cs.tu-bs.de/projects/libsmi/smilint.html
-- or use alternatively the online version at:
-- http://www.simpleweb.org/ietf/mibs/validate/
--
-- smilint -m -s -l 6 -i nameLength-32 ./WESTERMO-SW6-BRIDGE-MIB
-- Ensure that all needed MIBS are located in the SMIPATH.
-- *****************************************************************

-- **********************************************************************
-- * RSTP MIB
-- **********************************************************************

WESTERMO-SW6-BRIDGE-MIB DEFINITIONS ::= BEGIN

    IMPORTS
        MODULE-IDENTITY, OBJECT-TYPE           FROM SNMPv2-SMI
        Integer32                              FROM SNMPv2-SMI
        MODULE-COMPLIANCE, OBJECT-GROUP        FROM SNMPv2-CONF
        DisplayString                          FROM SNMPv2-TC
    ;

-- **********************************************************************
-- *  MODULE IDENTITY
-- **********************************************************************
rstp MODULE-IDENTITY
    LAST-UPDATED "202608120000Z"

    ORGANIZATION "Westermo Network Technologies AB"
    CONTACT-INFO "E-mail: info@westermo.com"
    DESCRIPTION  "MIB Module for the Westermo RT-300 Radio Modem Device - Bridge definitions"

    REVISION     "202608120000Z"
    DESCRIPTION  "Release 6.12.1-0"

    ::= { iso(1) org(3) dod(6) internet(1) private(4) enterprises(1)
          westermo(16177) products(1) rt(400) feature(2) 8 }

-- **********************************************************************
-- *  Begin Major sections
-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

--  Configuration
--  =============

    configuration    OBJECT IDENTIFIER ::= { rstp 1 }
     cfgRstpBridge   OBJECT IDENTIFIER ::= { configuration 1 }
     cfgRstpPort     OBJECT IDENTIFIER ::= { configuration 2 }

--  Conformance Information
--  =======================

    conformance           OBJECT IDENTIFIER ::= { rstp 10000 }
     groups               OBJECT IDENTIFIER ::= { conformance 1 }
      groupConfiguration  OBJECT IDENTIFIER ::= { groups 1 }

    compliances           OBJECT IDENTIFIER ::= { conformance 2 }

-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-- *  End Major Sections
-- **********************************************************************


-- **********************************************************************
-- *  Begin Object Types
-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

    cfgRstpBridgeEnabled OBJECT-TYPE
        SYNTAX INTEGER { disabled(0), enabled(1) }
        MAX-ACCESS read-write
        STATUS     current
        DESCRIPTION
            "Disable or Enable RSTP on Bridge"
        ::= { cfgRstpBridge 1 }

    cfgRstpBridgePriority OBJECT-TYPE
        SYNTAX Integer32 (0..61440)
        MAX-ACCESS read-write
        STATUS     current
        DESCRIPTION
            "RSTP Bridge Priority

             The bridge's relative priority value for determining the root
             bridge (the upper 16 bits of the bridge-id). A bridge with the
             lowest bridge-id is elected the root. By default, the priority is
             0x8000 (32768). This value needs to be a multiple of 4096,
             otherwise it's rounded to the nearest inferior one."
        ::= { cfgRstpBridge 2 }

    cfgRstpBridgeHelloTime OBJECT-TYPE
        SYNTAX Integer32 (2)
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "RSTP Hello Message Send Interval

            The interval in seconds between transmissions of hello messages
            by designated ports. With RSTP this value is 2 seconds."
        ::= { cfgRstpBridge 3 }

    cfgRstpBridgeForwardDelay OBJECT-TYPE
        SYNTAX Integer32 (4..30)
        MAX-ACCESS read-write
        STATUS     current
        DESCRIPTION
            "RSTP Bridge Forward Delay

             The delay in seconds used by STP bridges to transition root and
             designated ports to forwarding."
        ::= { cfgRstpBridge 4 }

    cfgRstpBridgeMaxAge OBJECT-TYPE
        SYNTAX Integer32 (6..40)
        MAX-ACCESS read-write
        STATUS     current
        DESCRIPTION
            "RSTP Bridge Maximum Age

             The maximum age of the information in seconds transmitted by
             the bridge when it is the root bridge."
        ::= { cfgRstpBridge 5 }

    cfgRstpBridgeTransmitHoldCount OBJECT-TYPE
        SYNTAX Integer32 (1..10)
        MAX-ACCESS read-write
        STATUS     current
        DESCRIPTION
            "RSTP Bridge Transmit Hold Count

             The transmit hold count used by the port transmit state machine
             to limit transmission rate."
        ::= { cfgRstpBridge 6 }

    cfgRstpPortTable OBJECT-TYPE
        SYNTAX SEQUENCE OF CfgRstpPortTableSeq
        MAX-ACCESS not-accessible
        STATUS     current
        DESCRIPTION
            "RSTP Port Configuration Table"
        ::= { cfgRstpPort 1 }

    cfgRstpPortTableEntry OBJECT-TYPE
        SYNTAX  CfgRstpPortTableSeq
        MAX-ACCESS not-accessible
        STATUS     current
        DESCRIPTION
            "RSTP Port Configuration Table Entry"
        INDEX {cfgRstpPortIndex}
        ::= { cfgRstpPortTable 1 }

    CfgRstpPortTableSeq ::=
        SEQUENCE {  cfgRstpPortIndex Integer32,
                    cfgRstpPortEnabled INTEGER,
                    cfgRstpPortName DisplayString,
                    cfgRstpPortPriority Integer32,
                    cfgRstpPortPathCost Integer32,
                    cfgRstpPortAutoEdge INTEGER
                 }

    cfgRstpPortIndex OBJECT-TYPE
        SYNTAX Integer32 (0..18)
        MAX-ACCESS not-accessible
        STATUS     current
        DESCRIPTION
            "Entry Index of Port Forward Table"
        ::= { cfgRstpPortTableEntry 1 }

    cfgRstpPortEnabled OBJECT-TYPE
        SYNTAX INTEGER { disabled(0), enabled(1) }
        MAX-ACCESS read-write
        STATUS     current
        DESCRIPTION
            "Disable or Enable RSTP on Port"
        ::= { cfgRstpPortTableEntry 2 }

    cfgRstpPortName OBJECT-TYPE
        SYNTAX DisplayString (SIZE(1..255))
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "Port Name to Apply Settings

             **Examples**:

             * eth0
             * wlan0"
        ::= { cfgRstpPortTableEntry 3 }

    cfgRstpPortPriority OBJECT-TYPE
        SYNTAX Integer32 (0..240)
        MAX-ACCESS read-write
        STATUS     current
        DESCRIPTION
            "RSTP Port Priority

             The port's relative priority value for determining the root port,
             in multiples of 16. By default, the port priority is 0x80 (128).
             Any value in the lower 4 bits is rounded off. The significant upper
             4 bits become the upper 4 bits of the port-id. A port with the
             lowest port-id is elected as the root."
        ::= { cfgRstpPortTableEntry 4 }

    cfgRstpPortPathCost OBJECT-TYPE
        SYNTAX Integer32 (-1..5000000)
        MAX-ACCESS read-write
        STATUS     current
        DESCRIPTION
            "RSTP Port Path Cost

             The port path cost. The port's contribution, when it is the root
             port, to the root path cost for the bridge. By default the cost is
             automatically calculated from the port's speed. If -1 is defined,
             the port path cost is automatically calculated.

             | Data rate  | RSTP cost (802.1W-2004, default value) |
             |------------|----------------------------------------|
             | 4 Mbit/s   |  5,000,000                             |
             | 10 Mbit/s  |  2,000,000                             |
             | 16 Mbit/s  |  1,250,000                             |
             | 100 Mbit/s |  200,000                               |
             | 1 Gbit/s   |  20,000                                |
             | 2 Gbit/s   |  10,000                                |
             | 10 Gbit/s  |  2,000                                 |"
        ::= { cfgRstpPortTableEntry 5 }

    cfgRstpPortAutoEdge OBJECT-TYPE
        SYNTAX INTEGER { disabled(0), enabled(1) }
        MAX-ACCESS read-write
        STATUS     current
        DESCRIPTION
            "RSTP Port Auto Edge

             The auto edge port parameter allows the automatic detection of
             edge ports.

             Ports can be configured as edge ports to facilitate rapid
             changes to the forwarding state when connected to endpoints.

             If enabled, the port will look for BPDUs; if there are none
             it begins forwarding packets.
             It is recommended to disable auto-edge for non-edge ports."
        ::= { cfgRstpPortTableEntry 6 }

-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-- *  End of   Object Types
-- *********************************************************************


-- **********************************************************************
-- *  Begin GROUPS
-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

    groupConfigRstp OBJECT-GROUP
        OBJECTS {
            cfgRstpBridgeEnabled,
            cfgRstpBridgePriority,
            cfgRstpBridgeHelloTime,
            cfgRstpBridgeForwardDelay,
            cfgRstpBridgeMaxAge,
            cfgRstpBridgeTransmitHoldCount,
            cfgRstpPortEnabled,
            cfgRstpPortName,
            cfgRstpPortPriority,
            cfgRstpPortPathCost,
            cfgRstpPortAutoEdge
        }
        STATUS current
        DESCRIPTION
            "RSTP configuration."
        ::= { groupConfiguration 1 }

-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-- *  End GROUPS
-- **********************************************************************


-- **********************************************************************
-- *  Begin COMPLIANCE STATEMENTS
-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

    compliance MODULE-COMPLIANCE
    STATUS current
    DESCRIPTION
        "Implementation Requirements for DT50 bindings"
    MODULE  -- this module
        MANDATORY-GROUPS {
            groupConfigRstp
        }
    ::= { compliances 1 }

-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-- *  End COMPLIANCE STATEMENTS
-- **********************************************************************

-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-- *  End of MIB DEFINITION
-- **********************************************************************
END


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