From b5e1cf204bc5d8348ce16388e905882a1bc4bd42 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Wed, 5 May 2004 22:44:46 +0000 Subject: Rename header file foreachaddr.c to foreachaddr.h, now that it isn't mostly static functions to be compiled in. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16314 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/ChangeLog | 1 + src/include/foreachaddr.c | 64 --------------------------------------------- src/include/foreachaddr.h | 64 +++++++++++++++++++++++++++++++++++++++++++++ src/kdc/ChangeLog | 4 +++ src/kdc/Makefile.in | 2 +- src/kdc/network.c | 2 +- src/lib/krb5/os/ChangeLog | 3 ++- src/lib/krb5/os/Makefile.in | 2 +- src/lib/krb5/os/localaddr.c | 2 +- 9 files changed, 75 insertions(+), 69 deletions(-) delete mode 100644 src/include/foreachaddr.c create mode 100644 src/include/foreachaddr.h (limited to 'src') diff --git a/src/include/ChangeLog b/src/include/ChangeLog index f503efacf..e76c0feb1 100644 --- a/src/include/ChangeLog +++ b/src/include/ChangeLog @@ -1,6 +1,7 @@ 2004-05-05 Ken Raeburn * foreachaddr.c: Implementation moved to lib/krb5/os/localaddr.c. + * foreachaddr.h: New file. (krb5int_foreach_localaddr): Declare. (foreach_localaddr): New macro. diff --git a/src/include/foreachaddr.c b/src/include/foreachaddr.c deleted file mode 100644 index 57591f596..000000000 --- a/src/include/foreachaddr.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * include/foreachaddr.c - * - * Copyright 1990,1991,2000,2001,2002,2004 by the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * Export of this software from the United States of America may - * require a specific license from the United States Government. - * It is the responsibility of any person or organization contemplating - * export to obtain such a license before exporting. - * - * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and - * distribute this software and its documentation for any purpose and - * without fee is hereby granted, provided that the above copyright - * notice appear in all copies and that both that copyright notice and - * this permission notice appear in supporting documentation, and that - * the name of M.I.T. not be used in advertising or publicity pertaining - * to distribution of the software without specific, written prior - * permission. Furthermore if you modify this software you must label - * your software as modified software and not distribute it in such a - * fashion that it might be confused with the original M.I.T. software. - * M.I.T. makes no representations about the suitability of - * this software for any purpose. It is provided "as is" without express - * or implied warranty. - * - * - * Iterate over the protocol addresses supported by this host, invoking - * a callback function or three supplied by the caller. - * - * XNS support is untested, but "should just work". (Hah!) - */ - -/* This function iterates over all the addresses it can find for the - local system, in one or two passes. In each pass, and between the - two, it can invoke callback functions supplied by the caller. The - two passes should operate on the same information, though not - necessarily in the same order each time. Duplicate and local - addresses should be eliminated. Storage passed to callback - functions should not be assumed to be valid after foreach_localaddr - returns. - - The int return value is an errno value (XXX or krb5_error_code - returned for a socket error) if something internal to - foreach_localaddr fails. If one of the callback functions wants to - indicate an error, it should store something via the 'data' handle. - If any callback function returns a non-zero value, - foreach_localaddr will clean up and return immediately. - - Multiple definitions are provided below, dependent on various - system facilities for extracting the necessary information. */ - -extern int -krb5int_foreach_localaddr (/*@null@*/ void *data, - int (*pass1fn) (/*@null@*/ void *, - struct sockaddr *) /*@*/, - /*@null@*/ int (*betweenfn) (/*@null@*/ void *) /*@*/, - /*@null@*/ int (*pass2fn) (/*@null@*/ void *, - struct sockaddr *) /*@*/) -#if defined(DEBUG) || defined(TEST) - /*@modifies fileSystem@*/ -#endif - ; - -#define foreach_localaddr krb5int_foreach_localaddr diff --git a/src/include/foreachaddr.h b/src/include/foreachaddr.h new file mode 100644 index 000000000..57591f596 --- /dev/null +++ b/src/include/foreachaddr.h @@ -0,0 +1,64 @@ +/* + * include/foreachaddr.c + * + * Copyright 1990,1991,2000,2001,2002,2004 by the Massachusetts Institute of Technology. + * All Rights Reserved. + * + * Export of this software from the United States of America may + * require a specific license from the United States Government. + * It is the responsibility of any person or organization contemplating + * export to obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. Furthermore if you modify this software you must label + * your software as modified software and not distribute it in such a + * fashion that it might be confused with the original M.I.T. software. + * M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + * + * + * Iterate over the protocol addresses supported by this host, invoking + * a callback function or three supplied by the caller. + * + * XNS support is untested, but "should just work". (Hah!) + */ + +/* This function iterates over all the addresses it can find for the + local system, in one or two passes. In each pass, and between the + two, it can invoke callback functions supplied by the caller. The + two passes should operate on the same information, though not + necessarily in the same order each time. Duplicate and local + addresses should be eliminated. Storage passed to callback + functions should not be assumed to be valid after foreach_localaddr + returns. + + The int return value is an errno value (XXX or krb5_error_code + returned for a socket error) if something internal to + foreach_localaddr fails. If one of the callback functions wants to + indicate an error, it should store something via the 'data' handle. + If any callback function returns a non-zero value, + foreach_localaddr will clean up and return immediately. + + Multiple definitions are provided below, dependent on various + system facilities for extracting the necessary information. */ + +extern int +krb5int_foreach_localaddr (/*@null@*/ void *data, + int (*pass1fn) (/*@null@*/ void *, + struct sockaddr *) /*@*/, + /*@null@*/ int (*betweenfn) (/*@null@*/ void *) /*@*/, + /*@null@*/ int (*pass2fn) (/*@null@*/ void *, + struct sockaddr *) /*@*/) +#if defined(DEBUG) || defined(TEST) + /*@modifies fileSystem@*/ +#endif + ; + +#define foreach_localaddr krb5int_foreach_localaddr diff --git a/src/kdc/ChangeLog b/src/kdc/ChangeLog index e9aadebf0..2fbf055de 100644 --- a/src/kdc/ChangeLog +++ b/src/kdc/ChangeLog @@ -1,3 +1,7 @@ +2004-05-05 Ken Raeburn + + * network.c: Include foreachaddr.h, not foreachaddr.c. + 2004-04-02 Ken Raeburn * network.c (setup_a_tcp_listener): Try to turn the IPV6_V6ONLY diff --git a/src/kdc/Makefile.in b/src/kdc/Makefile.in index 3231944dc..efd3b8d9a 100644 --- a/src/kdc/Makefile.in +++ b/src/kdc/Makefile.in @@ -159,7 +159,7 @@ $(OUTPRE)network.$(OBJEXT): network.c $(SRCTOP)/include/k5-int.h \ $(SRCTOP)/include/krb5/kdb.h kdc_util.h extern.h kdc5_err.h \ $(SRCTOP)/include/krb5/adm_proto.h $(SRCTOP)/include/syslog.h \ $(SRCTOP)/include/fake-addrinfo.h $(SRCTOP)/include/cm.h \ - $(SRCTOP)/include/foreachaddr.c + $(SRCTOP)/include/foreachaddr.h $(OUTPRE)policy.$(OBJEXT): policy.c $(SRCTOP)/include/k5-int.h \ $(BUILDTOP)/include/krb5/osconf.h $(BUILDTOP)/include/krb5/autoconf.h \ $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \ diff --git a/src/kdc/network.c b/src/kdc/network.c index 7ef102bba..e55efac93 100644 --- a/src/kdc/network.c +++ b/src/kdc/network.c @@ -262,7 +262,7 @@ static krb5_error_code add_tcp_port(int port) #define USE_TYPE SOCK_DGRAM #define USE_PROTO 0 #define SOCKET_ERRNO errno -#include "foreachaddr.c" +#include "foreachaddr.h" struct socksetup { const char *prog; diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index d1532b983..431bbd475 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,7 +1,8 @@ 2004-05-05 Ken Raeburn * localaddr.c: Incorporate foreach_localaddr implementation. - Export it as krb5int_foreach_localaddr. + Export it as krb5int_foreach_localaddr. Include foreachaddr.h, + not foreachaddr.c. 2004-03-22 Ken Raeburn diff --git a/src/lib/krb5/os/Makefile.in b/src/lib/krb5/os/Makefile.in index bc351e1ff..bcf677495 100644 --- a/src/lib/krb5/os/Makefile.in +++ b/src/lib/krb5/os/Makefile.in @@ -373,7 +373,7 @@ localaddr.so localaddr.po $(OUTPRE)localaddr.$(OBJEXT): localaddr.c $(SRCTOP)/in $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \ $(BUILDTOP)/include/krb5.h $(COM_ERR_DEPS) $(BUILDTOP)/include/profile.h \ $(SRCTOP)/include/port-sockets.h $(SRCTOP)/include/socket-utils.h \ - $(SRCTOP)/include/krb5/kdb.h $(SRCTOP)/include/foreachaddr.c + $(SRCTOP)/include/krb5/kdb.h $(SRCTOP)/include/foreachaddr.h locate_kdc.so locate_kdc.po $(OUTPRE)locate_kdc.$(OBJEXT): locate_kdc.c $(SRCTOP)/include/fake-addrinfo.h \ $(SRCTOP)/include/port-sockets.h $(BUILDTOP)/include/krb5/autoconf.h \ $(SRCTOP)/include/socket-utils.h $(SRCTOP)/include/k5-platform.h \ diff --git a/src/lib/krb5/os/localaddr.c b/src/lib/krb5/os/localaddr.c index e89a51ae9..01b331b58 100644 --- a/src/lib/krb5/os/localaddr.c +++ b/src/lib/krb5/os/localaddr.c @@ -50,7 +50,7 @@ # include "fake-addrinfo.h" #endif -#include "foreachaddr.c" +#include "foreachaddr.h" /* Note: foreach_localaddr is exported from the library through krb5int_accessor, for the KDC to use. -- cgit