Skip to main content

mptcp_pm/address/
get.rs

1// SPDX-License-Identifier: MIT
2
3use futures::TryStream;
4use netlink_packet_generic::GenlMessage;
5
6use crate::{
7    mptcp_execute, MptcpPathManagerError, MptcpPathManagerHandle,
8    MptcpPathManagerMessage,
9};
10
11pub struct MptcpPathManagerAddressGetRequest {
12    handle: MptcpPathManagerHandle,
13}
14
15impl MptcpPathManagerAddressGetRequest {
16    pub(crate) fn new(handle: MptcpPathManagerHandle) -> Self {
17        MptcpPathManagerAddressGetRequest { handle }
18    }
19
20    pub async fn execute(
21        self,
22    ) -> impl TryStream<
23        Ok = GenlMessage<MptcpPathManagerMessage>,
24        Error = MptcpPathManagerError,
25    > {
26        let MptcpPathManagerAddressGetRequest { mut handle } = self;
27
28        let mptcp_msg = MptcpPathManagerMessage::new_address_get();
29        mptcp_execute(&mut handle, mptcp_msg).await
30    }
31}