radius_das.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * RADIUS Dynamic Authorization Server (DAS)
  3. * Copyright (c) 2012, Jouni Malinen <j@w1.fi>
  4. *
  5. * This software may be distributed under the terms of the BSD license.
  6. * See README for more details.
  7. */
  8. #ifndef RADIUS_DAS_H
  9. #define RADIUS_DAS_H
  10. struct radius_das_data;
  11. enum radius_das_res {
  12. RADIUS_DAS_SUCCESS,
  13. RADIUS_DAS_NAS_MISMATCH,
  14. RADIUS_DAS_SESSION_NOT_FOUND,
  15. RADIUS_DAS_MULTI_SESSION_MATCH,
  16. };
  17. struct radius_das_attrs {
  18. /* NAS identification attributes */
  19. const u8 *nas_ip_addr;
  20. const u8 *nas_identifier;
  21. size_t nas_identifier_len;
  22. const u8 *nas_ipv6_addr;
  23. /* Session identification attributes */
  24. const u8 *sta_addr;
  25. const u8 *user_name;
  26. size_t user_name_len;
  27. const u8 *acct_session_id;
  28. size_t acct_session_id_len;
  29. const u8 *acct_multi_session_id;
  30. size_t acct_multi_session_id_len;
  31. const u8 *cui;
  32. size_t cui_len;
  33. };
  34. struct radius_das_conf {
  35. int port;
  36. const u8 *shared_secret;
  37. size_t shared_secret_len;
  38. const struct hostapd_ip_addr *client_addr;
  39. unsigned int time_window;
  40. int require_event_timestamp;
  41. void *ctx;
  42. enum radius_das_res (*disconnect)(void *ctx,
  43. struct radius_das_attrs *attr);
  44. };
  45. struct radius_das_data *
  46. radius_das_init(struct radius_das_conf *conf);
  47. void radius_das_deinit(struct radius_das_data *data);
  48. #endif /* RADIUS_DAS_H */