Dependents:   Nucleo

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers http_server_misc.h Source File

http_server_misc.h

Go to the documentation of this file.
00001 /**
00002  * @file http_server_misc.h
00003  * @brief HTTP server (miscellaneous functions)
00004  *
00005  * @section License
00006  *
00007  * Copyright (C) 2010-2017 Oryx Embedded SARL. All rights reserved.
00008  *
00009  * This file is part of CycloneTCP Open.
00010  *
00011  * This program is free software; you can redistribute it and/or
00012  * modify it under the terms of the GNU General Public License
00013  * as published by the Free Software Foundation; either version 2
00014  * of the License, or (at your option) any later version.
00015  *
00016  * This program 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
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program; if not, write to the Free Software Foundation,
00023  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00024  *
00025  * @author Oryx Embedded SARL (www.oryx-embedded.com)
00026  * @version 1.7.6
00027  **/
00028 
00029 #ifndef _HTTP_SERVER_MISC_H
00030 #define _HTTP_SERVER_MISC_H
00031 
00032 //Dependencies
00033 #include "http/http_server.h"
00034 
00035 //HTTP server related functions
00036 error_t httpReadRequestHeader(HttpConnection *connection);
00037 error_t httpParseRequestLine(HttpConnection *connection, char_t *requestLine);
00038 
00039 error_t httpReadHeaderField(HttpConnection *connection,
00040    char_t *buffer, size_t size, char_t *firstChar);
00041 
00042 void httpParseHeaderField(HttpConnection *connection,
00043    const char_t *name, char_t *value);
00044 
00045 void httpParseConnectionField(HttpConnection *connection,
00046    char_t *value);
00047 
00048 void httpParseContentTypeField(HttpConnection *connection,
00049    char_t *value);
00050 
00051 error_t httpReadChunkSize(HttpConnection *connection);
00052 
00053 void httpInitResponseHeader(HttpConnection *connection);
00054 error_t httpFormatResponseHeader(HttpConnection *connection, char_t *buffer);
00055 
00056 error_t httpSend(HttpConnection *connection,
00057    const void *data, size_t length, uint_t flags);
00058 
00059 error_t httpReceive(HttpConnection *connection,
00060    void *data, size_t size, size_t *received, uint_t flags);
00061 
00062 void httpGetAbsolutePath(HttpConnection *connection,
00063    const char_t *relative, char_t *absolute, size_t maxLen);
00064 
00065 bool_t httpCompExtension(const char_t *filename, const char_t *extension);
00066 
00067 error_t httpDecodePercentEncodedString(const char_t *input,
00068    char_t *output, size_t outputSize);
00069 
00070 void httpConvertArrayToHexString(const uint8_t *input,
00071    size_t inputLength, char_t *output);
00072 
00073 #endif
00074