-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathggate.h
36 lines (25 loc) · 963 Bytes
/
ggate.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
#ifndef _GGATE_H_
#define _GGATE_H_
#include <stdbool.h>
#include <unistd.h>
enum {
GGATE_DEFAULT_TIMEOUT = 0,
GGATE_DEFAULT_QUEUE_SIZE = 1024,
};
typedef struct ggate_context *ggate_context_t;
int ggate_load_module();
ggate_context_t ggate_context_alloc();
void ggate_context_init(ggate_context_t ctx);
void ggate_context_free(ggate_context_t ctx);
int ggate_context_open(ggate_context_t ctx);
void ggate_context_close(ggate_context_t ctx);
int ggate_context_rights_limit(ggate_context_t ctx);
int ggate_context_get_unit(ggate_context_t ctx);
int ggate_context_ioctl(ggate_context_t ctx, uint64_t req, void *data);
int ggate_context_create_device(ggate_context_t ctx, char const *host,
char const *port, char const *path,
off_t mediasize, uint32_t sectorsize,
uint32_t flags);
int ggate_context_destroy_device(ggate_context_t ctx, bool force);
int ggate_context_cancel(ggate_context_t ctx, uintptr_t seq);
#endif /* #ifndef _GGATE_H_ */