/*
+ * $Id: atp_packet.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <string.h>
#include <sys/types.h>
/* FIXME/SOCKLEN_T: socklen_t is a unix98 feature. */
#ifndef SOCKLEN_T
#define SOCKLEN_T unsigned int
-#endif
+#endif /* ! SOCKLEN_T */
#ifdef EBUG
#include <stdio.h>
saddr->sat_port == ATADDR_ANYPORT ? printf( "*" ) :
printf( "%d", saddr->sat_port );
}
-#endif
+#endif /* EBUG */
void atp_build_req_packet( pktbuf, tid, ctrl, atpb )
*/
#ifdef EBUG
atp_print_bufuse( ah, "recv_atp checking queue" );
-#endif
+#endif /* EBUG */
for ( pq = NULL, cq = ah->atph_queue; cq != NULL;
pq = cq, cq = cq->atpbuf_next ) {
memcpy(&ahdr, cq->atpbuf_info.atpbuf_data + 1,
print_func( rfunc );
atp_print_addr( " from", &cq->atpbuf_addr );
putchar( '\n' );
-#endif
+#endif /* EBUG */
if ((( tid & ahdr.atphd_tid ) == ahdr.atphd_tid ) &&
(( *func & rfunc ) == rfunc )
&& at_addr_eq( fromaddr, &cq->atpbuf_addr )) {
print_func( *func );
atp_print_addr( " from", fromaddr );
putchar( '\n' );
-#endif
+#endif /* EBUG */
do {
#ifdef EBUG
fflush( stdout );
-#endif
+#endif /* EBUG */
faddrlen = sizeof( struct sockaddr_at );
memset( &faddr, 0, sizeof( struct sockaddr_at ));
atp_print_addr( " from", &faddr );
putchar( '\n' );
bprint( rbuf, recvlen );
-#endif
+#endif /* EBUG */
if ( rfunc == ATP_TREL ) {
/* remove response from sent list */
for ( pq = NULL, cq = ah->atph_sent; cq != NULL;
if ( cq != NULL ) {
#ifdef EBUG
printf( "<%d> releasing transaction %hu\n", getpid(), ntohs( rtid ));
-#endif
+#endif /* EBUG */
if ( pq == NULL ) {
ah->atph_sent = cq->atpbuf_next;
} else {
/* add packet to incoming queue */
#ifdef EBUG
printf( "<%d> queuing incoming...\n", getpid() );
-#endif
+#endif /* EBUG */
if (( inbuf = atp_alloc_buf()) == NULL ) {
return -1;
}