added some code
authorpk910 <philipp@zoelle1.de>
Thu, 24 Jul 2014 08:55:21 +0000 (10:55 +0200)
committerpk910 <philipp@zoelle1.de>
Thu, 24 Jul 2014 08:55:21 +0000 (10:55 +0200)
src/Makefile.am
src/cmd_nick.h [new file with mode: 0644]
src/ircd_auth.c
src/ircd_users.c

index e27e2a169427db0307d54f820dc8c5160f9bc96b..5fc1b20122ef930616ce5ccff4a8b23d1720c1dc 100644 (file)
@@ -23,5 +23,6 @@ nextircd_SOURCES = \
        ircd_parse.c \
        ircd_auth.c \
        ircd_users.c \
+       cmd_nick.c \
        main.c
 
diff --git a/src/cmd_nick.h b/src/cmd_nick.h
new file mode 100644 (file)
index 0000000..66df83d
--- /dev/null
@@ -0,0 +1,27 @@
+/* cmd_ping.h - NextIRCd
+ * Copyright (C) 2012-2013  Philipp Kreil (pk910)
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License 
+ * along with this program. If not, see <http://www.gnu.org/licenses/>. 
+ */
+
+#ifndef _cmd_ping_h
+#define _cmd_ping_h
+
+struct Client;
+struct Auth;
+
+int cmd_nick_cli(struct Client *client, char *argv[], int argc);
+int cmd_nick_auth(struct Auth *auth, char *argv[], int argc);
+
+#endif
index 8079db1c78ff89092687b1ca5a1be44eba316dca..c2ec7285a7d3a2087ab226aa4d2a58a226a2f0b3 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "struct_auth.h"
 #include "struct_connection.h"
+#include "ircd_auth.h"
 #include "ircd_client.h"
 #include "IOHandler/IOSockets.h"
 #include "IOHandler/IODNSLookup.h"
@@ -66,11 +67,7 @@ static IODNS_CALLBACK(auth_dns_callback) {
                client_printf(auth->conn, "NOTICE AUTH :*** Found your hostname (%s)", auth->host);
        } else {
                struct IODNSAddress *sockaddr = iosocket_get_remote_addr(auth->conn->socket);
-               if(auth->conn->ipv6)
-                       inet_ntop(AF_INET6, (void *)(&((struct sockaddr_in6 *)sockaddr->address)->sin6_addr), auth->host, HOSTLEN);
-               else
-                       inet_ntop(AF_INET, (void *)(&((struct sockaddr_in *)sockaddr->address)->sin_addr), auth->host, HOSTLEN);
-               
+               iodns_print_address(sockaddr, auth->conn->socket->ipv6, auth->host, HOSTLEN);
                client_printf(auth->conn, "NOTICE AUTH :*** Couldn't look up your hostname. Using your IP instead (%s)", auth->host);
        }
        if(dnsresult)
index ef0bc82b231ec8305c011748951bde5770af449b..8e5b39f5a5cc771afc361953107b979481ce13b9 100644 (file)
@@ -14,6 +14,9 @@
  * You should have received a copy of the GNU General Public License 
  * along with this program. If not, see <http://www.gnu.org/licenses/>. 
  */
+
+#include <time.h>
+
 #include "struct_user.h"
 
 struct UserDictEntry {