summaryrefslogtreecommitdiff
path: root/capture_ui_utils.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-03-22 16:58:42 -0700
committerGuy Harris <guy@alum.mit.edu>2015-03-23 00:06:57 +0000
commit7b6e7b16d79a87f8e62803da622a1ff348c913c6 (patch)
treebe71fadfb9de56e6800264d5955cba9c8fdd70a7 /capture_ui_utils.h
parent98ded73ba1f34613344c632a0d7c903b254f5a82 (diff)
downloadwireshark-7b6e7b16d79a87f8e62803da622a1ff348c913c6.tar.gz
Centralize the code to set the active_dlt value for a device.
We were doing it similarly, but not the same, in several places; make a common routine for it. Have that code check to make sure the DLT_ value in question is actually supported by the device; if not, pick the first supported DLT_ value, if any; this keeps it from, for example, picking a bad DLT_ value if your defaults were set based on monitor mode being on but monitor mode actually being off, or vice versa. Change-Id: I1c58a97eda67555259d0dfdeaa02a850c0c96b5a Reviewed-on: https://code.wireshark.org/review/7796 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'capture_ui_utils.h')
-rw-r--r--capture_ui_utils.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/capture_ui_utils.h b/capture_ui_utils.h
index a09db8d7ea..320024a0c9 100644
--- a/capture_ui_utils.h
+++ b/capture_ui_utils.h
@@ -122,6 +122,13 @@ char *build_capture_combo_name(GList *if_list, gchar *if_name);
*/
const char *get_iface_description_for_interface(capture_options *capture_opts, guint i);
+/** Set the active DLT for a device appropriately.
+ *
+ * @param device the device on which to set the active DLT
+ * @param global_default_dlt the global default DLT
+ */
+extern void set_active_dlt(interface_t *device, int global_default_dlt);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */