]> arthur.barton.de Git - netatalk.git/blob - libatalk/pap/pap_read.c
Added include for ../../sys headers
[netatalk.git] / libatalk / pap / pap_read.c
1 /* taken from bin/pap/pap.c */
2
3 int pap_read(PAP pap)
4 {
5     struct atp_block atpb;
6     u_int16_t seq;
7
8     pap->cmdbuf[0] = pap->pap_connid;
9     pap->cmdbuf[1] = PAP_READ;
10     if ( ++pap->pap_seq == 0 ) 
11       pap->pap_seq = 1;
12
13     seq = htons( pap->pap_seq );
14     memcpy(pap->cmdbuf + 2, &seq, sizeof(seq));
15     atpb.atp_saddr = &pap->pap_sat;
16     atpb.atp_sreqdata = pap->cmdbuf;
17     atpb.atp_sreqdlen = sizeof(pap->cmdbuf);    /* bytes in SendData request */
18     atpb.atp_sreqto = 15;               /* retry timer */
19     atpb.atp_sreqtries = ATP_TRIES_INFINITE;    /* retry count */
20     if ( atp_sreq( pap->pap_atp, &atpb, pap->oquantum, ATP_XO ) < 0 ) {
21       return -1;
22     }
23
24     return 0;
25 }