]>
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 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
26 * Mach Operating System
27 * Copyright (c) 1987 Carnegie-Mellon University
28 * All rights reserved. The CMU software License Agreement specifies
29 * the terms and conditions for use and redistribution.
33 * Definitions of encryption keys etc..
38 * 5-Jun-87 Robert Sansom (rds) at Carnegie Mellon University
39 * Added macros to convert keys between network and host order.
41 * 12-Apr-87 Robert Sansom (rds) at Carnegie Mellon University
44 * 2-Feb-87 Robert Sansom (rds) at Carnegie Mellon University
47 * 5-Nov-86 Robert Sansom (rds) at Carnegie-Mellon University
59 unsigned char key_bytes
[16];
60 unsigned long key_longs
[4];
63 #define KEY_EQUAL(key1, key2) \
64 ((key1.key_longs[0] == key2.key_longs[0]) \
65 && (key1.key_longs[1] == key2.key_longs[1]) \
66 && (key1.key_longs[2] == key2.key_longs[2]) \
67 && (key1.key_longs[3] == key2.key_longs[3]))
69 #define KEY_IS_NULL(key) \
70 (((key).key_longs[0] == 0) && ((key).key_longs[1] == 0) \
71 && ((key).key_longs[2] == 0) && ((key).key_longs[3] == 0))
75 * Macros to convert keys between network and host byte order.
77 #define NTOH_KEY(key) { \
78 (key).key_longs[0] = ntohl((key).key_longs[0]); \
79 (key).key_longs[1] = ntohl((key).key_longs[1]); \
80 (key).key_longs[2] = ntohl((key).key_longs[2]); \
81 (key).key_longs[3] = ntohl((key).key_longs[3]); \
84 #define HTON_KEY(key) { \
85 (key).key_longs[0] = htonl((key).key_longs[0]); \
86 (key).key_longs[1] = htonl((key).key_longs[1]); \
87 (key).key_longs[2] = htonl((key).key_longs[2]); \
88 (key).key_longs[3] = htonl((key).key_longs[3]); \
92 * Structure used to transmit or store a token or a key.
97 } secure_info_t
, *secure_info_ptr_t
;
100 * Security Level of ports and messages.
102 #define PORT_NOT_SECURE 0
103 #define MESSAGE_NOT_SECURE 0
105 #endif /* _KEY_DEFS_ */