XenevaOS
Loading...
Searching...
No Matches
Classes | Macros
fssrv.h File Reference
#include <stdint.h>
Include dependency graph for fssrv.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  FsReq
 
struct  FsDirEnt
 
struct  FsResp
 

Macros

#define FSSRV_ENDPOINT   "fs"
 
#define FSSRV_NAME_MAX   31
 
#define FSSRV_MAX_DATA   4096
 
#define FSSRV_OP_OPEN   1 /* flags: FSSRV_F_*, answers size/uid */
 
#define FSSRV_OP_READ   2 /* offset, len -> data */
 
#define FSSRV_OP_WRITE   3 /* offset, data (len bytes follow) */
 
#define FSSRV_OP_READDIR   4 /* offset = entry index -> one FsDirEnt or FSSRV_E_NOENT at the end */
 
#define FSSRV_OP_REMOVE   5 /* owner or uid 0 only */
 
#define FSSRV_F_CREATE   1
 
#define FSSRV_F_WRITE   2
 
#define FSSRV_OK   0
 
#define FSSRV_E_NOENT   -1
 
#define FSSRV_E_PERM   -2
 
#define FSSRV_E_INVAL   -3
 
#define FSSRV_E_NOSPC   -4
 

Macro Definition Documentation

◆ FSSRV_E_INVAL

#define FSSRV_E_INVAL   -3

◆ FSSRV_E_NOENT

#define FSSRV_E_NOENT   -1

◆ FSSRV_E_NOSPC

#define FSSRV_E_NOSPC   -4

◆ FSSRV_E_PERM

#define FSSRV_E_PERM   -2

◆ FSSRV_ENDPOINT

#define FSSRV_ENDPOINT   "fs"

fssrv.h – wire protocol between the kernel's /srv file-system proxy (KernelAA64/Fs/srvfs.c) and a user-space file server (Process/fssrv).

The protocol is stateless and path-based, like NFS: there are no server-side handles, so nothing leaks when a client closes a file or dies. Every request travels over the generic kernel IPC to the endpoint FSSRV_ENDPOINT; the kernel stamps each one with the calling process's uid, which is what the server enforces permissions against. Data follows the fixed header in the same message.

◆ FSSRV_F_CREATE

#define FSSRV_F_CREATE   1

◆ FSSRV_F_WRITE

#define FSSRV_F_WRITE   2

◆ FSSRV_MAX_DATA

#define FSSRV_MAX_DATA   4096

◆ FSSRV_NAME_MAX

#define FSSRV_NAME_MAX   31

◆ FSSRV_OK

#define FSSRV_OK   0

◆ FSSRV_OP_OPEN

#define FSSRV_OP_OPEN   1 /* flags: FSSRV_F_*, answers size/uid */

◆ FSSRV_OP_READ

#define FSSRV_OP_READ   2 /* offset, len -> data */

◆ FSSRV_OP_READDIR

#define FSSRV_OP_READDIR   4 /* offset = entry index -> one FsDirEnt or FSSRV_E_NOENT at the end */

◆ FSSRV_OP_REMOVE

#define FSSRV_OP_REMOVE   5 /* owner or uid 0 only */

◆ FSSRV_OP_WRITE

#define FSSRV_OP_WRITE   3 /* offset, data (len bytes follow) */