S2OPC OPCUA Toolkit
Loading...
Searching...
No Matches
p_sopc_udp_sockets_custom.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
20#ifndef SOPC_P_UDP_SOCKETS_CUSTOM_H_
21#define SOPC_P_UDP_SOCKETS_CUSTOM_H_
22
23#include <inttypes.h>
24
25#include "p_sopc_sockets.h"
26
27#include "sopc_enums.h"
28#include "sopc_raw_sockets.h"
29
30#ifndef SO_TXTIME
31#define SO_TXTIME 61
32#define SCM_TXTIME SO_TXTIME
33#endif
34
35#define ONE_SEC 1000 * 1000 * 1000
36#define CLOCKID CLOCK_TAI
37
38/*
39 * SO_TXTIME gets a struct sock_txtime with flags being an integer bit
40 * field comprised of these values.
41 */
50
55typedef struct
56{
57 clockid_t clockid;
58 uint16_t flags;
60
71SOPC_ReturnStatus SOPC_UDP_SO_TXTIME_Socket_Option(const char* interface, SOPC_Socket sock, uint32_t soPriority);
72
88 void* txBuffer,
89 uint32_t txBuffLen,
90 uint64_t txtime,
91 const char* node,
92 const char* service);
93
104
105#endif /* SOPC_P_UDP_SOCKETS_CUSTOM_H_ */
txtime_flags
Definition p_sopc_udp_sockets_custom.h:43
@ SOF_TXTIME_FLAGS_LAST
Definition p_sopc_udp_sockets_custom.h:47
@ SOF_TXTIME_REPORT_ERRORS
Definition p_sopc_udp_sockets_custom.h:45
@ SOF_TXTIME_DEADLINE_MODE
Definition p_sopc_udp_sockets_custom.h:44
@ SOF_TXTIME_FLAGS_MASK
Definition p_sopc_udp_sockets_custom.h:48
SOPC_ReturnStatus SOPC_TX_UDP_Socket_Error_Queue(SOPC_Socket sock)
Function for socket error queue.
SOPC_ReturnStatus SOPC_TX_UDP_send(SOPC_Socket sock, void *txBuffer, uint32_t txBuffLen, uint64_t txtime, const char *node, const char *service)
Send data through the UDP socket to given IP address and port.
SOPC_ReturnStatus SOPC_UDP_SO_TXTIME_Socket_Option(const char *interface, SOPC_Socket sock, uint32_t soPriority)
Function to add new socket option and bind interface.
enum _SOPC_ReturnStatus SOPC_ReturnStatus
Common enumerations for S2OPC.
A platform independent API to use sockets.
Socket base type.
Definition p_sopc_sockets.h:36
The API for SO_TXTIME is the below struct and enum, which will be provided by uapi/linux/net_tstamp....
Definition p_sopc_udp_sockets_custom.h:56
clockid_t clockid
Definition p_sopc_udp_sockets_custom.h:57
uint16_t flags
Definition p_sopc_udp_sockets_custom.h:58