San Mehat | 82a2116 | 2009-05-12 17:26:28 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2008 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #include <errno.h> |
| 18 | #include <string.h> |
| 19 | #include <sys/types.h> |
| 20 | |
| 21 | #include "WifiNetwork.h" |
| 22 | #include "Supplicant.h" |
| 23 | |
| 24 | WifiNetwork::WifiNetwork(Supplicant *suppl) { |
| 25 | mSuppl = suppl; |
| 26 | mNetid = -1; |
| 27 | mSsid = NULL; |
| 28 | mBssid = NULL; |
| 29 | mPsk = NULL; |
| 30 | memset(mWepKeys, 0, sizeof(mWepKeys)); |
| 31 | mDefaultKeyIndex = -1; |
| 32 | mPriority = -1; |
| 33 | mHiddenSsid = NULL; |
| 34 | mAllowedKeyManagement = 0; |
| 35 | mAllowedProtocols = 0; |
| 36 | mAllowedAuthAlgorithms = 0; |
| 37 | mAllowedPairwiseCiphers = 0; |
| 38 | mAllowedGroupCiphers = 0; |
| 39 | } |
| 40 | |
| 41 | WifiNetwork::~WifiNetwork() { |
| 42 | if (mSsid) |
| 43 | free(mSsid); |
| 44 | if (mBssid) |
| 45 | free(mBssid); |
| 46 | if (mPsk) |
| 47 | free(mPsk); |
| 48 | for (int i = 0; i < 4; i++) { |
| 49 | if (mWepKeys[i]) |
| 50 | free(mWepKeys[i]); |
| 51 | } |
| 52 | if (mHiddenSsid) |
| 53 | free(mHiddenSsid); |
| 54 | } |
| 55 | |
| 56 | int WifiNetwork::setSsid(char *ssid) { |
| 57 | errno = ENOSYS; |
| 58 | return -1; |
| 59 | } |
| 60 | |
| 61 | int WifiNetwork::setBssid(char *bssid) { |
| 62 | errno = ENOSYS; |
| 63 | return -1; |
| 64 | } |
| 65 | |
| 66 | int WifiNetwork::setPsk(char *psk) { |
| 67 | errno = ENOSYS; |
| 68 | return -1; |
| 69 | } |
| 70 | |
| 71 | int WifiNetwork::setWepKey(int idx, char *key) { |
| 72 | errno = ENOSYS; |
| 73 | return -1; |
| 74 | } |
| 75 | |
| 76 | int WifiNetwork::setDefaultKeyIndex(int idx) { |
| 77 | errno = ENOSYS; |
| 78 | return -1; |
| 79 | } |
| 80 | |
| 81 | int WifiNetwork::setPriority(int idx) { |
| 82 | errno = ENOSYS; |
| 83 | return -1; |
| 84 | } |
| 85 | |
| 86 | int WifiNetwork::setHiddenSsid(char *ssid) { |
| 87 | errno = ENOSYS; |
| 88 | return -1; |
| 89 | } |
| 90 | |
| 91 | int WifiNetwork::setAllowedKeyManagement(uint32_t mask) { |
| 92 | errno = ENOSYS; |
| 93 | return -1; |
| 94 | } |
| 95 | |
| 96 | int WifiNetwork::setAllowedProtocols(uint32_t mask) { |
| 97 | errno = ENOSYS; |
| 98 | return -1; |
| 99 | } |
| 100 | |
| 101 | int WifiNetwork::setAllowedPairwiseCiphers(uint32_t mask) { |
| 102 | errno = ENOSYS; |
| 103 | return -1; |
| 104 | } |
| 105 | |
| 106 | int WifiNetwork::setAllowedGroupCiphers(uint32_t mask) { |
| 107 | errno = ENOSYS; |
| 108 | return -1; |
| 109 | } |