1 /* close the connection */
11 unsigned char buf[PAP_HDRSIZ];
14 buf[ 0 ] = pap->pap_connid;
16 buf[ 2 ] = buf[ 3 ] = 0;
18 atpb.atp_saddr = &pap->pap_sat;
19 atpb.atp_sreqdata = buf;
20 atpb.atp_sreqdlen = sizeof(buf); /* bytes in CloseConn request */
21 atpb.atp_sreqto = 2; /* retry timer */
22 atpb.atp_sreqtries = 5; /* retry count */
23 if (atp_sreq( atp, &atpb, 1, ATP_XO ) < 0) {
27 /* check for CloseConnReply */
28 iov.iov_base = pap->pap_data;
29 iov.iov_len = sizeof( pap->pap_data );
30 atpb.atp_rresiov = &iov;
31 atpb.atp_rresiovcnt = 1;
32 if ( atp_rresp( pap->pap_atp, &atpb ) < 0 ) {
37 if ( iov.iov_len != 4 || pap->pap_data[ 0 ] != pap->pap_connid ||
38 pap->pap_data[ 1 ] != PAP_CLOSEREPLY ) {
39 syslog(LOG_ERR, "pap_close: Bad response!");
45 atp_close(pap->pap_atp);