netatalk: afpclient.c File Reference

netatalk 4.5.1
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
afpclient.c File Reference
`#include <assert.h>`
`#include <atalk/afp.h>`
`#include "afpclient.h"`
`#include "testhelper.h"`

## Macros
#define | UNICODE(a)
#define | kTextEncodingUTF8 0x08000103

## Functions
int | OpenClientSocket (char *host, int port)
int | CloseClientSocket (int fd)
size_t | dsi_stream_read (DSI *dsi, void *data, const size_t length)
| Read data from DSI buffer.
int | dsi_read_header (DSI *dsi)
int | dsi_stream_receive (DSI *dsi, void *buf, const size_t ilength, size_t *rlength)
size_t | dsi_stream_write (DSI *dsi, void *data, const size_t length)
int | dsi_stream_send (DSI *dsi, void *buf, size_t length)
| write data.
void | dsi_tickle (DSI *dsi)
static int | dsi_receive (DSI *x, unsigned char *buf, size_t length)
static int | dsi_full_receive (DSI *x, unsigned char *buf, int length)
int | dsi_cmd_receive (DSI *x)
int | dsi_data_receive (DSI *x)
void | SendInit (DSI *dsi)
void | SetLen (DSI *dsi, int ofs)
static int | SendCmd (DSI *dsi, uint8_t cmd)
static int | SendCmdWithU16 (DSI *dsi, uint8_t cmd, uint16_t param)
static unsigned int | SendCmdVolDidCname (CONN *conn, uint8_t cmd, uint16_t vol, int did, char *name)
unsigned int | DSIOpenSession (CONN *conn)
unsigned int | DSIGetStatus (CONN *conn)
unsigned int | DSICloseSession (CONN *conn)
unsigned int | AFPopenLogin (CONN *conn, const char *vers, const char *uam, const char *usr, const char *pwd)
static void | capture_login_cont (CONN *conn)
unsigned int | AFPopenLoginExt (CONN *conn, const char *vers, const char *uam, const char *usr, const void *auth_info, size_t auth_info_len)
unsigned int | AFPopenLoginExt_pwd (CONN *conn, const char *vers, const char *uam, const char *usr, const char *pwd)
unsigned int | AFPLoginCont (CONN *conn, const void *auth_info, size_t auth_info_len)
unsigned int | AFPChangePW (CONN *conn, char *uam, char *usr, char *opwd, char *pwd)
unsigned int | AFPLogOut (CONN *conn)
unsigned int | AFPzzz (CONN *conn, int flag)
unsigned int | AFPGetSrvrInfo (CONN *conn)
unsigned int | AFPGetSrvrParms (CONN *conn)
unsigned int | AFPGetSrvrMsg (CONN *conn, uint16_t type, uint16_t bitmap)
unsigned int | AFPCloseVol (CONN *conn, uint16_t vol)
unsigned int | AFPCloseDT (CONN *conn, uint16_t vol)
unsigned int | AFPCloseFork (CONN *conn, uint16_t fork)
unsigned int | AFPByteLock (CONN *conn, uint16_t fork, int end, int mode, int offset, int size)
static off_t | get_off_t (unsigned char **ibuf, int is64)
static int | set_off_t (off_t offset, uint8_t *rbuf, int is64)
unsigned int | AFPByteLock_ext (CONN *conn, uint16_t fork, int end, int mode, off_t offset, off_t size)
unsigned int | AFPSetForkParam (CONN *conn, uint16_t fork, uint16_t bitmap, off_t size)
unsigned int | AFPFlush (CONN *conn, uint16_t vol)
unsigned int | AFPFlushFork (CONN *conn, uint16_t vol)
uint16_t | AFPOpenVol (CONN *conn, char *vol, uint16_t bitmap)
int | strp2c (char *cstr, const unsigned char *pstr)
void * | fp_malloc (size_t size)
char * | strp2cdup (unsigned char *src)
void * | fp_realloc (void *ptr, size_t size)
void | fp_free (void *ptr)
void | afp_volume_unpack (struct afp_volume_parms *parms, unsigned char *b, uint16_t rbitmap)
int | afp_volume_pack (unsigned char *b, struct afp_volume_parms *parms, uint16_t bitmap)
void | afp_filedir_unpack (CONN *conn, struct afp_filedir_parms *filedir, const unsigned char *b, uint16_t rfbitmap, uint16_t rdbitmap)
int | afp_filedir_pack (CONN *conn, unsigned char *b, struct afp_filedir_parms *filedir, uint16_t rfbitmap, uint16_t rdbitmap)
unsigned int | AFPGetVolParam (CONN *conn, uint16_t vol, uint16_t bitmap)
unsigned int | AFPSetVolParam (CONN *conn, uint16_t vol, uint16_t bitmap, struct afp_volume_parms *parms)
void | u2mac (uint8_t *dst, char *name, int len)
int | FPset_name (CONN *conn, int ofs, char *name)
unsigned int | AFPCreateFile (CONN *conn, uint16_t vol, char type, int did, char *name)
unsigned int | AFPWriteHeader (DSI *dsi, uint16_t fork, int offset, int size, char *data, char whence)
unsigned int | AFPWriteFooter (DSI *dsi, uint16_t fork, int offset, int size, char *data, char whence)
unsigned int | AFPWrite (CONN *conn, uint16_t fork, int offset, int size, char *data, char whence)
unsigned int | AFPWrite_ext (CONN *conn, uint16_t fork, off_t offset, off_t size, char *data, char whence)
unsigned int | AFPWrite_ext_async (CONN *conn, uint16_t fork, off_t offset, off_t size, char *data, char whence)
uint16_t | AFPOpenFork (CONN *conn, uint16_t vol, char type, uint16_t bitmap, int did, char *name, uint16_t access)
unsigned int | AFPDelete (CONN *conn, uint16_t vol, int did, char *name)
unsigned int | AFPGetComment (CONN *conn, uint16_t vol, int did, char *name)
unsigned int | AFPRemoveComment (CONN *conn, uint16_t vol, int did, char *name)
unsigned int | AFPAddComment (CONN *conn, uint16_t vol, int did, char *name, char *cmt)
unsigned int | AFPGetSessionToken (CONN *conn, int type, uint32_t time, int len, char *token)
unsigned int | AFPDisconnectOldSession (CONN *conn, uint16_t type, int len, char *token)
unsigned int | AFPGetUserInfo (CONN *conn, char flag, int id, uint16_t bitmap)
unsigned int | AFPMapID (CONN *conn, char fn, int id)
unsigned int | AFPMapName (CONN *conn, char fn, char *name)
unsigned int | AFPBadPacket (CONN *conn, char fn, char *name)
unsigned int | AFPReadHeader (DSI *dsi, uint16_t fork, int offset, int size, char *data)
unsigned int | AFPReadFooter (DSI *dsi, uint16_t fork, int offset, int size, char *data)
unsigned int | AFPRead (CONN *conn, uint16_t fork, int offset, int size, char *data)
unsigned int | AFPRead_ext (CONN *conn, uint16_t fork, off_t offset, off_t size, char *data)
unsigned int | AFPRead_ext_async (CONN *conn, uint16_t fork, off_t offset, off_t size, char *data)
unsigned int | AFPCreateDir (CONN *conn, uint16_t vol, int did, char *name)
unsigned int | AFPGetForkParam (CONN *conn, uint16_t fork, uint16_t bitmap)
unsigned int | AFPGetAPPL (CONN *conn, uint16_t dt, char *name, uint16_t index, uint16_t f_bitmap)
unsigned int | AFPAddAPPL (CONN *conn, uint16_t dt, int did, char *creator, uint32_t tag, char *name)
unsigned int | AFPRemoveAPPL (CONN *conn, uint16_t dt, int did, char *creator, char *name)
unsigned int | AFPCatSearch (CONN *conn, uint16_t vol, uint32_t nbe, char *pos, uint16_t f_bitmap, uint16_t d_bitmap, uint32_t rbitmap, struct afp_filedir_parms *filedir, struct afp_filedir_parms *filedir2)
unsigned int | AFPCatSearchExt (CONN *conn, uint16_t vol, uint32_t nbe, char *pos, uint16_t f_bitmap, uint16_t d_bitmap, uint32_t rbitmap, struct afp_filedir_parms *filedir, struct afp_filedir_parms *filedir2)
unsigned int | AFPGetACL (CONN *conn, uint16_t vol, int did, uint16_t bitmap, char *name)
unsigned int | AFPSetACL (CONN *conn, uint16_t vol, int did, uint16_t bitmap, char *name, uint32_t ace_count, darwin_ace_t *aces)
unsigned int | AFPGetExtAttr (CONN *conn, uint16_t vol, int did, uint16_t bitmap, int maxsize, char *pathname, char *attrname)
unsigned int | AFPListExtAttr (CONN *conn, uint16_t vol, int did, uint16_t bitmap, int maxsize, char *pathname)
unsigned int | AFPSetExtAttr (CONN *conn, uint16_t vol, int did, uint16_t bitmap, char *pathname, char *attrname, char *data)
unsigned int | AFPRemoveExtAttr (CONN *conn, uint16_t vol, int did, uint16_t bitmap, char *pathname, char *attrname)

## Variables
int | Throttle = 0
int | Convert = 1
int | Interactive = 0
int | Quiet = 1
int | Verbose = 0
int | Color = 1
static int | use_writev = 1
int | Attention_received
int | Force_type2

## Macro Definition Documentation

## ◆ kTextEncodingUTF8

#define kTextEncodingUTF8 0x08000103

## ◆ UNICODE

#define UNICODE | ( |  | a | ) |

Value:
(a->afp_version >= 30)

## Function Documentation

## ◆ afp_filedir_pack()

int afp_filedir_pack | ( | CONN * | conn,
|  | unsigned char * | b,
|  | struct afp_filedir_parms * | filedir,
|  | uint16_t | rfbitmap,
|  | uint16_t | rdbitmap )

## ◆ afp_filedir_unpack()

void afp_filedir_unpack | ( | CONN * | conn,
|  | struct afp_filedir_parms * | filedir,
|  | const unsigned char * | b,
|  | uint16_t | rfbitmap,
|  | uint16_t | rdbitmap )

## ◆ afp_volume_pack()

int afp_volume_pack | ( | unsigned char * | b,
|  | struct afp_volume_parms * | parms,
|  | uint16_t | bitmap )

Only backup date is valid.

## ◆ afp_volume_unpack()

void afp_volume_unpack | ( | struct afp_volume_parms * | parms,
|  | unsigned char * | b,
|  | uint16_t | rbitmap )

## ◆ AFPAddAPPL()

unsigned int AFPAddAPPL | ( | CONN * | conn,
|  | uint16_t | dt,
|  | int | did,
|  | char * | creator,
|  | uint32_t | tag,
|  | char * | name )

## ◆ AFPAddComment()

unsigned int AFPAddComment | ( | CONN * | conn,
|  | uint16_t | vol,
|  | int | did,
|  | char * | name,
|  | char * | cmt )

## ◆ AFPBadPacket()

unsigned int AFPBadPacket | ( | CONN * | conn,
|  | char | fn,
|  | char * | name )

## ◆ AFPByteLock()

unsigned int AFPByteLock | ( | CONN * | conn,
|  | uint16_t | fork,
|  | int | end,
|  | int | mode,
|  | int | offset,
|  | int | size )

## ◆ AFPByteLock_ext()

unsigned int AFPByteLock_ext | ( | CONN * | conn,
|  | uint16_t | fork,
|  | int | end,
|  | int | mode,
|  | off_t | offset,
|  | off_t | size )

## ◆ AFPCatSearch()

unsigned int AFPCatSearch | ( | CONN * | conn,
|  | uint16_t | vol,
|  | uint32_t | nbe,
|  | char * | pos,
|  | uint16_t | f_bitmap,
|  | uint16_t | d_bitmap,
|  | uint32_t | rbitmap,
|  | struct afp_filedir_parms * | filedir,
|  | struct afp_filedir_parms * | filedir2 )

## ◆ AFPCatSearchExt()

unsigned int AFPCatSearchExt | ( | CONN * | conn,
|  | uint16_t | vol,
|  | uint32_t | nbe,
|  | char * | pos,
|  | uint16_t | f_bitmap,
|  | uint16_t | d_bitmap,
|  | uint32_t | rbitmap,
|  | struct afp_filedir_parms * | filedir,
|  | struct afp_filedir_parms * | filedir2 )

## ◆ AFPChangePW()

unsigned int AFPChangePW | ( | CONN * | conn,
|  | char * | uam,
|  | char * | usr,
|  | char * | opwd,
|  | char * | pwd )

## ◆ AFPCloseDT()

unsigned int AFPCloseDT | ( | CONN * | conn,
|  | uint16_t | vol )

## ◆ AFPCloseFork()

unsigned int AFPCloseFork | ( | CONN * | conn,
|  | uint16_t | fork )

## ◆ AFPCloseVol()

unsigned int AFPCloseVol | ( | CONN * | conn,
|  | uint16_t | vol )

## ◆ AFPCreateDir()

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

## ◆ AFPCreateFile()

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

## ◆ AFPDelete()

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

## ◆ AFPDisconnectOldSession()

unsigned int AFPDisconnectOldSession | ( | CONN * | conn,
|  | uint16_t | type,
|  | int | len,
|  | char * | token )

## ◆ AFPFlush()

unsigned int AFPFlush | ( | CONN * | conn,
|  | uint16_t | vol )

## ◆ AFPFlushFork()

unsigned int AFPFlushFork | ( | CONN * | conn,
|  | uint16_t | vol )

## ◆ AFPGetACL()

unsigned int AFPGetACL | ( | CONN * | conn,
|  | uint16_t | vol,
|  | int | did,
|  | uint16_t | bitmap,
|  | char * | name )

## ◆ AFPGetAPPL()

unsigned int AFPGetAPPL | ( | CONN * | conn,
|  | uint16_t | dt,
|  | char * | name,
|  | uint16_t | index,
|  | uint16_t | f_bitmap )

## ◆ AFPGetComment()

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

## ◆ AFPGetExtAttr()

unsigned int AFPGetExtAttr | ( | CONN * | conn,
|  | uint16_t | vol,
|  | int | did,
|  | uint16_t | bitmap,
|  | int | maxsize,
|  | char * | pathname,
|  | char * | attrname )

## ◆ AFPGetForkParam()

unsigned int AFPGetForkParam | ( | CONN * | conn,
|  | uint16_t | fork,
|  | uint16_t | bitmap )

## ◆ AFPGetSessionToken()

unsigned int AFPGetSessionToken | ( | CONN * | conn,
|  | int | type,
|  | uint32_t | time,
|  | int | len,
|  | char * | token )

## ◆ AFPGetSrvrInfo()

unsigned int AFPGetSrvrInfo | ( | CONN * | conn | ) |

## ◆ AFPGetSrvrMsg()

unsigned int AFPGetSrvrMsg | ( | CONN * | conn,
|  | uint16_t | type,
|  | uint16_t | bitmap )

## ◆ AFPGetSrvrParms()

unsigned int AFPGetSrvrParms | ( | CONN * | conn | ) |

## ◆ AFPGetUserInfo()

unsigned int AFPGetUserInfo | ( | CONN * | conn,
|  | char | flag,
|  | int | id,
|  | uint16_t | bitmap )

## ◆ AFPGetVolParam()

unsigned int AFPGetVolParam | ( | CONN * | conn,
|  | uint16_t | vol,
|  | uint16_t | bitmap )

## ◆ AFPListExtAttr()

unsigned int AFPListExtAttr | ( | CONN * | conn,
|  | uint16_t | vol,
|  | int | did,
|  | uint16_t | bitmap,
|  | int | maxsize,
|  | char * | pathname )

## ◆ AFPLoginCont()

unsigned int AFPLoginCont | ( | CONN * | conn,
|  | const void * | auth_info,
|  | size_t | auth_info_len )

## ◆ AFPLogOut()

unsigned int AFPLogOut | ( | CONN * | conn | ) |

## ◆ AFPMapID()

unsigned int AFPMapID | ( | CONN * | conn,
|  | char | fn,
|  | int | id )

## ◆ AFPMapName()

unsigned int AFPMapName | ( | CONN * | conn,
|  | char | fn,
|  | char * | name )

## ◆ AFPOpenFork()

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

## ◆ AFPopenLogin()

unsigned int AFPopenLogin | ( | CONN * | conn,
|  | const char * | vers,
|  | const char * | uam,
|  | const char * | usr,
|  | const char * | pwd )

Bug
  spec violation in netatalk FPlogout ==> dsiclose

## ◆ AFPopenLoginExt()

unsigned int AFPopenLoginExt | ( | CONN * | conn,
|  | const char * | vers,
|  | const char * | uam,
|  | const char * | usr,
|  | const void * | auth_info,
|  | size_t | auth_info_len )

## ◆ AFPopenLoginExt_pwd()

unsigned int AFPopenLoginExt_pwd | ( | CONN * | conn,
|  | const char * | vers,
|  | const char * | uam,
|  | const char * | usr,
|  | const char * | pwd )

## ◆ AFPOpenVol()

uint16_t AFPOpenVol | ( | CONN * | conn,
|  | char * | vol,
|  | uint16_t | bitmap )

## ◆ AFPRead()

unsigned int AFPRead | ( | CONN * | conn,
|  | uint16_t | fork,
|  | int | offset,
|  | int | size,
|  | char * | data )

## ◆ AFPRead_ext()

unsigned int AFPRead_ext | ( | CONN * | conn,
|  | uint16_t | fork,
|  | off_t | offset,
|  | off_t | size,
|  | char * | data )

Note
  Assume size < 2GB

## ◆ AFPRead_ext_async()

unsigned int AFPRead_ext_async | ( | CONN * | conn,
|  | uint16_t | fork,
|  | off_t | offset,
|  | off_t | size,
|  | char * | data )

## ◆ AFPReadFooter()

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

## ◆ AFPReadHeader()

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

## ◆ AFPRemoveAPPL()

unsigned int AFPRemoveAPPL | ( | CONN * | conn,
|  | uint16_t | dt,
|  | int | did,
|  | char * | creator,
|  | char * | name )

## ◆ AFPRemoveComment()

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

## ◆ AFPRemoveExtAttr()

unsigned int AFPRemoveExtAttr | ( | CONN * | conn,
|  | uint16_t | vol,
|  | int | did,
|  | uint16_t | bitmap,
|  | char * | pathname,
|  | char * | attrname )

## ◆ AFPSetACL()

unsigned int AFPSetACL | ( | CONN * | conn,
|  | uint16_t | vol,
|  | int | did,
|  | uint16_t | bitmap,
|  | char * | name,
|  | uint32_t | ace_count,
|  | darwin_ace_t * | aces )

## ◆ AFPSetExtAttr()

unsigned int AFPSetExtAttr | ( | CONN * | conn,
|  | uint16_t | vol,
|  | int | did,
|  | uint16_t | bitmap,
|  | char * | pathname,
|  | char * | attrname,
|  | char * | data )

## ◆ AFPSetForkParam()

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

## ◆ AFPSetVolParam()

unsigned int AFPSetVolParam | ( | CONN * | conn,
|  | uint16_t | vol,
|  | uint16_t | bitmap,
|  | struct afp_volume_parms * | parms )

## ◆ AFPWrite()

unsigned int AFPWrite | ( | CONN * | conn,
|  | uint16_t | fork,
|  | int | offset,
|  | int | size,
|  | char * | data,
|  | char | whence )

## ◆ AFPWrite_ext()

unsigned int AFPWrite_ext | ( | CONN * | conn,
|  | uint16_t | fork,
|  | off_t | offset,
|  | off_t | size,
|  | char * | data,
|  | char | whence )

## ◆ AFPWrite_ext_async()

unsigned int AFPWrite_ext_async | ( | CONN * | conn,
|  | uint16_t | fork,
|  | off_t | offset,
|  | off_t | size,
|  | char * | data,
|  | char | whence )

## ◆ AFPWriteFooter()

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

## ◆ AFPWriteHeader()

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

## ◆ AFPzzz()

unsigned int AFPzzz | ( | CONN * | conn,
|  | int | flag )

## ◆ capture_login_cont()

void capture_login_cont | ( | CONN * | conn | ) |
| static

## ◆ CloseClientSocket()

int CloseClientSocket | ( | int | fd | ) |

## ◆ dsi_cmd_receive()

int dsi_cmd_receive | ( | DSI * | x | ) |

## ◆ dsi_data_receive()

int dsi_data_receive | ( | DSI * | x | ) |

## ◆ dsi_full_receive()

int dsi_full_receive | ( | DSI * | x,
|  | unsigned char * | buf,
|  | int | length )
| static

## ◆ dsi_read_header()

int dsi_read_header | ( | DSI * | dsi | ) |

## ◆ dsi_receive()

int dsi_receive | ( | DSI * | x,
|  | unsigned char * | buf,
|  | size_t | length )
| static

## ◆ dsi_stream_read()

size_t dsi_stream_read | ( | DSI * | dsi,
|  | void * | data,
|  | const size_t | length )

Read data from DSI buffer.

read raw data. return actual bytes read. this will wait until it gets length bytes

Essentially a loop around buf_read() to ensure "length" bytes are read from dsi->buffer and/or the socket.

Returns
  length on success, some value smaller than length indicates an error

## ◆ dsi_stream_receive()

int dsi_stream_receive | ( | DSI * | dsi,
|  | void * | buf,
|  | const size_t | ilength,
|  | size_t * | rlength )

read data. function on success. 0 on failure. data length gets stored in length variable. this should really use size_t's, but that would require changes elsewhere.

## ◆ dsi_stream_send()

int dsi_stream_send | ( | DSI * | dsi,
|  | void * | buf,
|  | size_t | length )

write data.

Returns
  0 on failure.

Note
  this assumes that dsi_len will never cause an overflow in the data buffer.

## ◆ dsi_stream_write()

size_t dsi_stream_write | ( | DSI * | dsi,
|  | void * | data,
|  | const size_t | length )

## ◆ dsi_tickle()

void dsi_tickle | ( | DSI * | dsi | ) |

server generated tickles. as this is only called by the tickle handler, we don't need to block signals.

## ◆ DSICloseSession()

unsigned int DSICloseSession | ( | CONN * | conn | ) |

Close Session no reply

## ◆ DSIGetStatus()

unsigned int DSIGetStatus | ( | CONN * | conn | ) |

GetStatus

## ◆ DSIOpenSession()

unsigned int DSIOpenSession | ( | CONN * | conn | ) |

Open a new session

## ◆ fp_free()

void fp_free | ( | void * | ptr | ) |

Our free wrapper. It does nothing special at the moment.

## ◆ fp_malloc()

void * fp_malloc | ( | size_t | size | ) |

Our malloc wrapper. It zeroes allocated memory.

## ◆ fp_realloc()

void * fp_realloc | ( | void * | ptr,
|  | size_t | size )

## ◆ FPset_name()

int FPset_name | ( | CONN * | conn,
|  | int | ofs,
|  | char * | name )

## ◆ get_off_t()

off_t get_off_t | ( | unsigned char ** | ibuf,
|  | int | is64 )
| static

## ◆ OpenClientSocket()

int OpenClientSocket | ( | char * | host,
|  | int | port )

## ◆ SendCmd()

int SendCmd | ( | DSI * | dsi,
|  | uint8_t | cmd )
| static

## ◆ SendCmdVolDidCname()

unsigned int SendCmdVolDidCname | ( | CONN * | conn,
|  | uint8_t | cmd,
|  | uint16_t | vol,
|  | int | did,
|  | char * | name )
| static

## ◆ SendCmdWithU16()

int SendCmdWithU16 | ( | DSI * | dsi,
|  | uint8_t | cmd,
|  | uint16_t | param )
| static

## ◆ SendInit()

void SendInit | ( | DSI * | dsi | ) |

## ◆ set_off_t()

int set_off_t | ( | off_t | offset,
|  | uint8_t * | rbuf,
|  | int | is64 )
| static

## ◆ SetLen()

void SetLen | ( | DSI * | dsi,
|  | int | ofs )

## ◆ strp2c()

int strp2c | ( | char * | cstr,
|  | const unsigned char * | pstr )

Converts Pascal string to C (null-terminated) string.

## ◆ strp2cdup()

char * strp2cdup | ( | unsigned char * | src | ) |

## ◆ u2mac()

void u2mac | ( | uint8_t * | dst,
|  | char * | name,
|  | int | len )

## Variable Documentation

## ◆ Attention_received

int Attention_received

## ◆ Color

int Color = 1

## ◆ Convert

int Convert = 1

## ◆ Force_type2

int Force_type2

## ◆ Interactive

int Interactive = 0

## ◆ Quiet

int Quiet = 1

## ◆ Throttle

int Throttle = 0

## ◆ use_writev

int use_writev = 1
| static

write data. 0 on failure. this assumes that dsi_len will never cause an overflow in the data buffer.

## ◆ Verbose

int Verbose = 0