aboutsummaryrefslogtreecommitdiffstats
path: root/eap_example/eap_example_peer.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@codeaurora.org>2020-04-23 22:15:47 (GMT)
committerJouni Malinen <j@w1.fi>2020-04-24 14:06:50 (GMT)
commitdb81d814516a9beab9e8062ad91e59f4c01e9503 (patch)
tree6778b62d10e9f4a47e21bfa5f21b6694a8df2323 /eap_example/eap_example_peer.c
parentd15e109e29874bb19d854d9057f50cd5f066f1cd (diff)
downloadhostap-db81d814516a9beab9e8062ad91e59f4c01e9503.zip
hostap-db81d814516a9beab9e8062ad91e59f4c01e9503.tar.gz
hostap-db81d814516a9beab9e8062ad91e59f4c01e9503.tar.bz2
eap_example: Convert Boolean to C99 bool
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Diffstat (limited to 'eap_example/eap_example_peer.c')
-rw-r--r--eap_example/eap_example_peer.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/eap_example/eap_example_peer.c b/eap_example/eap_example_peer.c
index fcbfb12..5fe0cb7 100644
--- a/eap_example/eap_example_peer.c
+++ b/eap_example/eap_example_peer.c
@@ -18,16 +18,16 @@ void eap_example_server_rx(const u8 *data, size_t data_len);
struct eap_peer_ctx {
- Boolean eapSuccess;
- Boolean eapRestart;
- Boolean eapFail;
- Boolean eapResp;
- Boolean eapNoResp;
- Boolean eapReq;
- Boolean portEnabled;
- Boolean altAccept; /* for EAP */
- Boolean altReject; /* for EAP */
- Boolean eapTriggerStart;
+ bool eapSuccess;
+ bool eapRestart;
+ bool eapFail;
+ bool eapResp;
+ bool eapNoResp;
+ bool eapReq;
+ bool portEnabled;
+ bool altAccept; /* for EAP */
+ bool altReject; /* for EAP */
+ bool eapTriggerStart;
struct wpabuf *eapReqData; /* for EAP */
@@ -48,11 +48,11 @@ static struct eap_peer_config * peer_get_config(void *ctx)
}
-static Boolean peer_get_bool(void *ctx, enum eapol_bool_var variable)
+static bool peer_get_bool(void *ctx, enum eapol_bool_var variable)
{
struct eap_peer_ctx *peer = ctx;
if (peer == NULL)
- return FALSE;
+ return false;
switch (variable) {
case EAPOL_eapSuccess:
return peer->eapSuccess;
@@ -75,12 +75,11 @@ static Boolean peer_get_bool(void *ctx, enum eapol_bool_var variable)
case EAPOL_eapTriggerStart:
return peer->eapTriggerStart;
}
- return FALSE;
+ return false;
}
-static void peer_set_bool(void *ctx, enum eapol_bool_var variable,
- Boolean value)
+static void peer_set_bool(void *ctx, enum eapol_bool_var variable, bool value)
{
struct eap_peer_ctx *peer = ctx;
if (peer == NULL)
@@ -319,7 +318,7 @@ int eap_example_peer_init(void)
return -1;
/* Enable "port" to allow authentication */
- eap_ctx.portEnabled = TRUE;
+ eap_ctx.portEnabled = true;
return 0;
}
@@ -344,7 +343,7 @@ int eap_example_peer_step(void)
if (eap_ctx.eapResp) {
struct wpabuf *resp;
printf("==> Response\n");
- eap_ctx.eapResp = FALSE;
+ eap_ctx.eapResp = false;
resp = eap_get_eapRespData(eap_ctx.eap);
if (resp) {
/* Send EAP response to the server */
@@ -372,7 +371,7 @@ int eap_example_peer_step(void)
void eap_example_peer_rx(const u8 *data, size_t data_len)
{
/* Make received EAP message available to the EAP library */
- eap_ctx.eapReq = TRUE;
+ eap_ctx.eapReq = true;
wpabuf_free(eap_ctx.eapReqData);
eap_ctx.eapReqData = wpabuf_alloc_copy(data, data_len);
}