utils.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright (C) 2012 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. #ifndef DHCPSRV_UTILS_H
  15. #define DHCPSRV_UTILS_H
  16. #include <exceptions/exceptions.h>
  17. namespace isc {
  18. namespace dhcp {
  19. /// An exception that is thrown if a DHCPv6 protocol violation occurs while
  20. /// processing a message (e.g. a mandatory option is missing)
  21. class RFCViolation : public isc::Exception {
  22. public:
  23. /// @brief constructor
  24. ///
  25. /// @param file name of the file, where exception occurred
  26. /// @param line line of the file, where exception occurred
  27. /// @param what text description of the issue that caused exception
  28. RFCViolation(const char* file, size_t line, const char* what) :
  29. isc::Exception(file, line, what) {}
  30. };
  31. }; // namespace isc::dhcp
  32. }; // namespace isc
  33. #endif // DHCPSRV_UTILS_H