dhcp6_log.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. // Copyright (C) 2012-2015 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 DHCP6_LOG_H
  15. #define DHCP6_LOG_H
  16. #include <dhcp6/dhcp6_messages.h>
  17. #include <log/logger_support.h>
  18. #include <log/macros.h>
  19. namespace isc {
  20. namespace dhcp {
  21. /// @name Constants defining debug levels for logging in DHCPv6 server.
  22. //@{
  23. /// @brief Debug level used to log information during server startup.
  24. const int DBG_DHCP6_START = DBGLVL_START_SHUT;
  25. /// @brief Debug level used to log information during server shutdown.
  26. const int DBG_DHCP6_SHUT = DBGLVL_START_SHUT;
  27. /// @brief Debug level used to log receiving commands.
  28. const int DBG_DHCP6_COMMAND = DBGLVL_COMMAND;
  29. /// @brief Debug level used to trace basic operations within the code.
  30. const int DBG_DHCP6_BASIC = DBGLVL_TRACE_BASIC;
  31. /// @brief Debug level used to trace hook related operations
  32. const int DBG_DHCP6_HOOKS = DBGLVL_TRACE_BASIC;
  33. /// @brief Debug level used to log the traces with some basic data.
  34. ///
  35. /// The basic data includes summary information, e.g. summary of the
  36. /// information returned by a particular function. It may also include
  37. /// more detailed information in cases when it is warranted and the
  38. /// extraction of the data doesn't impact the server's performance
  39. /// significantly.
  40. const int DBG_DHCP6_BASIC_DATA = DBGLVL_TRACE_BASIC_DATA;
  41. /// @brief Debug level used to trace detailed errors.
  42. ///
  43. /// Trace detailed operations, including errors raised when processing invalid
  44. /// packets. (These are not logged at severities of WARN or higher for fear
  45. /// that a set of deliberately invalid packets set to the server could overwhelm
  46. /// the logging.)
  47. const int DBG_DHCP6_DETAIL = DBGLVL_TRACE_DETAIL;
  48. /// @brief This level is used to log the contents of packets received and sent.
  49. const int DBG_DHCP6_DETAIL_DATA = DBGLVL_TRACE_DETAIL_DATA;
  50. //@}
  51. /// @name Constants holding names of loggers for the DHCPv6 server.
  52. //@{
  53. /// @brief Defines the name of the root level (default) logger.
  54. extern const char* DHCP6_ROOT_LOGGER_NAME;
  55. /// @brief Name of the base logger for DHCPv6 server.
  56. extern const char* DHCP6_APP_LOGGER_NAME;
  57. /// @brief Name of the logger for rejected packets.
  58. extern const char* DHCP6_BAD_PACKET_LOGGER_NAME;
  59. /// @brief Name of the logger for processed packets.
  60. extern const char* DHCP6_PACKET_LOGGER_NAME;
  61. /// @brief Name of the logger for options parser.
  62. extern const char* DHCP6_OPTIONS_LOGGER_NAME;
  63. /// @brief Name of the logger for hostname or FQDN processing.
  64. extern const char* DHCP6_DDNS_LOGGER_NAME;
  65. /// @brief Name of the logger for lease allocation logic.
  66. extern const char* DHCP6_LEASE_LOGGER_NAME;
  67. //@}
  68. /// @name Loggers used by the DHCPv6 server
  69. //@{
  70. /// @brief Base logger for DHCPv6 server.
  71. extern isc::log::Logger dhcp6_logger;
  72. /// @brief Logger for rejected packets.
  73. ///
  74. /// Here "bad packets" are packets that are either dropped (i.e malformed,
  75. /// unsupported types) or packets that are rejected for logical reasons.
  76. extern isc::log::Logger bad_packet6_logger;
  77. /// @brief Logger for processed packets.
  78. ///
  79. /// This logger is used to issue log messages related to the reception and
  80. /// sending DHCP packets.
  81. extern isc::log::Logger packet6_logger;
  82. /// @brief Logger for options parser.
  83. ///
  84. /// This logger is used to issue log messages related to processing of the
  85. /// DHCP options
  86. extern isc::log::Logger options6_logger;
  87. /// @brief Logger for Hostname or FQDN processing.
  88. ///
  89. /// This logger is used to issue log messages related to processing the
  90. /// hostnames, FQDNs and sending name change requests to D2.
  91. extern isc::log::Logger ddns6_logger;
  92. /// @brief Logger for lease allocation logic.
  93. ///
  94. /// This logger is used to issue log messages related to lease allocation.
  95. extern isc::log::Logger lease6_logger;
  96. //@}
  97. } // namespace dhcp6
  98. } // namespace isc
  99. #endif // DHCP6_LOG_H