Android-cuttlefish cvd tool
alloc_driver.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2020 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#include "absl/strings/string_view.h"
18
20
21namespace cuttlefish {
22
23inline constexpr char kCvdNetworkGroupName[] = "cvdnetwork";
24
25Result<void> AddTapIface(absl::string_view name);
26Result<void> ShutdownIface(absl::string_view name);
27Result<void> BringUpIface(absl::string_view name);
28Result<void> AddGateway(absl::string_view name, absl::string_view gateway,
29 absl::string_view netmask);
30Result<void> DestroyGateway(absl::string_view name, absl::string_view gateway,
31 absl::string_view netmask);
32Result<void> LinkTapToBridge(absl::string_view tap_name,
33 absl::string_view bridge_name);
34Result<void> DeleteIface(absl::string_view name);
35Result<bool> BridgeInUse(absl::string_view name);
36Result<bool> BridgeExists(absl::string_view name);
37Result<void> CreateBridge(absl::string_view name);
38
39} // namespace cuttlefish
Definition: alloc_driver.h:21
Result< void > AddTapIface(absl::string_view name)
Definition: alloc_iproute2.cpp:27
Result< void > DestroyGateway(absl::string_view name, absl::string_view gateway, absl::string_view netmask)
Definition: alloc_iproute2.cpp:56
constexpr char kCvdNetworkGroupName[]
Definition: alloc_driver.h:23
Result< bool > BridgeInUse(absl::string_view name)
Definition: alloc_iproute2.cpp:83
Result< void > DeleteIface(absl::string_view name)
Definition: alloc_iproute2.cpp:73
Result< bool > BridgeExists(absl::string_view name)
Definition: alloc_iproute2.cpp:79
Result< void > AddGateway(absl::string_view name, absl::string_view gateway, absl::string_view netmask)
Definition: alloc_iproute2.cpp:47
Result< void > BringUpIface(absl::string_view name)
Definition: alloc_iproute2.cpp:41
tl::expected< T, StackTraceError< E > > Result
Definition: result_type.h:30
Result< void > CreateBridge(absl::string_view name)
Definition: alloc_iproute2.cpp:89
Result< void > LinkTapToBridge(absl::string_view tap_name, absl::string_view bridge_name)
Definition: alloc_iproute2.cpp:65
Result< void > ShutdownIface(absl::string_view name)
Definition: alloc_iproute2.cpp:34