/*
 * Login.defs
 *
 * Mach Interface specifications for Kerberos Login IPC
 *
 */
 
subsystem KerberosLoginIPC 128;
 
#include <mach/std_types.defs>
#include <mach/mach_types.defs>

type	DataBlob              = array [] of char;

type	KLIPCInString         = DataBlob;
type	KLIPCOutString        = DataBlob;
type	KLIPCInIntArray       = array [] of int32;

type	KLIPCInPrincipal      = DataBlob;
type	KLIPCOutPrincipal     = DataBlob;

type	KLIPCInLoginOptions   = DataBlob;
type	KLIPCOutLoginOptions  = DataBlob;

type	KLIPCInBuffer         = DataBlob;
type	KLIPCOutBuffer        = DataBlob;

type	KLIPCStatus           = unsigned32;
type	KLIPCBoolean          = unsigned32;
type	KLIPCTime             = unsigned32;
type	KLIPCIndex            = unsigned32;
type	KLIPCSize             = unsigned32;

type	KLIPCPid              = int32;
type	KLIPCFlags            = int32;
type	KLIPCBuffer           = DataBlob;
type	KLIPCData             = DataBlob;

type	KLIPCKerberosVersion  = unsigned32;
type	KLIPCDialogIdentifier = unsigned32;


import "KLMachIPC.h";

// These are the bottleneck routines which have UI.

// We do these via Mach IPC so we can support client-side idling and killing the
// server if the user cancels all dialogs.  

serverprefix KLSIPC;
userprefix KLIPC;

waittime kKLMachIPCTimeout;

routine GetServerPID (inServerPort : mach_port_t;
                  out outServerPID : KLIPCPid;
             UserSecToken outToken : security_token_t);

routine AcquireNewInitialTickets (inServerPort : mach_port_t;
                             inApplicationName : KLIPCInString;
                         inApplicationIconPath : KLIPCInString;
                    inAllowHomeDirectoryAccess : KLIPCBoolean;

                                   inPrincipal : KLIPCInPrincipal;
                                       inFlags : KLIPCFlags;
                                    inLifetime : KLIPCTime;
                                   inRenewLife : KLIPCTime;
                                   inStartTime : KLIPCTime;
                                 inForwardable : KLIPCBoolean;
                                   inProxiable : KLIPCBoolean;
                                 inAddressless : KLIPCBoolean;
                                 inServiceName : KLIPCInString;
                              out outPrincipal : KLIPCOutPrincipal;
                              out outCacheName : KLIPCOutString;
                                out outResult : KLIPCStatus);


routine Prompter (inServerPort : mach_port_t;
             inApplicationName : KLIPCInString;
         inApplicationIconPath : KLIPCInString;
    inAllowHomeDirectoryAccess : KLIPCBoolean;
                  
                        inName : KLIPCInString;
                      inBanner : KLIPCInString;
                  inNumPrompts : KLIPCIndex;
                     inPrompts : KLIPCInString;
                     inHiddens : KLIPCInString;
                  inReplySizes : KLIPCInIntArray;
                out outReplies : KLIPCOutString;
                 out outResult : KLIPCStatus);


routine ChangePassword (inServerPort : mach_port_t;
                   inApplicationName : KLIPCInString;
               inApplicationIconPath : KLIPCInString;
          inAllowHomeDirectoryAccess : KLIPCBoolean;
                        
                         inPrincipal : KLIPCInPrincipal;
                       out outResult : KLIPCStatus);


routine HandleError (inServerPort : mach_port_t;
                inApplicationName : KLIPCInString;
            inApplicationIconPath : KLIPCInString;
       inAllowHomeDirectoryAccess : KLIPCBoolean;
                     
                          inError : KLIPCStatus;
                         inDialog : KLIPCDialogIdentifier;
                      inShowAlert : KLIPCBoolean;
                    out outResult : KLIPCStatus);
