forked from wireshark/wireshark
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move the parts of a capture_file used by libwireshark to a new struct…
…ure. Embed one of those structures in a capture_file, and have a struct epan_session point to that structure rather than to a capture_file. Pass that structure to the routines that fetch data that libwireshark uses when dissecting. That separates the stuff that libwireshark expects from the stuff that it doesn't look at. Change-Id: Ia3cd28efb9622476437a2ce32204597fae720877 Reviewed-on: https://code.wireshark.org/review/24692 Reviewed-by: Guy Harris <guy@alum.mit.edu>
- Loading branch information
Showing
29 changed files
with
450 additions
and
417 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* frame_set.c | ||
* fdfdkfslf;ajkdf | ||
* | ||
* Wireshark - Network traffic analyzer | ||
* By Gerald Combs <gerald@wireshark.org> | ||
* Copyright 1998 Gerald Combs | ||
* | ||
* SPDX-License-Identifier: GPL-2.0+ | ||
*/ | ||
|
||
#include <glib.h> | ||
|
||
#include <epan/frame_set.h> | ||
|
||
const char * | ||
frame_set_get_interface_name(frame_set *fs, guint32 interface_id) | ||
{ | ||
wtapng_iface_descriptions_t *idb_info; | ||
wtap_block_t wtapng_if_descr = NULL; | ||
char* interface_name; | ||
|
||
idb_info = wtap_file_get_idb_info(fs->wth); | ||
|
||
if (interface_id < idb_info->interface_data->len) | ||
wtapng_if_descr = g_array_index(idb_info->interface_data, wtap_block_t, interface_id); | ||
|
||
g_free(idb_info); | ||
|
||
if (wtapng_if_descr) { | ||
if (wtap_block_get_string_option_value(wtapng_if_descr, OPT_IDB_NAME, &interface_name) == WTAP_OPTTYPE_SUCCESS) | ||
return interface_name; | ||
if (wtap_block_get_string_option_value(wtapng_if_descr, OPT_IDB_DESCR, &interface_name) == WTAP_OPTTYPE_SUCCESS) | ||
return interface_name; | ||
} | ||
return "unknown"; | ||
} | ||
|
||
const char * | ||
frame_set_get_interface_description(frame_set *fs, guint32 interface_id) | ||
{ | ||
wtapng_iface_descriptions_t *idb_info; | ||
wtap_block_t wtapng_if_descr = NULL; | ||
char* interface_name; | ||
|
||
idb_info = wtap_file_get_idb_info(fs->wth); | ||
|
||
if (interface_id < idb_info->interface_data->len) | ||
wtapng_if_descr = g_array_index(idb_info->interface_data, wtap_block_t, interface_id); | ||
|
||
g_free(idb_info); | ||
|
||
if (wtapng_if_descr) { | ||
if (wtap_block_get_string_option_value(wtapng_if_descr, OPT_IDB_DESCR, &interface_name) == WTAP_OPTTYPE_SUCCESS) | ||
return interface_name; | ||
} | ||
return NULL; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* frame_set.h | ||
* Definition of frame_set structure. It holds information about a | ||
* fdfdkfslf;ajkdf | ||
* | ||
* Wireshark - Network traffic analyzer | ||
* By Gerald Combs <gerald@wireshark.org> | ||
* Copyright 1998 Gerald Combs | ||
* | ||
* SPDX-License-Identifier: GPL-2.0+ | ||
*/ | ||
|
||
#ifndef __EPAN_FRAME_SET_H__ | ||
#define __EPAN_FRAME_SET_H__ | ||
|
||
#include <epan/frame_data.h> | ||
#include <epan/frame_data_sequence.h> | ||
|
||
#include "ws_symbol_export.h" | ||
|
||
typedef struct { | ||
wtap *wth; /* Wiretap session */ | ||
const frame_data *ref; | ||
frame_data *prev_dis; | ||
frame_data *prev_cap; | ||
frame_data_sequence *frames; /* Sequence of frames, if we're keeping that information */ | ||
GTree *frames_user_comments; /* BST with user comments for frames (key = frame_data) */ | ||
} frame_set; | ||
|
||
WS_DLL_PUBLIC const char *frame_set_get_interface_name(frame_set *fs, guint32 interface_id); | ||
WS_DLL_PUBLIC const char *frame_set_get_interface_description(frame_set *fs, guint32 interface_id); | ||
|
||
#endif /* frame_set.h */ |
Oops, something went wrong.