S2OPC OPCUA Toolkit
|
Additional server configuration facilities for non-XML configuration of the server or non-essential advanced configuration. More...
Go to the source code of this file.
Typedefs | |
typedef SOPC_SecurityPolicy | SOPC_SecurityConfig |
The structure containing an endpoint security configuration. More... | |
typedef OpcUa_UserTokenPolicy | SOPC_UserTokenPolicy |
User token policy type to be used with SOPC_SecurityConfig_AddUserTokenPolicy. More... | |
Enumerations | |
enum | SOPC_SecurityModeMask { SOPC_SecurityModeMask_None = 0x01, SOPC_SecurityModeMask_Sign, SOPC_SecurityModeMask_SignAndEncrypt = 0x04 } |
Enumerated mask values authorized for use with SOPC_SecurityConfig_SetSecurityModes. Those values are masks which means they might be used with OR bitwise operation to activate several security modes. More... | |
Functions | |
SOPC_ReturnStatus | SOPC_ServerConfigHelper_SetNamespaces (size_t nbNamespaces, const char **namespaces) |
Server configuration without XML. More... | |
SOPC_ReturnStatus | SOPC_ServerConfigHelper_SetLocaleIds (size_t nbLocales, const char **localeIds) |
Define server locales ids supported from an array of locale strings. More... | |
SOPC_ReturnStatus | SOPC_ServerConfigHelper_SetApplicationDescription (const char *applicationUri, const char *productUri, const char *defaultAppName, const char *defaultAppNameLocale, OpcUa_ApplicationType applicationType) |
Define server application description. More... | |
SOPC_ReturnStatus | SOPC_ServerConfigHelper_AddApplicationNameLocale (const char *additionalAppName, const char *additionalAppNameLocale) |
Define server additional application name with given locale id. More... | |
SOPC_ReturnStatus | SOPC_ServerConfigHelper_SetPKIprovider (SOPC_PKIProvider *pki) |
Define the PKI provider that will be in charge of validating certificates received by server. More... | |
SOPC_ReturnStatus | SOPC_ServerConfigHelper_SetKeyCertPairFromPath (const char *serverCertPath, const char *serverKeyPath, bool encrypted) |
Set asymmetrical certificate and key of server from file paths. Certificate files shall use DER format, key file shall use DER or PEM format. More... | |
SOPC_ReturnStatus | SOPC_ServerConfigHelper_SetKeyCertPairFromBytes (size_t certificateNbBytes, const unsigned char *serverCertificate, size_t keyNbBytes, const unsigned char *serverPrivateKey) |
Set asymmetrical certificate and key of server from byte arrays. Certificate shall be in DER format, key file shall be in DER or PEM format. More... | |
SOPC_Endpoint_Config * | SOPC_ServerConfigHelper_CreateEndpoint (const char *url, bool hasDiscovery) |
Create a new endpoint configuration in server to be completed by using the functions below (SOPC_EndpointConfig_AddSecurityConfig, etc.) More... | |
SOPC_SecurityConfig * | SOPC_EndpointConfig_AddSecurityConfig (SOPC_Endpoint_Config *destEndpoint, SOPC_SecurityPolicy_URI uri) |
Add a security policy to the endpoint configuration. More... | |
SOPC_ReturnStatus | SOPC_SecurityConfig_SetSecurityModes (SOPC_SecurityConfig *destSecuConfig, SOPC_SecurityModeMask modes) |
Set a security mode mask to the security configuration. More... | |
SOPC_ReturnStatus | SOPC_SecurityConfig_AddUserTokenPolicy (SOPC_SecurityConfig *destSecuConfig, const SOPC_UserTokenPolicy *userTokenPolicy) |
Add a user token policy to the security policy. More... | |
bool | SOPC_EndpointConfig_AddClientToConnect (SOPC_Endpoint_Config *destEndpoint, const char *clientAppUri, const char *clientEndpointUrl) |
Add a reverse connection configuration for a client to the server endpoint configuration. More... | |
bool | SOPC_EndpointConfig_StopListening (SOPC_Endpoint_Config *destEndpoint) |
Configure the endpoint to not listen to incoming connections in case only reverse connections shall be possible. It will fail if no reverse connection is configured. More... | |
SOPC_ReturnStatus | SOPC_ServerConfigHelper_SetAddressSpace (SOPC_AddressSpace *addressSpaceConfig) |
Configure the server with the given address space. More... | |
SOPC_ReturnStatus | SOPC_ServerConfigHelper_SetUserAuthenticationManager (SOPC_UserAuthentication_Manager *authenticationMgr) |
Configure the server user authentication manager in charge to check user credentials. More... | |
SOPC_ReturnStatus | SOPC_ServerConfigHelper_SetUserAuthorizationManager (SOPC_UserAuthorization_Manager *authorizationMgr) |
Configure the server user authorization manager to check user access rights. More... | |
SOPC_ReturnStatus | SOPC_ServerConfigHelper_SetSoftwareBuildInfo (OpcUa_BuildInfo *buildInfo) |
Change the software build information to be displayed in the server build info node. More... | |
SOPC_AddressSpace * | SOPC_ServerConfigHelper_GetAddressSpace (void) |
Get the server configured address space. Note: it might be used after base NodeSet XML parsing to modify / extend it before server starts. More... | |
SOPC_ReturnStatus | SOPC_HelperConfigServer_SetNamespaces (size_t nbNamespaces, const char **namespaces) |
SOPC_ReturnStatus | SOPC_HelperConfigServer_SetLocaleIds (size_t nbLocales, const char **localeIds) |
SOPC_ReturnStatus | SOPC_HelperConfigServer_SetApplicationDescription (const char *applicationUri, const char *productUri, const char *defaultAppName, const char *defaultAppNameLocale, OpcUa_ApplicationType applicationType) |
SOPC_ReturnStatus | SOPC_HelperConfigServer_AddApplicationNameLocale (const char *additionalAppName, const char *additionalAppNameLocale) |
SOPC_ReturnStatus | SOPC_HelperConfigServer_SetPKIprovider (SOPC_PKIProvider *pki) |
SOPC_ReturnStatus | SOPC_HelperConfigServer_SetKeyCertPairFromPath (const char *serverCertPath, const char *serverKeyPath, bool encrypted) |
SOPC_ReturnStatus | SOPC_HelperConfigServer_SetKeyCertPairFromBytes (size_t certificateNbBytes, const unsigned char *serverCertificate, size_t keyNbBytes, const unsigned char *serverPrivateKey) |
SOPC_Endpoint_Config * | SOPC_HelperConfigServer_CreateEndpoint (const char *url, bool hasDiscovery) |
SOPC_ReturnStatus | SOPC_HelperConfigServer_SetAddressSpace (SOPC_AddressSpace *addressSpaceConfig) |
SOPC_ReturnStatus | SOPC_HelperConfigServer_SetUserAuthenticationManager (SOPC_UserAuthentication_Manager *authenticationMgr) |
SOPC_ReturnStatus | SOPC_HelperConfigServer_SetUserAuthorizationManager (SOPC_UserAuthorization_Manager *authorizationMgr) |
SOPC_ReturnStatus | SOPC_HelperConfigServer_SetSoftwareBuildInfo (OpcUa_BuildInfo *buildInfo) |
SOPC_AddressSpace * | SOPC_HelperConfigServer_GetAddressSpace (void) |
Additional server configuration facilities for non-XML configuration of the server or non-essential advanced configuration.
The structure containing an endpoint security configuration.
User token policy type to be used with SOPC_SecurityConfig_AddUserTokenPolicy.
Enumerated mask values authorized for use with SOPC_SecurityConfig_SetSecurityModes. Those values are masks which means they might be used with OR bitwise operation to activate several security modes.
SOPC_ReturnStatus SOPC_ServerConfigHelper_SetNamespaces | ( | size_t | nbNamespaces, |
const char ** | namespaces | ||
) |
Server configuration without XML.
Define server namespaces from an array of strings. Index in array is the namespace index starting to 1 for first element, namespace 0 is reserved for OPC UA namespace and is implicitely declared.
nbNamespaces | The number of namespaces defined in the array |
namespaces | The array of namespaces. Array and its content is copied by function. |
nbNamespaces
== 0 or namespaces
is invalid or SOPC_STATUS_INVALID_STATE if the configuration is not possible (toolkit not initialized, namesapces already defined, server already started). SOPC_ReturnStatus SOPC_ServerConfigHelper_SetLocaleIds | ( | size_t | nbLocales, |
const char ** | localeIds | ||
) |
Define server locales ids supported from an array of locale strings.
nbLocales | The number of locales defined in the array. It might be 0 if no locale defined (only default exist) |
localeIds | The array of locales. Array and its content is copied by function. |
localeIds
is invalid when nbLocales
> 0 or SOPC_STATUS_INVALID_STATE if the configuration is not possible (toolkit not initialized, localesIds already defined, server already started). SOPC_ReturnStatus SOPC_ServerConfigHelper_SetApplicationDescription | ( | const char * | applicationUri, |
const char * | productUri, | ||
const char * | defaultAppName, | ||
const char * | defaultAppNameLocale, | ||
OpcUa_ApplicationType | applicationType | ||
) |
Define server application description.
applicationUri | The globally unique identifier for the application instance. This URI is used as ServerUri in Services if the application is a Server. |
productUri | The globally unique identifier for the product. |
defaultAppName | The name of the application using the default locale language. |
defaultAppNameLocale | The default locale if any. If defined it shall exists in supported locales. |
applicationType | The type of application, it shall be one of the OpcUa_ApplicationType_*Server types |
applicationUri
, productUri
or defaultAppName
are invalid or SOPC_STATUS_INVALID_STATE if the configuration is not possible (toolkit not initialized, application description already set, server already started).SOPC_ReturnStatus SOPC_ServerConfigHelper_AddApplicationNameLocale | ( | const char * | additionalAppName, |
const char * | additionalAppNameLocale | ||
) |
Define server additional application name with given locale id.
additionalAppName | The name of the application using the additional locale language. |
additionalAppNameLocale | Locale used for the application name, it shall exists in supported locales of the server. |
additionalApplicationName
or additionalApplicationNameLocale
are invalid or SOPC_STATUS_INVALID_STATE if the configuration is not possible (toolkit not initialized, server already started).SOPC_ReturnStatus SOPC_ServerConfigHelper_SetPKIprovider | ( | SOPC_PKIProvider * | pki | ) |
Define the PKI provider that will be in charge of validating certificates received by server.
pki | The PKI provider to be used. It will be automatically deallocated using SOPC_PKIProvider_Free on call to SOPC_ServerConfigHelper_Clear. |
pki
is invalid or SOPC_STATUS_INVALID_STATE if the configuration is not possible (toolkit not initialized, PKI already defined, server already started).SOPC_ReturnStatus SOPC_ServerConfigHelper_SetKeyCertPairFromPath | ( | const char * | serverCertPath, |
const char * | serverKeyPath, | ||
bool | encrypted | ||
) |
Set asymmetrical certificate and key of server from file paths. Certificate files shall use DER format, key file shall use DER or PEM format.
serverCertPath | Path to server certificate file at DER format |
serverKeyPath | Path to server key file at DER or PEM format |
encrypted | Whether if the key is encrypted or not |
serverCertPath
or serverKeyPath
are invalid or SOPC_STATUS_INVALID_STATE if the configuration is not possible (toolkit not initialized, key/cert pair already set, server already started). SOPC_ReturnStatus SOPC_ServerConfigHelper_SetKeyCertPairFromBytes | ( | size_t | certificateNbBytes, |
const unsigned char * | serverCertificate, | ||
size_t | keyNbBytes, | ||
const unsigned char * | serverPrivateKey | ||
) |
Set asymmetrical certificate and key of server from byte arrays. Certificate shall be in DER format, key file shall be in DER or PEM format.
certificateNbBytes | Number of bytes in serverCertificate array |
serverCertificate | Array of bytes containing server certificate at DER format |
keyNbBytes | Number of bytes in serverPrivateKey array |
serverPrivateKey | Array of bytes containing server key file at DER or PEM format |
certificateNbBytes
, serverCertificate
, keyNbBytes
or serverKeyPath
are invalid (0 or NULL) or SOPC_STATUS_INVALID_STATE if the configuration is not possible (toolkit not initialized, key/cert pair already set, server already started). SOPC_Endpoint_Config* SOPC_ServerConfigHelper_CreateEndpoint | ( | const char * | url, |
bool | hasDiscovery | ||
) |
Create a new endpoint configuration in server to be completed by using the functions below (SOPC_EndpointConfig_AddSecurityConfig, etc.)
url | URL of the endpoint:opc.tcp://<host>:<port>[/<name>] |
hasDiscovery | If set activate discovery endpoint facility on same endpoint URL. Discovery services are then accessible without any security even if endpoint only allow secure connections (Sign or SignAndEncrypt) |
SOPC_SecurityConfig* SOPC_EndpointConfig_AddSecurityConfig | ( | SOPC_Endpoint_Config * | destEndpoint, |
SOPC_SecurityPolicy_URI | uri | ||
) |
Add a security policy to the endpoint configuration.
destEndpoint | Pointer to endpoint created with SOPC_ServerConfigHelper_CreateEndpoint |
uri | Security policy SOPC_SecurityPolicy_URI supported by destEndpoint |
SOPC_ReturnStatus SOPC_SecurityConfig_SetSecurityModes | ( | SOPC_SecurityConfig * | destSecuConfig, |
SOPC_SecurityModeMask | modes | ||
) |
Set a security mode mask to the security configuration.
destSecuConfig | Pointer to security configuration added with SOPC_EndpointConfig_AddSecurityConfig |
modes | Mask of security modes to be supported using a bitwise OR of SOPC_SecurityModeMask |
destSecuConfig
or modes
are invalid (0 or NULL)SOPC_ReturnStatus SOPC_SecurityConfig_AddUserTokenPolicy | ( | SOPC_SecurityConfig * | destSecuConfig, |
const SOPC_UserTokenPolicy * | userTokenPolicy | ||
) |
Add a user token policy to the security policy.
destSecuConfig | Pointer to security policy added with SOPC_EndpointConfig_AddSecurityConfig |
userTokenPolicy | User token policy to use for this security policy. SOPC_UserTokenPolicy_Anonymous, SOPC_UserTokenPolicy_UserName_DefaultSecurityPolicy or SOPC_UserTokenPolicy_UserName_NoneSecurityPolicy supported |
destSecuConfig
or modes
are invalid (NULL), or SOPC_STATUS_OUT_OF_MEMORY if already SOPC_MAX_SECU_POLICIES_CFG user token policies defined in this security policybool SOPC_EndpointConfig_AddClientToConnect | ( | SOPC_Endpoint_Config * | destEndpoint, |
const char * | clientAppUri, | ||
const char * | clientEndpointUrl | ||
) |
Add a reverse connection configuration for a client to the server endpoint configuration.
destEndpoint | Pointer to endpoint created with SOPC_ServerConfigHelper_CreateEndpoint |
clientAppUri | The client ApplicationUri. It might be empty since it is not checked for now. |
clientEndpointUrl | The client endpoint URL to connect to establish the reverse connection. |
bool SOPC_EndpointConfig_StopListening | ( | SOPC_Endpoint_Config * | destEndpoint | ) |
Configure the endpoint to not listen to incoming connections in case only reverse connections shall be possible. It will fail if no reverse connection is configured.
destEndpoint | Pointer to endpoint created with SOPC_ServerConfigHelper_CreateEndpoint |
SOPC_ReturnStatus SOPC_ServerConfigHelper_SetAddressSpace | ( | SOPC_AddressSpace * | addressSpaceConfig | ) |
Configure the server with the given address space.
addressSpaceConfig | the address space definition, in case of successful operation it is then deallocated on call to SOPC_ServerConfigHelper_Clear |
SOPC_ReturnStatus SOPC_ServerConfigHelper_SetUserAuthenticationManager | ( | SOPC_UserAuthentication_Manager * | authenticationMgr | ) |
Configure the server user authentication manager in charge to check user credentials.
authenticationMgr | Pointer to the user authentication manager in charge to check user credentials |
authenticationMgr
is invalid (NULL) or SOPC_STATUS_INVALID_STATE if the configuration is not possible (toolkit not initialized, authentication manager already set, server already started).SOPC_ReturnStatus SOPC_ServerConfigHelper_SetUserAuthorizationManager | ( | SOPC_UserAuthorization_Manager * | authorizationMgr | ) |
Configure the server user authorization manager to check user access rights.
authorizationMgr | Pointer to the user authorization manager in charge to check user access rights |
certificateNbBytes
, serverCertificate
, keyNbBytes
or serverKeyPath
are invalid (0 or NULL) or SOPC_STATUS_INVALID_STATE if the configuration is not possible (toolkit not initialized, authorization manager already set, server already started).SOPC_ReturnStatus SOPC_ServerConfigHelper_SetSoftwareBuildInfo | ( | OpcUa_BuildInfo * | buildInfo | ) |
Change the software build information to be displayed in the server build info node.
buildInfo | the build information name to display in server build info node. Content is copied and can be cleared after call. |
buildInfo
is invalid (NULL) or SOPC_STATUS_INVALID_STATE if the configuration is not possible (toolkit not initialized, build info already set, server already started). SOPC_AddressSpace* SOPC_ServerConfigHelper_GetAddressSpace | ( | void | ) |
Get the server configured address space. Note: it might be used after base NodeSet XML parsing to modify / extend it before server starts.
SOPC_ReturnStatus SOPC_HelperConfigServer_SetNamespaces | ( | size_t | nbNamespaces, |
const char ** | namespaces | ||
) |
SOPC_ReturnStatus SOPC_HelperConfigServer_SetLocaleIds | ( | size_t | nbLocales, |
const char ** | localeIds | ||
) |
SOPC_ReturnStatus SOPC_HelperConfigServer_SetApplicationDescription | ( | const char * | applicationUri, |
const char * | productUri, | ||
const char * | defaultAppName, | ||
const char * | defaultAppNameLocale, | ||
OpcUa_ApplicationType | applicationType | ||
) |
SOPC_ReturnStatus SOPC_HelperConfigServer_AddApplicationNameLocale | ( | const char * | additionalAppName, |
const char * | additionalAppNameLocale | ||
) |
SOPC_ReturnStatus SOPC_HelperConfigServer_SetPKIprovider | ( | SOPC_PKIProvider * | pki | ) |
SOPC_ReturnStatus SOPC_HelperConfigServer_SetKeyCertPairFromPath | ( | const char * | serverCertPath, |
const char * | serverKeyPath, | ||
bool | encrypted | ||
) |
SOPC_ReturnStatus SOPC_HelperConfigServer_SetKeyCertPairFromBytes | ( | size_t | certificateNbBytes, |
const unsigned char * | serverCertificate, | ||
size_t | keyNbBytes, | ||
const unsigned char * | serverPrivateKey | ||
) |
SOPC_Endpoint_Config* SOPC_HelperConfigServer_CreateEndpoint | ( | const char * | url, |
bool | hasDiscovery | ||
) |
SOPC_ReturnStatus SOPC_HelperConfigServer_SetAddressSpace | ( | SOPC_AddressSpace * | addressSpaceConfig | ) |
SOPC_ReturnStatus SOPC_HelperConfigServer_SetUserAuthenticationManager | ( | SOPC_UserAuthentication_Manager * | authenticationMgr | ) |
SOPC_ReturnStatus SOPC_HelperConfigServer_SetUserAuthorizationManager | ( | SOPC_UserAuthorization_Manager * | authorizationMgr | ) |
SOPC_ReturnStatus SOPC_HelperConfigServer_SetSoftwareBuildInfo | ( | OpcUa_BuildInfo * | buildInfo | ) |
SOPC_AddressSpace* SOPC_HelperConfigServer_GetAddressSpace | ( | void | ) |