2 * Copyright (c) 1990,1997 Regents of The University of Michigan.
3 * All Rights Reserved. See COPYRIGHT.
9 #include <netatalk/at.h>
10 #include <atalk/netddp.h>
11 #include <atalk/atp.h>
12 #include "atp_internals.h"
23 /* remove from list of open atp sockets & discard queued data
26 print_bufuse( ah, "atp_close");
29 while ( ah->atph_queue != NULL ) {
31 ah->atph_queue = cq->atpbuf_next;
35 while ( ah->atph_sent != NULL ) {
37 for ( i = 0; i < 8; ++i ) {
38 if ( cq->atpbuf_info.atpbuf_xo.atpxo_packet[ i ] != NULL ) {
39 atp_free_buf( cq->atpbuf_info.atpbuf_xo.atpxo_packet[ i ] );
42 ah->atph_sent = cq->atpbuf_next;
46 if ( ah->atph_reqpkt != NULL ) {
47 atp_free_buf( ah->atph_reqpkt );
48 ah->atph_reqpkt = NULL;
51 for ( i = 0; i < 8; ++i ) {
52 if ( ah->atph_resppkt[ i ] != NULL ) {
53 atp_free_buf( ah->atph_resppkt[ i ] );
54 ah->atph_resppkt[ i ] = NULL;
59 print_bufuse( ah, "atp_close end");
63 atp_free_buf( (struct atpbuf *) ah );
65 if (netddp_close(i) < 0)