aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-07-13 15:57:32 -0700
committerMartin Braun <martin.braun@ettus.com>2017-10-04 14:58:41 -0700
commitad1e0bc855cfa418f1a297c64e44a8352e80c4ee (patch)
tree94872818648329f110d604caf48f216eafd7987a /host/include
parentac6d27348d4e01035183423a031445808c0f6b90 (diff)
downloaduhd-ad1e0bc855cfa418f1a297c64e44a8352e80c4ee.tar.gz
uhd-ad1e0bc855cfa418f1a297c64e44a8352e80c4ee.tar.bz2
uhd-ad1e0bc855cfa418f1a297c64e44a8352e80c4ee.zip
udp: Added option to query local address of socket
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/transport/udp_zero_copy.hpp13
1 files changed, 13 insertions, 0 deletions
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