|
Packit |
fd8b60 |
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
|
Packit |
fd8b60 |
/* include/foreachaddr.h */
|
|
Packit |
fd8b60 |
/*
|
|
Packit |
fd8b60 |
* Copyright 1990,1991,2000,2001,2002,2004 by the Massachusetts Institute of Technology.
|
|
Packit |
fd8b60 |
* All Rights Reserved.
|
|
Packit |
fd8b60 |
*
|
|
Packit |
fd8b60 |
* Export of this software from the United States of America may
|
|
Packit |
fd8b60 |
* require a specific license from the United States Government.
|
|
Packit |
fd8b60 |
* It is the responsibility of any person or organization contemplating
|
|
Packit |
fd8b60 |
* export to obtain such a license before exporting.
|
|
Packit |
fd8b60 |
*
|
|
Packit |
fd8b60 |
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
|
|
Packit |
fd8b60 |
* distribute this software and its documentation for any purpose and
|
|
Packit |
fd8b60 |
* without fee is hereby granted, provided that the above copyright
|
|
Packit |
fd8b60 |
* notice appear in all copies and that both that copyright notice and
|
|
Packit |
fd8b60 |
* this permission notice appear in supporting documentation, and that
|
|
Packit |
fd8b60 |
* the name of M.I.T. not be used in advertising or publicity pertaining
|
|
Packit |
fd8b60 |
* to distribution of the software without specific, written prior
|
|
Packit |
fd8b60 |
* permission. Furthermore if you modify this software you must label
|
|
Packit |
fd8b60 |
* your software as modified software and not distribute it in such a
|
|
Packit |
fd8b60 |
* fashion that it might be confused with the original M.I.T. software.
|
|
Packit |
fd8b60 |
* M.I.T. makes no representations about the suitability of
|
|
Packit |
fd8b60 |
* this software for any purpose. It is provided "as is" without express
|
|
Packit |
fd8b60 |
* or implied warranty.
|
|
Packit |
fd8b60 |
*/
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
/*
|
|
Packit |
fd8b60 |
*
|
|
Packit |
fd8b60 |
* Iterate over the protocol addresses supported by this host, invoking
|
|
Packit |
fd8b60 |
* a callback function or three supplied by the caller.
|
|
Packit |
fd8b60 |
*
|
|
Packit |
fd8b60 |
* XNS support is untested, but "should just work". (Hah!)
|
|
Packit |
fd8b60 |
*/
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
/* This function iterates over all the addresses it can find for the
|
|
Packit |
fd8b60 |
local system, in one or two passes. In each pass, and between the
|
|
Packit |
fd8b60 |
two, it can invoke callback functions supplied by the caller. The
|
|
Packit |
fd8b60 |
two passes should operate on the same information, though not
|
|
Packit |
fd8b60 |
necessarily in the same order each time. Duplicate and local
|
|
Packit |
fd8b60 |
addresses should be eliminated. Storage passed to callback
|
|
Packit |
fd8b60 |
functions should not be assumed to be valid after foreach_localaddr
|
|
Packit |
fd8b60 |
returns.
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
The int return value is an errno value (XXX or krb5_error_code
|
|
Packit |
fd8b60 |
returned for a socket error) if something internal to
|
|
Packit |
fd8b60 |
foreach_localaddr fails. If one of the callback functions wants to
|
|
Packit |
fd8b60 |
indicate an error, it should store something via the 'data' handle.
|
|
Packit |
fd8b60 |
If any callback function returns a non-zero value,
|
|
Packit |
fd8b60 |
foreach_localaddr will clean up and return immediately.
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
Multiple definitions are provided below, dependent on various
|
|
Packit |
fd8b60 |
system facilities for extracting the necessary information. */
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
extern int
|
|
Packit |
fd8b60 |
krb5int_foreach_localaddr (/*@null@*/ void *data,
|
|
Packit |
fd8b60 |
int (*pass1fn) (/*@null@*/ void *,
|
|
Packit |
fd8b60 |
struct sockaddr *) /*@*/,
|
|
Packit |
fd8b60 |
/*@null@*/ int (*betweenfn) (/*@null@*/ void *) /*@*/,
|
|
Packit |
fd8b60 |
/*@null@*/ int (*pass2fn) (/*@null@*/ void *,
|
|
Packit |
fd8b60 |
struct sockaddr *) /*@*/)
|
|
Packit |
fd8b60 |
#if defined(DEBUG) || defined(TEST)
|
|
Packit |
fd8b60 |
/*@modifies fileSystem@*/
|
|
Packit |
fd8b60 |
#endif
|
|
Packit |
fd8b60 |
;
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
#define foreach_localaddr krb5int_foreach_localaddr
|