MCPcopy Create free account
hub / github.com/SIPp/sipp / gai_getsockaddr

Function gai_getsockaddr

src/socket.cpp:76–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74 char *peer_ip, int peer_ip_size, SIPpSocket **peer_socket);
75
76int gai_getsockaddr(struct sockaddr_storage* ss, const char* host,
77 const char *service, int flags, int family)
78{
79 const struct addrinfo hints = {flags, family,};
80 struct addrinfo* res;
81
82 int error = getaddrinfo(host, service, &hints, &res);
83 if (error == 0) {
84 memcpy(ss, res->ai_addr, res->ai_addrlen);
85 freeaddrinfo(res);
86 } else {
87 WARNING("getaddrinfo failed: %s", gai_strerror(error));
88 }
89
90 return error;
91}
92
93int gai_getsockaddr(struct sockaddr_storage* ss, const char* host,
94 unsigned short port, int flags, int family)

Callers 9

get_remote_media_addrMethod · 0.85
executeActionMethod · 0.85
mainFunction · 0.85
setup_ctrl_socketFunction · 0.85
set_multihome_addrFunction · 0.85
open_connectionsFunction · 0.85
connect_to_peerFunction · 0.85

Calls 1

WARNINGFunction · 0.85

Tested by

no test coverage detected