47 lines
1.7 KiB
C
47 lines
1.7 KiB
C
#ifndef _HEXAGRAM_PCAPNG_H
|
|
#define _HEXAGRAM_PCAPNG_H
|
|
|
|
#include <stdint.h>
|
|
#include <sys/types.h>
|
|
|
|
#include <hexagram/pcapng/error.h>
|
|
#include <hexagram/pcapng/block.h>
|
|
#include <hexagram/pcapng/option.h>
|
|
#include <hexagram/pcapng/section.h>
|
|
#include <hexagram/pcapng/if.h>
|
|
#include <hexagram/pcapng/if_stats.h>
|
|
#include <hexagram/pcapng/packet.h>
|
|
|
|
typedef struct _hexagram_pcapng_stream {
|
|
int fd,
|
|
error;
|
|
|
|
uint8_t if_tsresol;
|
|
} hexagram_pcapng_stream;
|
|
|
|
typedef ssize_t (hexagram_pcapng_block_handler)(hexagram_pcapng_stream *,
|
|
uint32_t type,
|
|
size_t length,
|
|
void *data);
|
|
|
|
typedef ssize_t (hexagram_pcapng_option_handler)(hexagram_pcapng_stream *,
|
|
uint32_t type,
|
|
uint16_t code,
|
|
uint16_t length,
|
|
void *data);
|
|
|
|
hexagram_pcapng_stream *hexagram_pcapng_stream_open_fd(int fd);
|
|
|
|
void hexagram_pcapng_stream_destroy(hexagram_pcapng_stream *stream);
|
|
|
|
ssize_t hexagram_pcapng_read_options(hexagram_pcapng_stream *stream,
|
|
hexagram_pcapng_option_handler *handler,
|
|
uint32_t type,
|
|
size_t len,
|
|
void *data);
|
|
|
|
ssize_t hexagram_pcapng_stream_read(hexagram_pcapng_stream *stream,
|
|
hexagram_pcapng_block_handler *handler,
|
|
void *data);
|
|
|
|
#endif /* _HEXAGRAM_PCAPNG_H */
|