svn rev #25128: trunk/src/ include/ kadmin/server/ kdc/ lib/apputils/

ghudson@MIT.EDU ghudson at MIT.EDU
Fri Sep 2 13:07:49 EDT 2011


http://src.mit.edu/fisheye/changelog/krb5/?cs=25128
Commit By: ghudson
Log Message:
Add a loop_ prefix to net-server.c functions.

>From npmccallum at redhat.com.


Changed Files:
U   trunk/src/include/net-server.h
U   trunk/src/kadmin/server/ovsec_kadmd.c
U   trunk/src/kdc/main.c
U   trunk/src/lib/apputils/net-server.c
Modified: trunk/src/include/net-server.h
===================================================================
--- trunk/src/include/net-server.h	2011-09-02 17:07:45 UTC (rev 25127)
+++ trunk/src/include/net-server.h	2011-09-02 17:07:49 UTC (rev 25128)
@@ -37,14 +37,15 @@
 /* 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 */
 
@@ -55,7 +56,7 @@
  * 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,

Modified: trunk/src/kadmin/server/ovsec_kadmd.c
===================================================================
--- trunk/src/kadmin/server/ovsec_kadmd.c	2011-09-02 17:07:45 UTC (rev 25127)
+++ trunk/src/kadmin/server/ovsec_kadmd.c	2011-09-02 17:07:49 UTC (rev 25128)
@@ -379,19 +379,19 @@
     }
 
 #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);
@@ -626,13 +626,13 @@
     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);

Modified: trunk/src/kdc/main.c
===================================================================
--- trunk/src/kdc/main.c	2011-09-02 17:07:45 UTC (rev 25127)
+++ trunk/src/kdc/main.c	2011-09-02 17:07:49 UTC (rev 25128)
@@ -1013,7 +1013,7 @@
             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;
         }
@@ -1027,7 +1027,7 @@
             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;
         }
@@ -1039,7 +1039,7 @@
      * 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();
@@ -1071,11 +1071,11 @@
     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);

Modified: trunk/src/lib/apputils/net-server.c
===================================================================
--- trunk/src/lib/apputils/net-server.c	2011-09-02 17:07:45 UTC (rev 25127)
+++ trunk/src/lib/apputils/net-server.c	2011-09-02 17:07:49 UTC (rev 25128)
@@ -64,7 +64,7 @@
 
 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
@@ -279,7 +279,7 @@
 static fd_set rpc_listenfds;
 
 krb5_error_code
-add_udp_port(int port)
+loop_add_udp_port(int port)
 {
     int i;
     void *tmp;
@@ -298,7 +298,7 @@
 }
 
 krb5_error_code
-add_tcp_port(int port)
+loop_add_tcp_port(int port)
 {
     int i;
     void *tmp;
@@ -317,7 +317,8 @@
 }
 
 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;
@@ -1092,7 +1093,7 @@
 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;
 
@@ -1798,7 +1799,7 @@
 }
 
 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
@@ -1845,8 +1846,8 @@
         }
         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;
@@ -1878,7 +1879,7 @@
 }
 
 static void
-closedown_network_sockets()
+loop_closedown_network_sockets()
 {
     int i;
     struct connection *conn;
@@ -1914,9 +1915,9 @@
 }
 
 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);




More information about the cvs-krb5 mailing list