version 3.02
This commit is contained in:
parent
7adaaf99be
commit
bc32a3a706
25 changed files with 287 additions and 99 deletions
38
common/count_filter.h
Normal file
38
common/count_filter.h
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// File: count_filter.h //
|
||||
// Description: byte counting filter for wanproxy streams //
|
||||
// Project: WANProxy XTech //
|
||||
// Author: Andreu Vidal Bramfeld-Software //
|
||||
// Last modified: 2016-02-28 //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef COUNT_FILTER_H
|
||||
#define COUNT_FILTER_H
|
||||
|
||||
#include <common/types.h>
|
||||
#include <common/filter.h>
|
||||
|
||||
#define TO_BE_CONTINUED 1
|
||||
|
||||
class CountFilter : public Filter
|
||||
{
|
||||
private:
|
||||
Buffer header_;
|
||||
intmax_t& total_count_;
|
||||
intmax_t expected_;
|
||||
intmax_t count_;
|
||||
int state_;
|
||||
|
||||
public:
|
||||
CountFilter (intmax_t& p, int flg = 0);
|
||||
|
||||
virtual bool consume (Buffer& buf, int flg = 0);
|
||||
virtual void flush (int flg);
|
||||
|
||||
private:
|
||||
bool explore_stream (Buffer& buf);
|
||||
};
|
||||
|
||||
#endif // COUNT_FILTER_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue