xref: /illumos-gate/usr/src/lib/gss_mechs/mech_krb5/support/init-addrinfo.c (revision 55fea89dcaa64928bed4327112404dcb3e07b79f)
1*159d09a2SMark Phalan /*
2*159d09a2SMark Phalan  * Copyright (C) 2004 by the Massachusetts Institute of Technology,
3*159d09a2SMark Phalan  * Cambridge, MA, USA.  All Rights Reserved.
4*159d09a2SMark Phalan  *
5*159d09a2SMark Phalan  * This software is being provided to you, the LICENSEE, by the
6*159d09a2SMark Phalan  * Massachusetts Institute of Technology (M.I.T.) under the following
7*159d09a2SMark Phalan  * license.  By obtaining, using and/or copying this software, you agree
8*159d09a2SMark Phalan  * that you have read, understood, and will comply with these terms and
9*159d09a2SMark Phalan  * conditions:
10*159d09a2SMark Phalan  *
11*159d09a2SMark Phalan  * Export of this software from the United States of America may
12*159d09a2SMark Phalan  * require a specific license from the United States Government.
13*159d09a2SMark Phalan  * It is the responsibility of any person or organization contemplating
14*159d09a2SMark Phalan  * export to obtain such a license before exporting.
15*159d09a2SMark Phalan  *
16*159d09a2SMark Phalan  * WITHIN THAT CONSTRAINT, permission to use, copy, modify and distribute
17*159d09a2SMark Phalan  * this software and its documentation for any purpose and without fee or
18*159d09a2SMark Phalan  * royalty is hereby granted, provided that you agree to comply with the
19*159d09a2SMark Phalan  * following copyright notice and statements, including the disclaimer, and
20*159d09a2SMark Phalan  * that the same appear on ALL copies of the software and documentation,
21*159d09a2SMark Phalan  * including modifications that you make for internal use or for
22*159d09a2SMark Phalan  * distribution:
23*159d09a2SMark Phalan  *
24*159d09a2SMark Phalan  * THIS SOFTWARE IS PROVIDED "AS IS", AND M.I.T. MAKES NO REPRESENTATIONS
25*159d09a2SMark Phalan  * OR WARRANTIES, EXPRESS OR IMPLIED.  By way of example, but not
26*159d09a2SMark Phalan  * limitation, M.I.T. MAKES NO REPRESENTATIONS OR WARRANTIES OF
27*159d09a2SMark Phalan  * MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF
28*159d09a2SMark Phalan  * THE LICENSED SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY
29*159d09a2SMark Phalan  * PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
30*159d09a2SMark Phalan  *
31*159d09a2SMark Phalan  * The name of the Massachusetts Institute of Technology or M.I.T. may NOT
32*159d09a2SMark Phalan  * be used in advertising or publicity pertaining to distribution of the
33*159d09a2SMark Phalan  * software.  Title to copyright in this software and any associated
34*159d09a2SMark Phalan  * documentation shall at all times remain with M.I.T., and USER agrees to
35*159d09a2SMark Phalan  * preserve same.
36*159d09a2SMark Phalan  *
37*159d09a2SMark Phalan  * Furthermore if you modify this software you must label
38*159d09a2SMark Phalan  * your software as modified software and not distribute it in such a
39*159d09a2SMark Phalan  * fashion that it might be confused with the original M.I.T. software.
40*159d09a2SMark Phalan  */
41*159d09a2SMark Phalan 
42*159d09a2SMark Phalan /* Stuff that needs initialization for fake-addrinfo.c.
43*159d09a2SMark Phalan 
44*159d09a2SMark Phalan    Separated out, so that static linking against this library doesn't
45*159d09a2SMark Phalan    require pulling in socket/nsl/whatever libraries for code not using
46*159d09a2SMark Phalan    getaddrinfo.  */
47*159d09a2SMark Phalan 
48*159d09a2SMark Phalan #include "port-sockets.h"
49*159d09a2SMark Phalan #include "socket-utils.h"
50*159d09a2SMark Phalan #include "k5-platform.h"
51*159d09a2SMark Phalan #include "k5-thread.h"
52*159d09a2SMark Phalan 
53*159d09a2SMark Phalan #include <stdio.h>		/* for sprintf */
54*159d09a2SMark Phalan #include <errno.h>
55*159d09a2SMark Phalan 
56*159d09a2SMark Phalan #define IMPLEMENT_FAKE_GETADDRINFO
57*159d09a2SMark Phalan #include "fake-addrinfo.h"
58*159d09a2SMark Phalan #include "cache-addrinfo.h"
59*159d09a2SMark Phalan 
60*159d09a2SMark Phalan struct fac krb5int_fac = { K5_MUTEX_PARTIAL_INITIALIZER, 0 };
61*159d09a2SMark Phalan 
krb5int_init_fac(void)62*159d09a2SMark Phalan int krb5int_init_fac (void)
63*159d09a2SMark Phalan {
64*159d09a2SMark Phalan     return k5_mutex_finish_init(&krb5int_fac.lock);
65*159d09a2SMark Phalan }
66*159d09a2SMark Phalan 
krb5int_fini_fac(void)67*159d09a2SMark Phalan void krb5int_fini_fac (void)
68*159d09a2SMark Phalan {
69*159d09a2SMark Phalan     k5_mutex_destroy(&krb5int_fac.lock);
70*159d09a2SMark Phalan }
71