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

Function sal_sendmsg

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

Source from the content-addressed store, hash-verified

929}
930
931int sal_sendmsg(int socket, const struct msghdr *message, int flags)
932{
933 struct sal_socket *sock;
934 struct sal_proto_family *pf;
935
936 /* get the socket object by socket descriptor */
937 SAL_SOCKET_OBJ_GET(sock, socket);
938
939 /* check the network interface is up status */
940 SAL_NETDEV_IS_UP(sock->netdev);
941 /* check the network interface socket opreation */
942 SAL_NETDEV_SOCKETOPS_VALID(sock->netdev, pf, sendmsg);
943
944#ifdef SAL_USING_TLS
945 if (SAL_SOCKOPS_PROTO_TLS_VALID(sock, send))
946 {
947 int ret;
948
949 if ((ret = proto_tls->ops->send(sock->user_data_tls, message, flags)) < 0)
950 {
951 return -1;
952 }
953 return ret;
954 }
955 else
956 {
957 return pf->skt_ops->sendmsg((int)(size_t)sock->user_data, message, flags);
958 }
959#else
960 return pf->skt_ops->sendmsg((int)(size_t)sock->user_data, message, flags);
961#endif
962}
963
964int sal_recvmsg(int socket, struct msghdr *message, int flags)
965{

Callers 1

sendmsgFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected