AuthorizedPasswords.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* vim: set expandtab ts=4 sw=4: */
  2. /*
  3. * You may redistribute this program and/or modify it under the terms of
  4. * the GNU General Public License as published by the Free Software Foundation,
  5. * either version 3 of the License, or (at your option) any later version.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. * You should have received a copy of the GNU General Public License
  13. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. #ifndef AuthorizedPasswords_H
  16. #define AuthorizedPasswords_H
  17. #include "admin/Admin.h"
  18. #include "crypto/CryptoAuth.h"
  19. #include "memory/Allocator.h"
  20. #include "util/Linker.h"
  21. Linker_require("admin/AuthorizedPasswords.c");
  22. /**
  23. * Init the AuthorizedPasswords admin function.
  24. * This function exports the following calls,
  25. * AuthorizedPasswords_add() --- Add an authorized password routers to connect.
  26. * - requires a user and a password.
  27. * - inputs
  28. * user: (String, mandatory)
  29. * The password to authorize.
  30. * password: (String, mandatory)
  31. * The password to authorize.
  32. * authType: (Integer, optional)
  33. * The way in which nodes will be allowed to authenticate with
  34. * the password.
  35. *
  36. * - outputs
  37. * error: (String)
  38. * A message explaining what went wrong, if everything went ok,
  39. * the error will be "none".
  40. *
  41. * AuthorizedPasswords_remove() --- Remove an authorized password.
  42. * - requires a user
  43. * - inputs
  44. * user: (String, mandatory)
  45. * The password to authorize.
  46. * - outputs
  47. * error: (String)
  48. * A message explaining what went wrong, if everything went ok,
  49. * the error will be "none".
  50. *
  51. * @param admin the admin object.
  52. * @param ca the cryptoauth to add users to.
  53. * @param allocator a persistent memory allocator.
  54. */
  55. void AuthorizedPasswords_init(struct Admin* admin,
  56. struct CryptoAuth* ca,
  57. struct Allocator* allocator);
  58. #endif