gas_server.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Generic advertisement service (GAS) server
  3. * Copyright (c) 2017, Qualcomm Atheros, Inc.
  4. *
  5. * This software may be distributed under the terms of the BSD license.
  6. * See README for more details.
  7. */
  8. #ifndef GAS_SERVER_H
  9. #define GAS_SERVER_H
  10. #ifdef CONFIG_GAS_SERVER
  11. struct gas_server;
  12. struct gas_server * gas_server_init(void *ctx,
  13. void (*tx)(void *ctx, int freq,
  14. const u8 *da,
  15. struct wpabuf *buf,
  16. unsigned int wait_time));
  17. void gas_server_deinit(struct gas_server *gas);
  18. int gas_server_register(struct gas_server *gas,
  19. const u8 *adv_proto_id, u8 adv_proto_id_len,
  20. struct wpabuf *
  21. (*req_cb)(void *ctx, const u8 *sa,
  22. const u8 *query, size_t query_len),
  23. void (*status_cb)(void *ctx, struct wpabuf *resp,
  24. int ok),
  25. void *ctx);
  26. int gas_server_rx(struct gas_server *gas, const u8 *da, const u8 *sa,
  27. const u8 *bssid, u8 categ, const u8 *data, size_t len,
  28. int freq);
  29. void gas_server_tx_status(struct gas_server *gas, const u8 *dst, const u8 *data,
  30. size_t data_len, int ack);
  31. #else /* CONFIG_GAS_SERVER */
  32. static inline void gas_server_deinit(struct gas_server *gas)
  33. {
  34. }
  35. #endif /* CONFIG_GAS_SERVER */
  36. #endif /* GAS_SERVER_H */