nl_http.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  $RCSfile$
00003                              -------------------
00004     cvs         : $Id: nl_http.h 978 2006-02-03 17:41:49Z aquamaniac $
00005     begin       : Sat Jan 24 2004
00006     copyright   : (C) 2004 by Martin Preuss
00007     email       : martin@libchipcard.de
00008 
00009  ***************************************************************************
00010  *                                                                         *
00011  *   This library is free software; you can redistribute it and/or         *
00012  *   modify it under the terms of the GNU Lesser General Public            *
00013  *   License as published by the Free Software Foundation; either          *
00014  *   version 2.1 of the License, or (at your option) any later version.    *
00015  *                                                                         *
00016  *   This library is distributed in the hope that it will be useful,       *
00017  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00018  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00019  *   Lesser General Public License for more details.                       *
00020  *                                                                         *
00021  *   You should have received a copy of the GNU Lesser General Public      *
00022  *   License along with this library; if not, write to the Free Software   *
00023  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,                 *
00024  *   MA  02111-1307  USA                                                   *
00025  *                                                                         *
00026  ***************************************************************************/
00027 
00028 
00029 #ifndef GWEN_NL_HTTP_H
00030 #define GWEN_NL_HTTP_H
00031 
00032 #include <gwenhywfar/netlayer.h>
00033 #include <gwenhywfar/inetsocket.h>
00034 #include <gwenhywfar/db.h>
00035 #include <gwenhywfar/url.h>
00036 
00037 
00038 #define GWEN_NL_HTTP_NAME "Http"
00039 
00040 
00041 /*
00042  * This module handles the HTTP protocol.
00043  * When reading the body of an HTTP message the transfer encoding type
00044  * "chunked" is automatically detected and handled transparently.
00045  */
00046 
00047 
00051 #define GWEN_NL_HTTP_FLAGS_IPC   0x00000001
00052 
00053 
00054 typedef enum {
00055   GWEN_NetLayerHttpVersion_1_0=0,
00056   GWEN_NetLayerHttpVersion_1_1
00057 } GWEN_NETLAYER_HTTP_VERSION;
00058 
00059 
00060 GWENHYWFAR_API
00061 GWEN_NETLAYER *GWEN_NetLayerHttp_new(GWEN_NETLAYER *baseLayer);
00062 
00063 
00064 
00065 GWENHYWFAR_API
00066 void GWEN_NetLayerHttp_SetOutCommand(GWEN_NETLAYER *nl,
00067                                      const char *command,
00068                                      const GWEN_URL *url);
00069 
00070 GWENHYWFAR_API
00071 void GWEN_NetLayerHttp_SetOutStatus(GWEN_NETLAYER *nl,
00072                                     int code,
00073                                     const char *text);
00074 
00075 GWENHYWFAR_API
00076 GWEN_DB_NODE *GWEN_NetLayerHttp_GetOutHeader(const GWEN_NETLAYER *nl);
00077 
00078 GWENHYWFAR_API
00079 GWEN_DB_NODE *GWEN_NetLayerHttp_GetInHeader(const GWEN_NETLAYER *nl);
00080 
00081 GWENHYWFAR_API
00082 int GWEN_NetLayerHttp_GetInStatusCode(const GWEN_NETLAYER *nl);
00083 
00084 GWENHYWFAR_API
00085 const char *GWEN_NetLayerHttp_GetInStatusText(const GWEN_NETLAYER *nl);
00086 
00087 
00088 GWENHYWFAR_API
00089 void GWEN_NetLayerHttp_SetHttpVersion(GWEN_NETLAYER *nl,
00090                                       GWEN_NETLAYER_HTTP_VERSION v);
00091 
00092 GWENHYWFAR_API
00093 GWEN_NETLAYER_HTTP_VERSION
00094   GWEN_NetLayerHttp_GetHttpVersion(const GWEN_NETLAYER *nl);
00095 
00096 GWENHYWFAR_API
00097 int GWEN_NetLayerHttp_Request(GWEN_NETLAYER *nl,
00098                               const char *command,
00099                               const GWEN_URL *url,
00100                               GWEN_DB_NODE *dbHeader,
00101                               const char *pBody,
00102                               int lBody,
00103                               GWEN_BUFFEREDIO *bio);
00104 
00105 #endif /* GWEN_NL_HTTP_H */
00106 
00107 

Generated on Thu Nov 9 22:06:49 2006 for gwenhywfar by  doxygen 1.5.1