Associate .scap files with Stratoshark
3b4c215a5f associated .scap files with Wireshark. Make sure they're just associated with Stratoshark. Split our wiretap file extension lists into separate versions based on application flavor. Fixes #20583
This commit is contained in:
parent
93525b979a
commit
35cddec4de
@ -17,6 +17,10 @@
|
|||||||
<array>
|
<array>
|
||||||
<string>scap</string>
|
<string>scap</string>
|
||||||
<string>scap.gz</string>
|
<string>scap.gz</string>
|
||||||
|
<!-- libscap only handles gzip compression, so omit these for now.
|
||||||
|
<string>scap.lz4</string>
|
||||||
|
<string>scap.zst</string>
|
||||||
|
-->
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleTypeIconFile</key>
|
<key>CFBundleTypeIconFile</key>
|
||||||
<string>Wiresharkdoc.icns</string>
|
<string>Wiresharkdoc.icns</string>
|
||||||
|
@ -124,16 +124,12 @@
|
|||||||
<key>CFBundleTypeExtensions</key>
|
<key>CFBundleTypeExtensions</key>
|
||||||
<array>
|
<array>
|
||||||
<string>pcapng</string>
|
<string>pcapng</string>
|
||||||
<string>scap</string>
|
|
||||||
<string>ntar</string>
|
<string>ntar</string>
|
||||||
<string>pcapng.gz</string>
|
<string>pcapng.gz</string>
|
||||||
<string>scap.gz</string>
|
|
||||||
<string>ntar.gz</string>
|
<string>ntar.gz</string>
|
||||||
<string>pcapng.lz4</string>
|
<string>pcapng.lz4</string>
|
||||||
<string>scap.lz4</string>
|
|
||||||
<string>ntar.lz4</string>
|
<string>ntar.lz4</string>
|
||||||
<string>pcapng.zst</string>
|
<string>pcapng.zst</string>
|
||||||
<string>scap.zst</string>
|
|
||||||
<string>ntar.zst</string>
|
<string>ntar.zst</string>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleTypeIconFile</key>
|
<key>CFBundleTypeIconFile</key>
|
||||||
|
@ -7,7 +7,7 @@ Do not edit manually!
|
|||||||
<Dialog Name="AdditionalTasksPage" Title="Additional Tasks" Subtitle="Create shortcuts and associate file extensions.">
|
<Dialog Name="AdditionalTasksPage" Title="Additional Tasks" Subtitle="Create shortcuts and associate file extensions.">
|
||||||
<CreateFunctionCustomScript>; Defined in stratoshark.nsi
|
<CreateFunctionCustomScript>; Defined in stratoshark.nsi
|
||||||
Call InitAdditionalTasksPage</CreateFunctionCustomScript>
|
Call InitAdditionalTasksPage</CreateFunctionCustomScript>
|
||||||
<Label Name="ExtensionsLabel" Location="22, 151" Size="372, 52" Text="Extensions include 5vw, acp, apc, atc, bfr, cap, enc, erf, fdc, ipfix, lcap, mplog, ntar, out, pcap, pcapng, pklg, pkt, rf5, scap, snoop, syc, tpc, tr1, trace, trc, vwr, wpc, and wpz." TabIndex="0" />
|
<Label Name="ExtensionsLabel" Location="22, 151" Size="372, 52" Text="The scap extension will be associated with Stratoshark." TabIndex="0" />
|
||||||
<CheckBox Name="AssociateExtensionsCheckBox" Location="22, 126" Size="406, 14" Text="Associate trace file extensions with Stratoshark" TabIndex="1" />
|
<CheckBox Name="AssociateExtensionsCheckBox" Location="22, 126" Size="406, 14" Text="Associate trace file extensions with Stratoshark" TabIndex="1" />
|
||||||
<CheckBox Name="QuickLaunchCheckBox" Location="22, 74" Size="406, 14" Text="Stratoshark Quick Launch Icon" TabIndex="2" />
|
<CheckBox Name="QuickLaunchCheckBox" Location="22, 74" Size="406, 14" Text="Stratoshark Quick Launch Icon" TabIndex="2" />
|
||||||
<CheckBox Name="DesktopIconCheckBox" Location="22, 54" Size="406, 14" Text="Stratoshark Desktop Icon" TabIndex="3" />
|
<CheckBox Name="DesktopIconCheckBox" Location="22, 54" Size="406, 14" Text="Stratoshark Desktop Icon" TabIndex="3" />
|
||||||
|
@ -7,7 +7,7 @@ Do not edit manually!
|
|||||||
<Dialog Name="AdditionalTasksPage" Title="Additional Tasks" Subtitle="Create shortcuts and associate file extensions.">
|
<Dialog Name="AdditionalTasksPage" Title="Additional Tasks" Subtitle="Create shortcuts and associate file extensions.">
|
||||||
<CreateFunctionCustomScript>; Defined in wireshark.nsi
|
<CreateFunctionCustomScript>; Defined in wireshark.nsi
|
||||||
Call InitAdditionalTasksPage</CreateFunctionCustomScript>
|
Call InitAdditionalTasksPage</CreateFunctionCustomScript>
|
||||||
<Label Name="ExtensionsLabel" Location="22, 151" Size="372, 52" Text="Extensions include 5vw, acp, apc, atc, bfr, cap, enc, erf, fdc, ipfix, lcap, mplog, ntar, out, pcap, pcapng, pklg, pkt, rf5, rtp, scap, snoop, syc, tpc, tr1, trace, trc, vwr, wpc, and wpz." TabIndex="0" />
|
<Label Name="ExtensionsLabel" Location="22, 151" Size="372, 52" Text="Extensions include 5vw, acp, apc, atc, bfr, cap, enc, erf, fdc, ipfix, lcap, mplog, ntar, out, pcap, pcapng, pklg, pkt, rf5, rtp, snoop, syc, tpc, tr1, trace, trc, vwr, wpc, and wpz." TabIndex="0" />
|
||||||
<CheckBox Name="AssociateExtensionsCheckBox" Location="22, 126" Size="406, 14" Text="Associate trace file extensions with Wireshark" TabIndex="1" />
|
<CheckBox Name="AssociateExtensionsCheckBox" Location="22, 126" Size="406, 14" Text="Associate trace file extensions with Wireshark" TabIndex="1" />
|
||||||
<CheckBox Name="QuickLaunchCheckBox" Location="22, 74" Size="406, 14" Text="Wireshark Quick Launch Icon" TabIndex="2" />
|
<CheckBox Name="QuickLaunchCheckBox" Location="22, 74" Size="406, 14" Text="Wireshark Quick Launch Icon" TabIndex="2" />
|
||||||
<CheckBox Name="DesktopIconCheckBox" Location="22, 54" Size="406, 14" Text="Wireshark Desktop Icon" TabIndex="3" />
|
<CheckBox Name="DesktopIconCheckBox" Location="22, 54" Size="406, 14" Text="Wireshark Desktop Icon" TabIndex="3" />
|
||||||
|
@ -104,7 +104,6 @@ Exec '"$SYSDIR\ie4uinit.exe" -ClearIconCache'
|
|||||||
Push ".tpc"
|
Push ".tpc"
|
||||||
Push ".syc"
|
Push ".syc"
|
||||||
Push ".snoop"
|
Push ".snoop"
|
||||||
Push ".scap"
|
|
||||||
Push ".rf5"
|
Push ".rf5"
|
||||||
Push ".pkt"
|
Push ".pkt"
|
||||||
Push ".pklg"
|
Push ".pklg"
|
||||||
|
@ -803,15 +803,6 @@
|
|||||||
<RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="rf5" Type="integer" Value="1" KeyPath="yes"/>
|
<RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="rf5" Type="integer" Value="1" KeyPath="yes"/>
|
||||||
<Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition>
|
<Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition>
|
||||||
</Component>
|
</Component>
|
||||||
<Component Id="cmpFAscap">
|
|
||||||
<ProgId Id="$(var.WiresharkFileAssociation)" Description="scap">
|
|
||||||
<Extension Id="scap">
|
|
||||||
<Verb Id="open" Command="open" TargetFile="filWireshark_exe" Argument=""%1""/>
|
|
||||||
</Extension>
|
|
||||||
</ProgId>
|
|
||||||
<RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="scap" Type="integer" Value="1" KeyPath="yes"/>
|
|
||||||
<Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition>
|
|
||||||
</Component>
|
|
||||||
<Component Id="cmpFAsnoop">
|
<Component Id="cmpFAsnoop">
|
||||||
<ProgId Id="$(var.WiresharkFileAssociation)" Description="snoop">
|
<ProgId Id="$(var.WiresharkFileAssociation)" Description="snoop">
|
||||||
<Extension Id="snoop">
|
<Extension Id="snoop">
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
<Condition Action="disable"><![CDATA[&Fe.Wireshark <> 3]]></Condition>
|
<Condition Action="disable"><![CDATA[&Fe.Wireshark <> 3]]></Condition>
|
||||||
</Control>
|
</Control>
|
||||||
<Control Id="FileExtensionsText1" Type="Text" X="20" Y="206" Width="350" Height="11" Transparent="yes" NoPrefix="yes" Text="Extensions include 5vw, acp, apc, atc, bfr, cap, enc, erf, fdc, lcap, mplog, ntar, out,"/>
|
<Control Id="FileExtensionsText1" Type="Text" X="20" Y="206" Width="350" Height="11" Transparent="yes" NoPrefix="yes" Text="Extensions include 5vw, acp, apc, atc, bfr, cap, enc, erf, fdc, lcap, mplog, ntar, out,"/>
|
||||||
<Control Id="FileExtensionsText2" Type="Text" X="20" Y="217" Width="350" Height="11" Transparent="yes" NoPrefix="yes" Text="pcap, pcapng, pkt, rf5, scap, snoop, syc, tpc, tr1, trace, trc, vwr, wpc, and wpz."/>
|
<Control Id="FileExtensionsText2" Type="Text" X="20" Y="217" Width="350" Height="11" Transparent="yes" NoPrefix="yes" Text="pcap, pcapng, pkt, rf5, snoop, syc, tpc, tr1, trace, trc, vwr, wpc, and wpz."/>
|
||||||
|
|
||||||
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0"/>
|
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0"/>
|
||||||
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)"/>
|
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)"/>
|
||||||
|
@ -41,5 +41,9 @@
|
|||||||
</magic>
|
</magic>
|
||||||
<glob pattern="*.scap"/>
|
<glob pattern="*.scap"/>
|
||||||
<glob pattern="*.scap.gz"/>
|
<glob pattern="*.scap.gz"/>
|
||||||
|
<!-- libscap only handles gzip compression, so omit these for now.
|
||||||
|
<glob pattern="*.scap.zst"/>
|
||||||
|
<glob pattern="*.scap.lz4"/>
|
||||||
|
-->
|
||||||
</mime-type>
|
</mime-type>
|
||||||
</mime-info>
|
</mime-info>
|
||||||
|
@ -59,16 +59,12 @@
|
|||||||
</match>
|
</match>
|
||||||
</magic>
|
</magic>
|
||||||
<glob pattern="*.pcapng"/>
|
<glob pattern="*.pcapng"/>
|
||||||
<glob pattern="*.scap"/>
|
|
||||||
<glob pattern="*.ntar"/>
|
<glob pattern="*.ntar"/>
|
||||||
<glob pattern="*.pcapng.gz"/>
|
<glob pattern="*.pcapng.gz"/>
|
||||||
<glob pattern="*.scap.gz"/>
|
|
||||||
<glob pattern="*.ntar.gz"/>
|
<glob pattern="*.ntar.gz"/>
|
||||||
<glob pattern="*.pcapng.zst"/>
|
<glob pattern="*.pcapng.zst"/>
|
||||||
<glob pattern="*.scap.zst"/>
|
|
||||||
<glob pattern="*.ntar.zst"/>
|
<glob pattern="*.ntar.zst"/>
|
||||||
<glob pattern="*.pcapng.lz4"/>
|
<glob pattern="*.pcapng.lz4"/>
|
||||||
<glob pattern="*.scap.lz4"/>
|
|
||||||
<glob pattern="*.ntar.lz4"/>
|
<glob pattern="*.ntar.lz4"/>
|
||||||
</mime-type>
|
</mime-type>
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include "wtap_modules.h"
|
#include "wtap_modules.h"
|
||||||
#include "file_wrappers.h"
|
#include "file_wrappers.h"
|
||||||
#include "required_file_handlers.h"
|
#include "required_file_handlers.h"
|
||||||
|
#include <wsutil/application_flavor.h>
|
||||||
#include <wsutil/buffer.h>
|
#include <wsutil/buffer.h>
|
||||||
#include <wsutil/str_util.h>
|
#include <wsutil/str_util.h>
|
||||||
|
|
||||||
@ -142,9 +143,9 @@ add_extensions(GSList *extensions, const char *extension,
|
|||||||
* All added file types, regardless of extension or lack thereof,
|
* All added file types, regardless of extension or lack thereof,
|
||||||
* must also be added open_info_base[] below.
|
* must also be added open_info_base[] below.
|
||||||
*/
|
*/
|
||||||
static const struct file_extension_info file_type_extensions_base[] = {
|
static const struct file_extension_info wireshark_file_type_extensions_base[] = {
|
||||||
{ "Wireshark/tcpdump/... - pcap", true, "pcap;cap;dmp" },
|
{ "Wireshark/tcpdump/... - pcap", true, "pcap;cap;dmp" },
|
||||||
{ "Wireshark/... - pcapng", true, "pcapng;scap;ntar" },
|
{ "Wireshark/... - pcapng", true, "pcapng;ntar" },
|
||||||
{ "Network Monitor, Surveyor, NetScaler", true, "cap" },
|
{ "Network Monitor, Surveyor, NetScaler", true, "cap" },
|
||||||
{ "Sun snoop", true, "snoop" },
|
{ "Sun snoop", true, "snoop" },
|
||||||
{ "InfoVista 5View capture", true, "5vw" },
|
{ "InfoVista 5View capture", true, "5vw" },
|
||||||
@ -186,7 +187,13 @@ static const struct file_extension_info file_type_extensions_base[] = {
|
|||||||
{ "PEAK CAN TRC log", true, "trc" },
|
{ "PEAK CAN TRC log", true, "trc" },
|
||||||
};
|
};
|
||||||
|
|
||||||
#define N_FILE_TYPE_EXTENSIONS array_length(file_type_extensions_base)
|
#define N_WIRESHARK_FILE_TYPE_EXTENSIONS array_length(wireshark_file_type_extensions_base)
|
||||||
|
|
||||||
|
static const struct file_extension_info stratoshark_file_type_extensions_base[] = {
|
||||||
|
{"Stratoshark/... - scap", true, "scap"},
|
||||||
|
};
|
||||||
|
|
||||||
|
#define N_STRATOSHARK_FILE_TYPE_EXTENSIONS array_length(stratoshark_file_type_extensions_base)
|
||||||
|
|
||||||
static const struct file_extension_info* file_type_extensions;
|
static const struct file_extension_info* file_type_extensions;
|
||||||
|
|
||||||
@ -201,7 +208,11 @@ init_file_type_extensions(void)
|
|||||||
|
|
||||||
file_type_extensions_arr = g_array_new(false,true,sizeof(struct file_extension_info));
|
file_type_extensions_arr = g_array_new(false,true,sizeof(struct file_extension_info));
|
||||||
|
|
||||||
g_array_append_vals(file_type_extensions_arr,file_type_extensions_base,N_FILE_TYPE_EXTENSIONS);
|
if (application_flavor_is_wireshark()) {
|
||||||
|
g_array_append_vals(file_type_extensions_arr, wireshark_file_type_extensions_base, N_WIRESHARK_FILE_TYPE_EXTENSIONS);
|
||||||
|
} else {
|
||||||
|
g_array_append_vals(file_type_extensions_arr, stratoshark_file_type_extensions_base, N_STRATOSHARK_FILE_TYPE_EXTENSIONS);
|
||||||
|
}
|
||||||
|
|
||||||
file_type_extensions = (struct file_extension_info*)(void *)file_type_extensions_arr->data;
|
file_type_extensions = (struct file_extension_info*)(void *)file_type_extensions_arr->data;
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
#include <wsutil/application_flavor.h>
|
||||||
#include <wsutil/wslog.h>
|
#include <wsutil/wslog.h>
|
||||||
#include <wsutil/strtoi.h>
|
#include <wsutil/strtoi.h>
|
||||||
#include <wsutil/glib-compat.h>
|
#include <wsutil/glib-compat.h>
|
||||||
@ -6461,15 +6462,25 @@ static const struct supported_block_type pcapng_blocks_supported[] = {
|
|||||||
{ WTAP_BLOCK_CUSTOM, MULTIPLE_BLOCKS_SUPPORTED, NO_OPTIONS_SUPPORTED },
|
{ WTAP_BLOCK_CUSTOM, MULTIPLE_BLOCKS_SUPPORTED, NO_OPTIONS_SUPPORTED },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct file_type_subtype_info pcapng_info = {
|
static const struct file_type_subtype_info wireshark_pcapng_info = {
|
||||||
"Wireshark/... - pcapng", "pcapng", "pcapng", "scap;ntar",
|
"Wireshark/... - pcapng", "pcapng", "pcapng", "ntar",
|
||||||
|
false, BLOCKS_SUPPORTED(pcapng_blocks_supported),
|
||||||
|
pcapng_dump_can_write_encap, pcapng_dump_open, NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct file_type_subtype_info stratoshark_pcapng_info = {
|
||||||
|
"Stratoshark/... - scap", "scap", "scap", "scap",
|
||||||
false, BLOCKS_SUPPORTED(pcapng_blocks_supported),
|
false, BLOCKS_SUPPORTED(pcapng_blocks_supported),
|
||||||
pcapng_dump_can_write_encap, pcapng_dump_open, NULL
|
pcapng_dump_can_write_encap, pcapng_dump_open, NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
void register_pcapng(void)
|
void register_pcapng(void)
|
||||||
{
|
{
|
||||||
pcapng_file_type_subtype = wtap_register_file_type_subtype(&pcapng_info);
|
if (application_flavor_is_wireshark()) {
|
||||||
|
pcapng_file_type_subtype = wtap_register_file_type_subtype(&wireshark_pcapng_info);
|
||||||
|
} else {
|
||||||
|
pcapng_file_type_subtype = wtap_register_file_type_subtype(&stratoshark_pcapng_info);
|
||||||
|
}
|
||||||
|
|
||||||
wtap_register_backwards_compatibility_lua_name("PCAPNG",
|
wtap_register_backwards_compatibility_lua_name("PCAPNG",
|
||||||
pcapng_file_type_subtype);
|
pcapng_file_type_subtype);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user