b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek/* include/kcm.h - Kerberos cache manager protocol declarations */
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * Copyright (C) 2014 by the Massachusetts Institute of Technology.
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * All rights reserved.
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * Redistribution and use in source and binary forms, with or without
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * modification, are permitted provided that the following conditions
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * * Redistributions of source code must retain the above copyright
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * notice, this list of conditions and the following disclaimer.
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * * Redistributions in binary form must reproduce the above copyright
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * notice, this list of conditions and the following disclaimer in
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * the documentation and/or other materials provided with the
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * distribution.
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * OF THE POSSIBILITY OF SUCH DAMAGE.
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek/* This should ideally be in RUNSTATEDIR, but Heimdal uses a hardcoded
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * /var/run, and we need to use the same default path. */
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek#define DEFAULT_KCM_SOCKET_PATH "/var/run/.heim_org.h5l.kcm-socket"
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * All requests begin with:
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * major version (1 bytes)
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * minor version (1 bytes)
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * opcode (16-bit big-endian)
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * All replies begin with a 32-bit big-endian reply code.
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * Parameters are appended to the request or reply with no delimiters. Flags
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * and time offsets are stored as 32-bit big-endian integers. Names are
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * marshalled as zero-terminated strings. Principals and credentials are
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * marshalled in the v4 FILE ccache format. UUIDs are 16 bytes. UUID lists
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * are not delimited, so nothing can come after them.
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek/* Opcodes without comments are currently unused in the MIT client
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek * implementation. */
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek KCM_OP_INITIALIZE, /* 0x4 (name, princ) -> () */
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek KCM_OP_GET_PRINCIPAL, /* 0x8 (name) -> (princ) */
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek KCM_OP_GET_CRED_UUID_LIST, /* 0x9 (name) -> (uuid, ...) */
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek KCM_OP_GET_CRED_BY_UUID, /* 0xa (name, uuid) -> (cred) */
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek KCM_OP_REMOVE_CRED, /* (name, flags, credtag) -> () */
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek KCM_OP_GET_CACHE_UUID_LIST, /* 0x12 () -> (uuid, ...) */
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek KCM_OP_GET_CACHE_BY_UUID, /* 0x13 (uuid) -> (name) */
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek KCM_OP_GET_DEFAULT_CACHE, /* 0x14 () -> (name) */
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek KCM_OP_SET_DEFAULT_CACHE, /* 0x15 (name) -> () */
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek KCM_OP_GET_KDC_OFFSET, /* 0x16 (name) -> (offset) */
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek KCM_OP_SET_KDC_OFFSET, /* 0x17 (name, offset) -> () */
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek KCM_OP_SENTINEL, /* SSSD addition, not in the MIT header */
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek#endif /* KCM_H */