X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/68876ea24b3d1782d404a39989ad855b328e5304..68ebdf7f1e10113662291faa75906e498482bd5e:/src/class.c diff --git a/src/class.c b/src/class.c index cccb8de..5998158 100644 --- a/src/class.c +++ b/src/class.c @@ -21,7 +21,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: class.c 254 2005-09-21 23:35:12Z nenolod $ */ #include "stdinc.h" @@ -35,7 +34,7 @@ #include "s_conf.h" #include "s_newconf.h" #include "send.h" -#include "irc_string.h" +#include "match.h" #define BAD_CONF_CLASS -1 #define BAD_PING -2 @@ -44,31 +43,31 @@ rb_dlink_list class_list; struct Class *default_class; -struct Class * -make_class(void) -{ - struct Class *tmp; - - tmp = rb_malloc(sizeof(struct Class)); - - ConFreq(tmp) = DEFAULT_CONNECTFREQUENCY; - PingFreq(tmp) = DEFAULT_PINGFREQUENCY; - MaxUsers(tmp) = 1; - MaxSendq(tmp) = DEFAULT_SENDQ; - - tmp->ip_limits = rb_new_patricia(PATRICIA_BITS); - return tmp; -} - -void -free_class(struct Class *tmp) -{ - if(tmp->ip_limits) - rb_destroy_patricia(tmp->ip_limits, NULL); - - rb_free(tmp->class_name); - rb_free(tmp); - +struct Class * +make_class(void) +{ + struct Class *tmp; + + tmp = rb_malloc(sizeof(struct Class)); + + ConFreq(tmp) = DEFAULT_CONNECTFREQUENCY; + PingFreq(tmp) = DEFAULT_PINGFREQUENCY; + MaxUsers(tmp) = 1; + MaxSendq(tmp) = DEFAULT_SENDQ; + + tmp->ip_limits = rb_new_patricia(PATRICIA_BITS); + return tmp; +} + +void +free_class(struct Class *tmp) +{ + if(tmp->ip_limits) + rb_destroy_patricia(tmp->ip_limits, NULL); + + rb_free(tmp->class_name); + rb_free(tmp); + } /* @@ -199,7 +198,8 @@ add_class(struct Class *classptr) PingFreq(tmpptr) = PingFreq(classptr); MaxSendq(tmpptr) = MaxSendq(classptr); ConFreq(tmpptr) = ConFreq(classptr); - CidrBitlen(tmpptr) = CidrBitlen(classptr); + CidrIpv4Bitlen(tmpptr) = CidrIpv4Bitlen(classptr); + CidrIpv6Bitlen(tmpptr) = CidrIpv6Bitlen(classptr); CidrAmount(tmpptr) = CidrAmount(classptr); free_class(classptr);