Open Core Interface - MLPI
MLPI-MotionLogicProgrammingInterface(mlpiCore)  1.26.2
mlpiSecurityLib.h
Go to the documentation of this file.
1 #ifndef __MLPISECURITYLIB_H__
2 #define __MLPISECURITYLIB_H__
3 
4 // -----------------------------------------------------------------------
5 // MLPI - <mlpiSecurityLib.h>
6 // -----------------------------------------------------------------------
7 // Copyright (c) 2016 Bosch Rexroth. All rights reserved.
8 // Redistribution and use in source and binary forms of this MLPI software
9 // (SW) provided to you, with or without modification, are permitted
10 // without prior approval provided that the following conditions are met:
11 //
12 // 1. Redistributions of source code of SW must retain the above copyright
13 // notice, this list of conditions and the following disclaimer.
14 //
15 // 2. Redistributions in binary form of SW must reproduce the above copyright
16 // notice, this list of conditions and the following disclaimer in the
17 // documentation and/or other materials provided with the distribution.
18 //
19 // 3. User recognizes and acknowledges that it acquires no right,
20 // title or interest in or to any of the names or trademarks used in
21 // connection with the SW ("names") by virtue of this License and waives
22 // any right to or interest in the names. User recognizes and acknowledges
23 // that names of companies or names or products of companies displayed
24 // in the documentation of SW to indicate the interoperability of products
25 // with the SW are the names of their respective owners. The use of such
26 // names in the documentation of SW does not imply any sponsorship,
27 // approval, or endorsement by such companies of this product.
28 //
29 // 4. Modified code versions, i.e. any addition to or deletion from
30 // the substance or structure of the original code of the SW running
31 // the MLPI must be plainly marked as such and must not be misrepresented
32 // as being original SW.
33 //
34 // 5. The SW may only be used in connection with a Bosch Rexroth product.
35 //
36 // THIS INFORMATION IS PROVIDED BY BOSCH REXROTH CORPORATION "AS IS"
37 // AND WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED, INCLUDING
38 // (BUT NOTLIMITED TO) ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
39 // FITNESS FOR ANY PARTICULAR PURPOSE, OR NON-INFRINGEMENT. WHILE THE
40 // INFORMATION PROVIDED IS BELIEVED TO BE ACCURATE, IT MAY INCLUDE
41 // ERRORS OR INACCURACIES.
42 // SUBJECT TO COMPULSORY STATUTORY PROVISIONS OF THE GERMAN LAW AS
43 // THE APPLICABLE LAW FOR THIS LICENSE BOSCH REXROTH CORPORATION WILL
44 // NOT BE LIABLE FOR ANY DAMAGES OF ANY KIND ARISING FROM THE USE OF
45 // THE SOFTWARE DISTRIBUTED HEREUNDER, INCLUDING BUT NOT LIMITED TO
46 // DIRECT, INDIRECT, INCIDENTAL, PUNITIVE, AND CONSEQUENTIAL DAMAGES.
47 // -----------------------------------------------------------------------
48 //
58 //
59 // -----------------------------------------------------------------------
60 
73 
74 
150 
157 
158 // -----------------------------------------------------------------------
159 // GLOBAL INCLUDES
160 // -----------------------------------------------------------------------
161 #include "mlpiGlobal.h"
162 
163 // -----------------------------------------------------------------------
164 // GLOBAL CONSTANTS
165 // -----------------------------------------------------------------------
166 
167 #define MLPI_SECURIY_NETWORKSERVICE_MAX_NAME_LEN (16)
168 #define MLPI_SECURIY_MAX_NETWORKSERVICES (16)
169 #define MLPI_SECURITY_NETWORKCONFIGVALUE_MAX_NAME_LEN (32)
170 #define MLPI_SECURITY_NETWORKCONFIGVALUE_MAX_VALUE_LEN (128)
171 
173 #define MLPI_SECURITY_NETWORKSERVICE_FTP L"FTP"
174 #define MLPI_SECURITY_NETWORKSERVICE_SSH L"SSH"
175 #define MLPI_SECURITY_NETWORKSERVICE_MLPI L"MLPI"
176 #define MLPI_SECURITY_NETWORKSERVICE_MLPIS L"MLPIS"
177 #define MLPI_SECURITY_NETWORKSERVICE_OPCUA L"OPCUA"
178 #define MLPI_SECURITY_NETWORKSERVICE_SIS L"SIS"
179 
180 //-----------------------------------------------------------------------
181 // GLOBAL ENUMERATIONS
182 //-----------------------------------------------------------------------
183 
187 {
191 
195 {
201 
202 // -----------------------------------------------------------------------
203 // GLOBAL TYPEDEFS
204 // -----------------------------------------------------------------------
205 
206 // message packing follows 8 byte natural alignment
207 #if !defined(TARGET_OS_VXWORKS)
208 #pragma pack(push,8)
209 #endif
210 
220 typedef struct MlpiNetworkServiceInfo
221 {
222  WCHAR16 networkServiceName[MLPI_SECURIY_NETWORKSERVICE_MAX_NAME_LEN];
223  MlpiSecurityServiceState networkServiceState;
224  MlpiSecurityServiceControl networkServiceControlInfo;
226 
237 typedef struct MlpiNetworkConfigurationValue
238 {
239  WCHAR16 MLPI_STRUCT_ALIGN_WCHAR16 name[MLPI_SECURITY_NETWORKCONFIGVALUE_MAX_NAME_LEN];
240  WCHAR16 MLPI_STRUCT_ALIGN_WCHAR16 value[MLPI_SECURITY_NETWORKCONFIGVALUE_MAX_VALUE_LEN];
242 
243 #if !defined(TARGET_OS_VXWORKS)
244 #pragma pack(pop)
245 #endif
246 
253 
254 // -----------------------------------------------------------------------
255 // GLOBAL EXPORTS
256 // -----------------------------------------------------------------------
257 #ifdef MLPI_API
258 #undef MLPI_API
259 #endif
260 
261 #if defined(TARGET_OS_WINNT)
262 #if defined(MLPI_EXPORTS)
263 #define MLPI_API __declspec(dllexport)
264 #elif defined(MLPI_IMPORTS)
265 #define MLPI_API __declspec(dllimport)
266 #else
267 #define MLPI_API
268 #endif
269 #else
270 #if defined(MLPI_EXPORTS)
271 #define MLPI_API __attribute__ ((visibility("default")))
272 #elif defined(MLPI_IMPORTS)
273 #define MLPI_API
274 #else
275 #define MLPI_API
276 #endif
277 #endif
278 
279 #ifdef __cplusplus
280 extern "C" {
281 #endif
282 
297 MLPI_API MLPIRESULT mlpiSecurityGetNetworkServiceInformation(const MLPIHANDLE connection, MlpiNetworkServiceInfo *serviceInformation, const ULONG numElements, ULONG *numElementsRet);
298 
312 MLPI_API MLPIRESULT mlpiSecurityGetNetworkServiceActivation(const MLPIHANDLE connection, const WCHAR16 *service, MlpiSecurityServiceState *state);
313 
326 MLPI_API MLPIRESULT mlpiSecuritySetNetworkServiceActivation(const MLPIHANDLE connection, const WCHAR16 *service, const MlpiSecurityServiceState state);
327 
343 MLPI_API MLPIRESULT mlpiSecurityGetNetworkServiceConfiguration(const MLPIHANDLE connection, const WCHAR16 *service, MlpiNetworkConfigurationValue *const config, const ULONG numElements, ULONG *const numElementsRet);
344 
362 MLPI_API MLPIRESULT mlpiSecuritySetNetworkServiceConfiguration(const MLPIHANDLE connection, const WCHAR16 *service, MlpiNetworkConfigurationValue *const config, const ULONG numElements);
363 
364 #ifdef __cplusplus
365 }
366 #endif
367 #endif /*__MLPISECURITYLIB_H__*/
MlpiSecurityServiceControl
This enumeration describes the control possibilities of an specific network service.
Protocol can be switched on an off.
MlpiSecurityServiceState
This enumeration describes the possible states of the network services.
struct MlpiNetworkConfigurationValue MlpiNetworkConfigurationValue
This structure provides one configuration value about a specific network-service. ...
wchar_t WCHAR16
UTF16 string.
Definition: mlpiGlobal.h:193
unsigned int ULONG
4 byte unsigned integer
Definition: mlpiGlobal.h:165
Protocol can be switched off.
MLPIRESULT mlpiSecurityGetNetworkServiceInformation(const MLPIHANDLE connection, MlpiNetworkServiceInfo *serviceInformation, const ULONG numElements, ULONG *numElementsRet)
This function returns information regarding all the network services available on the target device...
Protocol can be switched on.
struct MlpiNetworkServiceInfo MlpiNetworkServiceInfo
This structure provides all information about a specific network-service.
MLPIRESULT mlpiSecuritySetNetworkServiceConfiguration(const MLPIHANDLE connection, const WCHAR16 *service, MlpiNetworkConfigurationValue *const config, const ULONG numElements)
This function sets the configurations for selected network services.
MLPIRESULT mlpiSecurityGetNetworkServiceConfiguration(const MLPIHANDLE connection, const WCHAR16 *service, MlpiNetworkConfigurationValue *const config, const ULONG numElements, ULONG *const numElementsRet)
This function returns current configuration for all network services.
Protocol is not active.
MLPIRESULT mlpiSecuritySetNetworkServiceActivation(const MLPIHANDLE connection, const WCHAR16 *service, const MlpiSecurityServiceState state)
This function activates or deactivates a specific network service.
Protocol state can not be changed.
unsigned long MLPIHANDLE
common MLPI-API handle value
Definition: mlpiGlobal.h:206
MLPIRESULT mlpiSecurityGetNetworkServiceActivation(const MLPIHANDLE connection, const WCHAR16 *service, MlpiSecurityServiceState *state)
This function obtains the current activation state for a specific network service.
int MLPIRESULT
common MLPI-API return value
Definition: mlpiGlobal.h:198
#define MLPI_STRUCT_ALIGN_WCHAR16
2 byte char, aligned within structs to MLPI data type WCHAR16
Definition: mlpiGlobal.h:304