Documentation
¶
Index ¶
- Constants
- func AddAppl(conn net.Conn, volID uint16, dirID uint32, creator [4]byte, applTag [4]byte, ...) bool
- func AnonymousLogin(conn net.Conn) bool
- func CloseFork(conn net.Conn, forkID uint16) bool
- func Connect(host string, port int, ssl bool) (net.Conn, bool)
- func CreateFile(conn net.Conn, volumeID uint16, dirID uint32, fileName string) bool
- func Delete(conn net.Conn, volumeID uint16, dirID uint32, path string) bool
- func DeleteFile(conn net.Conn, path string) bool
- func Disconnect(conn net.Conn) bool
- func FlushFork(conn net.Conn, forkID uint16) bool
- func Logout(conn net.Conn) bool
- func MoveAndRenameFile(conn net.Conn, srcVolID uint16, srcDirID uint32, srcPath string, ...) bool
- func OpenSession(conn net.Conn) bool
- func OpenVolume(conn net.Conn, bitmap uint16, volumeName []byte) (uint16, bool)
- func ReadFile(conn net.Conn, path string, forkFlag byte) ([]byte, bool)
- func RenameFileHelper(conn net.Conn, srcPath string, dstPath string, dstName string) bool
- func SetFilParams(conn net.Conn, volID uint16, dirID uint32, bitmap uint16, path string, ...) bool
- func SetForkParams(conn net.Conn, forkID uint16, bitmap uint16, size uint64) bool
- func WalkRootDir(conn net.Conn, path string) (uint16, uint32, bool)
- func WriteExt(conn net.Conn, forkID uint16, fdata []byte) bool
- func WriteFile(conn net.Conn, path string, fdata []byte, withFork bool) bool
- func WriteNewFile(conn net.Conn, path string, fdata []byte, withFork bool) bool
- func WritePacket(conn net.Conn, packet FPPacket) bool
- type FPPacket
- func CreateFPPacket(command byte, payload []byte) FPPacket
- func Decode(data []byte) (FPPacket, bool)
- func GetAppl(conn net.Conn, volID uint16, creator [4]byte, aIndex uint16, bitmap uint16) (*FPPacket, bool)
- func GetForkParams(conn net.Conn, forkID uint16, bitmap uint16) (*FPPacket, bool)
- func GetServerStatus(host string, port int, ssl bool) (*FPPacket, bool)
- func OpenFork(conn net.Conn, flag byte, volumeID uint16, dirID uint32, bitmap uint16, ...) (*FPPacket, bool)
- func ReadExt(conn net.Conn, forkID uint16, offset uint64, count uint64) (*FPPacket, bool)
- func ReadPacket(conn net.Conn) (*FPPacket, bool)
- type Header
Constants ¶
const ( DSICloseSession = byte(0x1) DSICommand = byte(0x2) DSIGetStatus = byte(0x3) DSIOpenSession = byte(0x4) DSITickle = byte(0x5) DSIWrite = byte(0x6) DSIAttention = byte(0x8) AFPByteLock = 0x01 AFPCloseVol = 0x02 AFPCloseDir = 0x03 AFPCloseFork = 0x04 AFPCopyFile = 0x05 AFPCreateDir = 0x06 AFPCreateFile = 0x07 AFPDelete = 0x08 AFPEnumerate = 0x09 AFPFlush = 0x0a AFPFlushFork = 0x0b AFPGetForkParams = 0x0e AFPGetSrvrInfo = 0x0f AFPGetSrvrParams = 0x10 AFPGetVolParams = 0x11 AFPLogin = 0x12 AFPLoginCont = 0x13 AFPLogout = 0x14 AFPMapID = 0x15 AFPMapName = 0x16 AFPMoveAndRename = 0x17 AFPOpenVol = 0x18 AFPOpenDir = 0x19 AFPOpenFork = 0x1a AFPRead = 0x1b AFPRename = 0x1c AFPSetDirParams = 0x1d AFPSetFileParams = 0x1e AFPSetForkParams = 0x1f AFPSetVolParams = 0x20 AFPWrite = 0x21 AFPGetFileDirParams = 0x22 AFPSetFileDirParams = 0x23 AFPChangePW = 0x24 AFPGetUserInfo = 0x25 AFPGetSrvrMesg = 0x26 AFPCreateID = 0x27 AFPDeleteID = 0x28 AFPResolveID = 0x29 AFPExchangeFiles = 0x2a AFPCatSearch = 0x2b AFPOpenDT = 0x30 AFPCloseDT = 0x31 AFPGetIcon = 0x33 AFPGetIconInfo = 0x34 AFPAddAppl = 0x35 AFPRmvAppl = 0x36 AFPGetAppl = 0x37 AFPAddComment = 0x38 AFPRmvComment = 0x39 AFPGetComment = 0x3a AFPReadExt = 0x3c AFPWriteExt = 0x3d AFPGetExtAttr = 0x45 AFPSetExtAttr = 0x46 VolBitmapAttributes = 0x1 VolBitmapSignature = 0x2 VolBitmapCreationDate = 0x4 VolBitmapModificationDate = 0x8 VolBitmapBackupDate = 0x10 VolBitmapID = 0x20 VolBitmapBytesFree = 0x40 VolBitmapBytesTotal = 0x80 VolBitmapName = 0x100 VolBitmapExtendedBytesFree = 0x200 VolBitmapExtendedBytesTotal = 0x400 VolBitmapBlockSize = 0x800 FileBitmapAttributes = 0x1 FileBitmapParentDirID = 0x2 FileBitmapCreationDate = 0x4 FileBitmapModificationDate = 0x8 FileBitmapBackupDate = 0x10 FileBitmapFinderInfo = 0x20 FileBitmapLongName = 0x40 FileBitmapShortName = 0x80 FileBitmapNodeID = 0x100 FileBitmapDataForkSize = 0x200 FileBitmapResourceForkSize = 0x400 FileBitmapExtendedDataForkSize = 0x800 FileBitmapLaunchLimit = 0x1000 FileBitmapUTF8Name = 0x2000 FileBitmapExtendedResourceForkSize = 0x4000 FileBitmapUnixPrivileges = 0x8000 FileBitmapALL = 0xFFFF DirBitmapAttributes = 0x1 DirBitmapParentDirID = 0x0 DirBitmapCreationDate = 0x4 DirBitmapModificationDate = 0x8 DirBitmapBackupDate = 0x10 DirBitmapFinderInfo = 0x20 DirBitmapLongName = 0x40 DirBitmapShortName = 0x80 DirBitmapNodeID = 0x100 DirBitmapOffspringCount = 0x200 DirBitmapOwnerID = 0x400 DirBitmapGroupID = 0x800 DirBitmapAccessRights = 0x1000 DirBitmapUTF8Name = 0x2000 DirBitmapUnixPrivileges = 0x8000 DirBitmapALL = 0xBFFF AccessModeRead = 0x1 AccessModeWrite = 0x2 AccessModeDenyRead = 0x10 AccessModeDenyWrite = 0x20 )
Variables ¶
This section is empty.
Functions ¶
func AddAppl ¶ added in v1.39.0
func AddAppl(conn net.Conn, volID uint16, dirID uint32, creator [4]byte, applTag [4]byte, path string) bool
Sends the AddAppl command to the AFP server.
func AnonymousLogin ¶
Logs into the AFP server as the guest user.
func CreateFile ¶
Sends the CreateFile command to the AFP server.
func DeleteFile ¶
Deletes a file from the root directory of AFP Server via filename.
func MoveAndRenameFile ¶
func MoveAndRenameFile(conn net.Conn, srcVolID uint16, srcDirID uint32, srcPath string, dstDirID uint32, dstPath string, dstName string) bool
Sends the Move and Rename command to the AFP server.
func OpenVolume ¶
Sends the OpenVolume command to the AFP server.
func ReadFile ¶
Reads a file in the root directory on a AFP server. Works by looking up the file in the root volume, opening it's metadata file, and reading the file data. The parameters are conn - a connection to the AFP server created by afp.Connect(), path - a string of the file to open, and forkFlag, which is passed to OpenFork. To read just the file contents, it should be 0x00, to read fork resource data, it should be 0x02.
func RenameFileHelper ¶
Move and Renames an existing file to the root directory of AFP Server.
func SetFilParams ¶ added in v1.39.0
func SetFilParams(conn net.Conn, volID uint16, dirID uint32, bitmap uint16, path string, buffer []byte) bool
Sends the setfileparams command to the AFP server.
func SetForkParams ¶
Sends the SetForkParams command to the AFP server.
func WalkRootDir ¶
Walks the root directory of a volume by opening the volume by ID.
func WriteFile ¶
Writes to an existing file to the root directory of AFP Server. The parameters are conn - a connection to the AFP server created by afp.Connect(), path - a string of the file to create, fdata - the file data to write, and withFork - whether to create a fork metadata file.
func WriteNewFile ¶
Writes a new file to the root directory of AFP Server. The parameters are conn - a connection to the AFP server created by afp.Connect(), path - a string of the file to create, fdata - the file data to write, and withFork - whether to create a fork metadata file.
Types ¶
type FPPacket ¶
func CreateFPPacket ¶
Creates a FPPacket given a command byte and payload.
func GetAppl ¶ added in v1.39.0
func GetAppl(conn net.Conn, volID uint16, creator [4]byte, aIndex uint16, bitmap uint16) (*FPPacket, bool)
Sends the GetAppl command to the AFP server.
func GetForkParams ¶
Sends the GetForkParams command to the AFP server.
func GetServerStatus ¶
Connects to an AFP server and gets server information.
func OpenFork ¶
func OpenFork(conn net.Conn, flag byte, volumeID uint16, dirID uint32, bitmap uint16, accessMode uint16, path string) (*FPPacket, bool)
Sends the OpenFork command to the AFP server.