RFC1155-SMI(7)

πŸŽ€ RFC1155-SMI πŸŽ€ (the MIB page, but make it a group chat)

okay so this is RFC1155-SMI(7) from the MIB manual β€” the ASN.1 module that lays out the SMI definitions. It's literally one big DEFINITIONS ::= BEGIN … END block and every single line of it matters. No skimming bestie, we're reading the whole thing together πŸ’…


✨ SYNOPSIS ✨

RFC1155-SMI DEFINITIONS ::= BEGIN

πŸ’– DESCRIPTION πŸ’–

This is the module. It's an ASN.1 module. It drops a whole pile of definitions and it is very generous about what it shares β€” it exports everything (the comment literally says so, and I quote: -- EVERYTHING).

Inside you get:

  • the object identifier tree bits 🌳
  • the OBJECT-TYPE macro πŸ‘‘
  • and the full cast of syntax types πŸ’…

It ends with END. Obviously. Iconic behavior.


πŸ¦‹ EXPORTS πŸ¦‹

Here's the whole export list, no cap, no trimming, all of it:

EXPORTS -- EVERYTHING
        internet, directory, mgmt,
        experimental, private, enterprises,
        OBJECT-TYPE, ObjectName, ObjectSyntax, SimpleSyntax,
        ApplicationSyntax, NetworkAddress, IpAddress,
        Counter, Gauge, TimeTicks, Opaque;

Not me getting emotional over a keyword that just gives away every single name 😭 -- EVERYTHING is the most main character comment in this whole file.


🌸 THE OBJECT IDENTIFIER TREE 🌸

These are the OBJECT IDENTIFIER assignments, exactly as written:

  • internet β€” OBJECT IDENTIFIER ::= { iso org(3) dod(6) 1 }
  • directory β€” OBJECT IDENTIFIER ::= { internet 1 }
  • mgmt β€” OBJECT IDENTIFIER ::= { internet 2 }
  • experimental β€” OBJECT IDENTIFIER ::= { internet 3 }
  • private β€” OBJECT IDENTIFIER ::= { internet 4 }
  • enterprises β€” OBJECT IDENTIFIER ::= { private 1 }

And in the original layout, all cozy together:

internet      OBJECT IDENTIFIER ::= { iso org(3) dod(6) 1 }

directory     OBJECT IDENTIFIER ::= { internet 1 }

mgmt          OBJECT IDENTIFIER ::= { internet 2 }

experimental  OBJECT IDENTIFIER ::= { internet 3 }

private       OBJECT IDENTIFIER ::= { internet 4 }
enterprises   OBJECT IDENTIFIER ::= { private 1 }

look at them. a whole little family tree 🫢


πŸ‘‘ THE OBJECT-TYPE MACRO πŸ‘‘

The macro, verbatim, every character:

OBJECT-TYPE MACRO ::=
BEGIN
    TYPE NOTATION ::= "SYNTAX" type (TYPE ObjectSyntax)
                      "ACCESS" Access
                      "STATUS" Status
    VALUE NOTATION ::= value (VALUE ObjectName)

    Access ::= "read-only"
                    | "read-write"
                    | "write-only"
                    | "not-accessible"
    Status ::= "mandatory"
                    | "optional"
                    | "obsolete"
END

So the TYPE NOTATION takes "SYNTAX", then a type (TYPE ObjectSyntax), then "ACCESS" Access, then "STATUS" Status. And the VALUE NOTATION is value (VALUE ObjectName).

The two little menus inside it:

Access can be one of:

  • "read-only"
  • "read-write"
  • "write-only"
  • "not-accessible"

Status can be one of:

  • "mandatory"
  • "optional"
  • "obsolete"

"obsolete" is giving retired-but-still-in-the-group-chat energy πŸ’€


πŸ’… THE TYPES πŸ’…

ObjectName

ObjectName ::=
       OBJECT IDENTIFIER

ObjectSyntax

   -- syntax of objects in the MIB

   ObjectSyntax ::=
       CHOICE {
           simple
               SimpleSyntax,

   -- note that simple SEQUENCEs are not directly
   -- mentioned here to keep things simple (i.e.,
   -- prevent mis-use).  However, application-wide
   -- types which are IMPLICITly encoded simple
   -- SEQUENCEs may appear in the following CHOICE

           application-wide
               ApplicationSyntax
       }

Read those comments, bestie, they're doing the explaining for me: simple SEQUENCEs are not directly mentioned here, on purpose, to keep things simple (i.e. prevent mis-use) β€” but application-wide types that are IMPLICITly encoded simple SEQUENCEs may show up in the following CHOICE πŸ‘€

SimpleSyntax

      SimpleSyntax ::=
          CHOICE {
              number
                  INTEGER,

              string
                  OCTET STRING,

              object
                  OBJECT IDENTIFIER,

              empty
                  NULL
          }

ApplicationSyntax

      ApplicationSyntax ::=
          CHOICE {
              address
                  NetworkAddress,

              counter
                  Counter,

              gauge
                  Gauge,

              ticks
                  TimeTicks,

              arbitrary
                  Opaque

      -- other application-wide types, as they are
      -- defined, will be added here
          }

(note that closing brace indentation and the little note that other application-wide types will be added here as they get defined β€” they're leaving room in the group chat for future members πŸ₯Ή)

NetworkAddress

      -- application-wide types

      NetworkAddress ::=
          CHOICE {
              internet
                  IpAddress
          }

IpAddress

      IpAddress ::=
          [APPLICATION 0]          -- in network-byte order
              IMPLICIT OCTET STRING (SIZE (4))

SIZE (4). four. in network-byte order. locked in πŸ”’

Counter

      Counter ::=
          [APPLICATION 1]
              IMPLICIT INTEGER (0..4294967295)

Gauge

      Gauge ::=
          [APPLICATION 2]
              IMPLICIT INTEGER (0..4294967295)

TimeTicks

      TimeTicks ::=
          [APPLICATION 3]
              IMPLICIT INTEGER (0..4294967295)

three whole types that are all IMPLICIT INTEGER (0..4294967295) and honestly? consistency is a love language πŸ’–

Opaque

      Opaque ::=
          [APPLICATION 4]          -- arbitrary ASN.1 value,
              IMPLICIT OCTET STRING   --   "double-wrapped"

"double-wrapped" 😭 the quotes in the comment are killing me. arbitrary ASN.1 value, double-wrapped, no further questions.

And then:

END

slay. that's the module. πŸŽ€


Heads up bestie: this page is all definitions β€” if you're copying these blocks anywhere, keep the tags, numbers, sizes and comments exactly as they're written here, because every single one of them is load-bearing πŸ’…

ok that's literally the whole thing, you ate it 🫢 this page lives under Erlang/OTP in the SNMP corner of the manual, filed as RFC1155-SMI(7), and now you know it fr fr. go be iconic with your object identifiers ✨

πŸ“¦ where this page comes from