High Performance OPC UA Server SDK  1.3.1.248
appconfig.c
/*****************************************************************************
* *
* Copyright (c) 2006-2019 Unified Automation GmbH. All rights reserved. *
* *
* Software License Agreement ("SLA") Version 2.7 *
* *
* Unless explicitly acquired and licensed from Licensor under another *
* license, the contents of this file are subject to the Software License *
* Agreement ("SLA") Version 2.7, or subsequent versions as allowed by the *
* SLA, and You may not copy or use this file in either source code or *
* executable form, except in compliance with the terms and conditions of *
* the SLA. *
* *
* All software distributed under the SLA is provided strictly on an "AS *
* IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, *
* AND LICENSOR HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT *
* LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR *
* PURPOSE, QUIET ENJOYMENT, OR NON-INFRINGEMENT. See the SLA for specific *
* language governing rights and limitations under the SLA. *
* *
* The complete license agreement can be found here: *
* http://unifiedautomation.com/License/SLA/2.7/ *
* *
*****************************************************************************/
#include <appconfig.h>
#include <uaserver/server_config.h>
#include <platform/platform_config.h>
#include <uaprotocol/uaseconv/sechan.h>
#define KB *1024
#if defined(HAVE_PKI) && defined(SUPPORT_FILE_IO)
struct uaapp_certificate g_certificates[] = {
{ /* index 0 */
"file://hpsdk2048.der", /* cert location */
"file://hpsdk2048.key", /* key location */
0, /* store index */
90, /* days valid */
"sha256", /* sig. alg.: sha1, or sha256 */
2048, /* key length in bits */
0, /* issuer index, same as cert for self-signed */
true /* create cert if it doesn't exist */
}
};
#else
struct uaapp_certificate g_certificates[1] = { { NULL, NULL, 0, 0, NULL, 0, 0, false } };
#endif
static struct uaserver_endpoint g_endpoints[] = {
/* endpoint_url, bind_address, bind_port, security_policies, user_tokens */
#ifdef HAVE_PKI
{NULL, "0.0.0.0", 4840, {{0, 1}, 2}, {{0, 1}, 2}}
#else
{NULL, "0.0.0.0", 4840, {{0}, 1}, {{0, 1}, 2}}
#endif
};
static struct sechan_config g_sechan_configs[] = {
/* cert_ptr, cert_idx, store, ign_time, ign_issuer_time, ign_miss_crl, ign_miss_issuer_crl, ig_untrusted, check_complete_chain, disable_crl_check, disable_cert_validate, results, chainlen, policy_id, encrypt, sign, none */
#ifdef HAVE_PKI
{NULL, 0, 0, false, false, false, false, false, true, false, false, 0, 0, UA_SECURITY_POLICY_NONE, false, false, true},
{NULL, 0, 0, false, false, false, false, false, true, false, false, 2, 1, UA_SECURITY_POLICY_BASIC256SHA256, true, true, false}
#else
{NULL, -1, 0, false, false, false, false, false, true, false, false, 0, 0, UA_SECURITY_POLICY_NONE, false, false, true}
#endif
};
static struct uaserver_user_token g_user_tokens[] = {
{"Anonymous_Token", UA_USERTOKENTYPE_ANONYMOUS, 0},
#ifdef HAVE_PKI
{"Username_256_Token", UA_USERTOKENTYPE_USERNAME, UA_SECURITY_POLICY_BASIC256SHA256}
#else
{"Username_None_Token", UA_USERTOKENTYPE_USERNAME, UA_SECURITY_POLICY_NONE}
#endif
};
static struct uaserver_pkistore g_pkistores[] = {
{ "pki_store_0;5;5;5;5", "import" }
};
static struct serverprofile g_serverprofiles[] = {
{ "http://opcfoundation.org/UA-Profile/Server/MicroEmbeddedDevice2017" },
{ "http://opcfoundation.org/UA-Profile/Server/DataAccess" }
};
struct appconfig g_appconfig = {
0, /* xml_max_dom_nodes */
"Unified Automation GmbH", /* manufacturer_name */
"High Performance OPC UA SDK", /* product_name */
"urn:UnifiedAutomation:UASDKHP", /* product_uri */
NULL, /* software version */
NULL, /* build number */
"UaMinimalServerHPC", /* application_name */
"urn:UnifiedAutomation:HPC:Example", /* application_uri */
"Demo", /* organization_unit */
"Demo City", /* locality */
"Demo State", /* state */
"Demo Country", /* country */
NULL, /* ips */
NULL, /* dns */
"admin@demo.com", /* email */
NULL, /* domain_component */
NULL, /* ns0_filename */
{ /* uatcpmsg */
4, /* num_conns */
1, /* num_listeners */
10, /* max_ctxtx (max service calls) */
2 /* num_chunks per message */
},
{ /* seconv */
4, /* num_channels */
true, /* keep_spare_channel */
300000, /* min security token lifetime */
3600000, /* max security token lifetime */
},
{ /* session */
2, /* num_sessions */
10, /* max session calls */
5000, /* lifetime check interval */
10000, /* lifetime min */
3600000, /* lifetime max */
true, /* keep_spare_session */
10, /* authentication_num_users */
NULL, /* authentication_passwd_file */
1, /* authentication_store */
10, /* authorization_num_users */
NULL, /* authorization_users_file */
10, /* authorization_num_groups */
NULL, /* authorization_groups_file */
100, /* max references per node */
},
{ /* endpoint config */
g_endpoints, /* endpoints */
countof(g_endpoints), /* num_endpoints */
g_sechan_configs, /* sec_configs */
countof(g_sechan_configs), /* num_sec_config */
#if defined(HAVE_PKI) && defined(SUPPORT_FILE_IO)
g_certificates, /* certificates */
countof(g_certificates), /* num_certificates */
#else
NULL, /* certificates */
0, /* num_certificates */
#endif
NULL, /* sechan_certs */
0, /* num_sechan_certs */
g_user_tokens, /* user tokens */
countof(g_user_tokens), /* num_user_tokens */
false, /* allow_deprecated_policies */
},
{ /* pkistore config */
g_pkistores, /* pkistores */
countof(g_pkistores), /* num_pkistores */
},
50, /* num of timers */
{ /* ipc config */
192 KB, /* ipc_size */
0, /* heap_size (auto assign) */
20, /* max messages per queue */
5, /* num_queues */
20, /* num_messages */
20, /* num_services */
false, /* ipc_outprocess_encoder */
false, /* ipc_outprocess_seconv */
},
{ /* encoder config */
10, /* max_call_depth */
1 KB, /* max_string_length */
2 KB, /* max_bytestring_length */
50 /* max_array_length */
},
{ /* network config */
8 KB + 4, /* buffer_size (minimum allowed by the UA Specification) */
10, /* num_buffers */
8, /* num_buffers_per_connection */
4 /* max connections per ip */
},
{ /* subscription */
2, /* num_sessions_with_subscriptions */
2, /* num_publishrequests_per_session */
2, /* num_subscriptions */
1, /* num_subscriptions_per_session */
4, /* num_notificationmessages_per_session */
10, /* max_notifications_per_publish */
2, /* num_monitoreditems_per_subscription */
10, /* min_publishing_interval */
10000, /* max_publishing_interval */
4, /* num_monitoreditems */
10, /* min_sampling_interval */
10000, /* max_sampling_interval */
1, /* max_monitoreditem_queue_size */
1000, /* min_lifetime */
100000,/* max_lifetime */
20, /* num_eventnotifiers */
200, /* num_eventfields */
},
{ /* server config */
3, /* max_dimensions */
g_serverprofiles, /* serverprofile array */
countof(g_serverprofiles) /* num_serverprofiles */
},
{ /* client_config */
0, /* num_clients */
0, /* num_subscriptions */
0, /* store */
0, /* certificate */
},
{ /* redundancy_config */
UA_REDUNDANCYSUPPORT_NONE, /* redundancy_support */
NULL, /* redundant_server_uris */
0, /* num_redundant_server_uris */
NULL, /* addional_servers */
0 /* num_addional_servers */
}
};