| 1 |
/* ----------------------------------------------------------------------- * |
| 2 |
* |
| 3 |
* dev-ioctl-lib.h - autofs device control. |
| 4 |
* |
| 5 |
* Copyright 2008 Red Hat, Inc. All rights reserved. |
| 6 |
* Copyright 2008 Ian Kent <[email protected]> |
| 7 |
* |
| 8 |
* This program is free software; you can redistribute it and/or modify |
| 9 |
* it under the terms of the GNU General Public License as published by |
| 10 |
* the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139, |
| 11 |
* USA; either version 2 of the License, or (at your option) any later |
| 12 |
* version. |
| 13 |
* |
| 14 |
* This program is distributed in the hope that it will be useful, |
| 15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 |
* GNU General Public License for more details. |
| 18 |
* |
| 19 |
* ----------------------------------------------------------------------- */ |
| 20 |
|
| 21 |
#ifndef AUTOFS_DEV_IOCTL_LIB_H |
| 22 |
#define AUTOFS_DEV_IOCTL_LIB_H |
| 23 |
|
| 24 |
#include <linux/auto_dev-ioctl.h> |
| 25 |
|
| 26 |
#define CONTROL_DEVICE "/dev/autofs" |
| 27 |
|
| 28 |
#define DEV_IOCTL_IS_MOUNTED 0x0001 |
| 29 |
#define DEV_IOCTL_IS_AUTOFS 0x0002 |
| 30 |
#define DEV_IOCTL_IS_OTHER 0x0004 |
| 31 |
|
| 32 |
struct ioctl_ctl { |
| 33 |
int devfd; |
| 34 |
struct ioctl_ops *ops; |
| 35 |
}; |
| 36 |
|
| 37 |
struct ioctl_ops { |
| 38 |
int (*version)(unsigned int, int, struct autofs_dev_ioctl *); |
| 39 |
int (*protover)(unsigned int, int, unsigned int *); |
| 40 |
int (*protosubver)(unsigned int, int, unsigned int *); |
| 41 |
int (*mount_device)(unsigned int, const char *, unsigned int, dev_t *); |
| 42 |
int (*open)(unsigned int, int *, dev_t, const char *); |
| 43 |
int (*close)(unsigned int, int); |
| 44 |
int (*send_ready)(unsigned int, int, unsigned int); |
| 45 |
int (*send_fail)(unsigned int, int, unsigned int, int); |
| 46 |
int (*setpipefd)(unsigned int, int, int); |
| 47 |
int (*catatonic)(unsigned int, int); |
| 48 |
int (*timeout)(unsigned int, int, time_t); |
| 49 |
int (*requester)(unsigned int, int, const char *, uid_t *, gid_t *); |
| 50 |
int (*expire)(unsigned int, int, const char *, unsigned int); |
| 51 |
int (*askumount)(unsigned int, int, unsigned int *); |
| 52 |
int (*ismountpoint)(unsigned int, int, const char *, unsigned int *); |
| 53 |
}; |
| 54 |
|
| 55 |
void init_ioctl_ctl(void); |
| 56 |
void close_ioctl_ctl(void); |
| 57 |
struct ioctl_ops *get_ioctl_ops(void); |
| 58 |
struct autofs_dev_ioctl *alloc_ioctl_ctl_open(const char *, unsigned int); |
| 59 |
void free_ioctl_ctl_open(struct autofs_dev_ioctl *); |
| 60 |
|
| 61 |
#endif |
| 62 |
|