00001 /*************************************************************************** 00002 * Copyright (C) 2005 by Benjamin Hadorn (bhadorn@swissinfo.org) * 00003 *************************************************************************** 00004 * Projekt : Zeus 00005 * Module : HTTPDefines 00006 * Package : Protocols 00007 * Author : Benjamin Hadorn 00008 * Datum : $Date: 20.02.07 10:18 $ 00009 * Ablage : $File$ 00010 * System : Cell Computing Model 00011 *************************************************************************** 00012 * Licence: * 00013 * This library is free software; you can redistribute it and/or modify * 00014 * it under the terms of the GNU Lesser General Public License as * 00015 * published by the Free Software Foundation; either version * 00016 * 2.1 of the License, or (at your option) any later version. * 00017 * * 00018 * This library is distributed in the hope that it will be useful, * 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00021 * GNU Lesser General Public License for more details. * 00022 * * 00023 * You should have received a copy of the GNU Lesser General Public * 00024 * License along with this library; if not, write to the Free Software * 00025 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA * 00026 ***************************************************************************/ 00027 00028 /*************************************************************************** 00029 Changes : 00030 $Log: /WinSteuerung2/dev/Zeus/src/zeusbase/Net/Protocols/HTTPDefines.hpp $ 00031 ** 00032 ** 3 20.02.07 10:18 bha 00033 ** Ueberarbeiten von ICAST's 00034 ***************************************************************************/ 00035 00036 #ifndef HTTPDefinesHPP 00037 #define HTTPDefinesHPP 00038 00039 #include <zeusbase/System/ZObject.h> 00040 #include <zeusbase/System/Queue.hpp> 00041 00042 /***********************************************************************/ 00043 /* Used internally by the Scanner 00044 */ 00045 /***********************************************************************/ 00046 #define HTTP_TOKEN_DATA 0 00047 #define HTTP_TOKEN_NEWLINE 1 00048 #define HTTP_TOKEN_SPACE 2 00049 #define HTTP_TOKEN_TAB 3 00050 00051 #define HTTPSCAN_STATE_HEADER 0 00052 #define HTTPSCAN_STATE_BODY 1 00053 #define HTTPSCAN_STATE_END 2 00054 #define HTTPSCAN_STATE_ERROR 3 00055 00056 00057 #define HTTPPARSE_STATE_PROTOCOL 0 00058 #define HTTPPARSE_STATE_STATUSCODE 1 00059 #define HTTPPARSE_STATE_STATUSTEXT 2 00060 #define HTTPPARSE_STATE_HEADER_START 3 00061 #define HTTPPARSE_STATE_HEADER 4 00062 #define HTTPPARSE_STATE_HEADER_CONT 5 00063 #define HTTPPARSE_STATE_BODY 6 00064 #define HTTPPARSE_STATE_METHOD 7 00065 #define HTTPPARSE_STATE_RESSOURCE 8 00066 #define HTTPPARSE_STATE_ERROR 9 00067 00068 00069 BEGIN_NAMESPACE_Zeus 00070 00071 /***************************************************************************/ 00074 /***************************************************************************/ 00075 class THTTProtocol : public TZObject 00076 { 00077 public: 00078 00079 /**********************************************************************/ 00082 /**********************************************************************/ 00083 enum EResponseState 00084 { 00085 /*HTTP 1.0*/ 00086 etOK = 200, //OK 00087 etCreated = 201, //Created 00088 etAccepted = 202, //Accepted 00089 etNoContent =204, //No Content 00090 etMovedPermanently = 301, //Moved Permanently 00091 etMovedTemporarily = 302, //Moved Temporarily 00092 etNotModified = 304, //Not Modified 00093 etBadRequest = 400, //Bad Request 00094 etUnauthorized = 401, //Unauthorized 00095 etForbidden = 403, //Forbidden 00096 etNotFound = 404, //Not Found 00097 etInternalServerError = 500, //Internal Server Error 00098 etNotImplemented = 501, //Not Implemented 00099 etBadGateway = 502, //Bad Gateway 00100 etServiceUnavailable = 503, //Service Unavailable 00101 00102 /*HTTP 1.1*/ 00103 etSeeOther = 303 00104 }; 00105 00106 /**********************************************************************/ 00109 /**********************************************************************/ 00110 enum ERequestMethod 00111 { 00112 /*Base methods of HTTP 1.0*/ 00113 etGetMethod = 0, 00114 etPostMethod = 1, 00115 etHeadMethod = 2, 00116 00117 /*Additional features of HTTP 1.0*/ 00118 etPutMethod = 3, 00119 etDeleteMethod = 4, 00120 etLinkMethod = 5, 00121 etUnlinkMethod = 6 00122 }; 00123 00124 /***************************************************************************/ 00127 /***************************************************************************/ 00128 enum EHTTPVersion 00129 { 00130 etVersion_1_0 = 0, 00131 etVersion_1_1 = 1 00132 }; 00133 }; 00134 00135 END_NAMESPACE_Zeus 00136 00137 #endif