1 /*
2 * Copyright (C) 2014 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 #define LOG_TAG "Netd"
18
19 #include "DummyNetwork.h"
20
21 #include "errno.h"
22
23 namespace android {
24 namespace net {
25
26 // The dummy network is used to blackhole or reject traffic.
27 // It has an IPv4 and an IPv6 default route that point to a dummy interface
28 // which drops packets. It is used for system purposes only. Applications
29 // cannot use multinetwork APIs such as Network#bindSocket or
30 // android_setsocknetwork to send packets on the dummy network.
31 // Any attempt to do so will fail with ENETUNREACH.
32
33 const char* DummyNetwork::INTERFACE_NAME = "dummy0";
34
DummyNetwork(unsigned netId)35 DummyNetwork::DummyNetwork(unsigned netId) : Network(netId) {
36 mInterfaces.insert(INTERFACE_NAME);
37 }
38
~DummyNetwork()39 DummyNetwork::~DummyNetwork() {
40 }
41
42 } // namespace net
43 } // namespace android
44