2 * Copyright (c) 2006,2011,2014 Apple Inc. All Rights Reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
26 #include <rpc/types.h>
32 extern bool_t
sec_xdr_bytes(XDR
*, uint8_t **, unsigned int *, unsigned int);
33 extern bool_t
sec_xdr_array(XDR
*, uint8_t **, unsigned int *, unsigned int, unsigned int, xdrproc_t
);
34 extern bool_t
sec_xdr_charp(XDR
*, char **, u_int
);
35 extern bool_t
sec_xdr_reference(XDR
*xdrs
, uint8_t **pp
, u_int size
, xdrproc_t proc
);
36 extern bool_t
sec_xdr_pointer(XDR
*xdrs
, uint8_t **objpp
, u_int obj_size
, xdrproc_t xdr_obj
);
38 bool_t
sec_mem_alloc(XDR
*xdr
, u_int bsize
, uint8_t **data
);
39 void sec_mem_free(XDR
*xdr
, void *ptr
, u_int bsize
);
41 void sec_xdrmem_create(XDR
*xdrs
, char *addr
, u_int size
, enum xdr_op op
);
43 typedef struct sec_xdr_arena_allocator
{
48 } sec_xdr_arena_allocator_t
;
50 #define xdr_arena_magic 0xAEA1
51 #define xdr_size_magic 0xDEAD
53 void sec_xdr_arena_init_size_alloc(sec_xdr_arena_allocator_t
*arena
, XDR
*xdr
);
54 bool_t
sec_xdr_arena_init(sec_xdr_arena_allocator_t
*arena
, XDR
*xdr
,
55 size_t in_length
, uint8_t *in_data
);
56 void sec_xdr_arena_free(sec_xdr_arena_allocator_t
*alloc
, void *ptr
, size_t bsize
);
57 void *sec_xdr_arena_data(sec_xdr_arena_allocator_t
*alloc
);
58 sec_xdr_arena_allocator_t
*sec_xdr_arena_allocator(XDR
*xdr
);
59 bool_t
sec_xdr_arena_size_allocator(XDR
*xdr
);
61 bool_t
copyin(void * data
, xdrproc_t proc
, void ** copy
, u_int
* size
);
62 bool_t
copyout(const void * copy
, u_int size
, xdrproc_t proc
, void ** data
, u_int
*length
);
63 bool_t
copyout_chunked(const void * copy
, u_int size
, xdrproc_t proc
, void ** data
);
65 u_int
sec_xdr_sizeof_in(xdrproc_t func
, void * data
);
66 u_int
sec_xdr_sizeof_out(const void * copy
, u_int size
, xdrproc_t func
, void ** data
);
70 #endif /* !_SEC_XDR_H */