*/
case ALERT_LOCAL_AUTH_FAILED:
/* re-authentication failed */
+ charon_send_terminated_indication(name);
+ break;
case ALERT_RETRANSMIT_SEND_TIMEOUT:
/* re-transmit failed */
- charon_send_terminated_indication(name);
+ charon_send_terminated_indication_with_cause(name, CAUSE_TIMEOUT);
break;
default:
DBG1(DBG_CFG,"Alert %d ignored. Do not send notification to service", alert);
void charon_send_initate_failure(stroke_msg_t *msg, int index);
void charon_send_initiate_success(stroke_msg_t *msg, int index);
void charon_send_terminated_indication(char* name);
+void charon_send_terminated_indication_with_cause(char* name, int cause);
status_t charon_process_sim_auth(char* name, char *rand, char *autn,
char *ck, char *ik, char *res, int *res_len, sim_auth_resp_code_t *status);
{
charon_response_t *ind = create_response_msg(IND_TERMINATED);
push_string(&ind, ind_terminated.name, name);
+ ind->ind_terminated.cause = CAUSE_NORMAL;
+
+ int sock = send_message(ind, ind->length);
+ if (sock > 0)
+ {
+ close(sock);
+ }
+ free(ind);
+}
+
+void charon_send_terminated_indication_with_cause(char* name, int cause)
+{
+ charon_response_t *ind = create_response_msg(IND_TERMINATED);
+ push_string(&ind, ind_terminated.name, name);
+ ind->ind_terminated.cause = cause;
int sock = send_message(ind, ind->length);
if (sock > 0)
AUTH_SYNC_FAIL,
} sim_auth_resp_code_t;
+typedef enum {
+ CAUSE_NORMAL,
+ CAUSE_TIMEOUT
+} charon_termination_cause_t;
+
typedef struct
{
unsigned short length;
struct {
char *name;
+ charon_termination_cause_t cause;
} ind_terminated;
struct {