2 * Copyright (c) 1990,1997 Regents of The University of Michigan.
3 * All Rights Reserved. See COPYRIGHT.
11 #include <sys/types.h>
13 #include <sys/socket.h>
15 #include <netatalk/at.h>
16 #include <atalk/netddp.h>
17 #include <atalk/atp.h>
18 #include "atp_internals.h"
29 /* remove from list of open atp sockets & discard queued data
32 print_bufuse( ah, "atp_close");
35 while ( ah->atph_queue != NULL ) {
37 ah->atph_queue = cq->atpbuf_next;
41 while ( ah->atph_sent != NULL ) {
43 for ( i = 0; i < 8; ++i ) {
44 if ( cq->atpbuf_info.atpbuf_xo.atpxo_packet[ i ] != NULL ) {
45 atp_free_buf( cq->atpbuf_info.atpbuf_xo.atpxo_packet[ i ] );
48 ah->atph_sent = cq->atpbuf_next;
52 if ( ah->atph_reqpkt != NULL ) {
53 atp_free_buf( ah->atph_reqpkt );
54 ah->atph_reqpkt = NULL;
57 for ( i = 0; i < 8; ++i ) {
58 if ( ah->atph_resppkt[ i ] != NULL ) {
59 atp_free_buf( ah->atph_resppkt[ i ] );
60 ah->atph_resppkt[ i ] = NULL;
65 print_bufuse( ah, "atp_close end");
69 atp_free_buf( (struct atpbuf *) ah );
71 if (netddp_close(i) < 0)