-- =================================================================
-- Copyright (c) 2010-2013 Hewlett-Packard Development Company, L.P.
--
-- Description:
-- Reference:
-- Version: V1.0
-- History:
-- V1.0 created by zhanghaiyang.
--    Initial version of the MIB
-- =================================================================
HPN-ICF-RS485-MIB DEFINITIONS ::= BEGIN

IMPORTS
        hpnicfCommon
    FROM HPN-ICF-OID-MIB
        ifIndex
    FROM IF-MIB
        Integer32, OBJECT-TYPE, MODULE-IDENTITY
    FROM SNMPv2-SMI
        InetAddressType, InetAddress
    FROM INET-ADDRESS-MIB
        DisplayString, RowStatus
    FROM SNMPv2-TC;


hpnicfRS485 MODULE-IDENTITY
    LAST-UPDATED "200910210000Z" -- October 21, 2009
    ORGANIZATION
        ""
    CONTACT-INFO
        ""
    DESCRIPTION
        "The objects in this MIB module are used to manage RS485 interfaces,
        and manage sessions on them."
    ::= { hpnicfCommon 109 }

--
-- hpnicfRS485Properties
--
hpnicfRS485Properties OBJECT IDENTIFIER ::= { hpnicfRS485 1 }

--
-- hpnicfRS485PropertiesTable
--

hpnicfRS485PropertiesTable OBJECT-TYPE
    SYNTAX          SEQUENCE OF HpnicfRS485PropertiesEntry
    MAX-ACCESS      not-accessible
    STATUS          current
    DESCRIPTION
            "Propertie table."
    ::= { hpnicfRS485Properties 1 }

hpnicfRS485PropertiesEntry OBJECT-TYPE
    SYNTAX          HpnicfRS485PropertiesEntry
    MAX-ACCESS      not-accessible
    STATUS          current
    DESCRIPTION
            "Propertie entry."
    INDEX           { ifIndex }
    ::= { hpnicfRS485PropertiesTable 1 }

HpnicfRS485PropertiesEntry ::=
    SEQUENCE{
        hpnicfRS485RawSessionNextIndex
            Integer32,
        hpnicfRS485BaudRate
            INTEGER,
        hpnicfRS485DataBits
            INTEGER,
        hpnicfRS485Parity
            INTEGER,
        hpnicfRS485StopBits
            INTEGER,
        hpnicfRS485FlowControl
            INTEGER,
        hpnicfRS485TXCharacters
            Integer32,
        hpnicfRS485RXCharacters
            Integer32,
        hpnicfRS485TXErrCharacters
            Integer32,
        hpnicfRS485RXErrCharacters
            Integer32,
        hpnicfRS485ResetCharacters
            INTEGER
    }

hpnicfRS485RawSessionNextIndex OBJECT-TYPE
    SYNTAX          Integer32 (1..64)
    MAX-ACCESS      read-only
    STATUS          current
    DESCRIPTION
        "The next valid index of raw sessions, from 1 to 64,
        which session has been created.

        When there is no valid index left, it will return 0."
    ::= { hpnicfRS485PropertiesEntry 1 }

hpnicfRS485BaudRate OBJECT-TYPE
    SYNTAX          INTEGER {
                        bautRate300(1),         -- baud rate 300
                        bautRate600(2),         -- baud rate 600
                        bautRate1200(3),        -- baud rate 1200
                        bautRate2400(4),        -- baud rate 2400
                        bautRate4800(5),        -- baud rate 4800
                        bautRate9600(6),        -- baud rate 9600
                        bautRate19200(7),       -- baud rate 19200
                        bautRate38400(8),       -- baud rate 38400
                        bautRate57600(9),       -- baud rate 57600
                        bautRate115200(10)      -- baud rate 115200
                    }
    MAX-ACCESS      read-write
    STATUS          current
    DESCRIPTION
            "The port's baud rate."
    DEFVAL          { bautRate9600 }
    ::= { hpnicfRS485PropertiesEntry 2 }

hpnicfRS485DataBits OBJECT-TYPE
    SYNTAX          INTEGER {
                        five(1),            -- 5 data bits
                        six(2),             -- 6 data bits
                        seven(3),           -- 7 data bits
                        eight(4)            -- 8 data bits
                    }
    UNITS           "bit"
    MAX-ACCESS      read-write
    STATUS          current
    DESCRIPTION
            "The port's number of data bits in a character."
    DEFVAL          { eight }
    ::= { hpnicfRS485PropertiesEntry 3 }

hpnicfRS485Parity OBJECT-TYPE
    SYNTAX          INTEGER {
                        none(1),
                        odd(2),
                        even(3),
                        mark(4),
                        space(5)
                    }
    MAX-ACCESS      read-write
    STATUS          current
    DESCRIPTION
            "The port's sense of a character parity bit."
    DEFVAL          { none }
    ::= { hpnicfRS485PropertiesEntry 4 }

hpnicfRS485StopBits OBJECT-TYPE
    SYNTAX          INTEGER {
                        one(1),               -- 1 stop bit
                        two(2),               -- 2 stop bits
                        oneAndHalf(3)         -- 1.5 stop bits
                    }
    UNITS           "bit"
    MAX-ACCESS      read-write
    STATUS          current
    DESCRIPTION
            "The port's number of stop bits."
    DEFVAL          { one }
    ::= { hpnicfRS485PropertiesEntry 5 }

hpnicfRS485FlowControl OBJECT-TYPE
    SYNTAX          INTEGER{
                        none(1),
                        hardware(2),
                        xonOrxoff(3)
                    }
    MAX-ACCESS      read-write
    STATUS          current
    DESCRIPTION
            "The port's type of input flow control.  'none'
             indicates no flow control at this level.
             'hardware' indicates use of hardware signals.
             'xonOrxoff' indicates use of software function."
    DEFVAL          { none }
    ::= { hpnicfRS485PropertiesEntry 6 }

hpnicfRS485TXCharacters OBJECT-TYPE
    SYNTAX          Integer32
    MAX-ACCESS      read-only
    STATUS          current
    DESCRIPTION
            "The number of output characters for the port."
    ::= { hpnicfRS485PropertiesEntry 7 }

hpnicfRS485RXCharacters OBJECT-TYPE
    SYNTAX          Integer32
    MAX-ACCESS      read-only
    STATUS          current
    DESCRIPTION
            "The number of input characters for the port."
    ::= { hpnicfRS485PropertiesEntry 8 }

hpnicfRS485TXErrCharacters OBJECT-TYPE
    SYNTAX          Integer32
    MAX-ACCESS      read-only
    STATUS          current
    DESCRIPTION
            "The number of output error characters for the port."
    ::= { hpnicfRS485PropertiesEntry 9 }

hpnicfRS485RXErrCharacters OBJECT-TYPE
    SYNTAX          Integer32
    MAX-ACCESS      read-only
    STATUS          current
    DESCRIPTION
            "The number of input error characters for the port."
    ::= { hpnicfRS485PropertiesEntry 10 }

hpnicfRS485ResetCharacters OBJECT-TYPE
    SYNTAX          INTEGER {
                        counting(1),
                        clear(2)
                    }
    MAX-ACCESS      read-write
    STATUS          current
    DESCRIPTION
            "Reset the counters to zero, inlucding hpnicfRS485TXCharacters,
            hpnicfRS485RXCharacters, hpnicfRS485TXErrCharacters and
            hpnicfRS485RXErrCharacters."
    DEFVAL          { counting }
    ::= { hpnicfRS485PropertiesEntry 11 }

--
-- hpnicfRS485RawSessions
--
hpnicfRS485RawSessions OBJECT IDENTIFIER ::= { hpnicfRS485 2 }

--
-- hpnicfRS485RawSessionSummary
--
hpnicfRS485RawSessionSummary OBJECT IDENTIFIER ::= { hpnicfRS485RawSessions 1 }

hpnicfRS485RawSessionMaxNum OBJECT-TYPE
    SYNTAX          Integer32 (1..64)
    MAX-ACCESS      read-only
    STATUS          current
    DESCRIPTION
        "The max number of raw sessions what we can support."
    ::= { hpnicfRS485RawSessionSummary 1 }

--
-- hpnicfRS485RawSessionTable
--
hpnicfRS485RawSessionTable OBJECT-TYPE
    SYNTAX          SEQUENCE OF HpnicfRS485RawSessionEntry
    MAX-ACCESS      not-accessible
    STATUS          current
    DESCRIPTION
        "RS485 raw session table.  Data recieved from rs485 will be sent to
        the destination by raw sockets."
    ::= { hpnicfRS485RawSessions 2}

hpnicfRS485RawSessionEntry OBJECT-TYPE
    SYNTAX          HpnicfRS485RawSessionEntry
    MAX-ACCESS      not-accessible
    STATUS          current
    DESCRIPTION
            "Parameters of a session, including remote IP address, remote port,
            local port, and so on."
    INDEX           { ifIndex, hpnicfRS485SessionIndex }
    ::= { hpnicfRS485RawSessionTable 1 }

HpnicfRS485RawSessionEntry ::=
    SEQUENCE{
        hpnicfRS485SessionIndex
            Integer32,
        hpnicfRS485SessionType
            INTEGER,
        hpnicfRS485SessionAddType
            InetAddressType,
        hpnicfRS485SessionRemoteIP
            InetAddress,
        hpnicfRS485SessionRemotePort
            Integer32,
        hpnicfRS485SessionLocalPort
            Integer32,
        hpnicfRS485SessionStatus
            RowStatus
    }

hpnicfRS485SessionIndex OBJECT-TYPE
    SYNTAX          Integer32 (1..64)
    MAX-ACCESS      not-accessible
    STATUS          current
    DESCRIPTION
            "Raw session index."
    ::= { hpnicfRS485RawSessionEntry 1 }

hpnicfRS485SessionType OBJECT-TYPE
    SYNTAX          INTEGER {
                        udp(1),
                        tcpClient(2),
                        tcpServer(3)
                    }
    MAX-ACCESS      read-write
    STATUS          current
    DESCRIPTION
            "The type of a session.  A session can use UDP socket,
            TCP socket as a client, or TCP socket as a server."
    ::= { hpnicfRS485RawSessionEntry 2 }

hpnicfRS485SessionAddType OBJECT-TYPE
    SYNTAX          InetAddressType
    MAX-ACCESS      read-write
    STATUS          current
    DESCRIPTION
            "This object indicates the transport type of the
             address contained in hpnicfRS485SessionRemoteIP object."
    DEFVAL          { ipv4 }
    ::= { hpnicfRS485RawSessionEntry 3 }

hpnicfRS485SessionRemoteIP OBJECT-TYPE
    SYNTAX          InetAddress
    MAX-ACCESS      read-create
    STATUS          current
    DESCRIPTION
            "The IP of remote entry.

            When session type is 'udp', this is the IP of the peer.

            When session type is 'tcpClient', this is the IP of the server .

            When session type is 'tcpServer', this is invalid,
            it will return 0.
            "
    ::= { hpnicfRS485RawSessionEntry 4 }

hpnicfRS485SessionRemotePort OBJECT-TYPE
    SYNTAX          Integer32 (1024..65535)
    MAX-ACCESS      read-create
    STATUS          current
    DESCRIPTION
            "The port of remote entry.

            When session type is 'udp', this is port of the peer.

            When session type is 'tcpClient', this is the port of the server.

            When session type is 'tcpServer', this is invalid,
            it will return 0.
            "
    ::= { hpnicfRS485RawSessionEntry 5 }

hpnicfRS485SessionLocalPort OBJECT-TYPE
    SYNTAX          Integer32 (1024..65535)
    MAX-ACCESS      read-create
    STATUS          current
    DESCRIPTION
            "Local socket port.

            When session type is 'udp', this is local UDP socket port.

            When session type is 'tcpClient', this is invalid,
            it will return 0.

            When session type is 'tcpServer', this is the local port which
            will be listened.
            "
    ::= { hpnicfRS485RawSessionEntry 6 }

hpnicfRS485SessionStatus OBJECT-TYPE
    SYNTAX          RowStatus
    MAX-ACCESS      read-create
    STATUS          current
    DESCRIPTION
            "The status column used for creating,
            modifying, and deleting instances of
            the columnar objects in raw session table."
    ::= { hpnicfRS485RawSessionEntry 7 }

--
-- hpnicfRS485RawSessionErrInfoTable
--

hpnicfRS485RawSessionErrInfoTable OBJECT-TYPE
    SYNTAX          SEQUENCE OF HpnicfRS485RawSessionErrInfoEntry
    MAX-ACCESS      not-accessible
    STATUS          current
    DESCRIPTION
        "Error infomation table.  It is fail to create a session, management
        station can get infomation from this table."
    ::= { hpnicfRS485RawSessions 3}

hpnicfRS485RawSessionErrInfoEntry OBJECT-TYPE
    SYNTAX          HpnicfRS485RawSessionErrInfoEntry
    MAX-ACCESS      not-accessible
    STATUS          current
    DESCRIPTION
        "Error infomaition."
    INDEX           { ifIndex, hpnicfRS485SessionIndex }
    ::= { hpnicfRS485RawSessionErrInfoTable 1 }

HpnicfRS485RawSessionErrInfoEntry ::=
    SEQUENCE{
        hpnicfRS485RawSessionErrInfo
            DisplayString
    }

hpnicfRS485RawSessionErrInfo OBJECT-TYPE
    SYNTAX          DisplayString
    MAX-ACCESS      read-only
    STATUS          current
    DESCRIPTION
        "Error infomation string.  When a response with 'noCreeation' for
        row creation in table hpnicfRS485RawSessionTable,
        the management station should display this string to users,
        thus users can konw the reason."
    ::= { hpnicfRS485RawSessionErrInfoEntry 1 }

END
