class.c fixed
This commit is contained in:
parent
a4f22ead11
commit
b08ce46eb1
2 changed files with 26 additions and 26 deletions
|
@ -43,7 +43,7 @@ struct Class
|
|||
int con_freq;
|
||||
int ping_freq;
|
||||
int total;
|
||||
struct _patricia_tree_t *ip_limits;
|
||||
rb_patricia_tree_t *ip_limits;
|
||||
int cidr_bitlen;
|
||||
int cidr_amount;
|
||||
|
||||
|
|
50
src/class.c
50
src/class.c
|
@ -44,31 +44,31 @@
|
|||
rb_dlink_list class_list;
|
||||
struct Class *default_class;
|
||||
|
||||
struct Class *
|
||||
make_class(void)
|
||||
{
|
||||
struct Class *tmp;
|
||||
|
||||
tmp = (struct Class *) 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);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue