Skip to content

Commit 2d58a54

Browse files
committed
Remove all reexport
Removed these reexport: * `rtnetlink::packet` * `rtnetlink::proto` * `rtnetlink::sys` Signed-off-by: Gris Ge <[email protected]>
1 parent ebce2d8 commit 2d58a54

37 files changed

+210
-237
lines changed

Cargo.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ smol_socket = ["netlink-proto/smol_socket", "async-global-executor"]
2121
futures = "0.3.11"
2222
log = "0.4.8"
2323
thiserror = "1"
24-
netlink-packet-route = { version = "0.13.0" }
25-
netlink-proto = { default-features = false, version = "0.10" }
24+
netlink-sys = { version = "0.8" }
25+
netlink-packet-utils = { version = "0.5" }
26+
netlink-packet-route = { version = "0.15" }
27+
netlink-packet-core = { version = "0.5" }
28+
netlink-proto = { default-features = false, version = "0.11" }
2629
nix = { version = "0.26.1", default-features = false, features = ["fs", "mount", "sched", "signal"] }
2730
tokio = { version = "1.0.1", features = ["rt"], optional = true}
2831
async-global-executor = { version = "2.0.2", optional = true }

examples/get_links.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
// SPDX-License-Identifier: MIT
22

33
use futures::stream::TryStreamExt;
4-
use rtnetlink::{
5-
new_connection,
6-
packet::rtnl::{
7-
constants::{AF_BRIDGE, RTEXT_FILTER_BRVLAN},
8-
link::nlas::Nla,
9-
},
10-
Error, Handle,
4+
use netlink_packet_route::{
5+
constants::{AF_BRIDGE, RTEXT_FILTER_BRVLAN},
6+
link::nlas::Nla,
117
};
8+
use rtnetlink::{new_connection, Error, Handle};
129

1310
#[tokio::main]
1411
async fn main() -> Result<(), ()> {

examples/get_links_async.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
// SPDX-License-Identifier: MIT
22

33
use futures::stream::TryStreamExt;
4-
use rtnetlink::{
5-
new_connection,
6-
packet::rtnl::{
7-
constants::{AF_BRIDGE, RTEXT_FILTER_BRVLAN},
8-
link::nlas::Nla,
9-
},
10-
Error, Handle,
4+
use netlink_packet_route::{
5+
constants::{AF_BRIDGE, RTEXT_FILTER_BRVLAN},
6+
link::nlas::Nla,
117
};
8+
use rtnetlink::{new_connection, Error, Handle};
129

1310
#[async_std::main]
1411
async fn main() -> Result<(), ()> {

examples/get_links_thread_builder.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
// SPDX-License-Identifier: MIT
22

33
use futures::stream::TryStreamExt;
4-
5-
use rtnetlink::{
6-
new_connection,
7-
packet::rtnl::{
8-
constants::{AF_BRIDGE, RTEXT_FILTER_BRVLAN},
9-
link::nlas::Nla,
10-
},
11-
Error, Handle,
12-
};
4+
use netlink_packet_route::{link::nlas::Nla, AF_BRIDGE, RTEXT_FILTER_BRVLAN};
5+
use rtnetlink::{new_connection, Error, Handle};
136

147
async fn do_it(rt: &tokio::runtime::Runtime) -> Result<(), ()> {
158
env_logger::init();

examples/ip_monitor.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
use futures::stream::StreamExt;
44

55
use netlink_packet_route::constants::*;
6-
use rtnetlink::{
7-
new_connection,
8-
sys::{AsyncSocket, SocketAddr},
9-
};
6+
use netlink_sys::{AsyncSocket, SocketAddr};
7+
use rtnetlink::new_connection;
108

119
const fn nl_mgrp(group: u32) -> u32 {
1210
if group > 31 {

examples/listen.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44
//! changes, listens for said changes and prints the received messages.
55
66
use futures::stream::StreamExt;
7-
7+
use netlink_sys::{AsyncSocket, SocketAddr};
88
use rtnetlink::{
99
constants::{RTMGRP_IPV4_ROUTE, RTMGRP_IPV6_ROUTE},
1010
new_connection,
11-
sys::{AsyncSocket, SocketAddr},
1211
};
1312

1413
#[tokio::main]

examples/property_altname.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
// SPDX-License-Identifier: MIT
22

33
use futures::stream::TryStreamExt;
4-
use rtnetlink::{
5-
new_connection,
6-
packet::{
7-
rtnl::link::nlas::{Nla, Prop},
8-
LinkMessage,
9-
},
10-
Error, Handle,
4+
use netlink_packet_route::{
5+
link::nlas::{Nla, Prop},
6+
LinkMessage,
117
};
8+
use rtnetlink::{new_connection, Error, Handle};
129
use std::env;
1310

1411
#[tokio::main]

src/addr/add.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@
33
use futures::stream::StreamExt;
44
use std::net::{IpAddr, Ipv4Addr};
55

6-
use netlink_packet_route::{
7-
nlas::address::Nla, AddressMessage, NetlinkMessage, RtnlMessage, AF_INET,
8-
AF_INET6, NLM_F_ACK, NLM_F_CREATE, NLM_F_EXCL, NLM_F_REPLACE,
6+
use netlink_packet_core::{
7+
NetlinkMessage, NLM_F_ACK, NLM_F_CREATE, NLM_F_EXCL, NLM_F_REPLACE,
98
NLM_F_REQUEST,
109
};
1110

11+
use netlink_packet_route::{
12+
nlas::address::Nla, AddressMessage, RtnlMessage, AF_INET,
13+
AF_INET6,
14+
};
15+
1216
use crate::{try_nl, Error, Handle};
1317

1418
/// A request to create a new address. This is equivalent to the `ip address

src/addr/del.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
// SPDX-License-Identifier: MIT
22

33
use futures::stream::StreamExt;
4+
use netlink_packet_core::{NetlinkMessage, NLM_F_ACK, NLM_F_REQUEST};
5+
use netlink_packet_route::{AddressMessage, RtnlMessage};
46

5-
use crate::{
6-
packet::{
7-
AddressMessage, NetlinkMessage, RtnlMessage, NLM_F_ACK, NLM_F_REQUEST,
8-
},
9-
try_nl, Error, Handle,
10-
};
7+
use crate::{try_nl, Error, Handle};
118

129
pub struct AddressDelRequest {
1310
handle: Handle,

src/addr/get.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ use futures::{
77
};
88
use std::net::IpAddr;
99

10-
use netlink_packet_route::{
11-
nlas::address::Nla, AddressMessage, NetlinkMessage, RtnlMessage,
12-
NLM_F_DUMP, NLM_F_REQUEST,
13-
};
10+
use netlink_packet_core::{NetlinkMessage, NLM_F_DUMP, NLM_F_REQUEST};
11+
use netlink_packet_route::{nlas::address::Nla, AddressMessage, RtnlMessage};
1412

1513
use crate::{try_rtnl, Error, Handle};
1614

0 commit comments

Comments
 (0)