static unsigned long hash_ipv4(struct sockaddr *, int);
-/* int parse_netmask(const char *, struct rb_sockaddr_storage *, int *);
+/* int parse_netmask(const char *, struct irc_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),
{
char *ip = LOCAL_COPY(text);
char *ptr;
- struct rb_sockaddr_storage *addr, xaddr;
+ struct irc_sockaddr_storage *addr, xaddr;
int *b, xb;
if(nb == NULL)
b = &xb;
b = nb;
if(naddr == NULL)
- addr = (struct rb_sockaddr_storage *)&xaddr;
+ addr = (struct irc_sockaddr_storage *)&xaddr;
else
- addr = (struct rb_sockaddr_storage *)naddr;
+ addr = (struct irc_sockaddr_storage *)naddr;
#ifdef IPV6
if(strchr(ip, ':'))
memset(&atable, 0, sizeof(atable));
}
-/* unsigned long hash_ipv4(struct rb_sockaddr_storage*)
+/* unsigned long hash_ipv4(struct irc_sockaddr_storage*)
* Input: An IP address.
* Output: A hash value of the IP address.
* Side effects: None
return 0;
}
-/* unsigned long hash_ipv6(struct rb_sockaddr_storage*)
+/* unsigned long hash_ipv6(struct irc_sockaddr_storage*)
* Input: An IP address.
* Output: A hash value of the IP address.
* Side effects: None
return hash_text(text);
}
-/* struct ConfItem* find_conf_by_address(const char*, struct rb_sockaddr_storage*,
+/* struct ConfItem* find_conf_by_address(const char*, struct irc_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.
}
/* struct ConfItem* find_address_conf(const char*, const char*,
- * struct rb_sockaddr_storage*, int);
+ * struct irc_sockaddr_storage*, int);
* Input: The hostname, username, address, address family.
* Output: The applicable ConfItem.
* Side-effects: None
return iconf;
}
+/* struct ConfItem* find_dline(struct irc_sockaddr_storage*, int)
+ * Input: An address, an address family.
+ * Output: The best matching D-line or exempt line.
+ * Side effects: None.
+ */
+struct ConfItem *
+find_dline(struct sockaddr *addr, int aftype)
+{
+ struct ConfItem *eline;
+ eline = find_conf_by_address(NULL, NULL, NULL, addr, CONF_EXEMPTDLINE | 1, aftype, NULL);
+ if(eline)
+ return eline;
+ return find_conf_by_address(NULL, NULL, NULL, addr, CONF_DLINE | 1, aftype, NULL);
+}
+
/* void find_exact_conf_by_address(const char*, int, const char *)
* Input:
* Output: ConfItem if found
int masktype, bits;
unsigned long hv;
struct AddressRec *arec;
- struct rb_sockaddr_storage addr;
+ struct irc_sockaddr_storage addr;
if(address == NULL)
address = "/NOMATCH!/";
int masktype, bits;
unsigned long hv;
struct AddressRec *arec, *arecl = NULL;
- struct rb_sockaddr_storage addr;
+ struct irc_sockaddr_storage addr;
masktype = parse_netmask(address, (struct sockaddr *)&addr, &bits);
#ifdef IPV6
if(masktype == HM_IPV6)