return wth->file_type;
}
-int
+guint
wtap_snapshot_length(wtap *wth)
{
return wth->snapshot_length;
return wth->tsprecision;
}
+wtapng_section_t* wtap_file_get_shb_info(wtap *wth)
+{
+ wtapng_section_t *shb_hdr;
+
+ shb_hdr = g_new(wtapng_section_t,1);
+ shb_hdr->section_length = wth->shb_hdr.section_length;
+ /* options */
+ shb_hdr->opt_comment = wth->shb_hdr.opt_comment; /* NULL if not available */
+ shb_hdr->shb_hardware = wth->shb_hdr.shb_hardware; /* NULL if not available, UTF-8 string containing the description of the hardware used to create this section. */
+ shb_hdr->shb_os = wth->shb_hdr.shb_os; /* NULL if not available, UTF-8 string containing the name of the operating system used to create this section. */
+ shb_hdr->shb_user_appl = wth->shb_hdr.shb_user_appl; /* NULL if not available, UTF-8 string containing the name of the application used to create this section. */
+
+
+ return shb_hdr;
+}
+
+void wtap_write_shb_comment(wtap *wth, gchar *comment)
+{
+ g_free(wth->shb_hdr.opt_comment);
+ wth->shb_hdr.opt_comment = comment;
+
+}
+
+wtapng_iface_descriptions_t* wtap_file_get_idb_info(wtap *wth)
+{
+ wtapng_iface_descriptions_t *idb_info;
+
+ idb_info = g_new(wtapng_iface_descriptions_t,1);
+
+ idb_info->number_of_interfaces = wth->number_of_interfaces;
+ idb_info->interface_data = wth->interface_data;
+
+ return idb_info;
+}
+
/* Table of the encapsulation types we know about. */
struct encap_type_info {
const char *name;
/* WTAP_ENCAP_DVBCI */
{ "DVB-CI (Common Interface)", "dvbci"},
-
- /* WTAP_ENCAP_MUX27010 */
- { "MUX27010", "mux27010"}
+
+ /* WTAP_ENCAP_MUX27010 */
+ { "MUX27010", "mux27010"},
+
+ /* WTAP_ENCAP_MIME */
+ { "MIME", "mime" },
+
+ /* WTAP_ENCAP_NETANALYZER */
+ { "netANALYZER", "netanalyzer" },
+
+ /* WTAP_ENCAP_NETANALYZER_TRANSPARENT */
+ { "netANALYZER-Transparent", "netanalyzer-transparent" },
+
+ /* WTAP_ENCAP_IP_OVER_IB */
+ { "IP over Infiniband", "ip-over-ib" },
+
+ /* WTAP_ENCAP_MPEG_2_TS */
+ { "ISO/IEC 13818-1 MPEG2-TS", "mp2ts" }
};
gint wtap_num_encap_types = sizeof(encap_table_base) / sizeof(struct encap_type_info);
NULL,
NULL,
"Less data was read than was expected",
- "File contains a record that's not valid",
+ "The file appears to be damaged or corrupt.",
"Less data was written than was requested",
"Uncompression error: data oddly truncated",
"Uncompression error: data would overflow buffer",
return "Unknown reason";
return wtap_errlist[wtap_errlist_index];
} else
- return strerror(err);
+ return g_strerror(err);
}
/* Close only the sequential side, freeing up memory it uses.
}
void
-wtap_cleareof(wtap *wth _U_) {
+wtap_cleareof(wtap *wth) {
/* Reset EOF */
- if (file_eof(wth->fh))
- file_clearerr(wth->fh);
+ file_clearerr(wth->fh);
}
void wtap_set_cb_new_ipv4(wtap *wth, wtap_new_ipv4_callback_t add_new_ipv4) {