| 150 | } |
| 151 | |
| 152 | static int sockaddrToIpPort(struct sockaddr_in addr, std::string *ip, int *pPort) { |
| 153 | char a[32] = {0}; |
| 154 | unsigned char *bytes = (unsigned char *) &addr.sin_addr; |
| 155 | snprintf(a, sizeof(a), "%d.%d.%d.%d", bytes[0], bytes[1], bytes[2], bytes[3]); |
| 156 | *ip = a; |
| 157 | *pPort = ntohs(addr.sin_port); |
| 158 | return 0; |
| 159 | } |
| 160 | |
| 161 | static int64_t sockaddrToint64(struct sockaddr_in addr) { |
| 162 | int64_t s = addr.sin_port; |
nothing calls this directly
no outgoing calls
no test coverage detected