/nrf52832-nimble/rt-thread/components/net/at/at_socket/ |
H A D | at_socket.h | 19 #include <sys/socket.h> 32 /* sal socket magic word */ 35 /* Current state of the AT socket. */ 57 typedef void (*at_evt_cb_t)(int socket, at_socket_evt_t event, const char *buff, size_t bfsz); 60 /* A callback prototype to inform about events for AT socket */ 63 /* AT device socket options function */ 66 …int (*at_connect)(int socket, char *ip, int32_t port, enum at_socket_type type, rt_bool_t is_clien… 67 int (*at_closesocket)(int socket); 68 int (*at_send)(int socket, const char *buff, size_t bfsz, enum at_socket_type type); 85 /* AT socket magic word */ [all …]
|
H A D | at_socket.c | 36 #error The AT socket device is not selected, please select it through the env menuconfig. 52 /* AT device socket options */ 55 struct at_socket *at_get_socket(int socket) in at_get_socket() argument 57 if (socket < 0 || socket >= AT_SOCKETS_NUM) in at_get_socket() 62 /* check socket structure valid or not */ in at_get_socket() 63 if (sockets[socket].magic != AT_SOCKET_MAGIC) in at_get_socket() 68 return &sockets[socket]; in at_get_socket() 71 /* get a block to the AT socket receive list*/ 142 /* get a block from AT socket receive list */ 274 /* create AT socket lock */ in alloc_socket() [all …]
|
/nrf52832-nimble/rt-thread/components/net/sal_socket/socket/ |
H A D | net_sockets.c | 9 * 2018-05-17 ChenYong Add socket abstraction layer 17 #include <sys/socket.h> 22 int socket = dfs_net_getsocket(s); in accept() local 24 new_socket = sal_accept(socket, addr, addrlen); in accept() 27 /* this is a new socket, create it in file system fd */ in accept() 43 /* this is a socket fd */ in accept() 53 /* set socket to the data of dfs_fd */ in accept() 73 int socket = dfs_net_getsocket(s); in bind() local 75 return sal_bind(socket, name, namelen); in bind() 81 int socket; in shutdown() local [all …]
|
/nrf52832-nimble/rt-thread/components/net/sal_socket/src/ |
H A D | sal_socket.c | 30 /* the socket table used to dynamic allocate sockets */ 44 /* The global socket table */ 64 * SAL (Socket Abstraction Layer) initialize. 75 LOG_D("Socket Abstraction Layer is already initialized."); in sal_init() 79 /* init sal socket table */ in sal_init() 85 LOG_E("No memory for socket table.\n"); in sal_init() 89 /* create sal socket lock */ in sal_init() 92 LOG_I("Socket Abstraction Layer initialize success."); in sal_init() 248 * This function will get sal socket object by sal socket descriptor. 250 * @param socket sal socket index [all …]
|
/nrf52832-nimble/rt-thread/components/net/sal_socket/impl/ |
H A D | af_inet_lwip.c | 41 * Re-define lwip socket 46 /** sockets currently are built on netconns, each socket has one netconn */ 58 /** error happened for this socket, set by event_callback(), tested by select */ 60 /** last error that occurred on this socket */ 66 /** counter of how many threads are waiting for this socket using select */ 84 /* Get socket */ in event_callback() 87 s = conn->socket; in event_callback() 91 * the server task might not have created a new socket yet. in event_callback() 94 * can happen before the new socket is set up. */ in event_callback() 96 if (conn->socket < 0) in event_callback() [all …]
|
H A D | proto_mbedtls.c | 38 static void *mebdtls_socket(int socket) in mebdtls_socket() argument 43 if (socket < 0) in mebdtls_socket() 70 session->server_fd.fd = socket; in mebdtls_socket() 78 int socket, ret; in mbedtls_net_send_cb() local 83 socket = ((mbedtls_net_context *) ctx)->fd; in mbedtls_net_send_cb() 84 sock = sal_get_socket(socket); in mbedtls_net_send_cb() 95 if ((fcntl(socket, F_GETFL) & O_NONBLOCK) == O_NONBLOCK) in mbedtls_net_send_cb() 112 int socket, ret; in mbedtls_net_recv_cb() local 117 socket = ((mbedtls_net_context *) ctx)->fd; in mbedtls_net_recv_cb() 118 sock = sal_get_socket(socket); in mbedtls_net_recv_cb() [all …]
|
/nrf52832-nimble/rt-thread/components/net/sal_socket/include/ |
H A D | sal_socket.h | 34 /* Socket protocol types (TCP/UDP/RAW) */ 41 /* Option flags per-socket. These must match the SOF_ flags in ip.h (checked in init.c) */ 48 #define SO_ACCEPTCONN 0x0002 /* socket has had listen() */ 62 #define SO_TYPE 0x1008 /* get socket type */ 66 /* Level number for (get/set)sockopt() to apply to socket itself */ 67 #define SOL_SOCKET 0xfff /* options for socket level */ 73 #define AF_AT 45 /* AT socket */ 74 #define AF_WIZ 46 /* WIZnet socket */ 153 int sal_accept(int socket, struct sockaddr *addr, socklen_t *addrlen); 154 int sal_bind(int socket, const struct sockaddr *name, socklen_t namelen); [all …]
|
H A D | sal_tls.h | 20 * Here, the same socket protocol level for TLS as in Linux was used. 24 /* Socket options for TLS */ 26 /* Socket option to select TLS credentials to use. */ 28 /* Socket option to set select ciphersuites to use. */ 30 /* Socket option to set peer verification level for TLS connection. */ 32 /* Socket option to set role for DTLS connection. */ 43 void* (*socket)(int socket); member
|
H A D | sal.h | 28 /* SAL socket magic word */ 41 /* SAL socket offset */ 48 int (*socket) (int domain, int type, int protocol); member 77 uint32_t magic; /* SAL socket magic word */ 79 int socket; /* SAL socket descriptor */ member 84 const struct sal_socket_ops *ops; /* socket options */ 96 …int (*create)(struct sal_socket *sal_socket, int type, int protocol); /* register socket options… 101 /* SAL(Socket Abstraction Layer) initialize */
|
H A D | sal_netdb.h | 62 int ai_family; /* Address family of socket. */ 63 int ai_socktype; /* Socket type. */ 64 int ai_protocol; /* Protocol of socket. */ 65 socklen_t ai_addrlen; /* Length of socket address. */ 66 struct sockaddr *ai_addr; /* Socket address of socket. */
|
/nrf52832-nimble/rt-thread/examples/network/ |
H A D | chargen.c | 2 #include <sys/socket.h> 25 int socket; member 52 /* First acquire our socket for listening for connections */ in chargen_thread() 53 listenfd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); in chargen_thread() 54 LWIP_ASSERT("chargen_thread(): Socket create failed.", listenfd >= 0); in chargen_thread() 61 LWIP_ASSERT("chargen_thread(): Socket bind failed.", 0); in chargen_thread() 63 /* Put socket into listening mode */ in chargen_thread() 79 if (maxfdp1 < p_charcb->socket + 1) in chargen_thread() 80 maxfdp1 = p_charcb->socket + 1; in chargen_thread() 81 FD_SET(p_charcb->socket, &readset); in chargen_thread() [all …]
|
H A D | tcpsendpacket.c | 4 #include <sys/socket.h> /* ʹ��BSD socket����Ҫ����socket.hͷ�ļ� */ 15 /* ����һ��socket��������SOCKET_STREAM��TCP���� */ in tcp_senddata() 16 if ((sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) in tcp_senddata() 19 rt_kprintf("Socket error\n"); in tcp_senddata() 54 if ((sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) in tcp_senddata() 55 rt_kprintf("TCP Socket error:%d\n", sock); in tcp_senddata()
|
H A D | tcp_client.py | 3 import socket 5 s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
|
H A D | tcp_server.py | 3 import socket 6 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
H A D | tcpclient.c | 10 #include <sys/socket.h> /* 使用BSD socket,需要包含socket.h头文件 */ 62 if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1) in tcpclient() 65 LOG_E("Create socket error"); in tcpclient() 103 LOG_E("Received error, close the socket."); in tcpclient() 120 LOG_I("Got a 'q' or 'Q', close the socket."); in tcpclient() 135 LOG_I("send error, close the socket."); in tcpclient()
|
/nrf52832-nimble/rt-thread/components/net/sal_socket/dfs_net/ |
H A D | dfs_net.c | 11 * 2018-05-24 ChenYong Add socket abstraction layer 19 #include <sys/socket.h> 23 int socket; in dfs_net_getsocket() local 29 if (_dfs_fd->type != FT_SOCKET) socket = -1; in dfs_net_getsocket() 30 else socket = (int)_dfs_fd->data; in dfs_net_getsocket() 33 return socket; in dfs_net_getsocket() 43 int socket = (int) file->data; in dfs_net_read() local 45 return sal_recvfrom(socket, buf, count, 0, NULL, NULL); in dfs_net_read() 50 int socket = (int) file->data; in dfs_net_write() local 52 return sal_sendto(socket, buf, count, 0, NULL, 0); in dfs_net_write() [all …]
|
/nrf52832-nimble/rt-thread/components/net/lwip-2.1.0/src/include/lwip/ |
H A D | sockets.h | 3 * Socket API (to be used from non-TCPIP threads) 181 /* Set socket options argument */ 187 /* Socket protocol types (TCP/UDP/RAW) */ 193 * Option flags per-socket. These must match the SOF_ flags in ip.h (checked in init.c) 204 #define SO_ACCEPTCONN 0x0002 /* socket has had listen() */ 218 #define SO_TYPE 0x1008 /* get socket type */ 232 * Level number for (get/set)sockopt() to apply to socket itself. 234 #define SOL_SOCKET 0xfff /* options for socket level */ 265 …nd the SIGPIPE signal if an attempt to send is made on a stream-oriented socket that is no longer … 424 /* Socket I/O Controls: unimplemented */ [all …]
|
/nrf52832-nimble/rt-thread/components/net/lwip-2.0.2/src/include/lwip/ |
H A D | sockets.h | 3 * Socket API (to be used from non-TCPIP threads) 120 /** socket index for which to change options */ 162 /* Socket protocol types (TCP/UDP/RAW) */ 168 * Option flags per-socket. These must match the SOF_ flags in ip.h (checked in init.c) 179 #define SO_ACCEPTCONN 0x0002 /* socket has had listen() */ 193 #define SO_TYPE 0x1008 /* get socket type */ 207 * Level number for (get/set)sockopt() to apply to socket itself. 209 #define SOL_SOCKET 0xfff /* options for socket level */ 375 /* Socket I/O Controls: unimplemented */ 410 /* Make FD_SETSIZE match NUM_SOCKETS in socket.c */ [all …]
|
/nrf52832-nimble/rt-thread/examples/test/ |
H A D | net_test.c | 54 * UDP socket echo server 75 /* create a UDP socket */ in udpecho_socket_entry() 76 if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) == -1) in udpecho_socket_entry() 78 rt_kprintf("create socket error\n"); in udpecho_socket_entry() 88 /* bind socket to server address */ in udpecho_socket_entry() 100 /* try to receive from UDP socket */ in udpecho_socket_entry() 170 * TCP socket echo server 189 /* create a TCP socket */ in tcpecho_socket_entry() 190 if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1) in tcpecho_socket_entry() 192 rt_kprintf("create socket error\n"); in tcpecho_socket_entry() [all …]
|
/nrf52832-nimble/rt-thread/components/net/lwip-1.4.1/src/api/ |
H A D | sockets.c | 63 /** Contains all internal pointers and states used for a socket */ 65 /** sockets currently are built on netconns, each socket has one netconn */ 77 /** error happened for this socket, set by event_callback(), tested by select */ 79 /** last error that occurred on this socket */ 81 /** counter of how many threads are waiting for this socket using select */ 106 /** socket struct for which to change options */ 109 /** socket index for which to change options */ 133 /** Table to quickly map an lwIP error (err_t) to a socket error 189 * Map a externally used socket index to the internal socket representation. 191 * @param s externally used socket index [all …]
|
/nrf52832-nimble/rt-thread/components/net/lwip-2.0.2/src/api/ |
H A D | sockets.c | 5 * @defgroup socket Socket API 7 * BSD-style socket API.\n 10 * Header is in posix/sys/socket.h\b 193 * select on the same socket... 204 /** Contains all internal pointers and states used for a socket */ 206 /** sockets currently are built on netconns, each socket has one netconn */ 218 /** error happened for this socket, set by event_callback(), tested by select */ 220 /** last error that occurred on this socket (in fact, all our errnos fit into an u8_t) */ 222 /** counter of how many threads are waiting for this socket using select */ 270 /* Define the number of IPv4 multicast memberships, default is one per socket */ [all …]
|
/nrf52832-nimble/rt-thread/components/net/lwip-2.1.0/src/api/ |
H A D | sockets.c | 216 /* Define the number of IPv4 multicast memberships, default is one per socket */ 223 a socket is closed */ 225 /** the socket */ 242 a socket is closed */ 244 /** the socket */ 344 /* prevent new usage of this socket if free is pending */ in sock_inc_used() 371 /* In full-duplex mode,sock->fd_used != 0 prevents a socket descriptor from being 390 /* free the socket */ in done_socket() 409 /* Translate a socket 'int' into a pointer (only fails if the index is invalid) */ 427 /* Translate a socket 'int' into a pointer (only fails if the index is invalid) */ [all …]
|
/nrf52832-nimble/packages/NimBLE-latest/nimble/transport/socket/ |
H A D | syscfg.yml | 49 description: 'Use TCP socket, connects to BLE_SOCK_TCP_PORT' 57 description: 'Use Linux bluetooth raw socket' 65 description: 'Priority of the HCI socket task.' 70 description: 'Size of the HCI socket stack (units=words).' 75 Sysinit stage for the socket BLE transport.
|
/nrf52832-nimble/rt-thread/components/net/lwip-1.4.1/src/include/lwip/ |
H A D | netdb.h | 85 int ai_family; /* Address family of socket. */ 86 int ai_socktype; /* Socket type. */ 87 int ai_protocol; /* Protocol of socket. */ 88 socklen_t ai_addrlen; /* Length of socket address. */ 89 struct sockaddr *ai_addr; /* Socket address of socket. */
|
/nrf52832-nimble/rt-thread/components/net/sal_socket/ |
H A D | SConscript | 8 src += Glob('socket/net_netdb.c') 11 CPPPATH += [cwd + '/include/socket'] 27 src += Glob('socket/net_sockets.c') 34 CPPPATH += [cwd + '/include/socket/sys_socket']
|