lsquic_util.h revision 50aadb33
1/* Copyright (c) 2017 LiteSpeed Technologies Inc.  See LICENSE. */
2/*
3 * lsquic_util.h -- Utility functions
4 */
5
6#ifndef LSQUIC_UTIL_H
7#define LSQUIC_UTIL_H 1
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13lsquic_time_t
14lsquic_time_now (void);
15
16/* Returns 1 if `buf' contains only zero bytes, 0 otherwise.
17 */
18int
19lsquic_is_zero (const void *buf, size_t bufsz);
20
21
22
23char * get_bin_str(const void *s, size_t len, size_t max_display_len);
24
25
26/* `out_sz' is assumed to be at least 1.  `out' is always NUL-terminated. */
27size_t
28hexdump (const void *src, size_t src_sz, char *out, size_t out_sz);
29
30#ifdef __cplusplus
31}
32#endif
33
34
35#endif
36