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#include <string_view>
17
19
20namespace cuttlefish {
21
22inline constexpr char kCvdNetworkGroupName[] = "cvdnetwork";
23
24Result<void> AddTapIface(std::string_view name);
25Result<void> ShutdownIface(std::string_view name);
26Result<void> BringUpIface(std::string_view name);
27Result<void> AddGateway(std::string_view name, std::string_view gateway,
28 std::string_view netmask);
29Result<void> DestroyGateway(std::string_view name, std::string_view gateway,
30 std::string_view netmask);
31Result<void> LinkTapToBridge(std::string_view tap_name,
32 std::string_view bridge_name);
33Result<void> DeleteIface(std::string_view name);
34Result<bool> BridgeInUse(std::string_view name);
35Result<bool> BridgeExists(std::string_view name);
36Result<bool> BridgeInUse(std::string_view name);
37Result<void> CreateBridge(std::string_view name);
38Result<void> IptableConfig(std::string_view iptables_path,
39 std::string_view network, bool add);
40
41} // namespace cuttlefish
char * name
Definition: libf2fs.c:1403
Definition: alloc_driver.h:20
Result< void > ShutdownIface(std::string_view name)
Definition: alloc_iproute2.cpp:34
Result< void > AddGateway(std::string_view name, std::string_view gateway, std::string_view netmask)
Definition: alloc_iproute2.cpp:47
Result< void > LinkTapToBridge(std::string_view tap_name, std::string_view bridge_name)
Definition: alloc_iproute2.cpp:65
Result< bool > BridgeInUse(std::string_view name)
Definition: alloc_iproute2.cpp:83
Result< void > DestroyGateway(std::string_view name, std::string_view gateway, std::string_view netmask)
Definition: alloc_iproute2.cpp:56
Result< void > CreateBridge(std::string_view name)
Definition: alloc_iproute2.cpp:89
constexpr char kCvdNetworkGroupName[]
Definition: alloc_driver.h:22
Result< void > DeleteIface(std::string_view name)
Definition: alloc_iproute2.cpp:73
Result< bool > BridgeExists(std::string_view name)
Definition: alloc_iproute2.cpp:79
Result< void > BringUpIface(std::string_view name)
Definition: alloc_iproute2.cpp:41
Result< void > AddTapIface(std::string_view name)
Definition: alloc_iproute2.cpp:27
tl::expected< T, StackTraceError > Result
Definition: result_type.h:30
Result< void > IptableConfig(std::string_view iptables_path, std::string_view network, bool add)
Definition: alloc_iproute2.cpp:96
BinOp< T1, T2, Numeric, Add > add
Definition: utils.h:264