From 37e3501bf770cff9cad49e28f774aac96a1d976c Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 24 Apr 2020 00:41:16 +0300 Subject: [PATCH] FST: Convert Boolean to C99 bool Signed-off-by: Jouni Malinen --- src/ap/hostapd.c | 6 +-- src/fst/fst.c | 16 +++--- src/fst/fst.h | 16 +++--- src/fst/fst_ctrl_aux.h | 4 +- src/fst/fst_ctrl_iface.c | 48 ++++++++--------- src/fst/fst_ctrl_iface.h | 2 +- src/fst/fst_group.c | 10 ++-- src/fst/fst_group.h | 4 +- src/fst/fst_iface.c | 8 +-- src/fst/fst_iface.h | 8 +-- src/fst/fst_session.c | 96 ++++++++++++++++----------------- src/fst/fst_session.h | 12 ++--- wpa_supplicant/wpa_supplicant.c | 4 +- 13 files changed, 117 insertions(+), 117 deletions(-) diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index f2e964ac0..5515ab34d 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -1772,7 +1772,7 @@ static void fst_hostapd_update_mb_ie_cb(void *ctx, const u8 *addr, static const u8 * fst_hostapd_get_sta(struct fst_get_peer_ctx **get_ctx, - Boolean mb_only) + bool mb_only) { struct sta_info *s = (struct sta_info *) *get_ctx; @@ -1794,7 +1794,7 @@ static const u8 * fst_hostapd_get_sta(struct fst_get_peer_ctx **get_ctx, static const u8 * fst_hostapd_get_peer_first(void *ctx, struct fst_get_peer_ctx **get_ctx, - Boolean mb_only) + bool mb_only) { struct hostapd_data *hapd = ctx; @@ -1806,7 +1806,7 @@ static const u8 * fst_hostapd_get_peer_first(void *ctx, static const u8 * fst_hostapd_get_peer_next(void *ctx, struct fst_get_peer_ctx **get_ctx, - Boolean mb_only) + bool mb_only) { return fst_hostapd_get_sta(get_ctx, mb_only); } diff --git a/src/fst/fst.c b/src/fst/fst.c index fbe1175ac..21ef3d8b7 100644 --- a/src/fst/fst.c +++ b/src/fst/fst.c @@ -20,7 +20,7 @@ struct dl_list fst_global_ctrls_list; static void fst_ctrl_iface_notify_peer_state_change(struct fst_iface *iface, - Boolean connected, + bool connected, const u8 *peer_addr) { union fst_event_extra extra; @@ -42,7 +42,7 @@ struct fst_iface * fst_attach(const char *ifname, const u8 *own_addr, struct fst_group *g; struct fst_group *group = NULL; struct fst_iface *iface = NULL; - Boolean new_group = FALSE; + bool new_group = false; WPA_ASSERT(ifname != NULL); WPA_ASSERT(iface_obj != NULL); @@ -62,7 +62,7 @@ struct fst_iface * fst_attach(const char *ifname, const u8 *own_addr, cfg->group_id); return NULL; } - new_group = TRUE; + new_group = true; } iface = fst_iface_create(group, ifname, own_addr, iface_obj, cfg); @@ -166,7 +166,7 @@ void fst_global_del_ctrl(struct fst_ctrl_handle *h) void fst_rx_action(struct fst_iface *iface, const struct ieee80211_mgmt *mgmt, size_t len) { - if (fst_iface_is_connected(iface, mgmt->sa, FALSE)) + if (fst_iface_is_connected(iface, mgmt->sa, false)) fst_session_on_action_rx(iface, mgmt, len); else wpa_printf(MSG_DEBUG, @@ -187,7 +187,7 @@ void fst_notify_peer_connected(struct fst_iface *iface, const u8 *addr) fst_printf_iface(iface, MSG_DEBUG, MACSTR " became connected", MAC2STR(addr)); - fst_ctrl_iface_notify_peer_state_change(iface, TRUE, addr); + fst_ctrl_iface_notify_peer_state_change(iface, true, addr); } @@ -203,12 +203,12 @@ void fst_notify_peer_disconnected(struct fst_iface *iface, const u8 *addr) fst_printf_iface(iface, MSG_DEBUG, MACSTR " became disconnected", MAC2STR(addr)); - fst_ctrl_iface_notify_peer_state_change(iface, FALSE, addr); + fst_ctrl_iface_notify_peer_state_change(iface, false, addr); } -Boolean fst_are_ifaces_aggregated(struct fst_iface *iface1, - struct fst_iface *iface2) +bool fst_are_ifaces_aggregated(struct fst_iface *iface1, + struct fst_iface *iface2) { return fst_iface_get_group(iface1) == fst_iface_get_group(iface2); } diff --git a/src/fst/fst.h b/src/fst/fst.h index 7ba60d545..2410a6ef1 100644 --- a/src/fst/fst.h +++ b/src/fst/fst.h @@ -113,24 +113,24 @@ struct fst_wpa_obj { * get_peer_first - Get MAC address of the 1st connected STA * @ctx: User context %ctx * @get_ctx: Context to be used for %get_peer_next call - * @mb_only: %TRUE if only multi-band capable peer should be reported + * @mb_only: %true if only multi-band capable peer should be reported * Returns: Address of the 1st connected STA, %NULL if no STAs connected */ const u8 * (*get_peer_first)(void *ctx, struct fst_get_peer_ctx **get_ctx, - Boolean mb_only); + bool mb_only); /** * get_peer_next - Get MAC address of the next connected STA * @ctx: User context %ctx * @get_ctx: Context received from %get_peer_first or previous * %get_peer_next call - * @mb_only: %TRUE if only multi-band capable peer should be reported + * @mb_only: %true if only multi-band capable peer should be reported * Returns: Address of the next connected STA, %NULL if no more STAs * connected */ const u8 * (*get_peer_next)(void *ctx, struct fst_get_peer_ctx **get_ctx, - Boolean mb_only); + bool mb_only); }; /** @@ -273,11 +273,11 @@ void fst_notify_peer_disconnected(struct fst_iface *iface, const u8 *addr); * @iface1: 1st FST interface object * @iface1: 2nd FST interface object * - * Returns: %TRUE if the interfaces belong to the same FST group, - * %FALSE otherwise + * Returns: %true if the interfaces belong to the same FST group, + * %false otherwise */ -Boolean fst_are_ifaces_aggregated(struct fst_iface *iface1, - struct fst_iface *iface2); +bool fst_are_ifaces_aggregated(struct fst_iface *iface1, + struct fst_iface *iface2); /** * fst_update_mac_addr - Notify FST about MAC address change diff --git a/src/fst/fst_ctrl_aux.h b/src/fst/fst_ctrl_aux.h index 0aff5d061..ab80b6fc4 100644 --- a/src/fst/fst_ctrl_aux.h +++ b/src/fst/fst_ctrl_aux.h @@ -54,12 +54,12 @@ enum fst_initiator { union fst_event_extra { struct fst_event_extra_iface_state { - Boolean attached; + bool attached; char ifname[FST_MAX_INTERFACE_SIZE]; char group_id[FST_MAX_GROUP_ID_SIZE]; } iface_state; /* for EVENT_FST_IFACE_STATE_CHANGED */ struct fst_event_extra_peer_state { - Boolean connected; + bool connected; char ifname[FST_MAX_INTERFACE_SIZE]; u8 addr[ETH_ALEN]; } peer_state; /* for EVENT_PEER_STATE_CHANGED */ diff --git a/src/fst/fst_ctrl_iface.c b/src/fst/fst_ctrl_iface.c index 7df3362b6..45607b6d9 100644 --- a/src/fst/fst_ctrl_iface.c +++ b/src/fst/fst_ctrl_iface.c @@ -32,8 +32,8 @@ static struct fst_group * get_fst_group_by_id(const char *id) /* notifications */ -static Boolean format_session_state_extra(const union fst_event_extra *extra, - char *buffer, size_t size) +static bool format_session_state_extra(const union fst_event_extra *extra, + char *buffer, size_t size) { int len; char reject_str[32] = FST_CTRL_PVAL_NONE; @@ -42,7 +42,7 @@ static Boolean format_session_state_extra(const union fst_event_extra *extra, ss = &extra->session_state; if (ss->new_state != FST_SESSION_STATE_INITIAL) - return TRUE; + return true; switch (ss->extra.to_initial.reason) { case REASON_REJECT: @@ -183,10 +183,10 @@ static int session_get(const char *session_id, char *buf, size_t buflen) return os_snprintf(buf, buflen, "FAIL\n"); } - old_peer_addr = fst_session_get_peer_addr(s, TRUE); - new_peer_addr = fst_session_get_peer_addr(s, FALSE); - new_iface = fst_session_get_iface(s, FALSE); - old_iface = fst_session_get_iface(s, TRUE); + old_peer_addr = fst_session_get_peer_addr(s, true); + new_peer_addr = fst_session_get_peer_addr(s, false); + new_iface = fst_session_get_iface(s, false); + old_iface = fst_session_get_iface(s, true); return os_snprintf(buf, buflen, FST_CSG_PNAME_OLD_PEER_ADDR "=" MACSTR "\n" @@ -227,13 +227,13 @@ static int session_set(const char *session_id, char *buf, size_t buflen) p++; if (os_strncasecmp(p, FST_CSS_PNAME_OLD_IFNAME, q - p) == 0) { - ret = fst_session_set_str_ifname(s, q + 1, TRUE); + ret = fst_session_set_str_ifname(s, q + 1, true); } else if (os_strncasecmp(p, FST_CSS_PNAME_NEW_IFNAME, q - p) == 0) { - ret = fst_session_set_str_ifname(s, q + 1, FALSE); + ret = fst_session_set_str_ifname(s, q + 1, false); } else if (os_strncasecmp(p, FST_CSS_PNAME_OLD_PEER_ADDR, q - p) == 0) { - ret = fst_session_set_str_peer_addr(s, q + 1, TRUE); + ret = fst_session_set_str_peer_addr(s, q + 1, true); } else if (os_strncasecmp(p, FST_CSS_PNAME_NEW_PEER_ADDR, q - p) == 0) { - ret = fst_session_set_str_peer_addr(s, q + 1, FALSE); + ret = fst_session_set_str_peer_addr(s, q + 1, false); } else if (os_strncasecmp(p, FST_CSS_PNAME_LLT, q - p) == 0) { ret = fst_session_set_str_llt(s, q + 1); } else { @@ -539,8 +539,8 @@ static int iface_peers(const char *group_id, char *buf, size_t buflen) if (!found) return os_snprintf(buf, buflen, "FAIL\n"); - addr = fst_iface_get_peer_first(f, &ctx, FALSE); - for (; addr != NULL; addr = fst_iface_get_peer_next(f, &ctx, FALSE)) { + addr = fst_iface_get_peer_first(f, &ctx, false); + for (; addr != NULL; addr = fst_iface_get_peer_next(f, &ctx, false)) { int res; res = os_snprintf(buf + ret, buflen - ret, MACSTR "\n", @@ -692,7 +692,7 @@ static int print_band(unsigned num, struct fst_iface *iface, const u8 *addr, static void fst_ctrl_iface_on_iface_state_changed(struct fst_iface *i, - Boolean attached) + bool attached) { union fst_event_extra extra; @@ -710,14 +710,14 @@ static void fst_ctrl_iface_on_iface_state_changed(struct fst_iface *i, static int fst_ctrl_iface_on_iface_added(struct fst_iface *i) { - fst_ctrl_iface_on_iface_state_changed(i, TRUE); + fst_ctrl_iface_on_iface_state_changed(i, true); return 0; } static void fst_ctrl_iface_on_iface_removed(struct fst_iface *i) { - fst_ctrl_iface_on_iface_state_changed(i, FALSE); + fst_ctrl_iface_on_iface_state_changed(i, false); } @@ -749,7 +749,7 @@ int fst_ctrl_iface_mb_info(const u8 *addr, char *buf, size_t buflen) foreach_fst_group(g) { foreach_fst_group_iface(g, f) { - if (fst_iface_is_connected(f, addr, TRUE)) { + if (fst_iface_is_connected(f, addr, true)) { ret += print_band(num++, f, addr, buf + ret, buflen - ret); } @@ -789,7 +789,7 @@ int fst_ctrl_iface_receive(const char *cmd, char *reply, size_t reply_size) const struct fst_command *c; const char *p; const char *temp; - Boolean non_spaces_found; + bool non_spaces_found; for (c = commands; c->name; c++) { if (os_strncasecmp(cmd, c->name, os_strlen(c->name)) != 0) @@ -800,10 +800,10 @@ int fst_ctrl_iface_receive(const char *cmd, char *reply, size_t reply_size) return os_snprintf(reply, reply_size, "FAIL\n"); p++; temp = p; - non_spaces_found = FALSE; + non_spaces_found = false; while (*temp) { if (!isspace(*temp)) { - non_spaces_found = TRUE; + non_spaces_found = true; break; } temp++; @@ -818,18 +818,18 @@ int fst_ctrl_iface_receive(const char *cmd, char *reply, size_t reply_size) } -int fst_read_next_int_param(const char *params, Boolean *valid, char **endp) +int fst_read_next_int_param(const char *params, bool *valid, char **endp) { int ret = -1; const char *curp; - *valid = FALSE; + *valid = false; *endp = (char *) params; curp = params; if (*curp) { ret = (int) strtol(curp, endp, 0); if (!**endp || isspace(**endp)) - *valid = TRUE; + *valid = true; } return ret; @@ -887,7 +887,7 @@ int fst_parse_attach_command(const char *cmd, char *ifname, size_t ifname_size, { char *pos; char *endp; - Boolean is_valid; + bool is_valid; int val; if (fst_read_next_text_param(cmd, ifname, ifname_size, &endp) || diff --git a/src/fst/fst_ctrl_iface.h b/src/fst/fst_ctrl_iface.h index 4d0cd9fce..354b81fc7 100644 --- a/src/fst/fst_ctrl_iface.h +++ b/src/fst/fst_ctrl_iface.h @@ -30,7 +30,7 @@ fst_ctrl_iface_mb_info(const u8 *addr, char *buf, size_t buflen) #endif /* CONFIG_FST */ -int fst_read_next_int_param(const char *params, Boolean *valid, char **endp); +int fst_read_next_int_param(const char *params, bool *valid, char **endp); int fst_read_next_text_param(const char *params, char *buf, size_t buflen, char **endp); int fst_read_peer_addr(const char *mac, u8 *peer_addr); diff --git a/src/fst/fst_group.c b/src/fst/fst_group.c index a4ae016d9..d1c401497 100644 --- a/src/fst/fst_group.c +++ b/src/fst/fst_group.c @@ -305,7 +305,7 @@ fst_group_get_peer_other_connection_1(struct fst_iface *iface, if (other_iface == iface || band_id != fst_iface_get_band_id(other_iface)) continue; - if (fst_iface_is_connected(other_iface, tmp_peer_addr, FALSE)) { + if (fst_iface_is_connected(other_iface, tmp_peer_addr, false)) { os_memcpy(other_peer_addr, tmp_peer_addr, ETH_ALEN); return other_iface; } @@ -347,10 +347,10 @@ fst_group_get_peer_other_connection_2(struct fst_iface *iface, band_id != fst_iface_get_band_id(other_iface)) continue; cur_peer_addr = fst_iface_get_peer_first(other_iface, &ctx, - TRUE); + true); for (; cur_peer_addr; cur_peer_addr = fst_iface_get_peer_next(other_iface, &ctx, - TRUE)) { + true)) { cur_mbie = fst_iface_get_peer_mb_ie(other_iface, cur_peer_addr); if (!cur_mbie) @@ -493,9 +493,9 @@ void fst_group_delete(struct fst_group *group) } -Boolean fst_group_delete_if_empty(struct fst_group *group) +bool fst_group_delete_if_empty(struct fst_group *group) { - Boolean is_empty = !fst_group_has_ifaces(group) && + bool is_empty = !fst_group_has_ifaces(group) && !fst_session_global_get_first_by_group(group); if (is_empty) diff --git a/src/fst/fst_group.h b/src/fst/fst_group.h index 00aee9c8c..4a9ff3e82 100644 --- a/src/fst/fst_group.h +++ b/src/fst/fst_group.h @@ -29,7 +29,7 @@ void fst_group_delete(struct fst_group *g); void fst_group_update_ie(struct fst_group *g); -static inline Boolean fst_group_has_ifaces(struct fst_group *g) +static inline bool fst_group_has_ifaces(struct fst_group *g) { return !dl_list_empty(&g->ifaces); } @@ -44,7 +44,7 @@ static inline const char * fst_group_get_id(struct fst_group *g) return g->group_id; } -Boolean fst_group_delete_if_empty(struct fst_group *group); +bool fst_group_delete_if_empty(struct fst_group *group); struct fst_iface * fst_group_get_iface_by_name(struct fst_group *g, const char *ifname); struct fst_iface * diff --git a/src/fst/fst_iface.c b/src/fst/fst_iface.c index 35e83cb7b..90c5fc035 100644 --- a/src/fst/fst_iface.c +++ b/src/fst/fst_iface.c @@ -49,17 +49,17 @@ void fst_iface_delete(struct fst_iface *i) } -Boolean fst_iface_is_connected(struct fst_iface *iface, const u8 *addr, - Boolean mb_only) +bool fst_iface_is_connected(struct fst_iface *iface, const u8 *addr, + bool mb_only) { struct fst_get_peer_ctx *ctx; const u8 *a = fst_iface_get_peer_first(iface, &ctx, mb_only); for (; a != NULL; a = fst_iface_get_peer_next(iface, &ctx, mb_only)) if (os_memcmp(addr, a, ETH_ALEN) == 0) - return TRUE; + return true; - return FALSE; + return false; } diff --git a/src/fst/fst_iface.h b/src/fst/fst_iface.h index cbaa7d817..af7156cb2 100644 --- a/src/fst/fst_iface.h +++ b/src/fst/fst_iface.h @@ -111,20 +111,20 @@ static inline void fst_iface_update_mb_ie(struct fst_iface *i, static inline const u8 * fst_iface_get_peer_first(struct fst_iface *i, struct fst_get_peer_ctx **ctx, - Boolean mb_only) + bool mb_only) { return i->iface_obj.get_peer_first(i->iface_obj.ctx, ctx, mb_only); } static inline const u8 * fst_iface_get_peer_next(struct fst_iface *i, struct fst_get_peer_ctx **ctx, - Boolean mb_only) + bool mb_only) { return i->iface_obj.get_peer_next(i->iface_obj.ctx, ctx, mb_only); } -Boolean fst_iface_is_connected(struct fst_iface *iface, const u8 *addr, - Boolean mb_only); +bool fst_iface_is_connected(struct fst_iface *iface, const u8 *addr, + bool mb_only); void fst_iface_attach_mbie(struct fst_iface *i, struct wpabuf *mbie); enum mb_band_id fst_iface_get_band_id(struct fst_iface *i); diff --git a/src/fst/fst_session.c b/src/fst/fst_session.c index a02a93e76..e42a85c04 100644 --- a/src/fst/fst_session.c +++ b/src/fst/fst_session.c @@ -71,7 +71,7 @@ struct fst_session { * specific session object */ struct fst_group *group; enum fst_session_state state; - Boolean stt_armed; + bool stt_armed; }; static struct dl_list global_sessions_list; @@ -145,12 +145,12 @@ static u32 fst_find_free_session_id(void) struct fst_session *s; for (i = 0; i < (u32) -1; i++) { - Boolean in_use = FALSE; + bool in_use = false; foreach_fst_session(s) { if (s->id == global_session_id) { fst_session_global_inc_id(); - in_use = TRUE; + in_use = true; break; } } @@ -184,7 +184,7 @@ static void fst_session_stt_arm(struct fst_session *s) /* Action frames sometimes get delayed. Use relaxed timeout (2*) */ eloop_register_timeout(0, 2 * TU_TO_US(FST_DEFAULT_SESSION_TIMEOUT_TU), fst_session_timeout_handler, NULL, s); - s->stt_armed = TRUE; + s->stt_armed = true; } @@ -192,12 +192,12 @@ static void fst_session_stt_disarm(struct fst_session *s) { if (s->stt_armed) { eloop_cancel_timeout(fst_session_timeout_handler, NULL, s); - s->stt_armed = FALSE; + s->stt_armed = false; } } -static Boolean fst_session_is_in_transition(struct fst_session *s) +static bool fst_session_is_in_transition(struct fst_session *s) { /* See spec, 10.32.2.2 Transitioning between states */ return s->stt_armed; @@ -267,7 +267,7 @@ static void fst_session_reset_ex(struct fst_session *s, enum fst_reason reason) } -static int fst_session_send_action(struct fst_session *s, Boolean old_iface, +static int fst_session_send_action(struct fst_session *s, bool old_iface, const void *payload, size_t size, const struct wpabuf *extra_buf) { @@ -344,11 +344,11 @@ static int fst_session_send_tear_down(struct fst_session *s) td.action = FST_ACTION_TEAR_DOWN; td.fsts_id = host_to_le32(s->data.fsts_id); - res = fst_session_send_action(s, TRUE, &td, sizeof(td), NULL); + res = fst_session_send_action(s, true, &td, sizeof(td), NULL); if (!res) - fst_printf_sframe(s, TRUE, MSG_INFO, "FST TearDown sent"); + fst_printf_sframe(s, true, MSG_INFO, "FST TearDown sent"); else - fst_printf_sframe(s, TRUE, MSG_ERROR, + fst_printf_sframe(s, true, MSG_ERROR, "failed to send FST TearDown"); return res; @@ -481,10 +481,10 @@ static void fst_session_handle_setup_request(struct fst_iface *iface, return; } - fst_session_set_iface(s, iface, TRUE); - fst_session_set_peer_addr(s, mgmt->sa, TRUE); - fst_session_set_iface(s, new_iface, FALSE); - fst_session_set_peer_addr(s, new_iface_peer_addr, FALSE); + fst_session_set_iface(s, iface, true); + fst_session_set_peer_addr(s, mgmt->sa, true); + fst_session_set_iface(s, new_iface, false); + fst_session_set_peer_addr(s, new_iface_peer_addr, false); fst_session_set_llt(s, FST_LLT_VAL_TO_MS(le_to_host32(req->llt))); s->data.pending_setup_req_dlgt = req->dialog_token; s->data.fsts_id = le_to_host32(req->stie.fsts_id); @@ -687,8 +687,8 @@ static void fst_session_handle_ack_request(struct fst_session *s, res.dialog_token = req->dialog_token; res.fsts_id = req->fsts_id; - if (!fst_session_send_action(s, FALSE, &res, sizeof(res), NULL)) { - fst_printf_sframe(s, FALSE, MSG_INFO, "FST Ack Response sent"); + if (!fst_session_send_action(s, false, &res, sizeof(res), NULL)) { + fst_printf_sframe(s, false, MSG_INFO, "FST Ack Response sent"); fst_session_stt_disarm(s); fst_session_set_state(s, FST_SESSION_STATE_TRANSITION_DONE, NULL); @@ -785,7 +785,7 @@ struct fst_session * fst_session_create(struct fst_group *g) void fst_session_set_iface(struct fst_session *s, struct fst_iface *iface, - Boolean is_old) + bool is_old) { if (is_old) s->data.old_iface = iface; @@ -802,7 +802,7 @@ void fst_session_set_llt(struct fst_session *s, u32 llt) void fst_session_set_peer_addr(struct fst_session *s, const u8 *addr, - Boolean is_old) + bool is_old) { u8 *a = is_old ? s->data.old_peer_addr : s->data.new_peer_addr; @@ -850,14 +850,14 @@ int fst_session_initiate_setup(struct fst_session *s) } if (!fst_iface_is_connected(s->data.old_iface, s->data.old_peer_addr, - FALSE)) { + false)) { fst_printf_session(s, MSG_ERROR, "The preset old peer address is not connected"); return -EINVAL; } if (!fst_iface_is_connected(s->data.new_iface, s->data.new_peer_addr, - FALSE)) { + false)) { fst_printf_session(s, MSG_ERROR, "The preset new peer address is not connected"); return -EINVAL; @@ -905,12 +905,12 @@ int fst_session_initiate_setup(struct fst_session *s) req.stie.old_band_op = 1; req.stie.old_band_setup = 0; - res = fst_session_send_action(s, TRUE, &req, sizeof(req), + res = fst_session_send_action(s, true, &req, sizeof(req), fst_iface_get_mbie(s->data.old_iface)); if (!res) { s->data.fsts_id = fsts_id; s->data.pending_setup_req_dlgt = dialog_token; - fst_printf_sframe(s, TRUE, MSG_INFO, "FST Setup Request sent"); + fst_printf_sframe(s, true, MSG_INFO, "FST Setup Request sent"); fst_session_set_state(s, FST_SESSION_STATE_SETUP_COMPLETION, NULL); @@ -955,7 +955,7 @@ int fst_session_respond(struct fst_session *s, u8 status_code) } if (!fst_iface_is_connected(s->data.old_iface, - s->data.old_peer_addr, FALSE)) { + s->data.old_peer_addr, false)) { fst_printf_session(s, MSG_ERROR, "The preset peer address is not in the peer list"); return -EINVAL; @@ -1000,15 +1000,15 @@ int fst_session_respond(struct fst_session *s, u8 status_code) status_code); } - if (fst_session_send_action(s, TRUE, &res, sizeof(res), + if (fst_session_send_action(s, true, &res, sizeof(res), fst_iface_get_mbie(s->data.old_iface))) { - fst_printf_sframe(s, TRUE, MSG_ERROR, + fst_printf_sframe(s, true, MSG_ERROR, "cannot send FST Setup Response with code %d", status_code); return -EINVAL; } - fst_printf_sframe(s, TRUE, MSG_INFO, "FST Setup Response sent"); + fst_printf_sframe(s, true, MSG_INFO, "FST Setup Response sent"); if (status_code != WLAN_STATUS_SUCCESS) { union fst_session_state_switch_extra evext = { @@ -1053,14 +1053,14 @@ int fst_session_initiate_switch(struct fst_session *s) req.dialog_token = dialog_token; req.fsts_id = host_to_le32(s->data.fsts_id); - res = fst_session_send_action(s, FALSE, &req, sizeof(req), NULL); + res = fst_session_send_action(s, false, &req, sizeof(req), NULL); if (!res) { - fst_printf_sframe(s, FALSE, MSG_INFO, "FST Ack Request sent"); + fst_printf_sframe(s, false, MSG_INFO, "FST Ack Request sent"); fst_session_set_state(s, FST_SESSION_STATE_TRANSITION_DONE, NULL); fst_session_stt_arm(s); } else { - fst_printf_sframe(s, FALSE, MSG_ERROR, + fst_printf_sframe(s, false, MSG_ERROR, "Cannot send FST Ack Request"); } @@ -1091,7 +1091,7 @@ void fst_session_handle_action(struct fst_session *s, break; case FST_ACTION_ON_CHANNEL_TUNNEL: default: - fst_printf_sframe(s, FALSE, MSG_ERROR, + fst_printf_sframe(s, false, MSG_ERROR, "Unsupported FST Action frame"); break; } @@ -1137,7 +1137,7 @@ struct fst_group * fst_session_get_group(struct fst_session *s) } -struct fst_iface * fst_session_get_iface(struct fst_session *s, Boolean is_old) +struct fst_iface * fst_session_get_iface(struct fst_session *s, bool is_old) { return is_old ? s->data.old_iface : s->data.new_iface; } @@ -1149,7 +1149,7 @@ u32 fst_session_get_id(struct fst_session *s) } -const u8 * fst_session_get_peer_addr(struct fst_session *s, Boolean is_old) +const u8 * fst_session_get_peer_addr(struct fst_session *s, bool is_old) { return is_old ? s->data.old_peer_addr : s->data.new_peer_addr; } @@ -1232,7 +1232,7 @@ void fst_session_on_action_rx(struct fst_iface *iface, int fst_session_set_str_ifname(struct fst_session *s, const char *ifname, - Boolean is_old) + bool is_old) { struct fst_group *g = fst_session_get_group(s); struct fst_iface *i; @@ -1252,7 +1252,7 @@ int fst_session_set_str_ifname(struct fst_session *s, const char *ifname, int fst_session_set_str_peer_addr(struct fst_session *s, const char *mac, - Boolean is_old) + bool is_old) { u8 peer_addr[ETH_ALEN]; int res = fst_read_peer_addr(mac, peer_addr); @@ -1330,11 +1330,11 @@ static int get_group_fill_session(struct fst_group **g, struct fst_session *s) if (!s->data.old_iface) return -EINVAL; - old_addr = fst_iface_get_peer_first(s->data.old_iface, &ctx, TRUE); + old_addr = fst_iface_get_peer_first(s->data.old_iface, &ctx, true); if (!old_addr) return -EINVAL; - new_addr = fst_iface_get_peer_first(s->data.new_iface, &ctx, TRUE); + new_addr = fst_iface_get_peer_first(s->data.new_iface, &ctx, true); if (!new_addr) return -EINVAL; @@ -1350,7 +1350,7 @@ static int get_group_fill_session(struct fst_group **g, struct fst_session *s) int fst_test_req_send_fst_request(const char *params) { int fsts_id; - Boolean is_valid; + bool is_valid; char *endp; struct fst_setup_req req; struct fst_session s; @@ -1394,7 +1394,7 @@ int fst_test_req_send_fst_request(const char *params) req.stie.new_band_id = req.stie.old_band_id; } - return fst_session_send_action(&s, TRUE, &req, sizeof(req), + return fst_session_send_action(&s, true, &req, sizeof(req), s.data.old_iface->mb_ie); } @@ -1402,7 +1402,7 @@ int fst_test_req_send_fst_request(const char *params) int fst_test_req_send_fst_response(const char *params) { int fsts_id; - Boolean is_valid; + bool is_valid; char *endp; struct fst_setup_res res; struct fst_session s; @@ -1437,7 +1437,7 @@ int fst_test_req_send_fst_response(const char *params) * If some session has just received an FST Setup Request, then * use the correct dialog token copied from this request. */ - _s = fst_find_session_in_progress(fst_session_get_peer_addr(&s, TRUE), + _s = fst_find_session_in_progress(fst_session_get_peer_addr(&s, true), g); res.dialog_token = (_s && fst_session_is_ready_pending(_s)) ? _s->data.pending_setup_req_dlgt : g->dialog_token; @@ -1469,7 +1469,7 @@ int fst_test_req_send_fst_response(const char *params) res.stie.new_band_id = res.stie.old_band_id; } - return fst_session_send_action(&s, TRUE, &res, sizeof(res), + return fst_session_send_action(&s, true, &res, sizeof(res), s.data.old_iface->mb_ie); } @@ -1477,7 +1477,7 @@ int fst_test_req_send_fst_response(const char *params) int fst_test_req_send_ack_request(const char *params) { int fsts_id; - Boolean is_valid; + bool is_valid; char *endp; struct fst_ack_req req; struct fst_session s; @@ -1498,14 +1498,14 @@ int fst_test_req_send_ack_request(const char *params) req.dialog_token = g->dialog_token; req.fsts_id = host_to_le32(fsts_id); - return fst_session_send_action(&s, FALSE, &req, sizeof(req), NULL); + return fst_session_send_action(&s, false, &req, sizeof(req), NULL); } int fst_test_req_send_ack_response(const char *params) { int fsts_id; - Boolean is_valid; + bool is_valid; char *endp; struct fst_ack_res res; struct fst_session s; @@ -1526,14 +1526,14 @@ int fst_test_req_send_ack_response(const char *params) res.dialog_token = g->dialog_token; res.fsts_id = host_to_le32(fsts_id); - return fst_session_send_action(&s, FALSE, &res, sizeof(res), NULL); + return fst_session_send_action(&s, false, &res, sizeof(res), NULL); } int fst_test_req_send_tear_down(const char *params) { int fsts_id; - Boolean is_valid; + bool is_valid; char *endp; struct fst_tear_down td; struct fst_session s; @@ -1553,14 +1553,14 @@ int fst_test_req_send_tear_down(const char *params) td.action = FST_ACTION_TEAR_DOWN; td.fsts_id = host_to_le32(fsts_id); - return fst_session_send_action(&s, TRUE, &td, sizeof(td), NULL); + return fst_session_send_action(&s, true, &td, sizeof(td), NULL); } u32 fst_test_req_get_fsts_id(const char *params) { int sid; - Boolean is_valid; + bool is_valid; char *endp; struct fst_session *s; diff --git a/src/fst/fst_session.h b/src/fst/fst_session.h index 1162de4b3..e43d0ea39 100644 --- a/src/fst/fst_session.h +++ b/src/fst/fst_session.h @@ -24,10 +24,10 @@ fst_session_global_get_first_by_group(struct fst_group *g); struct fst_session * fst_session_create(struct fst_group *g); void fst_session_set_iface(struct fst_session *s, struct fst_iface *iface, - Boolean is_old); + bool is_old); void fst_session_set_llt(struct fst_session *s, u32 llt); void fst_session_set_peer_addr(struct fst_session *s, const u8 *addr, - Boolean is_old); + bool is_old); int fst_session_initiate_setup(struct fst_session *s); int fst_session_respond(struct fst_session *s, u8 status_code); int fst_session_initiate_switch(struct fst_session *s); @@ -39,8 +39,8 @@ void fst_session_reset(struct fst_session *s); void fst_session_delete(struct fst_session *s); struct fst_group * fst_session_get_group(struct fst_session *s); -struct fst_iface * fst_session_get_iface(struct fst_session *s, Boolean is_old); -const u8 * fst_session_get_peer_addr(struct fst_session *s, Boolean is_old); +struct fst_iface * fst_session_get_iface(struct fst_session *s, bool is_old); +const u8 * fst_session_get_peer_addr(struct fst_session *s, bool is_old); u32 fst_session_get_id(struct fst_session *s); u32 fst_session_get_llt(struct fst_session *s); enum fst_session_state fst_session_get_state(struct fst_session *s); @@ -57,9 +57,9 @@ void fst_session_on_action_rx(struct fst_iface *iface, int fst_session_set_str_ifname(struct fst_session *s, const char *ifname, - Boolean is_old); + bool is_old); int fst_session_set_str_peer_addr(struct fst_session *s, const char *mac, - Boolean is_old); + bool is_old); int fst_session_set_str_llt(struct fst_session *s, const char *llt_str); #ifdef CONFIG_FST_TEST diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index 50478c11e..5a503fe05 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -5475,7 +5475,7 @@ static void wpas_fst_update_mb_ie_cb(void *ctx, const u8 *addr, static const u8 * wpas_fst_get_peer_first(void *ctx, struct fst_get_peer_ctx **get_ctx, - Boolean mb_only) + bool mb_only) { struct wpa_supplicant *wpa_s = ctx; @@ -5489,7 +5489,7 @@ static const u8 * wpas_fst_get_peer_first(void *ctx, static const u8 * wpas_fst_get_peer_next(void *ctx, struct fst_get_peer_ctx **get_ctx, - Boolean mb_only) + bool mb_only) { return NULL; }