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

This commit is contained in:
Juan Lang 2009-12-07 13:32:57 -08:00 committed by Alexandre Julliard
parent da9bc130c6
commit 950202a59b
1 changed files with 17 additions and 1 deletions

View File

@ -553,6 +553,22 @@ static INT setOidWithItemAndInteger(AsnObjectIdentifier *dst,
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)
{
PMIB_IFROW row = (PMIB_IFROW)((BYTE *)src -
@ -572,7 +588,7 @@ static DWORD copyIfRowPhysAddr(AsnAny *value, void *src)
static struct structToAsnValue mib2IfEntryMap[] = {
{ 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, dwMtu), copyInt },
{ FIELD_OFFSET(MIB_IFROW, dwSpeed), copyInt },