From ad1e0bc855cfa418f1a297c64e44a8352e80c4ee Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 13 Jul 2017 15:57:32 -0700 Subject: udp: Added option to query local address of socket --- host/include/uhd/transport/udp_zero_copy.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'host/include') diff --git a/host/include/uhd/transport/udp_zero_copy.hpp b/host/include/uhd/transport/udp_zero_copy.hpp index 851e004d7..5acd8dc56 100644 --- a/host/include/uhd/transport/udp_zero_copy.hpp +++ b/host/include/uhd/transport/udp_zero_copy.hpp @@ -68,7 +68,20 @@ public: const device_addr_t &hints = device_addr_t() ); + /*! Return the local port of the UDP connection + * + * Port is in host byte order. No funny business here. + * + * \returns Port number or 0 if port number couldn't be identified. + */ virtual uint16_t get_local_port(void) const = 0; + + /*! Return the local IP address of the UDP connection as a dotted string. + * + * \returns IP address as a string or empty string if the IP address could + * not be identified. + */ + virtual std::string get_local_addr(void) const = 0; }; }} //namespace -- cgit v1.2.3