| 63 | } |
| 64 | |
| 65 | static inline TMaybe<TIp6> TryParseIp6FromString(const char* ipStr) { |
| 66 | TIp6 res; |
| 67 | |
| 68 | if (inet_pton(AF_INET6, ipStr, &res.Data) == 0) { |
| 69 | return Nothing(); |
| 70 | } |
| 71 | |
| 72 | return res; |
| 73 | } |
| 74 | |
| 75 | static inline char* Ip6ToString(const TIp6& ip, char* buf, size_t len) { |
| 76 | if (!inet_ntop(AF_INET6, (void*)&ip.Data, buf, (socklen_t)len)) { |
no test coverage detected