gas_query.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Generic advertisement service (GAS) query
  3. * Copyright (c) 2009, Atheros Communications
  4. * Copyright (c) 2011, Qualcomm Atheros
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. *
  10. * Alternatively, this software may be distributed under the terms of BSD
  11. * license.
  12. *
  13. * See README and COPYING for more details.
  14. */
  15. #ifndef GAS_QUERY_H
  16. #define GAS_QUERY_H
  17. struct gas_query;
  18. #ifdef CONFIG_GAS
  19. struct gas_query * gas_query_init(struct wpa_supplicant *wpa_s);
  20. void gas_query_deinit(struct gas_query *gas);
  21. int gas_query_rx(struct gas_query *gas, const u8 *da, const u8 *sa,
  22. const u8 *bssid, const u8 *data, size_t len, int freq);
  23. enum gas_query_result {
  24. GAS_QUERY_SUCCESS,
  25. GAS_QUERY_FAILURE,
  26. GAS_QUERY_TIMEOUT,
  27. GAS_QUERY_PEER_ERROR,
  28. GAS_QUERY_INTERNAL_ERROR,
  29. GAS_QUERY_CANCELLED,
  30. GAS_QUERY_DELETED_AT_DEINIT
  31. };
  32. int gas_query_req(struct gas_query *gas, const u8 *dst, int freq,
  33. struct wpabuf *req,
  34. void (*cb)(void *ctx, const u8 *dst, u8 dialog_token,
  35. enum gas_query_result result,
  36. const struct wpabuf *adv_proto,
  37. const struct wpabuf *resp, u16 status_code),
  38. void *ctx);
  39. void gas_query_cancel(struct gas_query *gas, const u8 *dst, u8 dialog_token);
  40. #else /* CONFIG_GAS */
  41. static inline struct gas_query * gas_query_init(struct wpa_supplicant *wpa_s)
  42. {
  43. return (void *) 1;
  44. }
  45. static inline void gas_query_deinit(struct gas_query *gas)
  46. {
  47. }
  48. #endif /* CONFIG_GAS */
  49. #endif /* GAS_QUERY_H */