nexmon – Blame information for rev 1

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