| 995 | } |
| 996 | |
| 997 | int sal_recvfrom(int socket, void *mem, size_t len, int flags, |
| 998 | struct sockaddr *from, socklen_t *fromlen) |
| 999 | { |
| 1000 | struct sal_socket *sock; |
| 1001 | struct sal_proto_family *pf; |
| 1002 | |
| 1003 | /* get the socket object by socket descriptor */ |
| 1004 | SAL_SOCKET_OBJ_GET(sock, socket); |
| 1005 | |
| 1006 | /* check the network interface is up status */ |
| 1007 | SAL_NETDEV_IS_UP(sock->netdev); |
| 1008 | /* check the network interface socket opreation */ |
| 1009 | SAL_NETDEV_SOCKETOPS_VALID(sock->netdev, pf, recvfrom); |
| 1010 | |
| 1011 | #ifdef SAL_USING_TLS |
| 1012 | if (SAL_SOCKOPS_PROTO_TLS_VALID(sock, recv)) |
| 1013 | { |
| 1014 | int ret; |
| 1015 | |
| 1016 | if ((ret = proto_tls->ops->recv(sock->user_data_tls, mem, len)) < 0) |
| 1017 | { |
| 1018 | return -1; |
| 1019 | } |
| 1020 | return ret; |
| 1021 | } |
| 1022 | else |
| 1023 | { |
| 1024 | return pf->skt_ops->recvfrom((int)(size_t)sock->user_data, mem, len, flags, from, fromlen); |
| 1025 | } |
| 1026 | #else |
| 1027 | return pf->skt_ops->recvfrom((int)(size_t)sock->user_data, mem, len, flags, from, fromlen); |
| 1028 | #endif |
| 1029 | } |
| 1030 | |
| 1031 | int sal_sendto(int socket, const void *dataptr, size_t size, int flags, |
| 1032 | const struct sockaddr *to, socklen_t tolen) |
no outgoing calls
no test coverage detected