Next: , Previous: read_dpkt_defs, Up: Internal Functions   [Contents]


A.5.53 read_hdr_defs

Read and store header parameter definitions.

Synopsis

#include <bpipe/bpipe.h>

static int read_hdr_defs(
  BPipe *bpipe,
  char **buf,
  size_t *buf_len
);

Parameters

BPipe *bpipe

the binary pipe to read

char **buf

the input buffer to use

size_t *buf_len

the length of the input buffer

Description

This routine reads header parameter definitions from a binary pipe, parses them, and stores the results in the binary pipe structure.

Returns

It returns zero upon success, non-zero upon failure. It sets bpipe_errno upon failure.

Errors

Upon error bpipe_errno is set to one of the following errors:

BPEBADPIPE

the header data definitions had errors

BPENOMEM

a memory allocation failed