aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>1997-10-06 21:05:49 +0000
committerH. Peter Anvin <hpa@zytor.com>1997-10-06 21:05:49 +0000
commitbddd43e289c8b8b62d7cb3f1f7eb27ca67cae28e (patch)
treeaac5e4a4b924cb13a54cc0760e99f349ea36bd12 /include
downloadautofs3-bddd43e289c8b8b62d7cb3f1f7eb27ca67cae28e.tar.gz
autofs3-bddd43e289c8b8b62d7cb3f1f7eb27ca67cae28e.tar.xz
autofs3-bddd43e289c8b8b62d7cb3f1f7eb27ca67cae28e.zip
Initial revision
Diffstat (limited to 'include')
-rw-r--r--include/automount.h111
-rw-r--r--include/linux/auto_fs.h62
2 files changed, 173 insertions, 0 deletions
diff --git a/include/automount.h b/include/automount.h
new file mode 100644
index 0000000..c7b6baf
--- /dev/null
+++ b/include/automount.h
@@ -0,0 +1,111 @@
+/*
+ * automount.h
+ *
+ * Header file for automounter modules
+ *
+ */
+
+#ifndef AUTOMOUNT_H
+#define AUTOMOUNT_H
+
+#include <paths.h>
+
+#ifndef _PATH_MOUNT
+#define _PATH_MOUNT "/bin/mount"
+#endif
+#ifndef _PATH_UMOUNT
+#define _PATH_UMOUNT "/bin/umount"
+#endif
+
+/* If smbmount is unavailable, remote the mount_smbfs module from
+ modules/Makefile */
+
+#ifndef _PATH_SMBMOUNT
+#define _PATH_SMBMOUNT "/usr/bin/smbmount"
+#endif
+
+/* Standard function used by daemon or modules */
+
+int spawnl(int logpri, const char *prog, ...);
+int spawnv(int logpri, const char *prog, const char * const *argv);
+void reset_signals(void);
+int do_mount(const char *root, const char *name, int name_len,
+ const char *what, const char *fstype, const char *options);
+
+/* Prototype for module functions */
+
+/* lookup module */
+
+#define AUTOFS_LOOKUP_VERSION 4
+
+#ifdef MODULE_LOOKUP
+int lookup_init(const char *mapfmt, int argc, const char * const *argv,
+ void **context);
+int lookup_mount(const char *, const char *, int, void *);
+int lookup_done(void *);
+#endif
+typedef (*lookup_init_t)(const char *, int, const char * const *, void **);
+typedef (*lookup_mount_t)(const char *, const char *, int, void *);
+typedef (*lookup_done_t)(void *);
+struct lookup_mod {
+ lookup_init_t lookup_init;
+ lookup_mount_t lookup_mount;
+ lookup_done_t lookup_done;
+ void *dlhandle;
+ void *context;
+};
+struct lookup_mod *open_lookup(const char *name, const char *err_prefix,
+ const char *mapfmt,
+ int argc, const char * const *argv);
+int close_lookup(struct lookup_mod *);
+
+/* parse module */
+
+#define AUTOFS_PARSE_VERSION 3
+
+#ifdef MODULE_PARSE
+int parse_init(int argc, const char * const *argv, void **context);
+int parse_mount(const char *root, const char *name,
+ int name_len, const char *mapent, void *context);
+int parse_done(void *);
+#endif
+typedef (*parse_init_t)(int, const char * const *,void **);
+typedef (*parse_mount_t)(const char *,const char *,int, const char *,void *);
+typedef (*parse_done_t)(void *);
+struct parse_mod {
+ parse_init_t parse_init;
+ parse_mount_t parse_mount;
+ parse_done_t parse_done;
+ void *dlhandle;
+ void *context;
+};
+struct parse_mod *open_parse(const char *name, const char *err_prefix,
+ int argc, const char * const *argv);
+int close_parse(struct parse_mod *);
+
+/* mount module */
+
+#define AUTOFS_MOUNT_VERSION 4
+
+#ifdef MODULE_MOUNT
+int mount_init(void **context);
+int mount_mount(const char *root, const char *name, int name_len,
+ const char *what, const char *fstype, const char *options,
+ void *context);
+int mount_done(void *context);
+#endif
+typedef (*mount_init_t)(void **);
+typedef (*mount_mount_t)(const char *, const char *, int, const char *, const char *, const char *, void *);
+typedef (*mount_done_t)(void *);
+struct mount_mod {
+ mount_init_t mount_init;
+ mount_mount_t mount_mount;
+ mount_done_t mount_done;
+ void *dlhandle;
+ void *context;
+};
+struct mount_mod *open_mount(const char *name, const char *err_prefix);
+int close_mount(struct mount_mod *);
+
+
+#endif /* AUTOMOUNT_H */
diff --git a/include/linux/auto_fs.h b/include/linux/auto_fs.h
new file mode 100644
index 0000000..2b25d29
--- /dev/null
+++ b/include/linux/auto_fs.h
@@ -0,0 +1,62 @@
+/* -*- linux-c -*- ------------------------------------------------------- *
+ *
+ * linux/include/linux/auto_fs.h
+ *
+ * Copyright 1997 Transmeta Corporation - All Rights Reserved
+ *
+ * This file is part of the Linux kernel and is made available under
+ * the terms of the GNU General Public License, version 2, or at your
+ * option, any later version, incorporated herein by reference.
+ *
+ * ----------------------------------------------------------------------- */
+
+
+#ifndef _LINUX_AUTO_FS_H
+#define _LINUX_AUTO_FS_H
+
+#include <linux/version.h>
+#include <linux/fs.h>
+#include <linux/limits.h>
+#include <linux/ioctl.h>
+#include <asm/types.h>
+
+#define AUTOFS_PROTO_VERSION 3
+
+enum autofs_packet_type {
+ autofs_ptype_missing, /* Missing entry (mount request) */
+ autofs_ptype_expire, /* Expire entry (umount request) */
+};
+
+struct autofs_packet_hdr {
+ int proto_version; /* Protocol version */
+ enum autofs_packet_type type; /* Type of packet */
+};
+
+struct autofs_packet_missing {
+ struct autofs_packet_hdr hdr;
+ unsigned long wait_queue_token;
+ int len;
+ char name[NAME_MAX+1];
+};
+
+struct autofs_packet_expire {
+ struct autofs_packet_hdr hdr;
+ int len;
+ char name[NAME_MAX+1];
+};
+
+#define AUTOFS_IOC_READY _IO(0x93,0x60)
+#define AUTOFS_IOC_FAIL _IO(0x93,0x61)
+#define AUTOFS_IOC_CATATONIC _IO(0x93,0x62)
+#define AUTOFS_IOC_PROTOVER _IOR(0x93,0x63,int)
+#define AUTOFS_IOC_SETTIMEOUT _IOWR(0x93,0x64,unsigned long)
+#define AUTOFS_IOC_EXPIRE _IOR(0x93,0x65,struct autofs_packet_expire)
+
+#ifdef __KERNEL__
+
+/* Init function */
+int init_autofs_fs(void);
+
+#endif /* __KERNEL__ */
+
+#endif /* _LINUX_AUTO_FS_H */