1178825Sdfr/*
2178825Sdfr * Copyright (c) 2005, PADL Software Pty Ltd.
3178825Sdfr * All rights reserved.
4178825Sdfr *
5233294Sstas * Portions Copyright (c) 2009 Apple Inc. All rights reserved.
6233294Sstas *
7178825Sdfr * Redistribution and use in source and binary forms, with or without
8178825Sdfr * modification, are permitted provided that the following conditions
9178825Sdfr * are met:
10178825Sdfr *
11178825Sdfr * 1. Redistributions of source code must retain the above copyright
12178825Sdfr *    notice, this list of conditions and the following disclaimer.
13178825Sdfr *
14178825Sdfr * 2. Redistributions in binary form must reproduce the above copyright
15178825Sdfr *    notice, this list of conditions and the following disclaimer in the
16178825Sdfr *    documentation and/or other materials provided with the distribution.
17178825Sdfr *
18178825Sdfr * 3. Neither the name of PADL Software nor the names of its contributors
19178825Sdfr *    may be used to endorse or promote products derived from this software
20178825Sdfr *    without specific prior written permission.
21178825Sdfr *
22178825Sdfr * THIS SOFTWARE IS PROVIDED BY PADL SOFTWARE AND CONTRIBUTORS ``AS IS'' AND
23178825Sdfr * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24178825Sdfr * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25178825Sdfr * ARE DISCLAIMED.  IN NO EVENT SHALL PADL SOFTWARE OR CONTRIBUTORS BE LIABLE
26178825Sdfr * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27178825Sdfr * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28178825Sdfr * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29178825Sdfr * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30178825Sdfr * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31178825Sdfr * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32178825Sdfr * SUCH DAMAGE.
33178825Sdfr */
34178825Sdfr
35178825Sdfr#ifndef __KCM_H__
36178825Sdfr#define __KCM_H__
37178825Sdfr
38178825Sdfr/*
39178825Sdfr * KCM protocol definitions
40178825Sdfr */
41178825Sdfr
42233294Sstas#define KCM_PROTOCOL_VERSION_MAJOR	2
43178825Sdfr#define KCM_PROTOCOL_VERSION_MINOR	0
44178825Sdfr
45233294Sstastypedef unsigned char kcmuuid_t[16];
46233294Sstas
47178825Sdfrtypedef enum kcm_operation {
48178825Sdfr    KCM_OP_NOOP,
49178825Sdfr    KCM_OP_GET_NAME,
50178825Sdfr    KCM_OP_RESOLVE,
51178825Sdfr    KCM_OP_GEN_NEW,
52178825Sdfr    KCM_OP_INITIALIZE,
53178825Sdfr    KCM_OP_DESTROY,
54178825Sdfr    KCM_OP_STORE,
55178825Sdfr    KCM_OP_RETRIEVE,
56178825Sdfr    KCM_OP_GET_PRINCIPAL,
57233294Sstas    KCM_OP_GET_CRED_UUID_LIST,
58233294Sstas    KCM_OP_GET_CRED_BY_UUID,
59178825Sdfr    KCM_OP_REMOVE_CRED,
60178825Sdfr    KCM_OP_SET_FLAGS,
61178825Sdfr    KCM_OP_CHOWN,
62178825Sdfr    KCM_OP_CHMOD,
63178825Sdfr    KCM_OP_GET_INITIAL_TICKET,
64178825Sdfr    KCM_OP_GET_TICKET,
65233294Sstas    KCM_OP_MOVE_CACHE,
66233294Sstas    KCM_OP_GET_CACHE_UUID_LIST,
67233294Sstas    KCM_OP_GET_CACHE_BY_UUID,
68233294Sstas    KCM_OP_GET_DEFAULT_CACHE,
69233294Sstas    KCM_OP_SET_DEFAULT_CACHE,
70233294Sstas    KCM_OP_GET_KDC_OFFSET,
71233294Sstas    KCM_OP_SET_KDC_OFFSET,
72233294Sstas    /* NTLM operations */
73233294Sstas    KCM_OP_ADD_NTLM_CRED,
74233294Sstas    KCM_OP_HAVE_NTLM_CRED,
75233294Sstas    KCM_OP_DEL_NTLM_CRED,
76233294Sstas    KCM_OP_DO_NTLM_AUTH,
77233294Sstas    KCM_OP_GET_NTLM_USER_LIST,
78178825Sdfr    KCM_OP_MAX
79178825Sdfr} kcm_operation;
80178825Sdfr
81178825Sdfr#define _PATH_KCM_SOCKET      "/var/run/.kcm_socket"
82178825Sdfr#define _PATH_KCM_DOOR      "/var/run/.kcm_door"
83178825Sdfr
84233294Sstas#define KCM_NTLM_FLAG_SESSIONKEY 1
85233294Sstas#define KCM_NTLM_FLAG_NTLM2_SESSION 2
86233294Sstas#define KCM_NTLM_FLAG_KEYEX 4
87233294Sstas#define KCM_NTLM_FLAG_AV_GUEST 8
88233294Sstas
89178825Sdfr#endif /* __KCM_H__ */
90178825Sdfr
91