Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#749 closed enhancement (complete)

Create C++ utility library

Reported by: stephen Owned by: zzchen_pku
Priority: low Milestone: Sprint-20110503
Component: Unclassified Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DNS Feature Depending on Ticket:
Estimated Difficulty: 4.0 Add Hours to Ticket: 0
Total Hours: 5.0 Internal?: no

Description

There are a number of functions/classes that are in individual libraries within BIND-10 but are in fact much more general. The idea here is to move them to a common "utilities" library. Examples include:

  • src/lib/log/strutil.*
  • src/lib/asiolink/asiolink_utilities.h

Note that the various makefiles will need to be updated to reference the new libraries.

Subtickets

Change History (18)

comment:1 Changed 50 years ago by zzchen_pku

  • Add Hours to Ticket changed from 0.0 to 5.0
  • Total Hours changed from 0.0 to 5.0

comment:1 Changed 9 years ago by zzchen_pku

  • Owner set to zzchen_pku
  • Status changed from new to assigned

comment:2 Changed 9 years ago by zzchen_pku

According to the discussion held on bind10-dev, I identified the things to move firstly, then wait for #366.

asio/asiolink_utilities.h
asio/qid_gen.h               # merge with nsas/random_number_generator.h
dns/dnssectime.h
dns/buffer.h
dns/util
log/filename.h
log/strutil.h
nsas/locks.h
nsas/lru_list.h
nsas/random_number_generator.h
xfr/fd_share.h

I'd like someone to have a look at the list before the next step.

comment:3 follow-up: Changed 9 years ago by vorner

I had a look at the list and it seems to me it makes sense. fd_share.h is, in fact, the thing moved to utils library in #366, the others look generally useful as well.

comment:4 in reply to: ↑ 3 Changed 9 years ago by zzchen_pku

Replying to vorner:

I had a look at the list and it seems to me it makes sense. fd_share.h is, in fact, the thing moved to utils library in #366, the others look generally useful as well.

Thank you:)
I'll continue the following work.

comment:5 Changed 9 years ago by shane

  • Estimated Difficulty changed from 0.0 to 4

comment:6 Changed 9 years ago by vorner

#366 is in master, so there should be no more collisions with it.

comment:7 Changed 9 years ago by zzchen_pku

  • Owner changed from zzchen_pku to UnAssigned
  • Status changed from assigned to reviewing

trac749 is ready for review.
I have moved files listed in http://bind10.isc.org/ticket/749#comment:2 to src/lib/util, skipped 'xfr/fd_share.h', since it has already been moved into utility library in master.

comment:8 Changed 9 years ago by jelte

  • Owner changed from UnAssigned to jelte

comment:9 follow-up: Changed 9 years ago by jelte

  • Owner changed from jelte to zzchen_pku

umz, was branch trac749 created from a branch point where src/lib/util did not exist yet? I don't see src/lib/util in there at all...

comment:10 in reply to: ↑ 9 Changed 9 years ago by zzchen_pku

  • Owner changed from zzchen_pku to jelte

Replying to jelte:

umz, was branch trac749 created from a branch point where src/lib/util did not exist yet?

Ha, yes ,you are right:)
I have committed the directory, please check.

comment:11 follow-up: Changed 9 years ago by jelte

  • Owner changed from jelte to zzchen_pku

I had to make some more additions to make it compile, see commit f5bcf535de7b23fd48061b9ee37580e2ac761f16

The information in the README in util/ is now untrue...

I'm not sure I consider buffer.h specifically io-related, and personally I would have put it in util/ directly, one the same level as strutil.[cc|h] (in fact, I also wonder if those readUint and writeUint functions should be considered io)

I also wouldn't consider sha1 and baseXXX to be 'compat', but even if we do, it seems sha1 does not have namespace directives.

Namespace of util/locks.h is also inconsistent with the rest (having that extra namespace locks is probably fine, but it should probably fall under isc/util as well)

Same goes for strutil.h

comment:12 in reply to: ↑ 11 ; follow-up: Changed 9 years ago by zzchen_pku

  • Owner changed from zzchen_pku to jelte

Replying to jelte:

The information in the README in util/ is now untrue...

Removed, may be we need a new readme file later.

I'm not sure I consider buffer.h specifically io-related, and personally I would have put it in util/ directly, one the same level as strutil.[cc|h] (in fact, I also wonder if those readUint and writeUint functions should be considered io)

Moved them to util/ directory.

I also wouldn't consider sha1 and baseXXX to be 'compat', but even if we do, it seems sha1 does not have namespace directives.

Renamed to 'coder', is it make sense to you, or you have a better suggestion?

Namespace of util/locks.h is also inconsistent with the rest (having that extra namespace locks is probably fine, but it should probably fall under isc/util as well)

Same goes for strutil.h

Done. Thanks.

comment:13 in reply to: ↑ 12 ; follow-up: Changed 9 years ago by jelte

  • Owner changed from jelte to zzchen_pku

Replying to zzchen_pku:

I also wouldn't consider sha1 and baseXXX to be 'compat', but even if we do, it seems sha1 does not have namespace directives.

Renamed to 'coder', is it make sense to you, or you have a better suggestion?

Sorry to keep bothering you :)

It was suggested on jabber to make the sha1 fall under 'hash' and the base encodings under 'encode', which i think is a nice suggestion.

comment:14 in reply to: ↑ 13 Changed 9 years ago by zzchen_pku

  • Owner changed from zzchen_pku to jelte

Replying to jelte:

Sorry to keep bothering you :)

It was suggested on jabber to make the sha1 fall under 'hash' and the base encodings under 'encode', which i think is a nice suggestion.

Don't worry:) Updated, please check.

comment:15 Changed 9 years ago by jelte

  • Owner changed from jelte to zzchen_pku

looks good :)

comment:16 Changed 9 years ago by zzchen_pku

  • Resolution set to complete
  • Status changed from reviewing to closed

Merged, closing it.

comment:17 Changed 9 years ago by zzchen_pku

  • Add Hours to Ticket changed from 0 to 5
  • Defect Severity set to N/A
  • Sub-Project set to DNS
Note: See TracTickets for help on using tickets.