autofs_prot.defs   [plain text]


/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 * or http://www.opensolaris.org/os/licensing.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information: Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 */
/*
 * Copyright 1993-1999, 2002 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

/*
 * From OpenSolaris
 *
 * #pragma ident	"@(#)autofs_prot.x	1.20	05/06/08 SMI"
 */

/*
 * Portions Copyright 2007-2011 Apple Inc.
 */

subsystem KernelUser autofs 666;

#include <mach/std_types.defs>
#include <mach/mach_types.defs>

#include <sys/syslimits.h>
#include "autofs_defs.h"
#include "autofs_migtypes.h"

import <autofs_types.h>;

/*
 * AUTOFS routines.
 */

/*
 * Mount request.
 * Request automountd to mount the map entry associated with
 * 'path/subdir/name' in 'map' given 'opts' options.
 */
routine autofs_mount(
	server		: mach_port_t;
	in map		: autofs_pathname;	/* context or map name */
	in path		: autofs_pathname;	/* mountpoint */
	in name		: autofs_component;	/* entry we're looking for */
	in subdir	: autofs_pathname;	/* subdir within map */
	in opts		: autofs_opts;
	in isdirect	: boolean_t;		/* direct mountpoint? */
	in issubtrigger	: boolean_t;		/* is this a subtrigger? */
	in mntpnt_fsid	: fsid_t;		/* fsid of FS on which we're mounting */
	in sendereuid	: uint32_t;		/* EUID of process sending request */
	in auditsesid	: int32_t;		/* audit session id of the process sending request */
	out mr_type	: int;			/* enum autofs_stat */
	out fsid	: fsid_t;		/* fsid of FS we mounted */
	out retflags	: uint32_t;		/* assorted MOUNT_RETF_ flags */
	out actions	: byte_buffer, dealloc;	/* variable number of entries */
	out err		: int;
	out mr_verbose	: boolean_t;
	ServerSecToken token : security_token_t
);

/*
 * Unmount request.
 * Automountd will issue unmount system call for the file system with the
 * given fsid with the given fstype, etc..
 * Status returned is 0 if the unmount was successful, an errno otherwise.
 */
routine autofs_unmount(
	server		: mach_port_t;
	in mntpnt_fsid	: fsid_t;		/* mntpnt fsid */
	in mntresource	: autofs_pathname;	/* mntpnt source */
	in mntpnt	: autofs_pathname;	/* mntpnt to unmount */
	in fstype	: autofs_fstype;	/* filesystem type to unmount */
	in mntopts	: autofs_opts;		/* mntpnt options */
	out status	: int;
	ServerSecToken token : security_token_t
);

/*
 * Readdir request.
 * Request list of entries in 'rda_map' map starting at the given
 * offset 'rda_offset', for 'rda_count' bytes.
 */
routine autofs_readdir(
	server			: mach_port_t;
	in rda_map		: autofs_pathname;
	in rda_offset		: int64_t;	/* starting offset */
	in rda_count		: uint32_t;	/* total size requested */
	out status		: int;
	out rddir_offset	: int64_t;	/* last offset in list */
	out rddir_eof		: boolean_t;	/* TRUE if last entry in result */
	out rddir_entries	: byte_buffer, dealloc;
						/* variable number of entries */
	ServerSecToken token : security_token_t
);

/*
 * Readdir request for subdirectories under a map.
 * Request list of entries in 'rda_map' map entry 'rda_key' underneath
 * the subdirectory 'rda_subdir',  starting at the given offset 'rda_offset',
 * for 'rda_count' bytes.
 */
routine autofs_readsubdir(
	server			: mach_port_t;
	in rda_map		: autofs_pathname;
	in rda_name		: autofs_component;	/* entry we're looking for */
	in rda_subdir		: autofs_pathname;	/* subdir within map */
	in rda_mntopts		: autofs_opts;		/* mntpnt options */
	in rda_parentino	: uint32_t;		/* (lower 32 bits of) parent inode number */
	in rda_offset		: int64_t;		/* starting offset */
	in rda_count		: uint32_t;		/* total size requested */
	out status		: int;
	out rddir_offset	: int64_t;		/* last offset in list */
	out rddir_eof		: boolean_t;		/* TRUE if last entry in result */
	out rddir_entries	: byte_buffer, dealloc;
							/* variable number of entries */
	ServerSecToken token : security_token_t
);

/*
 * Lookup request.
 * Query automountd if 'subdir/name' exists in 'map'
 */
routine autofs_lookup(
	server		: mach_port_t;
	in map		: autofs_pathname;	/* context or map name */
	in path		: autofs_pathname;	/* mountpoint */
	in name		: autofs_component;	/* entry we're looking for */
	in subdir	: autofs_pathname;	/* subdir within map */
	in opts		: autofs_opts;
	in isdirect	: boolean_t;		/* direct mountpoint? */
	in sendereuid	: uint32_t;		/* EUID of process sending request */
	out err		: int;
	out node_type	: int;
	out lu_verbose	: boolean_t;
	ServerSecToken token : security_token_t
);

/*
 * Mount-submount-trigger request.
 * Request automountd to mount autofs as a trigger on submntpt under
 * mntpt.
 */
routine autofs_mount_subtrigger(
	server		: mach_port_t;
	in mntpt	: autofs_pathname;	/* top-level mount point */
	in submntpt	: autofs_pathname;	/* submount point relative to mntpt */
	in path		: autofs_pathname;	/* path mount argument */
	in opts		: autofs_opts;		/* opts mount argument */
	in map		: autofs_pathname;	/* map mount argument */
	in subdir	: autofs_pathname;	/* subdir mount argument */
	in key		: autofs_pathname;	/* key mount argument */
	in flags	: uint32_t;		/* flags argument to mount() */
	in mntflags	: uint32_t;		/* mntflags mount argument */
	in direct	: int32_t;		/* direct mount argument */
	out fsid	: fsid_t;		/* fsid of FS we mounted */
	out top_level	: boolean_t;		/* true if submntpt empty */
	out err		: int;
	ServerSecToken token : security_token_t
);

/*
 * "Mount URL" request.
 * Request automountd to mount the specified URL at the specified mount
 * point with the specified options.
 */
routine autofs_mount_url(
	server		: mach_port_t;
	in url		: autofs_pathname;	/* URL to mount */
	in mountpoint	: autofs_pathname;	/* mountpoint */
	in opts		: autofs_opts;		/* mount options; null string if none */
	in mntpnt_fsid	: fsid_t;		/* fsid of FS on which we're mounting */
	in sendereuid	: uint32_t;		/* EUID of process sending request */
	in auditsesid	: int32_t;		/* audit session id of the process sending request */
	out fsid	: fsid_t;		/* fsid of FS we mounted */
	out retflags	: uint32_t;		/* assorted MOUNT_RETF_ flags */
	out err		: int;
	ServerSecToken token : security_token_t
);

/*
 * "Remount SMB server" request.
 * Request that automountd call SMBRemountServer() with the blob passed
 * in as an argument.
 */
simpleroutine autofs_smb_remount_server(
	server		: mach_port_t;
	in blob		: byte_buffer, dealloc;	/* opaque blob */
	in asid		: int32_t;  /* Audit session id of caller */
	ServerSecToken token : security_token_t
);