Path: blob/main/crypto/krb5/src/include/foreachaddr.h
34879 views
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */1/* include/foreachaddr.h */2/*3* Copyright 1990,1991,2000,2001,2002,2004 by the Massachusetts Institute of Technology.4* All Rights Reserved.5*6* Export of this software from the United States of America may7* require a specific license from the United States Government.8* It is the responsibility of any person or organization contemplating9* export to obtain such a license before exporting.10*11* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and12* distribute this software and its documentation for any purpose and13* without fee is hereby granted, provided that the above copyright14* notice appear in all copies and that both that copyright notice and15* this permission notice appear in supporting documentation, and that16* the name of M.I.T. not be used in advertising or publicity pertaining17* to distribution of the software without specific, written prior18* permission. Furthermore if you modify this software you must label19* your software as modified software and not distribute it in such a20* fashion that it might be confused with the original M.I.T. software.21* M.I.T. makes no representations about the suitability of22* this software for any purpose. It is provided "as is" without express23* or implied warranty.24*/2526/*27*28* Iterate over the protocol addresses supported by this host, invoking29* a callback function or three supplied by the caller.30*31* XNS support is untested, but "should just work". (Hah!)32*/3334/* This function iterates over all the addresses it can find for the35local system, in one or two passes. In each pass, and between the36two, it can invoke callback functions supplied by the caller. The37two passes should operate on the same information, though not38necessarily in the same order each time. Duplicate and local39addresses should be eliminated. Storage passed to callback40functions should not be assumed to be valid after foreach_localaddr41returns.4243The int return value is an errno value (XXX or krb5_error_code44returned for a socket error) if something internal to45foreach_localaddr fails. If one of the callback functions wants to46indicate an error, it should store something via the 'data' handle.47If any callback function returns a non-zero value,48foreach_localaddr will clean up and return immediately.4950Multiple definitions are provided below, dependent on various51system facilities for extracting the necessary information. */5253extern int54krb5int_foreach_localaddr (/*@null@*/ void *data,55int (*pass1fn) (/*@null@*/ void *,56struct sockaddr *) /*@*/,57/*@null@*/ int (*betweenfn) (/*@null@*/ void *) /*@*/,58/*@null@*/ int (*pass2fn) (/*@null@*/ void *,59struct sockaddr *) /*@*/)60#if defined(DEBUG) || defined(TEST)61/*@modifies fileSystem@*/62#endif63;6465#define foreach_localaddr krb5int_foreach_localaddr666768