inetmib1: Add a mechanism for initializing supported OIDs, and use it in SnmpExtensionInit.

This commit is contained in:
Juan Lang 2008-05-20 20:51:30 -07:00 committed by Alexandre Julliard
parent 50f4bd16f6
commit 709a0a46e2
1 changed files with 14 additions and 1 deletions

View File

@ -50,14 +50,27 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
static UINT mib2[] = { 1,3,6,1,2,1 }; static UINT mib2[] = { 1,3,6,1,2,1 };
static UINT mib2System[] = { 1,3,6,1,2,1,1 }; static UINT mib2System[] = { 1,3,6,1,2,1,1 };
struct mibImplementation
{
AsnObjectIdentifier name;
void (*init)(void);
};
static struct mibImplementation supportedIDs[] = {
};
BOOL WINAPI SnmpExtensionInit(DWORD dwUptimeReference, BOOL WINAPI SnmpExtensionInit(DWORD dwUptimeReference,
HANDLE *phSubagentTrapEvent, AsnObjectIdentifier *pFirstSupportedRegion) HANDLE *phSubagentTrapEvent, AsnObjectIdentifier *pFirstSupportedRegion)
{ {
AsnObjectIdentifier myOid = DEFINE_OID(mib2System); AsnObjectIdentifier myOid = DEFINE_OID(mib2System);
UINT i;
FIXME("(%d, %p, %p): stub\n", dwUptimeReference, phSubagentTrapEvent, TRACE("(%d, %p, %p)\n", dwUptimeReference, phSubagentTrapEvent,
pFirstSupportedRegion); pFirstSupportedRegion);
for (i = 0; i < sizeof(supportedIDs) / sizeof(supportedIDs[0]); i++)
if (supportedIDs[i].init)
supportedIDs[i].init();
*phSubagentTrapEvent = NULL; *phSubagentTrapEvent = NULL;
SnmpUtilOidCpy(pFirstSupportedRegion, &myOid); SnmpUtilOidCpy(pFirstSupportedRegion, &myOid);
return TRUE; return TRUE;