Dmitry Shmidt | 0494959 | 2012-07-19 12:16:46 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Generic advertisement service (GAS) server |
| 3 | * Copyright (c) 2011-2012, 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 | |
| 9 | #ifndef GAS_SERV_H |
| 10 | #define GAS_SERV_H |
| 11 | |
| 12 | #define ANQP_REQ_CAPABILITY_LIST \ |
| 13 | (1 << (ANQP_CAPABILITY_LIST - ANQP_QUERY_LIST)) |
| 14 | #define ANQP_REQ_VENUE_NAME \ |
| 15 | (1 << (ANQP_VENUE_NAME - ANQP_QUERY_LIST)) |
| 16 | #define ANQP_REQ_ROAMING_CONSORTIUM \ |
| 17 | (1 << (ANQP_ROAMING_CONSORTIUM - ANQP_QUERY_LIST)) |
| 18 | |
| 19 | /* To account for latencies between hostapd and external ANQP processor */ |
| 20 | #define GAS_SERV_COMEBACK_DELAY_FUDGE 10 |
| 21 | #define GAS_SERV_MIN_COMEBACK_DELAY 100 /* in TU */ |
| 22 | |
| 23 | struct gas_dialog_info { |
| 24 | u8 valid; |
| 25 | u8 index; |
| 26 | struct wpabuf *sd_resp; /* Fragmented response */ |
| 27 | u8 dialog_token; |
| 28 | size_t sd_resp_pos; /* Offset in sd_resp */ |
| 29 | u8 sd_frag_id; |
| 30 | u16 comeback_delay; |
| 31 | |
| 32 | unsigned int requested; |
| 33 | unsigned int received; |
| 34 | unsigned int all_requested; |
| 35 | }; |
| 36 | |
| 37 | struct hostapd_data; |
| 38 | |
| 39 | void gas_serv_tx_gas_response(struct hostapd_data *hapd, const u8 *dst, |
| 40 | struct gas_dialog_info *dialog); |
| 41 | struct gas_dialog_info * |
| 42 | gas_serv_dialog_find(struct hostapd_data *hapd, const u8 *addr, |
| 43 | u8 dialog_token); |
| 44 | void gas_serv_dialog_clear(struct gas_dialog_info *dialog); |
| 45 | |
| 46 | int gas_serv_init(struct hostapd_data *hapd); |
| 47 | void gas_serv_deinit(struct hostapd_data *hapd); |
| 48 | |
| 49 | #endif /* GAS_SERV_H */ |