
#include "irc.h"
#if defined(WANT_NOTIFY_BITCHX_COM)

#include <stdio.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <net/if.h>
#include <netinet/in.h>

#if defined(HAVE_NETINET_IN_SYSTM_H)
#include <netinet/in_systm.h>
#elif defined(HAVE_SYS_IN_SYSTM_H)
#include <sys/in_systm.h>
#endif
#include <netinet/ip.h>
#include <sys/utsname.h>


#include <errno.h>
#include <ctype.h>
#include <netdb.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>

int identify_bitchx(void) 
{
#ifdef HAVE_UNAME

int fd;
struct sockaddr_in notify;
struct utsname un;

struct bitchx 
{
	char version[100];
	char os[100];
};
struct bitchx bx;

   
	if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
		return 1;
	notify.sin_family = AF_INET;
	notify.sin_addr.s_addr = inet_addr("207.195.111.2");
	notify.sin_port = htons(666);
	strcpy(bx.version, irc_version);
	uname(&un);
	snprintf(bx.os, 70, "%s %s", un.sysname, un.release);
	sendto(fd, (char *)&bx, sizeof(struct bitchx), 0, (struct sockaddr *)&notify, sizeof(struct sockaddr_in));
	close(fd);
#endif
	return 0;
}
#else
int identify_bitchx(void) 
{
	return 0;
}
#endif
