162 |
|
return undef; |
163 |
|
} |
164 |
|
|
165 |
+ |
/* scan_checkexempt |
166 |
+ |
* |
167 |
+ |
* Check mask against exempt list. |
168 |
+ |
* |
169 |
+ |
* Parameters: |
170 |
+ |
* mask: Mask to check |
171 |
+ |
* |
172 |
+ |
* Return: |
173 |
+ |
* 1 if mask is in list |
174 |
+ |
* 0 if mask is not in list |
175 |
+ |
*/ |
176 |
+ |
static int |
177 |
+ |
scan_checkexempt(const char *mask, const char *ipmask) |
178 |
+ |
{ |
179 |
+ |
node_t *node; |
180 |
+ |
|
181 |
+ |
LIST_FOREACH(node, ExemptItem->masks->head) |
182 |
+ |
{ |
183 |
+ |
const char *exempt_mask = node->data; |
184 |
+ |
|
185 |
+ |
if (!match(exempt_mask, mask) || !match(exempt_mask, ipmask)) |
186 |
+ |
return 1; |
187 |
+ |
} |
188 |
+ |
|
189 |
+ |
return 0; |
190 |
+ |
} |
191 |
+ |
|
192 |
|
/* scan_init |
193 |
|
|
194 |
|
Initialize scanner and masks list based on configuration. |
965 |
|
} |
966 |
|
} |
967 |
|
|
941 |
– |
/* scan_checkexempt |
942 |
– |
* |
943 |
– |
* Check mask against exempt list. |
944 |
– |
* |
945 |
– |
* Parameters: |
946 |
– |
* mask: Mask to check |
947 |
– |
* |
948 |
– |
* Return: |
949 |
– |
* 1 if mask is in list |
950 |
– |
* 0 if mask is not in list |
951 |
– |
*/ |
952 |
– |
int |
953 |
– |
scan_checkexempt(const char *mask, const char *ipmask) |
954 |
– |
{ |
955 |
– |
node_t *node; |
956 |
– |
|
957 |
– |
LIST_FOREACH(node, ExemptItem->masks->head) |
958 |
– |
{ |
959 |
– |
const char *exempt_mask = node->data; |
960 |
– |
|
961 |
– |
if (!match(exempt_mask, mask) || !match(exempt_mask, ipmask)) |
962 |
– |
return 1; |
963 |
– |
} |
964 |
– |
|
965 |
– |
return 0; |
966 |
– |
} |
967 |
– |
|
968 |
|
/* scan_log |
969 |
|
* |
970 |
|
* Log the fact that a given ip/port/protocol has just been scanned, if the |