Skip to content

Commit 53f4254

Browse files
authored
update for dendite api (#35)
1 parent ffa2365 commit 53f4254

File tree

10 files changed

+1157
-793
lines changed

10 files changed

+1157
-793
lines changed

Cargo.lock

Lines changed: 1143 additions & 780 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
members = [
44
"adm",
5-
"common",
5+
"lldpd-common",
66
"lldpd-client",
77
"lldpd",
88
"protocol",
@@ -15,11 +15,11 @@ resolver = "2"
1515

1616
# intra-package dependencies
1717
lldpd-client = { path = "lldpd-client" }
18+
lldpd-common = { path = "lldpd-common" }
1819
protocol = { path = "protocol" }
19-
common = { path = "common" }
2020

2121
# oxide dependencies from github
22-
dpd-client = { git = "https://github.com/oxidecomputer/dendrite"}
22+
dpd-client = { git = "https://github.com/oxidecomputer/dendrite", branch = "main" }
2323

2424
# public dependencies from crates.io
2525
anyhow = "1.0"

lldpd-client/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ description = "Client library for the Oxide LLDP daemon"
66

77
[dependencies]
88
chrono.workspace = true
9-
common.workspace = true
109
futures.workspace = true
10+
lldpd-common.workspace = true
1111
protocol.workspace = true
1212
progenitor.workspace = true
1313
reqwest.workspace = true

lldpd-client/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::fmt;
1010

1111
/// Return the default port on which the `lldpd` API server listens for clients.
1212
pub const fn default_port() -> u16 {
13-
::common::DEFAULT_LLDPD_PORT
13+
::lldpd_common::DEFAULT_LLDPD_PORT
1414
}
1515

1616
// Automatically generate the client bindings using Progenitor.

common/Cargo.toml renamed to lldpd-common/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "common"
2+
name = "lldpd-common"
33
version = "0.1.0"
44
authors = ["Nils Nieuwejaar <nils@oxide.computer>"]
55
edition = "2021"
File renamed without changes.

lldpd/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ smf = [ "dep:smf-rs" ]
1111
[dependencies]
1212
anyhow.workspace = true
1313
chrono.workspace = true
14-
common.workspace = true
15-
protocol.workspace = true
1614
dpd-client.workspace = true
1715
dropshot.workspace = true
1816
http.workspace = true
17+
lldpd-common.workspace = true
18+
protocol.workspace = true
1919
signal-hook.workspace = true
2020
serde.workspace = true
2121
schemars.workspace = true

lldpd/src/api_server.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,11 +848,12 @@ pub async fn api_server_manager(
848848
// We always listen on localhost
849849
config_addrs.push(SocketAddr::new(
850850
IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)),
851-
common::DEFAULT_LLDPD_PORT,
851+
lldpd_common::DEFAULT_LLDPD_PORT,
852852
));
853853
// Get the list of all the addresses we should be listening on,
854854
// and compare it to the list we currently are listening on.
855-
let (add, remove) = common::purge_common(&config_addrs, &active_addrs);
855+
let (add, remove) =
856+
lldpd_common::purge_common(&config_addrs, &active_addrs);
856857

857858
for addr in remove {
858859
let hdl = active.remove(&addr).unwrap();

lldpd/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ pub(crate) struct Opt {
103103
about = "log format",
104104
help = "format logs for 'human' or 'json' consumption"
105105
)]
106-
log_format: common::LogFormat,
106+
log_format: lldpd_common::LogFormat,
107107

108108
#[structopt(long, help = "run without dpd")]
109109
#[cfg(feature = "dendrite")]
@@ -199,7 +199,7 @@ fn get_switchinfo(opts: &Opt) -> SwitchInfo {
199199
}
200200

201201
async fn run_lldpd(opts: Opt) -> LldpdResult<()> {
202-
let log = common::log_init("lldpd", &opts.log_file, opts.log_format)?;
202+
let log = lldpd_common::log_init("lldpd", &opts.log_file, opts.log_format)?;
203203

204204
let switchinfo = get_switchinfo(&opts);
205205
println!("switchinfo: {switchinfo:#?}");

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# We choose a specific toolchain (rather than "stable") for repeatability. The
33
# intent is to keep this up-to-date with recently-released stable Rust.
44

5-
channel = "1.84.0"
5+
channel = "1.87.0"
66
profile = "default"

0 commit comments

Comments
 (0)