|
iPXE
|
Hyper Text Transport Protocol. More...
#include <stdint.h>#include <ipxe/refcnt.h>#include <ipxe/interface.h>#include <ipxe/iobuf.h>#include <ipxe/process.h>#include <ipxe/retry.h>#include <ipxe/linebuf.h>#include <ipxe/pool.h>#include <ipxe/tables.h>#include <ipxe/ntlm.h>Go to the source code of this file.
Data Structures | |
| struct | http_scheme |
| An HTTP URI scheme. More... | |
| struct | http_connection |
| An HTTP connection. More... | |
| struct | http_method |
| An HTTP method. More... | |
| struct | http_request_range |
| HTTP request range descriptor. More... | |
| struct | http_request_content |
| HTTP request content descriptor. More... | |
| struct | http_request_auth_basic |
| HTTP request Basic authentication descriptor. More... | |
| struct | http_request_auth_digest |
| HTTP request Digest authentication descriptor. More... | |
| struct | http_request_auth_ntlm |
| HTTP request NTLM authentication descriptor. More... | |
| struct | http_request_auth |
| HTTP request authentication descriptor. More... | |
| struct | http_request |
| An HTTP request. More... | |
| struct | http_request_header |
| An HTTP request header. More... | |
| struct | http_response_transfer |
| HTTP response transfer descriptor. More... | |
| struct | http_response_content |
| HTTP response content descriptor. More... | |
| struct | http_response_auth_basic |
| HTTP response Basic authorization descriptor. More... | |
| struct | http_response_auth_digest |
| HTTP response Digest authorization descriptor. More... | |
| struct | http_response_auth_ntlm |
| HTTP response NTLM authorization descriptor. More... | |
| struct | http_response_auth |
| HTTP response authorization descriptor. More... | |
| struct | http_response |
| An HTTP response. More... | |
| struct | http_response_header |
| An HTTP response header. More... | |
| struct | http_state |
| HTTP transaction state. More... | |
| struct | http_transaction |
| An HTTP transaction. More... | |
| struct | http_transfer_encoding |
| An HTTP transfer encoding. More... | |
| struct | http_content_encoding |
| An HTTP content encoding. More... | |
| struct | http_authentication |
| An HTTP authentication scheme. More... | |
Macros | |
| #define | HTTP_PORT 80 |
| HTTP default port. More... | |
| #define | HTTPS_PORT 443 |
| HTTPS default port. More... | |
| #define | HTTP_SCHEMES __table ( struct http_scheme, "http_schemes" ) |
| HTTP scheme table. More... | |
| #define | __http_scheme __table_entry ( HTTP_SCHEMES, 01 ) |
| Declare an HTTP scheme. More... | |
| #define | HTTP_DIGEST_NC "00000001" |
| HTTP Digest authentication client nonce count. More... | |
| #define | HTTP_DIGEST_CNONCE_LEN 8 |
| HTTP Digest authentication client nonce length. More... | |
| #define | HTTP_DIGEST_RESPONSE_LEN 32 |
| HTTP Digest authentication response length. More... | |
| #define | HTTP_REQUEST_HEADERS __table ( struct http_request_header, "http_request_headers" ) |
| HTTP request header table. More... | |
| #define | __http_request_header __table_entry ( HTTP_REQUEST_HEADERS, 01 ) |
| Declare an HTTP request header. More... | |
| #define | HTTP_RESPONSE_HEADERS __table ( struct http_response_header, "http_response_headers" ) |
| HTTP response header table. More... | |
| #define | __http_response_header __table_entry ( HTTP_RESPONSE_HEADERS, 01 ) |
| Declare an HTTP response header. More... | |
| #define | HTTP_TRANSFER_ENCODINGS __table ( struct http_transfer_encoding, "http_transfer_encodings" ) |
| HTTP transfer encoding table. More... | |
| #define | __http_transfer_encoding __table_entry ( HTTP_TRANSFER_ENCODINGS, 01 ) |
| Declare an HTTP transfer encoding. More... | |
| #define | HTTP_CONTENT_ENCODINGS __table ( struct http_content_encoding, "http_content_encodings" ) |
| HTTP content encoding table. More... | |
| #define | __http_content_encoding __table_entry ( HTTP_CONTENT_ENCODINGS, 01 ) |
| Declare an HTTP content encoding. More... | |
| #define | HTTP_AUTHENTICATIONS __table ( struct http_authentication, "http_authentications" ) |
| HTTP authentication scheme table. More... | |
| #define | __http_authentication __table_entry ( HTTP_AUTHENTICATIONS, 01 ) |
| Declare an HTTP authentication scheme. More... | |
Enumerations | |
| enum | http_response_flags { HTTP_RESPONSE_KEEPALIVE = 0x0001, HTTP_RESPONSE_CONTENT_LEN = 0x0002, HTTP_RESPONSE_RETRY = 0x0004 } |
| HTTP response flags. More... | |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| char * | http_token (char **line, char **value) |
| Get HTTP response token. More... | |
| int | http_connect (struct interface *xfer, struct uri *uri) |
| Connect to an HTTP server. More... | |
| int | http_open (struct interface *xfer, struct http_method *method, struct uri *uri, struct http_request_range *range, struct http_request_content *content) |
| Open HTTP transaction. More... | |
| int | http_open_uri (struct interface *xfer, struct uri *uri) |
| Open HTTP transaction for simple URI. More... | |
Variables | |
| struct http_method | http_head |
| HTTP HEAD method. More... | |
| struct http_method | http_get |
| HTTP GET method. More... | |
| struct http_method | http_post |
| HTTP POST method. More... | |
Hyper Text Transport Protocol.
Definition in file http.h.
| #define HTTP_SCHEMES __table ( struct http_scheme, "http_schemes" ) |
| #define __http_scheme __table_entry ( HTTP_SCHEMES, 01 ) |
| #define HTTP_DIGEST_NC "00000001" |
| #define HTTP_DIGEST_CNONCE_LEN 8 |
| #define HTTP_DIGEST_RESPONSE_LEN 32 |
| #define HTTP_REQUEST_HEADERS __table ( struct http_request_header, "http_request_headers" ) |
| struct http_request_header http_request_accept_encoding __http_request_header __table_entry ( HTTP_REQUEST_HEADERS, 01 ) |
| #define HTTP_RESPONSE_HEADERS __table ( struct http_response_header, "http_response_headers" ) |
| struct http_response_header http_response_retry_after __http_response_header __table_entry ( HTTP_RESPONSE_HEADERS, 01 ) |
| #define HTTP_TRANSFER_ENCODINGS __table ( struct http_transfer_encoding, "http_transfer_encodings" ) |
| #define __http_transfer_encoding __table_entry ( HTTP_TRANSFER_ENCODINGS, 01 ) |
| #define HTTP_CONTENT_ENCODINGS __table ( struct http_content_encoding, "http_content_encodings" ) |
| #define __http_content_encoding __table_entry ( HTTP_CONTENT_ENCODINGS, 01 ) |
| #define HTTP_AUTHENTICATIONS __table ( struct http_authentication, "http_authentications" ) |
| struct http_authentication http_ntlm_auth __http_authentication __table_entry ( HTTP_AUTHENTICATIONS, 01 ) |
| enum http_response_flags |
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
| char* http_token | ( | char ** | line, |
| char ** | value | ||
| ) |
Get HTTP response token.
| line | Line position |
| value | Token value to fill in (if any) |
| token | Token, or NULL |
Definition at line 195 of file httpcore.c.
References isspace(), NULL, token, and value.
Referenced by http_parse_connection(), http_parse_digest_auth(), http_parse_status(), and http_parse_www_authenticate().
Connect to an HTTP server.
| xfer | Data transfer interface |
| uri | Connection URI |
| rc | Return status code |
HTTP connections are pooled. The caller should be prepared to receive a pool_reopen() message.
Definition at line 236 of file httpconn.c.
References assert(), DBGC2, EINVAL, ENOMEM, ENOTSUP, http_scheme::filter, uri::host, htons, http_conn_close(), http_conn_expired(), http_conn_free(), http_conn_socket_desc, http_conn_xfer_desc, http_scheme(), intf_init(), intf_plug_plug(), list_for_each_entry_reverse, memset(), http_scheme::name, NULL, pool, http_connection::pool, pool_del(), port, http_scheme::port, rc, ref_init, ref_put, http_connection::refcnt, http_connection::scheme, SOCK_STREAM, http_connection::socket, sockaddr_tcpip::st_port, strcmp(), strerror(), http_connection::uri, uri_get(), uri_port(), http_connection::xfer, xfer_open_named_socket(), and zalloc().
Referenced by http_open(), and http_reopen().
| int http_open | ( | struct interface * | xfer, |
| struct http_method * | method, | ||
| struct uri * | uri, | ||
| struct http_request_range * | range, | ||
| struct http_request_content * | content | ||
| ) |
Open HTTP transaction.
| xfer | Data transfer interface |
| method | Request method |
| uri | Request URI |
| range | Content range (if any) |
| content | Request content (if any) |
| rc | Return status code |
Definition at line 641 of file httpcore.c.
References http_transaction::conn, http_request::content, http_transaction::content, http_request_content::data, DBGC, DBGC2, ENOMEM, uri::epath, uri::equery, format_uri(), uri::host, http_request::host, http_close(), http_conn_desc, http_connect(), http_content_desc, http_free(), http_process_desc, http_request, http_retry_expired(), http_transfer_desc, http_watchdog(), http_watchdog_expired(), http_xfer_desc, intf_init(), intf_plug_plug(), http_request_content::len, memcpy(), memset(), method, http_request::method, NULL, uri::port, http_transaction::process, process_init(), http_request::range, range, rc, ref_init, ref_put, http_transaction::refcnt, http_transaction::request, http_transaction::retry, uri::scheme, http_transaction::state, strerror(), http_transaction::transfer, http_request_content::type, http_request::uri, http_transaction::uri, uri_get(), http_transaction::watchdog, http_transaction::xfer, and zalloc().
Referenced by http_block_read(), http_block_read_capacity(), http_open_uri(), peerblk_raw_open(), and peerblk_retrieval_open().
Open HTTP transaction for simple URI.
| xfer | Data transfer interface |
| uri | Request URI |
| rc | Return status code |
Definition at line 1983 of file httpcore.c.
References assert(), data, http_request_content::data, ENOMEM, free, http_form_params(), http_get, http_open(), http_post, http_request_content::len, len, method, NULL, uri::params, rc, type, http_request_content::type, and zalloc().
| struct http_method http_head |
HTTP HEAD method.
Definition at line 138 of file httpcore.c.
Referenced by http_block_read_capacity(), and http_rx_headers().
| struct http_method http_get |
HTTP GET method.
Definition at line 143 of file httpcore.c.
Referenced by http_block_read(), http_open_uri(), and peerblk_raw_open().
| struct http_method http_post |
HTTP POST method.
Definition at line 148 of file httpcore.c.
Referenced by http_open_uri(), and peerblk_retrieval_open().
1.8.15