1 /* close the connection */
7 unsigned char buf[PAP_HDRSIZ];
10 buf[ 0 ] = pap->pap_connid;
12 buf[ 2 ] = buf[ 3 ] = 0;
14 atpb.atp_saddr = &pap->pap_sat;
15 atpb.atp_sreqdata = buf;
16 atpb.atp_sreqdlen = sizeof(buf); /* bytes in CloseConn request */
17 atpb.atp_sreqto = 2; /* retry timer */
18 atpb.atp_sreqtries = 5; /* retry count */
19 if (atp_sreq( atp, &atpb, 1, ATP_XO ) < 0) {
23 /* check for CloseConnReply */
24 iov.iov_base = pap->pap_data;
25 iov.iov_len = sizeof( pap->pap_data );
26 atpb.atp_rresiov = &iov;
27 atpb.atp_rresiovcnt = 1;
28 if ( atp_rresp( pap->pap_atp, &atpb ) < 0 ) {
33 if ( iov.iov_len != 4 || pap->pap_data[ 0 ] != pap->pap_connid ||
34 pap->pap_data[ 1 ] != PAP_CLOSEREPLY ) {
35 syslog(LOG_ERR, "pap_close: Bad response!");
41 atp_close(pap->pap_atp);