* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* @file
+/** @file
* @brief Implementation of numeric nickname operations.
* @version $Id$
*/
#include "client.h"
#include "ircd.h"
#include "ircd_alloc.h"
+#include "ircd_log.h"
#include "ircd_string.h"
#include "match.h"
#include "s_bsd.h"
#include "s_misc.h"
#include "struct.h"
-#include <assert.h>
+/* #include <assert.h> -- Now using assert in ircd_log.h */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-/** @page numnicks %Numeric Nicks
+/** @page numnicks Numeric Nicks
* %Numeric nicks (numnicks) are new as of version ircu2.10.00beta1.
*
* The idea is as follows:
* @param[in] addr IP address to encode.
* @param[in] count Number of bytes writable to \a buf.
*/
-const char* iptobase64(char* buf, const struct irc_in_addr* addr, unsigned int count)
+const char* iptobase64(char* buf, const struct irc_in_addr* addr, unsigned int count, int v6_ok)
{
if (irc_in_addr_is_ipv4(addr)) {
assert(count >= 6);
inttobase64(buf, (htons(addr->in6_16[6]) << 16) | htons(addr->in6_16[7]), 6);
+ } else if (!v6_ok) {
+ assert(count >= 6);
+ strcpy(buf, "AAAAAA");
} else {
unsigned int max_start, max_zeros, curr_zeros, zero, ii;
char *output = buf;