Small fixups to Nicolas Vivien's bjavaloader patch
[barry.git] / src / pppfilter.h
blobb73f93be1a71c2cf6751f18d9f8f0092f4742b9b
1 ///
2 /// \file pppfilter.h
3 /// Data filter class, to morph PPP data into something that
4 /// the Blackberry / Rogers / ISP can handle.
5 /// This logic is based partly on XmBlackBerry's
6 /// gprs_protocol_fix.c program.
7 ///
9 /*
10 Copyright (C) 2008-2009, Net Direct Inc. (http://www.netdirect.ca/)
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 See the GNU General Public License in the COPYING file at the
22 root directory of this project for more details.
25 #ifndef __BARRY_M_PPPFILTER_H__
26 #define __BARRY_M_PPPFILTER_H__
28 #include "dll.h"
29 #include "data.h"
31 namespace Barry {
33 class BXEXPORT PppFilter
35 private:
36 Data m_writeBuf; // used for 0x7e handling
38 // write flags
39 bool m_ppp_mode;
40 unsigned char m_last;
42 BXLOCAL const Data& GetBuffer() const; // not implemented, since
43 // Write can return either m_writeBuf or data, and
44 // so this would be useless and unsafe
46 BXLOCAL void Filter(Data &dest, const Data &src, unsigned int destoffset);
48 public:
49 PppFilter();
51 bool PppMode() const { return m_ppp_mode; }
52 const Data& Write(const Data &data);
53 Data& Write(const Data &data, unsigned int prepend);
56 } // namespace Barry
58 #endif