1/*
2 * Copyright (c) 2010 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * 1.  Redistributions of source code must retain the above copyright
11 *     notice, this list of conditions and the following disclaimer.
12 * 2.  Redistributions in binary form must reproduce the above copyright
13 *     notice, this list of conditions and the following disclaimer in the
14 *     documentation and/or other materials provided with the distribution.
15 * 3.  Neither the name of Apple Inc. ("Apple") nor the names of its
16 *     contributors may be used to endorse or promote products derived from
17 *     this software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
20 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
23 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
26 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 *
30 * Portions of this software have been released under the following terms:
31 *
32 * (c) Copyright 1989-1993 OPEN SOFTWARE FOUNDATION, INC.
33 * (c) Copyright 1989-1993 HEWLETT-PACKARD COMPANY
34 * (c) Copyright 1989-1993 DIGITAL EQUIPMENT CORPORATION
35 *
36 * To anyone who acknowledges that this file is provided "AS IS"
37 * without any express or implied warranty:
38 * permission to use, copy, modify, and distribute this file for any
39 * purpose is hereby granted without fee, provided that the above
40 * copyright notices and this notice appears in all source code copies,
41 * and that none of the names of Open Software Foundation, Inc., Hewlett-
42 * Packard Company or Digital Equipment Corporation be used
43 * in advertising or publicity pertaining to distribution of the software
44 * without specific, written prior permission.  Neither Open Software
45 * Foundation, Inc., Hewlett-Packard Company nor Digital
46 * Equipment Corporation makes any representations about the suitability
47 * of this software for any purpose.
48 *
49 * Copyright (c) 2007, Novell, Inc. All rights reserved.
50 * Redistribution and use in source and binary forms, with or without
51 * modification, are permitted provided that the following conditions
52 * are met:
53 *
54 * 1.  Redistributions of source code must retain the above copyright
55 *     notice, this list of conditions and the following disclaimer.
56 * 2.  Redistributions in binary form must reproduce the above copyright
57 *     notice, this list of conditions and the following disclaimer in the
58 *     documentation and/or other materials provided with the distribution.
59 * 3.  Neither the name of Novell Inc. nor the names of its contributors
60 *     may be used to endorse or promote products derived from this
61 *     this software without specific prior written permission.
62 *
63 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
64 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
65 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
66 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY
67 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
68 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
69 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
70 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
71 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
72 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
73 *
74 * @APPLE_LICENSE_HEADER_END@
75 */
76
77/*
78**
79**  NAME
80**
81**      comp.c
82**
83**  FACILITY:
84**
85**      Remote Procedure Call (RPC)
86**
87**  ABSTRACT:
88**
89**  Definitions of storage internal to Common Communications Service component.
90**
91**
92*/
93
94#include <commonp.h>    /* Common internals for RPC Runtime system      */
95#include <com.h>        /* Externals for Common Services component      */
96#include <comprot.h>    /* Externals for common Protocol Services       */
97#include <comnaf.h>     /* Externals for common NAF Services            */
98#include <comp.h>       /* Internals for Common Services component      */
99#include <comfwd.h>     /* Externals for Common Services Fwd component  */
100
101/***********************************************************************/
102/*
103 * R P C _ G _ I N I T I A L I Z E D
104 *
105 * The value that indicates whether or not the RPC runtime has previously
106 * been initialized (via a call to rpc__init). Its declaration is
107 * in com.h since the Naming Service may need to invoke the
108 * RPC_VERIFY_INIT macro.
109 */
110GLOBAL boolean              rpc_g_initialized = false;
111
112/***********************************************************************/
113/*
114 * R P C _ G _ T H R E A D _ C O N T E X T _ K E Y
115 *
116 * The key visible to all threads that contains a pointer to the
117 * per-thread context block.
118 */
119GLOBAL dcethread_key        rpc_g_thread_context_key;
120
121/***********************************************************************/
122/*
123 * R P C _ G _ G L O B A L _ M U T E X
124 *
125 * The global mutex used for the entire Communications Service. Note
126 * that this may be temporary since a per-data structure mutex may
127 * be employed. Its declaration is in com.h since RPC Protocol
128 * Services will need to reference it through the mutex macros.
129 */
130GLOBAL rpc_mutex_t          rpc_g_global_mutex;
131
132/***********************************************************************/
133/*
134 * R P C _ G _ G L O B A L _ B I N D I N G _ C O N D
135 *
136 * The global binding handle condition variable used for call
137 * serialization.  This condition variable is protected by the global
138 * mutex.  Note that this may be temporary since a per-binding handle
139 * cond var / mutex may be employed.
140 */
141GLOBAL rpc_cond_t           rpc_g_global_binding_cond;
142
143/***********************************************************************/
144/*
145 * R P C _ G _ F O R K _ C O U N T
146 *
147 * The global fork count used to detect when a process using
148 * RPC has forked.  After a fork, the parent is allowed to proceed
149 * unaffected--all RPC helper threads are restarted, and
150 * all RPC state maintained.  In the child, however, all state
151 * is dropped, and the RPC initialization process will have
152 * to be repeated if the child tries to use RPC.
153 *
154 * The counter here is necessitated by the fact that it is possible
155 * for the application to hold the only reference to certain
156 * data structures allocated by the runtime;  the example of concern
157 * here is binding handles.  Since we have no way at present
158 * of tracking dow these binding handles during the normal fork
159 * handling, we need some way to recognize them if the application
160 * tries to use one *after* the fork.  By storing the current
161 * global fork count in each handle, and then incrementing the
162 * global count in the child of a fork, we can recognize such
163 * handles the next time they are used.  Protocol specific routine
164 * are then called to perform whatever actions are necessary to
165 * drop any state associated with the handle.
166 *
167 * Note that we are currently stranding memory across forks; eg.
168 * call handles, mutexes, etc.  This is considered a necessary and
169 * acceptable evil based on the following considerations:
170 *
171 *     1) The reset/release/etc. routines that exist today are
172 *        designed to carry out any pending operations associated
173 *        with the data structure.  For example, before freeing
174 *        a call handle, the DG code will try to send out any
175 *        pending acknowledgements.  For this reason, most of
176 *        these routines are unusable.
177 *     2) It is too late to redesign all of these routines to
178 *        incorporate the correct fork-aware behavior.
179 *     3) Vaporizing all state in the child of a fork creates a
180 *        scenario that is easier to understand, and implement
181 *        correctly.
182 *     4) The amount of memory stranded does not seem to be enough
183 *        to worry about.  We are assuming that the child of
184 *        a fork will not itself fork a child that will itself
185 *        fork a child, etc., eventually filling the VA space
186 *        with stranded memory.
187 */
188GLOBAL unsigned32 rpc_g_fork_count;
189
190/***********************************************************************/
191/*
192 * R P C _ G _ F W D _ F N
193 *
194 * The global forwarding map function variable.  Its value indicates
195 * whether or not the RPC runtime should be performing forwarding services
196 * and if so, the forwarding map function to use.
197 */
198GLOBAL rpc_fwd_map_fn_t     rpc_g_fwd_fn = NULL;
199
200/***********************************************************************/
201/*
202 * R P C _ G _ S E R V E R _ P T H R E A D _ A T T R
203 *
204 * A dcethread attribute for server thread creation.
205 * Initialized by rpc_init().
206 */
207GLOBAL dcethread_attr   rpc_g_server_dcethread_attr;
208
209/***********************************************************************/
210/*
211 * R P C _ G _ R U N T I M E _ P T H R E A D _ A T T R
212 *
213 * A dcethread attribute for internal thread creation.  This parameter
214 * is of particular interest to those threads internal to the runtime
215 * that can call security routines.  These threads include: the
216 * network listener and the receiver threads.
217 * Initialized by rpc_init().
218 */
219GLOBAL dcethread_attr   rpc_g_default_dcethread_attr;
220
221/***********************************************************************/
222/*
223 * RPCMEM package statistics.  Extern'd in "rpcmem.h>.
224 *
225 * ### !!! seems like this should be in the (non-existent) "rpcmem.c" file.
226 */
227GLOBAL rpc_mem_stats_elt_t  rpc_g_mem_stats[RPC_C_MEM_MAX_TYPES];
228
229/***********************************************************************/
230/*
231 * R P C _ G _ N S _ S P E C I F I C _ F R E E _ F N
232 *
233 * The global NS binding->ns_specific free function.  The NS init routine
234 * inits this.  It's purpose is to prevent the runtime from always pulling
235 * in the name service modules when they're not necessary.
236 */
237GLOBAL rpc_g_ns_specific_free_fn_t  rpc_g_ns_specific_free_fn = NULL;
238
239
240
241/* This table is used only by comtwrref.c to validate towers, but we need
242 * it accessible by the dynamic loading code so that new modules can register
243 * with the runtime.
244 * We allocate extra space, since there may be mulitple entries: eg
245 * rpc_c_protseq_id_ncacn_osi_dna
246 * */
247GLOBAL unsigned32 rpc_g_tower_prot_id_number = 0;	/* number of elts in rpc_g_tower_prot_ids */
248GLOBAL rpc_tower_prot_ids_t rpc_g_tower_prot_ids[RPC_C_PROTSEQ_ID_MAX*2] =
249{
250#if 0
251	{ rpc_c_protseq_id_ncacn_ip_tcp,   3,
252		{ {0x0B,   { 0, 0, 0, 0, 0, {0} }},
253			{0x07,   { 0, 0, 0, 0, 0, {0} }},
254			{0x09,   { 0, 0, 0, 0, 0, {0} }},
255			{0x00,   { 0, 0, 0, 0, 0, {0} }}
256		}
257	},
258	{ rpc_c_protseq_id_ncacn_dnet_nsp, 4,
259		{ {0x0B,   { 0, 0, 0, 0, 0, {0} }},
260			{0x02,   { 0, 0, 0, 0, 0, {0} }},
261			{0x04,   { 0, 0, 0, 0, 0, {0} }},
262			{0x06,   { 0, 0, 0, 0, 0, {0} }}
263		}
264	},
265	{ rpc_c_protseq_id_ncacn_osi_dna,  4,
266		{ {0x0B,   { 0, 0, 0, 0, 0, {0} }},
267			{0x03,   { 0, 0, 0, 0, 0, {0} }},
268			{0x04,   { 0, 0, 0, 0, 0, {0} }},
269			{0x06,   { 0, 0, 0, 0, 0, {0} }}
270		}
271	},
272	{ rpc_c_protseq_id_ncacn_osi_dna,  4,
273		{ {0x0B,   { 0, 0, 0, 0, 0, {0} }},
274			{0x03,   { 0, 0, 0, 0, 0, {0} }},
275			{0x05,   { 0, 0, 0, 0, 0, {0} }},
276			{0x06,   { 0, 0, 0, 0, 0, {0} }}
277		}
278	},
279	{ rpc_c_protseq_id_ncadg_ip_udp,   3,
280		{ {0x0A,   { 0, 0, 0, 0, 0, {0} }},
281			{0x08,   { 0, 0, 0, 0, 0, {0} }},
282			{0x09,   { 0, 0, 0, 0, 0, {0} }},
283			{0x00,   { 0, 0, 0, 0, 0, {0} }}
284		}
285	},
286	{ rpc_c_protseq_id_ncadg_dds,      3,
287		{ {0x0A,   { 0, 0, 0, 0, 0, {0} }},
288			{0x0D,   {0x9865a080UL, 0xbb73, 0x11c9, 0x96, 0x3c, {0x08,0x00, 0x2b, 0x13, 0xec, 0x4e}}},
289			{0x0D,   {0x9b86b6a0UL, 0xbb73, 0x11c9, 0xb8, 0x89, {0x08, 0x00, 0x2b, 0x13, 0xec, 0x4e}}},
290			{0x00,   { 0, 0, 0, 0, 0, {0} }}
291		}
292	}
293#endif
294};
295
296/***********************************************************************/
297/*
298 * R P C _ G _ P R O T S E Q _ I D
299 *
300 * The RPC Protocol Sequence ID table.  This table is indexed by an RPC
301 * Protocol Sequence ID.
302 *
303 * An RPC Protocol Sequence represents a specific RPC Protocol/Network
304 * Address Family combination which is by definition a valid combination
305 * of protocols. An RPC Protocol Sequence also represents a specific
306 * NAF interface type, since there may be multiple within a NAF. Each
307 * RPC Protocol Sequence has an entry in this table.
308 *
309 * Note that the ".rpc_protseq_id" field of i'th element in the table
310 * is always "i".  While redundant, this is useful so that you can pass
311 * pointers to individual table elements.
312 *
313 * The fields are:
314 *
315 *      supported       A boolean flag initialized to zero and filled
316 *                      in by rpc__init if it determines that this Protocol
317 *                      Sequence is actually supported by the system.
318 *
319 *      rpc_protseq_id  A constant identifier for the Protocol Sequence.
320 *
321 *      rpc_protocol_id A constant identifier for the RPC Protocol used
322 *                      in this Protocol Sequence.
323 *
324 *      naf_id          A constant identifier for the Network Address
325 *                      Family used in this Protocol Sequence.
326 *
327 *      net_protocol_id A constant identifier for the network protocol
328 *                      used in this Protocol Sequence.
329 *
330 *      net_if_id       A constant identifier for the network interface
331 *                      type used in this Protocol Sequence.
332 *
333 *      rpc_protseq     A string constant defining this Protocol Sequence.
334 *
335 *      port_restriction_list_p
336 *                      An optionally pointer to a port_restriction_list
337 *                      object.
338 */
339
340GLOBAL
341rpc_protseq_id_elt_t     rpc_g_protseq_id[RPC_C_PROTSEQ_ID_MAX] =
342{
343#if 0
344    {                                   /* Connection-RPC / IP / TCP */
345        0,
346        rpc_c_protseq_id_ncacn_ip_tcp,
347        RPC_C_PROTOCOL_ID_NCACN,
348        RPC_C_NAF_ID_IP,
349        RPC_C_NETWORK_PROTOCOL_ID_TCP,
350        RPC_C_NETWORK_IF_ID_STREAM,
351        RPC_PROTSEQ_NCACN_IP_TCP,
352        (rpc_port_restriction_list_p_t) NULL
353    },
354
355    {                                   /* Connection-RPC / DECnet / NSP */
356        0,
357        rpc_c_protseq_id_ncacn_dnet_nsp,
358        RPC_C_PROTOCOL_ID_NCACN,
359        RPC_C_NAF_ID_DNET,
360        RPC_C_NETWORK_PROTOCOL_ID_UNS,
361        RPC_C_NETWORK_IF_ID_STREAM,
362        RPC_PROTSEQ_NCACN_DNET_NSP,
363        (rpc_port_restriction_list_p_t) NULL
364    },
365
366    {                                   /* Connection-RPC / OSI / DNASESSION */
367        0,
368        rpc_c_protseq_id_ncacn_osi_dna,
369        RPC_C_PROTOCOL_ID_NCACN,
370        RPC_C_NAF_ID_OSI,
371        RPC_C_NETWORK_PROTOCOL_ID_DNASESSION,
372        RPC_C_NETWORK_IF_ID_SEQPACKET,
373        RPC_PROTSEQ_NCACN_OSI_DNA,
374        (rpc_port_restriction_list_p_t) NULL
375    },
376
377    {                                   /* Datagram-RPC / IP / UDP */
378        0,
379        rpc_c_protseq_id_ncadg_ip_udp,
380        RPC_C_PROTOCOL_ID_NCADG,
381        RPC_C_NAF_ID_IP,
382        RPC_C_NETWORK_PROTOCOL_ID_UDP,
383        RPC_C_NETWORK_IF_ID_DGRAM,
384        RPC_PROTSEQ_NCADG_IP_UDP,
385        (rpc_port_restriction_list_p_t) NULL
386    },
387
388    {                                   /* Datagram-RPC / DDS */
389        0,
390        rpc_c_protseq_id_ncadg_dds,
391        RPC_C_PROTOCOL_ID_NCADG,
392        RPC_C_NAF_ID_DDS,
393        RPC_C_NETWORK_PROTOCOL_ID_DDS,
394        RPC_C_NETWORK_IF_ID_DGRAM,
395        RPC_PROTSEQ_NCADG_DDS,
396        (rpc_port_restriction_list_p_t) NULL
397#ifdef TEST_PROTOCOL
398    },
399
400    {                                   /* Test-RPC / IP / TCP */
401        0,
402        RPC_C_PROTSEQ_ID_NCATP_IP_TCP,
403        RPC_C_PROTOCOL_ID_NCATP,
404        RPC_C_NAF_ID_IP,
405        RPC_C_NETWORK_PROTOCOL_ID_TCP,
406        RPC_C_NETWORK_IF_ID_STREAM,
407        RPC_PROTSEQ_NCATP_IP_TCP,
408        (rpc_port_restriction_list_p_t) NULL
409#endif /* TEST_PROTOCOL */
410    }
411#endif
412};
413
414
415/***********************************************************************/
416/*
417 * R P C _ G _ P R O T O C O L _ I D
418 *
419 * The RPC Protocol ID table.  Each RPC Protocol has an entry in this
420 * table.  This table is index by RPC Protocol ID.
421 *
422 * Note that the ".rpc_protocol_id" field of i'th element in the table
423 * is always "i".  While redundant, this is useful so that you can pass
424 * pointers to individual table elements.
425 *
426 * The fields are:
427 *
428 *      prot_init       The address of an initialization routine in the
429 *                      Protocol Service that will be called by rpc__init.
430 *
431 *      prot_fork_handler  The address of a routine to call to handle
432 *                      protocol specific, fork-related processing.
433 *
434 *      rpc_protocol_id A constant identifier for this RPC Protocol.
435 *
436 *      call_epv        An entry point vector for the Call Services in
437 *                      the Protocol Service.
438 *
439 *      mgmt_epv        An entry point vector for the Management Services in
440 *                      the Protocol Service.
441 *
442 *      binding_epv     An entry point vector for the Binding Services
443 *                      in the Protocol Service.
444 *
445 *      network_epv     An entry point vector for the Network Services
446 *                      in the Protocol Service.
447 */
448
449GLOBAL rpc_protocol_id_elt_t     rpc_g_protocol_id[RPC_C_PROTOCOL_ID_MAX] =
450{
451#if 0
452#ifdef PROT_NCACN
453    {
454        rpc__ncacn_init,                /* Connection-RPC */
455        NULL,
456        RPC_C_PROTOCOL_ID_NCACN,
457        NULL, NULL, NULL, NULL
458    },
459#else
460    {NULL},
461#endif
462
463#ifdef PROT_NCADG
464    {
465        rpc__ncadg_init,                /* Datagram-RPC */
466        NULL,
467        RPC_C_PROTOCOL_ID_NCADG,
468        NULL, NULL, NULL, NULL
469    }
470#else
471    {NULL}
472#endif
473
474#ifdef PROT_NCATP
475    ,{
476        rpc__ncatp_init,                /* Test-RPC */
477        NULL,
478        RPC_C_PROTOCOL_ID_NCATP,
479        NULL, NULL, NULL, NULL
480    }
481#endif
482#endif
483};
484
485/***********************************************************************/
486/*
487 * R P C _ G _ N A F _ I D
488 *
489 * The Network Address Family ID table.  This table is indexed by a NAF
490 * ID.
491 *
492 * Each Network Address Family Extension has an entry in this table.
493 * Note that this is a sparse table because it uses the Unix Address
494 * Family ID's as NAF ID's.
495 *
496 * Note that the ".naf_id" field of i'th element in the table is always
497 * "i".  While redundant, this is useful so that you can pass pointers
498 * to individual table elements.
499 *
500 * The fields are:
501 *
502 *      naf_init        The address of an initialization routine in the
503 *                      NAF Service that will be called by rpc__init
504 *
505 *      naf_id          A constant identifier for this NAF.
506 *
507 *      net_if_id       A constant identifier for the network interface
508 *                      type used in the NAF initialization routine (when
509 *                      determining if this NAF is supported).
510 *
511 *      naf_epv         An entry point vector for the NAF Service.
512 */
513
514GLOBAL rpc_naf_id_elt_t     rpc_g_naf_id[RPC_C_NAF_ID_MAX] =
515{
516#if 0
517    {NULL, 0, 0, NULL},
518    {NULL, 0, 0, NULL},
519#ifdef NAF_IP_STATIC
520    {
521        rpc__ip_init,
522        RPC_C_NAF_ID_IP,
523        RPC_C_NETWORK_IF_ID_DGRAM,
524        NULL
525    },
526#else
527    {NULL, 0, 0, NULL},
528#endif
529    {NULL, 0, 0, NULL},
530    {NULL, 0, 0, NULL},
531    {NULL, 0, 0, NULL},
532    {NULL, 0, 0, NULL},
533    {NULL, 0, 0, NULL},
534    {NULL, 0, 0, NULL},
535    {NULL, 0, 0, NULL},
536    {NULL, 0, 0, NULL},
537    {NULL, 0, 0, NULL},
538#ifdef NAF_DNET_STATIC
539    {
540        rpc__dnet_init,
541        RPC_C_NAF_ID_DNET,
542        RPC_C_NETWORK_IF_ID_SEQPACKET,
543        NULL
544    },
545#else
546    {NULL, 0, 0, NULL},
547#endif
548#ifdef NAF_DDS_STATIC
549    {
550        rpc__dds_init,
551        RPC_C_NAF_ID_DDS,
552        RPC_C_NETWORK_IF_ID_DGRAM,
553        NULL
554    },
555#else
556    {NULL, 0, 0, NULL},
557#endif
558    {NULL, 0, 0, NULL},
559    {NULL, 0, 0, NULL},
560    {NULL, 0, 0, NULL},
561    {NULL, 0, 0, NULL},
562    {NULL, 0, 0, NULL},
563#ifdef NAF_OSI_STATIC
564    {
565        rpc__osi_init,
566        RPC_C_NAF_ID_OSI,
567        RPC_C_NETWORK_IF_ID_STREAM,
568        NULL
569    }
570#else
571    {NULL, 0, 0, NULL}
572#endif
573#endif
574};
575
576/***********************************************************************/
577/*
578 * R P C _ G _ A U T H N _ P R O T O C O L _ I D
579 *
580 * The RPC Authentication Protocol ID table.
581 *
582 * Each RPC Authentication protocol has an entry in this table.  These
583 * entries include the following fields:
584 *
585 *      auth_init           The address of an initialization routine in the
586 *                          Authentication Service that will be called by
587 *                          rpc__init.
588 *
589 *      authn_protocol_id   A constant identifier for this Authentication Service.
590 *
591 *      dce_rpc_authn_protocol_id_t
592 *                          The value that goes into RPC protocol messages to
593 *                          identify which authentication protocol is in use.
594 *
595 *      epv                 An entry point vector for the Authentication Service
596 *                          functions.
597 *
598 * Note that the ".authn_protocol_id" field of i'th element in the table
599 * is always "i".  While redundant, this is useful so that you can pass
600 * pointers to individual table elements.
601 *
602 * Note that the ".auth_protocol_id" contains API values (see
603 * "rpc_c_authn_..." constants in "rpc.idl").
604 * "dce_rpc_authn_protocol_id_t" contains architectural values that appear
605 * in network messages (see "dce_c_rpc_authn_protocol_..." constants in
606 * "nbase.idl").
607 */
608
609/* FreeDCE Note: All auth modules are DSOs loaded via rpc__load_modules by rpc__init */
610
611GLOBAL rpc_authn_protocol_id_elt_t rpc_g_authn_protocol_id[RPC_C_AUTHN_PROTOCOL_ID_MAX] =
612{
613#if 0
614    {                               /* 0 */
615        NULL,
616        rpc_c_authn_none,
617        dce_c_rpc_authn_protocol_none,
618        NULL,
619		  NULL
620    }
621	 ,
622    {                               /* 1 */
623        NULL,
624        rpc_c_authn_dce_private,
625        dce_c_rpc_authn_protocol_krb5,
626        NULL,
627		  NULL
628    },
629    {                               /* 2 (reserved for dce_public) */
630        NULL,
631        rpc_c_authn_dce_public,
632        /* dce_c_rpc_authn_protocol_... */ 0,
633        NULL,
634		  NULL
635    },
636    {                               /* 3 */
637        NULL,
638        rpc_c_authn_dce_dummy,
639        dce_c_rpc_authn_protocol_dummy,
640        NULL,
641		  NULL
642    },
643    {                               /* 4 (reserved for dssa_public) */
644        NULL,
645        rpc_c_authn_dssa_public,
646        0,
647        NULL,
648		  NULL
649    }
650#endif
651};
652
653
654