Blame src/include/kcm.h

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