-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvmtypes.h
43 lines (30 loc) · 846 Bytes
/
vmtypes.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//Defines type for the virtual mouse system
//Author: Edwin Heerschap
#ifndef VMDEVICE_H
#define VMDEVICE_H
#include "vmdefines.h"
#include <linux/fs.h>
#include <linux/cdev.h>
//Represents an access control for a virtual mouse.
struct vmAccess {
char* name;
struct file_operations* fops;
void (*cleanup) (struct vmAccess *); //Do not use vmAccess struct afterwards.
};
//Represents a protocol for a virtual mouse.
struct vmProtocol {
char* name;
struct file_operations* fops;
int (*ioctl) (struct file*, unsigned int, unsigned long);
void (*cleanup) (struct vmProtocol *);
};
//Represents a virtual mouse device
struct vmDevice {
struct vmProtocol* protocol;
struct vmAccess* access;
struct cdev cdev;
dev_t dev;
int (*ioctl) (struct file*, unsigned int, unsigned long);
void (*cleanup) (struct vmDevice *);
};
#endif