forked from osmocom/wireshark
Directly use wtap_opttypes calls to fetch SHB options.
Don't put them in the summary structure; the summary routines should calculate summary statistics, not dig up every bit of information that *could* appear in a summary. Instead, have the GUI code call wtap_file_get_shb() to get the SHB information and call wtap_optionblock_get_option_string() to fetch the option values. Move the option code definitions into wtap_opttypes.h, as they're used by the API. Change-Id: Icef11f5fb30fdc3df1bb0208aae9ed0aebaf0182 Reviewed-on: https://code.wireshark.org/review/15748 Reviewed-by: Guy Harris <guy@alum.mit.edu>daniel/osmux
parent
56e33a549f
commit
adee685089
|
@ -76,7 +76,6 @@
|
|||
#include <wsutil/privileges.h>
|
||||
#include <ws_version_info.h>
|
||||
#include <wiretap/wtap_opttypes.h>
|
||||
#include <wiretap/pcapng.h>
|
||||
|
||||
#ifdef HAVE_PLUGINS
|
||||
#include <wsutil/plugins.h>
|
||||
|
|
15
summary.c
15
summary.c
|
@ -107,7 +107,6 @@ summary_fill_in(capture_file *cf, summary_tally *st)
|
|||
{
|
||||
frame_data *first_frame, *cur_frame;
|
||||
guint32 framenum;
|
||||
wtap_optionblock_t shb_inf;
|
||||
iface_options iface;
|
||||
guint i;
|
||||
wtapng_iface_descriptions_t* idb_info;
|
||||
|
@ -161,20 +160,6 @@ summary_fill_in(capture_file *cf, summary_tally *st)
|
|||
st->drops = cf->drops;
|
||||
st->dfilter = cf->dfilter;
|
||||
|
||||
/* Get info from SHB */
|
||||
shb_inf = wtap_file_get_shb(cf->wth);
|
||||
if(shb_inf == NULL){
|
||||
st->opt_comment = NULL;
|
||||
st->shb_hardware = NULL;
|
||||
st->shb_os = NULL;
|
||||
st->shb_user_appl = NULL;
|
||||
}else{
|
||||
wtap_optionblock_get_option_string(shb_inf, OPT_COMMENT, &st->opt_comment);
|
||||
wtap_optionblock_get_option_string(shb_inf, OPT_SHB_HARDWARE, &st->shb_hardware);
|
||||
wtap_optionblock_get_option_string(shb_inf, OPT_SHB_OS, &st->shb_os);
|
||||
wtap_optionblock_get_option_string(shb_inf, OPT_SHB_USERAPPL, (char**)&st->shb_user_appl);
|
||||
}
|
||||
|
||||
st->ifaces = g_array_new(FALSE, FALSE, sizeof(iface_options));
|
||||
idb_info = wtap_file_get_idb_info(cf->wth);
|
||||
for (i = 0; i < idb_info->interface_data->len; i++) {
|
||||
|
|
|
@ -75,11 +75,6 @@ typedef struct _summary_tally {
|
|||
guint64 drops; /**< number of packet drops */
|
||||
const char *dfilter; /**< display filter */
|
||||
gboolean is_tempfile;
|
||||
/* from SHB, use summary_fill_shb_inf() to get values */
|
||||
gchar *opt_comment; /**< comment from SHB block */
|
||||
gchar *shb_hardware; /**< Capture HW from SHB block */
|
||||
gchar *shb_os; /**< The OS the capture was made on from SHB block */
|
||||
const gchar *shb_user_appl; /**< The application that made the capture from SHB block */
|
||||
/* capture related, use summary_fill_in_capture() to get values */
|
||||
GArray *ifaces;
|
||||
gboolean legacy;
|
||||
|
|
|
@ -168,7 +168,6 @@ summary_open_cb(GtkWidget *w _U_, gpointer d _U_)
|
|||
GtkWidget *list, *treeview;
|
||||
GtkWidget *comment_view = NULL, *comment_frame, *comment_vbox;
|
||||
GtkTextBuffer *buffer = NULL;
|
||||
gchar *buf_str;
|
||||
GtkListStore *store;
|
||||
GtkTreeIter iter;
|
||||
GtkCellRenderer *renderer;
|
||||
|
@ -189,6 +188,7 @@ summary_open_cb(GtkWidget *w _U_, gpointer d _U_)
|
|||
|
||||
unsigned int elapsed_time;
|
||||
iface_options iface;
|
||||
wtap_optionblock_t shb_inf;
|
||||
unsigned int i;
|
||||
|
||||
if (summary_dlg != NULL) {
|
||||
|
@ -274,6 +274,8 @@ summary_open_cb(GtkWidget *w _U_, gpointer d _U_)
|
|||
add_string_to_grid(grid, &row, "Packet size limit:", string_buff);
|
||||
}
|
||||
|
||||
shb_inf = wtap_file_get_shb(cfile.wth);
|
||||
|
||||
/* Capture file comment area */
|
||||
if (wtap_dump_can_write(cfile.linktypes, WTAP_COMMENT_PER_SECTION)) {
|
||||
comment_frame = gtk_frame_new("Capture file comments");
|
||||
|
@ -288,12 +290,13 @@ summary_open_cb(GtkWidget *w _U_, gpointer d _U_)
|
|||
comment_view = gtk_text_view_new();
|
||||
gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(comment_view), GTK_WRAP_WORD);
|
||||
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (comment_view));
|
||||
if(summary.opt_comment == NULL) {
|
||||
gtk_text_buffer_set_text (buffer, "", -1);
|
||||
} else {
|
||||
buf_str = g_strdup_printf("%s", summary.opt_comment);
|
||||
gtk_text_buffer_set_text (buffer, buf_str, -1);
|
||||
g_free(buf_str);
|
||||
gtk_text_buffer_set_text (buffer, "", -1);
|
||||
if (shb_inf != NULL) {
|
||||
char *str;
|
||||
|
||||
wtap_optionblock_get_option_string(shb_inf, OPT_COMMENT, &str);
|
||||
if (str != NULL && str[0] != '\0')
|
||||
gtk_text_buffer_set_text (buffer, str, -1);
|
||||
}
|
||||
gtk_box_pack_start(GTK_BOX(comment_vbox), comment_view, TRUE, TRUE, 0);
|
||||
gtk_widget_show (comment_view);
|
||||
|
@ -340,20 +343,28 @@ summary_open_cb(GtkWidget *w _U_, gpointer d _U_)
|
|||
/* Capture */
|
||||
add_string_to_grid(grid, &row, "", "");
|
||||
add_string_to_grid_sensitive(grid, &row, "Capture", "", (summary.ifaces->len > 0));
|
||||
if(summary.shb_hardware){
|
||||
/* truncate the string to a reasonable length */
|
||||
g_snprintf(string_buff, SHB_STR_SNIP_LEN, "%s",summary.shb_hardware);
|
||||
add_string_to_grid(grid, &row, "Capture HW:",string_buff);
|
||||
}
|
||||
if(summary.shb_os){
|
||||
/* truncate the strings to a reasonable length */
|
||||
g_snprintf(string_buff, SHB_STR_SNIP_LEN, "%s",summary.shb_os);
|
||||
add_string_to_grid(grid, &row, "OS:", string_buff);
|
||||
}
|
||||
if(summary.shb_user_appl){
|
||||
/* truncate the string to a reasonable length */
|
||||
g_snprintf(string_buff, SHB_STR_SNIP_LEN, "%s",summary.shb_user_appl);
|
||||
add_string_to_grid(grid, &row, "Capture application:", string_buff);
|
||||
if (shb_inf != NULL) {
|
||||
char *str;
|
||||
|
||||
wtap_optionblock_get_option_string(shb_inf, OPT_SHB_HARDWARE, &str);
|
||||
if (str != NULL && str[0] != '\0') {
|
||||
g_snprintf(string_buff, SHB_STR_SNIP_LEN, "%s", str);
|
||||
add_string_to_grid(grid, &row, "Capture HW:",string_buff);
|
||||
}
|
||||
|
||||
wtap_optionblock_get_option_string(shb_inf, OPT_SHB_OS, &str);
|
||||
if (str != NULL && str[0] != '\0') {
|
||||
/* truncate the strings to a reasonable length */
|
||||
g_snprintf(string_buff, SHB_STR_SNIP_LEN, "%s", str);
|
||||
add_string_to_grid(grid, &row, "OS:", string_buff);
|
||||
}
|
||||
|
||||
wtap_optionblock_get_option_string(shb_inf, OPT_SHB_USERAPPL, &str);
|
||||
if (str != NULL && str[0] != '\0') {
|
||||
/* truncate the strings to a reasonable length */
|
||||
g_snprintf(string_buff, SHB_STR_SNIP_LEN, "%s", str);
|
||||
add_string_to_grid(grid, &row, "Capture application:", string_buff);
|
||||
}
|
||||
}
|
||||
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (scrolled_window), 5);
|
||||
|
@ -649,11 +660,11 @@ summary_to_texbuff(GtkTextBuffer *buffer)
|
|||
summary_tally summary;
|
||||
gchar string_buff[SUM_STR_MAX];
|
||||
gchar tmp_buff[SUM_STR_MAX];
|
||||
gchar *buf_str;
|
||||
wtap_optionblock_t shb_inf;
|
||||
unsigned int i;
|
||||
unsigned int elapsed_time;
|
||||
iface_options iface;
|
||||
double seconds;
|
||||
double seconds;
|
||||
|
||||
/* initial computations */
|
||||
summary_fill_in(&cfile, &summary);
|
||||
|
@ -748,20 +759,28 @@ summary_to_texbuff(GtkTextBuffer *buffer)
|
|||
g_snprintf(string_buff, SUM_STR_MAX, "Capture:\n");
|
||||
gtk_text_buffer_insert_at_cursor (buffer, string_buff, -1);
|
||||
|
||||
if(summary.shb_hardware){
|
||||
/* truncate the string to a reasonable length */
|
||||
g_snprintf(string_buff, SUM_STR_MAX, INDENT "Capture HW: %s\n",summary.shb_hardware);
|
||||
gtk_text_buffer_insert_at_cursor (buffer, string_buff, -1);
|
||||
}
|
||||
if(summary.shb_os){
|
||||
/* truncate the strings to a reasonable length */
|
||||
g_snprintf(string_buff, SUM_STR_MAX, INDENT "OS: %s\n",summary.shb_os);
|
||||
gtk_text_buffer_insert_at_cursor (buffer, string_buff, -1);
|
||||
}
|
||||
if(summary.shb_user_appl){
|
||||
/* truncate the string to a reasonable length */
|
||||
g_snprintf(string_buff, SUM_STR_MAX, INDENT "Capture application: %s\n",summary.shb_user_appl);
|
||||
gtk_text_buffer_insert_at_cursor (buffer, string_buff, -1);
|
||||
shb_inf = wtap_file_get_shb(cfile.wth);
|
||||
if (shb_inf != NULL) {
|
||||
char *str;
|
||||
|
||||
wtap_optionblock_get_option_string(shb_inf, OPT_SHB_HARDWARE, &str);
|
||||
if (str != NULL && str[0] != '\0') {
|
||||
/* truncate the string to a reasonable length */
|
||||
g_snprintf(string_buff, SUM_STR_MAX, INDENT "Capture HW: %s\n", str);
|
||||
gtk_text_buffer_insert_at_cursor (buffer, string_buff, -1);
|
||||
}
|
||||
wtap_optionblock_get_option_string(shb_inf, OPT_SHB_OS, &str);
|
||||
if (str != NULL && str[0] != '\0') {
|
||||
/* truncate the strings to a reasonable length */
|
||||
g_snprintf(string_buff, SUM_STR_MAX, INDENT "OS: %s\n", str);
|
||||
gtk_text_buffer_insert_at_cursor (buffer, string_buff, -1);
|
||||
}
|
||||
wtap_optionblock_get_option_string(shb_inf, OPT_SHB_USERAPPL, &str);
|
||||
if (str != NULL && str[0] != '\0') {
|
||||
/* truncate the string to a reasonable length */
|
||||
g_snprintf(string_buff, SUM_STR_MAX, INDENT "Capture application: %s\n", str);
|
||||
gtk_text_buffer_insert_at_cursor (buffer, string_buff, -1);
|
||||
}
|
||||
}
|
||||
|
||||
/* Add empty line */
|
||||
|
@ -875,10 +894,13 @@ summary_to_texbuff(GtkTextBuffer *buffer)
|
|||
gtk_text_buffer_insert_at_cursor (buffer, string_buff, -1);
|
||||
|
||||
/* Trace file comments from SHB */
|
||||
if(summary.opt_comment != NULL) {
|
||||
buf_str = g_strdup_printf("%s", summary.opt_comment);
|
||||
gtk_text_buffer_insert_at_cursor(buffer, buf_str, -1);
|
||||
g_free(buf_str);
|
||||
shb_inf = wtap_file_get_shb(cfile.wth);
|
||||
if (shb_inf != NULL) {
|
||||
char *str;
|
||||
|
||||
wtap_optionblock_get_option_string(shb_inf, OPT_COMMENT, &str);
|
||||
if (str != NULL && str[0] != '\0')
|
||||
gtk_text_buffer_insert_at_cursor(buffer, str, -1);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -242,33 +242,41 @@ QString CaptureFilePropertiesDialog::summaryToHtml()
|
|||
out << section_tmpl_.arg(tr("Capture"));
|
||||
out << table_begin;
|
||||
|
||||
QString capture_hardware(unknown);
|
||||
if (summary.shb_hardware && summary.shb_hardware[0] != '\0') {
|
||||
capture_hardware = summary.shb_hardware;
|
||||
}
|
||||
// capture HW
|
||||
out << table_row_begin
|
||||
<< table_vheader_tmpl.arg(tr("Hardware"))
|
||||
<< table_data_tmpl.arg(capture_hardware)
|
||||
<< table_row_end;
|
||||
wtap_optionblock_t shb_inf = wtap_file_get_shb(cap_file_.capFile()->wth);
|
||||
char *str;
|
||||
|
||||
QString capture_os(unknown);
|
||||
if (summary.shb_os && summary.shb_os[0] != '\0') {
|
||||
capture_os = summary.shb_os;
|
||||
}
|
||||
out << table_row_begin
|
||||
<< table_vheader_tmpl.arg(tr("OS"))
|
||||
<< table_data_tmpl.arg(capture_os)
|
||||
<< table_row_end;
|
||||
if (shb_inf != NULL) {
|
||||
QString capture_hardware(unknown);
|
||||
wtap_optionblock_get_option_string(shb_inf, OPT_SHB_HARDWARE, &str);
|
||||
if (str != NULL && str[0] != '\0') {
|
||||
capture_hardware = str;
|
||||
}
|
||||
// capture HW
|
||||
out << table_row_begin
|
||||
<< table_vheader_tmpl.arg(tr("Hardware"))
|
||||
<< table_data_tmpl.arg(capture_hardware)
|
||||
<< table_row_end;
|
||||
|
||||
QString capture_app(unknown);
|
||||
if (summary.shb_user_appl && summary.shb_user_appl[0] != '\0') {
|
||||
capture_app = summary.shb_user_appl;
|
||||
QString capture_os(unknown);
|
||||
wtap_optionblock_get_option_string(shb_inf, OPT_SHB_OS, &str);
|
||||
if (str != NULL && str[0] != '\0') {
|
||||
capture_os = str;
|
||||
}
|
||||
out << table_row_begin
|
||||
<< table_vheader_tmpl.arg(tr("OS"))
|
||||
<< table_data_tmpl.arg(capture_os)
|
||||
<< table_row_end;
|
||||
|
||||
QString capture_app(unknown);
|
||||
wtap_optionblock_get_option_string(shb_inf, OPT_SHB_USERAPPL, &str);
|
||||
if (str != NULL && str[0] != '\0') {
|
||||
capture_app = str;
|
||||
}
|
||||
out << table_row_begin
|
||||
<< table_vheader_tmpl.arg(tr("Application"))
|
||||
<< table_data_tmpl.arg(capture_app)
|
||||
<< table_row_end;
|
||||
}
|
||||
out << table_row_begin
|
||||
<< table_vheader_tmpl.arg(tr("Application"))
|
||||
<< table_data_tmpl.arg(capture_app)
|
||||
<< table_row_end;
|
||||
|
||||
out << table_end;
|
||||
|
||||
|
|
|
@ -25,93 +25,6 @@
|
|||
#include "wtap.h"
|
||||
#include "ws_symbol_export.h"
|
||||
|
||||
/* Option codes: 16-bit field */
|
||||
#define OPT_EOFOPT 0x0000
|
||||
#define OPT_COMMENT 0x0001 /**< NULL if not available */
|
||||
|
||||
/* Section Header block (SHB) */
|
||||
#define OPT_SHB_HARDWARE 0x0002 /**< NULL if not available
|
||||
* UTF-8 string containing the description of the
|
||||
* hardware used to create this section.
|
||||
*/
|
||||
#define OPT_SHB_OS 0x0003 /**< NULL if not available, UTF-8 string containing the
|
||||
* name of the operating system used to create this section.
|
||||
*/
|
||||
#define OPT_SHB_USERAPPL 0x0004 /**< NULL if not available, UTF-8 string containing the
|
||||
* name of the application used to create this section.
|
||||
*/
|
||||
|
||||
/* Interface Description block (IDB) */
|
||||
#define OPT_IDB_NAME 0x0002 /**< NULL if not available, A UTF-8 string containing the name
|
||||
* of the device used to capture data.
|
||||
* "eth0" / "\Device\NPF_{AD1CE675-96D0-47C5-ADD0-2504B9126B68}"
|
||||
*/
|
||||
#define OPT_IDB_DESCR 0x0003 /**< NULL if not available, A UTF-8 string containing the description
|
||||
* of the device used to capture data.
|
||||
* "Broadcom NetXtreme" / "First Ethernet Interface"
|
||||
*/
|
||||
#define OPT_IDB_IP4ADDR 0x0004 /**< XXX: if_IPv4addr Interface network address and netmask.
|
||||
* This option can be repeated multiple times within the same Interface Description Block
|
||||
* when multiple IPv4 addresses are assigned to the interface.
|
||||
* 192 168 1 1 255 255 255 0
|
||||
*/
|
||||
#define OPT_IDB_IP6ADDR 0x0005 /* XXX: if_IPv6addr Interface network address and prefix length (stored in the last byte).
|
||||
* This option can be repeated multiple times within the same Interface
|
||||
* Description Block when multiple IPv6 addresses are assigned to the interface.
|
||||
* 2001:0db8:85a3:08d3:1319:8a2e:0370:7344/64 is written (in hex) as
|
||||
* "20 01 0d b8 85 a3 08 d3 13 19 8a 2e 03 70 73 44 40"*/
|
||||
#define OPT_IDB_MACADDR 0x0006 /* XXX: if_MACaddr Interface Hardware MAC address (48 bits). */
|
||||
#define OPT_IDB_EUIADDR 0x0007 /* XXX: if_EUIaddr Interface Hardware EUI address (64 bits) */
|
||||
#define OPT_IDB_SPEED 0x0008 /**< 0xFFFFFFFF if unknown
|
||||
* Interface speed (in bps). 100000000 for 100Mbps
|
||||
*/
|
||||
#define OPT_IDB_TSRESOL 0x0009 /**< Resolution of timestamps. If the Most Significant Bit is equal to zero,
|
||||
* the remaining bits indicates the resolution of the timestamp as as a
|
||||
* negative power of 10 (e.g. 6 means microsecond resolution, timestamps
|
||||
* are the number of microseconds since 1/1/1970). If the Most Significant Bit
|
||||
* is equal to one, the remaining bits indicates the resolution has a
|
||||
* negative power of 2 (e.g. 10 means 1/1024 of second).
|
||||
* If this option is not present, a resolution of 10^-6 is assumed
|
||||
* (i.e. timestamps have the same resolution of the standard 'libpcap' timestamps).
|
||||
*/
|
||||
#define OPT_IDB_TZONE 0x000A /* XXX: if_tzone Time zone for GMT support (TODO: specify better). */
|
||||
#define OPT_IDB_FILTER 0x000B /**< The filter (e.g. "capture only TCP traffic") used to capture traffic.
|
||||
* The first byte of the Option Data keeps a code of the filter used
|
||||
* (e.g. if this is a libpcap string, or BPF bytecode, and more).
|
||||
* More details about this format will be presented in Appendix XXX (TODO).
|
||||
* (TODO: better use different options for different fields?
|
||||
* e.g. if_filter_pcap, if_filter_bpf, ...) 00 "tcp port 23 and host 10.0.0.5"
|
||||
*/
|
||||
#define OPT_IDB_OS 0x000C /**< NULL if not available, A UTF-8 string containing the name of the operating system of the
|
||||
* machine in which this interface is installed.
|
||||
* This can be different from the same information that can be
|
||||
* contained by the Section Header Block
|
||||
* (Section 3.1 (Section Header Block (mandatory))) because
|
||||
* the capture can have been done on a remote machine.
|
||||
* "Windows XP SP2" / "openSUSE 10.2"
|
||||
*/
|
||||
#define OPT_IDB_FCSLEN 0x000D /**< An integer value that specified the length of the
|
||||
* Frame Check Sequence (in bits) for this interface.
|
||||
* For link layers whose FCS length can change during time,
|
||||
* the Packet Block Flags Word can be used (see Appendix A (Packet Block Flags Word))
|
||||
*/
|
||||
#define OPT_IDB_TSOFFSET 0x000E /**< XXX: A 64 bits integer value that specifies an offset (in seconds)
|
||||
* that must be added to the timestamp of each packet to obtain
|
||||
* the absolute timestamp of a packet. If the option is missing,
|
||||
* the timestamps stored in the packet must be considered absolute
|
||||
* timestamps. The time zone of the offset can be specified with the
|
||||
* option if_tzone. TODO: won't a if_tsoffset_low for fractional
|
||||
* second offsets be useful for highly syncronized capture systems?
|
||||
*/
|
||||
|
||||
#define OPT_ISB_STARTTIME 0x0002
|
||||
#define OPT_ISB_ENDTIME 0x0003
|
||||
#define OPT_ISB_IFRECV 0x0004
|
||||
#define OPT_ISB_IFDROP 0x0005
|
||||
#define OPT_ISB_FILTERACCEPT 0x0006
|
||||
#define OPT_ISB_OSDROP 0x0007
|
||||
#define OPT_ISB_USRDELIV 0x0008
|
||||
|
||||
/* pcapng: common block header file encoding for every block type */
|
||||
typedef struct pcapng_block_header_s {
|
||||
guint32 block_type;
|
||||
|
|
|
@ -24,6 +24,99 @@
|
|||
|
||||
#include "ws_symbol_export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* We use the pcapng option codes for option type values.
|
||||
*/
|
||||
#define OPT_EOFOPT 0x0000 /**< Appears in pcapng files, but not in option blocks. */
|
||||
#define OPT_COMMENT 0x0001 /**< NULL if not available */
|
||||
|
||||
/* Section Header block (SHB) */
|
||||
#define OPT_SHB_HARDWARE 0x0002 /**< NULL if not available
|
||||
* UTF-8 string containing the description of the
|
||||
* hardware used to create this section.
|
||||
*/
|
||||
#define OPT_SHB_OS 0x0003 /**< NULL if not available, UTF-8 string containing the
|
||||
* name of the operating system used to create this section.
|
||||
*/
|
||||
#define OPT_SHB_USERAPPL 0x0004 /**< NULL if not available, UTF-8 string containing the
|
||||
* name of the application used to create this section.
|
||||
*/
|
||||
|
||||
/* Interface Description block (IDB) */
|
||||
#define OPT_IDB_NAME 0x0002 /**< NULL if not available, A UTF-8 string containing the name
|
||||
* of the device used to capture data.
|
||||
* "eth0" / "\Device\NPF_{AD1CE675-96D0-47C5-ADD0-2504B9126B68}"
|
||||
*/
|
||||
#define OPT_IDB_DESCR 0x0003 /**< NULL if not available, A UTF-8 string containing the description
|
||||
* of the device used to capture data.
|
||||
* "Broadcom NetXtreme" / "First Ethernet Interface"
|
||||
*/
|
||||
#define OPT_IDB_IP4ADDR 0x0004 /**< XXX: if_IPv4addr Interface network address and netmask.
|
||||
* This option can be repeated multiple times within the same Interface Description Block
|
||||
* when multiple IPv4 addresses are assigned to the interface.
|
||||
* 192 168 1 1 255 255 255 0
|
||||
*/
|
||||
#define OPT_IDB_IP6ADDR 0x0005 /* XXX: if_IPv6addr Interface network address and prefix length (stored in the last byte).
|
||||
* This option can be repeated multiple times within the same Interface
|
||||
* Description Block when multiple IPv6 addresses are assigned to the interface.
|
||||
* 2001:0db8:85a3:08d3:1319:8a2e:0370:7344/64 is written (in hex) as
|
||||
* "20 01 0d b8 85 a3 08 d3 13 19 8a 2e 03 70 73 44 40"*/
|
||||
#define OPT_IDB_MACADDR 0x0006 /* XXX: if_MACaddr Interface Hardware MAC address (48 bits). */
|
||||
#define OPT_IDB_EUIADDR 0x0007 /* XXX: if_EUIaddr Interface Hardware EUI address (64 bits) */
|
||||
#define OPT_IDB_SPEED 0x0008 /**< 0xFFFFFFFF if unknown
|
||||
* Interface speed (in bps). 100000000 for 100Mbps
|
||||
*/
|
||||
#define OPT_IDB_TSRESOL 0x0009 /**< Resolution of timestamps. If the Most Significant Bit is equal to zero,
|
||||
* the remaining bits indicates the resolution of the timestamp as as a
|
||||
* negative power of 10 (e.g. 6 means microsecond resolution, timestamps
|
||||
* are the number of microseconds since 1/1/1970). If the Most Significant Bit
|
||||
* is equal to one, the remaining bits indicates the resolution has a
|
||||
* negative power of 2 (e.g. 10 means 1/1024 of second).
|
||||
* If this option is not present, a resolution of 10^-6 is assumed
|
||||
* (i.e. timestamps have the same resolution of the standard 'libpcap' timestamps).
|
||||
*/
|
||||
#define OPT_IDB_TZONE 0x000A /* XXX: if_tzone Time zone for GMT support (TODO: specify better). */
|
||||
#define OPT_IDB_FILTER 0x000B /**< The filter (e.g. "capture only TCP traffic") used to capture traffic.
|
||||
* The first byte of the Option Data keeps a code of the filter used
|
||||
* (e.g. if this is a libpcap string, or BPF bytecode, and more).
|
||||
* More details about this format will be presented in Appendix XXX (TODO).
|
||||
* (TODO: better use different options for different fields?
|
||||
* e.g. if_filter_pcap, if_filter_bpf, ...) 00 "tcp port 23 and host 10.0.0.5"
|
||||
*/
|
||||
#define OPT_IDB_OS 0x000C /**< NULL if not available, A UTF-8 string containing the name of the operating system of the
|
||||
* machine in which this interface is installed.
|
||||
* This can be different from the same information that can be
|
||||
* contained by the Section Header Block
|
||||
* (Section 3.1 (Section Header Block (mandatory))) because
|
||||
* the capture can have been done on a remote machine.
|
||||
* "Windows XP SP2" / "openSUSE 10.2"
|
||||
*/
|
||||
#define OPT_IDB_FCSLEN 0x000D /**< An integer value that specified the length of the
|
||||
* Frame Check Sequence (in bits) for this interface.
|
||||
* For link layers whose FCS length can change during time,
|
||||
* the Packet Block Flags Word can be used (see Appendix A (Packet Block Flags Word))
|
||||
*/
|
||||
#define OPT_IDB_TSOFFSET 0x000E /**< XXX: A 64 bits integer value that specifies an offset (in seconds)
|
||||
* that must be added to the timestamp of each packet to obtain
|
||||
* the absolute timestamp of a packet. If the option is missing,
|
||||
* the timestamps stored in the packet must be considered absolute
|
||||
* timestamps. The time zone of the offset can be specified with the
|
||||
* option if_tzone. TODO: won't a if_tsoffset_low for fractional
|
||||
* second offsets be useful for highly syncronized capture systems?
|
||||
*/
|
||||
|
||||
#define OPT_ISB_STARTTIME 0x0002
|
||||
#define OPT_ISB_ENDTIME 0x0003
|
||||
#define OPT_ISB_IFRECV 0x0004
|
||||
#define OPT_ISB_IFDROP 0x0005
|
||||
#define OPT_ISB_FILTERACCEPT 0x0006
|
||||
#define OPT_ISB_OSDROP 0x0007
|
||||
#define OPT_ISB_USRDELIV 0x0008
|
||||
|
||||
struct wtap_optionblock;
|
||||
typedef struct wtap_optionblock *wtap_optionblock_t;
|
||||
|
||||
|
@ -252,6 +345,9 @@ WS_DLL_PUBLIC void wtap_optionblock_foreach_option(wtap_optionblock_t block, wta
|
|||
WS_DLL_PUBLIC int wtap_opttype_register_custom_block_type(const char* name, const char* description, wtap_block_create_func create,
|
||||
wtap_mand_free_func free_mand, wtap_mand_copy_func copy_mand);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* WTAP_OPT_TYPES_H */
|
||||
|
||||
|
|
Loading…
Reference in New Issue