]>
git.saurik.com Git - apple/xnu.git/blob - libsyscall/mach/servers/key_defs.h
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
29 * Mach Operating System
30 * Copyright (c) 1987 Carnegie-Mellon University
31 * All rights reserved. The CMU software License Agreement specifies
32 * the terms and conditions for use and redistribution.
36 * Definitions of encryption keys etc..
41 * 5-Jun-87 Robert Sansom (rds) at Carnegie Mellon University
42 * Added macros to convert keys between network and host order.
44 * 12-Apr-87 Robert Sansom (rds) at Carnegie Mellon University
47 * 2-Feb-87 Robert Sansom (rds) at Carnegie Mellon University
50 * 5-Nov-86 Robert Sansom (rds) at Carnegie-Mellon University
62 unsigned char key_bytes
[16];
63 unsigned long key_longs
[4];
66 #define KEY_EQUAL(key1, key2) \
67 ((key1.key_longs[0] == key2.key_longs[0]) \
68 && (key1.key_longs[1] == key2.key_longs[1]) \
69 && (key1.key_longs[2] == key2.key_longs[2]) \
70 && (key1.key_longs[3] == key2.key_longs[3]))
72 #define KEY_IS_NULL(key) \
73 (((key).key_longs[0] == 0) && ((key).key_longs[1] == 0) \
74 && ((key).key_longs[2] == 0) && ((key).key_longs[3] == 0))
78 * Macros to convert keys between network and host byte order.
80 #define NTOH_KEY(key) { \
81 (key).key_longs[0] = ntohl((key).key_longs[0]); \
82 (key).key_longs[1] = ntohl((key).key_longs[1]); \
83 (key).key_longs[2] = ntohl((key).key_longs[2]); \
84 (key).key_longs[3] = ntohl((key).key_longs[3]); \
87 #define HTON_KEY(key) { \
88 (key).key_longs[0] = htonl((key).key_longs[0]); \
89 (key).key_longs[1] = htonl((key).key_longs[1]); \
90 (key).key_longs[2] = htonl((key).key_longs[2]); \
91 (key).key_longs[3] = htonl((key).key_longs[3]); \
95 * Structure used to transmit or store a token or a key.
100 } secure_info_t
, *secure_info_ptr_t
;
103 * Security Level of ports and messages.
105 #define PORT_NOT_SECURE 0
106 #define MESSAGE_NOT_SECURE 0
108 #endif /* _KEY_DEFS_ */