open62541 1.3.12
Open source implementation of OPC UA
Loading...
Searching...
No Matches
architecture_functions.h
Go to the documentation of this file.
1/** This work is licensed under a Creative Commons CCZero 1.0 Universal License.
2 * See http://creativecommons.org/publicdomain/zero/1.0/ for more information.
3 *
4 * Copyright 2018 (c) Jose Cabral, fortiss GmbH
5 */
6
7/*
8 * This header has all the functions that are architecture dependent. The
9 * declaration is behind an ifndef since they can be previously defined in the
10 * ua_architecture.h which include this files at the end
11 */
12
13#ifndef PLUGINS_ARCH_UA_ARCHITECTURE_FUNCTIONS_H_
14#define PLUGINS_ARCH_UA_ARCHITECTURE_FUNCTIONS_H_
15
16#include <open62541/config.h>
17
19
20/** Sleep function */
21#ifndef UA_sleep_ms
22int UA_sleep_ms(unsigned int miliSeconds); //suspend the thread for a certain amount of mili seconds
23#endif
24
25/** Socket functions */
26#ifndef UA_send
27ssize_t UA_send(UA_SOCKET sockfd, const void *buf, size_t len, int flags); //equivalent to posix send implementation
28#endif
29
30#ifndef UA_sendto
31ssize_t UA_sendto(UA_SOCKET sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen); //equivalent to posix sendto implementation
32#endif
33
34#ifndef UA_select
35int UA_select(UA_SOCKET nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); //equivalent to posix select implementation
36#endif
37
38#ifndef UA_recv
39ssize_t UA_recv(UA_SOCKET sockfd, void *buf, size_t len, int flags); //equivalent to posix recv implementation
40#endif
41
42#ifndef UA_recvfrom
43ssize_t UA_recvfrom(UA_SOCKET sockfd, void *buf, size_t len, int flags, struct sockaddr *src_addr, socklen_t *addrlen);//equivalent to posix recvfrom implementation
44#endif
45
46#ifndef UA_recvmsg
47ssize_t UA_recvmsg(int sockfd, struct msghdr *msg, int flags);//equivalent to posix recvmsg implementation
48#endif
49
50#ifndef UA_shutdown
51int UA_shutdown(UA_SOCKET sockfd, int how); //equivalent to posix shutdown implementation
52#endif
53
54#ifndef UA_socket
55UA_SOCKET UA_socket(int domain, int type, int protocol);//equivalent to posix socket implementation
56#endif
57
58#ifndef UA_bind
59int UA_bind(UA_SOCKET sockfd, const struct sockaddr *addr, socklen_t addrlen);//equivalent to posix bind implementation
60#endif
61
62#ifndef UA_listen
63int UA_listen(UA_SOCKET sockfd, int backlog);//equivalent to posix listen implementation
64#endif
65
66#ifndef UA_accept
67int UA_accept(UA_SOCKET sockfd, struct sockaddr *addr, socklen_t *addrlen);//equivalent to posix accept implementation
68#endif
69
70#ifndef UA_close
71int UA_close(UA_SOCKET sockfd);//equivalent to posix close implementation
72#endif
73
74#ifndef UA_connect
75int UA_connect(UA_SOCKET sockfd, const struct sockaddr *addr, socklen_t addrlen);//equivalent to posix connect implementation
76#endif
77
78#ifndef UA_fd_set
79void UA_fd_set(UA_SOCKET fd, fd_set *set); //equivalent to posix FD_SET implementation
80#endif
81
82#ifndef UA_fd_isset
83int UA_fd_isset(UA_SOCKET fd, fd_set *set);//equivalent to posix FD_ISSET implementation
84#endif
85
86#ifndef UA_getaddrinfo
87int UA_getaddrinfo(const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res);//equivalent to posix getaddrinfo implementation
88#endif
89
90#ifndef UA_htonl
91uint32_t UA_htonl(uint32_t hostlong);//equivalent to posix UA_htonl implementation
92#endif
93
94#ifndef UA_ntohl
95uint32_t UA_ntohl(uint32_t netlong);//equivalent to posix ntohl implementation
96#endif
97
98#ifndef UA_inet_pton
99int UA_inet_pton(int af, const char *src, void *dst);//equivalent to ANSI inet_pton implementation
100#endif
101
102#if UA_IPV6
103# ifndef UA_if_nametoindex
104unsigned int UA_if_nametoindex(const char *ifname);//equivalent to posix if_nametoindex implementation
105# endif
106#endif
107
108#ifndef UA_socket_set_blocking
109unsigned int UA_socket_set_blocking(UA_SOCKET sockfd);//set a socket as blocking. Returns 0 if OK, other value otherwise
110#endif
111
112#ifndef UA_socket_set_nonblocking
113unsigned int UA_socket_set_nonblocking(UA_SOCKET sockfd);//set a socket as non-blocking. Returns 0 if OK, other value otherwise
114#endif
115
116#ifndef UA_ioctl
117int UA_ioctl(int fildes, int request, ...);//equivalent to posix ioctl implementation
118#endif
119
120#ifndef UA_getsockopt
121int UA_getsockopt(int sockfd, int level, int optname, void *optval, socklen_t *optlen); //equivalent to posix getsockopt implementation. Only in non windows architectures
122#endif
123
124#ifndef UA_setsockopt
125int UA_setsockopt(int sockfd, int level, int optname, const void *optval, socklen_t optlen);//equivalent to posix setsockopt implementation
126#endif
127
128#ifndef UA_freeaddrinfo
129void UA_freeaddrinfo(struct addrinfo *res);//equivalent to posix freeaddrinfo implementation
130#endif
131
132#ifndef UA_gethostname
133int UA_gethostname(char *name, size_t len);//equivalent to posix gethostname implementation
134#endif
135
136#ifndef UA_getsockname
137int UA_getsockname(int sockfd, struct sockaddr *addr, socklen_t *addrlen);//equivalent to posix getsockname implementation
138#endif
139
140#ifndef UA_initialize_architecture_network
141void UA_initialize_architecture_network(void);//initializes all needed for using the network interfaces
142#endif
143
144#ifndef UA_deinitialize_architecture_network
145void UA_deinitialize_architecture_network(void);//de-initializes the network interfaces
146#endif
147
148/** Print function */
149#ifndef UA_snprintf
150int UA_snprintf(char* pa_stream, size_t pa_size, const char* pa_format, ...); //prints text to output
151#endif
152
153#ifndef UA_strncasecmp
154int UA_strncasecmp(const char* s1, const char* s2, size_t n);
155#endif
156
157/** Access to file function */
158#ifndef UA_access
159int UA_access(const char *pathname, int mode); //equivalent implementation of https://linux.die.net/man/2/access
160#endif
161
162#ifndef UA_fileExists
163#define UA_fileExists(X) ( UA_access(X, 0) == 0)
164#endif
165
167
169
170#endif /* PLUGINS_ARCH_UA_ARCHITECTURE_FUNCTIONS_H_ */
unsigned int UA_socket_set_nonblocking(UA_SOCKET sockfd)
ssize_t UA_recvmsg(int sockfd, struct msghdr *msg, int flags)
unsigned int UA_socket_set_blocking(UA_SOCKET sockfd)
void UA_initialize_architecture_network(void)
int UA_strncasecmp(const char *s1, const char *s2, size_t n)
int UA_access(const char *pathname, int mode)
Access to file function.
void UA_deinitialize_architecture_network(void)
int UA_ioctl(int fildes, int request,...)
#define _UA_BEGIN_DECLS
#undef UA_DEBUG_DUMP_PKGS
Definition config.h:89
#define _UA_END_DECLS
Definition config.h:96
static UA_LogCategory const char * msg
Definition log.h:53
#define UA_sleep_ms(X)
This work is licensed under a Creative Commons CCZero 1.0 Universal License.
Definition ua_freeRTOS.h:17
#define UA_snprintf
Definition ua_freeRTOS.h:41
#define UA_setsockopt
Definition ua_lwip.h:59
#define UA_gethostname
Definition ua_lwip.h:62
#define UA_sendto
Definition ua_lwip.h:46
#define UA_socket
Definition ua_lwip.h:53
#define UA_ntohl
Definition ua_lwip.h:49
#define UA_getsockname
Definition ua_lwip.h:67
#define UA_select
Definition ua_lwip.h:51
#define UA_send
Definition ua_lwip.h:44
#define UA_getaddrinfo
Definition ua_lwip.h:72
#define UA_recvfrom
Definition ua_lwip.h:47
#define UA_bind
Definition ua_lwip.h:54
#define UA_getsockopt
Definition ua_lwip.h:58
#define UA_fd_set(fd, fds)
Definition ua_lwip.h:27
#define UA_close
Definition ua_lwip.h:50
#define UA_freeaddrinfo
Definition ua_lwip.h:60
#define UA_listen
Definition ua_lwip.h:55
#define UA_accept
Definition ua_lwip.h:56
#define UA_fd_isset(fd, fds)
Definition ua_lwip.h:28
#define UA_inet_pton(af, src, dst)
Definition ua_lwip.h:83
#define UA_recv
Definition ua_lwip.h:45
#define UA_SOCKET
Definition ua_lwip.h:31
#define UA_shutdown
Definition ua_lwip.h:52
#define UA_htonl
Definition ua_lwip.h:48
#define UA_connect
Definition ua_lwip.h:57