Commit 950202a5 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

inetmib1: Return SNMP_ERRORSTATUS_NOSUCHNAME for an interface's description if it has none.

parent da9bc130
...@@ -553,6 +553,22 @@ static INT setOidWithItemAndInteger(AsnObjectIdentifier *dst, ...@@ -553,6 +553,22 @@ static INT setOidWithItemAndInteger(AsnObjectIdentifier *dst,
return ret; return ret;
} }
static DWORD copyIfRowDescr(AsnAny *value, void *src)
{
PMIB_IFROW row = (PMIB_IFROW)((BYTE *)src -
FIELD_OFFSET(MIB_IFROW, dwDescrLen));
DWORD ret;
if (row->dwDescrLen)
{
setStringValue(value, ASN_OCTETSTRING, row->dwDescrLen, row->bDescr);
ret = SNMP_ERRORSTATUS_NOERROR;
}
else
ret = SNMP_ERRORSTATUS_NOSUCHNAME;
return ret;
}
static DWORD copyIfRowPhysAddr(AsnAny *value, void *src) static DWORD copyIfRowPhysAddr(AsnAny *value, void *src)
{ {
PMIB_IFROW row = (PMIB_IFROW)((BYTE *)src - PMIB_IFROW row = (PMIB_IFROW)((BYTE *)src -
...@@ -572,7 +588,7 @@ static DWORD copyIfRowPhysAddr(AsnAny *value, void *src) ...@@ -572,7 +588,7 @@ static DWORD copyIfRowPhysAddr(AsnAny *value, void *src)
static struct structToAsnValue mib2IfEntryMap[] = { static struct structToAsnValue mib2IfEntryMap[] = {
{ FIELD_OFFSET(MIB_IFROW, dwIndex), copyInt }, { FIELD_OFFSET(MIB_IFROW, dwIndex), copyInt },
{ FIELD_OFFSET(MIB_IFROW, dwDescrLen), copyLengthPrecededString }, { FIELD_OFFSET(MIB_IFROW, dwDescrLen), copyIfRowDescr },
{ FIELD_OFFSET(MIB_IFROW, dwType), copyInt }, { FIELD_OFFSET(MIB_IFROW, dwType), copyInt },
{ FIELD_OFFSET(MIB_IFROW, dwMtu), copyInt }, { FIELD_OFFSET(MIB_IFROW, dwMtu), copyInt },
{ FIELD_OFFSET(MIB_IFROW, dwSpeed), copyInt }, { FIELD_OFFSET(MIB_IFROW, dwSpeed), copyInt },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment