radius_schema.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // Copyright (C) 2015-2016 Internet Systems Consortium, Inc. ("ISC")
  2. //
  3. // This Source Code Form is subject to the terms of the Mozilla Public
  4. // License, v. 2.0. If a copy of the MPL was not distributed with this
  5. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  6. #ifndef TEST_RADIUS_SCHEMA_H
  7. #define TEST_RADIUS_SCHEMA_H
  8. #include <config.h>
  9. #include <dhcpsrv/host.h>
  10. #include <dhcpsrv/testutils/schema.h>
  11. #include <string>
  12. namespace isc {
  13. namespace dhcp {
  14. namespace test {
  15. extern const char* RADIUS_VALID_TYPE;
  16. /// Return valid connection string
  17. ///
  18. /// @return valid Radius connection string.
  19. std::string validRadiusConnectionString();
  20. /// @brief Clear everything from the database
  21. ///
  22. /// Submits the current schema drop script:
  23. ///
  24. /// <TEST_ADMIN_SCRIPTS_DIR>/mysql/dhcpdb_drop.mysql
  25. ///
  26. /// to the unit test Radius database. If the script fails, the invoking test
  27. /// will fail. The output of stderr is suppressed unless the parameter,
  28. /// show_err is true.
  29. ///
  30. /// @param show_err flag which governs whether or not stderr is suppressed.
  31. void destroyRadiusSchema(bool show_err = false);
  32. /// @brief Create the Radius Schema
  33. ///
  34. /// Submits the current schema creation script:
  35. ///
  36. /// <TEST_ADMIN_SCRIPTS_DIR>/mysql/dhcpdb_create.mysql
  37. ///
  38. /// to the unit test Radius database. If the script fails, the invoking test
  39. /// will fail. The output of stderr is suppressed unless the parameter,
  40. /// show_err is true.
  41. ///
  42. /// @param show_err flag which governs whether or not stderr is suppressed.
  43. void createRadiusSchema(bool show_err = false);
  44. void freeradiusAdd(const HostPtr& host);
  45. bool freeradiusDel(const SubnetID& subnet_id, const asiolink::IOAddress& addr);
  46. bool freeradiusDel4(const SubnetID& subnet_id,
  47. const Host::IdentifierType& identifier_type,
  48. const uint8_t* identifier_begin, const size_t identifier_len);
  49. bool freeradiusDel6(const SubnetID& subnet_id,
  50. const Host::IdentifierType& identifier_type,
  51. const uint8_t* identifier_begin, const size_t identifier_len);
  52. };
  53. };
  54. };
  55. #endif