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