netatalk 4.5.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
atp.h File Reference

ATP packet format. More...

`#include <stdint.h>`
`#include <sys/types.h>`
`#include <sys/time.h>`
`#include <netatalk/at.h>`

Go to the source code of this file.

## Data Structures
struct | atphdr
struct | atpxobuf
struct | atpbuf
struct | atp_handle
struct | sreq_st
struct | rres_st
struct | rreq_st
struct | sres_st
struct | atp_block

## Macros
#define | ATP_MAXDATA (578+4)
#define | ATP_BUFSIZ 587
#define | ATP_HDRSIZE 5
#define | ATP_TRELMASK 0x07
#define | ATP_RELTIME 30
#define | ATP_TREL30 0x0
#define | ATP_TREL1M 0x1
#define | ATP_TREL2M 0x2
#define | ATP_TREL4M 0x3
#define | ATP_TREL8M 0x4
#define | ATP_TRIES_INFINITE -1
#define | atp_sockaddr(h)
#define | atp_fileno(x)
#define | atp_sreqdata atp_data.sreqdata.atpd_data
#define | atp_sreqdlen atp_data.sreqdata.atpd_dlen
#define | atp_sreqtries atp_data.sreqdata.atpd_tries
#define | atp_sreqto atp_data.sreqdata.atpd_to
#define | atp_rresiov atp_data.rresdata.atpd_iov
#define | atp_rresiovcnt atp_data.rresdata.atpd_iovcnt
#define | atp_rreqdata atp_data.rreqdata.atpd_data
#define | atp_rreqdlen atp_data.rreqdata.atpd_dlen
#define | atp_sresiov atp_data.sresdata.atpd_iov
#define | atp_sresiovcnt atp_data.sresdata.atpd_iovcnt
#define | ATP_STS (1<<3)
#define | ATP_EOM (1<<4)
#define | ATP_XO (1<<5)
#define | ATP_FUNCMASK (3<<6)
#define | ATP_TREQ (1<<6)
#define | ATP_TRESP (2<<6)
#define | ATP_TREL (3<<6)

## Typedefs
typedef struct atp_handle * | ATP

## Functions
ATP | atp_open (uint8_t, const struct at_addr *)
int | atp_close (ATP)
int | atp_sreq (ATP, struct atp_block *, int, uint8_t)
| Send ATP transaction service request.
int | atp_rresp (ATP, struct atp_block *)
| Receives ATP response packets.
int | atp_rsel (ATP, struct sockaddr_at *, int)
| Receive ATP packets.
int | atp_rreq (ATP, struct atp_block *)
| wait for a transaction service request
int | atp_sresp (ATP, struct atp_block *)
| send a transaction response

## Detailed Description

ATP packet format.

|----------------|
| link header |
| ... |
|----------------|
| DDP header |
| ... |
| type = 3 |
|----------------|
| control info | --> bits 7,6: function code
|----------------| 5: XO bit
| bitmap/seq no. | 4: EOM bit
|----------------| 3: STS bit
| TID (MSB) | 2,1,0: release timer code (ignored under phase I)
|----------------|
| TID (LSB) |
|----------------|
| user bytes (4) |
|----------------|
| data (0-578) |
| ... |
|----------------|
phase
int phase(struct interface *iface, char **av)
Definition config.c:538
function
#define function
Definition hash.c:48
data
#define data
Definition hash.c:38
type
static enum op type
Definition nad_cp.c:96
seq
static uint16_t seq
Definition pap.c:505
header
static void header(void)
Print test header with timestamp.
Definition speedtest.c:742

## Macro Definition Documentation

## ◆ ATP_BUFSIZ

#define ATP_BUFSIZ 587

maximum packet size

## ◆ ATP_EOM

#define ATP_EOM (1<<4)

End Of Message

## ◆ atp_fileno

#define atp_fileno | ( |  | x | ) |

Value:
((x)->atph_socket)

## ◆ ATP_FUNCMASK

#define ATP_FUNCMASK (3<<6)

mask all but function

## ◆ ATP_HDRSIZE

#define ATP_HDRSIZE 5

includes DDP type field

## ◆ ATP_MAXDATA

#define ATP_MAXDATA (578+4)

maximum ATP data size

## ◆ ATP_RELTIME

#define ATP_RELTIME 30

base release timer (in secs)

## ◆ atp_rreqdata

#define atp_rreqdata atp_data.rreqdata.atpd_data

## ◆ atp_rreqdlen

#define atp_rreqdlen atp_data.rreqdata.atpd_dlen

## ◆ atp_rresiov

#define atp_rresiov atp_data.rresdata.atpd_iov

## ◆ atp_rresiovcnt

#define atp_rresiovcnt atp_data.rresdata.atpd_iovcnt

## ◆ atp_sockaddr

#define atp_sockaddr | ( |  | h | ) |

Value:
(&(h)->atph_saddr)

## ◆ atp_sreqdata

#define atp_sreqdata atp_data.sreqdata.atpd_data

## ◆ atp_sreqdlen

#define atp_sreqdlen atp_data.sreqdata.atpd_dlen

## ◆ atp_sreqto

#define atp_sreqto atp_data.sreqdata.atpd_to

## ◆ atp_sreqtries

#define atp_sreqtries atp_data.sreqdata.atpd_tries

## ◆ atp_sresiov

#define atp_sresiov atp_data.sresdata.atpd_iov

## ◆ atp_sresiovcnt

#define atp_sresiovcnt atp_data.sresdata.atpd_iovcnt

## ◆ ATP_STS

#define ATP_STS (1<<3)

Send Transaction Status

## ◆ ATP_TREL

#define ATP_TREL (3<<6)

Trans. RELease

## ◆ ATP_TREL1M

#define ATP_TREL1M 0x1

these are passed in flags of

## ◆ ATP_TREL2M

#define ATP_TREL2M 0x2

atp_sreq call, and set in the

## ◆ ATP_TREL30

#define ATP_TREL30 0x0

release time codes

## ◆ ATP_TREL4M

#define ATP_TREL4M 0x3

packet control info.

## ◆ ATP_TREL8M

#define ATP_TREL8M 0x4

## ◆ ATP_TRELMASK

#define ATP_TRELMASK 0x07

mask all but TREL

## ◆ ATP_TREQ

#define ATP_TREQ (1<<6)

Trans. REQuest

## ◆ ATP_TRESP

#define ATP_TRESP (2<<6)

Trans. RESPonse

## ◆ ATP_TRIES_INFINITE

#define ATP_TRIES_INFINITE -1

for atp_sreq, etc

## ◆ ATP_XO

#define ATP_XO (1<<5)

eXactly Once mode

## Typedef Documentation

## ◆ ATP

typedef struct atp_handle* ATP

## Function Documentation

## ◆ atp_close()

int atp_close | ( | ATP | ah | ) |
| extern

## ◆ atp_open()

ATP atp_open | ( | uint8_t | port,
|  | const struct at_addr * | saddr )
| extern

## ◆ atp_rreq()

int atp_rreq | ( | ATP | ah,
|  | struct atp_block * | atpb )
| extern

wait for a transaction service request

Parameters

  ah | open atp handle
  atpb | parameter block

## ◆ atp_rresp()

int atp_rresp | ( | ATP | ah,
|  | struct atp_block * | atpb )
| extern

Receives ATP response packets.

Parameters

  ah | open atp handle
  atpb | parameter block

## ◆ atp_rsel()

int atp_rsel | ( | ATP | ah,
|  | struct sockaddr_at * | faddr,
|  | int | func )
| extern

Receive ATP packets.

Parameters

  ah | open atp handle
  faddr | address to receive from
  func | which function(s) to wait for; 0 means request or response

## ◆ atp_sreq()

int atp_sreq | ( | ATP | ah,
|  | struct atp_block * | atpb,
|  | int | respcount,
|  | uint8_t | flags )
| extern

Send ATP transaction service request.

Parameters

  ah | open atp handle
  atpb | parameter block
  respcount | buffers available for response
  flags | ATP_XO, ATP_TREL

## ◆ atp_sresp()

int atp_sresp | ( | ATP | ah,
|  | struct atp_block * | atpb )
| extern

send a transaction response

Parameters

  ah | open atp handle
  atpb | parameter block