2021-11-30 02:59:23 +00:00
|
|
|
/** @file
|
2008-01-13 21:10:09 +00:00
|
|
|
*
|
|
|
|
* Wiretap Library
|
|
|
|
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
|
|
|
|
*
|
2018-02-07 11:26:45 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
2008-01-13 21:10:09 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __W_PCAPNG_H__
|
|
|
|
#define __W_PCAPNG_H__
|
|
|
|
|
2011-06-04 21:20:57 +00:00
|
|
|
#include <glib.h>
|
2016-01-26 01:17:21 +00:00
|
|
|
#include "wtap.h"
|
2013-02-28 19:35:59 +00:00
|
|
|
#include "ws_symbol_export.h"
|
2011-06-04 21:20:57 +00:00
|
|
|
|
2017-11-22 19:05:48 +00:00
|
|
|
#define PCAPNG_MAGIC 0x1A2B3C4D
|
2019-05-20 13:31:59 +00:00
|
|
|
#define PCAPNG_SWAPPED_MAGIC 0x4D3C2B1A
|
2017-11-22 19:05:48 +00:00
|
|
|
|
|
|
|
#define PCAPNG_MAJOR_VERSION 1
|
|
|
|
#define PCAPNG_MINOR_VERSION 0
|
|
|
|
|
2016-03-04 13:52:48 +00:00
|
|
|
/* pcapng: common block header file encoding for every block type */
|
|
|
|
typedef struct pcapng_block_header_s {
|
|
|
|
guint32 block_type;
|
|
|
|
guint32 block_total_length;
|
|
|
|
/* x bytes block_body */
|
|
|
|
/* guint32 block_total_length */
|
|
|
|
} pcapng_block_header_t;
|
|
|
|
|
|
|
|
/* pcapng: section header block file encoding */
|
|
|
|
typedef struct pcapng_section_header_block_s {
|
|
|
|
/* pcapng_block_header_t */
|
|
|
|
guint32 magic;
|
|
|
|
guint16 version_major;
|
|
|
|
guint16 version_minor;
|
|
|
|
guint64 section_length; /* might be -1 for unknown */
|
|
|
|
/* ... Options ... */
|
|
|
|
} pcapng_section_header_block_t;
|
|
|
|
|
|
|
|
/* pcapng: interface description block file encoding */
|
|
|
|
typedef struct pcapng_interface_description_block_s {
|
|
|
|
guint16 linktype;
|
|
|
|
guint16 reserved;
|
|
|
|
guint32 snaplen;
|
|
|
|
/* ... Options ... */
|
|
|
|
} pcapng_interface_description_block_t;
|
|
|
|
|
|
|
|
/* pcapng: interface statistics block file encoding */
|
|
|
|
typedef struct pcapng_interface_statistics_block_s {
|
|
|
|
guint32 interface_id;
|
|
|
|
guint32 timestamp_high;
|
|
|
|
guint32 timestamp_low;
|
|
|
|
/* ... Options ... */
|
|
|
|
} pcapng_interface_statistics_block_t;
|
|
|
|
|
2018-11-17 12:56:12 +00:00
|
|
|
/* pcapng: Decryption Secrets Block file encoding */
|
|
|
|
typedef struct pcapng_decryption_secrets_block_s {
|
|
|
|
guint32 secrets_type; /* Secrets Type, see secrets-types.h */
|
|
|
|
guint32 secrets_len; /* Size of variable-length secrets data. */
|
|
|
|
/* x bytes Secrets Data. */
|
|
|
|
/* ... Options ... */
|
|
|
|
} pcapng_decryption_secrets_block_t;
|
|
|
|
|
2016-03-04 13:52:48 +00:00
|
|
|
struct pcapng_option_header {
|
|
|
|
guint16 type;
|
|
|
|
guint16 value_length;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Minimum IDB size = minimum block size + size of fixed length portion of IDB.
|
|
|
|
*/
|
|
|
|
#define MIN_IDB_SIZE ((guint32)(MIN_BLOCK_SIZE + sizeof(pcapng_interface_description_block_t)))
|
2018-11-17 12:56:12 +00:00
|
|
|
#define MIN_DSB_SIZE ((guint32)(MIN_BLOCK_SIZE + sizeof(pcapng_decryption_secrets_block_t)))
|
2016-03-04 13:52:48 +00:00
|
|
|
|
2014-10-10 01:04:16 +00:00
|
|
|
wtap_open_return_val pcapng_open(wtap *wth, int *err, gchar **err_info);
|
2008-01-13 21:10:09 +00:00
|
|
|
|
|
|
|
#endif
|