Selaa lähdekoodia

permissions: max_subnets - new parameter

- specify the max size for address subnets array
- default value: 512
- if there are more subnet records in address tables than the value of
  max_subnets, increase it
Daniel-Constantin Mierla 9 vuotta sitten
vanhempi
commit
46b10dfe19
3 muutettua tiedostoa jossa 6 lisäystä ja 2 poistoa
  1. 3 0
      modules/permissions/hash.c
  2. 0 2
      modules/permissions/hash.h
  3. 3 0
      modules/permissions/permissions.c

+ 3 - 0
modules/permissions/hash.c

@@ -44,6 +44,9 @@ static int_str tag_avp;
 extern int peer_tag_mode;
 
 
+extern int _perm_max_subnets;
+
+#define PERM_MAX_SUBNETS _perm_max_subnets
 
 /*
  * Parse and set tag AVP specs

+ 0 - 2
modules/permissions/hash.h

@@ -176,8 +176,6 @@ int addr_hash_table_rpc_print(struct addr_list** table, rpc_t* rpc, void* c);
 void empty_addr_hash_table(struct addr_list** hash_table);
 
 
-#define PERM_MAX_SUBNETS 512
-
 
 /*
  * Structure used to store a subnet

+ 3 - 0
modules/permissions/permissions.c

@@ -88,6 +88,8 @@ str port_col = str_init("port");           /* Name of port column */
 static int check_all_branches = 1;
 
 
+int _perm_max_subnets = 512;
+
 /*  
  * Convert the name of the files into table index
  */
@@ -178,6 +180,7 @@ static param_export_t params[] = {
 	{"ip_addr_col",        PARAM_STR, &ip_addr_col     },
 	{"mask_col",           PARAM_STR, &mask_col        },
 	{"port_col",           PARAM_STR, &port_col        },
+	{"max_subnets",        PARAM_INT, &_perm_max_subnets },
 	{0, 0, 0}
 };