ANSC_STATUS WebUpoInitialize ( ANSC_HANDLE hThisObject ) { ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS; PWEB_URI_PATH_OBJECT pMyObject = (PWEB_URI_PATH_OBJECT)hThisObject; ULONG i = 0; /* * Until you have to simulate C++ object-oriented programming style with standard C, you don't * appreciate all the nice little things come with C++ language and all the dirty works that * have been done by the C++ compilers. Member initialization is one of these things. While in * C++ you don't have to initialize all the member fields inherited from the base class since * the compiler will do it for you, such is not the case with C. */ AnscCoInitialize((ANSC_HANDLE)pMyObject); /* * Although we have initialized some of the member fields in the "create" member function, we * repeat the work here for completeness. While this simulation approach is pretty stupid from * a C++/Java programmer perspective, it's the best we can get for universal embedded network * programming. Before we develop our own operating system (don't expect that to happen any * time soon), this is the way things gonna be. */ pMyObject->Oid = WEB_URI_PATH_OID; pMyObject->Create = WebUpoCreate; pMyObject->Remove = WebUpoRemove; pMyObject->EnrollObjects = WebUpoEnrollObjects; pMyObject->Initialize = WebUpoInitialize; pMyObject->hResourceOwner = (ANSC_HANDLE)NULL; pMyObject->HashIndex = 0; pMyObject->IsRemoveable = WebUpoIsRemoveable; pMyObject->GetPathName = WebUpoGetPathName; pMyObject->SetPathName = WebUpoSetPathName; pMyObject->GetResourceOwner = WebUpoGetResourceOwner; pMyObject->SetResourceOwner = WebUpoSetResourceOwner; pMyObject->Reset = WebUpoReset; pMyObject->GetUriPath = WebUpoGetUriPath; pMyObject->AddUriPath = WebUpoAddUriPath; pMyObject->DelUriPath = WebUpoDelUriPath; pMyObject->DelAllUriPaths = WebUpoDelAllUriPaths; for ( i = 0; i < WEB_UPO_UPO_TABLE_SIZE; i++ ) { AnscQueueInitializeHeader(&pMyObject->UpoTable[i]); } AnscInitializeLock(&pMyObject->UpoTableLock); return ANSC_STATUS_SUCCESS; }
/********************************************************************** prototype: void* CcspCreateScalarHelper ( ); description: This function is called to create an object of "CCSP_SCALAR_HELPER_OBJECT". argument: None return: The handle of the object; **********************************************************************/ void* CcspCreateScalarHelper ( ) { PCCSP_SCALAR_HELPER_OBJECT pThisObject = NULL; pThisObject = (PCCSP_SCALAR_HELPER_OBJECT)AnscAllocateMemory(sizeof(CCSP_SCALAR_HELPER_OBJECT)); if( pThisObject == NULL) { return NULL; } AnscZeroMemory((void*)pThisObject, sizeof(CCSP_SCALAR_HELPER_OBJECT)); pThisObject->pMibFilter = 0; pThisObject->bHasWritable = FALSE; pThisObject->uMaxOid = 0; pThisObject->uMinOid = 0; pThisObject->uOidLen = 0; pThisObject->uCacheTimeout = 30; pThisObject->HandleRequestsCallback = NULL; pThisObject->pCcspComp = NULL; pThisObject->pCcspPath = NULL; pThisObject->nCacheMibCount = 0; pThisObject->LoadMibs = CcspScalarHelperLoadMibs; pThisObject->Remove = CcspScalarHelperRemove; pThisObject->RegisterMibHandler = CcspScalarHelperRegisterMibHandler; pThisObject->RefreshCache = CcspScalarHelperRefreshCache; pThisObject->ClearCache = CcspScalarHelperClearCache; pThisObject->SetMibValues = CcspScalarHelperSetMibValues; pThisObject->GetMibValues = CcspScalarHelperGetMibValues; /* init the queues */ AnscQueueInitializeHeader(&pThisObject->MibValueQueue); AnscQueueInitializeHeader(&pThisObject->MibObjQueue); return (void*)pThisObject; }
/********************************************************************** prototype: ANSC_HANDLE CcspCreateNamespaceMgr ( char* pContainerName ); description: This function is called to create a NamespaceComponent object argument: char* pContainerName return: The NamespaceComponent handle; **********************************************************************/ ANSC_HANDLE CcspCreateNamespaceMgr ( char* pContainerName ) { PCCSP_NAMESPACE_MGR_OBJECT pThisObject = (PCCSP_NAMESPACE_MGR_OBJECT)NULL; pThisObject = (PCCSP_NAMESPACE_MGR_OBJECT) AnscAllocateMemory(sizeof(CCSP_NAMESPACE_MGR_OBJECT)); if( pThisObject == NULL) { return NULL; } /* * Initialize the common variables and functions. */ AnscCopyString(pThisObject->pContainerName, pContainerName); pThisObject->uTotalNamespace = 0; AnscQueueInitializeHeader(&pThisObject->ComponentQueue); pThisObject->GetCountOfRegNamespace = CcspNsMgrGetCountOfRegNamespace; pThisObject->LookforComponent = CcspNsMgrLookforComponent; pThisObject->RegisterNamespaces = CcspNsMgrRegisterNamespaces; pThisObject->BuildNamespaces = CcspNsMgrBuildNamespaces; pThisObject->UnregisterNamespace = CcspNsMgrUnregisterNamespace; pThisObject->UnregisterComponent = CcspNsMgrUnregisterComponent; pThisObject->DiscoverNamespace = CcspNsMgrDiscoverNamespace; pThisObject->CheckNamespaceDataType = CcspNsMgrCheckNamespaceDataType; pThisObject->GetRegisteredComponents = CcspNsMgrGetRegisteredComponents; pThisObject->GetNamespaceByComponent = CcspNsMgrGetNamespaceByComponent; pThisObject->DumpObject = CcspNsMgrDumpObject; pThisObject->CleanAll = CcspNsMgrCleanAll; /* create the hash table */ pThisObject->hAtomNamespace = AnscCreateAtomTable ( (ANSC_HANDLE)pThisObject, (ANSC_HANDLE)pThisObject, NULL ); return (ANSC_HANDLE)pThisObject; }
ANSC_STATUS BspTemplateListCOInitialize ( ANSC_HANDLE hThisObject ) { PBSP_TEMPLATE_LIST_OBJECT pMyObject = (PBSP_TEMPLATE_LIST_OBJECT)hThisObject; int i; if ( !pMyObject ) { return ANSC_STATUS_FAILURE; } pMyObject->AddItem = BspTemplateListAddItem; pMyObject->UpdateItem = BspTemplateListUpdateItem; pMyObject->FindItem = BspTemplateListFindItem; pMyObject->AddGroup = BspTemplateListAddGroup; pMyObject->Store = BspTemplateListStore; pMyObject->Load = BspTemplateListLoad; pMyObject->IsTemplateLoaded = BspTemplateListIsTemplateLoaded; pMyObject->SetTemplateLoaded = BspTemplateListSetTemplateLoaded; pMyObject->RegisterTemplate = BspTemplateListRegisterTemplate; pMyObject->GetRegisteredTemplate = BspTemplateListGetRegisteredTemplate; pMyObject->SetTemplateSource = BspTemplateListSetTemplateSource; pMyObject->UseArchive = BspTemplateListUseArchive; pMyObject->AddTemplate = BspTemplateListAddTemplate; pMyObject->GetTemplate = BspTemplateListGetTemplate; pMyObject->ImportTemplates = BspTemplateListImportTemplates; pMyObject->ClearTemplates = BspTemplateListClearTemplates; pMyObject->SetCmif = BspTemplateListSetCmif; pMyObject->GetCmif = BspTemplateListGetCmif; pMyObject->CacheTemplates = BspTemplateListCacheTemplates; pMyObject->LoadCacheTemplates = BspTemplateListLoadCacheTemplates; pMyObject->Remove = BspTemplateListCORemove; pMyObject->Initialize = BspTemplateListCOInitialize; pMyObject->SetBspSoaIf = BspTemplateListSetBspSoaIf; pMyObject->GetBspSoaIf = BspTemplateListGetBspSoaIf; pMyObject->hList = AnscCreatePtrArrayComponent(NULL, NULL, NULL); pMyObject->hLoadedTemplatesList = AnscCreatePtrArrayComponent(NULL, NULL, NULL); for (i = 0; i < BSP_TEMPLATE_LIST_REG_TABLE_SIZE; i ++) { AnscQueueInitializeHeader(&pMyObject->RegTemplateTable[i]); } return ANSC_STATUS_SUCCESS; }
ANSC_STATUS AnscTsoReset ( ANSC_HANDLE hThisObject ) { ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS; PANSC_TIMER_SCHEDULER_OBJECT pMyObject = (PANSC_TIMER_SCHEDULER_OBJECT)hThisObject; PANSC_TIMER_DESCRIPTOR_OBJECT pTimerDescriptor = NULL; PSINGLE_LINK_ENTRY pSLinkEntry = NULL; AnscAcquireSpinLock (&pMyObject->TdoQueueSpinLock); AnscQueueInitializeHeader(&pMyObject->TdoQueue ); AnscReleaseSpinLock (&pMyObject->TdoQueueSpinLock); pMyObject->hCurInvokedTdo = (ANSC_HANDLE)NULL; return ANSC_STATUS_SUCCESS; }
ANSC_STATUS HttpFcoDelAllFeos ( ANSC_HANDLE hThisObject ) { ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS; PHTTP_FORM_CONTENT_OBJECT pMyObject = (PHTTP_FORM_CONTENT_OBJECT)hThisObject; PHTTP_HFP_INTERFACE pHfpIf = (PHTTP_HFP_INTERFACE )pMyObject->hHfpIf; PHTTP_FORM_ELEMENT pFormElement = NULL; PSINGLE_LINK_ENTRY pSLinkEntry = NULL; ULONG i = 0; for ( i = 0; i < HTTP_FCO_FEO_TABLE_SIZE; i++ ) { AnscQueueInitializeHeader(&pMyObject->FeoTable[i]); } return ANSC_STATUS_SUCCESS; }
/********************************************************************** prototype: ANSC_HANDLE CcspCreateNamespaceComponent ( char* pContainerName ); description: This function is called to create a NamespaceComponent object argument: char* pContainerName return: The NamespaceComponent handle; **********************************************************************/ ANSC_HANDLE CcspCreateNamespaceComponent ( char* pContainerName ) { PCCSP_NAMESPACE_COMP_OBJECT pThisObject = (PCCSP_NAMESPACE_COMP_OBJECT)NULL; pThisObject = (PCCSP_NAMESPACE_COMP_OBJECT) AnscAllocateMemory(sizeof(CCSP_NAMESPACE_COMP_OBJECT)); if( pThisObject == NULL) { return NULL; } /* * Initialize the common variables and functions. */ pThisObject->pContainerName = pContainerName; AnscZeroMemory(pThisObject->pCompName, CCSP_MAXI_COMPONENT_NAME_LENGTH); AnscZeroMemory(pThisObject->pDbusPath, CCSP_MAXI_DBUS_PATH_LENGTH); AnscZeroMemory(pThisObject->pPrefix, CCSP_MAXI_SUBSYSTEM_PREFIX); AnscQueueInitializeHeader(&pThisObject->ParamspaceQueue); pThisObject->UnregisterNamespace = CcspNsCompUnregisterNamespace; pThisObject->GetNamespaceCount = CcspNsCompGetNamespaceCount; pThisObject->GetNamespaceStringArray = CcspNsCompGetNamespaceStringArray; pThisObject->GetNamespaceStructArray = CcspNsCompGetNamespaceStructArray; pThisObject->BuildFromNamespaceStringArray = CcspNsCompBuildFromNamespaceStringArray; pThisObject->BuildFromNamespaceStructArray = CcspNsCompBuildFromNamespaceStructArray; pThisObject->IsObjectSupported = CcspNsCompIsObjectSupported; pThisObject->DumpObject = CcspNsCompDumpObject; pThisObject->CleanAll = CcspNsCompCleanAll; return (ANSC_HANDLE)pThisObject; }
ANSC_STATUS DslhDmagntCancel ( ANSC_HANDLE hThisObject ) { PDSLH_DATAMODEL_AGENT_OBJECT pMyObject = (PDSLH_DATAMODEL_AGENT_OBJECT)hThisObject; PSINGLE_LINK_ENTRY pSListEntry = NULL; PPLUGIN_INFORMATION pInfo = NULL; if ( !pMyObject->bActive ) { return ANSC_STATUS_SUCCESS; } /* remove all the pluginInfo */ pSListEntry = AnscQueueGetFirstEntry(&pMyObject->sPluginInfoList); while( pSListEntry != NULL) { pInfo = ACCESS_PLUGIN_INFORMATION(pSListEntry); pSListEntry = AnscQueueGetNextEntry(pSListEntry); if( pInfo != NULL) { DslhDmagntRemovePluginInfo(pMyObject, pInfo); } } AnscQueueInitializeHeader(&pMyObject->sPluginInfoList); pMyObject->bActive = FALSE; return ANSC_STATUS_SUCCESS; }
ANSC_STATUS AnscDetoInitialize ( ANSC_HANDLE hThisObject ) { ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS; PANSC_DAEMON_ENGINE_TCP_OBJECT pMyObject = (PANSC_DAEMON_ENGINE_TCP_OBJECT)hThisObject; ULONG i = 0; /* * Until you have to simulate C++ object-oriented programming style with standard C, you don't * appreciate all the nice little things come with C++ language and all the dirty works that * have been done by the C++ compilers. Member initialization is one of these things. While in * C++ you don't have to initialize all the member fields inherited from the base class since * the compiler will do it for you, such is not the case with C. */ AnscCoInitialize((ANSC_HANDLE)pMyObject); /* * Although we have initialized some of the member fields in the "create" member function, we * repeat the work here for completeness. While this simulation approach is pretty stupid from * a C++/Java programmer perspective, it's the best we can get for universal embedded network * programming. Before we develop our own operating system (don't expect that to happen any * time soon), this is the way things gonna be. */ pMyObject->Oid = ANSC_DAEMON_ENGINE_TCP_OID; pMyObject->Create = AnscDetoCreate; pMyObject->Remove = AnscDetoRemove; pMyObject->EnrollObjects = AnscDetoEnrollObjects; pMyObject->Initialize = AnscDetoInitialize; pMyObject->hDaemonServer = (ANSC_HANDLE)NULL; pMyObject->CurSocketCount = 0; pMyObject->MaxSocketCount = ANSC_DETO_MAX_SOCKET_COUNT; pMyObject->ControlFlags = 0; pMyObject->StartTime = 0; pMyObject->AvgServingTime = 0; pMyObject->SocketTimeOut = ANSC_DETO_SOCKET_TIMEOUT; pMyObject->bStarted = FALSE; pMyObject->bCleaningDemanded = FALSE; pMyObject->bBusy = FALSE; pMyObject->TtcCount = 0; pMyObject->MtcCount = 0; pMyObject->TrcCount = 0; pMyObject->MrcCount = 0; pMyObject->TscCount = 0; pMyObject->MscCount = 0; pMyObject->GetDaemonServer = AnscDetoGetDaemonServer; pMyObject->SetDaemonServer = AnscDetoSetDaemonServer; pMyObject->GetMaxSocketCount = AnscDetoGetMaxSocketCount; pMyObject->SetMaxSocketCount = AnscDetoSetMaxSocketCount; pMyObject->GetControlFlags = AnscDetoGetControlFlags; pMyObject->SetControlFlags = AnscDetoSetControlFlags; pMyObject->Reset = AnscDetoReset; pMyObject->GetSocketByAddress = AnscDetoGetSocketByAddress; pMyObject->GetSocketByAddress2 = AnscDetoGetSocketByAddress2; pMyObject->GetSocketByOsocket = AnscDetoGetSocketByOsocket; pMyObject->GetSocketByOsocket2 = AnscDetoGetSocketByOsocket2; pMyObject->AddSocket = AnscDetoAddSocket; pMyObject->DelSocket = AnscDetoDelSocket; pMyObject->DelAllSockets = AnscDetoDelAllSockets; pMyObject->ExpAllSockets = AnscDetoExpAllSockets; pMyObject->EnableRecv = AnscDetoEnableRecv; pMyObject->EnableSend = AnscDetoEnableSend; pMyObject->RecvTask = AnscDetoRecvTask; pMyObject->SendTask = AnscDetoSendTask; pMyObject->Start = AnscDetoStart; pMyObject->Stop = AnscDetoStop; pMyObject->Cancel = AnscDetoCancel; pMyObject->Clean = AnscDetoClean; pMyObject->Snapshot = AnscDetoSnapshot; pMyObject->CloseUp = AnscDetoCloseUp; pMyObject->Recv = AnscDetoRecv; pMyObject->Recv2 = AnscDetoRecv2; pMyObject->Send = AnscDetoSend; pMyObject->Send2 = AnscDetoSend2; AnscInitializeEvent(&pMyObject->RecvEvent ); AnscSetEvent (&pMyObject->RecvEvent ); AnscInitializeEvent(&pMyObject->SendEvent ); AnscSetEvent (&pMyObject->SendEvent ); AnscInitializeEvent(&pMyObject->NewSocketEvent); AnscResetEvent (&pMyObject->NewSocketEvent); AnscInitializeLock(&pMyObject->RecvSocketSetLock); AnscInitializeLock(&pMyObject->SendSocketSetLock); for ( i = 0; i < ANSC_DETO_SOCKET_TABLE_SIZE; i++ ) { AnscSListInitializeHeader(&pMyObject->SocketTable[i]); } AnscInitializeLock(&pMyObject->SocketTableLock); AnscQueueInitializeHeader(&pMyObject->PacketQueue ); AnscInitializeLock (&pMyObject->PacketQueueLock); return ANSC_STATUS_SUCCESS; }
ANSC_STATUS CcspCwmpsoInitialize ( ANSC_HANDLE hThisObject ) { ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS; PCCSP_CWMP_SESSION_OBJECT pMyObject = (PCCSP_CWMP_SESSION_OBJECT)hThisObject; /* * Until you have to simulate C++ object-oriented programming style with standard C, you don't * appreciate all the nice little things come with C++ language and all the dirty works that * have been done by the C++ compilers. Member initialization is one of these things. While in * C++ you don't have to initialize all the member fields inherited from the base class since * the compiler will do it for you, such is not the case with C. */ AnscCoInitialize((ANSC_HANDLE)pMyObject); /* * Although we have initialized some of the member fields in the "create" member function, we * repeat the work here for completeness. While this simulation approach is pretty stupid from * a C++/Java programmer perspective, it's the best we can get for universal embedded network * programming. Before we develop our own operating system (don't expect that to happen any * time soon), this is the way things gonna be. */ pMyObject->Oid = CCSP_CWMP_SESSION_OID; pMyObject->Create = CcspCwmpsoCreate; pMyObject->Remove = CcspCwmpsoRemove; pMyObject->EnrollObjects = CcspCwmpsoEnrollObjects; pMyObject->Initialize = CcspCwmpsoInitialize; pMyObject->hCcspCwmpCpeController = (ANSC_HANDLE)NULL; pMyObject->hCcspCwmpProcessor = (ANSC_HANDLE)NULL; pMyObject->AsyncTaskCount = 0; pMyObject->bActive = FALSE; pMyObject->bInformWhenActive = FALSE; pMyObject->GlobalRequestID = 1; pMyObject->SessionState = CCSP_CWMPSO_SESSION_STATE_idle; pMyObject->CpeMaxEnvelopes = CCSP_CWMP_CPE_MAX_ENVELOPES; pMyObject->AcsMaxEnvelopes = 1; pMyObject->ActiveResponses = 0; pMyObject->bHoldRequests = FALSE; pMyObject->bNoMoreRequests = FALSE; pMyObject->bLastEmptyRequestSent = FALSE; pMyObject->EventCount = 0; pMyObject->RetryCount = 0; pMyObject->ModifiedParamCount = 0; pMyObject->GetCcspCwmpAcsConnection = CcspCwmpsoGetCcspCwmpAcsConnection; pMyObject->GetCcspCwmpMcoIf = CcspCwmpsoGetCcspCwmpMcoIf; pMyObject->GetCcspCwmpCpeController = CcspCwmpsoGetCcspCwmpCpeController; pMyObject->SetCcspCwmpCpeController = CcspCwmpsoSetCcspCwmpCpeController; pMyObject->GetCcspCwmpProcessor = CcspCwmpsoGetCcspCwmpProcessor; pMyObject->SetCcspCwmpProcessor = CcspCwmpsoSetCcspCwmpProcessor; pMyObject->Reset = CcspCwmpsoReset; pMyObject->AcqAccess = CcspCwmpsoAcqAccess; pMyObject->RelAccess = CcspCwmpsoRelAccess; pMyObject->SessionTimerInvoke = CcspCwmpsoSessionTimerInvoke; pMyObject->SessionRetryTimerInvoke = CcspCwmpsoSessionRetryTimerInvoke; pMyObject->DelayedActiveNotifTimerInvoke = CcspCwmpsoDelayedActiveNotifTimerInvoke; pMyObject->StartRetryTimer = CcspCwmpsoStartRetryTimer; pMyObject->StopRetryTimer = CcspCwmpsoStopRetryTimer; pMyObject->StopDelayedActiveNotifTimer = CcspCwmpsoStopDelayedActiveNotifTimer; pMyObject->IsAcsConnected = CcspCwmpsoIsAcsConnected; pMyObject->ConnectToAcs = CcspCwmpsoConnectToAcs; pMyObject->CloseConnection = CcspCwmpsoCloseConnection; pMyObject->AddCwmpEvent = CcspCwmpsoAddCwmpEvent; pMyObject->DiscardCwmpEvent = CcspCwmpsoDiscardCwmpEvent; pMyObject->DelAllEvents = CcspCwmpsoDelAllEvents; pMyObject->AddModifiedParameter = CcspCwmpsoAddModifiedParameter; pMyObject->DelAllParameters = CcspCwmpsoDelAllParameters; pMyObject->SaveCwmpEvent = CcspCwmpsoSaveCwmpEvent; pMyObject->GetRpcMethods = CcspCwmpsoGetRpcMethods; pMyObject->Inform = CcspCwmpsoInform; pMyObject->TransferComplete = CcspCwmpsoTransferComplete; pMyObject->AutonomousTransferComplete= CcspCwmpsoAutonomousTransferComplete; pMyObject->Kicked = CcspCwmpsoKicked; pMyObject->RequestDownload = CcspCwmpsoRequestDownload; pMyObject->DUStateChangeComplete = CcspCwmpsoDUStateChangeComplete; pMyObject->AutonomousDUStateChangeComplete = CcspCwmpsoAutonomousDUStateChangeComplete; pMyObject->RecvSoapMessage = CcspCwmpsoRecvSoapMessage; pMyObject->NotifySessionClosed = CcspCwmpsoNotifySessionClosed; pMyObject->AsyncProcessTask = CcspCwmpsoAsyncProcessTask; pMyObject->CancelRetryDelay = CcspCwmpsoCancelRetryDelay; pMyObject->InformPending = CcspCwmpsoInformPending; AnscInitializeLock (&pMyObject->AccessLock ); AnscQueueInitializeHeader(&pMyObject->AsyncReqQueue ); AnscInitializeLock (&pMyObject->AsyncReqQueueLock); AnscQueueInitializeHeader(&pMyObject->SavedReqQueue ); AnscInitializeLock (&pMyObject->SavedReqQueueLock); AnscQueueInitializeHeader(&pMyObject->AsyncRepQueue ); AnscInitializeLock (&pMyObject->AsyncRepQueueLock); AnscInitializeEvent (&pMyObject->AsyncProcessEvent); AnscResetEvent (&pMyObject->AsyncProcessEvent); return ANSC_STATUS_SUCCESS; }
ANSC_STATUS SlapOcoInitialize ( ANSC_HANDLE hThisObject ) { ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS; PSLAP_OBJ_CONTAINER_OBJECT pMyObject = (PSLAP_OBJ_CONTAINER_OBJECT)hThisObject; ULONG i = 0; /* * Until you have to simulate C++ object-oriented programming style with standard C, you don't * appreciate all the nice little things come with C++ language and all the dirty works that * have been done by the C++ compilers. Member initialization is one of these things. While in * C++ you don't have to initialize all the member fields inherited from the base class since * the compiler will do it for you, such is not the case with C. */ AnscCoInitialize((ANSC_HANDLE)pMyObject); /* * Although we have initialized some of the member fields in the "create" member function, we * repeat the work here for completeness. While this simulation approach is pretty stupid from * a C++/Java programmer perspective, it's the best we can get for universal embedded network * programming. Before we develop our own operating system (don't expect that to happen any * time soon), this is the way things gonna be. */ pMyObject->Oid = SLAP_OBJ_CONTAINER_OID; pMyObject->Create = SlapOcoCreate; pMyObject->Remove = SlapOcoRemove; pMyObject->EnrollObjects = SlapOcoEnrollObjects; pMyObject->Initialize = SlapOcoInitialize; pMyObject->hSlapUoaIf = (ANSC_HANDLE)NULL; pMyObject->hSlapBssIf = (ANSC_HANDLE)NULL; pMyObject->hSlapObjMapper = (ANSC_HANDLE)NULL; pMyObject->ContainerName = NULL; pMyObject->GlobalInsId = 0; pMyObject->HashIndex = 0; pMyObject->GetSlapUoaIf = SlapOcoGetSlapUoaIf; pMyObject->SetSlapUoaIf = SlapOcoSetSlapUoaIf; pMyObject->GetSlapBssIf = SlapOcoGetSlapBssIf; pMyObject->SetSlapBssIf = SlapOcoSetSlapBssIf; pMyObject->GetSlapObjMapper = SlapOcoGetSlapObjMapper; pMyObject->SetSlapObjMapper = SlapOcoSetSlapObjMapper; pMyObject->GetContainerName = SlapOcoGetContainerName; pMyObject->SetContainerName = SlapOcoSetContainerName; pMyObject->GetContainerType = SlapOcoGetContainerType; pMyObject->SetContainerType = SlapOcoSetContainerType; pMyObject->Reset = SlapOcoReset; pMyObject->AssignInstanceId = SlapOcoAssignInstanceId; pMyObject->GetSrvComponent = SlapOcoGetSrvComponent; pMyObject->AddSrvComponent = SlapOcoAddSrvComponent; pMyObject->DelSrvComponent = SlapOcoDelSrvComponent; pMyObject->DelAllSrvComponents = SlapOcoDelAllSrvComponents; for ( i = 0; i < SLAP_OCO_SCO_TABLE_SIZE; i++ ) { AnscQueueInitializeHeader(&pMyObject->ScoTable[i]); } AnscInitializeLock(&pMyObject->ScoTableLock); return ANSC_STATUS_SUCCESS; }
ANSC_STATUS Bmc2ComdoInitialize ( ANSC_HANDLE hThisObject ) { ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS; PBMC2_COM_DOMAIN_OBJECT pMyObject = (PBMC2_COM_DOMAIN_OBJECT)hThisObject; /* * Until you have to simulate C++ object-oriented programming style with standard C, you don't * appreciate all the nice little things come with C++ language and all the dirty works that * have been done by the C++ compilers. Member initialization is one of these things. While in * C++ you don't have to initialize all the member fields inherited from the base class since * the compiler will do it for you, such is not the case with C. */ AnscCoInitialize((ANSC_HANDLE)pMyObject); /* * Although we have initialized some of the member fields in the "create" member function, we * repeat the work here for completeness. While this simulation approach is pretty stupid from * a C++/Java programmer perspective, it's the best we can get for universal embedded network * programming. Before we develop our own operating system (don't expect that to happen any * time soon), this is the way things gonna be. */ pMyObject->Oid = BMC2_COM_DOMAIN_OID; pMyObject->Create = Bmc2ComdoCreate; pMyObject->Remove = Bmc2ComdoRemove; pMyObject->EnrollObjects = Bmc2ComdoEnrollObjects; pMyObject->Initialize = Bmc2ComdoInitialize; pMyObject->hBmc2ComTerminal = (ANSC_HANDLE)NULL; pMyObject->hBmc2EnvController = (ANSC_HANDLE)NULL; pMyObject->hBmc2ReqController = (ANSC_HANDLE)NULL; pMyObject->DomainTitle = NULL; pMyObject->bActive = FALSE; pMyObject->hSlapContainerDomain = (ANSC_HANDLE)NULL; pMyObject->hSlapBmc2Domain = (ANSC_HANDLE)NULL; pMyObject->GetBmc2ComTerminal = Bmc2ComdoGetBmc2ComTerminal; pMyObject->SetBmc2ComTerminal = Bmc2ComdoSetBmc2ComTerminal; pMyObject->GetBmc2EnvController = Bmc2ComdoGetBmc2EnvController; pMyObject->SetBmc2EnvController = Bmc2ComdoSetBmc2EnvController; pMyObject->GetBmc2ReqController = Bmc2ComdoGetBmc2ReqController; pMyObject->SetBmc2ReqController = Bmc2ComdoSetBmc2ReqController; pMyObject->GetDomainTitle = Bmc2ComdoGetDomainTitle; pMyObject->SetDomainTitle = Bmc2ComdoSetDomainTitle; pMyObject->Reset = Bmc2ComdoReset; pMyObject->Engage = Bmc2ComdoEngage; pMyObject->Cancel = Bmc2ComdoCancel; pMyObject->SetupEnv = Bmc2ComdoSetupEnv; pMyObject->CloseEnv = Bmc2ComdoCloseEnv; pMyObject->GetCommandsByPrefix = Bmc2ComdoGetCommandsByPrefix; pMyObject->GetCommandProperty = Bmc2ComdoGetCommandProperty; pMyObject->AddCommandProperty = Bmc2ComdoAddCommandProperty; pMyObject->DelCommandProperty = Bmc2ComdoDelCommandProperty; pMyObject->DelAllCommandProperties = Bmc2ComdoDelAllCommandProperties; pMyObject->SetCommandHelpSyntax = Bmc2ComdoSetCommandHelpSyntax; AnscQueueInitializeHeader(&pMyObject->CompoQueue ); AnscInitializeLock (&pMyObject->CompoQueueLock); return ANSC_STATUS_SUCCESS; }
ANSC_STATUS AnscLpccoInitialize ( ANSC_HANDLE hThisObject ) { ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS; PANSC_LPC_CONNECTOR_OBJECT pMyObject = (PANSC_LPC_CONNECTOR_OBJECT)hThisObject; ULONG i = 0; /* * Until you have to simulate C++ object-oriented programming style with standard C, you don't * appreciate all the nice little things come with C++ language and all the dirty works that * have been done by the C++ compilers. Member initialization is one of these things. While in * C++ you don't have to initialize all the member fields inherited from the base class since * the compiler will do it for you, such is not the case with C. */ AnscCoInitialize((ANSC_HANDLE)pMyObject); /* * Although we have initialized some of the member fields in the "create" member function, we * repeat the work here for completeness. While this simulation approach is pretty stupid from * a C++/Java programmer perspective, it's the best we can get for universal embedded network * programming. Before we develop our own operating system (don't expect that to happen any * time soon), this is the way things gonna be. */ pMyObject->Oid = ANSC_LPC_CONNECTOR_OID; pMyObject->Create = AnscLpccoCreate; pMyObject->Remove = AnscLpccoRemove; pMyObject->EnrollObjects = AnscLpccoEnrollObjects; pMyObject->Initialize = AnscLpccoInitialize; pMyObject->LpcOpmode = ANSC_LPC_OPMODE_CLIENT; pMyObject->PartyName = NULL; pMyObject->SeqNumber = 0; pMyObject->CallTimeout = ANSC_LPC_DEF_CALL_TIMEOUT; pMyObject->bConnected = FALSE; pMyObject->bActive = FALSE; pMyObject->GetAnscImcIf = AnscLpccoGetAnscImcIf; pMyObject->GetAnscCpcIf = AnscLpccoGetAnscCpcIf; pMyObject->SetAnscCpcIf = AnscLpccoSetAnscCpcIf; pMyObject->GetPartyAddrSize = AnscLpccoGetPartyAddrSize; pMyObject->GetCallTimeout = AnscLpccoGetCallTimeout; pMyObject->SetCallTimeout = AnscLpccoSetCallTimeout; pMyObject->Reset = AnscLpccoReset; pMyObject->GetPartyCount = AnscLpccoGetPartyCount; pMyObject->GetPartyArray = AnscLpccoGetPartyArray; pMyObject->GetPartyAddr = AnscLpccoGetPartyAddr; pMyObject->GetPartyAddr2 = AnscLpccoGetPartyAddr2; pMyObject->AddPartyAddr = AnscLpccoAddPartyAddr; pMyObject->DelPartyAddr = AnscLpccoDelPartyAddr; pMyObject->DelAllPartyAddrs = AnscLpccoDelAllPartyAddrs; pMyObject->GetPendingCall = AnscLpccoGetPendingCall; pMyObject->PopPendingCall = AnscLpccoPopPendingCall; pMyObject->AddPendingCall = AnscLpccoAddPendingCall; pMyObject->DelPendingCall = AnscLpccoDelPendingCall; pMyObject->PopAllPendingCalls = AnscLpccoPopAllPendingCalls; pMyObject->DelAllPendingCalls = AnscLpccoDelAllPendingCalls; pMyObject->AcqAccess = AnscLpccoAcqAccess; pMyObject->RelAccess = AnscLpccoRelAccess; pMyObject->Engage = AnscLpccoEngage; pMyObject->Cancel = AnscLpccoCancel; pMyObject->Enroll = AnscLpccoEnroll; pMyObject->Unbind = AnscLpccoUnbind; pMyObject->ConnectToManager = AnscLpccoConnectToManager; pMyObject->ConnTimerInvoke = AnscLpccoConnTimerInvoke; pMyObject->ImcGenPartyAddr = AnscLpccoImcGenPartyAddr; pMyObject->ImcGetLpcOpmode = AnscLpccoImcGetLpcOpmode; pMyObject->ImcSetLpcOpmode = AnscLpccoImcSetLpcOpmode; pMyObject->ImcGetPartyName = AnscLpccoImcGetPartyName; pMyObject->ImcSetPartyName = AnscLpccoImcSetPartyName; pMyObject->ImcIsPartyConnected = AnscLpccoImcIsPartyConnected; pMyObject->ImcEngage = AnscLpccoImcEngage; pMyObject->ImcCancel = AnscLpccoImcCancel; pMyObject->ImcCallRequest = AnscLpccoImcCallRequest; pMyObject->ImcCallRequest2 = AnscLpccoImcCallRequest2; pMyObject->CpcCallDispatch = AnscLpccoCpcCallDispatch; pMyObject->CpcFreeOutputBuffer = AnscLpccoCpcFreeOutputBuffer; pMyObject->CpcNotifyEvent = AnscLpccoCpcNotifyEvent; AnscInitializeLock(&pMyObject->AccessLock); for ( i = 0; i < ANSC_LPCCO_PARTY_TABLE_SIZE; i++ ) { AnscQueueInitializeHeader(&pMyObject->PartyTable[i]); } AnscInitializeLock(&pMyObject->PartyTableLock); AnscQueueInitializeHeader(&pMyObject->PcallQueue ); AnscInitializeLock (&pMyObject->PcallQueueLock); return ANSC_STATUS_SUCCESS; }
ANSC_STATUS TlsSmoInitialize ( ANSC_HANDLE hThisObject ) { PTLS_SESSION_MANAGER_OBJECT pMyObject = (PTLS_SESSION_MANAGER_OBJECT)hThisObject; ULONG i = 0; /* * Until you have to simulate C++ object-oriented progtlsming style with standard C, you don't * appreciate all the nice little things come with C++ language and all the dirty works that * have been done by the C++ compilers. Member initialization is one of these things. While in * C++ you don't have to initialize all the member fields inherited from the base class since * the compiler will do it for you, such is not the case with C. */ AnscCoInitialize((ANSC_HANDLE)pMyObject); /* * Although we have initialized some of the member fields in the "create" member function, we * repeat the work here for completeness. While this simulation approach is pretty stupid from * a C++/Java progtlsmer perspective, it's the best we can get for universal embedded network * progtlsming. Before we develop our own operating system (don't expect that to happen any * time soon), this is the way things gonna be. */ pMyObject->Oid = TLS_SESSION_MANAGER_OID; pMyObject->Create = TlsSmoCreate; pMyObject->Remove = TlsSmoRemove; pMyObject->EnrollObjects = TlsSmoEnrollObjects; pMyObject->Initialize = TlsSmoInitialize; pMyObject->hTlsMecIf = (ANSC_HANDLE)NULL; pMyObject->bActive = FALSE; pMyObject->GetProperty = TlsSmoGetProperty; pMyObject->SetProperty = TlsSmoSetProperty; pMyObject->ResetProperty = TlsSmoResetProperty; pMyObject->Reset = TlsSmoReset; pMyObject->Engage = TlsSmoEngage; pMyObject->Cancel = TlsSmoCancel; pMyObject->PatrolTimerInvoke = TlsSmoPatrolTimerInvoke; pMyObject->GetSession = TlsSmoGetSession; pMyObject->AddSession = TlsSmoAddSession; pMyObject->DelSession = TlsSmoDelSession; pMyObject->DelAllSessions = TlsSmoDelAllSessions; #if 0 pMyObject->HsmSelHandshakeSession = TlsSmoHsmSelHandshakeSession; pMyObject->HsmGetHandshakeSession = TlsSmoHsmGetHandshakeSession; pMyObject->HsmAddHandshakeSession = TlsSmoHsmAddHandshakeSession; pMyObject->HsmDelHandshakeSession = TlsSmoHsmDelHandshakeSession; pMyObject->HsmDelAllHandshakeSessions = TlsSmoHsmDelAllHandshakeSessions; #endif for ( i = 0; i < TLS_SMO_SEO_TABLE_SIZE; i++ ) { AnscQueueInitializeHeader(&pMyObject->SeoTable[i]); } AnscInitializeLock(&pMyObject->SeoTableLock); /* * We shall initialize the object properties to the default values, which may be changed later * via the exposed member functions. If any of the future extensions needs to change the object * property, the following code also needs to be changed. */ pMyObject->ResetProperty((ANSC_HANDLE)pMyObject); return ANSC_STATUS_SUCCESS; }