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

Function ipaddr_to_ipstr

components/net/at/at_socket/at_socket.c:729–737  ·  view source on GitHub ↗

ipaddr structure change to IP address */

Source from the content-addressed store, hash-verified

727
728/* ipaddr structure change to IP address */
729static int ipaddr_to_ipstr(const struct sockaddr *sockaddr, char *ipstr)
730{
731 struct sockaddr_in *sin = (struct sockaddr_in *) sockaddr;
732
733 /* change network ip_addr to ip string */
734 rt_snprintf(ipstr, 16, "%u.%u.%u.%u", NIPQUAD(sin->sin_addr.s_addr));
735
736 return 0;
737}
738
739#ifdef AT_USING_SOCKET_SERVER
740static void at_connect_notice_cb(struct at_socket *sock, at_socket_evt_t event, const char *buff, size_t bfsz)

Callers 3

at_connectFunction · 0.85
at_recvfromFunction · 0.85
at_sendtoFunction · 0.85

Calls 1

rt_snprintfFunction · 0.85

Tested by

no test coverage detected