Android-cuttlefish cvd tool
alloc.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#pragma once
17
18#include <stdint.h>
19
20#include <optional>
21#include <string>
22
23#include "absl/strings/string_view.h"
24
27
28namespace cuttlefish {
29
30constexpr absl::string_view kDefaultInterfacePrefix = "cvd";
31
32struct IfaceData {
33 std::string name;
34 uint32_t session_id;
35 uint32_t resource_id;
36};
37
43};
44
47
48// Acquires interfaces from the resource allocator daemon.
49std::optional<IfaceConfig> AllocateNetworkInterfaces();
50
51} // namespace cuttlefish
Definition: cuttlefish_config.h:264
Definition: alloc_driver.h:21
std::optional< IfaceConfig > AllocateNetworkInterfaces()
constexpr absl::string_view kDefaultInterfacePrefix
Definition: alloc.h:30
Result< IfaceConfig > DefaultNetworkInterfaces(const CuttlefishConfig::InstanceSpecific &instance)
Definition: alloc.cc:43
tl::expected< T, StackTraceError< E > > Result
Definition: result_type.h:30
Definition: alloc.h:38
IfaceData ethernet_tap
Definition: alloc.h:42
IfaceData bridged_wireless_tap
Definition: alloc.h:40
IfaceData mobile_tap
Definition: alloc.h:39
IfaceData non_bridged_wireless_tap
Definition: alloc.h:41
Definition: alloc.h:32
uint32_t session_id
Definition: alloc.h:34
std::string name
Definition: alloc.h:33
uint32_t resource_id
Definition: alloc.h:35