5 |
* |
* |
6 |
* Copyright (C) 2005-2007 NTT DATA CORPORATION |
* Copyright (C) 2005-2007 NTT DATA CORPORATION |
7 |
* |
* |
8 |
* Version: 1.5.0 2007/09/20 |
* Version: 1.5.1-pre 2007/10/16 |
9 |
* |
* |
10 |
* This file is applicable to both 2.4.30 and 2.6.11 and later. |
* This file is applicable to both 2.4.30 and 2.6.11 and later. |
11 |
* See README.ccs for ChangeLog. |
* See README.ccs for ChangeLog. |
377 |
return 0; |
return 0; |
378 |
} |
} |
379 |
|
|
380 |
int AddNetworkPolicy(char *data, struct domain_info *domain, const u8 is_delete) |
int AddNetworkPolicy(char *data, struct domain_info *domain, const struct condition_list *condition, const u8 is_delete) |
381 |
{ |
{ |
382 |
u8 sock_type, operation, record_type; |
u8 sock_type, operation, record_type; |
383 |
u16 min_address[8], max_address[8]; |
u16 min_address[8], max_address[8]; |
385 |
u16 min_port, max_port; |
u16 min_port, max_port; |
386 |
int count; |
int count; |
387 |
char *cp1 = NULL, *cp2 = NULL; |
char *cp1 = NULL, *cp2 = NULL; |
|
const struct condition_list *condition = NULL; |
|
|
cp1 = FindConditionPart(data); |
|
|
if (cp1 && (condition = FindOrAssignNewCondition(cp1)) == NULL) goto out; |
|
388 |
if ((cp1 = strchr(data, ' ')) == NULL) goto out; cp1++; |
if ((cp1 = strchr(data, ' ')) == NULL) goto out; cp1++; |
389 |
if (strncmp(data, "TCP ", 4) == 0) sock_type = SOCK_STREAM; |
if (strncmp(data, "TCP ", 4) == 0) sock_type = SOCK_STREAM; |
390 |
else if (strncmp(data, "UDP ", 4) == 0) sock_type = SOCK_DGRAM; |
else if (strncmp(data, "UDP ", 4) == 0) sock_type = SOCK_DGRAM; |