1 /* $NetBSD: wildcard_inet_addr.c,v 1.1.1.1 2009/06/23 10:08:48 tron Exp $ */ 2 3 /*++ 4 /* NAME 5 /* wildcard_inet_addr 3 6 /* SUMMARY 7 /* expand wild-card address 8 /* SYNOPSIS 9 /* #include <wildcard_inet_addr.h> 10 /* 11 /* INET_ADDR_LIST *wildcard_inet_addr(void) 12 /* DESCRIPTION 13 /* wildcard_inet_addr() determines all wild-card addresses 14 /* for all supported address families. 15 /* DIAGNOSTICS 16 /* Fatal errors: out of memory. 17 /* SEE ALSO 18 /* inet_addr_list(3) address list management 19 /* LICENSE 20 /* .ad 21 /* .fi 22 /* The Secure Mailer license must be distributed with this software. 23 /* AUTHOR(S) 24 /* Wietse Venema 25 /* IBM T.J. Watson Research 26 /* P.O. Box 704 27 /* Yorktown Heights, NY 10598, USA 28 /* 29 /* Dean C. Strik 30 /* Department ICT 31 /* Eindhoven University of Technology 32 /* P.O. Box 513 33 /* 5600 MB Eindhoven, Netherlands 34 /* E-mail: <dean@ipnet6.org> 35 /*--*/ 36 37 /* System library. */ 38 39 #include <sys_defs.h> 40 41 /* Utility library. */ 42 43 #include <msg.h> 44 #include <inet_addr_list.h> 45 #include <inet_addr_host.h> 46 47 /* Global library. */ 48 49 #include <wildcard_inet_addr.h> 50 51 /* Application-specific. */ 52 53 static INET_ADDR_LIST wild_addr_list; 54 55 static void wildcard_inet_addr_init(INET_ADDR_LIST *addr_list) 56 { 57 inet_addr_list_init(addr_list); 58 if (inet_addr_host(addr_list, "") == 0) 59 msg_fatal("could not get list of wildcard addresses"); 60 } 61 62 /* wildcard_inet_addr_list - return list of addresses */ 63 64 INET_ADDR_LIST *wildcard_inet_addr_list(void) 65 { 66 if (wild_addr_list.used == 0) 67 wildcard_inet_addr_init(&wild_addr_list); 68 69 return (&wild_addr_list); 70 } 71