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 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
31 #include "wsutil/filesystem.h"
36 #include <wsutil/unicode-utils.h>
40 topic_online_url(topic_action_e action)
43 case(ONLINEPAGE_HOME):
44 return "https://www.wireshark.org";
46 case(ONLINEPAGE_WIKI):
47 return "https://wiki.wireshark.org";
49 case(ONLINEPAGE_DOWNLOAD):
50 return "https://www.wireshark.org/download.html";
52 case(ONLINEPAGE_DOCS):
53 return "https://www.wireshark.org/docs/";
55 case(ONLINEPAGE_USERGUIDE):
56 return "https://www.wireshark.org/docs/wsug_html_chunked/";
59 return "http://www.wireshark.org/faq.html";
62 return "https://ask.wireshark.org";
64 case(ONLINEPAGE_SAMPLE_FILES):
65 return "https://wiki.wireshark.org/SampleCaptures";
67 case(ONLINEPAGE_CAPTURE_SETUP):
68 return "https://wiki.wireshark.org/CaptureSetup";
70 case(ONLINEPAGE_NETWORK_MEDIA):
71 return "https://wiki.wireshark.org/CaptureSetup/NetworkMedia";
73 case(ONLINEPAGE_SAMPLE_CAPTURES):
74 return "https://wiki.wireshark.org/SampleCaptures";
76 case(ONLINEPAGE_SECURITY):
77 return "https://wiki.wireshark.org/Security";
79 case(ONLINEPAGE_CHIMNEY):
80 return "https://wiki.wireshark.org/CaptureSetup/Offloading#chimney";
88 * Open the help dialog and show a specific HTML help page.
91 user_guide_url(const gchar *page) {
92 GString *url = g_string_new("");
95 * Try to open local .chm file. This is not the most intuitive way to
96 * go about this but it fits in with the rest of the _url functions.
101 g_string_printf(url, "%s\\user-guide.chm::/wsug_chm/%s>Wireshark Help",
102 get_datafile_dir(), page);
106 HH_DISPLAY_TOPIC, 0);
108 /* if the .chm file could be opened, stop here */
110 g_string_free(url, TRUE /* free_segment */);
116 if (g_file_test(DOC_DIR "/guides/wsug_html_chunked", G_FILE_TEST_IS_DIR)) {
117 /* try to open the HTML page from wireshark.org instead */
118 g_string_printf(url, "file://" DOC_DIR "/guides/wsug_html_chunked/%s", page);
120 #endif /* ifdef DOC_DIR */
121 /* try to open the HTML page from wireshark.org instead */
122 g_string_printf(url, "https://www.wireshark.org/docs/wsug_html_chunked/%s", page);
125 #endif /* ifdef DOC_DIR */
128 return g_string_free(url, FALSE);
132 topic_action_url(topic_action_e action)
136 /* pages online at www.wireshark.org */
137 url = g_strdup(topic_online_url(action));
143 /* local manual pages */
144 case(LOCALPAGE_MAN_WIRESHARK):
145 url = data_file_url("wireshark.html");
147 case(LOCALPAGE_MAN_WIRESHARK_FILTER):
148 url = data_file_url("wireshark-filter.html");
150 case(LOCALPAGE_MAN_CAPINFOS):
151 url = data_file_url("capinfos.html");
153 case(LOCALPAGE_MAN_DUMPCAP):
154 url = data_file_url("dumpcap.html");
156 case(LOCALPAGE_MAN_EDITCAP):
157 url = data_file_url("editcap.html");
159 case(LOCALPAGE_MAN_MERGECAP):
160 url = data_file_url("mergecap.html");
162 case(LOCALPAGE_MAN_RAWSHARK):
163 url = data_file_url("rawshark.html");
165 case(LOCALPAGE_MAN_REORDERCAP):
166 url = data_file_url("reordercap.html");
168 case(LOCALPAGE_MAN_TEXT2PCAP):
169 url = data_file_url("text2pcap.html");
171 case(LOCALPAGE_MAN_TSHARK):
172 url = data_file_url("tshark.html");
175 /* local help pages (User's Guide) */
177 url = user_guide_url( "index.html");
179 case(HELP_CAPTURE_OPTIONS_DIALOG):
180 url = user_guide_url("ChCapCaptureOptions.html");
182 case(HELP_CAPTURE_FILTERS_DIALOG):
183 url = user_guide_url("ChWorkDefineFilterSection.html");
185 case(HELP_DISPLAY_FILTERS_DIALOG):
186 url = user_guide_url("ChWorkDefineFilterSection.html");
188 case(HELP_FILTER_EXPRESSION_DIALOG):
189 url = user_guide_url("ChWorkFilterAddExpressionSection.html");
191 case(HELP_COLORING_RULES_DIALOG):
192 url = user_guide_url("ChCustColorizationSection.html");
194 case(HELP_CONFIG_PROFILES_DIALOG):
195 url = user_guide_url("ChCustConfigProfilesSection.html");
197 case (HELP_MANUAL_ADDR_RESOLVE_DIALOG):
198 url = user_guide_url("ChManualAddressResolveSection.html");
200 case(HELP_PRINT_DIALOG):
201 url = user_guide_url("ChIOPrintSection.html");
203 case(HELP_FIND_DIALOG):
204 url = user_guide_url("ChWorkFindPacketSection.html");
206 case(HELP_FIREWALL_DIALOG):
207 url = user_guide_url("ChUseToolsMenuSection.html");
209 case(HELP_GOTO_DIALOG):
210 url = user_guide_url("ChWorkGoToPacketSection.html");
212 case(HELP_CAPTURE_INTERFACES_DIALOG):
213 url = user_guide_url("ChCapInterfaceSection.html");
215 case(HELP_CAPTURE_INFO_DIALOG):
216 url = user_guide_url("ChCapRunningSection.html");
218 case(HELP_CAPTURE_MANAGE_INTERFACES_DIALOG):
219 url = user_guide_url("ChCapManageInterfacesSection.html");
221 case(HELP_ENABLED_PROTOCOLS_DIALOG):
222 url = user_guide_url("ChCustProtocolDissectionSection.html");
224 case(HELP_ENABLED_HEURISTICS_DIALOG):
225 url = user_guide_url("ChCustProtocolDissectionSection.html");
227 case(HELP_DECODE_AS_DIALOG):
228 url = user_guide_url("ChCustProtocolDissectionSection.html");
230 case(HELP_DECODE_AS_SHOW_DIALOG):
231 url = user_guide_url("ChCustProtocolDissectionSection.html");
233 case(HELP_FOLLOW_STREAM_DIALOG):
234 url = user_guide_url("ChAdvFollowTCPSection.html");
236 case(HELP_SHOW_PACKET_BYTES_DIALOG):
237 url = user_guide_url("ChAdvShowPacketBytes.html");
239 case(HELP_EXPERT_INFO_DIALOG):
240 url = user_guide_url("ChAdvExpert.html");
243 case(HELP_EXTCAP_OPTIONS_DIALOG):
244 url = data_file_url("extcap.html");
247 case(HELP_STATS_SUMMARY_DIALOG):
248 url = user_guide_url("ChStatSummary.html");
250 case(HELP_STATS_PROTO_HIERARCHY_DIALOG):
251 url = user_guide_url("ChStatHierarchy.html");
253 case(HELP_STATS_ENDPOINTS_DIALOG):
254 url = user_guide_url("ChStatEndpoints.html");
256 case(HELP_STATS_CONVERSATIONS_DIALOG):
257 url = user_guide_url("ChStatConversations.html");
259 case(HELP_STATS_IO_GRAPH_DIALOG):
260 url = user_guide_url("ChStatIOGraphs.html");
262 case(HELP_STATS_COMPARE_FILES_DIALOG):
263 url = user_guide_url("ChStatCompareCaptureFiles.html");
265 case(HELP_STATS_LTE_MAC_TRAFFIC_DIALOG):
266 url = user_guide_url("ChTelLTEMACTraffic.html");
268 case(HELP_STATS_LTE_RLC_TRAFFIC_DIALOG):
269 url = user_guide_url("ChTelLTERLCTraffic.html");
271 case(HELP_STATS_WLAN_TRAFFIC_DIALOG):
272 url = user_guide_url("ChStatWLANTraffic.html");
274 case(HELP_FILESET_DIALOG):
275 url = user_guide_url("ChIOFileSetSection.html");
277 case(HELP_CAPTURE_INTERFACE_OPTIONS_DIALOG):
278 url = user_guide_url("ChCustPreferencesSection.html#ChCustInterfaceOptionsSection");
280 case(HELP_CAPTURE_INTERFACES_DETAILS_DIALOG):
281 url = user_guide_url("ChCapInterfaceDetailsSection.html");
283 case(HELP_PREFERENCES_DIALOG):
284 url = user_guide_url("ChCustPreferencesSection.html");
286 case(HELP_EXPORT_FILE_DIALOG):
287 case(HELP_EXPORT_FILE_WIN32_DIALOG):
288 url = user_guide_url("ChIOExportSection.html");
290 case(HELP_EXPORT_BYTES_DIALOG):
291 case(HELP_EXPORT_BYTES_WIN32_DIALOG):
292 url = user_guide_url("ChIOExportSection.html#ChIOExportSelectedDialog");
294 case(HELP_EXPORT_OBJECT_LIST):
295 url = user_guide_url("ChIOExportSection.html#ChIOExportObjectsDialog");
297 case(HELP_OPEN_DIALOG):
298 case(HELP_OPEN_WIN32_DIALOG):
299 url = user_guide_url("ChIOOpenSection.html");
301 case(HELP_MERGE_DIALOG):
302 case(HELP_MERGE_WIN32_DIALOG):
303 url = user_guide_url("ChIOMergeSection.html");
305 case(HELP_IMPORT_DIALOG):
306 url = user_guide_url("ChIOImportSection.html");
308 case(HELP_SAVE_DIALOG):
309 case(HELP_SAVE_WIN32_DIALOG):
310 url = user_guide_url("ChIOSaveSection.html");
312 case(HELP_TIME_SHIFT_DIALOG):
313 url = user_guide_url("ChWorkShiftTimePacketSection.html");
315 case(HELP_FILTER_SAVE_DIALOG):
316 url = user_guide_url("ChWorkFilterSaveSection.html");
318 case(HELP_TELEPHONY_VOIP_CALLS_DIALOG):
319 url = user_guide_url("ChTelVoipCalls.html");
321 case(HELP_RTP_ANALYSIS_DIALOG):
322 url = user_guide_url("ChTelRTPAnalysis.html");
324 case(HELP_NEW_PACKET_DIALOG):
325 url = user_guide_url("ChapterWork.html#ChWorkPacketSepView");
327 case(HELP_IAX2_ANALYSIS_DIALOG):
328 url = user_guide_url("ChTelIAX2Analysis.html");
330 case(HELP_TELEPHONY_RTP_PLAYER_DIALOG):
331 url = user_guide_url("ChTelRtpPlayer.html");
334 case(TOPIC_ACTION_NONE):
336 g_assert_not_reached();
348 * indent-tabs-mode: nil
351 * ex: set shiftwidth=4 tabstop=8 expandtab:
352 * :indentSize=4:tabSize=8:noTabs=true: