Encoding via BER: octet strings in SNMP with double quotes - SNMP

This is a discussion on Encoding via BER: octet strings in SNMP with double quotes - SNMP ; After scoring the net in search of the answer (and not finding it), I ask here. I understand: SNMP is based off ASN.1, and SNMP traps are encoded via the BER. Given this, if I had a trap defined with ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Encoding via BER: octet strings in SNMP with double quotes

  1. Encoding via BER: octet strings in SNMP with double quotes


    After scoring the net in search of the answer (and not finding it), I ask
    here.

    I understand:

    SNMP is based off ASN.1, and SNMP traps are encoded via the BER.

    Given this, if I had a trap defined with a part:

    Description OBJECT-TYPE
    SYNTAX OCTET STRING(SIZE(0..2000))
    ACCESS read-only
    STATUS mandatory
    DESCRIPTION
    "Description of the alarm being signalled"
    ::= { AlarmObjs 10 }


    when encoding the string:


    this is a string with a " in it


    what would the encoding be in regards to the double quote?

    Thanks in advance for any answer.

    Jamie

  2. Re: Encoding via BER: octet strings in SNMP with double quotes

    HI,

    Octets of an OCTET STRING are encoded in binary. So, the binary
    for a quote character, a ("), is the binary value, which is 22 hex.

    The definition of BER is found in X.209.

    On Mon, 17 Nov 2003, Jamie Love wrote:
    > After scoring the net in search of the answer (and not finding it), I ask
    > here.
    >
    > I understand:
    >
    > SNMP is based off ASN.1, and SNMP traps are encoded via the BER.
    >
    > Given this, if I had a trap defined with a part:
    >
    > Description OBJECT-TYPE
    > SYNTAX OCTET STRING(SIZE(0..2000))
    > ACCESS read-only
    > STATUS mandatory
    > DESCRIPTION
    > "Description of the alarm being signalled"
    > ::= { AlarmObjs 10 }
    >
    >
    > when encoding the string:
    >
    >
    > this is a string with a " in it
    >
    >
    > what would the encoding be in regards to the double quote?
    >
    > Thanks in advance for any answer.
    >
    > Jamie


    Regards,
    /david



  3. Re: Encoding via BER: octet strings in SNMP with double quotes

    On Mon, 17 Nov 2003 03:34:53 +0000, dperkin wrote:

    That is what I thought. I suppose my question was really, there is no 'special'
    encoding required is there...

    The reason I am being so basic here is that, though I know ASN.1/BER well,
    in the context of SNMP it is not so clear (or at least it is not in the
    discussions I have been having).

    Thanks.

    > HI,
    >
    > Octets of an OCTET STRING are encoded in binary. So, the binary
    > for a quote character, a ("), is the binary value, which is 22 hex.
    >
    > The definition of BER is found in X.209.
    >


    Jamie


  4. Re: Encoding via BER: octet strings in SNMP with double quotes

    Jamie Love wrote:

    > The reason I am being so basic here is that, though I know ASN.1/BER well,
    > in the context of SNMP it is not so clear (or at least it is not in the
    > discussions I have been having).


    At least an OCTET STRING is still an OCTET STRING in SNMP land (even
    though it has an implicit size restriction in SNMP land that does not
    exist in pure ASN.1)...

    /js

    --
    Juergen Schoenwaelder International University Bremen
    P.O. Box 750 561, 28725 Bremen, Germany

+ Reply to Thread