/* exported from network.c */
extern volatile int signal_requests_exit, signal_requests_reset;
void init_addr(krb5_fulladdr *, struct sockaddr *);
-krb5_error_code add_udp_port(int port);
-krb5_error_code add_tcp_port(int port);
-krb5_error_code add_rpc_service(int port, u_long prognum, u_long versnum,
- void (*dispatch)());
-krb5_error_code setup_network(void *handle, const char *prog, int no_reconfig);
-krb5_error_code listen_and_process(void *handle, const char *prog,
- void (*reset)(void));
-void closedown_network(void);
+krb5_error_code loop_add_udp_port(int port);
+krb5_error_code loop_add_tcp_port(int port);
+krb5_error_code loop_add_rpc_service(int port, u_long prognum, u_long versnum,
+ void (*dispatch)());
+krb5_error_code loop_setup_network(void *handle, const char *prog,
+ int no_reconfig);
+krb5_error_code loop_listen_and_process(void *handle, const char *prog,
+ void (*reset)(void));
+void loop_closedown_network(void);
/* to be supplied by the server application */
* The first, dispatch(), is for normal processing of a request. The
* second, make_toolong_error(), is obviously for generating an error
* to send back when the incoming message is bigger than
- * listen_and_process can accept.
+ * loop_listen_and_process can accept.
*/
krb5_error_code dispatch (void *handle,
struct sockaddr *local_addr,
}
#define server_handle ((kadm5_server_handle_t)global_server_handle)
- if ((ret = add_udp_port(server_handle->params.kpasswd_port))
- || (ret = add_tcp_port(server_handle->params.kpasswd_port))
- || (ret = add_rpc_service(server_handle->params.kadmind_port,
+ if ((ret = loop_add_udp_port(server_handle->params.kpasswd_port))
+ || (ret = loop_add_tcp_port(server_handle->params.kpasswd_port))
+ || (ret = loop_add_rpc_service(server_handle->params.kadmind_port,
KADM, KADMVERS, kadm_1))
#ifndef DISABLE_IPROP
|| (server_handle->params.iprop_enabled
- ? (ret = add_rpc_service(server_handle->params.iprop_port,
+ ? (ret = loop_add_rpc_service(server_handle->params.iprop_port,
KRB5_IPROP_PROG, KRB5_IPROP_VERS,
krb5_iprop_prog_1))
: 0)
#endif
#undef server_handle
- || (ret = setup_network(global_server_handle, whoami, 0))) {
+ || (ret = loop_setup_network(global_server_handle, whoami, 0))) {
const char *e_txt = krb5_get_error_message (context, ret);
krb5_klog_syslog(LOG_ERR, _("%s: %s while initializing network, "
"aborting"), whoami, e_txt);
if (nofork)
fprintf(stderr, _("%s: starting...\n"), whoami);
- listen_and_process(global_server_handle, whoami, reset_db);
+ loop_listen_and_process(global_server_handle, whoami, reset_db);
krb5_klog_syslog(LOG_INFO, _("finished, exiting"));
/* Clean up memory, etc */
svcauth_gssapi_unset_names();
kadm5_destroy(global_server_handle);
- closedown_network();
+ loop_closedown_network();
kadm5int_acl_finish(context, 0);
if(gss_changepw_name) {
(void) gss_release_name(&OMret, &gss_changepw_name);
port = strtol(cp, &cp, 10);
if (cp == 0)
break;
- retval = add_udp_port(port);
+ retval = loop_add_udp_port(port);
if (retval)
goto net_init_error;
}
port = strtol(cp, &cp, 10);
if (cp == 0)
break;
- retval = add_tcp_port(port);
+ retval = loop_add_tcp_port(port);
if (retval)
goto net_init_error;
}
* children won't be able to re-open the listener sockets. Hopefully our
* platform has pktinfo support and doesn't need reconfigs.
*/
- if ((retval = setup_network(NULL, kdc_progname, (workers > 0)))) {
+ if ((retval = loop_setup_network(NULL, kdc_progname, (workers > 0)))) {
net_init_error:
kdc_err(kcontext, retval, _("while initializing network"));
finish_realms();
krb5_klog_syslog(LOG_INFO, _("commencing operation"));
if (nofork)
fprintf(stderr, _("%s: starting...\n"), kdc_progname);
- if ((retval = listen_and_process(0, kdc_progname, reset_for_hangup))) {
+ if ((retval = loop_listen_and_process(0, kdc_progname, reset_for_hangup))) {
kdc_err(kcontext, retval, _("while processing network requests"));
errout++;
}
- closedown_network();
+ loop_closedown_network();
krb5_klog_syslog(LOG_INFO, _("shutting down"));
unload_preauth_plugins(kcontext);
unload_authdata_plugins(kcontext);
volatile int signal_requests_exit = 0, signal_requests_reset = 0;
-static void closedown_network_sockets(void);
+static void loop_closedown_network_sockets(void);
/* Misc utility routines. */
static void
static fd_set rpc_listenfds;
krb5_error_code
-add_udp_port(int port)
+loop_add_udp_port(int port)
{
int i;
void *tmp;
}
krb5_error_code
-add_tcp_port(int port)
+loop_add_tcp_port(int port)
{
int i;
void *tmp;
}
krb5_error_code
-add_rpc_service(int port, u_long prognum, u_long versnum, void (*dispatchfn)())
+loop_add_rpc_service(int port, u_long prognum,
+ u_long versnum, void (*dispatchfn)())
{
int i;
void *tmp;
extern void (*krb5int_sendtokdc_debug_handler)(const void*, size_t);
krb5_error_code
-setup_network(void *handle, const char *prog, int no_reconfig)
+loop_setup_network(void *handle, const char *prog, int no_reconfig)
{
struct socksetup setup_data;
}
krb5_error_code
-listen_and_process(void *handle, const char *prog, void (*reset)(void))
+loop_listen_and_process(void *handle, const char *prog, void (*reset)(void))
{
int nfound;
/* This struct contains 3 fd_set objects; on some platforms, they
}
if (sret == 0 && netchanged) {
network_reconfiguration_needed = 0;
- closedown_network_sockets();
- err = setup_network(handle, prog, 0);
+ loop_closedown_network_sockets();
+ err = loop_setup_network(handle, prog, 0);
if (err) {
com_err(prog, err, _("while reinitializing network"));
return err;
}
static void
-closedown_network_sockets()
+loop_closedown_network_sockets()
{
int i;
struct connection *conn;
}
void
-closedown_network()
+loop_closedown_network()
{
- closedown_network_sockets();
+ loop_closedown_network_sockets();
FREE_SET_DATA(connections);
FREE_SET_DATA(udp_port_data);
FREE_SET_DATA(tcp_port_data);