From a0e266befb7df46547876d951beb3d0c2ba6ff2e Mon Sep 17 00:00:00 2001 From: Kristofer Hallin Date: Mon, 4 Jul 2022 17:12:40 +0200 Subject: [PATCH] New MIB and implementation with clixonInetTable. --- test/mibs/CLIXON-TYPES-MIB.txt | 105 ++++++++++++++++++++++++++++++--- test/test_snmp_get.sh | 10 ++++ 2 files changed, 106 insertions(+), 9 deletions(-) diff --git a/test/mibs/CLIXON-TYPES-MIB.txt b/test/mibs/CLIXON-TYPES-MIB.txt index a73869ac..cc467f14 100644 --- a/test/mibs/CLIXON-TYPES-MIB.txt +++ b/test/mibs/CLIXON-TYPES-MIB.txt @@ -36,6 +36,8 @@ clixonExamples MODULE-IDENTITY clixonExampleScalars OBJECT IDENTIFIER ::= { clixonExamples 1 } clixonExampleTables OBJECT IDENTIFIER ::= { clixonExamples 2 } clixonExampleNotifications OBJECT IDENTIFIER ::= { clixonExamples 3 } +clixonTables OBJECT IDENTIFIER ::= { clixonExamples 4 } +clixonInetTables OBJECT IDENTIFIER ::= { clixonExamples 5 } clixonExampleNotificationPrefix OBJECT IDENTIFIER ::= { clixonExampleNotifications 0 } clixonExampleNotificationObjects OBJECT IDENTIFIER @@ -214,15 +216,7 @@ ifStackStatus OBJECT-TYPE interfaces, and many implementations will choose not to support write-access for any type of interface." ::= { clixonExampleScalars 12 } - -ifIpAddr OBJECT-TYPE - SYNTAX InetAddress - MAX-ACCESS read-write - STATUS current - DESCRIPTION - "Example IP" - ::= { clixonExampleScalars 13 } - + -- -- Example Tables -- @@ -274,6 +268,59 @@ nsIETFWGChair2 OBJECT-TYPE working group." ::= { clixonIETFWGEntry 3 } + + + + +clixonTable OBJECT-TYPE + SYNTAX SEQUENCE OF ClixonEntry + MAX-ACCESS not-accessible + STATUS current + DESCRIPTION + "This table merely contains a set of data which is otherwise + useless for true network management. It is a table which + describes properies about a IETF Working Group, such as the + names of the two working group chairs. + This example table is implemented in the + agent/mibgroup/examples/data_set.c file." + ::= { clixonTables 1 } +clixonEntry OBJECT-TYPE + SYNTAX ClixonEntry + MAX-ACCESS not-accessible + STATUS current + DESCRIPTION + "A row describing a given working group" + INDEX { nsName } + ::= {clixonTable 1 } +ClixonEntry ::= SEQUENCE { + nsName INTEGER, + nsChair1 OCTET STRING, + nsChair2 OCTET STRING +} +nsName OBJECT-TYPE + SYNTAX INTEGER (1..2147483647) + MAX-ACCESS not-accessible + STATUS current + DESCRIPTION + "The name of the IETF Working Group this table describes." + ::= { clixonEntry 1 } +nsChair1 OBJECT-TYPE + SYNTAX OCTET STRING + MAX-ACCESS read-write + STATUS current + DESCRIPTION + "One of the names of the chairs for the IETF working group." + ::= { clixonEntry 2 } +nsChair2 OBJECT-TYPE + SYNTAX OCTET STRING + MAX-ACCESS read-create + STATUS current + DESCRIPTION + "The other name, if one exists, of the chairs for the IETF + working group." + ::= { clixonEntry 3 } + + -- -- A table used in a table_iterator example -- (agent/mibgroup/examples/clixonHostsTable*.[ch]) @@ -353,4 +400,44 @@ clixonObjectID OBJECT-TYPE to its `Fred Router'." ::= { netSnmp 3 } + +clixonInetTable OBJECT-TYPE + SYNTAX SEQUENCE OF ClixonInetEntry + MAX-ACCESS not-accessible + STATUS current + DESCRIPTION + "This table merely contains a set of data which is otherwise + useless for true network management. It is a table which + describes properies about a IETF Working Group, such as the + names of the two working group chairs. + This example table is implemented in the + agent/mibgroup/examples/data_set.c file." + ::= { clixonExampleTables 3 } +clixonInetEntry OBJECT-TYPE + SYNTAX ClixonInetEntry + MAX-ACCESS not-accessible + STATUS current + DESCRIPTION + "A row describing a given working group" + INDEX { clixonAddress } + ::= {clixonInetTable 1 } +ClixonInetEntry ::= SEQUENCE { + clixonAddress InetAddress, + clixonString OCTET STRING +} +clixonAddress OBJECT-TYPE + SYNTAX InetAddress + MAX-ACCESS not-accessible + STATUS current + DESCRIPTION + "The name of the IETF Working Group this table describes." + ::= { clixonInetEntry 2 } +clixonString OBJECT-TYPE + SYNTAX OCTET STRING + MAX-ACCESS read-write + STATUS current + DESCRIPTION + "One of the names of the chairs for the IETF working group." + ::= { clixonInetEntry 3 } + END diff --git a/test/test_snmp_get.sh b/test/test_snmp_get.sh index 0641c089..2c5d6396 100755 --- a/test/test_snmp_get.sh +++ b/test/test_snmp_get.sh @@ -84,6 +84,16 @@ cat < $fstate active + + + 1.2.3.4 + foo + + + 2.2.2.2 + bar + + EOF