| 115 | } |
| 116 | |
| 117 | int str2ip(const char* ip_str, ip_t* ip) { |
| 118 | // ip_str can be NULL when called by EndPoint(0, ...) |
| 119 | if (ip_str != NULL) { |
| 120 | for (; isspace(*ip_str); ++ip_str); |
| 121 | int rc = inet_pton(AF_INET, ip_str, ip); |
| 122 | if (rc > 0) { |
| 123 | return 0; |
| 124 | } |
| 125 | } |
| 126 | return -1; |
| 127 | } |
| 128 | |
| 129 | IPStr ip2str(ip_t ip) { |
| 130 | IPStr str; |
no outgoing calls