X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/68876ea24b3d1782d404a39989ad855b328e5304..d25c6eb1b223d1a0993dde9a28c97ef95e54bceb:/src/class.c diff --git a/src/class.c b/src/class.c index cccb8de..3b55fff 100644 --- a/src/class.c +++ b/src/class.c @@ -35,7 +35,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 +44,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 +199,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);