21 typedef int socklen_t;
25 #include <sys/socket.h> 26 #include <arpa/inet.h> 39 const char *
hex(
const unsigned char id[20]);
49 int from_hex(
const char *
s,
unsigned char id[20]);
63 const char *
sockaddr_fmt(
const struct sockaddr *sa, socklen_t addrlen);
72 int sockaddr_cmp(
const struct sockaddr *s1,
const struct sockaddr *s2);
const char * compactaddr_fmt(const unsigned char *ip, size_t len)
Format compact address information.
int from_hex(const char *s, unsigned char id[20])
Convert a hexadecimal representation string to a 160-bit value.
size_t len
length of the string
Definition: bencode.h:55
int sockaddr_cmp(const struct sockaddr *s1, const struct sockaddr *s2)
Compare two socket addresses.
const char * sockaddr_fmt(const struct sockaddr *sa, socklen_t addrlen)
Format socket address.
const char * hex(const unsigned char id[20])
Return the hexadecimal representation of a 160-bit value.
struct bvalue::@1::@3 s
String value.