2005-11-23 10:06:54 +00:00
|
|
|
/* +------------------------------------+
|
|
|
|
* | Inspire Internet Relay Chat Daemon |
|
|
|
|
* +------------------------------------+
|
|
|
|
*
|
2006-01-15 15:59:11 +00:00
|
|
|
* InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
|
2005-11-23 10:06:54 +00:00
|
|
|
* E-mail:
|
|
|
|
* <brain@chatspike.net>
|
|
|
|
* <Craig@chatspike.net>
|
|
|
|
*
|
|
|
|
* Written by Craig Edwards, Craig McLure, and others.
|
|
|
|
* This program is free but copyrighted software; see
|
|
|
|
* the file COPYING for details.
|
|
|
|
*
|
|
|
|
* ---------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
2006-04-08 17:05:48 +00:00
|
|
|
#ifndef INSPIRCD_SOCKET_H
|
|
|
|
#define INSPIRCD_SOCKET_H
|
2005-11-25 10:38:55 +00:00
|
|
|
|
2006-04-09 11:51:24 +00:00
|
|
|
#include <arpa/inet.h>
|
2006-04-08 17:05:48 +00:00
|
|
|
#include <sys/time.h>
|
|
|
|
#include <sys/resource.h>
|
2005-11-23 11:22:06 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/socket.h>
|
2006-04-09 11:51:24 +00:00
|
|
|
#include <sys/stat.h>
|
2005-11-23 11:22:06 +00:00
|
|
|
#include <netinet/in.h>
|
2006-04-08 17:05:48 +00:00
|
|
|
#include <unistd.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <poll.h>
|
2006-04-09 11:51:24 +00:00
|
|
|
#include <netdb.h>
|
2006-04-10 22:16:34 +00:00
|
|
|
#include <errno.h>
|
|
|
|
|
2006-04-08 01:35:02 +00:00
|
|
|
#include "inspircd_config.h"
|
|
|
|
|
|
|
|
/* macros to the relevant system address description structs */
|
|
|
|
#ifdef IPV6
|
|
|
|
|
|
|
|
typedef struct sockaddr_in6 insp_sockaddr;
|
|
|
|
typedef struct in6_addr insp_inaddr;
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
typedef struct sockaddr_in insp_sockaddr;
|
|
|
|
typedef struct in_addr insp_inaddr;
|
|
|
|
|
|
|
|
#endif
|
2005-11-23 10:06:54 +00:00
|
|
|
|
2006-04-08 17:05:48 +00:00
|
|
|
int OpenTCPSocket();
|
|
|
|
bool BindSocket(int sockfd, insp_sockaddr client, insp_sockaddr server, int port, char* addr);
|
|
|
|
int BindPorts(bool bail);
|
2005-11-25 10:38:55 +00:00
|
|
|
|
|
|
|
#endif
|