MSWSP: add ids for another unknown Property Set
[wireshark-wip.git] / epan / frequency-utils.h
blobd631b8623024c6b955f7a32a67e233e1637fd64e
1 /* frequency-utils.h
2 * Frequency conversion utility definitions
4 * $Id$
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 2007 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 #ifndef __FREQUENCY_UTILS_H__
26 #define __FREQUENCY_UTILS_H__
28 #include "ws_symbol_export.h"
30 /** @file
31 * Frequency and channel conversion utilities.
34 /**
35 * Given a center frequency in MHz, return a channel number.
36 * @param freq Frequency in MHz.
37 * @return The equivalent channel or -1 if no match is found.
39 WS_DLL_PUBLIC
40 gint
41 ieee80211_mhz_to_chan(guint freq);
43 /**
44 * Given a channel number and a band type, return a center frequency.
45 * @param chan Channel number
46 * @param is_bg TRUE if the channel is a b/g channel, FALSE otherwise.
47 * @return The equivalent frequency or 0 if no match is found.
49 WS_DLL_PUBLIC
50 guint
51 ieee80211_chan_to_mhz(gint chan, gboolean is_bg);
53 /**
54 * Given a frequency in MHz, return a string representation.
55 * @param freq Frequench in MHz.
56 * @return A string showing the frequency, channel number, and type. The string must be freed with g_free() after use.
58 WS_DLL_PUBLIC
59 gchar*
60 ieee80211_mhz_to_str(guint freq);
62 /* Should this be "(freq < 4920)", or something else? */
63 #define FREQ_IS_BG(freq) (freq <= 2484)
66 * Editor modelines
68 * Local Variables:
69 * c-basic-offset: 4
70 * tab-width: 8
71 * indent-tabs-mode: nil
72 * End:
74 * ex: set shiftwidth=4 tabstop=8 expandtab:
75 * :indentSize=4:tabSize=8:noTabs=true:
78 #endif /* __FREQUENCY_UTILS_H__ */