Opened 3 years ago

#6778 enhancement new

Provide dns Message and EDNSMessage constructors which accept FlagConstants and ValueConstants

Reported by: rwall Owned by:
Priority: normal Milestone:
Component: names Keywords:
Cc: Branch:


In ticket:5675#comment:16 exarkun wrote:

  1. Earlier you mentioned an idea about improving the handling of these numerous flags. I think that's a good idea to pursue. Consider this idea (not necessarily for this ticket, since making these APIs private means we have plenty of time to improve them with follow-up work) - __init__ should accept a FlagConstant collapsing as many of these flags as possible (looks like there are 8 parameters that would all combine into 1) into a single value. We could also think about whether opCode, rCode, and ednsVersion merit more special handling (perhaps a Values constant instead of int) and For compatibility, _EDNSMessage can also:
  1. provide an alternate constructor with a signature more like its current __init__ signature - this would be an API more like a drop-in replacement for Message.__init__. This can also include whatever extra safety checks seem useful to help developers avoid subtle mistakes (though hopefully we can also encourage them to switch to the nicer API).

Change History (0)

Note: See TracTickets for help on using tickets.