2019-09-20 18:21:54 +00:00
|
|
|
// Copyright 2019 Intel Corporation. All Rights Reserved.
|
|
|
|
//
|
|
|
|
// Portions Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
|
|
//
|
|
|
|
// Portions Copyright 2017 The Chromium OS Authors. All rights reserved.
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: (Apache-2.0 AND BSD-3-Clause)
|
|
|
|
|
2022-02-17 01:23:45 +00:00
|
|
|
use clap::{Arg, Command};
|
2020-01-21 15:16:38 +00:00
|
|
|
use vhost_user_net::start_net_backend;
|
2019-09-20 18:21:54 +00:00
|
|
|
|
|
|
|
fn main() {
|
2021-08-04 19:35:56 +00:00
|
|
|
env_logger::init();
|
|
|
|
|
2022-02-17 01:23:45 +00:00
|
|
|
let cmd_arguments = Command::new("vhost-user-net backend")
|
2023-01-06 16:45:47 +00:00
|
|
|
.version(env!("CARGO_PKG_VERSION"))
|
|
|
|
.author(env!("CARGO_PKG_AUTHORS"))
|
2019-09-20 18:21:54 +00:00
|
|
|
.about("Launch a vhost-user-net backend.")
|
|
|
|
.arg(
|
2021-12-31 23:09:17 +00:00
|
|
|
Arg::new("net-backend")
|
2020-01-20 14:28:06 +00:00
|
|
|
.long("net-backend")
|
2020-05-08 15:11:00 +00:00
|
|
|
.help(vhost_user_net::SYNTAX)
|
2022-10-04 14:52:43 +00:00
|
|
|
.num_args(1)
|
2021-08-04 14:36:47 +00:00
|
|
|
.required(true),
|
2019-09-20 18:21:54 +00:00
|
|
|
)
|
|
|
|
.get_matches();
|
|
|
|
|
2022-10-04 14:52:43 +00:00
|
|
|
let backend_command = cmd_arguments.get_one::<String>("net-backend").unwrap();
|
2020-01-21 15:16:38 +00:00
|
|
|
start_net_backend(backend_command);
|
2019-09-20 18:21:54 +00:00
|
|
|
}
|