MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / sal_recvmsg

Function sal_recvmsg

components/net/sal/src/sal_socket.c:964–995  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

962}
963
964int sal_recvmsg(int socket, struct msghdr *message, int flags)
965{
966 struct sal_socket *sock;
967 struct sal_proto_family *pf;
968
969 /* get the socket object by socket descriptor */
970 SAL_SOCKET_OBJ_GET(sock, socket);
971
972 /* check the network interface is up status */
973 SAL_NETDEV_IS_UP(sock->netdev);
974 /* check the network interface socket opreation */
975 SAL_NETDEV_SOCKETOPS_VALID(sock->netdev, pf, recvmsg);
976
977#ifdef SAL_USING_TLS
978 if (SAL_SOCKOPS_PROTO_TLS_VALID(sock, recv))
979 {
980 int ret;
981
982 if ((ret = proto_tls->ops->recv(sock->user_data_tls, message, flags)) < 0)
983 {
984 return -1;
985 }
986 return ret;
987 }
988 else
989 {
990 return pf->skt_ops->recvmsg((int)(size_t)sock->user_data, message, flags);
991 }
992#else
993 return pf->skt_ops->recvmsg((int)(size_t)sock->user_data, message, flags);
994#endif
995}
996
997int sal_recvfrom(int socket, void *mem, size_t len, int flags,
998 struct sockaddr *from, socklen_t *fromlen)

Callers 1

recvmsgFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected