netatalk  4.5.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
speedtest_local_vfs.h File Reference
#include <stdint.h>
#include <sys/types.h>
#include "afpclient.h"
#include "dsi.h"

Go to the source code of this file.

Data Structures

struct  vfs

Macros

#define MAXDIR   32
#define MAXVOL   3

Functions

uint16_t local_openvol (CONN *conn, char *vol)
 Open directory as volume in Local mode.
unsigned int local_closevol (CONN *conn, uint16_t vol)
 Close volume and cleanup heaps.
unsigned int local_getfiledirparams (CONN *conn, uint16_t vol, int did, char *name, uint16_t f_bitmap, uint16_t d_bitmap)
 Check file/directory existence via stat().
unsigned int local_createdir (CONN *conn, uint16_t vol, int did, char *name)
 Create directory via mkdir() and add to heap.
unsigned int local_createfile (CONN *conn, uint16_t vol, char type, int did, char *name)
 Create file via open().
uint16_t local_openfork (CONN *conn, uint16_t vol, int type, uint16_t bitmap, int did, char *name, int access)
 Open file fork and return file descriptor as fork handle.
unsigned int local_writeheader (DSI *dsi, uint16_t fork, int offset, int size, char *data, char whence)
 Write data via lseek() + write() syscalls.
unsigned int local_writefooter (DSI *dsi, uint16_t fork, int offset, int size, char *data, char whence)
 No-op write footer (AFP compatibility).
unsigned int local_flushfork (CONN *conn, uint16_t fork)
 Flush file data to disk via fsync().
unsigned int local_closefork (CONN *conn, uint16_t fork)
 Close file descriptor.
unsigned int local_delete (CONN *conn, uint16_t vol, int did, char *name)
 Delete file/directory via unlink()/rmdir().
unsigned int local_setforkparam (CONN *conn, uint16_t fork, uint16_t bitmap, off_t size)
 Set file size via ftruncate().
unsigned int local_write (CONN *conn, uint16_t fork, long long offset, int size, char *data, char whence)
 Write data to file via lseek() + write().
unsigned int local_read (CONN *conn, uint16_t fork, long long offset, int size, char *data)
 Read data from file via lseek() + read().
unsigned int local_readheader (DSI *dsi, uint16_t fork, int offset, int size, char *data)
 No-op read header (AFP compatibility).
unsigned int local_readfooter (DSI *dsi, uint16_t fork, int offset, int size, char *data)
 Read data footer via lseek() + read().
unsigned int local_copyfile (struct CONN *conn, uint16_t svol, int sdid, uint16_t dvol, int ddid, char *src, char *buf, char *dst)
 Copy file operation (not implemented, returns error).

Variables

char * Dir_heap [MAXVOL][MAXDIR]
char * Vol_heap [MAXVOL]
int Local_VFS_Quiet
int Local_VFS_Direct
struct vfs local_VFS

Macro Definition Documentation

◆ MAXDIR

#define MAXDIR   32

◆ MAXVOL

#define MAXVOL   3

Function Documentation

◆ local_closefork()

unsigned int local_closefork ( CONN * conn,
uint16_t fork )

Close file descriptor.

◆ local_closevol()

unsigned int local_closevol ( CONN * conn,
uint16_t vol )

Close volume and cleanup heaps.

◆ local_copyfile()

unsigned int local_copyfile ( struct CONN * conn,
uint16_t svol,
int sdid,
uint16_t dvol,
int ddid,
char * src,
char * buf,
char * dst )

Copy file operation (not implemented, returns error).

◆ local_createdir()

unsigned int local_createdir ( CONN * conn,
uint16_t vol,
int did,
char * name )

Create directory via mkdir() and add to heap.

◆ local_createfile()

unsigned int local_createfile ( CONN * conn,
uint16_t vol,
char type,
int did,
char * name )

Create file via open().

◆ local_delete()

unsigned int local_delete ( CONN * conn,
uint16_t vol,
int did,
char * name )

Delete file/directory via unlink()/rmdir().

◆ local_flushfork()

unsigned int local_flushfork ( CONN * conn,
uint16_t fork )

Flush file data to disk via fsync().

◆ local_getfiledirparams()

unsigned int local_getfiledirparams ( CONN * conn,
uint16_t vol,
int did,
char * name,
uint16_t f_bitmap,
uint16_t d_bitmap )

Check file/directory existence via stat().

◆ local_openfork()

uint16_t local_openfork ( CONN * conn,
uint16_t vol,
int type,
uint16_t bitmap,
int did,
char * name,
int access )

Open file fork and return file descriptor as fork handle.

◆ local_openvol()

uint16_t local_openvol ( CONN * conn,
char * vol )

Open directory as volume in Local mode.

◆ local_read()

unsigned int local_read ( CONN * conn,
uint16_t fork,
long long offset,
int size,
char * data )

Read data from file via lseek() + read().

◆ local_readfooter()

unsigned int local_readfooter ( DSI * dsi,
uint16_t fork,
int offset,
int size,
char * data )

Read data footer via lseek() + read().

◆ local_readheader()

unsigned int local_readheader ( DSI * dsi,
uint16_t fork,
int offset,
int size,
char * data )

No-op read header (AFP compatibility).

◆ local_setforkparam()

unsigned int local_setforkparam ( CONN * conn,
uint16_t fork,
uint16_t bitmap,
off_t size )

Set file size via ftruncate().

◆ local_write()

unsigned int local_write ( CONN * conn,
uint16_t fork,
long long offset,
int size,
char * data,
char whence )

Write data to file via lseek() + write().

◆ local_writefooter()

unsigned int local_writefooter ( DSI * dsi,
uint16_t fork,
int offset,
int size,
char * data,
char whence )

No-op write footer (AFP compatibility).

◆ local_writeheader()

unsigned int local_writeheader ( DSI * dsi,
uint16_t fork,
int offset,
int size,
char * data,
char whence )

Write data via lseek() + write() syscalls.

Variable Documentation

◆ Dir_heap

char* Dir_heap[MAXVOL][MAXDIR]
extern

◆ local_VFS

struct vfs local_VFS
extern

◆ Local_VFS_Direct

int Local_VFS_Direct
extern

◆ Local_VFS_Quiet

int Local_VFS_Quiet
extern

◆ Vol_heap

char* Vol_heap[MAXVOL]
extern