]>
git.proxmox.com Git - mirror_frr.git/blob - tests/lib/test_stream.c
1 // SPDX-License-Identifier: GPL-2.0-or-later
4 * Copyright (C) 2006 Sun Microsystems, Inc.
13 static unsigned long long ham
= 0xdeadbeefdeadbeef;
14 struct thread_master
*master
;
16 static void print_stream(struct stream
*s
)
18 size_t getp
= stream_get_getp(s
);
20 printfrr("endp: %zu, readable: %zu, writeable: %zu\n",
21 stream_get_endp(s
), STREAM_READABLE(s
), STREAM_WRITEABLE(s
));
23 while (STREAM_READABLE(s
)) {
24 printfrr("0x%x ", *stream_pnt(s
));
25 stream_forward_getp(s
, 1);
30 /* put getp back to where it was */
31 stream_set_getp(s
, getp
);
47 stream_resize_inplace(&s
, stream_get_endp(s
));
51 printfrr("c: 0x%hhx\n", stream_getc(s
));
52 printfrr("w: 0x%hx\n", stream_getw(s
));
53 printfrr("l: 0x%x\n", stream_getl(s
));
54 printfrr("q: 0x%" PRIx64
"\n", stream_getq(s
));