diff options
author | Martin Braun <martin.braun@ettus.com> | 2017-12-01 16:14:11 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-12-22 15:05:58 -0800 |
commit | 87dbcd9f1a5b2b464c27af56c3a91ab00f66c441 (patch) | |
tree | 62ccd5be210d94862071aecda5ec3e667b036148 /host/lib/usrp/mpmd/mpmd_xport_ctrl_udp.hpp | |
parent | a927a364c5b07387be3a849b74546b98ba84db84 (diff) | |
download | uhd-87dbcd9f1a5b2b464c27af56c3a91ab00f66c441.tar.gz uhd-87dbcd9f1a5b2b464c27af56c3a91ab00f66c441.tar.bz2 uhd-87dbcd9f1a5b2b464c27af56c3a91ab00f66c441.zip |
mpmd: Refactor MPM transport architecture, use managers
This splits up the transport code in mpmd_impl across multiple classes
to properly leverage the request_xport/commit_xport API in MPM.
Different types of transport (UDP, liberio) use their own distinct
classes, which are generated dynamically on request.
This is a true refactoring despite the large amount of changes; there
are no functional differences.
Reviewed-By: Brent Stapleton <brent.stapleton@ettus.com>
Reviewed-By: Trung Tran <trung.tran@ettus.com>
Reviewed-By: Ashish Chaudhari <ashish.chaudhari@ettus.com>
Diffstat (limited to 'host/lib/usrp/mpmd/mpmd_xport_ctrl_udp.hpp')
-rw-r--r-- | host/lib/usrp/mpmd/mpmd_xport_ctrl_udp.hpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/host/lib/usrp/mpmd/mpmd_xport_ctrl_udp.hpp b/host/lib/usrp/mpmd/mpmd_xport_ctrl_udp.hpp new file mode 100644 index 000000000..0c8c19479 --- /dev/null +++ b/host/lib/usrp/mpmd/mpmd_xport_ctrl_udp.hpp @@ -0,0 +1,46 @@ +// +// Copyright 2017 Ettus Research, a National Instruments Company +// +// SPDX-License-Identifier: GPL-3.0 +// + +#ifndef INCLUDED_MPMD_XPORT_ctrl_udp_HPP +#define INCLUDED_MPMD_XPORT_ctrl_udp_HPP + +#include "mpmd_xport_ctrl_base.hpp" +#include <uhd/types/device_addr.hpp> +#include "../device3/device3_impl.hpp" + +namespace uhd { namespace mpmd { namespace xport { + +/*! UDP transport manager + * + * Opens UDP sockets + */ +class mpmd_xport_ctrl_udp : public mpmd_xport_ctrl_base +{ +public: + mpmd_xport_ctrl_udp( + const uhd::device_addr_t& mb_args + ); + + both_xports_t make_transport( + mpmd_xport_mgr::xport_info_t& xport_info, + const usrp::device3_impl::xport_type_t xport_type, + const uhd::device_addr_t& xport_args + ); + + bool is_valid( + const mpmd_xport_mgr::xport_info_t& xport_info + ) const; + +private: + const uhd::device_addr_t _mb_args; + const uhd::dict<std::string, std::string> _recv_args; + const uhd::dict<std::string, std::string> _send_args; + const std::vector<std::string> _available_addrs; +}; + +}}} /* namespace uhd::mpmd::xport */ + +#endif /* INCLUDED_MPMD_XPORT_ctrl_udp_HPP */ |