1 /* $KAME: key_debug.c,v 1.29 2001/08/16 14:25:41 itojun Exp $ */
4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
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 project 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 PROJECT 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 PROJECT 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
37 #if defined(__FreeBSD__) && __FreeBSD__ >= 3
39 #include "opt_inet6.h"
40 #include "opt_ipsec.h"
47 #include <sys/types.h>
48 #include <sys/param.h>
50 #include <sys/systm.h>
52 #include <sys/queue.h>
54 #include <sys/socket.h>
56 #include <netinet/in.h>
57 #ifdef HAVE_NETINET6_IPSEC
58 # include <netinet6/ipsec.h>
60 # include <netinet/ipsec.h>
72 static void kdebug_sadb_prop
__P((struct sadb_ext
*));
73 static void kdebug_sadb_identity
__P((struct sadb_ext
*));
74 static void kdebug_sadb_supported
__P((struct sadb_ext
*));
75 static void kdebug_sadb_lifetime
__P((struct sadb_ext
*));
76 static void kdebug_sadb_sa
__P((struct sadb_ext
*));
77 static void kdebug_sadb_address
__P((struct sadb_ext
*));
78 static void kdebug_sadb_key
__P((struct sadb_ext
*));
79 static void kdebug_sadb_x_sa2
__P((struct sadb_ext
*));
80 static void kdebug_sadb_x_policy
__P((struct sadb_ext
*ext
));
81 static void kdebug_sockaddr
__P((struct sockaddr
*addr
));
83 #ifdef SADB_X_EXT_NAT_T_TYPE
84 static void kdebug_sadb_x_nat_t_type
__P((struct sadb_ext
*ext
));
85 static void kdebug_sadb_x_nat_t_port
__P((struct sadb_ext
*ext
));
89 static void kdebug_secreplay
__P((struct secreplay
*));
93 #define panic(param) { printf(param); exit(1); }
97 /* NOTE: host byte order */
99 /* %%%: about struct sadb_msg */
102 struct sadb_msg
*base
;
104 struct sadb_ext
*ext
;
109 panic("kdebug_sadb: NULL pointer was passed.\n");
111 printf("sadb_msg{ version=%u type=%u errno=%u satype=%u\n",
112 base
->sadb_msg_version
, base
->sadb_msg_type
,
113 base
->sadb_msg_errno
, base
->sadb_msg_satype
);
114 printf(" len=%u reserved=%u seq=%u pid=%u\n",
115 base
->sadb_msg_len
, base
->sadb_msg_reserved
,
116 base
->sadb_msg_seq
, base
->sadb_msg_pid
);
118 tlen
= PFKEY_UNUNIT64(base
->sadb_msg_len
) - sizeof(struct sadb_msg
);
119 ext
= (void *)((caddr_t
)(void *)base
+ sizeof(struct sadb_msg
));
122 printf("sadb_ext{ len=%u type=%u }\n",
123 ext
->sadb_ext_len
, ext
->sadb_ext_type
);
125 if (ext
->sadb_ext_len
== 0) {
126 printf("kdebug_sadb: invalid ext_len=0 was passed.\n");
129 if (ext
->sadb_ext_len
> tlen
) {
130 printf("kdebug_sadb: ext_len exceeds end of buffer.\n");
134 switch (ext
->sadb_ext_type
) {
138 case SADB_EXT_LIFETIME_CURRENT
:
139 case SADB_EXT_LIFETIME_HARD
:
140 case SADB_EXT_LIFETIME_SOFT
:
141 kdebug_sadb_lifetime(ext
);
143 case SADB_EXT_ADDRESS_SRC
:
144 case SADB_EXT_ADDRESS_DST
:
145 case SADB_EXT_ADDRESS_PROXY
:
146 kdebug_sadb_address(ext
);
148 case SADB_EXT_KEY_AUTH
:
149 case SADB_EXT_KEY_ENCRYPT
:
150 kdebug_sadb_key(ext
);
152 case SADB_EXT_IDENTITY_SRC
:
153 case SADB_EXT_IDENTITY_DST
:
154 kdebug_sadb_identity(ext
);
156 case SADB_EXT_SENSITIVITY
:
158 case SADB_EXT_PROPOSAL
:
159 kdebug_sadb_prop(ext
);
161 case SADB_EXT_SUPPORTED_AUTH
:
162 case SADB_EXT_SUPPORTED_ENCRYPT
:
163 kdebug_sadb_supported(ext
);
165 case SADB_EXT_SPIRANGE
:
166 case SADB_X_EXT_KMPRIVATE
:
168 case SADB_X_EXT_POLICY
:
169 kdebug_sadb_x_policy(ext
);
172 kdebug_sadb_x_sa2(ext
);
174 #ifdef SADB_X_EXT_NAT_T_TYPE
175 case SADB_X_EXT_NAT_T_TYPE
:
176 kdebug_sadb_x_nat_t_type(ext
);
178 case SADB_X_EXT_NAT_T_SPORT
:
179 case SADB_X_EXT_NAT_T_DPORT
:
180 kdebug_sadb_x_nat_t_port(ext
);
182 case SADB_X_EXT_NAT_T_OA
:
183 kdebug_sadb_address(ext
);
187 printf("kdebug_sadb: invalid ext_type %u was passed.\n",
192 extlen
= PFKEY_UNUNIT64(ext
->sadb_ext_len
);
194 ext
= (void *)((caddr_t
)(void *)ext
+ extlen
);
201 kdebug_sadb_prop(ext
)
202 struct sadb_ext
*ext
;
204 struct sadb_prop
*prop
= (void *)ext
;
205 struct sadb_comb
*comb
;
210 panic("kdebug_sadb_prop: NULL pointer was passed.\n");
212 len
= (PFKEY_UNUNIT64(prop
->sadb_prop_len
) - sizeof(*prop
))
214 comb
= (void *)(prop
+ 1);
215 printf("sadb_prop{ replay=%u\n", prop
->sadb_prop_replay
);
218 printf("sadb_comb{ auth=%u encrypt=%u "
219 "flags=0x%04x reserved=0x%08x\n",
220 comb
->sadb_comb_auth
, comb
->sadb_comb_encrypt
,
221 comb
->sadb_comb_flags
, comb
->sadb_comb_reserved
);
223 printf(" auth_minbits=%u auth_maxbits=%u "
224 "encrypt_minbits=%u encrypt_maxbits=%u\n",
225 comb
->sadb_comb_auth_minbits
,
226 comb
->sadb_comb_auth_maxbits
,
227 comb
->sadb_comb_encrypt_minbits
,
228 comb
->sadb_comb_encrypt_maxbits
);
230 printf(" soft_alloc=%u hard_alloc=%u "
231 "soft_bytes=%lu hard_bytes=%lu\n",
232 comb
->sadb_comb_soft_allocations
,
233 comb
->sadb_comb_hard_allocations
,
234 (unsigned long)comb
->sadb_comb_soft_bytes
,
235 (unsigned long)comb
->sadb_comb_hard_bytes
);
237 printf(" soft_alloc=%lu hard_alloc=%lu "
238 "soft_bytes=%lu hard_bytes=%lu }\n",
239 (unsigned long)comb
->sadb_comb_soft_addtime
,
240 (unsigned long)comb
->sadb_comb_hard_addtime
,
241 (unsigned long)comb
->sadb_comb_soft_usetime
,
242 (unsigned long)comb
->sadb_comb_hard_usetime
);
251 kdebug_sadb_identity(ext
)
252 struct sadb_ext
*ext
;
254 struct sadb_ident
*id
= (void *)ext
;
259 panic("kdebug_sadb_identity: NULL pointer was passed.\n");
261 len
= PFKEY_UNUNIT64(id
->sadb_ident_len
) - sizeof(*id
);
262 printf("sadb_ident_%s{",
263 id
->sadb_ident_exttype
== SADB_EXT_IDENTITY_SRC
? "src" : "dst");
264 switch (id
->sadb_ident_type
) {
266 printf(" type=%d id=%lu",
267 id
->sadb_ident_type
, (u_long
)id
->sadb_ident_id
);
270 ipsec_hexdump((caddr_t
)(id
+ 1), len
); /*XXX cast ?*/
274 p
= (void *)(id
+ 1);
276 for (/*nothing*/; *p
&& p
< ep
; p
++) {
277 if (isprint((int)*p
))
278 printf("%c", *p
& 0xff);
280 printf("\\%03o", *p
& 0xff);
294 kdebug_sadb_supported(ext
)
295 struct sadb_ext
*ext
;
297 struct sadb_supported
*sup
= (void *)ext
;
298 struct sadb_alg
*alg
;
303 panic("kdebug_sadb_supported: NULL pointer was passed.\n");
305 len
= (PFKEY_UNUNIT64(sup
->sadb_supported_len
) - sizeof(*sup
))
307 alg
= (void *)(sup
+ 1);
308 printf("sadb_sup{\n");
310 printf(" { id=%d ivlen=%d min=%d max=%d }\n",
311 alg
->sadb_alg_id
, alg
->sadb_alg_ivlen
,
312 alg
->sadb_alg_minbits
, alg
->sadb_alg_maxbits
);
321 kdebug_sadb_lifetime(ext
)
322 struct sadb_ext
*ext
;
324 struct sadb_lifetime
*lft
= (void *)ext
;
328 printf("kdebug_sadb_lifetime: NULL pointer was passed.\n");
330 printf("sadb_lifetime{ alloc=%u, bytes=%u\n",
331 lft
->sadb_lifetime_allocations
,
332 (u_int32_t
)lft
->sadb_lifetime_bytes
);
333 printf(" addtime=%u, usetime=%u }\n",
334 (u_int32_t
)lft
->sadb_lifetime_addtime
,
335 (u_int32_t
)lft
->sadb_lifetime_usetime
);
342 struct sadb_ext
*ext
;
344 struct sadb_sa
*sa
= (void *)ext
;
348 panic("kdebug_sadb_sa: NULL pointer was passed.\n");
350 printf("sadb_sa{ spi=%u replay=%u state=%u\n",
351 (u_int32_t
)ntohl(sa
->sadb_sa_spi
), sa
->sadb_sa_replay
,
353 printf(" auth=%u encrypt=%u flags=0x%08x }\n",
354 sa
->sadb_sa_auth
, sa
->sadb_sa_encrypt
, sa
->sadb_sa_flags
);
360 kdebug_sadb_address(ext
)
361 struct sadb_ext
*ext
;
363 struct sadb_address
*addr
= (void *)ext
;
367 panic("kdebug_sadb_address: NULL pointer was passed.\n");
369 printf("sadb_address{ proto=%u prefixlen=%u reserved=0x%02x%02x }\n",
370 addr
->sadb_address_proto
, addr
->sadb_address_prefixlen
,
371 ((u_char
*)(void *)&addr
->sadb_address_reserved
)[0],
372 ((u_char
*)(void *)&addr
->sadb_address_reserved
)[1]);
374 kdebug_sockaddr((void *)((caddr_t
)(void *)ext
+ sizeof(*addr
)));
381 struct sadb_ext
*ext
;
383 struct sadb_key
*key
= (void *)ext
;
387 panic("kdebug_sadb_key: NULL pointer was passed.\n");
389 printf("sadb_key{ bits=%u reserved=%u\n",
390 key
->sadb_key_bits
, key
->sadb_key_reserved
);
394 if (((uint32_t)key
->sadb_key_bits
>> 3) >
395 (PFKEY_UNUNIT64(key
->sadb_key_len
) - sizeof(struct sadb_key
))) {
396 printf("kdebug_sadb_key: key length mismatch, bit:%d len:%ld.\n",
397 (uint32_t)key
->sadb_key_bits
>> 3,
398 (long)PFKEY_UNUNIT64(key
->sadb_key_len
) - sizeof(struct sadb_key
));
401 ipsec_hexdump(key
+ sizeof(struct sadb_key
),
402 (int)((uint32_t)key
->sadb_key_bits
>> 3));
408 kdebug_sadb_x_sa2(ext
)
409 struct sadb_ext
*ext
;
411 struct sadb_x_sa2
*sa2
= (void *)ext
;
415 panic("kdebug_sadb_x_sa2: NULL pointer was passed.\n");
417 printf("sadb_x_sa2{ mode=%u reqid=%u\n",
418 sa2
->sadb_x_sa2_mode
, sa2
->sadb_x_sa2_reqid
);
419 printf(" reserved1=%u reserved2=%u sequence=%u }\n",
420 sa2
->sadb_x_sa2_reserved1
, sa2
->sadb_x_sa2_reserved2
,
421 sa2
->sadb_x_sa2_sequence
);
427 kdebug_sadb_x_policy(ext
)
428 struct sadb_ext
*ext
;
430 struct sadb_x_policy
*xpl
= (void *)ext
;
431 struct sockaddr
*addr
;
435 panic("kdebug_sadb_x_policy: NULL pointer was passed.\n");
437 #ifdef HAVE_PFKEY_POLICY_PRIORITY
438 printf("sadb_x_policy{ type=%u dir=%u id=%x priority=%u }\n",
440 printf("sadb_x_policy{ type=%u dir=%u id=%x }\n",
442 xpl
->sadb_x_policy_type
, xpl
->sadb_x_policy_dir
,
443 #ifdef HAVE_PFKEY_POLICY_PRIORITY
444 xpl
->sadb_x_policy_id
, xpl
->sadb_x_policy_priority
);
446 xpl
->sadb_x_policy_id
);
449 if (xpl
->sadb_x_policy_type
== IPSEC_POLICY_IPSEC
) {
451 struct sadb_x_ipsecrequest
*xisr
;
453 tlen
= PFKEY_UNUNIT64(xpl
->sadb_x_policy_len
) - sizeof(*xpl
);
454 xisr
= (void *)(xpl
+ 1);
457 printf(" { len=%u proto=%u mode=%u level=%u reqid=%u\n",
458 xisr
->sadb_x_ipsecrequest_len
,
459 xisr
->sadb_x_ipsecrequest_proto
,
460 xisr
->sadb_x_ipsecrequest_mode
,
461 xisr
->sadb_x_ipsecrequest_level
,
462 xisr
->sadb_x_ipsecrequest_reqid
);
464 if (xisr
->sadb_x_ipsecrequest_len
> sizeof(*xisr
)) {
465 addr
= (void *)(xisr
+ 1);
466 kdebug_sockaddr(addr
);
467 addr
= (void *)((caddr_t
)(void *)addr
468 + sysdep_sa_len(addr
));
469 kdebug_sockaddr(addr
);
474 /* prevent infinite loop */
475 if (xisr
->sadb_x_ipsecrequest_len
== 0) {
476 printf("kdebug_sadb_x_policy: wrong policy struct.\n");
479 /* prevent overflow */
480 if (xisr
->sadb_x_ipsecrequest_len
> tlen
) {
481 printf("invalid ipsec policy length\n");
485 tlen
-= xisr
->sadb_x_ipsecrequest_len
;
487 xisr
= (void *)((caddr_t
)(void *)xisr
488 + xisr
->sadb_x_ipsecrequest_len
);
492 panic("kdebug_sadb_x_policy: wrong policy struct.\n");
498 #ifdef SADB_X_EXT_NAT_T_TYPE
500 kdebug_sadb_x_nat_t_type(struct sadb_ext
*ext
)
502 struct sadb_x_nat_t_type
*ntt
= (void *)ext
;
506 panic("kdebug_sadb_x_nat_t_type: NULL pointer was passed.\n");
508 printf("sadb_x_nat_t_type{ type=%u }\n", ntt
->sadb_x_nat_t_type_type
);
514 kdebug_sadb_x_nat_t_port(struct sadb_ext
*ext
)
516 struct sadb_x_nat_t_port
*ntp
= (void *)ext
;
520 panic("kdebug_sadb_x_nat_t_port: NULL pointer was passed.\n");
522 printf("sadb_x_nat_t_port{ port=%u }\n", ntohs(ntp
->sadb_x_nat_t_port_port
));
529 /* %%%: about SPD and SAD */
532 struct secpolicy
*sp
;
536 panic("kdebug_secpolicy: NULL pointer was passed.\n");
538 printf("secpolicy{ refcnt=%u state=%u policy=%u\n",
539 sp
->refcnt
, sp
->state
, sp
->policy
);
541 kdebug_secpolicyindex(&sp
->spidx
);
543 switch (sp
->policy
) {
544 case IPSEC_POLICY_DISCARD
:
545 printf(" type=discard }\n");
547 case IPSEC_POLICY_GENERATE
:
548 printf(" type=generate }\n");
550 case IPSEC_POLICY_NONE
:
551 printf(" type=none }\n");
553 case IPSEC_POLICY_IPSEC
:
555 struct ipsecrequest
*isr
;
556 for (isr
= sp
->req
; isr
!= NULL
; isr
= isr
->next
) {
558 printf(" level=%u\n", isr
->level
);
559 kdebug_secasindex(&isr
->saidx
);
561 if (isr
->sav
!= NULL
)
562 kdebug_secasv(isr
->sav
);
567 case IPSEC_POLICY_BYPASS
:
568 printf(" type=bypass }\n");
570 case IPSEC_POLICY_ENTRUST
:
571 printf(" type=entrust }\n");
574 printf("kdebug_secpolicy: Invalid policy found. %d\n",
583 kdebug_secpolicyindex(spidx
)
584 struct secpolicyindex
*spidx
;
588 panic("kdebug_secpolicyindex: NULL pointer was passed.\n");
590 printf("secpolicyindex{ dir=%u prefs=%u prefd=%u ul_proto=%u\n",
591 spidx
->dir
, spidx
->prefs
, spidx
->prefd
, spidx
->ul_proto
);
593 ipsec_hexdump((caddr_t
)&spidx
->src
,
594 sysdep_sa_len((struct sockaddr
*)&spidx
->src
));
596 ipsec_hexdump((caddr_t
)&spidx
->dst
,
597 sysdep_sa_len((struct sockaddr
*)&spidx
->dst
));
604 kdebug_secasindex(saidx
)
605 struct secasindex
*saidx
;
609 panic("kdebug_secpolicyindex: NULL pointer was passed.\n");
611 printf("secasindex{ mode=%u proto=%u\n",
612 saidx
->mode
, saidx
->proto
);
614 ipsec_hexdump((caddr_t
)&saidx
->src
,
615 sysdep_sa_len((struct sockaddr
*)&saidx
->src
));
617 ipsec_hexdump((caddr_t
)&saidx
->dst
,
618 sysdep_sa_len((struct sockaddr
*)&saidx
->dst
));
626 struct secasvar
*sav
;
630 panic("kdebug_secasv: NULL pointer was passed.\n");
633 kdebug_secasindex(&sav
->sah
->saidx
);
635 printf(" refcnt=%u state=%u auth=%u enc=%u\n",
636 sav
->refcnt
, sav
->state
, sav
->alg_auth
, sav
->alg_enc
);
637 printf(" spi=%u flags=%u\n",
638 (u_int32_t
)ntohl(sav
->spi
), sav
->flags
);
640 if (sav
->key_auth
!= NULL
)
641 kdebug_sadb_key((struct sadb_ext
*)sav
->key_auth
);
642 if (sav
->key_enc
!= NULL
)
643 kdebug_sadb_key((struct sadb_ext
*)sav
->key_enc
);
644 if (sav
->iv
!= NULL
) {
646 ipsec_hexdump(sav
->iv
, sav
->ivlen
? sav
->ivlen
: 8);
650 if (sav
->replay
!= NULL
)
651 kdebug_secreplay(sav
->replay
);
652 if (sav
->lft_c
!= NULL
)
653 kdebug_sadb_lifetime((struct sadb_ext
*)sav
->lft_c
);
654 if (sav
->lft_h
!= NULL
)
655 kdebug_sadb_lifetime((struct sadb_ext
*)sav
->lft_h
);
656 if (sav
->lft_s
!= NULL
)
657 kdebug_sadb_lifetime((struct sadb_ext
*)sav
->lft_s
);
660 /* XXX: misc[123] ? */
667 kdebug_secreplay(rpl
)
668 struct secreplay
*rpl
;
674 panic("kdebug_secreplay: NULL pointer was passed.\n");
676 printf(" secreplay{ count=%u wsize=%u seq=%u lastseq=%u",
677 rpl
->count
, rpl
->wsize
, rpl
->seq
, rpl
->lastseq
);
679 if (rpl
->bitmap
== NULL
) {
684 printf("\n bitmap { ");
686 for (len
= 0; len
< rpl
->wsize
; len
++) {
687 for (l
= 7; l
>= 0; l
--)
688 printf("%u", (((rpl
->bitmap
)[len
] >> l
) & 1) ? 1 : 0);
703 printf("mbuf(%p){ m_next:%p m_nextpkt:%p m_data:%p "
704 "m_len:%d m_type:0x%02x m_flags:0x%02x }\n",
705 m
, m
->m_next
, m
->m_nextpkt
, m
->m_data
,
706 m
->m_len
, m
->m_type
, m
->m_flags
);
708 if (m
->m_flags
& M_PKTHDR
) {
709 printf(" m_pkthdr{ len:%d rcvif:%p }\n",
710 m
->m_pkthdr
.len
, m
->m_pkthdr
.rcvif
);
714 if (m
->m_flags
& M_EXT
) {
715 printf(" m_ext{ ext_buf:%p ext_free:%p "
716 "ext_size:%u ext_ref:%p }\n",
717 m
->m_ext
.ext_buf
, m
->m_ext
.ext_free
,
718 m
->m_ext
.ext_size
, m
->m_ext
.ext_ref
);
732 for (j
= 0; m
; m
= m
->m_next
) {
734 printf(" m_data:\n");
735 for (i
= 0; i
< m
->m_len
; i
++) {
736 if (i
&& i
% 32 == 0)
740 printf("%02x", mtod(m
, u_char
*)[i
]);
751 kdebug_sockaddr(addr
)
752 struct sockaddr
*addr
;
754 struct sockaddr_in
*sin4
;
756 struct sockaddr_in6
*sin6
;
761 panic("kdebug_sockaddr: NULL pointer was passed.\n");
763 /* NOTE: We deal with port number as host byte order. */
764 printf("sockaddr{ len=%u family=%u", sysdep_sa_len(addr
), addr
->sa_family
);
766 switch (addr
->sa_family
) {
769 printf(" port=%u\n", ntohs(sin4
->sin_port
));
770 ipsec_hexdump(&sin4
->sin_addr
, sizeof(sin4
->sin_addr
));
775 printf(" port=%u\n", ntohs(sin6
->sin6_port
));
776 printf(" flowinfo=0x%08x, scope_id=0x%08x\n",
777 sin6
->sin6_flowinfo
, sin6
->sin6_scope_id
);
778 ipsec_hexdump(&sin6
->sin6_addr
, sizeof(sin6
->sin6_addr
));
789 ipsec_bindump(buf
, len
)
795 for (i
= 0; i
< len
; i
++)
796 printf("%c", (unsigned char)buf
[i
]);
803 ipsec_hexdump(buf
, len
)
809 for (i
= 0; i
< len
; i
++) {
810 if (i
!= 0 && i
% 32 == 0) printf("\n");
811 if (i
% 4 == 0) printf(" ");
812 printf("%02x", ((const unsigned char *)buf
)[i
]);
815 if (i
% 32 != 0) printf("\n");