gas_query.h 1.4 KB

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