Opened 8 years ago

Last modified 3 years ago

#6802 new enhancement

Make our config parsing less kludgy

Reported by: nickm Owned by:
Priority: Medium Milestone: Tor: unspecified
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor-client, term-project-ideas torrc configuration parsing
Cc: catalyst Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


If our only configuration types were strings, numbers, booleans, and so forth, our existing configuration parsing mechanism would be nifty. But right now, we do entirely too much with STRING, LINELIST, and worst still LINELIST_V.

We've become decent at implementing some patterns to work around this, but it would be neat to get much better.

So as first steps, I suggest that we:

  • Split the parts of the configuration file parsing that handle the abstract bits of config_format_t into their own file.
  • Turn config_type_t into an OO thing, so that it's easier to add more.
  • Teach the linelist types and the smartlist types to be a bit smarter about what they are lists of, so that every list type doesn't need special handling.
  • Make our linelist_v types have an explicit syntax for sections.
  • Implement an additional function to handle the common case of a line that has some positional arguments and some k{=v} arguments.

Child Tickets

Change History (7)

comment:1 Changed 8 years ago by nickm

Keywords: tor-client added

comment:2 Changed 8 years ago by nickm

Component: Tor ClientTor

comment:3 Changed 6 years ago by netogallo

So the first two items basically mean:

Move all functions (like config_expand_abbrev) whose first argumetn is a const config_format_t to it's own file and then make it an OO-thingy. What exactly is meant by OO-thingy (sorry, I have coding knowledge but little experience with c)?

comment:4 Changed 5 years ago by nickm

Keywords: 6s194 added

comment:5 Changed 5 years ago by nickm

Keywords: term-project-ideas added; 6s194 removed

These tickets were tagged "6s194" as ideas for possible term projects for students in MIT subject 6.S194 spring 2016. I'm retagging with term-project-ideas, so that the students can use the 6s194 tag for tickets they're actually working on.

comment:6 Changed 3 years ago by nickm

Keywords: torrc configuration parsing added
Severity: Normal

comment:7 Changed 3 years ago by catalyst

Cc: catalyst added
Note: See TracTickets for help on using tickets.