S2OPC OPCUA Toolkit
Loading...
Searching...
No Matches
sopc_udp_sockets.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// TODO: only Linux implementation provided
27
28#ifndef SOPC_UDP_SOCKETS_H_
29#define SOPC_UDP_SOCKETS_H_
30
31#include <stdbool.h>
32#include <stdint.h>
33#include <stdio.h>
34
35#include "sopc_buffer.h"
36#include "sopc_enums.h"
37#include "sopc_raw_sockets.h"
38
48SOPC_Socket_AddressInfo* SOPC_UDP_SocketAddress_Create(bool IPv6, const char* node, const char* service);
49
51
67 const char* interfaceName,
68 bool setReuseAddr,
69 bool setNonBlocking,
70 SOPC_Socket* sock);
71
84 const char* interfaceName,
85 bool setNonBlocking,
86 SOPC_Socket* sock);
87
100 const SOPC_Socket_AddressInfo* destAddr,
101 SOPC_Buffer* buffer);
102
113
131
140
141#endif /* SOPC_UDP_SOCKETS_H_ */
A buffer of bytes with a maximum size, length and position.
enum _SOPC_ReturnStatus SOPC_ReturnStatus
Common enumerations for S2OPC.
A platform independent API to use sockets.
SOPC_ReturnStatus SOPC_UDP_Socket_ReceiveFrom(SOPC_Socket sock, SOPC_Buffer *buffer)
Receive data on the UDP socket from given IP address and port.
SOPC_ReturnStatus SOPC_UDP_Socket_CreateToSend(SOPC_Socket_AddressInfo *destAddress, const char *interfaceName, bool setNonBlocking, SOPC_Socket *sock)
Create a new UDP socket and bind it.
SOPC_ReturnStatus SOPC_UDP_Socket_SendTo(SOPC_Socket sock, const SOPC_Socket_AddressInfo *destAddr, SOPC_Buffer *buffer)
Send data through the UDP socket to given IP address and port.
SOPC_ReturnStatus SOPC_UDP_Socket_Set_MulticastTTL(SOPC_Socket sock, uint8_t TTL_scope)
Set the Multicast TTL configuration value (default value is 1) Controls the live time of datagram (de...
void SOPC_UDP_Socket_Close(SOPC_Socket *sock)
Close the socket connection and/or clear the socket If the socket was automatically added to a multic...
SOPC_ReturnStatus SOPC_UDP_Socket_CreateToReceive(SOPC_Socket_AddressInfo *listenAddress, const char *interfaceName, bool setReuseAddr, bool setNonBlocking, SOPC_Socket *sock)
Create a new UDP socket and bind it.
SOPC_Socket_AddressInfo * SOPC_UDP_SocketAddress_Create(bool IPv6, const char *node, const char *service)
Create a new UDP socket address using getaddrinfo.
void SOPC_UDP_SocketAddress_Delete(SOPC_Socket_AddressInfo **addr)
Bytes buffer structure.
Definition sopc_buffer.h:38
Socket addressing information for listening or connecting operation type.
Definition p_sopc_sockets.h:46
Socket base type.
Definition p_sopc_sockets.h:36