open62541 1.3.12
Open source implementation of OPC UA
Loading...
Searching...
No Matches
ua_pubsub_networkmessage.h
Go to the documentation of this file.
1/** This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
4 *
5 * Copyright (c) 2017 - 2018 Fraunhofer IOSB (Author: Tino Bischoff)
6 * Copyright (c) 2017-2019 Fraunhofer IOSB (Author: Andreas Ebner)
7 */
8
9#ifndef UA_PUBSUB_NETWORKMESSAGE_H_
10#define UA_PUBSUB_NETWORKMESSAGE_H_
11
12#include <open62541/types.h>
15
17
18/** DataSet Payload Header */
23
24/** FieldEncoding Enum */
31
32/** DataSetMessage Type */
39
40/** DataSetMessage Header */
58
59
60
61typedef struct {
65 /* Json keys for the dataSetFields: TODO: own dataSetMessageType for json? */
68
73
78
86
91
99
105
106
117
118
128
129
174
175
176/** Network Message Offsets */
177
178
179/** Offsets for buffered messages in the PubSub fast path. */
196
197typedef struct {
199 union {
200 struct {
203 } value;
205 } offsetData;
206 size_t offset;
208
209typedef struct {
210 UA_ByteString buffer; /* The precomputed message buffer */
211 UA_NetworkMessageOffset *offsets; /* Offsets for changes in the message buffer */
213 UA_Boolean RTsubscriberEnabled; /* Addtional offsets computation like publisherId, WGId if this bool enabled */
214 UA_NetworkMessage *nm; /* The precomputed NetworkMessage for subscriber */
217
218void
220
221
222
225 UA_Byte **bufPos, const UA_Byte *bufEnd);
226
230
231size_t
233
236 const UA_Byte *bufEnd);
237
240 UA_DataSetMessage* dst, UA_UInt16 dsmSize);
241
242size_t
244 size_t currentOffset);
245
247
248
249
252
255 const UA_ByteString *src, size_t *bufferPosition);
256
257
258
259
260/** If dataToEncryptStart not-NULL, then it will be set to the start-position of
261 * the payload in the buffer. */
264 UA_Byte **bufPos, const UA_Byte *bufEnd,
265 UA_Byte **dataToEncryptStart);
266
269 UA_Byte **bufPos, const UA_Byte *bufEnd);
270
273 UA_Byte **bufPos, const UA_Byte *bufEnd);
274
277 UA_Byte **bufPos, const UA_Byte *bufEnd);
278
279
280
283
286
289
292 UA_NetworkMessage* dst);
293
294
297
298size_t
300 UA_NetworkMessageOffsetBuffer *offsetBuffer);
301
302#ifdef UA_ENABLE_PUBSUB_ENCRYPTION
303
305UA_NetworkMessage_signEncrypt(UA_NetworkMessage *nm, UA_MessageSecurityMode securityMode,
306 UA_PubSubSecurityPolicy *policy, void *policyContext,
307 UA_Byte *messageStart, UA_Byte *encryptStart,
308 UA_Byte *sigStart);
309#endif
310
311void
313
314#ifdef UA_ENABLE_JSON_ENCODING
316UA_NetworkMessage_encodeJson(const UA_NetworkMessage *src,
317 UA_Byte **bufPos, const UA_Byte **bufEnd, UA_String *namespaces,
318 size_t namespaceSize, UA_String *serverUris,
319 size_t serverUriSize, UA_Boolean useReversible);
320
321size_t
322UA_NetworkMessage_calcSizeJson(const UA_NetworkMessage *src,
323 UA_String *namespaces, size_t namespaceSize,
324 UA_String *serverUris, size_t serverUriSize,
325 UA_Boolean useReversible);
326
327UA_StatusCode UA_NetworkMessage_decodeJson(UA_NetworkMessage *dst, const UA_ByteString *src);
328#endif
329
331
332#endif /* UA_PUBSUB_NETWORKMESSAGE_H_ */
#define _UA_BEGIN_DECLS
#undef UA_DEBUG_DUMP_PKGS
Definition config.h:89
#define _UA_END_DECLS
Definition config.h:96
UA_DataSetMessageType dataSetMessageType
UA_DataSetMessage_DeltaFrameField * deltaFrameFields
UA_DataSetMessageHeader header
UA_DataSetMessage_DataDeltaFrameData deltaFrameData
UA_DataSetMessage_DataKeyFrameData keyFrameData
This Source Code Form is subject to the terms of the Mozilla Public License, v.
UA_DataSetMessage * dataSetMessages
UA_NetworkMessageOffsetType contentType
UA_NetworkMessageSecurityHeader securityHeader
UA_NetworkMessageType networkMessageType
UA_DataSetPayloadHeader dataSetPayloadHeader
UA_NetworkMessageGroupHeader groupHeader
UA_DataSetPayload dataSetPayload
UA_PublisherIdDatatype publisherIdType
_UA_BEGIN_DECLS typedef bool UA_Boolean
This Source Code Form is subject to the terms of the Mozilla Public License, v.
Definition types.h:26
uint16_t UA_UInt16
Definition types.h:46
uint32_t UA_UInt32
Definition types.h:56
int64_t UA_DateTime
Definition types.h:144
uint32_t UA_StatusCode
Definition types.h:77
uint8_t UA_Byte
Definition types.h:36
uint64_t UA_UInt64
Definition types.h:66
UA_MessageSecurityMode
UA_DateTime UA_UtcTime
UA_StatusCode UA_NetworkMessage_decodeBinary(const UA_ByteString *src, size_t *offset, UA_NetworkMessage *dst)
UA_StatusCode UA_NetworkMessage_updateBufferedNwMessage(UA_NetworkMessageOffsetBuffer *buffer, const UA_ByteString *src, size_t *bufferPosition)
void UA_NetworkMessage_clear(UA_NetworkMessage *p)
UA_StatusCode UA_NetworkMessage_updateBufferedMessage(UA_NetworkMessageOffsetBuffer *buffer)
UA_StatusCode UA_DataSetMessage_encodeBinary(const UA_DataSetMessage *src, UA_Byte **bufPos, const UA_Byte *bufEnd)
size_t UA_DataSetMessageHeader_calcSizeBinary(const UA_DataSetMessageHeader *p)
UA_StatusCode UA_NetworkMessage_decodeFooters(const UA_ByteString *src, size_t *offset, UA_NetworkMessage *dst)
UA_StatusCode UA_NetworkMessage_encodeHeaders(const UA_NetworkMessage *src, UA_Byte **bufPos, const UA_Byte *bufEnd)
UA_StatusCode UA_DataSetMessageHeader_encodeBinary(const UA_DataSetMessageHeader *src, UA_Byte **bufPos, const UA_Byte *bufEnd)
UA_FieldEncoding
FieldEncoding Enum
@ UA_FIELDENCODING_RAWDATA
@ UA_FIELDENCODING_UNKNOWN
@ UA_FIELDENCODING_DATAVALUE
@ UA_FIELDENCODING_VARIANT
UA_StatusCode UA_NetworkMessage_encodeBinary(const UA_NetworkMessage *src, UA_Byte **bufPos, const UA_Byte *bufEnd, UA_Byte **dataToEncryptStart)
If dataToEncryptStart not-NULL, then it will be set to the start-position of the payload in the buffe...
void UA_NetworkMessageOffsetBuffer_clear(UA_NetworkMessageOffsetBuffer *ob)
size_t UA_NetworkMessage_calcSizeBinary(UA_NetworkMessage *p, UA_NetworkMessageOffsetBuffer *offsetBuffer)
void UA_DataSetMessage_clear(const UA_DataSetMessage *p)
UA_StatusCode UA_NetworkMessage_decodeHeaders(const UA_ByteString *src, size_t *offset, UA_NetworkMessage *dst)
UA_StatusCode UA_NetworkMessage_encodePayload(const UA_NetworkMessage *src, UA_Byte **bufPos, const UA_Byte *bufEnd)
@ UA_PUBLISHERDATATYPE_BYTE
@ UA_PUBLISHERDATATYPE_STRING
@ UA_PUBLISHERDATATYPE_UINT64
@ UA_PUBLISHERDATATYPE_UINT32
@ UA_PUBLISHERDATATYPE_UINT16
UA_NetworkMessageOffsetType
Network Message Offsets
@ UA_PUBSUB_OFFSETTYPE_TIMESTAMP_NOW
@ UA_PUBSUB_OFFSETTYPE_NETWORKMESSAGE_SEQUENCENUMBER
@ UA_PUBSUB_OFFSETTYPE_PAYLOAD_DATAVALUE
@ UA_PUBSUB_OFFSETTYPE_DATASETWRITERID
@ UA_PUBSUB_OFFSETTYPE_NETWORKMESSAGE_FIELDENCDODING
@ UA_PUBSUB_OFFSETTYPE_TIMESTAMP
@ UA_PUBSUB_OFFSETTYPE_PAYLOAD_RAW
@ UA_PUBSUB_OFFSETTYPE_PAYLOAD_VARIANT
@ UA_PUBSUB_OFFSETTYPE_DATASETMESSAGE_SEQUENCENUMBER
@ UA_PUBSUB_OFFSETTYPE_PUBLISHERID
@ UA_PUBSUB_OFFSETTYPE_WRITERGROUPID
@ UA_PUBSUB_OFFSETTYPE_TIMESTAMP_PICOSECONDS
size_t UA_DataSetMessage_calcSizeBinary(UA_DataSetMessage *p, UA_NetworkMessageOffsetBuffer *offsetBuffer, size_t currentOffset)
@ UA_NETWORKMESSAGE_DISCOVERY_RESPONSE
@ UA_NETWORKMESSAGE_DATASET
@ UA_NETWORKMESSAGE_DISCOVERY_REQUEST
UA_StatusCode UA_DataSetMessageHeader_decodeBinary(const UA_ByteString *src, size_t *offset, UA_DataSetMessageHeader *dst)
UA_StatusCode UA_NetworkMessage_decodePayload(const UA_ByteString *src, size_t *offset, UA_NetworkMessage *dst)
UA_DataSetMessageType
DataSetMessage Type.
@ UA_DATASETMESSAGE_KEEPALIVE
@ UA_DATASETMESSAGE_DATAKEYFRAME
@ UA_DATASETMESSAGE_DATADELTAFRAME
@ UA_DATASETMESSAGE_EVENT
UA_StatusCode UA_NetworkMessageHeader_decodeBinary(const UA_ByteString *src, size_t *offset, UA_NetworkMessage *dst)
UA_StatusCode UA_NetworkMessage_encodeFooters(const UA_NetworkMessage *src, UA_Byte **bufPos, const UA_Byte *bufEnd)
UA_StatusCode UA_DataSetMessage_decodeBinary(const UA_ByteString *src, size_t *offset, UA_DataSetMessage *dst, UA_UInt16 dsmSize)