Bug 752461 - Hide click-to-play overlays when choosing "never activate plugins.....
[gecko.git] / netwerk / wifi / nsWifiAccessPoint.h
blob4633958f3a951b52816276ec4b01f44bcc998c38
1 /* ***** BEGIN LICENSE BLOCK *****
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 * The contents of this file are subject to the Mozilla Public License Version
5 * 1.1 (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 * http://www.mozilla.org/MPL/
9 * Software distributed under the License is distributed on an "AS IS" basis,
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 * for the specific language governing rights and limitations under the
12 * License.
14 * The Original Code is Geolocation.
16 * The Initial Developer of the Original Code is Mozilla Foundation
17 * Portions created by the Initial Developer are Copyright (C) 2008
18 * the Initial Developer. All Rights Reserved.
20 * This is a derivative of work done by Google under a BSD style License.
21 * See: http://gears.googlecode.com/svn/trunk/gears/geolocation/
23 * Contributor(s):
24 * Doug Turner <dougt@meer.net> (Original Author)
26 * Alternatively, the contents of this file may be used under the terms of
27 * either the GNU General Public License Version 2 or later (the "GPL"), or
28 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 * in which case the provisions of the GPL or the LGPL are applicable instead
30 * of those above. If you wish to allow use of your version of this file only
31 * under the terms of either the GPL or the LGPL, and not to allow others to
32 * use your version of this file under the terms of the MPL, indicate your
33 * decision by deleting the provisions above and replace them with the notice
34 * and other provisions required by the GPL or the LGPL. If you do not delete
35 * the provisions above, a recipient may use your version of this file under
36 * the terms of any one of the MPL, the GPL or the LGPL.
38 * ***** END LICENSE BLOCK ***** */
40 #include "nsWifiMonitor.h"
41 #include "nsIWifiAccessPoint.h"
43 #include "nsString.h"
44 #include "nsCOMArray.h"
46 #ifndef __nsWifiAccessPoint__
47 #define __nsWifiAccessPoint__
49 class nsWifiAccessPoint : public nsIWifiAccessPoint
51 public:
52 NS_DECL_ISUPPORTS
53 NS_DECL_NSIWIFIACCESSPOINT
55 nsWifiAccessPoint();
56 ~nsWifiAccessPoint();
58 char mMac[18];
59 int mSignal;
60 char mSsid[33];
61 int mSsidLen;
63 void setSignal(int signal)
65 mSignal = signal;
68 void setMac(const unsigned char mac_as_int[6])
70 // mac_as_int is big-endian. Write in byte chunks.
71 // Format is XX-XX-XX-XX-XX-XX.
73 const unsigned char holder[6] = {0};
74 if (!mac_as_int) {
75 mac_as_int = holder;
78 static const char *kMacFormatString = ("%02x-%02x-%02x-%02x-%02x-%02x");
80 sprintf(mMac, kMacFormatString,
81 mac_as_int[0], mac_as_int[1], mac_as_int[2],
82 mac_as_int[3], mac_as_int[4], mac_as_int[5]);
84 mMac[17] = 0;
87 void setSSID(const char* aSSID, unsigned long len) {
88 if (aSSID && (len < sizeof(mSsid))) {
89 strncpy(mSsid, aSSID, len);
90 mSsid[len] = 0;
91 mSsidLen = len;
93 else
95 mSsid[0] = 0;
96 mSsidLen = 0;
103 // Helper functions
105 bool AccessPointsEqual(nsCOMArray<nsWifiAccessPoint>& a, nsCOMArray<nsWifiAccessPoint>& b);
106 void ReplaceArray(nsCOMArray<nsWifiAccessPoint>& a, nsCOMArray<nsWifiAccessPoint>& b);
109 #endif