summaryrefslogtreecommitdiff
path: root/src/lib/net/address.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/net/address.c')
-rw-r--r--src/lib/net/address.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/net/address.c b/src/lib/net/address.c
index cf4af423a7..5a32533610 100644
--- a/src/lib/net/address.c
+++ b/src/lib/net/address.c
@@ -2114,6 +2114,18 @@ tor_addr_port_eq(const tor_addr_port_t *a,
return tor_addr_eq(&a->addr, &b->addr) && a->port == b->port;
}
+/**
+ * Copy a tor_addr_port_t from @a source to @a dest.
+ **/
+void
+tor_addr_port_copy(tor_addr_port_t *dest,
+ const tor_addr_port_t *source)
+{
+ tor_assert(dest);
+ tor_assert(source);
+ memcpy(dest, source, sizeof(tor_addr_port_t));
+}
+
/** Return true if <b>string</b> represents a valid IPv4 adddress in
* 'a.b.c.d' form.
*/