Definitions common to HTTP client and server. More...
#include "core/net.h"
Go to the source code of this file.
Data Structures | |
struct | HttpParam |
Attribute-value pair. More... | |
Macros | |
#define | HTTP_PORT 80 |
#define | HTTPS_PORT 443 |
#define | HTTP_STATUS_CODE_1YZ(code) ((code) >= 100 && (code) < 200) |
#define | HTTP_STATUS_CODE_2YZ(code) ((code) >= 200 && (code) < 300) |
#define | HTTP_STATUS_CODE_3YZ(code) ((code) >= 300 && (code) < 400) |
#define | HTTP_STATUS_CODE_4YZ(code) ((code) >= 400 && (code) < 500) |
#define | HTTP_STATUS_CODE_5YZ(code) ((code) >= 500 && (code) < 600) |
Functions | |
error_t | httpCheckCharset (const char_t *s, size_t length, uint_t charset) |
Check whether a string contains valid characters. More... | |
error_t | httpParseParam (const char_t **pos, HttpParam *param) |
Parse a list of parameters. More... | |
bool_t | httpCompareParamName (const HttpParam *param, const char_t *name) |
Compare parameter name with the supplied string. More... | |
bool_t | httpCompareParamValue (const HttpParam *param, const char_t *value) |
Compare parameter name with the supplied string. More... | |
error_t | httpCopyParamValue (const HttpParam *param, char_t *value, size_t maxLen) |
Copy the value of a parameter. More... | |
void | httpEncodeHexString (const uint8_t *input, size_t inputLen, char_t *output) |
Convert byte array to hex string. More... | |
Detailed Description
Definitions common to HTTP client and server.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneTCP Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version
- 2.4.4
Definition in file http_common.h.
Macro Definition Documentation
◆ HTTP_PORT
#define HTTP_PORT 80 |
Definition at line 38 of file http_common.h.
◆ HTTP_STATUS_CODE_1YZ
Definition at line 43 of file http_common.h.
◆ HTTP_STATUS_CODE_2YZ
Definition at line 44 of file http_common.h.
◆ HTTP_STATUS_CODE_3YZ
Definition at line 45 of file http_common.h.
◆ HTTP_STATUS_CODE_4YZ
Definition at line 46 of file http_common.h.
◆ HTTP_STATUS_CODE_5YZ
Definition at line 47 of file http_common.h.
◆ HTTPS_PORT
#define HTTPS_PORT 443 |
Definition at line 40 of file http_common.h.
Enumeration Type Documentation
◆ HttpAuthMode
enum HttpAuthMode |
HTTP authentication schemes.
Enumerator | |
---|---|
HTTP_AUTH_MODE_NONE | |
HTTP_AUTH_MODE_BASIC | |
HTTP_AUTH_MODE_DIGEST |
Definition at line 71 of file http_common.h.
◆ HttpAuthQop
enum HttpAuthQop |
Quality of protection (digest authentication)
Enumerator | |
---|---|
HTTP_AUTH_QOP_NONE | |
HTTP_AUTH_QOP_AUTH | |
HTTP_AUTH_QOP_AUTH_INT |
Definition at line 83 of file http_common.h.
◆ HttpCharset
enum HttpCharset |
HTTP character sets.
Enumerator | |
---|---|
HTTP_CHARSET_OCTET | |
HTTP_CHARSET_CTL | |
HTTP_CHARSET_LWS | |
HTTP_CHARSET_ALPHA | |
HTTP_CHARSET_DIGIT | |
HTTP_CHARSET_HEX | |
HTTP_CHARSET_VCHAR | |
HTTP_CHARSET_TCHAR | |
HTTP_CHARSET_TEXT | |
HTTP_CHARSET_OBS_TEXT |
Definition at line 137 of file http_common.h.
◆ HttpFlags
enum HttpFlags |
Flags used by I/O functions.
Enumerator | |
---|---|
HTTP_FLAG_WAIT_ALL | |
HTTP_FLAG_BREAK_CHAR | |
HTTP_FLAG_BREAK_CRLF | |
HTTP_FLAG_NO_DELAY | |
HTTP_FLAG_DELAY |
Definition at line 95 of file http_common.h.
◆ HttpRequestState
enum HttpRequestState |
HTTP request states.
Definition at line 109 of file http_common.h.
◆ HttpVersion
enum HttpVersion |
HTTP version numbers.
Enumerator | |
---|---|
HTTP_VERSION_0_9 | |
HTTP_VERSION_1_0 | |
HTTP_VERSION_1_1 |
Definition at line 59 of file http_common.h.
Function Documentation
◆ httpCheckCharset()
Check whether a string contains valid characters.
- Parameters
-
[in] s Pointer to the string [in] length Length of the string [in] charset Acceptable charset
- Returns
- Error code
Definition at line 49 of file http_common.c.
◆ httpCompareParamName()
Compare parameter name with the supplied string.
- Parameters
-
[in] param Pointer to the parameter [in] name NULL-terminated string
- Returns
- Comparison result
Definition at line 368 of file http_common.c.
◆ httpCompareParamValue()
Compare parameter name with the supplied string.
- Parameters
-
[in] param Pointer to the parameter [in] value NULL-terminated string
- Returns
- Comparison result
Definition at line 401 of file http_common.c.
◆ httpCopyParamValue()
Copy the value of a parameter.
- Parameters
-
[in] param Pointer to the parameter [out] value Pointer to the buffer where to copy the parameter value [out] maxLen Maximum number of characters the buffer can hold
- Returns
- Error code
Definition at line 435 of file http_common.c.
◆ httpEncodeHexString()
void httpEncodeHexString | ( | const uint8_t * | input, |
size_t | inputLen, | ||
char_t * | output | ||
) |
Convert byte array to hex string.
- Parameters
-
[in] input Point to the byte array [in] inputLen Length of the byte array [out] output NULL-terminated string resulting from the conversion
Definition at line 475 of file http_common.c.
◆ httpParseParam()
Parse a list of parameters.
- Parameters
-
[in,out] pos Actual position if the list of parameters [out] param Structure that contains the parameter name and value
- Returns
- Error code
Definition at line 117 of file http_common.c.