1
/**************************************************************************
2
*** COPYRIGHT (c) 2002 by TransNexus, Inc. ***
4
*** This software is property of TransNexus, Inc. ***
5
*** This software is freely available under license from TransNexus. ***
6
*** The license terms and conditions for free use of this software by ***
7
*** third parties are defined in the OSP Toolkit Software License ***
8
*** Agreement (LICENSE.txt). Any use of this software by third ***
9
*** parties, which does not comply with the terms and conditions of the ***
10
*** OSP Toolkit Software License Agreement is prohibited without ***
11
*** the prior, express, written consent of TransNexus, Inc. ***
13
*** Thank you for using the OSP ToolKit(TM). Please report any bugs, ***
14
*** suggestions or feedback to support@transnexus.com ***
16
**************************************************************************/
26
* ospinit.cpp - Provider space initialization.
29
#include "osp/ospprovider.h"
31
OSPTPROVIDER OSPVProviderCollection[OSPC_MAX_PROVIDERS];
32
OSPTMUTEX OSPVProviderMutex;
35
char *OSPVDeleteAllowed;
40
* The OSPPInit function performs internal housekeeping necessary to
41
* prepare the SDK software for operation.
43
* returns OSPC_ERR_NO_ERROR if successful, OSPC_ERR_XXX otherwise.
46
OSPPInit(OSPTBOOL hw_enabled)
48
int providerindex = 0;
49
int errorcode = OSPC_ERR_NO_ERROR,
50
tmperror = OSPC_ERR_NO_ERROR;
53
* create global provider mutex
55
OSPM_MUTEX_INIT(OSPVProviderMutex, NULL, errorcode);
56
if (errorcode == OSPC_ERR_NO_ERROR)
59
* cycle thru collection, initializing each element.
61
for(providerindex = 0; providerindex < OSPC_MAX_PROVIDERS; providerindex++)
63
OSPM_MEMSET(&OSPVProviderCollection[providerindex], 0,
64
sizeof(OSPTPROVIDER));
68
* initialize Winsock Library if necessary
70
OSPM_INITWINSOCK(errorcode);
73
* if initialization failed, destroy the mutex and return failure
75
if (errorcode != OSPC_ERR_NO_ERROR)
76
OSPM_MUTEX_DESTROY(OSPVProviderMutex, tmperror);
79
if (errorcode != OSPC_ERR_NO_ERROR)
80
errorcode = OSPC_ERR_PROV_INIT_FAILURE;
83
if (errorcode == OSPC_ERR_NO_ERROR)
85
OSPVDeleteAllowed = OSPM_GETENV("GKSIM_DELETE_ALLOWED");
90
* Initialize openssl global parameters
92
OSPPOpenSSLInit(hw_enabled);
100
int errorcode = OSPC_ERR_NO_ERROR;
103
* called to cleanup any resources allocated by OSPPinit
105
OSPM_MUTEX_DESTROY(OSPVProviderMutex, errorcode);
106
OSPM_CLEANUPWINSOCK();
109
* Clean up openssl global parameters
111
OSPPOpenSSLCleanUp();