0

I'm trying to define an MIB for the following sample MO:

tabular_mo_struct
{
    int index1;
    int index2;
    int address [10];
    int flag;
}

flag above can take values like this (bitmask type):

val1, val2, val3,

or a combination of above val1 | val2 | ...

I'm a bit unclear

  • if my MIB should represent "address" as an octet string? I could not find any other suitable type.
  • What is the best way to represent "flag" in MIB?

Thanks in advance.

  • What type of "address"? Street address, MAC address, IPv4, IPv6? You'll find that all but one of those have a specifically defined "syntax" in SNMP. – Jolta May 19 '14 at 13:13
  • Thanks. address in my MO is of integer type. one row in the MO indexed by index1,index2 may thus have 10 addresses (as defined in the above structure). – user3651993 May 19 '14 at 15:45
  • I'm afraid I still don't follow what the "address" signifies. I can't come up with any type of address that's made up of ten integers. A MAC address is 6 bytes, an IPv4 address is 4 bytes, an IPv6 address is 128 bits, etc. If it is just another word for "sequence of integers", then yes, you should probably make up a TEXTUAL-CONVENTION describing them as OCTET STRING, with DISPLAY-HINT like "1d 1d 1d 1d 1d 1d 1d 1d 1d 1d" or similar. – Jolta May 20 '14 at 07:00
  • Yes, it is a the "sequence of integers" I was referring to and was not sure if any current type and TC can be used. As I understood, a new TC would be required to achieve this. Thanks for you help. – user3651993 May 21 '14 at 18:53

1 Answers1

1

To resolve the address field, you probably need to define a table.

For the flag, you can use BITS, which is a derived type from OCTET STRING,

https://www.rfc-editor.org/rfc/rfc2578#page-22

Community
  • 1
  • 1
Lex Li
  • 60,503
  • 9
  • 116
  • 147
  • Thank you. Yes, the above structure is a tabular object for me and a specific row in that table will have a field named "address" (sequence of 10 integers). As I understood from the previous comment, this can be achieved by defining a new TC, since existing TCs will not fit in this case. – user3651993 May 21 '14 at 19:01
  • Also, as per the definition of BITs "This collection is assigned non-negative, contiguous (but see below) values, starting at zero". Can I use it, even if sometimes this variable takes value which is OR-ed combination of these named bits? – user3651993 May 21 '14 at 19:06
  • If tabular_mo_struct is already a row in a table, then you need to define a second table to hold address. Similar cases can be found from standard RFCs such as TCP and UDP MIB documents. For your BITS question, I couldn't see why you cannot. – Lex Li May 22 '14 at 03:15