-int uci_del(struct uci_context *ctx, struct uci_package *p, char *section, char *option)
+int uci_rename(struct uci_context *ctx, struct uci_package *p, char *section, char *option, char *name)
+{
+ /* NB: UCI_INTERNAL use means without history tracking */
+ bool internal = ctx->internal;
+ struct uci_element *e;
+ struct uci_section *s = NULL;
+ struct uci_option *o = NULL;
+
+ UCI_HANDLE_ERR(ctx);
+ UCI_ASSERT(ctx, p != NULL);
+ UCI_ASSERT(ctx, section != NULL);
+
+ UCI_INTERNAL(uci_lookup, ctx, &e, p, section, option);
+
+ if (!internal)
+ uci_add_history(ctx, p, UCI_CMD_RENAME, section, option, name);
+
+ name = uci_strdup(ctx, name);
+ if (e->name)
+ free(e->name);
+ e->name = name;
+
+ return 0;
+}
+
+
+int uci_delete(struct uci_context *ctx, struct uci_package *p, char *section, char *option)