Add centralized IP/Peer formatting functions

This stops us from needing to manually check against ":" to
add brackets around IPv6 addresses everywhere.
This commit is contained in:
Matt Stancliff
2014-10-23 12:40:02 -04:00
parent 3cd36a4dd9
commit 2d90619f88
4 changed files with 37 additions and 0 deletions

View File

@ -70,5 +70,8 @@ int anetSendTimeout(char *err, int fd, long long ms);
int anetPeerToString(int fd, char *ip, size_t ip_len, int *port);
int anetKeepAlive(char *err, int fd, int interval);
int anetSockName(int fd, char *ip, size_t ip_len, int *port);
int anetFormatIP(char *fmt, size_t fmt_len, char *ip, int port);
int anetFormatPeer(int fd, char *fmt, size_t fmt_len);
int anetFormatSock(int fd, char *fmt, size_t fmt_len);
#endif