mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-19 11:42:27 +00:00
Doxygen updates
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@51932 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -22,15 +22,14 @@
|
|||||||
#include "asterisk/config.h"
|
#include "asterisk/config.h"
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file http.h
|
* \file http.h
|
||||||
\brief Support for Private Asterisk HTTP Servers.
|
* \brief Support for Private Asterisk HTTP Servers.
|
||||||
\note Note: The Asterisk HTTP servers are extremely simple and minimal and
|
* \note Note: The Asterisk HTTP servers are extremely simple and minimal and
|
||||||
only support the "GET" method.
|
* only support the "GET" method.
|
||||||
\author Mark Spencer <markster@digium.com>
|
*
|
||||||
*/
|
* \author Mark Spencer <markster@digium.com>
|
||||||
|
*
|
||||||
/*!
|
* \note In order to have TLS/SSL support, we need the openssl libraries.
|
||||||
* In order to have TLS/SSL support, we need the openssl libraries.
|
|
||||||
* Still we can decide whether or not to use them by commenting
|
* Still we can decide whether or not to use them by commenting
|
||||||
* in or out the DO_SSL macro.
|
* in or out the DO_SSL macro.
|
||||||
* TLS/SSL support is basically implemented by reading from a config file
|
* TLS/SSL support is basically implemented by reading from a config file
|
||||||
@@ -42,11 +41,10 @@
|
|||||||
* on the socket, to do the necessary setup. At the moment the context's name
|
* on the socket, to do the necessary setup. At the moment the context's name
|
||||||
* is hardwired in the function, but we can certainly make it into an extra
|
* is hardwired in the function, but we can certainly make it into an extra
|
||||||
* parameter to the function.
|
* parameter to the function.
|
||||||
*
|
|
||||||
* We declare most of ssl support variables unconditionally,
|
* We declare most of ssl support variables unconditionally,
|
||||||
* because their number is small and this simplifies the code.
|
* because their number is small and this simplifies the code.
|
||||||
*
|
*
|
||||||
* NOTE: the ssl-support variables (ssl_ctx, do_ssl, certfile, cipher)
|
* \note: the ssl-support variables (ssl_ctx, do_ssl, certfile, cipher)
|
||||||
* and their setup should be moved to a more central place, e.g. asterisk.conf
|
* and their setup should be moved to a more central place, e.g. asterisk.conf
|
||||||
* and the source files that processes it. Similarly, ssl_setup() should
|
* and the source files that processes it. Similarly, ssl_setup() should
|
||||||
* be run earlier in the startup process so modules have it available.
|
* be run earlier in the startup process so modules have it available.
|
||||||
@@ -65,7 +63,7 @@ typedef struct {} SSL;
|
|||||||
typedef struct {} SSL_CTX;
|
typedef struct {} SSL_CTX;
|
||||||
#endif /* DO_SSL */
|
#endif /* DO_SSL */
|
||||||
|
|
||||||
/* SSL support */
|
/*! SSL support */
|
||||||
#define AST_CERTFILE "asterisk.pem"
|
#define AST_CERTFILE "asterisk.pem"
|
||||||
|
|
||||||
struct tls_config {
|
struct tls_config {
|
||||||
@@ -137,13 +135,16 @@ void *server_root(void *);
|
|||||||
void server_start(struct server_args *desc);
|
void server_start(struct server_args *desc);
|
||||||
int ssl_setup(struct tls_config *cfg);
|
int ssl_setup(struct tls_config *cfg);
|
||||||
|
|
||||||
/*! \brief HTTP Callbacks take the socket, the method and the path as arguments and should
|
/*! \brief HTTP Callbacks take the socket
|
||||||
|
|
||||||
|
\note The method and the path as arguments and should
|
||||||
return the content, allocated with malloc(). Status should be changed to reflect
|
return the content, allocated with malloc(). Status should be changed to reflect
|
||||||
the status of the request if it isn't 200 and title may be set to a malloc()'d string
|
the status of the request if it isn't 200 and title may be set to a malloc()'d string
|
||||||
to an appropriate title for non-200 responses. Content length may also be specified.
|
to an appropriate title for non-200 responses. Content length may also be specified.
|
||||||
The return value may include additional headers at the front and MUST include a blank
|
The return value may include additional headers at the front and MUST include a blank
|
||||||
line with \r\n to provide separation between user headers and content (even if no
|
line with \r\n to provide separation between user headers and content (even if no
|
||||||
content is specified) */
|
content is specified)
|
||||||
|
*/
|
||||||
typedef struct ast_str *(*ast_http_callback)(struct sockaddr_in *requestor, const char *uri, struct ast_variable *params, int *status, char **title, int *contentlength);
|
typedef struct ast_str *(*ast_http_callback)(struct sockaddr_in *requestor, const char *uri, struct ast_variable *params, int *status, char **title, int *contentlength);
|
||||||
|
|
||||||
struct ast_http_uri {
|
struct ast_http_uri {
|
||||||
|
24
main/http.c
24
main/http.c
@@ -58,24 +58,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
|||||||
#define MAX_PREFIX 80
|
#define MAX_PREFIX 80
|
||||||
#define DEFAULT_PREFIX "/asterisk"
|
#define DEFAULT_PREFIX "/asterisk"
|
||||||
|
|
||||||
/*!
|
/* See http.h for more information about the SSL implementation */
|
||||||
* In order to have TLS/SSL support, we need the openssl libraries.
|
|
||||||
* Still we can decide whether or not to use them by commenting
|
|
||||||
* in or out the DO_SSL macro.
|
|
||||||
* TLS/SSL support is basically implemented by reading from a config file
|
|
||||||
* (currently http.conf) the names of the certificate and cipher to use,
|
|
||||||
* and then run ssl_setup() to create an appropriate SSL_CTX (ssl_ctx)
|
|
||||||
* If we support multiple domains, presumably we need to read multiple
|
|
||||||
* certificates.
|
|
||||||
* When we are requested to open a TLS socket, we run make_file_from_fd()
|
|
||||||
* on the socket, to do the necessary setup. At the moment the context's name
|
|
||||||
* is hardwired in the function, but we can certainly make it into an extra
|
|
||||||
* parameter to the function.
|
|
||||||
*
|
|
||||||
* We declare most of ssl support variables unconditionally,
|
|
||||||
* because their number is small and this simplifies the code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if defined(HAVE_OPENSSL) && (defined(HAVE_FUNOPEN) || defined(HAVE_FOPENCOOKIE))
|
#if defined(HAVE_OPENSSL) && (defined(HAVE_FUNOPEN) || defined(HAVE_FOPENCOOKIE))
|
||||||
#define DO_SSL /* comment in/out if you want to support ssl */
|
#define DO_SSL /* comment in/out if you want to support ssl */
|
||||||
#endif
|
#endif
|
||||||
@@ -157,6 +140,7 @@ static char *uri_decode(char *buf)
|
|||||||
}
|
}
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct ast_str *static_callback(struct sockaddr_in *req, const char *uri, struct ast_variable *vars, int *status, char **title, int *contentlength)
|
static struct ast_str *static_callback(struct sockaddr_in *req, const char *uri, struct ast_variable *vars, int *status, char **title, int *contentlength)
|
||||||
{
|
{
|
||||||
struct ast_str *result;
|
struct ast_str *result;
|
||||||
@@ -298,7 +282,9 @@ struct ast_str *ast_http_error(int status, const char *title, const char *extra_
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief
|
/*! \brief
|
||||||
* Link the new uri into the list. They are sorted by length of
|
* Link the new uri into the list.
|
||||||
|
*
|
||||||
|
* They are sorted by length of
|
||||||
* the string, not alphabetically. Duplicate entries are not replaced,
|
* the string, not alphabetically. Duplicate entries are not replaced,
|
||||||
* but the insertion order (using <= and not just <) makes sure that
|
* but the insertion order (using <= and not just <) makes sure that
|
||||||
* more recent insertions hide older ones.
|
* more recent insertions hide older ones.
|
||||||
|
Reference in New Issue
Block a user