1 /* $NetBSD: tp_subr2.c,v 1.40 2009/03/18 17:06:53 cegger Exp $ */
4 * Copyright (c) 1991, 1993
5 * The Regents of the University of California. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the University nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * @(#)tp_subr2.c 8.1 (Berkeley) 6/10/93
34 /***********************************************************
35 Copyright IBM Corporation 1987
39 Permission to use, copy, modify, and distribute this software and its
40 documentation for any purpose and without fee is hereby granted,
41 provided that the above copyright notice appear in all copies and that
42 both that copyright notice and this permission notice appear in
43 supporting documentation, and that the name of IBM not be
44 used in advertising or publicity pertaining to distribution of the
45 software without specific, written prior permission.
47 IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
48 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
49 IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
50 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
51 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
52 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
55 ******************************************************************/
58 * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
61 * Some auxiliary routines: tp_protocol_error: required by xebec- called when
62 * a combo of state, event, predicate isn't covered for by the transition
63 * file. tp_indicate: gives indications(signals) to the user process
64 * tp_getoptions: initializes variables that are affected by the options
68 #include <sys/cdefs.h>
69 __KERNEL_RCSID(0, "$NetBSD: tp_subr2.c,v 1.40 2009/03/18 17:06:53 cegger Exp $");
72 * this def'n is to cause the expansion of this macro in the routine
75 #define LOCAL_CREDIT_EXPAND
80 #include <sys/param.h>
81 #include <sys/systm.h>
83 #include <sys/socket.h>
84 #include <sys/socketvar.h>
85 #include <sys/domain.h>
86 #include <sys/protosw.h>
87 #include <sys/errno.h>
89 #include <sys/kernel.h>
90 #include <sys/queue.h>
93 #include <net/if_types.h>
95 #include <netiso/argo_debug.h>
96 #include <netiso/tp_param.h>
97 #include <netiso/tp_ip.h>
98 #include <netiso/iso.h>
99 #include <netiso/iso_errno.h>
100 #include <netiso/iso_pcb.h>
101 #include <netiso/iso_var.h>
102 #include <netiso/tp_timer.h>
103 #include <netiso/tp_stat.h>
104 #include <netiso/tp_tpdu.h>
105 #include <netiso/tp_pcb.h>
106 #include <netiso/tp_seq.h>
107 #include <netiso/tp_trace.h>
108 #include <netiso/tp_user.h>
109 #include <netiso/tp_var.h>
110 #include <netiso/cons.h>
111 #include <netiso/clnp.h>
114 static void copyQOSparms (struct tp_conn_param
*, struct tp_conn_param
*);
118 * NAME: tp_local_credit()
121 * tp_emit(), tp_usrreq()
123 * FUNCTION and ARGUMENTS:
124 * Computes the local credit and stashes it in tpcb->tp_lcredit.
125 * It's a macro in the production system rather than a procdure.
132 * This doesn't actually get called in a production system -
133 * the macro gets expanded instead in place of calls to this proc.
134 * But for debugging, we call this and that allows us to add
135 * debugging messages easily here.
138 tp_local_credit(struct tp_pcb
*tpcb
)
142 if (argo_debug
[D_CREDIT
]) {
143 printf("ref 0x%x lcdt 0x%x l_tpdusize 0x%x decbit 0x%x cong_win 0x%lx\n",
153 if (tp_traceflags
[D_CREDIT
]) {
154 tptraceTPCB(TPPTmisc
,
156 tpcb
->tp_lcredit
, tpcb
->tp_l_tpdusize
, 0, 0);
162 * NAME: tp_protocol_error()
165 * tp_driver(), when it doesn't know what to do with
166 * a combo of event, state, predicate
168 * FUNCTION and ARGUMENTS:
179 tp_protocol_error(struct tp_event
*e
, struct tp_pcb
*tpcb
)
181 printf("TP PROTOCOL ERROR! tpcb %p event 0x%x, state 0x%x\n",
182 tpcb
, e
->ev_number
, tpcb
->tp_state
);
184 if (tp_traceflags
[D_DRIVER
]) {
185 tptraceTPCB(TPPTmisc
, "PROTOCOL ERROR tpcb event state",
186 tpcb
, e
->ev_number
, tpcb
->tp_state
, 0);
189 return EIO
; /* for lack of anything better */
193 /* Not used at the moment */
201 * NAME: tp_indicate()
204 * tp.trans when XPD arrive, when a connection is being disconnected by
205 * the arrival of a DR or ER, and when a connection times out.
207 * FUNCTION and ARGUMENTS:
208 * (ind) is the type of indication : T_DISCONNECT, T_XPD
209 * (error) is an E* value that will be put in the socket structure
210 * to be passed along to the user later.
211 * Gives a SIGURG to the user process or group indicated by the socket
212 * attached to the tpcb.
221 tp_indicate(int ind
, struct tp_pcb
*tpcb
, u_int error
)
223 struct socket
*so
= tpcb
->tp_sock
;
225 if (tp_traceflags
[D_INDICATION
]) {
226 tptraceTPCB(TPPTindicate
, ind
, *(u_short
*) (tpcb
->tp_lsuffix
),
227 *(u_short
*) (tpcb
->tp_fsuffix
), error
, so
->so_pgid
);
231 if (argo_debug
[D_INDICATION
]) {
233 ls
= tpcb
->tp_lsuffix
,
234 fs
= tpcb
->tp_fsuffix
,
237 "indicate 0x%x lsuf 0x%02x%02x fsuf 0x%02x%02x err 0x%x noind 0x%x ref 0x%x\n",
239 *ls
, *(ls
+ 1), *fs
, *(fs
+ 1),
240 error
, /* so->so_pgrp, */
241 tpcb
->tp_no_disc_indications
,
246 if (ind
== ER_TPDU
) {
248 struct tp_disc_reason x
;
250 if ((so
->so_state
& SS_CANTRCVMORE
) == 0 &&
251 (m
= m_get(M_DONTWAIT
, MT_OOBDATA
)) != 0) {
253 x
.dr_hdr
.cmsg_len
= m
->m_len
= sizeof(x
);
254 x
.dr_hdr
.cmsg_level
= SOL_TRANSPORT
;
255 x
.dr_hdr
.cmsg_type
= TPOPT_DISC_REASON
;
257 *mtod(m
, struct tp_disc_reason
*) = x
;
258 sbappendrecord(&tpcb
->tp_Xrcv
, m
);
263 so
->so_error
= error
;
265 if (ind
== T_DISCONNECT
) {
267 so
->so_error
= ENOTCONN
;
268 if (tpcb
->tp_no_disc_indications
)
272 if (tp_traceflags
[D_INDICATION
]) {
273 tptraceTPCB(TPPTmisc
, "doing sohasoutofband(so)", so
, 0, 0, 0);
280 * NAME : tp_getoptions()
283 * tp.trans whenever we go into OPEN state
285 * FUNCTION and ARGUMENTS:
286 * sets the proper flags and values in the tpcb, to control
287 * the appropriate actions for the given class, options,
288 * sequence space, etc, etc.
297 tp_getoptions(struct tp_pcb
*tpcb
)
300 tpcb
->tp_xtd_format
? TP_XTD_FMT_MASK
: TP_NML_FMT_MASK
;
302 tpcb
->tp_xtd_format
? TP_XTD_FMT_BIT
: TP_NML_FMT_BIT
;
303 tpcb
->tp_seqhalf
= tpcb
->tp_seqbit
>> 1;
305 max(tpcb
->tp_dt_ticks
, (tpcb
->tp_peer_acktime
+ 2));
311 * NAME: tp_recycle_tsuffix()
314 * Called when a ref is frozen.
316 * FUNCTION and ARGUMENTS:
317 * allows the suffix to be reused.
326 tp_recycle_tsuffix(void *v
)
328 struct tp_pcb
*tpcb
= v
;
329 memset((void *) tpcb
->tp_lsuffix
, 0, sizeof(tpcb
->tp_lsuffix
));
330 memset((void *) tpcb
->tp_fsuffix
, 0, sizeof(tpcb
->tp_fsuffix
));
331 tpcb
->tp_fsuffixlen
= tpcb
->tp_lsuffixlen
= 0;
333 (tpcb
->tp_nlproto
->nlp_recycle_suffix
) (tpcb
->tp_npcb
);
340 * tp{af}_quench() when ICMP source quench or similar thing arrives.
342 * FUNCTION and ARGUMENTS:
343 * Drop the congestion window back to 1.
344 * Congestion window scheme:
345 * Initial value is 1. ("slow start" as Nagle, et. al. call it)
346 * For each good ack that arrives, the congestion window is increased
347 * by 1 (up to max size of logical infinity, which is to say,
348 * it doesn't wrap around).
349 * Source quench causes it to drop back to 1.
350 * tp_send() uses the smaller of (regular window, congestion window).
351 * One retransmission strategy option is to have any retransmission
352 * cause reset the congestion window back to 1.
354 * (cmd) is either PRC_QUENCH: source quench, or
355 * PRC_QUENCH2: dest. quench (dec bit)
364 tp_quench(struct inpcb
*ipcb
, int cmd
)
366 struct tp_pcb
*tpcb
= (struct tp_pcb
*) ipcb
;
368 if (argo_debug
[D_QUENCH
]) {
369 printf("tp_quench tpcb %p ref 0x%x sufx 0x%x\n",
370 tpcb
, tpcb
->tp_lref
, *(u_short
*) (tpcb
->tp_lsuffix
));
371 printf("cong_win 0x%lx decbit 0x%x \n",
372 tpcb
->tp_cong_win
, tpcb
->tp_decbit
);
377 tpcb
->tp_cong_win
= tpcb
->tp_l_tpdusize
;
381 /* might as well quench source also */
382 tpcb
->tp_cong_win
= tpcb
->tp_l_tpdusize
;
383 tpcb
->tp_decbit
= TP_DECBIT_CLEAR_COUNT
;
384 IncStat(ts_rcvdecbit
);
395 * FUNCTION and ARGUMENTS:
404 tp_netcmd(struct tp_pcb
*tpcb
, int cmd
)
406 printf("tp_netcmd(): X25 NOT CONFIGURED!!\n");
411 * tp_ctloutput() and tp_emit()
412 * FUNCTION and ARGUMENTS:
413 * Convert a class mask to the highest numeric value it represents.
416 tp_mask_to_num(u_char x
)
420 for (j
= 4; j
>= 0; j
--) {
424 ASSERT((j
== 4) || (j
== 0)); /* for now */
425 if ((j
!= 4) && (j
!= 0)) {
426 printf("ASSERTION ERROR: tp_mask_to_num: x 0x%x j %d\n",
430 if (tp_traceflags
[D_TPINPUT
]) {
431 tptrace(TPPTmisc
, "tp_mask_to_num(x) returns j", x
, j
, 0, 0);
435 if (argo_debug
[D_TPINPUT
]) {
436 printf("tp_mask_to_num(0x%x) returns 0x%x\n", x
, j
);
444 copyQOSparms(const struct tp_conn_param
*src
, struct tp_conn_params
*dst
)
446 /* copy all but the bits stuff at the end */
447 #define COPYSIZE (12 * sizeof(short))
449 memcpy((void *) dst
, (void *) src
, COPYSIZE
);
450 dst
->p_tpdusize
= src
->p_tpdusize
;
451 dst
->p_ack_strat
= src
->p_ack_strat
;
452 dst
->p_rx_strat
= src
->p_rx_strat
;
458 * Determine a reasonable value for maxseg size.
459 * If the route is known, check route for mtu.
460 * We also initialize the congestion/slow start
461 * window to be a single segment if the destination isn't local.
462 * While looking at the routing entry, we also initialize other path-dependent
463 * parameters from pre-set or cached values in the routing entry.
466 tp_mss(struct tp_pcb
*tpcb
, int nhdr_size
)
472 int i
, ssthresh
= 0, rt_mss
;
475 if (tpcb
->tp_ptpdusize
)
476 mss
= tpcb
->tp_ptpdusize
<< 7;
478 mss
= 1 << tpcb
->tp_tpdusize
;
480 if ((rt
= rtcache_validate(tpcb
->tp_routep
)) == NULL
) {
481 bufsize
= so
->so_rcv
.sb_hiwat
;
486 #ifdef RTV_MTU /* if route characteristics exist ... */
488 * While we're here, check if there's an initial rtt
489 * or rttvar. Convert from the route-table units
490 * to hz ticks for the smoothed timers and slow-timeout units
491 * for other inital variables.
493 if (tpcb
->tp_rtt
== 0 && (rtt
= rt
->rt_rmx
.rmx_rtt
)) {
494 tpcb
->tp_rtt
= rtt
* hz
/ RTM_RTTUNIT
;
495 if (rt
->rt_rmx
.rmx_rttvar
)
496 tpcb
->tp_rtv
= rt
->rt_rmx
.rmx_rttvar
499 tpcb
->tp_rtv
= tpcb
->tp_rtt
;
502 * if there's an mtu associated with the route, use it
504 if (rt
->rt_rmx
.rmx_mtu
)
505 rt_mss
= rt
->rt_rmx
.rmx_mtu
- nhdr_size
;
508 rt_mss
= (ifp
->if_mtu
- nhdr_size
);
509 if (tpcb
->tp_ptpdusize
== 0 || /* assume application doesn't care */
510 mss
> rt_mss
/* network won't support what was asked for */ )
512 /* can propose mtu which are multiples of 128 */
515 * If there's a pipesize, change the socket buffer
519 if ((bufsize
= rt
->rt_rmx
.rmx_sendpipe
) > 0) {
521 bufsize
= min(bufsize
, so
->so_snd
.sb_hiwat
);
522 (void) sbreserve(&so
->so_snd
, bufsize
, so
);
525 if ((bufsize
= rt
->rt_rmx
.rmx_recvpipe
) > 0) {
527 bufsize
= min(bufsize
, so
->so_rcv
.sb_hiwat
);
528 (void) sbreserve(&so
->so_rcv
, bufsize
, so
);
530 bufsize
= so
->so_rcv
.sb_hiwat
;
533 * There's some sort of gateway or interface
534 * buffer limit on the path. Use this to set
535 * the slow start threshhold, but set the
536 * threshold to no less than 2*mss.
538 ssthresh
= rt
->rt_rmx
.rmx_ssthresh
;
541 * The current mss is initialized to the default value.
542 * If we compute a smaller value, reduce the current mss.
543 * If we compute a larger value, return it for use in sending
544 * a max seg size option.
545 * If we received an offer, don't exceed it.
546 * However, do not accept offers under 128 bytes.
548 if (tpcb
->tp_l_tpdusize
)
549 mss
= min(mss
, tpcb
->tp_l_tpdusize
);
551 * We want a minimum recv window of 4 packets to
552 * signal packet loss by duplicate acks.
554 mss
= min(mss
, bufsize
>> 2) & ~0x7f;
555 mss
= max(mss
, 128); /* sanity */
557 (rt
== 0 || (rt
->rt_flags
& RTF_GATEWAY
)) ? mss
: bufsize
;
558 tpcb
->tp_l_tpdusize
= mss
;
560 tpcb
->tp_ssthresh
= max(2 * mss
, ssthresh
);
561 /* Calculate log2 of mss */
562 for (i
= TP_MIN_TPDUSIZE
+ 1; i
<= TP_MAX_TPDUSIZE
; i
++)
566 tpcb
->tp_tpdusize
= i
;
572 * tp_usrreq on PRU_CONNECT and tp_input on receipt of CR
574 * FUNCTION and ARGUMENTS:
575 * -- An mbuf containing the peer's network address.
576 * -- Our control block, which will be modified
577 * -- In the case of cons, a control block for that layer.
582 * EAFNOSUPPORT if can't find an nl_protosw for x.25 (really could panic)
583 * ECONNREFUSED if trying to run TP0 with non-type 37 address
584 * possibly other E* returned from cons_netcmd()
587 * Determines recommended tpdusize, buffering and intial delays
588 * based on information cached on the route.
591 tp_route_to(struct mbuf
*m
, struct tp_pcb
*tpcb
, void *channel
)
593 struct sockaddr_iso
*siso
; /* NOTE: this may be a
595 int error
= 0, save_netservice
= tpcb
->tp_netservice
;
596 struct rtentry
*rt
= 0;
599 siso
= mtod(m
, struct sockaddr_iso
*);
601 if (tp_traceflags
[D_CONN
]) {
602 tptraceTPCB(TPPTmisc
,
603 "route_to: so afi netservice class",
604 tpcb
->tp_sock
, siso
->siso_addr
.isoa_genaddr
[0], tpcb
->tp_netservice
,
609 if (argo_debug
[D_CONN
]) {
610 printf("tp_route_to( m %p, channel %p, tpcb %p netserv 0x%x)\n",
611 m
, channel
, tpcb
, tpcb
->tp_netservice
);
612 printf("m->mlen x%x, m->m_data:\n", m
->m_len
);
613 dump_buf(mtod(m
, void *), m
->m_len
);
616 if (channel
== NULL
) {
617 switch (siso
->siso_family
) {
619 error
= EAFNOSUPPORT
;
624 struct isopcb
*isop
= (struct isopcb
*) tpcb
->tp_npcb
;
625 int flags
= tpcb
->tp_sock
->so_options
& SO_DONTROUTE
;
626 tpcb
->tp_netservice
= ISO_CLNS
;
627 if (clnp_route(&siso
->siso_addr
, &isop
->isop_route
,
628 flags
, NULL
, NULL
) == 0) {
629 rt
= rtcache_validate(&isop
->isop_route
);
630 if (rt
&& rt
->rt_flags
& RTF_PROTO1
)
631 tpcb
->tp_netservice
= ISO_CONS
;
637 tpcb
->tp_netservice
= IN_CLNS
;
640 if (tpcb
->tp_nlproto
->nlp_afamily
!= siso
->siso_family
) {
642 if (argo_debug
[D_CONN
]) {
643 printf("tp_route_to( CHANGING nlproto old 0x%x new 0x%x)\n",
644 save_netservice
, tpcb
->tp_netservice
);
647 if ((error
= tp_set_npcb(tpcb
)) != 0)
651 if (argo_debug
[D_CONN
]) {
652 printf("tp_route_to calling nlp_pcbconn, netserv %d\n",
653 tpcb
->tp_netservice
);
656 tpcb
->tp_nlproto
= nl_protosw
+ tpcb
->tp_netservice
;
657 error
= (*tpcb
->tp_nlproto
->nlp_pcbconn
) (tpcb
->tp_npcb
, m
, NULL
);
661 /* only gets common info */
662 nhdr_size
= (*tpcb
->tp_nlproto
->nlp_mtu
)(tpcb
);
663 tp_mss(tpcb
, nhdr_size
);
666 if (argo_debug
[D_CONN
]) {
667 printf("tp_route_to returns 0x%x\n", error
);
671 if (tp_traceflags
[D_CONN
]) {
672 tptraceTPCB(TPPTmisc
, "route_to: returns: error netserv class", error
,
673 tpcb
->tp_netservice
, tpcb
->tp_class
, 0);
679 /* class zero version */
681 tp0_stash(struct tp_pcb
*tpcb
, struct tp_event
*e
)
683 #define E e->TPDU_ATTR(DT)
685 struct sockbuf
*sb
= &tpcb
->tp_sock
->so_rcv
;
689 PStat(tpcb
, Nb_from_ll
) += E
.e_datalen
;
690 tpmeas(tpcb
->tp_lref
, TPtime_from_ll
, &e
->e_time
,
691 E
.e_seq
, PStat(tpcb
, Nb_from_ll
), E
.e_datalen
);
696 if (argo_debug
[D_STASH
]) {
697 printf("stash EQ: seq 0x%x datalen 0x%x eot 0x%x",
698 E
.e_seq
, E
.e_datalen
, E
.e_eot
);
703 if (tp_traceflags
[D_STASH
]) {
704 tptraceTPCB(TPPTmisc
, "stash EQ: seq len eot",
705 E
.e_seq
, E
.e_datalen
, E
.e_eot
, 0);
710 struct mbuf
*n
= E
.e_data
;
712 n
->m_nextpkt
= NULL
; /* set on tp_input */
714 sbappend(sb
, E
.e_data
);
716 if (argo_debug
[D_STASH
]) {
717 dump_mbuf(sb
->sb_mb
, "stash 0: so_rcv after appending");
720 if (tpcb
->tp_netservice
!= ISO_CONS
)
721 printf("tp0_stash: tp running over something weird\n");
725 tp0_openflow(struct tp_pcb
*tpcb
)
727 if (tpcb
->tp_netservice
!= ISO_CONS
)
728 printf("tp0_openflow: tp running over something weird\n");
734 * tp_ctloutput() when the user sets TPOPT_PERF_MEAS on
735 * and tp_newsocket() when a new connection is made from
736 * a listening socket with tp_perf_on == true.
737 * FUNCTION and ARGUMENTS:
738 * (tpcb) is the usual; this procedure gets a clear cluster mbuf for
739 * a tp_pmeas structure, and makes tpcb->tp_p_meas point to it.
741 * ENOBUFS if it cannot get a cluster mbuf.
745 tp_setup_perf(struct tp_pcb
*tpcb
)
747 if (tpcb
->tp_p_meas
== 0) {
748 tpcb
->tp_p_meas
= malloc(sizeof(struct tp_pmeas
), M_PCB
, M_WAITOK
|M_ZERO
);
750 if (argo_debug
[D_PERF_MEAS
]) {
752 "tpcb 0x%x so 0x%x ref 0x%x tp_p_meas 0x%x tp_perf_on 0x%x\n",
753 tpcb
, tpcb
->tp_sock
, tpcb
->tp_lref
,
754 tpcb
->tp_p_meas
, tpcb
->tp_perf_on
);
757 tpcb
->tp_perf_on
= 1;
761 #endif /* TP_PERF_MEAS */
765 dump_addr(struct sockaddr
*addr
)
767 switch (addr
->sa_family
) {
770 dump_inaddr(satosin(addr
));
775 dump_isoaddr(satosiso(addr
));
779 printf("BAD AF: 0x%x\n", addr
->sa_family
);
784 #define MAX_COLUMNS 8
786 * Dump the buffer to the screen in a readable format. Format is:
788 * hex/dec where hex is the hex format, dec is the decimal format.
789 * columns of hex/dec numbers will be printed, followed by the
790 * character representations (if printable).
793 Dump_buf(const void *buf
, size_t len
)
796 #define Buf ((const u_char *)buf)
797 printf("Dump buf %p len 0x%lx\n", buf
, (unsigned long)len
);
798 for (i
= 0; i
< len
; i
+= MAX_COLUMNS
) {
800 for (j
= 0; j
< MAX_COLUMNS
; j
++) {
802 printf("%x/%d\t", Buf
[i
+ j
], Buf
[i
+ j
]);
808 for (j
= 0; j
< MAX_COLUMNS
; j
++) {
810 if (((Buf
[i
+ j
]) > 31) && ((Buf
[i
+ j
]) < 128))
811 printf("%c", Buf
[i
+ j
]);
819 #endif /* ARGO_DEBUG */