naptr_35.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
  2. //
  3. // Permission to use, copy, modify, and/or distribute this software for any
  4. // purpose with or without fee is hereby granted, provided that the above
  5. // copyright notice and this permission notice appear in all copies.
  6. //
  7. // THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
  8. // REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  9. // AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  10. // INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  11. // LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  12. // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  13. // PERFORMANCE OF THIS SOFTWARE.
  14. // BEGIN_HEADER_GUARD
  15. #include <string>
  16. #include <dns/name.h>
  17. #include <dns/rdata.h>
  18. #include <util/buffer.h>
  19. // BEGIN_ISC_NAMESPACE
  20. // BEGIN_COMMON_DECLARATIONS
  21. // END_COMMON_DECLARATIONS
  22. // BEGIN_RDATA_NAMESPACE
  23. class NAPTR : public Rdata {
  24. public:
  25. // BEGIN_COMMON_MEMBERS
  26. // END_COMMON_MEMBERS
  27. // NAPTR specific methods
  28. uint16_t getOrder() const;
  29. uint16_t getPreference() const;
  30. const std::string& getFlags() const;
  31. const std::string& getServices() const;
  32. const std::string& getRegexp() const;
  33. const Name& getReplacement() const;
  34. private:
  35. /// Get a <character-string> from a string
  36. ///
  37. /// \param input_str The input string
  38. /// \param input_iterator The iterator from which to start extracting, the iterator will be updated
  39. /// to new position after the function is returned
  40. /// \return A std::string that contains the extracted <character-string>
  41. std::string getNextCharacterString(const std::string& input_str, std::string::const_iterator& input_iterator);
  42. /// Get a <character-string> from a input buffer
  43. ///
  44. /// \param buffer The input buffer
  45. /// \param len The input buffer total length
  46. /// \return A std::string that contains the extracted <character-string>
  47. std::string getNextCharacterString(util::InputBuffer& buffer, size_t len);
  48. /// Skip the left whitespaces of the input string
  49. ///
  50. /// \param input_str The input string
  51. /// \param input_iterator From which the skipping started
  52. void skipLeftSpaces(const std::string& input_str, std::string::const_iterator& input_iterator);
  53. uint16_t order_;
  54. uint16_t preference_;
  55. std::string flags_;
  56. std::string services_;
  57. std::string regexp_;
  58. Name replacement_;
  59. };
  60. // END_RDATA_NAMESPACE
  61. // END_ISC_NAMESPACE
  62. // END_HEADER_GUARD
  63. // Local Variables:
  64. // mode: c++
  65. // End: