]>
git.saurik.com Git - apple/libc.git/blob - mach/servers/key_defs.h
a44d5269c9430cbe2f87eb808588ec8ce07da9be
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
23 * Mach Operating System
24 * Copyright (c) 1987 Carnegie-Mellon University
25 * All rights reserved. The CMU software License Agreement specifies
26 * the terms and conditions for use and redistribution.
30 * Definitions of encryption keys etc..
35 * 5-Jun-87 Robert Sansom (rds) at Carnegie Mellon University
36 * Added macros to convert keys between network and host order.
38 * 12-Apr-87 Robert Sansom (rds) at Carnegie Mellon University
41 * 2-Feb-87 Robert Sansom (rds) at Carnegie Mellon University
44 * 5-Nov-86 Robert Sansom (rds) at Carnegie-Mellon University
56 unsigned char key_bytes
[16];
57 unsigned long key_longs
[4];
60 #define KEY_EQUAL(key1, key2) \
61 ((key1.key_longs[0] == key2.key_longs[0]) \
62 && (key1.key_longs[1] == key2.key_longs[1]) \
63 && (key1.key_longs[2] == key2.key_longs[2]) \
64 && (key1.key_longs[3] == key2.key_longs[3]))
66 #define KEY_IS_NULL(key) \
67 (((key).key_longs[0] == 0) && ((key).key_longs[1] == 0) \
68 && ((key).key_longs[2] == 0) && ((key).key_longs[3] == 0))
72 * Macros to convert keys between network and host byte order.
74 #define NTOH_KEY(key) { \
75 (key).key_longs[0] = ntohl((key).key_longs[0]); \
76 (key).key_longs[1] = ntohl((key).key_longs[1]); \
77 (key).key_longs[2] = ntohl((key).key_longs[2]); \
78 (key).key_longs[3] = ntohl((key).key_longs[3]); \
81 #define HTON_KEY(key) { \
82 (key).key_longs[0] = htonl((key).key_longs[0]); \
83 (key).key_longs[1] = htonl((key).key_longs[1]); \
84 (key).key_longs[2] = htonl((key).key_longs[2]); \
85 (key).key_longs[3] = htonl((key).key_longs[3]); \
89 * Structure used to transmit or store a token or a key.
94 } secure_info_t
, *secure_info_ptr_t
;
97 * Security Level of ports and messages.
99 #define PORT_NOT_SECURE 0
100 #define MESSAGE_NOT_SECURE 0
102 #endif /* _KEY_DEFS_ */