S2OPC OPCUA Toolkit
Loading...
Searching...
No Matches
sopc_protocol_constants.h
Go to the documentation of this file.
1/*
2 * Licensed to Systerel under one or more contributor license
3 * agreements. See the NOTICE file distributed with this work
4 * for additional information regarding copyright ownership.
5 * Systerel licenses this file to you under the Apache
6 * License, Version 2.0 (the "License"); you may not use this
7 * file except in compliance with the License. You may obtain
8 * a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
26#ifndef SOPC_PROTOCOL_CONSTANTS_H_
27#define SOPC_PROTOCOL_CONSTANTS_H_
28
29/* OPC UA SPECIFICATION CONFIGURATION */
30
32#define SOPC_PROTOCOL_VERSION 0
33
34/* now defined only for OPC UA Secure Conversation (minimum chunk size): see mantis #3447 */
35#define SOPC_TCP_UA_MIN_BUFFER_SIZE 8192
36
37/* see Part 6 Table 31, 35 and 37 */
38#define SOPC_TCP_UA_MAX_URL_AND_REASON_LENGTH 4096
39
40/* Length of a TCP UA message Header */
41#define SOPC_TCP_UA_HEADER_LENGTH 8
42/* Length of a TCP UA ACK message */
43#define SOPC_TCP_UA_ACK_MSG_LENGTH 28
44/* Minimum length of a TCP UA HELLO message (without including URL string content but only its size)*/
45#define SOPC_TCP_UA_HEL_MIN_MSG_LENGTH 32
46/* Minimum length of a TCP UA ERROR message */
47#define SOPC_TCP_UA_ERR_MIN_MSG_LENGTH 16
48/* Minimum length of a TCP UA REVERSE HELLO message (without including URI/URL strings content but only its size)*/
49#define SOPC_TCP_UA_RHE_MIN_MSG_LENGTH 16
50
51/* Position of MessageSize header field in a UA message chunk*/
52#define SOPC_UA_HEADER_MESSAGE_SIZE_POSITION 4
53/* Position of IsFinal header field in a UA message chunk*/
54#define SOPC_UA_HEADER_ISFINAL_POSITION 3
55
56/* Length of an UA secure message chunk header */
57#define SOPC_UA_SECURE_MESSAGE_HEADER_LENGTH 12
58/* Length of an UA symmetric security header chunk header */
59#define SOPC_UA_SYMMETRIC_SECURITY_HEADER_LENGTH 4
60/* Length of an UA secure message chunk sequence header */
61#define SOPC_UA_SECURE_MESSAGE_SEQUENCE_LENGTH 8
62
63/* Length of 3 previous header fields */
64#define SOPC_UA_SYMMETRIC_SECURE_MESSAGE_HEADERS_LENGTH \
65 (SOPC_UA_SECURE_MESSAGE_HEADER_LENGTH + SOPC_UA_SYMMETRIC_SECURITY_HEADER_LENGTH + \
66 SOPC_UA_SECURE_MESSAGE_SEQUENCE_LENGTH)
67
68/* Position of sequence header in a symmetric secure message */
69#define SOPC_UA_SYMMETRIC_SEQUENCE_HEADER_POSITION \
70 (SOPC_UA_SECURE_MESSAGE_HEADER_LENGTH + SOPC_UA_SYMMETRIC_SECURITY_HEADER_LENGTH)
71
72#endif // SOPC_PROTOCOL_CONSTANTS_H_