[keystone-rtos/netapi.git] / ti / runtime / netapi / applications / ipsec_offload / config-app / src / cmd_shell.c
diff --git a/ti/runtime/netapi/applications/ipsec_offload/config-app/src/cmd_shell.c b/ti/runtime/netapi/applications/ipsec_offload/config-app/src/cmd_shell.c
index e2c31e555ff43a3f2ffa23c49636899587967215..152a2cfda3532b264824e1dd99790da727a647ea 100755 (executable)
#define OPTION_ID_GTPU_TEID 5
#define OPTION_ID_NUM_TEIDS 6
#define OPTION_ID_SHARED_SA 7
-#define OPTION_ID_MAX 8
+#define OPTION_ID_NO_EXPIRE_SA 8
+#define OPTION_ID_MAX 9
enum cmd_id {
CMD_ID_OFFLOAD_SP = 1,
#define CMD_NAME_STOP_OFFLOAD "stop_offload"
#define CMD_DESC_STOP_OFFLOAD "Stop Offload of an IPSec Policy"
#define CMD_MIN_ARGS_STOP_OFFLOAD 3
-#define CMD_SHORT_OPTS_STOP_OFFLOAD snprintf(short_opts,CMD_SHORT_OPTS_LEN, "%d:", OPTION_ID_SP_ID);
+#define CMD_SHORT_OPTS_STOP_OFFLOAD snprintf(short_opts,CMD_SHORT_OPTS_LEN, "%d:%d",\
+ OPTION_ID_SP_ID, OPTION_ID_NO_EXPIRE_SA);
static struct option stop_offload_options[] =
{
{"sp_id", required_argument, 0, OPTION_ID_SP_ID},
+ {"no_expire_sa", no_argument, 0, OPTION_ID_NO_EXPIRE_SA},
{0, 0, 0, 0}
};
opt_input_gen[c].is_valid = 1;
break;
+ case OPTION_ID_NO_EXPIRE_SA:
+#ifdef DEBUG
+ printf ("option no_expire_sa enabled\n");
+#endif
+ opt_input_gen[c].is_valid = 1;
+ break;
default:
printf ("unknown option c=%d\n", c);
break;
req.policy_id =
(uint32_t)opt_input_gen[OPTION_ID_SP_ID].value.intval;
+ if (opt_input_gen[OPTION_ID_NO_EXPIRE_SA].is_valid) {
+ req.no_expire_sa = 1;
+ }
if (shell_ctx.ipc_send_if->stop_offload_req(&req)) {
printf("%s failed\n", CMD_NAME_STOP_OFFLOAD);
} else {