[asterisk-commits] russell: branch russell/ais r80931 - in /team/russell/ais: include/asterisk/ ...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sun Aug 26 00:22:09 CDT 2007
Author: russell
Date: Sun Aug 26 00:22:08 2007
New Revision: 80931
URL: http://svn.digium.com/view/asterisk?view=rev&rev=80931
Log:
more adding of ast_ to public API stuff
Modified:
team/russell/ais/include/asterisk/server.h
team/russell/ais/main/http.c
team/russell/ais/main/manager.c
team/russell/ais/main/server.c
Modified: team/russell/ais/include/asterisk/server.h
URL: http://svn.digium.com/view/asterisk/team/russell/ais/include/asterisk/server.h?view=diff&rev=80931&r1=80930&r2=80931
==============================================================================
--- team/russell/ais/include/asterisk/server.h (original)
+++ team/russell/ais/include/asterisk/server.h Sun Aug 26 00:22:08 2007
@@ -25,7 +25,7 @@
* 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)
+ * and then run ast_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()
@@ -37,7 +37,7 @@
*
* \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 the source files that processes it. Similarly, ssl_setup() should
+ * and the source files that processes it. Similarly, ast_ssl_setup() should
* be run earlier in the startup process so modules have it available.
*
*/
@@ -73,13 +73,13 @@
* The following code implements a generic mechanism for starting
* services on a TCP or TLS socket.
* The service is configured in the struct ast_server_args, and
- * then started by calling server_start(desc) on the descriptor.
- * server_start() first verifies if an instance of the service is active,
+ * then started by calling ast_server_start(desc) on the descriptor.
+ * ast_server_start() first verifies if an instance of the service is active,
* and in case shuts it down. Then, if the service must be started, creates
* a socket and a thread in charge of doing the accept().
*
* The body of the thread is desc->accept_fn(desc), which the user can define
- * freely. We supply a sample implementation, server_root(), structured as an
+ * freely. We supply a sample implementation, ast_server_root(), structured as an
* infinite loop. At the beginning of each iteration it runs periodic_fn()
* if defined (e.g. to perform some cleanup etc.) then issues a poll()
* or equivalent with a timeout of 'poll_timeout' milliseconds, and if the
@@ -96,7 +96,7 @@
* we need to do the following:
* + move struct server_instance and struct ast_server_args to
* a common header file, together with prototypes for
- * server_start() and server_root().
+ * ast_server_start() and ast_server_root().
*/
/*!
@@ -106,7 +106,7 @@
FILE *f; /* fopen/funopen result */
int fd; /* the socket returned by accept() */
SSL *ssl; /* ssl state */
-// iint (*ssl_setup)(SSL *);
+// iint (*ast_ssl_setup)(SSL *);
int client;
struct sockaddr_in requestor;
struct ast_server_args *parent;
@@ -130,9 +130,9 @@
struct server_instance *client_start(struct ast_server_args *desc);
-void *server_root(void *);
-void server_start(struct ast_server_args *desc);
-int ssl_setup(struct ast_tls_config *cfg);
+void *ast_server_root(void *);
+void ast_server_start(struct ast_server_args *desc);
+int ast_ssl_setup(struct ast_tls_config *cfg);
void *ast_make_file_from_fd(void *data);
Modified: team/russell/ais/main/http.c
URL: http://svn.digium.com/view/asterisk/team/russell/ais/main/http.c?view=diff&rev=80931&r1=80930&r2=80931
==============================================================================
--- team/russell/ais/main/http.c (original)
+++ team/russell/ais/main/http.c Sun Aug 26 00:22:08 2007
@@ -82,7 +82,7 @@
.tls_cfg = NULL,
.poll_timeout = -1,
.name = "http server",
- .accept_fn = server_root,
+ .accept_fn = ast_server_root,
.worker_fn = httpd_helper_thread,
};
@@ -92,7 +92,7 @@
.tls_cfg = &http_tls_cfg,
.poll_timeout = -1,
.name = "https server",
- .accept_fn = server_root,
+ .accept_fn = ast_server_root,
.worker_fn = httpd_helper_thread,
};
@@ -1030,9 +1030,9 @@
if (strcmp(prefix, newprefix))
ast_copy_string(prefix, newprefix, sizeof(prefix));
enablestatic = newenablestatic;
- server_start(&http_desc);
- if (ssl_setup(https_desc.tls_cfg))
- server_start(&https_desc);
+ ast_server_start(&http_desc);
+ if (ast_ssl_setup(https_desc.tls_cfg))
+ ast_server_start(&https_desc);
return 0;
}
Modified: team/russell/ais/main/manager.c
URL: http://svn.digium.com/view/asterisk/team/russell/ais/main/manager.c?view=diff&rev=80931&r1=80930&r2=80931
==============================================================================
--- team/russell/ais/main/manager.c (original)
+++ team/russell/ais/main/manager.c Sun Aug 26 00:22:08 2007
@@ -3220,7 +3220,7 @@
static int registered = 0;
static int webregged = 0;
-/*! \brief cleanup code called at each iteration of server_root,
+/*! \brief cleanup code called at each iteration of ast_server_root,
* guaranteed to happen every 5 seconds at most
*/
static void purge_old_stuff(void *data)
@@ -3237,7 +3237,7 @@
.poll_timeout = 5000, /* wake up every 5 seconds */
.periodic_fn = purge_old_stuff,
.name = "AMI server",
- .accept_fn = server_root, /* thread doing the accept() */
+ .accept_fn = ast_server_root, /* thread doing the accept() */
.worker_fn = session_do, /* thread handling the session */
};
@@ -3247,7 +3247,7 @@
.tls_cfg = &ami_tls_cfg,
.poll_timeout = -1, /* the other does the periodic cleanup */
.name = "AMI TLS server",
- .accept_fn = server_root, /* thread doing the accept() */
+ .accept_fn = ast_server_root, /* thread doing the accept() */
.worker_fn = session_do, /* thread handling the session */
};
@@ -3476,9 +3476,9 @@
if (newhttptimeout > 0)
httptimeout = newhttptimeout;
- server_start(&ami_desc);
- if (ssl_setup(amis_desc.tls_cfg))
- server_start(&amis_desc);
+ ast_server_start(&ami_desc);
+ if (ast_ssl_setup(amis_desc.tls_cfg))
+ ast_server_start(&amis_desc);
return 0;
}
Modified: team/russell/ais/main/server.c
URL: http://svn.digium.com/view/asterisk/team/russell/ais/main/server.c?view=diff&rev=80931&r1=80930&r2=80931
==============================================================================
--- team/russell/ais/main/server.c (original)
+++ team/russell/ais/main/server.c Sun Aug 26 00:22:08 2007
@@ -74,7 +74,7 @@
}
#endif /* DO_SSL */
-void *server_root(void *data)
+void *ast_server_root(void *data)
{
struct ast_server_args *desc = data;
int fd;
@@ -123,7 +123,7 @@
int client_setup(struct ast_tls_config *);
-int ssl_setup(struct ast_tls_config *cfg)
+int ast_ssl_setup(struct ast_tls_config *cfg)
{
#ifndef DO_SSL
cfg->enabled = 0;
@@ -251,7 +251,7 @@
* accept().
*/
-void server_start(struct ast_server_args *desc)
+void ast_server_start(struct ast_server_args *desc)
{
int flags;
int x = 1;
@@ -322,7 +322,7 @@
void *ast_make_file_from_fd(void *data)
{
struct server_instance *ser = data;
- int (*ssl_setup)(SSL *) = (ser->client) ? SSL_connect : SSL_accept;
+ int (*ast_ssl_setup)(SSL *) = (ser->client) ? SSL_connect : SSL_accept;
int ret;
char err[256];
@@ -334,7 +334,7 @@
#ifdef DO_SSL
else if ( (ser->ssl = SSL_new(ser->parent->tls_cfg->ssl_ctx)) ) {
SSL_set_fd(ser->ssl, ser->fd);
- if ((ret = ssl_setup(ser->ssl)) <= 0) {
+ if ((ret = ast_ssl_setup(ser->ssl)) <= 0) {
if(option_verbose > 1)
ast_verbose(VERBOSE_PREFIX_2 "Problem setting up ssl connection: %s\n", ERR_error_string(ERR_get_error(), err));
} else {
More information about the asterisk-commits
mailing list