]>
git.saurik.com Git - apple/libc.git/blob - mach/servers/key_defs.h
2 * Copyright (c) 1999 Apple Computer, 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@
24 * Mach Operating System
25 * Copyright (c) 1987 Carnegie-Mellon University
26 * All rights reserved. The CMU software License Agreement specifies
27 * the terms and conditions for use and redistribution.
31 * Definitions of encryption keys etc..
36 * 5-Jun-87 Robert Sansom (rds) at Carnegie Mellon University
37 * Added macros to convert keys between network and host order.
39 * 12-Apr-87 Robert Sansom (rds) at Carnegie Mellon University
42 * 2-Feb-87 Robert Sansom (rds) at Carnegie Mellon University
45 * 5-Nov-86 Robert Sansom (rds) at Carnegie-Mellon University
57 unsigned char key_bytes
[16];
58 unsigned long key_longs
[4];
61 #define KEY_EQUAL(key1, key2) \
62 ((key1.key_longs[0] == key2.key_longs[0]) \
63 && (key1.key_longs[1] == key2.key_longs[1]) \
64 && (key1.key_longs[2] == key2.key_longs[2]) \
65 && (key1.key_longs[3] == key2.key_longs[3]))
67 #define KEY_IS_NULL(key) \
68 (((key).key_longs[0] == 0) && ((key).key_longs[1] == 0) \
69 && ((key).key_longs[2] == 0) && ((key).key_longs[3] == 0))
73 * Macros to convert keys between network and host byte order.
75 #define NTOH_KEY(key) { \
76 (key).key_longs[0] = ntohl((key).key_longs[0]); \
77 (key).key_longs[1] = ntohl((key).key_longs[1]); \
78 (key).key_longs[2] = ntohl((key).key_longs[2]); \
79 (key).key_longs[3] = ntohl((key).key_longs[3]); \
82 #define HTON_KEY(key) { \
83 (key).key_longs[0] = htonl((key).key_longs[0]); \
84 (key).key_longs[1] = htonl((key).key_longs[1]); \
85 (key).key_longs[2] = htonl((key).key_longs[2]); \
86 (key).key_longs[3] = htonl((key).key_longs[3]); \
90 * Structure used to transmit or store a token or a key.
95 } secure_info_t
, *secure_info_ptr_t
;
98 * Security Level of ports and messages.
100 #define PORT_NOT_SECURE 0
101 #define MESSAGE_NOT_SECURE 0
103 #endif /* _KEY_DEFS_ */