Skip to content

Commit

Permalink
vsock_proxy: rename starter.rs
Browse files Browse the repository at this point in the history
Rename starter.rs module to proxy.rs to better reflect its purpose.

Signed-off-by: Erdem Meydanli <[email protected]>
  • Loading branch information
meerd committed Apr 9, 2024
1 parent 1670239 commit a319cda
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion vsock_proxy/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

pub mod starter;
pub mod proxy;
pub mod dns;

use std::net::IpAddr;
Expand Down
2 changes: 1 addition & 1 deletion vsock_proxy/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use clap::{App, AppSettings, Arg};
use env_logger::init;
use log::info;

use vsock_proxy::{starter::Proxy, IpAddrType, VsockProxyResult};
use vsock_proxy::{proxy::Proxy, IpAddrType, VsockProxyResult};

fn main() -> VsockProxyResult<()> {
init();
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions vsock_proxy/tests/connection_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ use std::thread;
use tempfile::NamedTempFile;
use vsock::{VsockAddr, VsockStream};

use vsock_proxy::{starter::Proxy, IpAddrType};
use vsock_proxy::{proxy::Proxy, IpAddrType};

fn vsock_connect(port: u32) -> VsockStream {
let sockaddr = VsockAddr::new(vsock_proxy::starter::VSOCK_PROXY_CID, port);
let sockaddr = VsockAddr::new(vsock_proxy::proxy::VSOCK_PROXY_CID, port);
VsockStream::connect(&sockaddr).expect("Could not connect")
}

Expand All @@ -30,7 +30,7 @@ fn test_tcp_connection() {
)
.unwrap();
let proxy = Proxy::new(
vsock_proxy::starter::VSOCK_PROXY_PORT,
vsock_proxy::proxy::VSOCK_PROXY_PORT,
&addr,
9000,
2,
Expand Down Expand Up @@ -72,7 +72,7 @@ fn test_tcp_connection() {

// Start client that connects to proxy on port 8000 vsock
let client_handle = thread::spawn(move || {
let mut stream = vsock_connect(vsock_proxy::starter::VSOCK_PROXY_PORT);
let mut stream = vsock_connect(vsock_proxy::proxy::VSOCK_PROXY_PORT);

// Write request
stream.write_all(b"client2server").expect("client write");
Expand Down

0 comments on commit a319cda

Please sign in to comment.