lwip62541.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. #ifndef ARCH_COMMON_LWIP62541_H_
  7. #define ARCH_COMMON_LWIP62541_H_
  8. #define LWIP_TIMEVAL_PRIVATE 0
  9. #define LWIP_POSIX_SOCKETS_IO_NAMES 0
  10. #ifdef LWIP_COMPAT_SOCKETS
  11. #undef LWIP_COMPAT_SOCKETS
  12. #endif
  13. #define LWIP_COMPAT_SOCKETS 0
  14. #include <lwip/tcpip.h>
  15. #include <lwip/netdb.h>
  16. #define sockaddr_storage sockaddr
  17. #define OPTVAL_TYPE int
  18. #define UA_fd_set(fd, fds) FD_SET((unsigned int)fd, fds)
  19. #define UA_fd_isset(fd, fds) FD_ISSET((unsigned int)fd, fds)
  20. #define UA_IPV6 0
  21. #define UA_SOCKET int
  22. #define UA_INVALID_SOCKET -1
  23. #define UA_ERRNO errno
  24. #define UA_INTERRUPTED EINTR
  25. #define UA_AGAIN EAGAIN
  26. #define UA_EAGAIN EAGAIN
  27. #define UA_WOULDBLOCK EWOULDBLOCK
  28. #define UA_ERR_CONNECTION_PROGRESS EINPROGRESS
  29. #define UA_send lwip_send
  30. #define UA_recv lwip_recv
  31. #define UA_close lwip_close
  32. #define UA_select lwip_select
  33. #define UA_shutdown lwip_shutdown
  34. #define UA_socket lwip_socket
  35. #define UA_bind lwip_bind
  36. #define UA_listen lwip_listen
  37. #define UA_accept lwip_accept
  38. #define UA_connect lwip_connect
  39. #define UA_getsockopt lwip_getsockopt
  40. #define UA_setsockopt lwip_setsockopt
  41. #define UA_freeaddrinfo lwip_freeaddrinfo
  42. #define UA_gethostname gethostname_lwip
  43. #define UA_getaddrinfo lwip_getaddrinfo
  44. int gethostname_lwip(char* name, size_t len);
  45. #endif /* ARCH_COMMON_LWIP62541_H_ */