blob: cd24c19eb74c8cd5b11946d4675e6eed69ef119e [file] [log] [blame]
San Mehatdc266072009-05-06 11:16:52 -07001/*
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 */
San Mehat5d6d4172009-05-14 15:00:06 -070016
17#include <string.h>
San Mehatdc266072009-05-06 11:16:52 -070018#include <errno.h>
San Mehat5d6d4172009-05-14 15:00:06 -070019#include <sys/socket.h>
20#include <netinet/in.h>
21#include <arpa/inet.h>
22
San Mehatdc266072009-05-06 11:16:52 -070023#include "VpnController.h"
24
25VpnController::VpnController() :
26 Controller("VPN") {
27}
28
29int VpnController::start() {
San Mehat5d6d4172009-05-14 15:00:06 -070030 errno = ENOSYS;
San Mehatdc266072009-05-06 11:16:52 -070031 return -1;
32}
33
34int VpnController::stop() {
San Mehat5d6d4172009-05-14 15:00:06 -070035 errno = ENOSYS;
San Mehatdc266072009-05-06 11:16:52 -070036 return -1;
37}
38
39int VpnController::enable() {
San Mehat5d6d4172009-05-14 15:00:06 -070040 errno = ENOSYS;
San Mehatdc266072009-05-06 11:16:52 -070041 return -1;
42}
43
44int VpnController::disable() {
San Mehat5d6d4172009-05-14 15:00:06 -070045 errno = ENOSYS;
San Mehatdc266072009-05-06 11:16:52 -070046 return -1;
47}
San Mehat5d6d4172009-05-14 15:00:06 -070048
49int VpnController::setVpnGateway(const char *vpnGw) {
50 if (!inet_aton(vpnGw, &mVpnGateway)) {
51 errno = EINVAL;
52 return -1;
53 }
54 return 0;
55}
56
57int VpnController::setVpnGateway(struct in_addr *vpnGw) {
58 memcpy(&mVpnGateway, vpnGw, sizeof(struct in_addr));
59 return 0;
60}