00001 // 00002 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software 00003 // Foundation, Inc 00004 // 00005 // This program is free software; you can redistribute it and/or modify 00006 // it under the terms of the GNU General Public License as published by 00007 // the Free Software Foundation; either version 3 of the License, or 00008 // (at your option) any later version. 00009 // 00010 // This program is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with this program; if not, write to the Free Software 00017 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00018 00019 #ifndef _PROTOCOL_H_ 00020 #define _PROTOCOL_H_ 00021 00022 #include <string> 00023 #include "network.h" 00024 00025 class Protocol : public gnash::Network { 00026 typedef enum { RTMP_PROTO, RTMPT_PROTO, RTMPS_PROTO, HTTP_PROTO, HTTPS_PROTO } protocol_type_e; 00027 public: 00028 Protocol() { }; 00029 virtual ~Protocol() { }; 00030 00031 virtual bool handShakeWait() = 0; 00032 virtual bool handShakeRequest() = 0; 00033 virtual bool handShakeResponse() = 0; 00034 virtual bool clientFinish() = 0; 00035 virtual bool serverFinish() = 0; 00036 virtual bool packetRequest() = 0; 00037 virtual bool packetSend() = 0; 00038 virtual bool packetRead() = 0; 00039 void resetBytesOut() { _outbytes = 0; }; 00040 int getBytesOut() { return _outbytes; }; 00041 void resetBytesIn() { _inbytes = 0; }; 00042 int getBytesIn() { return _inbytes; }; 00043 private: 00044 std::string _name; 00045 protected: 00046 int _inbytes; 00047 int _outbytes; 00048 }; 00049 00050 // end of _PROTOCOL_H_ 00051 #endif 00052 00053 // local Variables: 00054 // mode: C++ 00055 // indent-tabs-mode: t 00056 // End: