irc_sockaddr_storage -> rb_sockaddr_storage, changing fd in Listener struct to F 'cause libratbox3 need it.
This commit is contained in:
parent
c945815bf6
commit
3ea5fee7ed
|
@ -233,7 +233,7 @@ struct LocalUser
|
|||
conf_item_t *att_conf; /* attached conf */
|
||||
struct server_conf *att_sconf;
|
||||
|
||||
struct irc_sockaddr_storage ip;
|
||||
struct rb_sockaddr_storage ip;
|
||||
time_t last_nick_change;
|
||||
int number_of_nick_changes;
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ struct AddressRec
|
|||
struct
|
||||
{
|
||||
/* Pointer into ConfItem... -A1kmm */
|
||||
struct irc_sockaddr_storage addr;
|
||||
struct rb_sockaddr_storage addr;
|
||||
int bits;
|
||||
}
|
||||
ipa;
|
||||
|
|
|
@ -152,17 +152,6 @@
|
|||
#endif
|
||||
#endif /* #ifdef IPV6 */
|
||||
|
||||
|
||||
#ifdef IPV6
|
||||
#define irc_sockaddr_storage sockaddr_storage
|
||||
#else
|
||||
#define irc_sockaddr_storage sockaddr
|
||||
#define ss_family sa_family
|
||||
#ifdef SOCKADDR_IN_HAS_LEN
|
||||
#define ss_len sa_len
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef IPV6
|
||||
#define PATRICIA_BITS 128
|
||||
#else
|
||||
|
|
|
@ -35,11 +35,11 @@ struct Listener
|
|||
{
|
||||
struct Listener *next; /* list node pointer */
|
||||
const char *name; /* listener name */
|
||||
int fd; /* file descriptor */
|
||||
rb_fde_t *F; /* file descriptor */
|
||||
int ref_count; /* number of connection references */
|
||||
int active; /* current state of listener */
|
||||
int index; /* index into poll array */
|
||||
struct irc_sockaddr_storage addr;
|
||||
int ssl; /* ssl listener */
|
||||
struct rb_sockaddr_storage addr;
|
||||
struct DNSQuery *dns_query;
|
||||
char vhost[HOSTLEN + 1]; /* virtual name of listener */
|
||||
};
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
struct DNSReply
|
||||
{
|
||||
char *h_name;
|
||||
struct irc_sockaddr_storage addr;
|
||||
struct rb_sockaddr_storage addr;
|
||||
};
|
||||
|
||||
struct DNSQuery
|
||||
|
@ -32,14 +32,14 @@ struct DNSQuery
|
|||
void (*callback)(void* vptr, struct DNSReply *reply); /* callback to call */
|
||||
};
|
||||
|
||||
extern struct irc_sockaddr_storage irc_nsaddr_list[];
|
||||
extern struct rb_sockaddr_storage irc_nsaddr_list[];
|
||||
extern int irc_nscount;
|
||||
|
||||
extern void init_resolver(void);
|
||||
extern void restart_resolver(void);
|
||||
extern void delete_resolver_queries(const struct DNSQuery *);
|
||||
extern void gethost_byname_type(const char *, struct DNSQuery *, int);
|
||||
extern void gethost_byaddr(const struct irc_sockaddr_storage *, struct DNSQuery *);
|
||||
extern void gethost_byaddr(const struct rb_sockaddr_storage *, struct DNSQuery *);
|
||||
extern void add_local_domain(char *, size_t);
|
||||
extern void report_dns_servers(struct Client *);
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ struct hostent;
|
|||
|
||||
struct ip_value
|
||||
{
|
||||
struct irc_sockaddr_storage ip;
|
||||
struct rb_sockaddr_storage ip;
|
||||
int ip_mask;
|
||||
int type;
|
||||
};
|
||||
|
|
|
@ -203,7 +203,7 @@ struct server_conf
|
|||
time_t hold;
|
||||
|
||||
int aftype;
|
||||
struct irc_sockaddr_storage my_ipnum;
|
||||
struct rb_sockaddr_storage my_ipnum;
|
||||
|
||||
char *class_name;
|
||||
struct Class *class;
|
||||
|
|
|
@ -76,7 +76,7 @@ mo_dline(struct Client *client_p, struct Client *source_p,
|
|||
const char *dlhost;
|
||||
char *oper_reason;
|
||||
char *reason = def;
|
||||
struct irc_sockaddr_storage daddr;
|
||||
struct rb_sockaddr_storage daddr;
|
||||
char cidr_form_host[HOSTLEN + 1];
|
||||
struct ConfItem *aconf;
|
||||
int bits;
|
||||
|
|
|
@ -695,7 +695,7 @@ remove_temp_gline(const char *user, const char *host)
|
|||
{
|
||||
struct ConfItem *aconf;
|
||||
rb_dlink_node *ptr;
|
||||
struct irc_sockaddr_storage addr, caddr;
|
||||
struct rb_sockaddr_storage addr, caddr;
|
||||
int bits, cbits;
|
||||
int mtype, gtype;
|
||||
|
||||
|
|
|
@ -691,7 +691,7 @@ static int
|
|||
already_placed_kline(struct Client *source_p, const char *luser, const char *lhost, int tkline)
|
||||
{
|
||||
const char *reason, *p;
|
||||
struct irc_sockaddr_storage iphost, *piphost;
|
||||
struct rb_sockaddr_storage iphost, *piphost;
|
||||
struct ConfItem *aconf;
|
||||
int t, bits;
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ mo_testline(struct Client *client_p, struct Client *source_p, int parc, const ch
|
|||
{
|
||||
struct ConfItem *aconf;
|
||||
struct ConfItem *resv_p;
|
||||
struct irc_sockaddr_storage ip;
|
||||
struct rb_sockaddr_storage ip;
|
||||
char user_trunc[USERLEN + 1], notildeuser_trunc[USERLEN + 1];
|
||||
const char *name = NULL;
|
||||
const char *username = NULL;
|
||||
|
|
|
@ -39,7 +39,7 @@ static unsigned long hash_ipv6(struct sockaddr *, int);
|
|||
static unsigned long hash_ipv4(struct sockaddr *, int);
|
||||
|
||||
|
||||
/* int parse_netmask(const char *, struct irc_sockaddr_storage *, int *);
|
||||
/* int parse_netmask(const char *, struct rb_sockaddr_storage *, int *);
|
||||
* Input: A hostmask, or an IPV4/6 address.
|
||||
* Output: An integer describing whether it is an IPV4, IPV6 address or a
|
||||
* hostmask, an address(if it is an IP mask),
|
||||
|
@ -51,7 +51,7 @@ parse_netmask(const char *text, struct sockaddr *naddr, int *nb)
|
|||
{
|
||||
char *ip = LOCAL_COPY(text);
|
||||
char *ptr;
|
||||
struct irc_sockaddr_storage *addr, xaddr;
|
||||
struct rb_sockaddr_storage *addr, xaddr;
|
||||
int *b, xb;
|
||||
if(nb == NULL)
|
||||
b = &xb;
|
||||
|
@ -59,9 +59,9 @@ parse_netmask(const char *text, struct sockaddr *naddr, int *nb)
|
|||
b = nb;
|
||||
|
||||
if(naddr == NULL)
|
||||
addr = (struct irc_sockaddr_storage *)&xaddr;
|
||||
addr = (struct rb_sockaddr_storage *)&xaddr;
|
||||
else
|
||||
addr = (struct irc_sockaddr_storage *)naddr;
|
||||
addr = (struct rb_sockaddr_storage *)naddr;
|
||||
|
||||
#ifdef IPV6
|
||||
if(strchr(ip, ':'))
|
||||
|
@ -109,7 +109,7 @@ init_host_hash(void)
|
|||
memset(&atable, 0, sizeof(atable));
|
||||
}
|
||||
|
||||
/* unsigned long hash_ipv4(struct irc_sockaddr_storage*)
|
||||
/* unsigned long hash_ipv4(struct rb_sockaddr_storage*)
|
||||
* Input: An IP address.
|
||||
* Output: A hash value of the IP address.
|
||||
* Side effects: None
|
||||
|
@ -128,7 +128,7 @@ hash_ipv4(struct sockaddr *saddr, int bits)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* unsigned long hash_ipv6(struct irc_sockaddr_storage*)
|
||||
/* unsigned long hash_ipv6(struct rb_sockaddr_storage*)
|
||||
* Input: An IP address.
|
||||
* Output: A hash value of the IP address.
|
||||
* Side effects: None
|
||||
|
@ -196,7 +196,7 @@ get_mask_hash(const char *text)
|
|||
return hash_text(text);
|
||||
}
|
||||
|
||||
/* struct ConfItem* find_conf_by_address(const char*, struct irc_sockaddr_storage*,
|
||||
/* struct ConfItem* find_conf_by_address(const char*, struct rb_sockaddr_storage*,
|
||||
* int type, int fam, const char *username)
|
||||
* Input: The hostname, the address, the type of mask to find, the address
|
||||
* family, the username.
|
||||
|
@ -343,7 +343,7 @@ find_conf_by_address(const char *name, const char *sockhost,
|
|||
}
|
||||
|
||||
/* struct ConfItem* find_address_conf(const char*, const char*,
|
||||
* struct irc_sockaddr_storage*, int);
|
||||
* struct rb_sockaddr_storage*, int);
|
||||
* Input: The hostname, username, address, address family.
|
||||
* Output: The applicable ConfItem.
|
||||
* Side-effects: None
|
||||
|
@ -416,7 +416,7 @@ find_address_conf(const char *host, const char *sockhost, const char *user,
|
|||
return iconf;
|
||||
}
|
||||
|
||||
/* struct ConfItem* find_dline(struct irc_sockaddr_storage*, int)
|
||||
/* struct ConfItem* find_dline(struct rb_sockaddr_storage*, int)
|
||||
* Input: An address, an address family.
|
||||
* Output: The best matching D-line or exempt line.
|
||||
* Side effects: None.
|
||||
|
@ -442,7 +442,7 @@ find_exact_conf_by_address(const char *address, int type, const char *username)
|
|||
int masktype, bits;
|
||||
unsigned long hv;
|
||||
struct AddressRec *arec;
|
||||
struct irc_sockaddr_storage addr;
|
||||
struct rb_sockaddr_storage addr;
|
||||
|
||||
if(address == NULL)
|
||||
address = "/NOMATCH!/";
|
||||
|
@ -548,7 +548,7 @@ delete_one_address_conf(const char *address, struct ConfItem *aconf)
|
|||
int masktype, bits;
|
||||
unsigned long hv;
|
||||
struct AddressRec *arec, *arecl = NULL;
|
||||
struct irc_sockaddr_storage addr;
|
||||
struct rb_sockaddr_storage addr;
|
||||
masktype = parse_netmask(address, (struct sockaddr *)&addr, &bits);
|
||||
#ifdef IPV6
|
||||
if(masktype == HM_IPV6)
|
||||
|
|
|
@ -539,7 +539,7 @@ 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
|
||||
|
@ -547,7 +547,7 @@ inetpton_sock(const char *src, struct sockaddr *dst)
|
|||
{
|
||||
((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
|
||||
|
|
|
@ -56,14 +56,14 @@ static PF accept_connection;
|
|||
static listener_t *ListenerPollList = NULL;
|
||||
|
||||
static listener_t *
|
||||
make_listener(struct irc_sockaddr_storage *addr)
|
||||
make_listener(struct rb_sockaddr_storage *addr)
|
||||
{
|
||||
listener_t *listener = (listener_t *) rb_malloc(sizeof(listener_t));
|
||||
s_assert(0 != listener);
|
||||
|
||||
listener->name = me.name;
|
||||
listener->fd = -1;
|
||||
memcpy(&listener->addr, addr, sizeof(struct irc_sockaddr_storage));
|
||||
memcpy(&listener->addr, addr, sizeof(struct rb_sockaddr_storage));
|
||||
listener->next = NULL;
|
||||
return listener;
|
||||
}
|
||||
|
@ -252,7 +252,7 @@ inetport(listener_t *listener)
|
|||
}
|
||||
|
||||
static listener_t *
|
||||
find_listener(struct irc_sockaddr_storage *addr)
|
||||
find_listener(struct rb_sockaddr_storage *addr)
|
||||
{
|
||||
listener_t *listener = NULL;
|
||||
listener_t *last_closed = NULL;
|
||||
|
@ -314,7 +314,7 @@ void
|
|||
add_listener(int port, const char *vhost_ip, int family)
|
||||
{
|
||||
listener_t *listener;
|
||||
struct irc_sockaddr_storage vaddr;
|
||||
struct rb_sockaddr_storage vaddr;
|
||||
|
||||
/*
|
||||
* if no port in conf line, don't bother
|
||||
|
@ -451,7 +451,7 @@ add_connection(listener_t *listener, int fd, struct sockaddr *sai, int exempt)
|
|||
*/
|
||||
new_client = make_client(NULL);
|
||||
|
||||
memcpy(&new_client->localClient->ip, sai, sizeof(struct irc_sockaddr_storage));
|
||||
memcpy(&new_client->localClient->ip, sai, sizeof(struct rb_sockaddr_storage));
|
||||
|
||||
/*
|
||||
* copy address to 'sockhost' as a string, copy it to host too
|
||||
|
@ -484,7 +484,7 @@ static void
|
|||
accept_connection(int pfd, void *data)
|
||||
{
|
||||
static time_t last_oper_notice = 0;
|
||||
struct irc_sockaddr_storage sai;
|
||||
struct rb_sockaddr_storage sai;
|
||||
socklen_t addrlen = sizeof(sai);
|
||||
int fd;
|
||||
listener_t *listener = data;
|
||||
|
|
|
@ -326,7 +326,7 @@ int comp_with_mask_sock(struct sockaddr *addr, struct sockaddr *dest, u_int mask
|
|||
*/
|
||||
int match_ips(const char *s1, const char *s2)
|
||||
{
|
||||
struct irc_sockaddr_storage ipaddr, maskaddr;
|
||||
struct rb_sockaddr_storage ipaddr, maskaddr;
|
||||
char mask[BUFSIZE];
|
||||
char address[HOSTLEN + 1];
|
||||
char *len;
|
||||
|
@ -380,7 +380,7 @@ int match_ips(const char *s1, const char *s2)
|
|||
|
||||
int match_cidr(const char *s1, const char *s2)
|
||||
{
|
||||
struct irc_sockaddr_storage ipaddr, maskaddr;
|
||||
struct rb_sockaddr_storage ipaddr, maskaddr;
|
||||
char mask[BUFSIZE];
|
||||
char address[NICKLEN + USERLEN + HOSTLEN + 6];
|
||||
char *ipmask;
|
||||
|
|
20
src/res.c
20
src/res.c
|
@ -79,7 +79,7 @@ struct reslist
|
|||
char resend; /* send flag. 0 == dont resend */
|
||||
time_t sentat;
|
||||
time_t timeout;
|
||||
struct irc_sockaddr_storage addr;
|
||||
struct rb_sockaddr_storage addr;
|
||||
char *name;
|
||||
struct DNSQuery *query; /* query callback for this request */
|
||||
};
|
||||
|
@ -90,7 +90,7 @@ static rb_dlink_list request_list = { NULL, NULL, 0 };
|
|||
static void rem_request(struct reslist *request);
|
||||
static struct reslist *make_request(struct DNSQuery *query);
|
||||
static void do_query_name(struct DNSQuery *query, const char *name, struct reslist *request, int);
|
||||
static void do_query_number(struct DNSQuery *query, const struct irc_sockaddr_storage *,
|
||||
static void do_query_number(struct DNSQuery *query, const struct rb_sockaddr_storage *,
|
||||
struct reslist *request);
|
||||
static void query_name(struct reslist *request);
|
||||
static int send_res_msg(const char *buf, int len, int count);
|
||||
|
@ -100,7 +100,7 @@ static int proc_answer(struct reslist *request, HEADER * header, char *, char *)
|
|||
static struct reslist *find_id(int id);
|
||||
static struct DNSReply *make_dnsreply(struct reslist *request);
|
||||
|
||||
extern struct irc_sockaddr_storage irc_nsaddr_list[IRCD_MAXNS];
|
||||
extern struct rb_sockaddr_storage irc_nsaddr_list[IRCD_MAXNS];
|
||||
extern int irc_nscount;
|
||||
extern char irc_domain[HOSTLEN + 1];
|
||||
|
||||
|
@ -116,7 +116,7 @@ extern char irc_domain[HOSTLEN + 1];
|
|||
* paul vixie, 29may94
|
||||
* revised for ircd, cryogen(stu) may03
|
||||
*/
|
||||
static int res_ourserver(const struct irc_sockaddr_storage *inp)
|
||||
static int res_ourserver(const struct rb_sockaddr_storage *inp)
|
||||
{
|
||||
#ifdef IPV6
|
||||
struct sockaddr_in6 *v6;
|
||||
|
@ -128,7 +128,7 @@ static int res_ourserver(const struct irc_sockaddr_storage *inp)
|
|||
|
||||
for (ns = 0; ns < irc_nscount; ns++)
|
||||
{
|
||||
const struct irc_sockaddr_storage *srv = &irc_nsaddr_list[ns];
|
||||
const struct rb_sockaddr_storage *srv = &irc_nsaddr_list[ns];
|
||||
#ifdef IPV6
|
||||
v6 = (struct sockaddr_in6 *)srv;
|
||||
#endif
|
||||
|
@ -392,7 +392,7 @@ void gethost_byname_type(const char *name, struct DNSQuery *query, int type)
|
|||
/*
|
||||
* gethost_byaddr - get host name from address
|
||||
*/
|
||||
void gethost_byaddr(const struct irc_sockaddr_storage *addr, struct DNSQuery *query)
|
||||
void gethost_byaddr(const struct rb_sockaddr_storage *addr, struct DNSQuery *query)
|
||||
{
|
||||
do_query_number(query, addr, NULL);
|
||||
}
|
||||
|
@ -424,7 +424,7 @@ static void do_query_name(struct DNSQuery *query, const char *name, struct resli
|
|||
/*
|
||||
* do_query_number - Use this to do reverse IP# lookups.
|
||||
*/
|
||||
static void do_query_number(struct DNSQuery *query, const struct irc_sockaddr_storage *addr,
|
||||
static void do_query_number(struct DNSQuery *query, const struct rb_sockaddr_storage *addr,
|
||||
struct reslist *request)
|
||||
{
|
||||
const unsigned char *cp;
|
||||
|
@ -432,7 +432,7 @@ static void do_query_number(struct DNSQuery *query, const struct irc_sockaddr_st
|
|||
if (request == NULL)
|
||||
{
|
||||
request = make_request(query);
|
||||
memcpy(&request->addr, addr, sizeof(struct irc_sockaddr_storage));
|
||||
memcpy(&request->addr, addr, sizeof(struct rb_sockaddr_storage));
|
||||
request->name = (char *)rb_malloc(HOSTLEN + 1);
|
||||
}
|
||||
|
||||
|
@ -734,8 +734,8 @@ static void res_readreply(int fd, void *data)
|
|||
struct DNSReply *reply = NULL;
|
||||
int rc;
|
||||
int answer_count;
|
||||
socklen_t len = sizeof(struct irc_sockaddr_storage);
|
||||
struct irc_sockaddr_storage lsin;
|
||||
socklen_t len = sizeof(struct rb_sockaddr_storage);
|
||||
struct rb_sockaddr_storage lsin;
|
||||
|
||||
rc = recvfrom(fd, buf, sizeof(buf), 0, (struct sockaddr *)&lsin, &len);
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@
|
|||
/* $Id: reslib.c 1695 2006-06-27 15:11:23Z jilles $ */
|
||||
/* from Hybrid Id: reslib.c 177 2005-10-22 09:05:05Z michael $ */
|
||||
|
||||
struct irc_sockaddr_storage irc_nsaddr_list[IRCD_MAXNS];
|
||||
struct rb_sockaddr_storage irc_nsaddr_list[IRCD_MAXNS];
|
||||
int irc_nscount = 0;
|
||||
char irc_domain[HOSTLEN + 1];
|
||||
|
||||
|
|
|
@ -265,8 +265,8 @@ auth_error(struct AuthRequest *auth)
|
|||
static int
|
||||
start_auth_query(struct AuthRequest *auth)
|
||||
{
|
||||
struct irc_sockaddr_storage localaddr;
|
||||
socklen_t locallen = sizeof(struct irc_sockaddr_storage);
|
||||
struct rb_sockaddr_storage localaddr;
|
||||
socklen_t locallen = sizeof(struct rb_sockaddr_storage);
|
||||
int fd;
|
||||
int family;
|
||||
|
||||
|
|
|
@ -284,7 +284,7 @@ struct oper_conf *
|
|||
find_oper_conf(const char *username, const char *host, const char *locip, const char *name)
|
||||
{
|
||||
struct oper_conf *oper_p;
|
||||
struct irc_sockaddr_storage ip, cip;
|
||||
struct rb_sockaddr_storage ip, cip;
|
||||
char addr[HOSTLEN+1];
|
||||
int bits, cbits;
|
||||
rb_dlink_node *ptr;
|
||||
|
|
|
@ -1469,7 +1469,7 @@ int
|
|||
serv_connect(struct server_conf *server_p, struct Client *by)
|
||||
{
|
||||
struct Client *client_p;
|
||||
struct irc_sockaddr_storage myipnum;
|
||||
struct rb_sockaddr_storage myipnum;
|
||||
int fd;
|
||||
char vhoststr[HOSTIPLEN];
|
||||
|
||||
|
|
Loading…
Reference in New Issue