unbound: testcode/readhex.c File Reference

unbound 0.1

Functions
readhex.c File Reference

Declarations useful for the unit tests. More...

`#include "config.h"`
`#include <ctype.h>`
`#include "testcode/readhex.h"`
`#include "util/log.h"`
`#include "sldns/sbuffer.h"`
`#include "sldns/parseutil.h"`

## Functions
static void | skip_whites (const char **p)
| skip whitespace
void | hex_to_buf (sldns_buffer *pkt, const char *hex)
| Helper to convert hex string to packet buffer.

## Detailed Description

Declarations useful for the unit tests.

## Function Documentation

## ◆ hex_to_buf()

void hex_to_buf | ( | struct sldns_buffer * | pkt,
|  | const char * | hex )

Helper to convert hex string to packet buffer.

Parameters

  pkt | buffer to put result in.
  hex | string of hex data. Spaces and ';...' comments are skipped.

References log_assert, skip_whites(), sldns_buffer_clear(), sldns_buffer_flip(), sldns_buffer_limit(), sldns_buffer_position(), sldns_buffer_write_u8(), and sldns_hexdigit_to_int().

Referenced by perftestpkt(), read_input(), and testpkt().