home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR3 / KA9Q212.ZIP / FILTER.H < prev    next >
C/C++ Source or Header  |  1993-07-16  |  1KB  |  37 lines

  1. /****************************************************************************
  2. *    $Id: filter.h 1.2 93/07/16 11:44:39 ROOT_DOS Exp $
  3. *    14 Jun 93    1.2        GT    Enable ip_filter () prototype.                    *
  4. ****************************************************************************/
  5. #ifndef _FILTER_H
  6. #define _FILTER_H
  7.  
  8. #ifndef _GLOBAL_H
  9. #include "global.h"
  10. #endif
  11.  
  12. #define FILTER_ACTION_DENY 1
  13. #define FILTER_ACTION_PERMIT 2
  14.  
  15. /*
  16.  *   Filter entry structure.
  17.  */
  18. struct filter {
  19.     struct filter    *next;        /* Link to next filter element    */
  20.     short        action;        /* Filter entry match action    */
  21.     int        (*type) __ARGS((struct mbuf *bp, struct ip *ip, struct filter *fp));    /* Packet type comparison f(x)    */
  22.     struct filtersd {
  23.           unsigned long addr;    /* Address used for comparisons    */
  24.         unsigned long mask;    /* Address comparison mask    */
  25.         unsigned char bits;    /* One bits in high part of mask*/
  26.         unsigned char exclude;    /* Exclude matching addresses    */
  27.         unsigned short port;    /* TCP/UDP port (low of range)    */
  28.         unsigned short hiport;    /* High port of range        */
  29.     } src, dest;
  30.     unsigned long    matches;    /* Number of matching packets    */
  31. };
  32.  
  33. int doipfilter __ARGS(( int argc, char *argv[], void *p ));
  34. int ip_filter __ARGS(( struct mbuf *bp, struct ip *ip, struct filter *fp ));
  35.  
  36. #endif /* _FILTER_H */
  37.