Ignore:
Timestamp:
Aug 6, 2009, 11:17:00 PM (11 years ago)
Author:
Sam Hocevar
Message:

Allow remote network host filtering, courtesy of Corentin Delorme.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/src/fd.c

    r2584 r3635  
    11/*
    22 *  zzuf - general purpose fuzzer
    3  *  Copyright (c) 2006-2007 Sam Hocevar <sam@zoy.org>
     3 *  Copyright (c) 2006-2009 Sam Hocevar <sam@hocevar.net>
    44 *                All Rights Reserved
    55 *
     
    3636#include "fd.h"
    3737#include "fuzz.h"
     38#include "network.h"
    3839#include "ranges.h"
    3940
     
    4344static int has_include = 0, has_exclude = 0;
    4445#endif
    45 
    46 /* Network port cherry picking */
    47 static int *ports = NULL;
    48 static int static_ports[512];
    4946
    5047/* File descriptor cherry picking */
     
    10097}
    10198
    102 void _zz_ports(char const *portlist)
    103 {
    104     ports = _zz_allocrange(portlist, static_ports);
    105 }
    106 
    10799void _zz_list(char const *fdlist)
    108100{
     
    200192    if(list != static_list)
    201193        free(list);
    202     if(ports != static_ports)
    203         free(ports);
    204194}
    205195
     
    225215
    226216    return 1;
    227 }
    228 
    229 int _zz_portwatched(int port)
    230 {
    231     if(!ports)
    232         return 1;
    233 
    234     return _zz_isinrange(port, ports);
    235217}
    236218
Note: See TracChangeset for help on using the changeset viewer.