X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/527ec9116af5dc8e75f02351f5ea3e34423a1f70..e30b893eb148e413288f127920a47fd688a26195:/src/irc_string.c diff --git a/src/irc_string.c b/src/irc_string.c index b7f0957..5951dd6 100644 --- a/src/irc_string.c +++ b/src/irc_string.c @@ -26,17 +26,15 @@ #include "stdinc.h" #include "sprintf_irc.h" -#include "tools.h" #include "irc_string.h" #include "client.h" -#include "memory.h" #include "setup.h" #ifndef INADDRSZ #define INADDRSZ 4 #endif -#ifdef IPV6 +#ifdef RB_IPV6 #ifndef IN6ADDRSZ #define IN6ADDRSZ 16 #endif @@ -220,7 +218,7 @@ ircd_base64_encode(const unsigned char *str, int length) return NULL; } - result = MyMalloc(((length + 2) / 3) * 5); + result = rb_malloc(((length + 2) / 3) * 5); p = result; while (length > 2) @@ -257,7 +255,7 @@ ircd_base64_decode(const unsigned char *str, int length, int *ret) int ch, i = 0, j = 0, k; unsigned char *result; - result = MyMalloc(length + 1); + result = rb_malloc(length + 1); while ((ch = *current++) != '\0' && length-- > 0) { if (ch == base64_pad) break; @@ -400,7 +398,7 @@ inetntoa(const char *in) */ static const char *inet_ntop4(const u_char * src, char *dst, unsigned int size); -#ifdef IPV6 +#ifdef RB_IPV6 static const char *inet_ntop6(const u_char * src, char *dst, unsigned int size); #endif @@ -429,7 +427,7 @@ inet_ntop4(const unsigned char *src, char *dst, unsigned int size) * author: * Paul Vixie, 1996. */ -#ifdef IPV6 +#ifdef RB_IPV6 static const char * inet_ntop6(const unsigned char *src, char *dst, unsigned int size) { @@ -541,15 +539,15 @@ inetpton_sock(const char *src, struct sockaddr *dst) { ((struct sockaddr_in *) dst)->sin_port = 0; ((struct sockaddr_in *) dst)->sin_family = AF_INET; - SET_SS_LEN((struct irc_sockaddr_storage *) dst, sizeof(struct sockaddr_in)); + SET_SS_LEN((struct rb_sockaddr_storage *) dst, sizeof(struct sockaddr_in)); return 1; } -#ifdef IPV6 +#ifdef RB_IPV6 else if(inetpton(AF_INET6, src, &((struct sockaddr_in6 *) dst)->sin6_addr)) { ((struct sockaddr_in6 *) dst)->sin6_port = 0; ((struct sockaddr_in6 *) dst)->sin6_family = AF_INET6; - SET_SS_LEN((struct irc_sockaddr_storage *) dst, sizeof(struct sockaddr_in6)); + SET_SS_LEN((struct rb_sockaddr_storage *) dst, sizeof(struct sockaddr_in6)); return 1; } #endif @@ -564,7 +562,7 @@ inetntop_sock(struct sockaddr *src, char *dst, unsigned int size) case AF_INET: return (inetntop(AF_INET, &((struct sockaddr_in *) src)->sin_addr, dst, size)); break; -#ifdef IPV6 +#ifdef RB_IPV6 case AF_INET6: return (inetntop(AF_INET6, &((struct sockaddr_in6 *) src)->sin6_addr, dst, size)); break; @@ -590,7 +588,7 @@ inetntop(int af, const void *src, char *dst, unsigned int size) { case AF_INET: return (inet_ntop4(src, dst, size)); -#ifdef IPV6 +#ifdef RB_IPV6 case AF_INET6: if(IN6_IS_ADDR_V4MAPPED((const struct in6_addr *) src) || IN6_IS_ADDR_V4COMPAT((const struct in6_addr *) src)) @@ -679,7 +677,7 @@ inet_pton4(src, dst) return (1); } -#ifdef IPV6 +#ifdef RB_IPV6 /* int * inet_pton6(src, dst) * convert presentation level address to network order binary form. @@ -805,7 +803,7 @@ inetpton(af, src, dst) { case AF_INET: return (inet_pton4(src, dst)); -#ifdef IPV6 +#ifdef RB_IPV6 case AF_INET6: /* Somebody might have passed as an IPv4 address this is sick but it works */ if(inet_pton4(src, dst))