]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - src/irc_string.c
'You are exempt from...' message fixed - glines gone
[irc/rqf/shadowircd.git] / src / irc_string.c
index 26dbfca782c71bb3f8fb3cc3882a64ee72ef6b6f..5951dd65862a18a026ce9fa20f91f4ec9b17d487 100644 (file)
 
 #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;
@@ -392,7 +390,7 @@ inetntoa(const char *in)
  * SOFTWARE.
  */
 
-#define SPRINTF(x) ((size_t)ircsprintf x)
+#define SPRINTF(x) ((size_t)rb_sprintf x)
 
 /*
  * WARNING: Don't even consider trying to compile this on a system where
@@ -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,13 +803,13 @@ 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))
                {
                        char tmp[HOSTIPLEN];
-                       ircsprintf(tmp, "::ffff:%s", src);
+                       rb_sprintf(tmp, "::ffff:%s", src);
                        return (inet_pton6(tmp, dst));
                }
                else