This commit is contained in:
qazmko1029 2024-02-19 18:10:03 +01:00 committed by GitHub
commit 4b2d402cec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 11 deletions

View File

@ -74,7 +74,7 @@ namespace LwipMibCompiler
string mibFileName = Path.GetFileNameWithoutExtension(mibFile).ToLowerInvariant(); string mibFileName = Path.GetFileNameWithoutExtension(mibFile).ToLowerInvariant();
destFile = Path.Combine(destFile, mibFileName + ".c"); destFile = Path.Combine(destFile, mibFileName + ".c");
} }
string destFileExt = Path.GetExtension(destFile); string destFileExt = Path.GetExtension(destFile);
if (!String.IsNullOrEmpty(destFileExt)) if (!String.IsNullOrEmpty(destFileExt))
{ {
@ -94,10 +94,10 @@ namespace LwipMibCompiler
} }
} }
// read and resolve MIB // read and resolve MIB
Console.WriteLine(" Reading MIB file..."); Console.WriteLine(" Reading MIB file...");
MibDocument md = new MibDocument(mibFile); MibDocument md = new MibDocument(mibFile);
MibTypesResolver.ResolveTypes(md.Modules[0]); MibTypesResolver.ResolveTypes(md.Modules[0]);
MibTree mt = new MibTree(md.Modules[0] as MibModule); MibTree mt = new MibTree(md.Modules[0] as MibModule);
@ -335,7 +335,7 @@ namespace LwipMibCompiler
{ {
Console.WriteLine(String.Format("Unsupported BaseType: Module='{0}', Name='{1}'!", mibType.Module, mibType.Name)); Console.WriteLine(String.Format("Unsupported BaseType: Module='{0}', Name='{1}'!", mibType.Module, mibType.Name));
} }
return null; return null;
} }
} }
@ -353,7 +353,7 @@ namespace LwipMibCompiler
} }
else if (ote.Access == MaxAccess.readCreate) else if (ote.Access == MaxAccess.readCreate)
{ {
result.AccessMode = SnmpAccessMode.ReadOnly; result.AccessMode = SnmpAccessMode.ReadWrite;
} }
else if (ignoreAccessibleFlag && (ote.Access == MaxAccess.notAccessible)) else if (ignoreAccessibleFlag && (ote.Access == MaxAccess.notAccessible))
{ {
@ -426,7 +426,7 @@ namespace LwipMibCompiler
} }
MibTreeNode rowNode = mibTreeNode.ChildNodes[0]; MibTreeNode rowNode = mibTreeNode.ChildNodes[0];
ObjectType rot = rowNode.Entity as ObjectType; ObjectType rot = rowNode.Entity as ObjectType;
if (rot != null) if (rot != null)
{ {

View File

@ -256,7 +256,7 @@ snmp_prepare_trap_oid(struct snmp_obj_id *dest_snmp_trap_oid, const struct snmp_
if (sizeof(dest_snmp_trap_oid->id) >= sizeof(snmpTrapOID)) { if (sizeof(dest_snmp_trap_oid->id) >= sizeof(snmpTrapOID)) {
MEMCPY(&dest_snmp_trap_oid->id, snmpTrapOID , sizeof(snmpTrapOID)); MEMCPY(&dest_snmp_trap_oid->id, snmpTrapOID , sizeof(snmpTrapOID));
dest_snmp_trap_oid->len = LWIP_ARRAYSIZE(snmpTrapOID); dest_snmp_trap_oid->len = LWIP_ARRAYSIZE(snmpTrapOID);
dest_snmp_trap_oid->id[dest_snmp_trap_oid->len++] = specific_trap + 1; dest_snmp_trap_oid->id[dest_snmp_trap_oid->len++] = generic_trap + 1;
} else { } else {
err = ERR_MEM; err = ERR_MEM;
} }
@ -359,8 +359,8 @@ snmp_send_trap_or_notification_or_inform_generic(struct snmp_msg_trap *trap_msg,
NULL, /* *next */ NULL, /* *next */
NULL, /* *prev */ NULL, /* *prev */
{ /* oid */ { /* oid */
8, /* oid len */ 9, /* oid len */
{1, 3, 6, 1, 2, 1, 1, 3} /* oid for sysUpTime */ {1, 3, 6, 1, 2, 1, 1, 3, 0} /* oid for sysUpTime.0 */
}, },
SNMP_ASN1_TYPE_TIMETICKS, /* type */ SNMP_ASN1_TYPE_TIMETICKS, /* type */
sizeof(u32_t), /* value_len */ sizeof(u32_t), /* value_len */
@ -371,8 +371,8 @@ snmp_send_trap_or_notification_or_inform_generic(struct snmp_msg_trap *trap_msg,
NULL, /* *next */ NULL, /* *next */
NULL, /* *prev */ NULL, /* *prev */
{ /* oid */ { /* oid */
10, /* oid len */ 11, /* oid len */
{1, 3, 6, 1, 6, 3, 1, 1, 4, 1} /* oid for snmpTrapOID */ {1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0} /* oid for snmpTrapOID.0 */
}, },
SNMP_ASN1_TYPE_OBJECT_ID, /* type */ SNMP_ASN1_TYPE_OBJECT_ID, /* type */
0, /* value_len */ 0, /* value_len */