X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=include%2Fres.h;h=7582f225b601744aca21d9f4a501c7d5bfcfc695;hb=9b1f5beca29ec78141f19a19d689f0f7cc3fe3ac;hp=6ca91ce48d204682b290cc6b3c75dc073803414a;hpb=9e97df973e333c18f65f251a213fcf736e52653f;p=ircu2.10.12-pk.git diff --git a/include/res.h b/include/res.h index 6ca91ce..7582f22 100644 --- a/include/res.h +++ b/include/res.h @@ -7,13 +7,35 @@ #ifndef INCLUDED_res_h #define INCLUDED_res_h -#include "listener.h" -#include "ircd_addrinfo.h" +#ifndef INCLUDED_config_h +#include "config.h" +#endif + +#ifndef INCLUDED_sys_types_h +#include +#define INCLUDED_sys_types_h +#endif + +#ifndef INCLUDED_sys_socket_h +#include +#define INCLUDED_sys_socket_h +#endif + +#include -#ifndef INADDR_NONE -#define INADDR_NONE ((uint32_t)-1) +#ifndef INCLUDED_netinet_in_h +#include +#define INCLUDED_netinet_in_h #endif +#ifdef HAVE_STDINT_H +#ifndef INCLUDED_stdint_h +#include +#define INCLUDED_stdint_h +#endif +#endif + +struct Client; struct StatDesc; /* Here we define some values lifted from nameser.h */ @@ -38,17 +60,22 @@ struct StatDesc; #define RRFIXEDSZ 10 #define HFIXEDSZ 12 -struct irc_ssaddr +struct irc_in_addr +{ + unsigned short in6_16[8]; +}; + +struct irc_sockaddr { - struct sockaddr_storage ss; - size_t ss_len; + struct irc_in_addr addr; + unsigned short port; }; struct DNSReply { char *h_name; int h_addrtype; - struct irc_ssaddr addr; + struct irc_in_addr addr; }; struct DNSQuery @@ -102,7 +129,10 @@ extern void delete_resolver_queries(const void *vptr); extern void report_dns_servers(struct Client *source_p, struct StatDesc *sd, int stat, char *param); extern void gethost_byname_type(const char *name, const struct DNSQuery *query, int type); extern void gethost_byname(const char *name, const struct DNSQuery *query); -extern void gethost_byaddr(const struct irc_ssaddr *addr, const struct DNSQuery *query); -extern void gethost_byinaddr(const struct in_addr *addr, const struct DNSQuery *query); +extern void gethost_byaddr(const struct irc_in_addr *addr, const struct DNSQuery *query); +extern int irc_in_addr_valid(const struct irc_in_addr *addr); +extern int irc_in_addr_cmp(const struct irc_in_addr *a, const struct irc_in_addr *b); +extern int irc_in_addr_is_ipv4(const struct irc_in_addr *addr); +extern int irc_in_addr_is_loopback(const struct irc_in_addr *addr); #endif