gas_query.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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, u8 categ, const u8 *data, size_t len,
  17. int freq);
  18. /**
  19. * enum gas_query_result - GAS query result
  20. */
  21. enum gas_query_result {
  22. GAS_QUERY_SUCCESS,
  23. GAS_QUERY_FAILURE,
  24. GAS_QUERY_TIMEOUT,
  25. GAS_QUERY_PEER_ERROR,
  26. GAS_QUERY_INTERNAL_ERROR,
  27. GAS_QUERY_STOPPED,
  28. GAS_QUERY_DELETED_AT_DEINIT
  29. };
  30. int gas_query_req(struct gas_query *gas, const u8 *dst, int freq,
  31. int wildcard_bssid, struct wpabuf *req,
  32. void (*cb)(void *ctx, const u8 *dst, u8 dialog_token,
  33. enum gas_query_result result,
  34. const struct wpabuf *adv_proto,
  35. const struct wpabuf *resp, u16 status_code),
  36. void *ctx);
  37. int gas_query_stop(struct gas_query *gas, u8 dialog_token);
  38. #else /* CONFIG_GAS */
  39. static inline struct gas_query * gas_query_init(struct wpa_supplicant *wpa_s)
  40. {
  41. return (void *) 1;
  42. }
  43. static inline void gas_query_deinit(struct gas_query *gas)
  44. {
  45. }
  46. #endif /* CONFIG_GAS */
  47. #endif /* GAS_QUERY_H */