Logo Search packages:      
Sourcecode: l7-filter-userspace version File versions  Download package



  Functions and classes which keep track of and use regexes to classify streams 
  of application data.
  By Ethan Sommer <sommere@users.sf.net> and Matthew Strait 
  <quadong@users.sf.net>, (C) Nov 2006-2007

  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License
  as published by the Free Software Foundation; either version
  2 of the License, or (at your option) any later version.


#ifndef L7_CLASSIFY_H
#define L7_CLASSIFY_H

using namespace std;
#include <string>
#include <list>
#include <sys/types.h>
#include <regex.h>
#include "l7-conntrack.h"

00030 class l7_pattern {

  int mark; // this is the mark as it appears in the config file
            // before it goes to netfilter, it will get modified by the mask
  string pattern_string;
  int eflags; // for regexec
  int cflags; // for regcomp
  string name;
  regex_t preg;//the compiled regex
  char * pre_process(const char * s);
  int hex2dec(char c);

  l7_pattern(string name,string pattern_string,int eflags,int cflags,int mark);
  bool matches(char * buffer);
  string getName();
  int getMark();

00051 class l7_classify {

  int add_pattern_from_file(const string filename, int mark);
  list<l7_pattern *> patterns;
  l7_classify(string filename);
  int classify(char * buffer);


Generated by  Doxygen 1.6.0   Back to index