1 /* application_flavor.c
2 * Application flavor routines
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * SPDX-License-Identifier: GPL-2.0-or-later
12 #define WS_LOG_DOMAIN LOG_DOMAIN_WSUTIL
14 #include "application_flavor.h"
16 static enum application_flavor_e application_flavor
= APPLICATION_FLAVOR_WIRESHARK
;
18 void set_application_flavor(enum application_flavor_e flavor
)
20 application_flavor
= flavor
;
23 enum application_flavor_e
get_application_flavor(void)
25 return application_flavor
;
28 const char *application_flavor_name_proper(void) {
29 switch (get_application_flavor()) {
30 case APPLICATION_FLAVOR_WIRESHARK
:
32 case APPLICATION_FLAVOR_STRATOSHARK
:
35 ws_assert_not_reached();
39 const char *application_flavor_name_lower(void) {
40 switch (get_application_flavor()) {
41 case APPLICATION_FLAVOR_WIRESHARK
:
43 case APPLICATION_FLAVOR_STRATOSHARK
:
46 ws_assert_not_reached();
50 enum application_flavor_e
application_name_to_flavor(const char *name
)
52 if (g_ascii_strcasecmp(name
, "stratoshark") == 0) {
53 return APPLICATION_FLAVOR_STRATOSHARK
;
55 return APPLICATION_FLAVOR_WIRESHARK
;
58 bool application_flavor_is_wireshark(void)
60 return get_application_flavor() == APPLICATION_FLAVOR_WIRESHARK
;
63 bool application_flavor_is_stratoshark(void)
65 return get_application_flavor() == APPLICATION_FLAVOR_STRATOSHARK
;
74 * indent-tabs-mode: nil
77 * ex: set shiftwidth=4 tabstop=8 expandtab:
78 * :indentSize=4:tabSize=8:noTabs=true: