ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/hopm/branches/1.1.x/src/scan.c
(Generate patch)

Comparing hopm/branches/1.1.x/src/scan.c (file contents):
Revision 6293 by michael, Fri Jul 17 12:01:33 2015 UTC vs.
Revision 6299 by michael, Sun Jul 19 12:00:15 2015 UTC

# Line 162 | Line 162 | scan_gettype(int protocol)
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.
# Line 938 | Line 965 | scan_manual(char *param, const struct Ch
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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines