summaryrefslogtreecommitdiffhomepage
path: root/proto-shell.c
diff options
context:
space:
mode:
Diffstat (limited to 'proto-shell.c')
-rw-r--r--proto-shell.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/proto-shell.c b/proto-shell.c
index 9041045..de1b084 100644
--- a/proto-shell.c
+++ b/proto-shell.c
@@ -159,6 +159,10 @@ proto_shell_handler(struct interface_proto_state *proto,
state->last_error = -1;
proto_shell_clear_host_dep(state);
state->sm = S_SETUP;
+ } else if (cmd == PROTO_CMD_RENEW) {
+ if (!(handler->proto.flags & PROTO_FLAG_RENEW_AVAILABLE))
+ return 0;
+ action = "renew";
} else {
if (state->sm == S_TEARDOWN)
return 0;
@@ -761,6 +765,10 @@ proto_shell_add_handler(const char *script, const char *name, json_object *obj)
if (tmp && json_object_get_boolean(tmp))
handler->proto.flags |= PROTO_FLAG_INIT_AVAILABLE;
+ tmp = json_get_field(obj, "renew-handler", json_type_boolean);
+ if (tmp && json_object_get_boolean(tmp))
+ handler->proto.flags |= PROTO_FLAG_RENEW_AVAILABLE;
+
config = json_get_field(obj, "config", json_type_array);
if (config)
handler->config_buf = netifd_handler_parse_config(&handler->config, config);