SoftapController.h revision 84c65a62fe7b053fed7f20274ca7379627a87b79
15af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt/* 25af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt * Copyright (C) 2008 The Android Open Source Project 35af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt * 45af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt * Licensed under the Apache License, Version 2.0 (the "License"); 55af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt * you may not use this file except in compliance with the License. 65af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt * You may obtain a copy of the License at 75af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt * 85af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt * http://www.apache.org/licenses/LICENSE-2.0 95af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt * 105af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt * Unless required by applicable law or agreed to in writing, software 115af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt * distributed under the License is distributed on an "AS IS" BASIS, 125af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 135af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt * See the License for the specific language governing permissions and 145af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt * limitations under the License. 155af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt */ 165af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt 175af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt#ifndef _SOFTAP_CONTROLLER_H 185af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt#define _SOFTAP_CONTROLLER_H 195af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt 205af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt#include <linux/in.h> 2184c65a62fe7b053fed7f20274ca7379627a87b79Dmitry Shmidt#include <net/if.h> 225af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt#include <utils/List.h> 235af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt 2484c65a62fe7b053fed7f20274ca7379627a87b79Dmitry Shmidt#define SOFTAP_MAX_BUFFER_SIZE 4096 2584c65a62fe7b053fed7f20274ca7379627a87b79Dmitry Shmidt 265af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidtclass SoftapController { 2784c65a62fe7b053fed7f20274ca7379627a87b79Dmitry Shmidt char mBuf[SOFTAP_MAX_BUFFER_SIZE]; 2884c65a62fe7b053fed7f20274ca7379627a87b79Dmitry Shmidt char mIface[IFNAMSIZ]; 295af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt pid_t mPid; 3084c65a62fe7b053fed7f20274ca7379627a87b79Dmitry Shmidt int mSock; 315af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt 3284c65a62fe7b053fed7f20274ca7379627a87b79Dmitry Shmidt int getPrivFuncNum(char *iface, const char *fname); 335af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidtpublic: 345af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt SoftapController(); 355af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt virtual ~SoftapController(); 365af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt 375af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt int startSoftap(); 385af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt int stopSoftap(); 395af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt bool isSoftapStarted(); 405af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt int setSoftap(int argc, char *argv[]); 415af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt}; 425af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt 435af38c360587ca2eef0badf6137ccf018f8cd4aaDmitry Shmidt#endif 44