2 * Copyright (c) 1990,1997 Regents of The University of Michigan.
3 * All Rights Reserved. See COPYRIGHT.
11 #include <sys/types.h>
13 #include <netatalk/at.h>
14 #include <atalk/netddp.h>
15 #include <atalk/atp.h>
16 #include "atp_internals.h"
27 /* remove from list of open atp sockets & discard queued data
30 print_bufuse( ah, "atp_close");
33 while ( ah->atph_queue != NULL ) {
35 ah->atph_queue = cq->atpbuf_next;
39 while ( ah->atph_sent != NULL ) {
41 for ( i = 0; i < 8; ++i ) {
42 if ( cq->atpbuf_info.atpbuf_xo.atpxo_packet[ i ] != NULL ) {
43 atp_free_buf( cq->atpbuf_info.atpbuf_xo.atpxo_packet[ i ] );
46 ah->atph_sent = cq->atpbuf_next;
50 if ( ah->atph_reqpkt != NULL ) {
51 atp_free_buf( ah->atph_reqpkt );
52 ah->atph_reqpkt = NULL;
55 for ( i = 0; i < 8; ++i ) {
56 if ( ah->atph_resppkt[ i ] != NULL ) {
57 atp_free_buf( ah->atph_resppkt[ i ] );
58 ah->atph_resppkt[ i ] = NULL;
63 print_bufuse( ah, "atp_close end");
67 atp_free_buf( (struct atpbuf *) ah );
69 if (netddp_close(i) < 0)