Lines Matching full:socket

28 /* We do not need <socket/include/socket.h>
30 * and all, ASF will not need to define it. Unfortunately its socket.h does
38 #include <socket/include/m2m_socket_host_if.h>
41 typedef void (*tpfAppSocketCb) (SOCKET sock, uint8 u8Msg, void *pvMsg);
45 NMI_API SOCKET socket(uint16 u16Domain, uint8 u8Type, uint8 u8Flags);
46 NMI_API sint8 bind(SOCKET sock, struct sockaddr *pstrAddr, uint8 u8AddrLen);
47 NMI_API sint8 listen(SOCKET sock, uint8 backlog);
48 NMI_API sint8 accept(SOCKET sock, struct sockaddr *addr, uint8 *addrlen);
49 NMI_API sint8 connect(SOCKET sock, struct sockaddr *pstrAddr, uint8 u8AddrLen);
50 NMI_API sint16 recv(SOCKET sock, void *pvRecvBuf,
52 NMI_API sint16 send(SOCKET sock, void *pvSendBuffer,
54 NMI_API sint16 sendto(SOCKET sock, void *pvSendBuffer,
57 NMI_API sint8 winc1500_close(SOCKET sock);
95 SOCKET sock;
100 SOCKET sock;
112 #include <socket/include/m2m_socket_host_if.h>
172 return "Successful socket operation"; in socket_error_string()
174 return "Socket address is invalid." in socket_error_string()
175 "The socket operation cannot be completed successfully" in socket_error_string()
180 return "Socket operation cannot bind on the given address." in socket_error_string()
181 " With socket operations, only one IP address per " in socket_error_string()
182 "socket is permitted. Any attempt for a new socket " in socket_error_string()
184 "open socket, will return the following error code. " in socket_error_string()
190 " to exceed that number at socket creation." in socket_error_string()
191 " Identifies that @ref socket operation failed."; in socket_error_string()
196 " to exceed that number at socket creation." in socket_error_string()
197 " Identifies that socket operation failed"; in socket_error_string()
205 return "The requested socket operation is not valid in the " in socket_error_string()
206 "current socket state. For example: @ref accept is " in socket_error_string()
207 "called on a TCP socket before bind or listen."; in socket_error_string()
210 "the socket address required for the socket operation " in socket_error_string()
215 return "The socket is closed by the peer. The local socket is " in socket_error_string()
218 return "The socket pending operation has timedout."; in socket_error_string()
221 " socket operation."; in socket_error_string()
267 return "Bind socket event."; in socket_message_to_string()
269 return "Listen socket event."; in socket_message_to_string()
273 return "Accept socket event."; in socket_message_to_string()
275 return "Connect socket event."; in socket_message_to_string()
277 return "Receive socket event."; in socket_message_to_string()
279 return "Send socket event."; in socket_message_to_string()
281 return "Sendto socket event."; in socket_message_to_string()
283 return "Recvfrom socket event."; in socket_message_to_string()
290 * This function is called when the socket is to be opened.
298 SOCKET sock; in winc1500_get()
309 sock = socket(2, type, 0); in winc1500_get()
311 LOG_ERR("socket error!"); in winc1500_get()
332 SOCKET socket = (intptr_t)context->offload_context; in winc1500_bind() local
347 if (k_sem_take(&w1500_data.socket_data[socket].wait_sem, in winc1500_bind()
353 return w1500_data.socket_data[socket].ret_code; in winc1500_bind()
357 * This function is called when user wants to mark the socket
362 SOCKET socket = (intptr_t)context->offload_context; in winc1500_listen() local
372 if (k_sem_take(&w1500_data.socket_data[socket].wait_sem, in winc1500_listen()
377 return w1500_data.socket_data[socket].ret_code; in winc1500_listen()
391 SOCKET socket = (intptr_t)context->offload_context; in winc1500_connect() local
394 w1500_data.socket_data[socket].connect_cb = cb; in winc1500_connect()
395 w1500_data.socket_data[socket].connect_user_data = user_data; in winc1500_connect()
396 w1500_data.socket_data[socket].ret_code = 0; in winc1500_connect()
398 ret = connect(socket, (struct sockaddr *)addr, addrlen); in winc1500_connect()
406 k_sem_take(&w1500_data.socket_data[socket].wait_sem, K_MSEC(timeout))) { in winc1500_connect()
410 return w1500_data.socket_data[socket].ret_code; in winc1500_connect()
422 SOCKET socket = (intptr_t)context->offload_context; in winc1500_accept() local
425 w1500_data.socket_data[socket].accept_cb = cb; in winc1500_accept()
426 w1500_data.socket_data[socket].accept_user_data = user_data; in winc1500_accept()
428 ret = accept(socket, NULL, 0); in winc1500_accept()
436 if (k_sem_take(&w1500_data.socket_data[socket].wait_sem, in winc1500_accept()
442 return w1500_data.socket_data[socket].ret_code; in winc1500_accept()
454 SOCKET socket = (intptr_t)context->offload_context; in winc1500_send() local
470 ret = send(socket, buf->data, buf->len, 0); in winc1500_send()
494 SOCKET socket = (intptr_t)context->offload_context; in winc1500_sendto() local
510 ret = sendto(socket, buf->data, buf->len, 0, in winc1500_sendto()
558 SOCKET socket = (intptr_t)context->offload_context; in winc1500_recv() local
561 w1500_data.socket_data[socket].recv_cb = cb; in winc1500_recv()
562 w1500_data.socket_data[socket].recv_user_data = user_data; in winc1500_recv()
567 ret = prepare_pkt(&w1500_data.socket_data[socket]); in winc1500_recv()
574 ret = recv(socket, w1500_data.socket_data[socket].pkt_buf->data, in winc1500_recv()
586 * This function is called when user wants to close the socket.
590 SOCKET sock = (intptr_t)context->offload_context; in winc1500_put()
784 LOG_ERR("CONNECT: socket %d error %d", in handle_socket_msg_connect()
801 static bool handle_socket_msg_recv(SOCKET sock, in handle_socket_msg_recv()
863 * the socket ID for the accepted connection with the remote peer. in handle_socket_msg_accept()
868 LOG_DBG("ACCEPT: from %d.%d.%d.%d:%d, new socket is %d", in handle_socket_msg_accept()
897 /* We get a new socket from accept_msg but we need a new in handle_socket_msg_accept()
898 * context as well. The new context gives us another socket in handle_socket_msg_accept()
924 static void winc1500_socket_cb(SOCKET sock, uint8 message, void *pvMsg) in winc1500_socket_cb()