1d5573d34c8fac49e16b20cf144486125bf940086San Mehat/*
2d5573d34c8fac49e16b20cf144486125bf940086San Mehat * Copyright (C) 2008 The Android Open Source Project
3d5573d34c8fac49e16b20cf144486125bf940086San Mehat *
4d5573d34c8fac49e16b20cf144486125bf940086San Mehat * Licensed under the Apache License, Version 2.0 (the "License");
5d5573d34c8fac49e16b20cf144486125bf940086San Mehat * you may not use this file except in compliance with the License.
6d5573d34c8fac49e16b20cf144486125bf940086San Mehat * You may obtain a copy of the License at
7d5573d34c8fac49e16b20cf144486125bf940086San Mehat *
8d5573d34c8fac49e16b20cf144486125bf940086San Mehat *      http://www.apache.org/licenses/LICENSE-2.0
9d5573d34c8fac49e16b20cf144486125bf940086San Mehat *
10d5573d34c8fac49e16b20cf144486125bf940086San Mehat * Unless required by applicable law or agreed to in writing, software
11d5573d34c8fac49e16b20cf144486125bf940086San Mehat * distributed under the License is distributed on an "AS IS" BASIS,
12d5573d34c8fac49e16b20cf144486125bf940086San Mehat * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13d5573d34c8fac49e16b20cf144486125bf940086San Mehat * See the License for the specific language governing permissions and
14d5573d34c8fac49e16b20cf144486125bf940086San Mehat * limitations under the License.
15d5573d34c8fac49e16b20cf144486125bf940086San Mehat */
16d5573d34c8fac49e16b20cf144486125bf940086San Mehat
17d5573d34c8fac49e16b20cf144486125bf940086San Mehat#ifndef _PPP_CONTROLLER_H
18d5573d34c8fac49e16b20cf144486125bf940086San Mehat#define _PPP_CONTROLLER_H
19d5573d34c8fac49e16b20cf144486125bf940086San Mehat
20d5573d34c8fac49e16b20cf144486125bf940086San Mehat#include <linux/in.h>
21d5573d34c8fac49e16b20cf144486125bf940086San Mehat
22f00db28f37f1b5509598fef586036ff0a52ec30bMathias Agopian#include "List.h"
23d5573d34c8fac49e16b20cf144486125bf940086San Mehat
24f00db28f37f1b5509598fef586036ff0a52ec30bMathias Agopiantypedef android::netd::List<char *> TtyCollection;
25d5573d34c8fac49e16b20cf144486125bf940086San Mehat
26d5573d34c8fac49e16b20cf144486125bf940086San Mehatclass PppController {
27d5573d34c8fac49e16b20cf144486125bf940086San Mehat    TtyCollection *mTtys;
28d5573d34c8fac49e16b20cf144486125bf940086San Mehat    pid_t          mPid; // TODO: Add support for > 1 pppd instance
29d5573d34c8fac49e16b20cf144486125bf940086San Mehat
30d5573d34c8fac49e16b20cf144486125bf940086San Mehatpublic:
31d5573d34c8fac49e16b20cf144486125bf940086San Mehat    PppController();
32d5573d34c8fac49e16b20cf144486125bf940086San Mehat    virtual ~PppController();
33d5573d34c8fac49e16b20cf144486125bf940086San Mehat
34d5573d34c8fac49e16b20cf144486125bf940086San Mehat    int attachPppd(const char *tty, struct in_addr local,
3574d8fdd307275bfdf95dcf61d9e6366e87da24ecRobert Greenwalt                   struct in_addr remote, struct in_addr dns1,
3674d8fdd307275bfdf95dcf61d9e6366e87da24ecRobert Greenwalt                   struct in_addr dns2);
37d5573d34c8fac49e16b20cf144486125bf940086San Mehat    int detachPppd(const char *tty);
38d5573d34c8fac49e16b20cf144486125bf940086San Mehat    TtyCollection *getTtyList();
39d5573d34c8fac49e16b20cf144486125bf940086San Mehat
40d5573d34c8fac49e16b20cf144486125bf940086San Mehatprivate:
411881762f345d011d079ee318d31f0a8d8ee5891eSan Mehat    int updateTtyList();
42d5573d34c8fac49e16b20cf144486125bf940086San Mehat};
43d5573d34c8fac49e16b20cf144486125bf940086San Mehat
44d5573d34c8fac49e16b20cf144486125bf940086San Mehat#endif
45