XenevaOS
Loading...
Searching...
No Matches
fssrv.h
Go to the documentation of this file.
1
11#ifndef __FSSRV_H__
12#define __FSSRV_H__
13
14#include <stdint.h>
15
16#define FSSRV_ENDPOINT "fs"
17#define FSSRV_NAME_MAX 31
18#define FSSRV_MAX_DATA 4096
19
20#define FSSRV_OP_OPEN 1 /* flags: FSSRV_F_*, answers size/uid */
21#define FSSRV_OP_READ 2 /* offset, len -> data */
22#define FSSRV_OP_WRITE 3 /* offset, data (len bytes follow) */
23#define FSSRV_OP_READDIR 4 /* offset = entry index -> one FsDirEnt or FSSRV_E_NOENT at the end */
24#define FSSRV_OP_REMOVE 5 /* owner or uid 0 only */
25
26#define FSSRV_F_CREATE 1
27#define FSSRV_F_WRITE 2
28
29#define FSSRV_OK 0
30#define FSSRV_E_NOENT -1
31#define FSSRV_E_PERM -2
32#define FSSRV_E_INVAL -3
33#define FSSRV_E_NOSPC -4
34
35typedef struct {
39 uint32_t len; /* READ: bytes wanted; WRITE: bytes following */
40 char name[FSSRV_NAME_MAX + 1]; /* file name inside the file system, no '/' */
41} FsReq; /* WRITE data follows this header */
42
43/* one directory entry, returned as the data of a READDIR answer */
44typedef struct {
48} FsDirEnt;
49
50typedef struct {
52 uint32_t size; /* file size after the operation */
53 uint32_t uid; /* owner */
54 uint32_t len; /* READ: data bytes following */
55} FsResp; /* READ data follows this header */
56
57#endif
int int32_t
Definition acefiex.h:160
unsigned int uint32_t
Definition acefiex.h:163
struct drm_crtc struct drm_plane struct drm_plane const struct drm_crtc_funcs const char * name
Definition drm_crtc.h:1242
#define FSSRV_NAME_MAX
Definition fssrv.h:17
Definition fssrv.h:44
uint32_t size
Definition fssrv.h:46
uint32_t uid
Definition fssrv.h:47
Definition fssrv.h:35
uint32_t offset
Definition fssrv.h:38
uint32_t op
Definition fssrv.h:36
uint32_t flags
Definition fssrv.h:37
uint32_t len
Definition fssrv.h:39
Definition fssrv.h:50
uint32_t uid
Definition fssrv.h:53
uint32_t size
Definition fssrv.h:52
int32_t status
Definition fssrv.h:51
uint32_t len
Definition fssrv.h:54