From 1d52ac4d3f67a6e3fac3602f87d00c14060068ab Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 29 Nov 2016 08:04:41 -0500 Subject: Lay down some infrastructure for bridges in the New Guard Order. This includes: * making bridge_info_t exposed but opaque * allowing guards where we don't know an identity * making it possible to learn the identity of a guard * creating a guard that lacks a node_t * remembering a guard's address and port. * Looking up a guard by address and port. * Only enforcing the rule that we need a live consensus to update the "listed" status for guards when we are not using bridges. --- src/common/address.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/common/address.c') diff --git a/src/common/address.c b/src/common/address.c index 773e688554..1bb0c077d1 100644 --- a/src/common/address.c +++ b/src/common/address.c @@ -2121,3 +2121,11 @@ tor_addr_port_new(const tor_addr_t *addr, uint16_t port) return ap; } +/** Return true iff a and b are the same address and port */ +int +tor_addr_port_eq(const tor_addr_port_t *a, + const tor_addr_port_t *b) +{ + return tor_addr_eq(&a->addr, &b->addr) && a->port == b->port; +} + -- cgit v1.2.3-54-g00ecf