mirror of
https://github.com/azure-rtos/netx.git
synced 2023-08-10 07:57:54 +08:00
Update on 30 Jun 2023. Expand to see details.
06cb10f01 Fix typo in NetXDuo Crypto 996dd14fc BSD functions overriding option 3b756c219 Fix mqtt interoperability issue when upgrade to ubuntu 20.04 01ca51021 Added support for skipping failed step 3e3a15e79 Add record length checking in nxe_secure_tls_session_send. ec617d178 Fix demo_netx_secure_tls test link issue under nightly build a934cb718 Fix pipeline libgcc issue in nx_secure_interoperability test f08024578 Fix illegal access when NXD_MQTT_OVER_WEBSOCKET enabled 9798e2b89 Corrected the mDNS symbols check 456007dd1 Fixed multiple proxy update issue cf0bf15b5 Add TLS sample demo_netx_secure_tls.c. 87ea505bf Add sha256 in driver preprocess command for ADU 7e1b9686a Add pnp check for ADU ef78d336d Improved the code to ignore null file url.
This commit is contained in:
parent
997f73d296
commit
f84c27a68d
1070
addons/BSD/nx_bsd.c
1070
addons/BSD/nx_bsd.c
File diff suppressed because it is too large
Load Diff
@ -25,7 +25,7 @@
|
|||||||
/* BSD DEFINITIONS RELEASE */
|
/* BSD DEFINITIONS RELEASE */
|
||||||
/* */
|
/* */
|
||||||
/* nx_bsd.h PORTABLE C */
|
/* nx_bsd.h PORTABLE C */
|
||||||
/* 6.1.5 */
|
/* 6.x */
|
||||||
/* AUTHOR */
|
/* AUTHOR */
|
||||||
/* */
|
/* */
|
||||||
/* Yuxin Zhou, Microsoft Corporation */
|
/* Yuxin Zhou, Microsoft Corporation */
|
||||||
@ -46,6 +46,10 @@
|
|||||||
/* 03-02-2021 Yuxin Zhou Modified comment(s), and */
|
/* 03-02-2021 Yuxin Zhou Modified comment(s), and */
|
||||||
/* fixed compiler warnings, */
|
/* fixed compiler warnings, */
|
||||||
/* resulting in version 6.1.5 */
|
/* resulting in version 6.1.5 */
|
||||||
|
/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), and */
|
||||||
|
/* added option to enable */
|
||||||
|
/* native APIs with prefix, */
|
||||||
|
/* resulting in version 6.x */
|
||||||
/* */
|
/* */
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
|
|
||||||
@ -115,6 +119,13 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
/* #define NX_BSD_TIMEOUT_PROCESS_IN_TIMER */
|
/* #define NX_BSD_TIMEOUT_PROCESS_IN_TIMER */
|
||||||
|
|
||||||
|
|
||||||
|
/* Defined, APIs are natively named with nx_bsd_ prefix to avoid conflicting/overriding OS BSD APIs. */
|
||||||
|
/*
|
||||||
|
#define NX_BSD_ENABLE_NATIVE_API
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* Define configuration constants for the BSD compatibility layer. Note that these can be overridden via -D or a #define somewhere else. */
|
/* Define configuration constants for the BSD compatibility layer. Note that these can be overridden via -D or a #define somewhere else. */
|
||||||
|
|
||||||
#ifndef NX_BSD_TCP_WINDOW
|
#ifndef NX_BSD_TCP_WINDOW
|
||||||
@ -167,6 +178,94 @@ extern "C" {
|
|||||||
#define NX_BSD_TIMED_WAIT_EVENT ((ULONG) 0x00000008) /* Event flag to signal a timed wait state has expired on a socket */
|
#define NX_BSD_TIMED_WAIT_EVENT ((ULONG) 0x00000008) /* Event flag to signal a timed wait state has expired on a socket */
|
||||||
#define NX_BSD_TIMER_EVENT ((ULONG) 0x00000010) /* Event flag to singal a BSD 1 sec timer */
|
#define NX_BSD_TIMER_EVENT ((ULONG) 0x00000010) /* Event flag to singal a BSD 1 sec timer */
|
||||||
|
|
||||||
|
|
||||||
|
/* For BSD APIs overriding. */
|
||||||
|
|
||||||
|
#if !defined(NX_BSD_ENABLE_NATIVE_API)
|
||||||
|
|
||||||
|
|
||||||
|
/* Overriding struct names. */
|
||||||
|
|
||||||
|
#define nx_bsd_time_t time_t
|
||||||
|
#define nx_bsd_suseconds_t suseconds_t
|
||||||
|
|
||||||
|
#define nx_bsd_timeval timeval
|
||||||
|
|
||||||
|
#define nx_bsd_sockaddr_storage sockaddr_storage
|
||||||
|
|
||||||
|
#define nx_bsd_sockaddr sockaddr
|
||||||
|
|
||||||
|
#define nx_bsd_in6_addr in6_addr
|
||||||
|
|
||||||
|
#define nx_bsd_sockaddr_in6 sockaddr_in6
|
||||||
|
|
||||||
|
#define nx_bsd_in_addr in_addr
|
||||||
|
#define nx_bsd_in_addr_t in_addr_t
|
||||||
|
#define nx_bsd_socklen_t socklen_t
|
||||||
|
|
||||||
|
#define nx_bsd_sockaddr_in sockaddr_in
|
||||||
|
|
||||||
|
#define nx_bsd_fd_set fd_set
|
||||||
|
|
||||||
|
#define nx_bsd_ip_mreq ip_mreq
|
||||||
|
|
||||||
|
#define nx_bsd_sock_errno sock_errno
|
||||||
|
|
||||||
|
#define nx_bsd_linger linger
|
||||||
|
|
||||||
|
#define nx_bsd_sock_keepalive sock_keepalive
|
||||||
|
|
||||||
|
#define nx_bsd_sock_reuseaddr sock_reuseaddr
|
||||||
|
|
||||||
|
#define nx_bsd_sock_winsize sock_winsize
|
||||||
|
|
||||||
|
#define nx_bsd_addrinfo addrinfo
|
||||||
|
|
||||||
|
#define nx_bsd_pollfd pollfd
|
||||||
|
|
||||||
|
#define nx_bsd_sockaddr_ll sockaddr_ll
|
||||||
|
|
||||||
|
|
||||||
|
/* Overriding function names. */
|
||||||
|
|
||||||
|
#define nx_bsd_accept accept
|
||||||
|
#define nx_bsd_initialize bsd_initialize
|
||||||
|
#define nx_bsd_bind bind
|
||||||
|
#define nx_bsd_connect connect
|
||||||
|
#define nx_bsd_getpeername getpeername
|
||||||
|
#define nx_bsd_getsockname getsockname
|
||||||
|
#define nx_bsd_ioctl ioctl
|
||||||
|
#define nx_bsd_inet_addr inet_addr
|
||||||
|
#define nx_bsd_inet_ntoa inet_ntoa
|
||||||
|
#define nx_bsd_inet_aton inet_aton
|
||||||
|
#define nx_bsd_inet_pton inet_pton
|
||||||
|
#define nx_bsd_inet_ntop inet_ntop
|
||||||
|
#define nx_bsd_listen listen
|
||||||
|
#define nx_bsd_recvfrom recvfrom
|
||||||
|
#define nx_bsd_recv recv
|
||||||
|
#define nx_bsd_sendto sendto
|
||||||
|
#define nx_bsd_send send
|
||||||
|
#define nx_bsd_select select
|
||||||
|
#define nx_bsd_soc_close soc_close
|
||||||
|
#define nx_bsd_socket socket
|
||||||
|
#define nx_bsd_fcntl fcntl
|
||||||
|
#define nx_bsd_getsockopt getsockopt
|
||||||
|
#define nx_bsd_setsockopt setsockopt
|
||||||
|
#define nx_bsd_getaddrinfo getaddrinfo
|
||||||
|
#define nx_bsd_freeaddrinfo freeaddrinfo
|
||||||
|
#define nx_bsd_getnameinfo getnameinfo
|
||||||
|
#define nx_bsd_set_errno set_errno
|
||||||
|
#define nx_bsd_poll poll
|
||||||
|
|
||||||
|
#define NX_BSD_FD_SET FD_SET
|
||||||
|
#define NX_BSD_FD_CLR FD_CLR
|
||||||
|
#define NX_BSD_FD_ISSET FD_ISSET
|
||||||
|
#define NX_BSD_FD_ZERO FD_ZERO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/* For compatibility undefine the fd_set. Then define the FD set size. */
|
/* For compatibility undefine the fd_set. Then define the FD set size. */
|
||||||
|
|
||||||
#ifdef fd_set
|
#ifdef fd_set
|
||||||
@ -486,26 +585,27 @@ extern "C" {
|
|||||||
|
|
||||||
/* Define data types used in structure timeval. */
|
/* Define data types used in structure timeval. */
|
||||||
|
|
||||||
#ifdef __CCRX__
|
#if defined(__CCRX__) || defined(NX_BSD_ENABLE_NATIVE_API)
|
||||||
typedef LONG time_t;
|
typedef LONG nx_bsd_time_t;
|
||||||
#endif /* __CCRX__ */
|
#endif /* __CCRX__ || NX_BSD_ENABLE_NATIVE_API */
|
||||||
typedef LONG suseconds_t;
|
typedef LONG nx_bsd_suseconds_t;
|
||||||
|
|
||||||
#ifndef __SES_ARM
|
#ifndef __SES_ARM
|
||||||
struct timeval
|
struct nx_bsd_timeval
|
||||||
{
|
{
|
||||||
time_t tv_sec; /* Seconds */
|
nx_bsd_time_t tv_sec; /* Seconds */
|
||||||
suseconds_t tv_usec; /* Microseconds */
|
nx_bsd_suseconds_t
|
||||||
|
tv_usec; /* Microseconds */
|
||||||
};
|
};
|
||||||
#endif /* __SES_ARM */
|
#endif /* __SES_ARM */
|
||||||
|
|
||||||
struct sockaddr_storage
|
struct nx_bsd_sockaddr_storage
|
||||||
{
|
{
|
||||||
USHORT ss_len;
|
USHORT ss_len;
|
||||||
USHORT ss_family;
|
USHORT ss_family;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct sockaddr
|
struct nx_bsd_sockaddr
|
||||||
{
|
{
|
||||||
USHORT sa_family; /* Address family (e.g. , AF_INET). */
|
USHORT sa_family; /* Address family (e.g. , AF_INET). */
|
||||||
UCHAR sa_data[14]; /* Protocol- specific address information. */
|
UCHAR sa_data[14]; /* Protocol- specific address information. */
|
||||||
@ -514,23 +614,24 @@ struct sockaddr
|
|||||||
|
|
||||||
/* Internet address (a structure for historical reasons). */
|
/* Internet address (a structure for historical reasons). */
|
||||||
|
|
||||||
struct in_addr
|
struct nx_bsd_in_addr
|
||||||
{
|
{
|
||||||
ULONG s_addr; /* Internet address (32 bits). */
|
ULONG s_addr; /* Internet address (32 bits). */
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef ULONG in_addr_t;
|
typedef ULONG nx_bsd_in_addr_t;
|
||||||
typedef ULONG socklen_t;
|
typedef ULONG nx_bsd_socklen_t;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Socket address, Internet style. */
|
/* Socket address, Internet style. */
|
||||||
|
|
||||||
struct sockaddr_in
|
struct nx_bsd_sockaddr_in
|
||||||
{
|
{
|
||||||
USHORT sin_family; /* Internet Protocol (AF_INET). */
|
USHORT sin_family; /* Internet Protocol (AF_INET). */
|
||||||
USHORT sin_port; /* Address port (16 bits). */
|
USHORT sin_port; /* Address port (16 bits). */
|
||||||
struct in_addr sin_addr; /* Internet address (32 bits). */
|
struct nx_bsd_in_addr
|
||||||
|
sin_addr; /* Internet address (32 bits). */
|
||||||
CHAR sin_zero[8]; /* Not used. */
|
CHAR sin_zero[8]; /* Not used. */
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -540,51 +641,53 @@ typedef struct FD_SET_STRUCT /* The select socket array manager.
|
|||||||
{
|
{
|
||||||
INT fd_count; /* How many are SET? */
|
INT fd_count; /* How many are SET? */
|
||||||
ULONG fd_array[(NX_BSD_MAX_SOCKETS + 31)/32]; /* Bit map of SOCKET Descriptors. */
|
ULONG fd_array[(NX_BSD_MAX_SOCKETS + 31)/32]; /* Bit map of SOCKET Descriptors. */
|
||||||
} fd_set;
|
} nx_bsd_fd_set;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct NX_BSD_SOCKET_SUSPEND_STRUCT
|
typedef struct NX_BSD_SOCKET_SUSPEND_STRUCT
|
||||||
{
|
{
|
||||||
ULONG nx_bsd_socket_suspend_actual_flags;
|
ULONG nx_bsd_socket_suspend_actual_flags;
|
||||||
fd_set nx_bsd_socket_suspend_read_fd_set;
|
nx_bsd_fd_set nx_bsd_socket_suspend_read_fd_set;
|
||||||
fd_set nx_bsd_socket_suspend_write_fd_set;
|
nx_bsd_fd_set nx_bsd_socket_suspend_write_fd_set;
|
||||||
fd_set nx_bsd_socket_suspend_exception_fd_set;
|
nx_bsd_fd_set nx_bsd_socket_suspend_exception_fd_set;
|
||||||
|
|
||||||
} NX_BSD_SOCKET_SUSPEND;
|
} NX_BSD_SOCKET_SUSPEND;
|
||||||
|
|
||||||
|
|
||||||
struct ip_mreq
|
struct nx_bsd_ip_mreq
|
||||||
{
|
{
|
||||||
struct in_addr imr_multiaddr; /* The IPv4 multicast address to join. */
|
struct nx_bsd_in_addr
|
||||||
struct in_addr imr_interface; /* The interface to use for this group. */
|
imr_multiaddr; /* The IPv4 multicast address to join. */
|
||||||
|
struct nx_bsd_in_addr
|
||||||
|
imr_interface; /* The interface to use for this group. */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* Define additional BSD data structures for supporting socket options. */
|
/* Define additional BSD data structures for supporting socket options. */
|
||||||
|
|
||||||
struct sock_errno
|
struct nx_bsd_sock_errno
|
||||||
{
|
{
|
||||||
INT error; /* default = 0; */
|
INT error; /* default = 0; */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct linger
|
struct nx_bsd_linger
|
||||||
{
|
{
|
||||||
INT l_onoff; /* 0 = disabled; 1 = enabled; default = 0;*/
|
INT l_onoff; /* 0 = disabled; 1 = enabled; default = 0;*/
|
||||||
INT l_linger; /* linger time in seconds; default = 0;*/
|
INT l_linger; /* linger time in seconds; default = 0;*/
|
||||||
};
|
};
|
||||||
|
|
||||||
struct sock_keepalive
|
struct nx_bsd_sock_keepalive
|
||||||
{
|
{
|
||||||
INT keepalive_enabled; /* 0 = disabled; 1 = enabled; default = 0;*/
|
INT keepalive_enabled; /* 0 = disabled; 1 = enabled; default = 0;*/
|
||||||
};
|
};
|
||||||
|
|
||||||
struct sock_reuseaddr
|
struct nx_bsd_sock_reuseaddr
|
||||||
{
|
{
|
||||||
INT reuseaddr_enabled; /* 0 = disabled; 1 = enabled; default = 1; */
|
INT reuseaddr_enabled; /* 0 = disabled; 1 = enabled; default = 1; */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct sock_winsize
|
struct nx_bsd_sock_winsize
|
||||||
{
|
{
|
||||||
INT winsize; /* receive window size for TCP sockets ; */
|
INT winsize; /* receive window size for TCP sockets ; */
|
||||||
};
|
};
|
||||||
@ -597,16 +700,17 @@ union UNION_ID
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct addrinfo
|
struct nx_bsd_addrinfo
|
||||||
{
|
{
|
||||||
INT ai_flags;
|
INT ai_flags;
|
||||||
INT ai_family;
|
INT ai_family;
|
||||||
INT ai_socktype;
|
INT ai_socktype;
|
||||||
INT ai_protocol;
|
INT ai_protocol;
|
||||||
socklen_t ai_addrlen;
|
nx_bsd_socklen_t ai_addrlen;
|
||||||
struct sockaddr *ai_addr;
|
struct nx_bsd_sockaddr *ai_addr;
|
||||||
CHAR *ai_canonname;
|
CHAR *ai_canonname;
|
||||||
struct addrinfo *ai_next;
|
struct nx_bsd_addrinfo
|
||||||
|
*ai_next;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct NX_BSD_SERVICE_LIST
|
struct NX_BSD_SERVICE_LIST
|
||||||
@ -666,6 +770,30 @@ struct NX_BSD_SERVICE_LIST
|
|||||||
#define NI_DGRAM 0x0010
|
#define NI_DGRAM 0x0010
|
||||||
|
|
||||||
|
|
||||||
|
/* Define the struct used by poll. */
|
||||||
|
struct nx_bsd_pollfd
|
||||||
|
{
|
||||||
|
INT fd; /* file descriptor. */
|
||||||
|
SHORT events; /* requested events. */
|
||||||
|
SHORT revents; /* returned events. */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Define the options used by poll. */
|
||||||
|
|
||||||
|
#define POLLRDNORM 0x0100
|
||||||
|
#define POLLRDBAND 0x0200 /* Not supported. */
|
||||||
|
#define POLLIN (POLLRDNORM)
|
||||||
|
#define POLLPRI 0x0400
|
||||||
|
|
||||||
|
#define POLLWRNORM 0x0010
|
||||||
|
#define POLLOUT (POLLWRNORM)
|
||||||
|
#define POLLWRBAND 0x0020 /* Not supported. */
|
||||||
|
|
||||||
|
#define POLLERR 0x0001
|
||||||
|
#define POLLHUP 0x0002
|
||||||
|
#define POLLNVAL 0x0004
|
||||||
|
|
||||||
|
|
||||||
/* Defines maximum IPv4 addresses for getaddrinfo. */
|
/* Defines maximum IPv4 addresses for getaddrinfo. */
|
||||||
#ifndef NX_BSD_IPV4_ADDR_MAX_NUM
|
#ifndef NX_BSD_IPV4_ADDR_MAX_NUM
|
||||||
#define NX_BSD_IPV4_ADDR_MAX_NUM 5
|
#define NX_BSD_IPV4_ADDR_MAX_NUM 5
|
||||||
@ -756,52 +884,63 @@ typedef struct NX_BSD_SOCKET_STRUCT
|
|||||||
|
|
||||||
/* Define the BSD function prototypes for use by the application. */
|
/* Define the BSD function prototypes for use by the application. */
|
||||||
|
|
||||||
INT accept(INT sockID, struct sockaddr *ClientAddress, INT *addressLength);
|
|
||||||
INT bsd_initialize(NX_IP *default_ip, NX_PACKET_POOL *default_pool, CHAR *bsd_thread_stack_area, ULONG bsd_thread_stack_size, UINT bsd_thread_priority);
|
|
||||||
INT bind(INT sockID, struct sockaddr *localAddress, INT addressLength);
|
|
||||||
INT connect(INT sockID, struct sockaddr *remoteAddress, INT addressLength);
|
|
||||||
INT getpeername(INT sockID, struct sockaddr *remoteAddress, INT *addressLength);
|
|
||||||
INT getsockname(INT sockID, struct sockaddr *localAddress, INT *addressLength);
|
|
||||||
INT ioctl(INT sockID, INT command, INT *result);
|
|
||||||
in_addr_t inet_addr(const CHAR *buffer);
|
|
||||||
CHAR *inet_ntoa(struct in_addr address_to_convert);
|
|
||||||
INT inet_aton(const CHAR *cp_arg, struct in_addr *addr);
|
|
||||||
INT inet_pton(INT af, const CHAR *src, VOID *dst);
|
|
||||||
const CHAR *inet_ntop(INT af, const VOID *src, CHAR *dst, socklen_t size);
|
|
||||||
INT listen(INT sockID, INT backlog);
|
|
||||||
UINT nx_bsd_socket_set_inherited_settings(UINT master_sock_id, UINT secondary_sock_id);
|
|
||||||
INT recvfrom(INT sockID, CHAR *buffer, INT buffersize, INT flags,struct sockaddr *fromAddr, INT *fromAddrLen);
|
|
||||||
INT recv(INT sockID, VOID *rcvBuffer, INT bufferLength, INT flags);
|
|
||||||
INT sendto(INT sockID, CHAR *msg, INT msgLength, INT flags, struct sockaddr *destAddr, INT destAddrLen);
|
|
||||||
INT send(INT sockID, const CHAR *msg, INT msgLength, INT flags);
|
|
||||||
INT select(INT nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
|
|
||||||
INT soc_close( INT sockID);
|
|
||||||
INT socket(INT protocolFamily, INT type, INT protocol);
|
|
||||||
INT fcntl(INT sock_ID, UINT flag_type, UINT f_options);
|
|
||||||
INT getsockopt(INT sockID, INT option_level, INT option_name, VOID *option_value, INT *option_length);
|
|
||||||
INT setsockopt(INT sockID, INT option_level, INT option_name, const VOID *option_value, INT option_length);
|
|
||||||
INT getaddrinfo(const CHAR *node, const CHAR *service, const struct addrinfo *hints, struct addrinfo **res);
|
|
||||||
VOID freeaddrinfo(struct addrinfo *res);
|
|
||||||
INT getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags);
|
|
||||||
VOID nx_bsd_set_service_list(struct NX_BSD_SERVICE_LIST *serv_list_ptr, ULONG serv_list_len);
|
|
||||||
|
|
||||||
|
INT nx_bsd_accept(INT sockID, struct nx_bsd_sockaddr *ClientAddress, INT *addressLength);
|
||||||
|
INT nx_bsd_initialize(NX_IP *default_ip, NX_PACKET_POOL *default_pool, CHAR *bsd_thread_stack_area, ULONG bsd_thread_stack_size, UINT bsd_thread_priority);
|
||||||
|
INT nx_bsd_bind(INT sockID, const struct nx_bsd_sockaddr *localAddress, INT addressLength);
|
||||||
|
INT nx_bsd_connect(INT sockID, struct nx_bsd_sockaddr *remoteAddress, INT addressLength);
|
||||||
|
INT nx_bsd_getpeername(INT sockID, struct nx_bsd_sockaddr *remoteAddress, INT *addressLength);
|
||||||
|
INT nx_bsd_getsockname(INT sockID, struct nx_bsd_sockaddr *localAddress, INT *addressLength);
|
||||||
|
INT nx_bsd_ioctl(INT sockID, INT command, INT *result);
|
||||||
|
nx_bsd_in_addr_t nx_bsd_inet_addr(const CHAR *buffer);
|
||||||
|
CHAR *nx_bsd_inet_ntoa(struct nx_bsd_in_addr address_to_convert);
|
||||||
|
INT nx_bsd_inet_aton(const CHAR *cp_arg, struct nx_bsd_in_addr *addr);
|
||||||
|
INT nx_bsd_inet_pton(INT af, const CHAR *src, VOID *dst);
|
||||||
|
const CHAR *nx_bsd_inet_ntop(INT af, const VOID *src, CHAR *dst, nx_bsd_socklen_t size);
|
||||||
|
INT nx_bsd_listen(INT sockID, INT backlog);
|
||||||
|
UINT nx_bsd_socket_set_inherited_settings(UINT master_sock_id, UINT secondary_sock_id);
|
||||||
|
INT nx_bsd_recvfrom(INT sockID, CHAR *buffer, INT buffersize, INT flags,struct nx_bsd_sockaddr *fromAddr, INT *fromAddrLen);
|
||||||
|
INT nx_bsd_recv(INT sockID, VOID *rcvBuffer, INT bufferLength, INT flags);
|
||||||
|
INT nx_bsd_sendto(INT sockID, CHAR *msg, INT msgLength, INT flags, struct nx_bsd_sockaddr *destAddr, INT destAddrLen);
|
||||||
|
INT nx_bsd_send(INT sockID, const CHAR *msg, INT msgLength, INT flags);
|
||||||
|
INT nx_bsd_select(INT nfds, nx_bsd_fd_set *readfds, nx_bsd_fd_set *writefds, nx_bsd_fd_set *exceptfds, struct nx_bsd_timeval *timeout);
|
||||||
|
INT nx_bsd_soc_close( INT sockID);
|
||||||
|
INT nx_bsd_socket(INT protocolFamily, INT type, INT protocol);
|
||||||
|
INT nx_bsd_fcntl(INT sock_ID, UINT flag_type, UINT f_options);
|
||||||
|
INT nx_bsd_getsockopt(INT sockID, INT option_level, INT option_name, VOID *option_value, INT *option_length);
|
||||||
|
INT nx_bsd_setsockopt(INT sockID, INT option_level, INT option_name, const VOID *option_value, INT option_length);
|
||||||
|
INT nx_bsd_getaddrinfo(const CHAR *node, const CHAR *service, const struct nx_bsd_addrinfo *hints, struct nx_bsd_addrinfo **res);
|
||||||
|
VOID nx_bsd_freeaddrinfo(struct nx_bsd_addrinfo *res);
|
||||||
|
INT nx_bsd_getnameinfo(const struct nx_bsd_sockaddr *sa, nx_bsd_socklen_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags);
|
||||||
|
VOID nx_bsd_set_service_list(struct NX_BSD_SERVICE_LIST *serv_list_ptr, ULONG serv_list_len);
|
||||||
|
INT nx_bsd_poll(struct nx_bsd_pollfd *fds, ULONG nfds, INT timeout);
|
||||||
|
|
||||||
|
#if !defined(NX_BSD_ENABLE_NATIVE_API)
|
||||||
#undef FD_SET
|
#undef FD_SET
|
||||||
#undef FD_CLR
|
#undef FD_CLR
|
||||||
#undef FD_ISSET
|
#undef FD_ISSET
|
||||||
#undef FD_ZERO
|
#undef FD_ZERO
|
||||||
|
#endif
|
||||||
|
|
||||||
|
VOID NX_BSD_FD_SET(INT fd, nx_bsd_fd_set *fdset);
|
||||||
|
VOID NX_BSD_FD_CLR(INT fd, nx_bsd_fd_set *fdset);
|
||||||
|
INT NX_BSD_FD_ISSET(INT fd, nx_bsd_fd_set *fdset);
|
||||||
|
VOID NX_BSD_FD_ZERO(nx_bsd_fd_set *fdset);
|
||||||
|
VOID nx_bsd_set_errno(INT tx_errno);
|
||||||
|
|
||||||
|
INT _nx_get_errno(VOID);
|
||||||
|
|
||||||
|
#if !defined(NX_BSD_ENABLE_NATIVE_API)
|
||||||
|
#define errno (tx_thread_identify() -> bsd_errno)
|
||||||
|
#else
|
||||||
|
#define nx_bsd_errno (tx_thread_identify() -> bsd_errno)
|
||||||
|
#endif
|
||||||
|
|
||||||
VOID FD_SET(INT fd, fd_set *fdset);
|
|
||||||
VOID FD_CLR(INT fd, fd_set *fdset);
|
|
||||||
INT FD_ISSET(INT fd, fd_set *fdset);
|
|
||||||
VOID FD_ZERO(fd_set *fdset);
|
|
||||||
VOID set_errno(INT tx_errno);
|
|
||||||
int _nx_get_errno(VOID);
|
|
||||||
#define errno (_nx_get_errno())
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(NX_BSD_RAW_SUPPORT) || defined(NX_BSD_RAW_PPPOE_SUPPORT)
|
#if defined(NX_BSD_RAW_SUPPORT) || defined(NX_BSD_RAW_PPPOE_SUPPORT)
|
||||||
/* Link Layer Socket Addressing */
|
/* Link Layer Socket Addressing */
|
||||||
struct sockaddr_ll
|
struct nx_bsd_sockaddr_ll
|
||||||
{
|
{
|
||||||
USHORT sll_family; /* Address Family. Must be AF_PACKET */
|
USHORT sll_family; /* Address Family. Must be AF_PACKET */
|
||||||
USHORT sll_protocol; /* LL frame type */
|
USHORT sll_protocol; /* LL frame type */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user