Lines Matching defs:acl

52 	struct acl_list* acl = (struct acl_list*)calloc(1,
54 if(!acl)
56 acl->region = regional_create();
57 if(!acl->region) {
58 acl_list_delete(acl);
61 return acl;
65 acl_list_delete(struct acl_list* acl)
67 if(!acl)
69 regional_destroy(acl->region);
70 free(acl);
75 acl_list_insert(struct acl_list* acl, struct sockaddr_storage* addr,
79 struct acl_addr* node = regional_alloc(acl->region,
84 if(!addr_tree_insert(&acl->tree, &node->node, addr, addrlen, net)) {
86 verbose(VERB_QUERY, "duplicate acl address ignored.");
93 acl_list_str_cfg(struct acl_list* acl, const char* str, const char* s2,
120 if(!acl_list_insert(acl, &addr, addrlen, net, control,
130 read_acl_list(struct acl_list* acl, struct config_file* cfg)
135 if(!acl_list_str_cfg(acl, p->str, p->str2, 1))
142 acl_list_apply_cfg(struct acl_list* acl, struct config_file* cfg)
144 regional_free_all(acl->region);
145 addr_tree_init(&acl->tree);
146 if(!read_acl_list(acl, cfg))
149 if(!acl_list_str_cfg(acl, "0.0.0.0/0", "refuse", 0))
151 if(!acl_list_str_cfg(acl, "127.0.0.0/8", "allow", 0))
154 if(!acl_list_str_cfg(acl, "::0/0", "refuse", 0))
156 if(!acl_list_str_cfg(acl, "::1", "allow", 0))
158 if(!acl_list_str_cfg(acl, "::ffff:127.0.0.1", "allow", 0))
161 addr_tree_init_parents(&acl->tree);
166 acl_list_lookup(struct acl_list* acl, struct sockaddr_storage* addr,
169 struct acl_addr* r = (struct acl_addr*)addr_tree_lookup(&acl->tree,
176 acl_list_get_mem(struct acl_list* acl)
178 if(!acl) return 0;
179 return sizeof(*acl) + regional_get_mem(acl->region);