rrset_collection_python_inc.cc 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. namespace {
  2. // Modifications
  3. // - libdns++ => isc.dns, libdatasrc => isc.datasrc
  4. // - note about the direct construction.
  5. // - add note about iteration
  6. const char* const RRsetCollectionBase_doc = "\
  7. Generic class to represent a set of RRsets.\n\
  8. \n\
  9. This is a generic container and the stored set of RRsets does not\n\
  10. necessarily form a valid zone (e.g. there doesn't necessarily have to\n\
  11. be an SOA at the \"origin\"). Instead, it will be used to represent a\n\
  12. single zone for the purpose of zone loading/checking. It provides a\n\
  13. simple find() method to find an RRset for the given name and type (and\n\
  14. maybe class) and a way to iterate over all RRsets.\n\
  15. \n\
  16. Note: in the initial version, iteration is not yet supported.\n\
  17. \n\
  18. See RRsetCollection for a simple isc.dns implementation. Other modules\n\
  19. such as isc.datasrc will have another implementation.\n\
  20. \n\
  21. This base class cannot be directly instantiated. Such an attempt will\n\
  22. result in a TypeError exception.\n\
  23. \n\
  24. ";
  25. // Modifications
  26. // - ConstRRset => RRset
  27. // - NULL => None
  28. // - added types of params
  29. const char* const RRsetCollectionBase_find_doc = "\
  30. find(name, rrclass, rrtype) -> isc.dns.RRset\n\
  31. \n\
  32. Find a matching RRset in the collection.\n\
  33. \n\
  34. Returns the RRset in the collection that exactly matches the given\n\
  35. name, rrclass and rrtype. If no matching RRset is found, None is\n\
  36. returned.\n\
  37. \n\
  38. This method's implementations currently are not specified to handle\n\
  39. RRTypes such as RRSIG and NSEC3. This interface may be refined to\n\
  40. clarify this point in the future, and perhaps, provide additional API\n\
  41. for these RRType.\n\
  42. \n\
  43. As for RRSIG, there are some fundamental open questions. For example,\n\
  44. it's not clear whether we want to return all RRSIGs of the given name\n\
  45. covering any RR types (in which case, we need to figure out how), or\n\
  46. we need to extend the interface so we can specify the covered type. A\n\
  47. specific derived implementation may return something if type RRSIG is\n\
  48. specified, but this is not specified here at the base class level. So,\n\
  49. for RRSIGs the behavior should be assumed as undefined.\n\
  50. \n\
  51. As for NSEC3, it's not clear whether owner names (which included\n\
  52. hashed labels) are the best choice of search key, because in many\n\
  53. cases, what the application wants to find is an NSEC3 that has the\n\
  54. hash of some particular \"normal\" domain names. Also, if the\n\
  55. underlying implementation encapsulates a single zone, NSEC3 records\n\
  56. conceptually belong to a separate name space, which may cause\n\
  57. implementation difficulty.\n\
  58. \n\
  59. Behavior with meta types such as ANY and AXFR are also undefined. A\n\
  60. specific implementation may return something for these. But, unlike\n\
  61. the case of RRSIGs, these types of RRsets are not expected to be added\n\
  62. to any implementation of collection in the first place (by the\n\
  63. definition of \"meta types\"), so querying for such types is\n\
  64. basically an invalid operation. The API doesn't require\n\
  65. implementations to check this condition and reject it, so the behavior\n\
  66. is undefined. This interface will not be refined in future versions\n\
  67. for these meta types.\n\
  68. \n\
  69. Exceptions:\n\
  70. RRsetCollectionError if find() results in some implementation-\n\
  71. specific error.\n\
  72. \n\
  73. Parameters:\n\
  74. name (isc.dns.Name) The name of the RRset to search for.\n\
  75. rrtype (isc.dns.RRType) The type of the RRset to search for.\n\
  76. rrclass (isc.dns.RRClass) The class of the RRset to search for.\n\
  77. \n\
  78. Return Value(s): The RRset if found, None otherwise.\n\
  79. ";
  80. // Modifications
  81. // - libdns++ => isc.dns
  82. // - remove STL
  83. // - MasterLoaderError => IscException
  84. // - added types of params
  85. // - input_stream => input, stream => bytes
  86. const char* const RRsetCollection_doc = "\
  87. Derived class implementation of RRsetCollectionBase for isc.dns module.\n\
  88. \n\
  89. RRsetCollection()\n\
  90. \n\
  91. Constructor.\n\
  92. \n\
  93. This constructor creates an empty collection without any data in\n\
  94. it. RRsets can be added to the collection with the add_rrset()\n\
  95. method.\n\
  96. \n\
  97. RRsetCollection(filename, origin, rrclass)\n\
  98. \n\
  99. Constructor.\n\
  100. \n\
  101. The origin and rrclass arguments are required for the zone\n\
  102. loading, but RRsetCollection itself does not do any validation,\n\
  103. and the collection of RRsets does not have to form a valid zone.\n\
  104. The constructor throws IscException if there is an error\n\
  105. during loading.\n\
  106. \n\
  107. Parameters:\n\
  108. filename (str) Name of a file containing a collection of RRs in the\n\
  109. master file format (which may or may not form a valid\n\
  110. zone).\n\
  111. origin (isc.dns.Name) The zone origin.\n\
  112. rrclass (isc.dns.RRClass) The zone class.\n\
  113. \n\
  114. RRsetCollection(input, origin, rrclass)\n\
  115. \n\
  116. Constructor.\n\
  117. \n\
  118. This constructor is similar to the previous one, but instead of\n\
  119. taking a filename to load a zone from, it takes a bytes object,\n\
  120. representing the zone contents in text.\n\
  121. The constructor throws IscException if there is an error\n\
  122. during loading.\n\
  123. \n\
  124. Parameters:\n\
  125. input (bytes) Textual representation of the zone.\n\
  126. origin (isc.dns.Name) The zone origin.\n\
  127. rrclass (isc.dns.RRClass) The zone class.\n\
  128. \n\
  129. ";
  130. // Modifications
  131. // - void => None
  132. // - InvalidParameter => ValueError
  133. // - remove ownership related points (doesn't apply here)
  134. const char* const RRsetCollection_addRRset_doc = "\
  135. add_rrset(rrset) -> None\n\
  136. \n\
  137. Add an RRset to the collection.\n\
  138. \n\
  139. Does not do any validation whether rrset belongs to a particular zone\n\
  140. or not.\n\
  141. \n\
  142. It throws a ValueError exception if an rrset with the same\n\
  143. class, type and name already exists.\n\
  144. \n\
  145. ";
  146. // Modifications
  147. // - ConstRRset => RRset
  148. const char* const RRsetCollection_find_doc = "\
  149. find(name, rrclass, rrtype) -> isc.dns.RRset\n\
  150. \n\
  151. Find a matching RRset in the collection.\n\
  152. \n\
  153. Returns the RRset in the collection that exactly matches the given\n\
  154. name, rrclass and rrtype. If no matching RRset is found, None is\n\
  155. returned.\n\
  156. \n\
  157. Parameters:\n\
  158. name The name of the RRset to search for.\n\
  159. rrclass The class of the RRset to search for.\n\
  160. rrtype The type of the RRset to search for.\n\
  161. \n\
  162. Return Value(s): The RRset if found, None otherwise.\n\
  163. ";
  164. // Modifications
  165. // // - true/false => True/False
  166. const char* const RRsetCollection_removeRRset_doc = "\
  167. remove_rrset(name, rrclass, rrtype) -> bool\n\
  168. \n\
  169. Remove an RRset from the collection.\n\
  170. \n\
  171. RRset(s) matching the name, rrclass and rrtype are removed from the\n\
  172. collection.\n\
  173. \n\
  174. True if a matching RRset was deleted, False if no such RRset exists.\n\
  175. \n\
  176. ";
  177. } // unnamed namespace