12eab1f762badb7ba46b95716e62ea4548a979903Dmitry Shmidt/*
22eab1f762badb7ba46b95716e62ea4548a979903Dmitry Shmidt * Copyright (C) 2012 The Android Open Source Project
32eab1f762badb7ba46b95716e62ea4548a979903Dmitry Shmidt *
42eab1f762badb7ba46b95716e62ea4548a979903Dmitry Shmidt * Licensed under the Apache License, Version 2.0 (the "License");
52eab1f762badb7ba46b95716e62ea4548a979903Dmitry Shmidt * you may not use this file except in compliance with the License.
62eab1f762badb7ba46b95716e62ea4548a979903Dmitry Shmidt * You may obtain a copy of the License at
72eab1f762badb7ba46b95716e62ea4548a979903Dmitry Shmidt *
8329c3b4681e2ca4831adc7c8cf257e9e32971710Sasha Levitskiy *	  http://www.apache.org/licenses/LICENSE-2.0
92eab1f762badb7ba46b95716e62ea4548a979903Dmitry Shmidt *
102eab1f762badb7ba46b95716e62ea4548a979903Dmitry Shmidt * Unless required by applicable law or agreed to in writing, software
112eab1f762badb7ba46b95716e62ea4548a979903Dmitry Shmidt * distributed under the License is distributed on an "AS IS" BASIS,
122eab1f762badb7ba46b95716e62ea4548a979903Dmitry Shmidt * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
132eab1f762badb7ba46b95716e62ea4548a979903Dmitry Shmidt * See the License for the specific language governing permissions and
142eab1f762badb7ba46b95716e62ea4548a979903Dmitry Shmidt * limitations under the License.
152eab1f762badb7ba46b95716e62ea4548a979903Dmitry Shmidt */
162eab1f762badb7ba46b95716e62ea4548a979903Dmitry Shmidt
172eab1f762badb7ba46b95716e62ea4548a979903Dmitry Shmidt#ifndef _INTERFACE_CONTROLLER_H
182eab1f762badb7ba46b95716e62ea4548a979903Dmitry Shmidt#define _INTERFACE_CONTROLLER_H
192eab1f762badb7ba46b95716e62ea4548a979903Dmitry Shmidt
202eab1f762badb7ba46b95716e62ea4548a979903Dmitry Shmidt#include <linux/in.h>
212eab1f762badb7ba46b95716e62ea4548a979903Dmitry Shmidt#include <net/if.h>
222eab1f762badb7ba46b95716e62ea4548a979903Dmitry Shmidt
232eab1f762badb7ba46b95716e62ea4548a979903Dmitry Shmidttypedef struct android_wifi_priv_cmd {
24329c3b4681e2ca4831adc7c8cf257e9e32971710Sasha Levitskiy	char *buf;
25329c3b4681e2ca4831adc7c8cf257e9e32971710Sasha Levitskiy	int used_len;
26329c3b4681e2ca4831adc7c8cf257e9e32971710Sasha Levitskiy	int total_len;
272eab1f762badb7ba46b95716e62ea4548a979903Dmitry Shmidt} android_wifi_priv_cmd;
282eab1f762badb7ba46b95716e62ea4548a979903Dmitry Shmidt
292eab1f762badb7ba46b95716e62ea4548a979903Dmitry Shmidt#define INTERFACE_MAX_BUFFER_SIZE	256
302eab1f762badb7ba46b95716e62ea4548a979903Dmitry Shmidt
312eab1f762badb7ba46b95716e62ea4548a979903Dmitry Shmidtclass InterfaceController {
32329c3b4681e2ca4831adc7c8cf257e9e32971710Sasha Levitskiy public:
33329c3b4681e2ca4831adc7c8cf257e9e32971710Sasha Levitskiy	InterfaceController();
34329c3b4681e2ca4831adc7c8cf257e9e32971710Sasha Levitskiy	virtual ~InterfaceController();
35329c3b4681e2ca4831adc7c8cf257e9e32971710Sasha Levitskiy	int interfaceCommand(int argc, char *argv[], char **rbuf);
36329c3b4681e2ca4831adc7c8cf257e9e32971710Sasha Levitskiy
37329c3b4681e2ca4831adc7c8cf257e9e32971710Sasha Levitskiy private:
38329c3b4681e2ca4831adc7c8cf257e9e32971710Sasha Levitskiy	void *libh_;
39329c3b4681e2ca4831adc7c8cf257e9e32971710Sasha Levitskiy	int (*sendCommand_)(int argc, char *argv[], char **rbuf);
40329c3b4681e2ca4831adc7c8cf257e9e32971710Sasha Levitskiy	int (*sendCommandInit_)(void);
41329c3b4681e2ca4831adc7c8cf257e9e32971710Sasha Levitskiy	int (*sendCommandFini_)(void);
422eab1f762badb7ba46b95716e62ea4548a979903Dmitry Shmidt};
432eab1f762badb7ba46b95716e62ea4548a979903Dmitry Shmidt
442eab1f762badb7ba46b95716e62ea4548a979903Dmitry Shmidt#endif
45