简体   繁体   中英

Maximum Length of Octet String allowed to send from SNMP Agent using LWIP

I am trying to implement SNMP agent on a device using LWIP Library in Xilinx SDK.

I successfully implemented the agent and got the agent running over my device to respond to commands (snmpget, snmpset,snmpwalk).

But if a OID has to return an octet string of length > 255, the agent behaves suspiciously. when i tried to pass the octet string of length >255, i recieve no data on that oid and agent gets disconnected after that and will not repsond to any furthur commands.

snmp octet strings of length <255 are correctly received with no problem (no issues).. I wonder does LWIP SNMP Agent has limitation on the size of the octet string..??

I found a solution...!!!

in the file src\\lwip-1.4.0\\src\\core\\snmp\\msg_in.c , which processes the incoming messages is converting the length of string from u16_t to u8_t. It indicates the range has now deprecated to (0-255). So the problem.

I changed the u8_t's which are restricting me from processing octet strings of lenght > 255 to u16_t's.

Now the LWIP Library is able to handle message of length > 255..

Thanks..!!!

Objects defined as octet strings are typically limited to 255 bytes, either directly,

    SYNTAX               OCTET STRING (SIZE (0..255))

or indirectly by using something like DisplayString

    SYNTAX               DisplayString

which is in turn limited to 255 bytes.

DisplayString ::= TEXTUAL-CONVENTION 
    DISPLAY-HINT         "255a" 
    STATUS                current 
    DESCRIPTION          "Represents textual information taken from the NVT ASCII..."
    SYNTAX                OCTET STRING (SIZE (0..255))

Take a look at RFC 2578 and 2579 . You can define an object with a larger size, but bear in mind that SNMP isn't meant to transfer large sets of data.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM