| 1 |
/* |
| 2 |
* include/linux/lsm2caitsith.h |
| 3 |
* |
| 4 |
* Copyright (C) 2005-2012 NTT DATA CORPORATION |
| 5 |
* |
| 6 |
* Version: 0.2.3 2018/04/01 |
| 7 |
*/ |
| 8 |
|
| 9 |
#ifndef _LINUX_LSM2CAITSITH_H |
| 10 |
#define _LINUX_LSM2CAITSITH_H |
| 11 |
|
| 12 |
#include <linux/version.h> |
| 13 |
#include <linux/uidgid.h> |
| 14 |
|
| 15 |
#ifdef CONFIG_CAITSITH |
| 16 |
|
| 17 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0) |
| 18 |
int ccs_settime(const struct timespec64 *ts, const struct timezone *tz); |
| 19 |
#else |
| 20 |
int ccs_settime(const struct timespec *ts, const struct timezone *tz); |
| 21 |
#endif |
| 22 |
int ccs_sb_umount(struct vfsmount *mnt, int flags); |
| 23 |
|
| 24 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0) |
| 25 |
int ccs_inode_getattr(struct vfsmount *mnt, struct dentry *dentry); |
| 26 |
#else |
| 27 |
int ccs_inode_getattr(const struct path *path); |
| 28 |
#endif |
| 29 |
int ccs_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg); |
| 30 |
int ccs_file_fcntl(struct file *file, unsigned int cmd, unsigned long arg); |
| 31 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) |
| 32 |
int ccs_file_open(struct file *file); |
| 33 |
#else |
| 34 |
int ccs_file_open(struct file *file, const struct cred *cred); |
| 35 |
#endif |
| 36 |
int ccs_socket_create(int family, int type, int protocol, int kern); |
| 37 |
int ccs_socket_bind(struct socket *sock, struct sockaddr *address, |
| 38 |
int addrlen); |
| 39 |
int ccs_socket_connect(struct socket *sock, struct sockaddr *address, |
| 40 |
int addrlen); |
| 41 |
int ccs_socket_listen(struct socket *sock, int backlog); |
| 42 |
int ccs_socket_sendmsg(struct socket *sock, struct msghdr *msg, int size); |
| 43 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0) |
| 44 |
int ccs_path_chmod(const struct path *path, umode_t mode); |
| 45 |
int ccs_path_chown(const struct path *path, kuid_t uid, kgid_t gid); |
| 46 |
int ccs_path_chroot(const struct path *path); |
| 47 |
int ccs_path_link(struct dentry *old_dentry, const struct path *new_dir, |
| 48 |
struct dentry *new_dentry); |
| 49 |
int ccs_path_mkdir(const struct path *dir, struct dentry *dentry, |
| 50 |
umode_t mode); |
| 51 |
int ccs_path_mknod(const struct path *dir, struct dentry *dentry, umode_t mode, |
| 52 |
unsigned int dev); |
| 53 |
int ccs_path_rename(const struct path *old_dir, struct dentry *old_dentry, |
| 54 |
const struct path *new_dir, struct dentry *new_dentry); |
| 55 |
int ccs_path_rmdir(const struct path *dir, struct dentry *dentry); |
| 56 |
int ccs_path_symlink(const struct path *dir, struct dentry *dentry, |
| 57 |
const char *old_name); |
| 58 |
int ccs_path_truncate(const struct path *path); |
| 59 |
int ccs_path_unlink(const struct path *dir, struct dentry *dentry); |
| 60 |
int ccs_sb_mount(const char *dev_name, const struct path *path, |
| 61 |
const char *type, unsigned long flags, void *data); |
| 62 |
int ccs_sb_pivotroot(const struct path *old_path, const struct path *new_path); |
| 63 |
#else |
| 64 |
int ccs_path_chmod(struct path *path, umode_t mode); |
| 65 |
int ccs_path_chown(struct path *path, kuid_t uid, kgid_t gid); |
| 66 |
int ccs_path_chroot(struct path *path); |
| 67 |
int ccs_path_link(struct dentry *old_dentry, struct path *new_dir, |
| 68 |
struct dentry *new_dentry); |
| 69 |
int ccs_path_mkdir(struct path *dir, struct dentry *dentry, umode_t mode); |
| 70 |
int ccs_path_mknod(struct path *dir, struct dentry *dentry, umode_t mode, |
| 71 |
unsigned int dev); |
| 72 |
int ccs_path_rename(struct path *old_dir, struct dentry *old_dentry, |
| 73 |
struct path *new_dir, struct dentry *new_dentry); |
| 74 |
int ccs_path_rmdir(struct path *dir, struct dentry *dentry); |
| 75 |
int ccs_path_symlink(struct path *dir, struct dentry *dentry, |
| 76 |
const char *old_name); |
| 77 |
int ccs_path_truncate(struct path *path); |
| 78 |
int ccs_path_unlink(struct path *dir, struct dentry *dentry); |
| 79 |
int ccs_sb_mount(const char *dev_name, struct path *path, const char *type, |
| 80 |
unsigned long flags, void *data); |
| 81 |
int ccs_sb_pivotroot(struct path *old_path, struct path *new_path); |
| 82 |
#endif |
| 83 |
#else |
| 84 |
|
| 85 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0) |
| 86 |
static inline int ccs_settime(const struct timespec64 *ts, |
| 87 |
const struct timezone *tz) |
| 88 |
{ |
| 89 |
return 0; |
| 90 |
} |
| 91 |
#else |
| 92 |
static inline int ccs_settime(const struct timespec *ts, |
| 93 |
const struct timezone *tz) |
| 94 |
{ |
| 95 |
return 0; |
| 96 |
} |
| 97 |
#endif |
| 98 |
static inline int ccs_sb_mount(const char *dev_name, const struct path *path, |
| 99 |
const char *type, unsigned long flags, |
| 100 |
void *data) |
| 101 |
{ |
| 102 |
return 0; |
| 103 |
} |
| 104 |
static inline int ccs_sb_umount(struct vfsmount *mnt, int flags) |
| 105 |
{ |
| 106 |
return 0; |
| 107 |
} |
| 108 |
static inline int ccs_sb_pivotroot(const struct path *old_path, |
| 109 |
const struct path *new_path) |
| 110 |
{ |
| 111 |
return 0; |
| 112 |
} |
| 113 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0) |
| 114 |
static inline int ccs_inode_getattr(struct vfsmount *mnt, |
| 115 |
struct dentry *dentry) |
| 116 |
{ |
| 117 |
return 0; |
| 118 |
} |
| 119 |
#else |
| 120 |
static inline int ccs_inode_getattr(const struct path *path) |
| 121 |
{ |
| 122 |
return 0; |
| 123 |
} |
| 124 |
#endif |
| 125 |
static inline int ccs_file_ioctl(struct file *file, unsigned int cmd, |
| 126 |
unsigned long arg) |
| 127 |
{ |
| 128 |
return 0; |
| 129 |
} |
| 130 |
static inline int ccs_file_fcntl(struct file *file, unsigned int cmd, |
| 131 |
unsigned long arg) |
| 132 |
{ |
| 133 |
return 0; |
| 134 |
} |
| 135 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) |
| 136 |
static inline int ccs_file_open(struct file *file) |
| 137 |
{ |
| 138 |
return 0; |
| 139 |
} |
| 140 |
#else |
| 141 |
static inline int ccs_file_open(struct file *file, const struct cred *cred) |
| 142 |
{ |
| 143 |
return 0; |
| 144 |
} |
| 145 |
#endif |
| 146 |
static inline int ccs_socket_create(int family, int type, int protocol, |
| 147 |
int kern) |
| 148 |
{ |
| 149 |
return 0; |
| 150 |
} |
| 151 |
static inline int ccs_socket_bind(struct socket *sock, |
| 152 |
struct sockaddr *address, int addrlen) |
| 153 |
{ |
| 154 |
return 0; |
| 155 |
} |
| 156 |
static inline int ccs_socket_connect(struct socket *sock, |
| 157 |
struct sockaddr *address, int addrlen) |
| 158 |
{ |
| 159 |
return 0; |
| 160 |
} |
| 161 |
static inline int ccs_socket_listen(struct socket *sock, int backlog) |
| 162 |
{ |
| 163 |
return 0; |
| 164 |
} |
| 165 |
static inline int ccs_socket_sendmsg(struct socket *sock, struct msghdr *msg, |
| 166 |
int size) |
| 167 |
{ |
| 168 |
return 0; |
| 169 |
} |
| 170 |
static inline int ccs_path_unlink(const struct path *dir, |
| 171 |
struct dentry *dentry) |
| 172 |
{ |
| 173 |
return 0; |
| 174 |
} |
| 175 |
static inline int ccs_path_mkdir(const struct path *dir, struct dentry *dentry, |
| 176 |
umode_t mode) |
| 177 |
{ |
| 178 |
return 0; |
| 179 |
} |
| 180 |
static inline int ccs_path_rmdir(const struct path *dir, struct dentry *dentry) |
| 181 |
{ |
| 182 |
return 0; |
| 183 |
} |
| 184 |
static inline int ccs_path_mknod(const struct path *dir, struct dentry *dentry, |
| 185 |
umode_t mode, unsigned int dev) |
| 186 |
{ |
| 187 |
return 0; |
| 188 |
} |
| 189 |
static inline int ccs_path_truncate(const struct path *path) |
| 190 |
{ |
| 191 |
return 0; |
| 192 |
} |
| 193 |
static inline int ccs_path_symlink(const struct path *dir, |
| 194 |
struct dentry *dentry, const char *old_name) |
| 195 |
{ |
| 196 |
return 0; |
| 197 |
} |
| 198 |
static inline int ccs_path_link(struct dentry *old_dentry, |
| 199 |
const struct path *new_dir, |
| 200 |
struct dentry *new_dentry) |
| 201 |
{ |
| 202 |
return 0; |
| 203 |
} |
| 204 |
static inline int ccs_path_rename(const struct path *old_dir, |
| 205 |
struct dentry *old_dentry, |
| 206 |
const struct path *new_dir, |
| 207 |
struct dentry *new_dentry) |
| 208 |
{ |
| 209 |
return 0; |
| 210 |
} |
| 211 |
static inline int ccs_path_chmod(const struct path *path, umode_t mode) |
| 212 |
{ |
| 213 |
return 0; |
| 214 |
} |
| 215 |
static inline int ccs_path_chown(const struct path *path, kuid_t uid, |
| 216 |
kgid_t gid) |
| 217 |
{ |
| 218 |
return 0; |
| 219 |
} |
| 220 |
static inline int ccs_path_chroot(const struct path *path) |
| 221 |
{ |
| 222 |
return 0; |
| 223 |
} |
| 224 |
|
| 225 |
#endif /* defined(CONFIG_CAITSITH) */ |
| 226 |
|
| 227 |
#endif /* !defined(_LINUX_LSM2CAITSITH_H) */ |