DSI (Data Stream Interface) protocol definitions modified for the afptest test-suite. More...
#include <sys/types.h>#include <sys/time.h>#include <signal.h>#include <netinet/in.h>Go to the source code of this file.
Data Structures | |
| struct | dsi_block |
| struct | DSI |
Macros | |
| #define | DSI_BLOCKSIZ 16 |
| #define | DSI_CMDSIZ 800 |
| #define | DSI_DATASIZ 8192 |
| #define | DSIFL_REQUEST 0x00 |
| #define | DSIFL_REPLY 0x01 |
| #define | DSIFL_MAX 0x01 |
| #define | DSIOPT_SERVQUANT 0x00 |
| #define | DSIOPT_ATTNQUANT 0x01 |
| #define | DSIFUNC_CLOSE 1 |
| #define | DSIFUNC_CMD 2 |
| #define | DSIFUNC_STAT 3 |
| #define | DSIFUNC_OPEN 4 |
| #define | DSIFUNC_TICKLE 5 |
| #define | DSIFUNC_WRITE 6 |
| #define | DSIFUNC_ATTN 8 |
| #define | DSIFUNC_MAX 8 |
| #define | DSIERR_OK 0x0000 |
| #define | DSIERR_BADVERS 0xfbd6 |
| #define | DSIERR_BUFSMALL 0xfbd5 |
| #define | DSIERR_NOSESS 0xfbd4 |
| #define | DSIERR_NOSERV 0xfbd3 |
| #define | DSIERR_PARM 0xfbd2 |
| #define | DSIERR_SERVBUSY 0xfbd1 |
| #define | DSIERR_SESSCLOS 0xfbd0 |
| #define | DSIERR_SIZERR 0xfbcf |
| #define | DSIERR_TOOMANY 0xfbce |
| #define | DSIERR_NOACK 0xfbcd |
| #define | DSI_DEFQUANT 2 |
| #define | DSI_SERVQUANT_MAX 0xffffffffL |
| #define | DSI_SERVQUANT_MIN 0x0004A2E0L |
| #define | DSI_SERVQUANT_DEF DSI_SERVQUANT_MIN |
| #define | DSI_AFPOVERTCP_PORT 548 |
| #define | dsi_wrtreply(a, b) |
| #define | dsi_serverID(x) |
| #define | dsi_send(x) |
| #define | dsi_receive(x) |
Typedefs | |
| typedef struct DSI | DSI |
Functions | |
| DSI * | dsi_init (const char *, const char *, const char *, const int, const int, const uint32_t) |
| void | dsi_setstatus (DSI *, uint8_t *, const int) |
| void | dsi_kill (int) |
| size_t | dsi_stream_write (DSI *, void *, const size_t) |
| size_t | dsi_stream_read (DSI *, void *, const size_t) |
| Read data from DSI buffer. | |
| int | dsi_stream_send (DSI *, void *, size_t) |
| write data. | |
| int | dsi_stream_receive (DSI *, void *, const size_t, size_t *) |
| size_t | dsi_writeinit (DSI *, void *, const size_t) |
| size_t | dsi_write (DSI *, void *, const size_t) |
| void | dsi_writeflush (DSI *) |
| ssize_t | dsi_readinit (DSI *, void *, const size_t, const size_t, const int) |
| streaming i/o for afp_read. | |
| ssize_t | dsi_read (DSI *, void *, const size_t) |
| void | dsi_readdone (DSI *) |
DSI (Data Stream Interface) protocol definitions modified for the afptest test-suite.
The interface for the test-suite differts from the libatalk DSI interface in that is retains a statically allocated buffer for commands as well as smaller command and data buffer sizes that fit in 16 bit size fields.
What a DSI packet looks like:
| #define DSI_AFPOVERTCP_PORT 548 |
default port number
| #define DSI_BLOCKSIZ 16 |
| #define DSI_CMDSIZ 800 |
| #define DSI_DATASIZ 8192 |
| #define DSI_DEFQUANT 2 |
default attention quantum size
| #define dsi_receive | ( | x | ) |
| #define dsi_send | ( | x | ) |
| #define dsi_serverID | ( | x | ) |
| #define DSI_SERVQUANT_DEF DSI_SERVQUANT_MIN |
default server quantum
| #define DSI_SERVQUANT_MAX 0xffffffffL |
server quantum
| #define DSI_SERVQUANT_MIN 0x0004A2E0L |
minimum server quantum
| #define dsi_wrtreply | ( | a, | |
| b ) |
| #define DSIERR_BADVERS 0xfbd6 |
| #define DSIERR_BUFSMALL 0xfbd5 |
| #define DSIERR_NOACK 0xfbcd |
| #define DSIERR_NOSERV 0xfbd3 |
| #define DSIERR_NOSESS 0xfbd4 |
| #define DSIERR_OK 0x0000 |
| #define DSIERR_PARM 0xfbd2 |
| #define DSIERR_SERVBUSY 0xfbd1 |
| #define DSIERR_SESSCLOS 0xfbd0 |
| #define DSIERR_SIZERR 0xfbcf |
| #define DSIERR_TOOMANY 0xfbce |
| #define DSIFL_MAX 0x01 |
| #define DSIFL_REPLY 0x01 |
| #define DSIFL_REQUEST 0x00 |
| #define DSIFUNC_ATTN 8 |
DSIAttention
| #define DSIFUNC_CLOSE 1 |
DSICloseSession
| #define DSIFUNC_CMD 2 |
DSICommand
| #define DSIFUNC_MAX 8 |
largest command
| #define DSIFUNC_OPEN 4 |
DSIOpenSession
| #define DSIFUNC_STAT 3 |
DSIGetStatus
| #define DSIFUNC_TICKLE 5 |
DSITickle
| #define DSIFUNC_WRITE 6 |
DSIWrite
| #define DSIOPT_ATTNQUANT 0x01 |
attention quantum
| #define DSIOPT_SERVQUANT 0x00 |
server request quantum
| typedef struct DSI DSI |
|
extern |
basic initialization: dsi_init.c
|
extern |
|
extern |
send off the data
|
extern |
|
extern |
streaming i/o for afp_read.
this is all from the perspective of the client. it basically does the reverse of dsi_write. on first entry, it will send off the header plus whatever is in its command buffer. it returns the amount of stuff still to be read (constrained by the buffer size).
|
extern |
|
extern |
Read data from DSI buffer.
Essentially a loop around buf_read() to ensure "length" bytes are read from dsi->buffer and/or the socket.
|
extern |
|
extern |
write data.
|
extern |
|
extern |
fill up buf and then return. this should be called repeatedly until all the data has been read. i block alarm processing during the transfer to avoid sending unnecessary tickles.
|
extern |
flush any unread buffers.
|
extern |