Added support for OpenVPN Object

This commit is contained in:
Amin Ben Romdhane 2024-02-06 09:08:01 +00:00 committed by Vivek Kumar Dutta
parent 0826d70838
commit 0bde2364b6
3 changed files with 17 additions and 3 deletions

View file

@ -164,7 +164,9 @@ If we consider multi-instance objects, they are kind of special because we have
@Count => Returns the count of instances
@Value => Replace with the value passed in set command, used for ubus set
@Value => Replace with the value passed in set command, only used for ubus **set**
@Input.XXX => Replace with the value passed in Input 'XXX' option, only used for ubus **operate**
## How to have different mappings for get/set:
```json

View file

@ -327,8 +327,12 @@ static void resolve_all_symbols(struct dmctx *ctx, void *data, char *instance, c
if (idx_pos != 0 && nbr_instances - idx_pos >= 0)
pos += snprintf(&new_key[pos], key_len - pos, "%s.", ctx->inst_buf[nbr_instances - idx_pos] ? ctx->inst_buf[nbr_instances - idx_pos] : "");
} else
} else if (strcmp(pch, "@Input") == 0) {
pos += snprintf(&new_key[pos], key_len - pos, "%s.", pchr ? dmjson_get_value((json_object *)value, 1, pchr) : "");
break;
} else {
pos += snprintf(&new_key[pos], key_len - pos, "%s.", pch);
}
}
if (pos && !has_dot)
@ -981,7 +985,7 @@ static int ubus_set_operate(json_object *mapping_obj, int json_version, char *re
if (args) {
struct ubus_arg u_args[16] = {0};
int u_args_size = fill_ubus_arguments(ctx, data, instance, "", nbr_instances, json_version, args, u_args);
int u_args_size = fill_ubus_arguments(ctx, data, instance, value, nbr_instances, json_version, args, u_args);
if (u_args_size != 0) {
in_args = json_object_new_object();

View file

@ -115,6 +115,14 @@
"src/times.c"
]
},
{
"repo": "https://dev.iopsys.eu/feed/openwrt-packages.git",
"proto": "git",
"version": "devel",
"dm_files": [
"net/openvpn/files/etc/bbfdm/plugins/OpenVPN_DM.json"
]
},
{
"repo": "https://dev.iopsys.eu/voice/tr104.git",
"proto": "git",