From 58ff5de657cf73166e840d6e7d5c44673da25eed Mon Sep 17 00:00:00 2001 From: Amin Ben Ramdhane Date: Fri, 19 Feb 2021 15:20:05 +0100 Subject: [PATCH] bbf: implement Device.PPP.Interface.{i}.IPv6CP.RemoteInterfaceIdentifier parameter --- dmtree/tr181/ppp.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dmtree/tr181/ppp.c b/dmtree/tr181/ppp.c index ecd41e8e..026046a3 100644 --- a/dmtree/tr181/ppp.c +++ b/dmtree/tr181/ppp.c @@ -246,6 +246,16 @@ static int get_PPPInterfaceIPv6CP_LocalInterfaceIdentifier(char *refparam, struc return 0; } +static int get_PPPInterfaceIPv6CP_RemoteInterfaceIdentifier(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) +{ + json_object *res = NULL; + + dmubus_call("network.interface", "status", UBUS_ARGS{{"interface", section_name((struct uci_section *)data), String}}, 1, &res); + DM_ASSERT(res, *value = ""); + *value = dmjson_get_value(res, 2, "data", "llremote"); + return 0; +} + static int ppp_read_sysfs(struct uci_section *sect, const char *name, char **value) { char *proto; @@ -582,7 +592,7 @@ DMLEAF tPPPInterfaceIPCPParams[] = { DMLEAF tPPPInterfaceIPv6CPParams[] = { /* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/ {"LocalInterfaceIdentifier", &DMREAD, DMT_STRING, get_PPPInterfaceIPv6CP_LocalInterfaceIdentifier, NULL, BBFDM_BOTH}, -//{"RemoteInterfaceIdentifier", &DMREAD, DMT_STRING, get_PPPInterfaceIPv6CP_RemoteInterfaceIdentifier, NULL, BBFDM_BOTH}, +{"RemoteInterfaceIdentifier", &DMREAD, DMT_STRING, get_PPPInterfaceIPv6CP_RemoteInterfaceIdentifier, NULL, BBFDM_BOTH}, {0} };