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
25
26namespace cuttlefish {
27
28constexpr std::string_view kDefaultInterfacePrefix = "cvd";
29
30struct IfaceData {
31 std::string name;
32 uint32_t session_id;
33 uint32_t resource_id;
34};
35
41};
42
45
46// Acquires interfaces from the resource allocator daemon.
47std::optional<IfaceConfig> AllocateNetworkInterfaces();
48
49} // namespace cuttlefish
Definition: expected.h:86
Definition: cuttlefish_config.h:269
Definition: alloc_utils.cpp:23
constexpr std::string_view kDefaultInterfacePrefix
Definition: alloc.h:28
std::optional< IfaceConfig > AllocateNetworkInterfaces()
Definition: alloc.cc:69
Result< IfaceConfig > DefaultNetworkInterfaces(const CuttlefishConfig::InstanceSpecific &instance)
Definition: alloc.cc:45
Definition: alloc.h:36
IfaceData ethernet_tap
Definition: alloc.h:40
IfaceData bridged_wireless_tap
Definition: alloc.h:38
IfaceData mobile_tap
Definition: alloc.h:37
IfaceData non_bridged_wireless_tap
Definition: alloc.h:39
Definition: alloc.h:30
uint32_t session_id
Definition: alloc.h:32
std::string name
Definition: alloc.h:31
uint32_t resource_id
Definition: alloc.h:33