|
unbound 0.1
|
HTTP1.1/SSL server. More...
#include "config.h"#include <openssl/x509.h>#include <openssl/pem.h>#include <ctype.h>#include <signal.h>Functions | |
| static void | usage (void) |
| Give petal usage, and exit (1). | |
| static void | print_exit (const char *str) |
| fatal exit | |
| static void | log_errno (const char *str) |
| print errno | |
| static int | parse_ip_addr (char *str, int port, struct sockaddr_storage *ret, socklen_t *l) |
| parse a text IP address into a sockaddr | |
| static void | fd_close (int fd) |
| close the fd | |
| static int | read_ssl_line (SSL *ssl, char *buf, size_t len) |
| Read one line from SSL zero terminates. | |
| static int | process_one_header (char *buf, char *file, size_t flen, char *host, size_t hlen, int *vs) |
| process one http header | |
| static int | read_http_headers (SSL *ssl, char *file, size_t flen, char *host, size_t hlen, int *vs) |
| read http headers and process them | |
| static SSL_CTX * | setup_ctx (char *key, char *cert) |
| setup SSL context | |
| static int | setup_fd (char *addr, int port) |
| setup listening TCP | |
| static SSL * | setup_ssl (int s, SSL_CTX *ctx) |
| setup SSL connection to the client | |
| static int | file_name_is_safe (char *s) |
| check a file name for safety | |
| static void | adjust_host (char *host) |
| adjust host | |
| static void | adjust_file (char *file) |
| adjust filename | |
| static int | host_name_is_safe (char *s) |
| check a host name for safety | |
| static void | provide_file_10 (SSL *ssl, char *fname) |
| provide file in whole transfer | |
| static void | provide_file_chunked (SSL *ssl, char *fname) |
| provide file over SSL, chunked encoding | |
| static void | service_ssl (SSL *ssl, struct sockaddr_storage *from, socklen_t falen) |
| provide service to the ssl descriptor | |
| static void | do_service (char *addr, int port, char *key, char *cert) |
| provide ssl service | |
| int | main (int argc, char *argv[]) |
| Main routine for petal. | |
Variables | |
| static int | verb = 0 |
| verbosity for this application | |
| int | optind |
| getopt global, in case header files fail to declare it. | |
| char * | optarg |
| getopt global, in case header files fail to declare it. | |
HTTP1.1/SSL server.
|
static |
Give petal usage, and exit (1).
References usage().
|
static |
fatal exit
References print_exit().
Referenced by do_service(), parse_ip_addr(), print_exit(), and setup_ctx().
|
static |
|
static |
parse a text IP address into a sockaddr
References parse_ip_addr(), and print_exit().
|
static |
close the fd
References fd_close().
|
static |
Read one line from SSL zero terminates.
skips "\r\n" (but not copied to buf).
| ssl | the SSL connection to read from (blocking). |
| buf | buffer to return line in. |
| len | size of the buffer. |
References read_ssl_line(), and verb.
|
static |
process one http header
References process_one_header().
|
static |
read http headers and process them
References process_one_header(), read_http_headers(), read_ssl_line(), and verb.
|
static |
setup SSL context
References print_exit(), setup_ctx(), and verb.
|
static |
setup listening TCP
References fd_close(), log_errno(), parse_ip_addr(), and setup_fd().
Referenced by do_service(), and setup_fd().
|
static |
setup SSL connection to the client
References setup_ssl().
|
static |
check a file name for safety
References file_name_is_safe().
Referenced by file_name_is_safe(), and service_ssl().
|
static |
|
static |
|
static |
check a host name for safety
References host_name_is_safe().
Referenced by host_name_is_safe(), and service_ssl().
|
static |
provide file in whole transfer
References provide_file_10().
Referenced by provide_file_10(), and service_ssl().
|
static |
provide file over SSL, chunked encoding
References provide_file_chunked(), and verb.
Referenced by provide_file_chunked(), and service_ssl().
|
static |
provide service to the ssl descriptor
References adjust_file(), adjust_host(), file_name_is_safe(), host_name_is_safe(), provide_file_10(), provide_file_chunked(), read_http_headers(), service_ssl(), and verb.
Referenced by do_service(), and service_ssl().
|
static |
provide ssl service
References do_service(), fd_close(), log_errno(), print_exit(), service_ssl(), setup_ctx(), setup_fd(), setup_ssl(), and verb.
Referenced by do_service(), and main().