Skip to content
  • Nick Mathewson's avatar
    Parse prop171 options; refactor listener/port option code · ddc65e2b
    Nick Mathewson authored
    Proposal 171 gives us a new syntax for parsing client port options.
    You can now have as many FooPort options as you want (for Foo in
    Socks, Trans, DNS, NATD), and they can have address:port arguments,
    and you can specify the level of isolation on those ports.
    
    Additionally, this patch refactors the client port parsing logic to
    use a new type, port_cfg_t.  Previously, ports to be bound were
    half-parsed in config.c, and later re-parsed in connection.c when
    we're about to bind them.  Now, parsing a port means converting it
    into a port_cfg_t, and binding it uses only a port_cfg_t, without
    needing to parse the user-provided strings at all.
    
    We should do a related refactoring on other port types.  For
    control ports, that'll be easy enough.  For ORPort and DirPort,
    we'll want to do this when we solve proposal 118 (letting servers
    bind to and advertise multiple ports).
    
    This implements tickets 3514 and 3515.
    ddc65e2b