netatalk  4.4.0dev
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
speedtest.c File Reference
#include <fcntl.h>
#include <getopt.h>
#include <signal.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include "afpclient.h"
#include "afpcmd.h"
#include "afphelper.h"
#include "testhelper.h"

Data Structures

struct  vfs
struct  test_entry

Macros

#define KILOBYTE   1024
#define MEGABYTE   (KILOBYTE*KILOBYTE)
#define MAXDIR   10
#define MAXVOL   3
#define O_DIRECT   040000

Functions

int32_t is_there (CONN *conn, uint16_t volume, int32_t did, char *name)
uint16_t local_openvol (CONN *conn, char *vol)
unsigned int local_closevol (CONN *conn, uint16_t vol)
static int local_chdir (uint16_t vol, int did)
unsigned int local_createdir (CONN *conn, uint16_t vol, int did, char *name)
unsigned int local_getfiledirparams (CONN *conn, uint16_t vol, int did, char *name, uint16_t f_bitmap, uint16_t d_bitmap)
unsigned int local_delete (CONN *conn, uint16_t vol, int did, char *name)
unsigned int local_createfile (CONN *conn, uint16_t vol, char type, int did, char *name)
uint16_t local_openfork (CONN *conn, uint16_t vol, int type, uint16_t bitmap, int did, char *name, int access)
unsigned int local_writeheader (DSI *dsi, uint16_t fork, int offset, int size, char *data, char whence)
unsigned int local_writefooter (DSI *dsi, uint16_t fork, int offset, int size, char *data, char whence)
unsigned int local_flushfork (CONN *conn, uint16_t fork)
unsigned int local_closefork (CONN *conn, uint16_t fork)
unsigned int local_setforkparam (CONN *conn, uint16_t fork, uint16_t bitmap, off_t size)
unsigned int local_write (CONN *conn, uint16_t fork, long long offset, int size, char *data, char whence)
unsigned int local_read (CONN *conn, uint16_t fork, long long offset, int size, char *data)
unsigned int local_readheader (DSI *dsi, uint16_t fork, int offset, int size, char *data)
unsigned int local_readfooter (DSI *dsi, uint16_t fork, int offset, int size, char *data)
unsigned int local_copyfile (struct CONN *conn, uint16_t svol, int sdid, uint16_t dvol, int ddid, char *src, char *buf, char *dst)
static void press_enter (char *s)
unsigned long long delta (void)
static void header (void)
static void timer_footer (void)
void Write (void)
int init_fork (int fork)
static int getfd (CONN *conn, int fork)
void Copy (void)
void ServerCopy (void)
void Read (void)
static void run_one (char *name)
void usage (char *av0)
int main (int ac, char **av)

Variables

uint16_t VolID
uint16_t VolID2
static DSIdsi
CONNConn
int ExitCode = 0
DSIDsi
char Data [30000]
char * Buffer
struct timeval Timer_start
struct timeval Timer_end
static char * Server = "localhost"
static int Port = DSI_AFPOVERTCP_PORT
static char * Password = ""
char * Vol = ""
char * Vol2 = ""
char * User
int Version = 34
char * Test = "Write"
static char * Filename
char * vers = "AFP3.4"
char * uam = "Cleartxt Passwrd"
static int Count = 1
static off_t Size = 64 * MEGABYTE
static size_t Quantum = 0
static int Request = 1
static int Req = 1
static int Delete = 0
static int Sparse = 0
static int Local = 0
static int Flush = 1
static int Direct = 0
CONNConn2
int Mac = 0
int EmptyVol = 0
int PassCount = 0
int FailCount = 0
int SkipCount = 0
int NotTestedCount = 0
char FailedTests [1024][256] = {{0}}
char NotTestedTests [1024][256] = {{0}}
char SkippedTests [1024][256] = {{0}}
struct vfs VFS
static char * Dir_heap [MAXVOL][MAXDIR]
static char * Vol_heap [MAXVOL]
static char temp [MAXPATHLEN+1]
struct vfs local_VFS
static struct test_entry test_table []

Macro Definition Documentation

◆ KILOBYTE

#define KILOBYTE   1024

◆ MAXDIR

#define MAXDIR   10

◆ MAXVOL

#define MAXVOL   3

◆ MEGABYTE

#define MEGABYTE   (KILOBYTE*KILOBYTE)

◆ O_DIRECT

#define O_DIRECT   040000

Function Documentation

◆ Copy()

void Copy ( void )

◆ delta()

unsigned long long delta ( void )

◆ getfd()

int getfd ( CONN * conn,
int fork )
static

◆ header()

void header ( void )
static

◆ init_fork()

int init_fork ( int fork)

◆ is_there()

int32_t is_there ( CONN * conn,
uint16_t volume,
int32_t did,
char * name )

◆ local_chdir()

int local_chdir ( uint16_t vol,
int did )
static

◆ local_closefork()

unsigned int local_closefork ( CONN * conn,
uint16_t fork )

◆ local_closevol()

unsigned int local_closevol ( CONN * conn,
uint16_t vol )

◆ 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 )

◆ local_createdir()

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

◆ local_createfile()

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

◆ local_delete()

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

◆ local_flushfork()

unsigned int local_flushfork ( CONN * conn,
uint16_t fork )

◆ local_getfiledirparams()

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

◆ local_openfork()

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

◆ local_openvol()

uint16_t local_openvol ( CONN * conn,
char * vol )

◆ local_read()

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

◆ local_readfooter()

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

◆ local_readheader()

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

◆ local_setforkparam()

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

◆ local_write()

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

◆ local_writefooter()

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

◆ local_writeheader()

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

◆ main()

int main ( int ac,
char ** av )

◆ press_enter()

void press_enter ( char * s)
static

◆ Read()

void Read ( void )

◆ run_one()

void run_one ( char * name)
static

◆ ServerCopy()

void ServerCopy ( void )

◆ timer_footer()

void timer_footer ( void )
static

◆ usage()

void usage ( char * av0)

◆ Write()

void Write ( void )

Variable Documentation

◆ Buffer

char* Buffer

◆ Conn

CONN* Conn

◆ Conn2

CONN* Conn2

◆ Count

int Count = 1
static

◆ Data

char Data[30000]

◆ Delete

int Delete = 0
static

◆ Dir_heap

char* Dir_heap[MAXVOL][MAXDIR]
static

◆ Direct

int Direct = 0
static

◆ Dsi

DSI* Dsi

◆ dsi

DSI* dsi
static

◆ EmptyVol

int EmptyVol = 0

◆ ExitCode

int ExitCode = 0

◆ FailCount

int FailCount = 0

◆ FailedTests

char FailedTests[1024][256] = {{0}}

◆ Filename

char* Filename
static

◆ Flush

int Flush = 1
static

◆ Local

int Local = 0
static

◆ local_VFS

struct vfs local_VFS
Initial value:
= {
}
unsigned int local_writefooter(DSI *dsi, uint16_t fork, int offset, int size, char *data, char whence)
Definition speedtest.c:376
unsigned int local_delete(CONN *conn, uint16_t vol, int did, char *name)
Definition speedtest.c:263
unsigned int local_createfile(CONN *conn, uint16_t vol, char type, int did, char *name)
Definition speedtest.c:288
unsigned int local_closefork(CONN *conn, uint16_t fork)
Definition speedtest.c:404
uint16_t local_openvol(CONN *conn, char *vol)
Definition speedtest.c:130
unsigned int local_copyfile(struct CONN *conn, uint16_t svol, int sdid, uint16_t dvol, int ddid, char *src, char *buf, char *dst)
Definition speedtest.c:511
unsigned int local_write(CONN *conn, uint16_t fork, long long offset, int size, char *data, char whence)
Definition speedtest.c:436
unsigned int local_flushfork(CONN *conn, uint16_t fork)
Definition speedtest.c:389
unsigned int local_getfiledirparams(CONN *conn, uint16_t vol, int did, char *name, uint16_t f_bitmap, uint16_t d_bitmap)
Definition speedtest.c:243
unsigned int local_writeheader(DSI *dsi, uint16_t fork, int offset, int size, char *data, char whence)
Definition speedtest.c:355
unsigned int local_read(CONN *conn, uint16_t fork, long long offset, int size, char *data)
Definition speedtest.c:457
unsigned int local_setforkparam(CONN *conn, uint16_t fork, uint16_t bitmap, off_t size)
Definition speedtest.c:419
unsigned int local_closevol(CONN *conn, uint16_t vol)
Definition speedtest.c:164
unsigned int local_createdir(CONN *conn, uint16_t vol, int did, char *name)
Definition speedtest.c:194
unsigned int local_readheader(DSI *dsi, uint16_t fork, int offset, int size, char *data)
Definition speedtest.c:477
uint16_t local_openfork(CONN *conn, uint16_t vol, int type, uint16_t bitmap, int did, char *name, int access)
Definition speedtest.c:321
unsigned int local_readfooter(DSI *dsi, uint16_t fork, int offset, int size, char *data)
Definition speedtest.c:490

◆ Mac

int Mac = 0

◆ NotTestedCount

int NotTestedCount = 0

◆ NotTestedTests

char NotTestedTests[1024][256] = {{0}}

◆ PassCount

int PassCount = 0

◆ Password

char* Password = ""
static

◆ Port

int Port = DSI_AFPOVERTCP_PORT
static

◆ Quantum

size_t Quantum = 0
static

◆ Req

int Req = 1
static

◆ Request

int Request = 1
static

◆ Server

char* Server = "localhost"
static

◆ Size

off_t Size = 64 * MEGABYTE
static

◆ SkipCount

int SkipCount = 0

◆ SkippedTests

char SkippedTests[1024][256] = {{0}}

◆ Sparse

int Sparse = 0
static

◆ temp

char temp[MAXPATHLEN+1]
static

◆ Test

char* Test = "Write"

◆ test_table

struct test_entry test_table[]
static
Initial value:
= {
{ "Read", Read },
{ "Write", Write },
{ "Copy", Copy },
{ "ServerCopy", ServerCopy },
{ NULL, NULL }
}
void Read(void)
Definition speedtest.c:1172
void Copy(void)
Definition speedtest.c:781
void Write(void)
Definition speedtest.c:586
void ServerCopy(void)
Definition speedtest.c:1053

◆ Timer_end

struct timeval Timer_end

◆ Timer_start

struct timeval Timer_start

◆ uam

char* uam = "Cleartxt Passwrd"

◆ User

char* User

◆ vers

char* vers = "AFP3.4"

◆ Version

int Version = 34

◆ VFS

struct vfs VFS
Initial value:
= {
}
unsigned int FPWriteFooter(DSI *dsi, uint16_t fork, int offset, int size, char *data, char whence)
Definition afpcmd.c:2423
unsigned int FPGetFileDirParams(CONN *conn, uint16_t vol, int did, char *name, uint16_t f_bitmap, uint16_t d_bitmap)
Definition afpcmd.c:1334
unsigned int FPReadFooter(DSI *dsi, uint16_t fork, int offset, int size, char *data)
Definition afpcmd.c:2337
unsigned int FPCloseFork(CONN *conn, uint16_t vol)
Definition afpcmd.c:1082
unsigned int FPRead(CONN *conn, uint16_t fork, long long offset, int size, char *data)
Definition afpcmd.c:2353
unsigned int FPCreateFile(CONN *conn, uint16_t vol, char type, int did, char *name)
Definition afpcmd.c:1850
unsigned int FPDelete(CONN *conn, uint16_t vol, int did, char *name)
Definition afpcmd.c:1687
unsigned int FPReadHeader(DSI *dsi, uint16_t fork, int offset, int size, char *data)
Definition afpcmd.c:2321
unsigned int FPCreateDir(CONN *conn, uint16_t vol, int did, char *name)
Definition afpcmd.c:1807
unsigned int FPCopyFile(CONN *conn, uint16_t svol, int sdid, uint16_t dvol, int ddid, char *src, char *dstdir, char *dst)
Definition afpcmd.c:2168
uint16_t FPOpenVol(CONN *conn, char *vol)
Definition afpcmd.c:843
unsigned int FPCloseVol(CONN *conn, uint16_t vol)
Definition afpcmd.c:849
uint16_t FPOpenFork(CONN *conn, uint16_t vol, int type, uint16_t bitmap, int did, char *name, int access)
Definition afpcmd.c:1826
unsigned int FPFlushFork(CONN *conn, uint16_t vol)
Definition afpcmd.c:1152
unsigned int FPWrite(CONN *conn, uint16_t fork, long long offset, int size, char *data, char whence)
Definition afpcmd.c:2439
unsigned int FPSetForkParam(CONN *conn, uint16_t fork, uint16_t bitmap, off_t size)
Definition afpcmd.c:1938
unsigned int FPWriteHeader(DSI *dsi, uint16_t fork, int offset, int size, char *data, char whence)
Definition afpcmd.c:2407

◆ Vol

char* Vol = ""

◆ Vol2

char* Vol2 = ""

◆ Vol_heap

char* Vol_heap[MAXVOL]
static

◆ VolID

uint16_t VolID

◆ VolID2

uint16_t VolID2