Commit 4f7878bd authored by Martti Mela's avatar Martti Mela

removed stun_bind_ enums and replaced with stun_discovery_ scheisse

darcs-hash:20060329111850-1b897-a7378e7e0bf39e9d0525028000be40f21e102279.gz
parent 159f020d
......@@ -103,12 +103,14 @@ typedef enum stun_state_e {
stun_discovery_processing,
stun_discovery_done,
#if 0
/* STUN bind events */
stun_bind_init, /**< Initial state */
stun_bind_processing, /**< Processing server reply */
stun_bind_done, /**< Initial state */
stun_request_not_found, /**< Response without matching request */
#endif
/* STUN errors */
/* Do not change the order! Errors need to be after stun_error */
......@@ -118,11 +120,14 @@ typedef enum stun_state_e {
stun_tls_connection_failed,
stun_tls_ssl_connect_failed,
#if 0
/* stun client errors */
stun_bind_error,
stun_bind_timeout,
#endif
stun_request_timeout,
stun_discovery_error,
stun_discovery_timeout,
} stun_state_t;
......
......@@ -241,15 +241,17 @@ char const *stun_str_state(stun_state_t state)
STUN_STATE_STR(stun_discovery_init);
STUN_STATE_STR(stun_discovery_processing);
STUN_STATE_STR(stun_discovery_done);
#if 0
STUN_STATE_STR(stun_bind_init);
STUN_STATE_STR(stun_bind_processing);
STUN_STATE_STR(stun_bind_done);
STUN_STATE_STR(stun_bind_error);
STUN_STATE_STR(stun_bind_timeout);
STUN_STATE_STR(stun_request_not_found);
#endif
STUN_STATE_STR(stun_tls_connection_timeout);
STUN_STATE_STR(stun_tls_connection_failed);
STUN_STATE_STR(stun_tls_ssl_connect_failed);
STUN_STATE_STR(stun_request_not_found);
STUN_STATE_STR(stun_bind_error);
STUN_STATE_STR(stun_bind_timeout);
STUN_STATE_STR(stun_discovery_timeout);
STUN_STATE_STR(stun_request_timeout);
......@@ -1881,8 +1883,8 @@ static int do_action(stun_handle_t *sh, stun_msg_t *msg)
case stun_action_no_action:
SU_DEBUG_3(("%s: Unknown response. No matching request found.\n", __func__));
req->sr_state = stun_request_not_found;
#if 0
req->sr_state = stun_request_not_found;
sh->sh_callback(sh->sh_context, sh, NULL,
stun_action_no_action, req->sr_state);
#endif
......@@ -1950,7 +1952,7 @@ static int process_binding_request(stun_request_t *req, stun_msg_t *binding_resp
if (stun_process_error_response(binding_response) < 0) {
SU_DEBUG_3(("%s: Error in Binding Error Response.\n", __func__));
}
req->sr_state = stun_bind_error;
req->sr_state = stun_discovery_error;
break;
}
......@@ -2113,7 +2115,7 @@ static int action_bind(stun_request_t *req, stun_msg_t *binding_response)
memcpy(sd->sd_addr_seen_outside, sa, sizeof(su_sockaddr_t));
sd->sd_state = stun_bind_done;
sd->sd_state = stun_discovery_done;
if (sd->sd_callback)
sd->sd_callback(sd->sd_magic, sh, sd, action, sd->sd_state);
......
......@@ -125,6 +125,8 @@ void stunc_ss_cb(stunc_t *stunc,
SU_DEBUG_0(("%s: Obtaining shared secret failed.\n",
__func__));
stunc->sc_flags &= ~do_bind;
if (!stunc->sc_flags)
su_root_break(stun_handle_root(sh));
break;
......@@ -161,7 +163,7 @@ void stunc_bind_cb(stunc_t *stunc,
su_root_break(stun_handle_root(sh));
switch (event) {
case stun_bind_done:
case stun_discovery_done:
addrlen = sizeof(*sa);
memset(sa, 0, addrlen);
......@@ -186,9 +188,8 @@ void stunc_bind_cb(stunc_t *stunc,
break;
case stun_discovery_timeout:
case stun_bind_error:
case stun_discovery_error:
case stun_error:
case stun_bind_timeout:
default:
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment