-
Notifications
You must be signed in to change notification settings - Fork 48
/
ualds.h
74 lines (60 loc) · 2.85 KB
/
ualds.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/* Copyright (c) 1996-2024, OPC Foundation. All rights reserved.
The source code in this file is covered under a dual-license scenario:
- RCL: for OPC Foundation members in good-standing
- GPL V2: everybody else
RCL license terms accompanied with this source code. See http://opcfoundation.org/License/RCL/1.00/
GNU General Public License as published by the Free Software Foundation;
version 2 of the License are accompanied with this source code. See http://opcfoundation.org/License/GPLv2
This source code is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifndef __UALDS_H__
#define __UALDS_H__
/** UA LDS Endpoint configuration structure.
* Unlike the OpcUa_EndpointDescription this is a technical configuration,
* which defines endpoint = url = IP/port combination, which is required
* for creating the sockets.
* OpcUa_EndpointDescription defines one endpoint to be the combination
* of one url + one security configuration + one messagemode. This requires
* to create individual endpoints for each permutation of url and security configurations.
* (complete nonesense!).
*/
struct _ualds_endpoint
{
char szUrl[UALDS_CONF_MAX_URI_LENGTH];
OpcUa_UInt32 nNoOfSecurityPolicies;
OpcUa_Endpoint_SecurityPolicyConfiguration *pSecurityPolicies;
OpcUa_Endpoint hEndpoint; /**< handle of open endpoint */
};
typedef struct _ualds_endpoint ualds_endpoint;
typedef struct _multicastSocketCallbackStruct
{
OpcUa_Void* sdRef;
OpcUa_Void* context;
} MulticastSocketCallbackStruct;
extern OpcUa_Mutex g_mutex;
extern int g_bEnableZeroconf;
void ualds_endpoint_initialize(ualds_endpoint *pEndpoint);
void ualds_endpoint_clear(ualds_endpoint *pEndpoint);
int ualds_server();
void ualds_shutdown();
void ualds_reload();
void ualds_expirationcheck();
const ualds_endpoint* ualds_endpoints(OpcUa_UInt32 *pNumEndpoints);
const char* ualds_serveruri();
const char* ualds_producturi();
const char* ualds_applicationname(const char *szLocale);
// param flush
// != 0 => flush to disk
// == 0 => don't flush to disk
int ualds_settings_cleanup(int flush);
/*============================================================================
* Helper Macro For Building Response Header
*===========================================================================*/
#define UALDS_BUILDRESPONSEHEADER \
pResponse->ResponseHeader.Timestamp = OpcUa_DateTime_UtcNow(); \
pResponse->ResponseHeader.RequestHandle = pRequest->RequestHeader.RequestHandle;\
pResponse->ResponseHeader.ServiceResult = uStatus;\
uStatus = OpcUa_Good
#endif /* __UALDS_H__ */