73 |
struct ccs_address_group_entry *group; |
struct ccs_address_group_entry *group; |
74 |
const struct ccs_path_info *saved_group_name; |
const struct ccs_path_info *saved_group_name; |
75 |
int error = -ENOMEM; |
int error = -ENOMEM; |
76 |
if (!ccs_is_correct_path(group_name, 0, 0, 0, __func__) || |
if (!ccs_is_correct_path(group_name, 0, 0, 0) || |
77 |
!group_name[0]) |
!group_name[0]) |
78 |
return NULL; |
return NULL; |
79 |
saved_group_name = ccs_get_name(group_name); |
saved_group_name = ccs_get_name(group_name); |
177 |
} |
} |
178 |
list_add_tail(&entry->list, &group->address_group_member_list); |
list_add_tail(&entry->list, &group->address_group_member_list); |
179 |
entry = NULL; |
entry = NULL; |
|
atomic_inc(&group->users); |
|
180 |
error = 0; |
error = 0; |
181 |
} |
} |
182 |
up_write(&ccs_policy_lock); |
up_write(&ccs_policy_lock); |
445 |
* @min_port: Start of port number range. |
* @min_port: Start of port number range. |
446 |
* @max_port: End of port number range. |
* @max_port: End of port number range. |
447 |
* @domain: Pointer to "struct ccs_domain_info". |
* @domain: Pointer to "struct ccs_domain_info". |
448 |
* @condition: Pointer to "struct ccs_condition_list". May be NULL. |
* @condition: Pointer to "struct ccs_condition". May be NULL. |
449 |
* @is_delete: True if it is a delete request. |
* @is_delete: True if it is a delete request. |
450 |
* |
* |
451 |
* Returns 0 on success, negative value otherwise. |
* Returns 0 on success, negative value otherwise. |
456 |
const u32 *max_address, |
const u32 *max_address, |
457 |
const u16 min_port, const u16 max_port, |
const u16 min_port, const u16 max_port, |
458 |
struct ccs_domain_info *domain, |
struct ccs_domain_info *domain, |
459 |
struct ccs_condition_list *condition, |
struct ccs_condition *condition, |
460 |
const bool is_delete) |
const bool is_delete) |
461 |
{ |
{ |
462 |
struct ccs_ip_network_acl_record *entry = NULL; |
struct ccs_ip_network_acl_record *entry = NULL; |
662 |
error = err; |
error = err; |
663 |
goto done; |
goto done; |
664 |
} |
} |
665 |
if (r.mode == 1 && ccs_domain_quota_ok(r.cookie.u.domain)) |
if (r.mode == 1 && ccs_domain_quota_ok(r.cookie.u.domain)) { |
666 |
|
struct ccs_condition *cond = ccs_handler_cond(); |
667 |
ccs_update_network_entry(operation, is_ipv6 ? |
ccs_update_network_entry(operation, is_ipv6 ? |
668 |
IP_RECORD_TYPE_IPv6 : |
IP_RECORD_TYPE_IPv6 : |
669 |
IP_RECORD_TYPE_IPv4, |
IP_RECORD_TYPE_IPv4, |
670 |
NULL, address, address, port, port, |
NULL, address, address, port, port, |
671 |
r.cookie.u.domain, ccs_handler_cond(), |
r.cookie.u.domain, cond, false); |
672 |
false); |
ccs_put_condition(cond); |
673 |
|
} |
674 |
error = 0; |
error = 0; |
675 |
done: |
done: |
676 |
ccs_exit_request_info(&r); |
ccs_exit_request_info(&r); |
682 |
* |
* |
683 |
* @data: String to parse. |
* @data: String to parse. |
684 |
* @domain: Pointer to "struct ccs_domain_info". |
* @domain: Pointer to "struct ccs_domain_info". |
685 |
* @condition: Pointer to "struct ccs_condition_list". May be NULL. |
* @condition: Pointer to "struct ccs_condition". May be NULL. |
686 |
* @is_delete: True if it is a delete request. |
* @is_delete: True if it is a delete request. |
687 |
* |
* |
688 |
* Returns 0 on success, negative value otherwise. |
* Returns 0 on success, negative value otherwise. |
689 |
*/ |
*/ |
690 |
int ccs_write_network_policy(char *data, struct ccs_domain_info *domain, |
int ccs_write_network_policy(char *data, struct ccs_domain_info *domain, |
691 |
struct ccs_condition_list *condition, |
struct ccs_condition *condition, |
692 |
const bool is_delete) |
const bool is_delete) |
693 |
{ |
{ |
694 |
u8 sock_type; |
u8 sock_type; |