| 885 | } |
| 886 | |
| 887 | int sal_connect(int socket, const struct sockaddr *name, socklen_t namelen) |
| 888 | { |
| 889 | struct sal_socket *sock; |
| 890 | struct sal_proto_family *pf; |
| 891 | int ret; |
| 892 | |
| 893 | /* get the socket object by socket descriptor */ |
| 894 | SAL_SOCKET_OBJ_GET(sock, socket); |
| 895 | |
| 896 | /* check the network interface is up status */ |
| 897 | SAL_NETDEV_IS_UP(sock->netdev); |
| 898 | /* check the network interface socket opreation */ |
| 899 | SAL_NETDEV_SOCKETOPS_VALID(sock->netdev, pf, connect); |
| 900 | |
| 901 | ret = pf->skt_ops->connect((int)(size_t)sock->user_data, name, namelen); |
| 902 | #ifdef SAL_USING_TLS |
| 903 | if (ret >= 0 && SAL_SOCKOPS_PROTO_TLS_VALID(sock, connect)) |
| 904 | { |
| 905 | if (proto_tls->ops->connect(sock->user_data_tls) < 0) |
| 906 | { |
| 907 | return -1; |
| 908 | } |
| 909 | |
| 910 | return ret; |
| 911 | } |
| 912 | #endif |
| 913 | |
| 914 | return ret; |
| 915 | } |
| 916 | |
| 917 | int sal_listen(int socket, int backlog) |
| 918 | { |
no outgoing calls
no test coverage detected