AuthorizedPasswords.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. /**
  21. * Init the AuthorizedPasswords admin function.
  22. * This function exports the following calls,
  23. * AuthorizedPasswords_add() --- Add an authorized password routers to connect.
  24. * - requires a user and a password.
  25. * - inputs
  26. * user: (String, mandatory)
  27. * The password to authorize.
  28. * password: (String, mandatory)
  29. * The password to authorize.
  30. * authType: (Integer, optional)
  31. * The way in which nodes will be allowed to authenticate with
  32. * the password.
  33. *
  34. * - outputs
  35. * error: (String)
  36. * A message explaining what went wrong, if everything went ok,
  37. * the error will be "none".
  38. *
  39. * AuthorizedPasswords_remove() --- Remove an authorized password.
  40. * - requires a user
  41. * - inputs
  42. * user: (String, mandatory)
  43. * The password to authorize.
  44. * - outputs
  45. * error: (String)
  46. * A message explaining what went wrong, if everything went ok,
  47. * the error will be "none".
  48. *
  49. * @param admin the admin object.
  50. * @param ca the cryptoauth to add users to.
  51. * @param allocator a persistent memory allocator.
  52. */
  53. void AuthorizedPasswords_init(struct Admin* admin,
  54. struct CryptoAuth* ca,
  55. struct Allocator* allocator);
  56. #endif