S2OPC OPCUA Toolkit
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 
48 SOPC_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  Socket* sock);
71 
84  const char* interfaceName,
85  bool setNonBlocking,
86  Socket* sock);
87 
100 
111 
129 
138 
139 #endif /* SOPC_UDP_SOCKETS_H_ */
sopc_raw_sockets.h
A platform independent API to use sockets.
SOPC_Buffer
Bytes buffer structure.
Definition: sopc_buffer.h:38
sopc_enums.h
SOPC_UDP_Socket_ReceiveFrom
SOPC_ReturnStatus SOPC_UDP_Socket_ReceiveFrom(Socket sock, SOPC_Buffer *buffer)
Receive data on the UDP socket from given IP address and port.
SOPC_UDP_Socket_CreateToSend
SOPC_ReturnStatus SOPC_UDP_Socket_CreateToSend(SOPC_Socket_AddressInfo *destAddress, const char *interfaceName, bool setNonBlocking, Socket *sock)
Create a new UDP socket and bind it.
SOPC_UDP_SocketAddress_Create
SOPC_Socket_AddressInfo * SOPC_UDP_SocketAddress_Create(bool IPv6, const char *node, const char *service)
Create a new UDP socket address using getaddrinfo.
SOPC_UDP_Socket_Set_MulticastTTL
SOPC_ReturnStatus SOPC_UDP_Socket_Set_MulticastTTL(Socket sock, uint8_t TTL_scope)
Set the Multicast TTL configuration value (default value is 1) Controls the live time of datagram (de...
SOPC_UDP_Socket_Close
void SOPC_UDP_Socket_Close(Socket *sock)
Close the socket connection and/or clear the socket If the socket was automatically added to a multic...
SOPC_UDP_Socket_CreateToReceive
SOPC_ReturnStatus SOPC_UDP_Socket_CreateToReceive(SOPC_Socket_AddressInfo *listenAddress, const char *interfaceName, bool setReuseAddr, bool setNonBlocking, Socket *sock)
Create a new UDP socket and bind it.
SOPC_UDP_SocketAddress_Delete
void SOPC_UDP_SocketAddress_Delete(SOPC_Socket_AddressInfo **addr)
SOPC_Socket_AddressInfo
struct addrinfo SOPC_Socket_AddressInfo
Socket addressing information for listening or connecting operation type.
Definition: p_sopc_sockets.h:45
SOPC_UDP_Socket_SendTo
SOPC_ReturnStatus SOPC_UDP_Socket_SendTo(Socket sock, const SOPC_Socket_AddressInfo *destAddr, SOPC_Buffer *buffer)
Send data through the UDP socket to given IP address and port.
Socket_t
Definition: p_sopc_sockets.h:30
sopc_buffer.h
A buffer of bytes with a maximum size, length and position.
SOPC_ReturnStatus
SOPC_ReturnStatus
Definition: libs2opc_client.h:64