3 * Some content from gtk/help_dlg.c by Laurent Deniel <laurent.deniel@free.fr>
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 2000 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
19 #include "wsutil/filesystem.h"
24 #include <wsutil/unicode-utils.h>
28 topic_online_url(topic_action_e action)
31 case(ONLINEPAGE_HOME):
32 return "https://www.wireshark.org";
34 case(ONLINEPAGE_WIKI):
35 return "https://wiki.wireshark.org";
37 case(ONLINEPAGE_DOWNLOAD):
38 return "https://www.wireshark.org/download.html";
40 case(ONLINEPAGE_DOCS):
41 return "https://www.wireshark.org/docs/";
43 case(ONLINEPAGE_USERGUIDE):
44 return "https://www.wireshark.org/docs/wsug_html_chunked/";
47 return "http://www.wireshark.org/faq.html";
50 return "https://ask.wireshark.org";
52 case(ONLINEPAGE_SAMPLE_FILES):
53 return "https://wiki.wireshark.org/SampleCaptures";
55 case(ONLINEPAGE_CAPTURE_SETUP):
56 return "https://wiki.wireshark.org/CaptureSetup";
58 case(ONLINEPAGE_NETWORK_MEDIA):
59 return "https://wiki.wireshark.org/CaptureSetup/NetworkMedia";
61 case(ONLINEPAGE_SAMPLE_CAPTURES):
62 return "https://wiki.wireshark.org/SampleCaptures";
64 case(ONLINEPAGE_SECURITY):
65 return "https://wiki.wireshark.org/Security";
67 case(ONLINEPAGE_CHIMNEY):
68 return "https://wiki.wireshark.org/CaptureSetup/Offloading#chimney";
76 * Open the help dialog and show a specific HTML help page.
79 user_guide_url(const gchar *page) {
80 GString *url = g_string_new("");
83 * Try to open local .chm file. This is not the most intuitive way to
84 * go about this but it fits in with the rest of the _url functions.
89 g_string_printf(url, "%s\\user-guide.chm::/wsug_chm/%s>Wireshark Help",
90 get_datafile_dir(), page);
96 /* if the .chm file could be opened, stop here */
98 g_string_free(url, TRUE /* free_segment */);
104 if (g_file_test(DOC_DIR "/guides/wsug_html_chunked", G_FILE_TEST_IS_DIR)) {
105 /* try to open the HTML page from wireshark.org instead */
106 g_string_printf(url, "file://" DOC_DIR "/guides/wsug_html_chunked/%s", page);
108 #endif /* ifdef DOC_DIR */
109 /* try to open the HTML page from wireshark.org instead */
110 g_string_printf(url, "https://www.wireshark.org/docs/wsug_html_chunked/%s", page);
113 #endif /* ifdef DOC_DIR */
116 return g_string_free(url, FALSE);
120 topic_action_url(topic_action_e action)
124 /* pages online at www.wireshark.org */
125 url = g_strdup(topic_online_url(action));
131 /* local manual pages */
132 case(LOCALPAGE_MAN_WIRESHARK):
133 url = data_file_url("wireshark.html");
135 case(LOCALPAGE_MAN_WIRESHARK_FILTER):
136 url = data_file_url("wireshark-filter.html");
138 case(LOCALPAGE_MAN_CAPINFOS):
139 url = data_file_url("capinfos.html");
141 case(LOCALPAGE_MAN_DUMPCAP):
142 url = data_file_url("dumpcap.html");
144 case(LOCALPAGE_MAN_EDITCAP):
145 url = data_file_url("editcap.html");
147 case(LOCALPAGE_MAN_MERGECAP):
148 url = data_file_url("mergecap.html");
150 case(LOCALPAGE_MAN_RAWSHARK):
151 url = data_file_url("rawshark.html");
153 case(LOCALPAGE_MAN_REORDERCAP):
154 url = data_file_url("reordercap.html");
156 case(LOCALPAGE_MAN_TEXT2PCAP):
157 url = data_file_url("text2pcap.html");
159 case(LOCALPAGE_MAN_TSHARK):
160 url = data_file_url("tshark.html");
163 /* local help pages (User's Guide) */
165 url = user_guide_url( "index.html");
167 case(HELP_CAPTURE_OPTIONS_DIALOG):
168 url = user_guide_url("ChCapCaptureOptions.html");
170 case(HELP_CAPTURE_FILTERS_DIALOG):
171 url = user_guide_url("ChWorkDefineFilterSection.html");
173 case(HELP_DISPLAY_FILTERS_DIALOG):
174 url = user_guide_url("ChWorkDefineFilterSection.html");
176 case(HELP_FILTER_EXPRESSION_DIALOG):
177 url = user_guide_url("ChWorkFilterAddExpressionSection.html");
179 case(HELP_COLORING_RULES_DIALOG):
180 url = user_guide_url("ChCustColorizationSection.html");
182 case(HELP_CONFIG_PROFILES_DIALOG):
183 url = user_guide_url("ChCustConfigProfilesSection.html");
185 case (HELP_MANUAL_ADDR_RESOLVE_DIALOG):
186 url = user_guide_url("ChManualAddressResolveSection.html");
188 case(HELP_PRINT_DIALOG):
189 url = user_guide_url("ChIOPrintSection.html");
191 case(HELP_FIND_DIALOG):
192 url = user_guide_url("ChWorkFindPacketSection.html");
194 case(HELP_FIREWALL_DIALOG):
195 url = user_guide_url("ChUseToolsMenuSection.html");
197 case(HELP_GOTO_DIALOG):
198 url = user_guide_url("ChWorkGoToPacketSection.html");
200 case(HELP_CAPTURE_INTERFACES_DIALOG):
201 url = user_guide_url("ChCapInterfaceSection.html");
203 case(HELP_CAPTURE_INFO_DIALOG):
204 url = user_guide_url("ChCapRunningSection.html");
206 case(HELP_CAPTURE_MANAGE_INTERFACES_DIALOG):
207 url = user_guide_url("ChCapManageInterfacesSection.html");
209 case(HELP_ENABLED_PROTOCOLS_DIALOG):
210 url = user_guide_url("ChCustProtocolDissectionSection.html");
212 case(HELP_ENABLED_HEURISTICS_DIALOG):
213 url = user_guide_url("ChCustProtocolDissectionSection.html");
215 case(HELP_DECODE_AS_DIALOG):
216 url = user_guide_url("ChCustProtocolDissectionSection.html");
218 case(HELP_DECODE_AS_SHOW_DIALOG):
219 url = user_guide_url("ChCustProtocolDissectionSection.html");
221 case(HELP_FOLLOW_STREAM_DIALOG):
222 url = user_guide_url("ChAdvFollowStreamSection.html");
224 case(HELP_SHOW_PACKET_BYTES_DIALOG):
225 url = user_guide_url("ChAdvShowPacketBytes.html");
227 case(HELP_EXPERT_INFO_DIALOG):
228 url = user_guide_url("ChAdvExpert.html");
230 case(HELP_EXTCAP_OPTIONS_DIALOG):
231 url = data_file_url("extcap.html");
233 case(HELP_STATS_SUMMARY_DIALOG):
234 url = user_guide_url("ChStatSummary.html");
236 case(HELP_STATS_PROTO_HIERARCHY_DIALOG):
237 url = user_guide_url("ChStatHierarchy.html");
239 case(HELP_STATS_ENDPOINTS_DIALOG):
240 url = user_guide_url("ChStatEndpoints.html");
242 case(HELP_STATS_CONVERSATIONS_DIALOG):
243 url = user_guide_url("ChStatConversations.html");
245 case(HELP_STATS_IO_GRAPH_DIALOG):
246 url = user_guide_url("ChStatIOGraphs.html");
248 case(HELP_STATS_COMPARE_FILES_DIALOG):
249 url = user_guide_url("ChStatCompareCaptureFiles.html");
251 case(HELP_STATS_LTE_MAC_TRAFFIC_DIALOG):
252 url = user_guide_url("ChTelLTEMACTraffic.html");
254 case(HELP_STATS_LTE_RLC_TRAFFIC_DIALOG):
255 url = user_guide_url("ChTelLTERLCTraffic.html");
257 case(HELP_STATS_TCP_STREAM_GRAPHS_DIALOG):
258 url = user_guide_url("ChStatTCPStreamGraphs.html");
260 case(HELP_STATS_WLAN_TRAFFIC_DIALOG):
261 url = user_guide_url("ChStatWLANTraffic.html");
263 case(HELP_FILESET_DIALOG):
264 url = user_guide_url("ChIOFileSetSection.html");
266 case(HELP_CAPTURE_INTERFACE_OPTIONS_DIALOG):
267 url = user_guide_url("ChCustPreferencesSection.html#ChCustInterfaceOptionsSection");
269 case(HELP_CAPTURE_INTERFACES_DETAILS_DIALOG):
270 url = user_guide_url("ChCapInterfaceDetailsSection.html");
272 case(HELP_PREFERENCES_DIALOG):
273 url = user_guide_url("ChCustPreferencesSection.html");
275 case(HELP_EXPORT_FILE_DIALOG):
276 case(HELP_EXPORT_FILE_WIN32_DIALOG):
277 url = user_guide_url("ChIOExportSection.html");
279 case(HELP_EXPORT_BYTES_DIALOG):
280 case(HELP_EXPORT_BYTES_WIN32_DIALOG):
281 url = user_guide_url("ChIOExportSection.html#ChIOExportSelectedDialog");
283 case(HELP_EXPORT_OBJECT_LIST):
284 url = user_guide_url("ChIOExportSection.html#ChIOExportObjectsDialog");
286 case(HELP_OPEN_DIALOG):
287 case(HELP_OPEN_WIN32_DIALOG):
288 url = user_guide_url("ChIOOpenSection.html");
290 case(HELP_MERGE_DIALOG):
291 case(HELP_MERGE_WIN32_DIALOG):
292 url = user_guide_url("ChIOMergeSection.html");
294 case(HELP_IMPORT_DIALOG):
295 url = user_guide_url("ChIOImportSection.html");
297 case(HELP_SAVE_DIALOG):
298 case(HELP_SAVE_WIN32_DIALOG):
299 url = user_guide_url("ChIOSaveSection.html");
301 case(HELP_TIME_SHIFT_DIALOG):
302 url = user_guide_url("ChWorkShiftTimePacketSection.html");
304 case(HELP_FILTER_SAVE_DIALOG):
305 url = user_guide_url("ChWorkFilterSaveSection.html");
307 case(HELP_TELEPHONY_VOIP_CALLS_DIALOG):
308 url = user_guide_url("ChTelVoipCalls.html");
310 case(HELP_RTP_ANALYSIS_DIALOG):
311 url = user_guide_url("ChTelRTPAnalysis.html");
313 case(HELP_NEW_PACKET_DIALOG):
314 url = user_guide_url("ChapterWork.html#ChWorkPacketSepView");
316 case(HELP_IAX2_ANALYSIS_DIALOG):
317 url = user_guide_url("ChTelIAX2Analysis.html");
319 case(HELP_TELEPHONY_RTP_PLAYER_DIALOG):
320 url = user_guide_url("ChTelRtpPlayer.html");
323 case(TOPIC_ACTION_NONE):
325 g_assert_not_reached();
337 * indent-tabs-mode: nil
340 * ex: set shiftwidth=4 tabstop=8 expandtab:
341 * :indentSize=4:tabSize=8:noTabs=true: