bbf: Added ieee1905 code

This commit is contained in:
nevadita.chatterjee 2020-09-01 17:35:26 +05:30 committed by Amin Ben Ramdhane
parent efdef65178
commit 725981c900
5 changed files with 2102 additions and 26 deletions

View file

@ -82,6 +82,7 @@ libbbfdm_la_SOURCES += \
../dmtree/tr181/dynamicdns.c \
../dmtree/tr181/security.c \
../dmtree/tr181/lanconfigsecurity.c \
../dmtree/tr181/ieee1905.c \
../dmtree/tr181/qos.c
endif

View file

@ -47,6 +47,7 @@
#include "dynamicdns.h"
#include "lanconfigsecurity.h"
#include "security.h"
#include "ieee1905.h"
#ifdef BBF_TR104
#include "servicesvoiceservice.h"
#endif
@ -105,6 +106,7 @@ DMOBJ tRoot_181_Obj[] = {
{"Firewall", &DMREAD, NULL, NULL, "file:/etc/config/firewall", NULL, NULL, NULL, NULL, tFirewallObj, tFirewallParams, NULL, BBFDM_BOTH},
{"DNS", &DMREAD, NULL, NULL, "file:/etc/config/dhcp", NULL, NULL, NULL, NULL, tDNSObj, tDNSParams, NULL, BBFDM_BOTH},
{"Users", &DMREAD, NULL, NULL, "file:/etc/config/users", NULL, NULL, NULL, NULL, tUsersObj, tUsersParams, NULL, BBFDM_BOTH},
{"IEEE1905", &DMREAD, NULL, NULL, "file:/etc/config/ieee1905;ubus:ieee1905->info", NULL, NULL, NULL, NULL, tIEEE1905Obj , tIEEE1905Params, NULL, BBFDM_BOTH},
{"InterfaceStack", &DMREAD, NULL, NULL, "file:/etc/config/network", browseInterfaceStackInst, NULL, NULL, NULL, NULL, tInterfaceStackParams, NULL, BBFDM_BOTH},
{"USB", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tUSBObj, tUSBParams, NULL, BBFDM_BOTH},
{"GRE", &DMREAD, NULL, NULL, "file:/lib/netifd/proto/gre.sh", NULL, NULL, NULL, NULL, tGREObj, tGREParams, NULL, BBFDM_BOTH},

1617
dmtree/tr181/ieee1905.c Normal file

File diff suppressed because it is too large Load diff

49
dmtree/tr181/ieee1905.h Normal file
View file

@ -0,0 +1,49 @@
/*
* Copyright (C) 2020 iopsys Software Solutions AB
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation
*
* Author: <Nevadita> <Chatterjee> <nevadita.chatterjee@iopsys.eu>
*/
#ifndef __IEEE1905_H
#define __IEEE1905_H
#include <libbbf_api/dmcommon.h>
extern DMOBJ tIEEE1905Obj[];
extern DMLEAF tIEEE1905Params[];
extern DMOBJ tIEEE1905ALObj[];
extern DMLEAF tIEEE1905ALParams[];
extern DMOBJ tIEEE1905ALInterfaceObj[];
extern DMLEAF tIEEE1905ALInterfaceParams[];
extern DMLEAF tIEEE1905ALInterfaceVendorPropertiesParams[];
extern DMOBJ tIEEE1905ALInterfaceLinkObj[];
extern DMLEAF tIEEE1905ALInterfaceLinkParams[];
extern DMLEAF tIEEE1905ALInterfaceLinkMetricParams[];
extern DMOBJ tIEEE1905ALForwardingTableObj[];
extern DMLEAF tIEEE1905ALForwardingTableParams[];
extern DMLEAF tIEEE1905ALForwardingTableForwardingRuleParams[];
extern DMOBJ tIEEE1905ALNetworkTopologyObj[];
extern DMLEAF tIEEE1905ALNetworkTopologyParams[];
extern DMLEAF tIEEE1905ALNetworkTopologyChangeLogParams[];
extern DMOBJ tIEEE1905ALNetworkTopologyIEEE1905DeviceObj[];
extern DMLEAF tIEEE1905ALNetworkTopologyIEEE1905DeviceParams[];
extern DMLEAF tIEEE1905ALNetworkTopologyIEEE1905DeviceIPv4AddressParams[];
extern DMLEAF tIEEE1905ALNetworkTopologyIEEE1905DeviceIPv6AddressParams[];
extern DMLEAF tIEEE1905ALNetworkTopologyIEEE1905DeviceVendorPropertiesParams[];
extern DMLEAF tIEEE1905ALNetworkTopologyIEEE1905DeviceInterfaceParams[];
extern DMLEAF tIEEE1905ALNetworkTopologyIEEE1905DeviceNonIEEE1905NeighborParams[];
extern DMLEAF tIEEE1905ALNetworkTopologyIEEE1905DeviceL2NeighborParams[];
extern DMOBJ tIEEE1905ALNetworkTopologyIEEE1905DeviceIEEE1905NeighborObj[];
extern DMLEAF tIEEE1905ALNetworkTopologyIEEE1905DeviceIEEE1905NeighborParams[];
extern DMLEAF tIEEE1905ALNetworkTopologyIEEE1905DeviceIEEE1905NeighborMetricParams[];
extern DMLEAF tIEEE1905ALNetworkTopologyIEEE1905DeviceBridgingTupleParams[];
extern DMLEAF tIEEE1905ALSecurityParams[];
extern DMLEAF tIEEE1905ALNetworkingRegistrarParams[];
#endif //__IEEE1905_H

View file

@ -67301,7 +67301,18 @@
"enumerations": [
"1905.1",
"1905.1a"
]
],
"mapping": [
{
"type": "ubus",
"ubus": {
"object": "ieee1905",
"method": "info",
"args": {},
"key": "Version"
}
}
]
},
"Device.IEEE1905.AL.": {
"type": "object",
@ -67327,6 +67338,17 @@
],
"pattern": [
"([0-9A-Fa-f][0-9A-Fa-f]:){5}([0-9A-Fa-f][0-9A-Fa-f])"
],
"mapping": [
{
"type": "ubus",
"ubus": {
"object": "ieee1905",
"method": "info",
"args": {},
"key": "IEEE1905Id"
}
}
]
},
"Status": {
@ -67349,7 +67371,18 @@
"NotPresent",
"LowerLayerDown",
"Error"
]
],
"mapping": [
{
"type": "ubus",
"ubus": {
"object": "ieee1905",
"method": "info",
"args": {},
"key": "Status"
}
}
]
},
"LastChange": {
"type": "unsignedInt",
@ -67360,7 +67393,18 @@
"usp"
],
"datatype": "unsignedInt",
"unit": "seconds"
"unit": "seconds",
"mapping": [
{
"type": "ubus",
"ubus": {
"object": "ieee1905",
"method": "info",
"args": {},
"key": "LastChange"
}
}
]
},
"LowerLayers": {
"type": "string",
@ -67391,7 +67435,18 @@
"802.11 5 GHz",
"802.11 60 GHz"
]
}
},
"mapping": [
{
"type": "ubus",
"ubus": {
"object": "ieee1905",
"method": "info",
"args": {},
"key": "RegistrarFreqBand"
}
}
]
},
"InterfaceNumberOfEntries": {
"type": "unsignedInt",
@ -67401,7 +67456,18 @@
"cwmp",
"usp"
],
"datatype": "unsignedInt"
"datatype": "unsignedInt",
"mapping": [
{
"type": "ubus",
"ubus": {
"object": "ieee1905",
"method": "info",
"args": {},
"key": "interface_num"
}
}
]
},
"Device.IEEE1905.AL.Interface.{i}.": {
"type": "object",
@ -67411,6 +67477,15 @@
],
"access": false,
"array": true,
"mapping": {
"type": "ubus",
"ubus": {
"object": "ieee1905",
"method": "info",
"args": {},
"key": "interfaces"
}
},
"InterfaceId": {
"type": "string",
"read": true,
@ -67427,6 +67502,17 @@
],
"pattern": [
"([0-9A-Fa-f][0-9A-Fa-f]:){5}([0-9A-Fa-f][0-9A-Fa-f])"
],
"mapping": [
{
"type": "ubus",
"ubus": {
"object": "ieee1905",
"method": "info",
"args": {},
"key": "interfaces[@i-1].mac"
}
}
]
},
"Status": {
@ -67511,6 +67597,17 @@
"IEEE 1901 FFT",
"MoCAv1.1",
"Generic PHY"
],
"mapping": [
{
"type": "ubus",
"ubus": {
"object": "ieee1905",
"method": "info",
"args": {},
"key": "interfaces[@i-1].interface_type"
}
}
]
},
"GenericPhyOUI": {
@ -67587,7 +67684,18 @@
"Power_Save",
"Off",
"Unsupported"
]
],
"mapping": [
{
"type": "ubus",
"ubus": {
"object": "ieee1905",
"method": "info",
"args": {},
"key": "interfaces[@i-1].power_state"
}
}
]
},
"VendorPropertiesNumberOfEntries": {
"type": "unsignedInt",
@ -67597,7 +67705,19 @@
"cwmp",
"usp"
],
"datatype": "unsignedInt"
"datatype": "unsignedInt",
"mapping": [
{
"type": "ubus",
"ubus": {
"object": "ieee1905",
"method": "info",
"args": {},
"key": "interfaces[@i-1].vendor_nr"
}
}
]
},
"LinkNumberOfEntries": {
"type": "unsignedInt",
@ -67607,7 +67727,18 @@
"cwmp",
"usp"
],
"datatype": "unsignedInt"
"datatype": "unsignedInt",
"mapping": [
{
"type": "ubus",
"ubus": {
"object": "ieee1905",
"method": "info",
"args": {},
"key": "interfaces[@i-1].neighbour_nr"
}
}
]
},
"Device.IEEE1905.AL.Interface.{i}.VendorProperties.{i}.": {
"type": "object",
@ -67660,6 +67791,15 @@
],
"access": false,
"array": true,
"mapping": {
"type": "ubus",
"ubus": {
"object": "ieee1905.al.Name",
"method": "link_info",
"args": {},
"key": "Links"
}
},
"InterfaceId": {
"type": "string",
"read": true,
@ -67676,7 +67816,18 @@
],
"pattern": [
"([0-9A-Fa-f][0-9A-Fa-f]:){5}([0-9A-Fa-f][0-9A-Fa-f])"
]
],
"mapping": [
{
"type": "ubus",
"ubus": {
"object": "ieee1905.al.Name",
"method": "link_info",
"args": {},
"key": "Links[@i-1].InterfaceId"
}
}
]
},
"IEEE1905Id": {
"type": "string",
@ -67694,7 +67845,18 @@
],
"pattern": [
"([0-9A-Fa-f][0-9A-Fa-f]:){5}([0-9A-Fa-f][0-9A-Fa-f])"
]
],
"mapping": [
{
"type": "ubus",
"ubus": {
"object": "ieee1905.al.Name",
"method": "link_info",
"args": {},
"key": "Links[@i-1].IEEE1905Id"
}
}
]
},
"MediaType": {
"type": "string",
@ -67720,7 +67882,18 @@
"IEEE 1901 FFT",
"MoCAv1.1",
"Generic PHY"
]
],
"mapping": [
{
"type": "ubus",
"ubus": {
"object": "ieee1905.al.Name",
"method": "link_info",
"args": {},
"key": "Links[@i-1].MediaType"
}
}
]
},
"GenericPhyOUI": {
"type": "string",
@ -67905,7 +68078,22 @@
"cwmp",
"usp"
],
"datatype": "boolean"
"datatype": "boolean",
"mapping": [
{
"type": "uci",
"uci": {
"file": "ieee1905",
"section": {
"type": "forwarding_table",
"name": "forwarding_table"
},
"option": {
"name": "forwarding_enabled"
}
}
}
]
},
"ForwardingRuleNumberOfEntries": {
"type": "unsignedInt",
@ -67915,7 +68103,21 @@
"cwmp",
"usp"
],
"datatype": "unsignedInt"
"datatype": "unsignedInt",
"mapping": [
{
"type": "uci",
"uci": {
"file": "ieee1905",
"section": {
"type": "forwarding_rule"
},
"option": {
"name": "forwarding_rule_nr"
}
}
}
]
},
"Device.IEEE1905.AL.ForwardingTable.ForwardingRule.{i}.": {
"type": "object",
@ -67925,6 +68127,16 @@
],
"access": true,
"array": true,
"mapping": {
"type": "uci",
"uci": {
"file": "ieee1905",
"section": {
"type": "forwarding_rule"
},
"dmmapfile": "dmmap_forwarding_rule"
}
},
"InterfaceList": {
"type": "string",
"read": true,
@ -67940,7 +68152,22 @@
"max": 256
}
]
}
},
"mapping": [
{
"type": "uci",
"uci": {
"file": "dmmap_forwarding_rule",
"section": {
"type": "forwarding_rule",
"index": "@i-1"
},
"option": {
"name": "interface_list"
}
}
}
]
},
"MACDestinationAddress": {
"type": "string",
@ -67958,7 +68185,22 @@
],
"pattern": [
"([0-9A-Fa-f][0-9A-Fa-f]:){5}([0-9A-Fa-f][0-9A-Fa-f])"
]
],
"mapping": [
{
"type": "uci",
"uci": {
"file": "dmmap_forwarding_rule",
"section": {
"type": "forwarding_rule",
"index": "@i-1"
},
"option": {
"name": "mac_destination_addr"
}
}
}
]
},
"MACDestinationAddressFlag": {
"type": "boolean",
@ -67968,7 +68210,22 @@
"cwmp",
"usp"
],
"datatype": "boolean"
"datatype": "boolean",
"mapping": [
{
"type": "uci",
"uci": {
"file": "dmmap_forwarding_rule",
"section": {
"type": "forwarding_rule",
"index": "@i-1"
},
"option": {
"name": "mac_destination_addr_flag"
}
}
}
]
},
"MACSourceAddress": {
"type": "string",
@ -67986,7 +68243,22 @@
],
"pattern": [
"([0-9A-Fa-f][0-9A-Fa-f]:){5}([0-9A-Fa-f][0-9A-Fa-f])"
]
],
"mapping": [
{
"type": "uci",
"uci": {
"file": "dmmap_forwarding_rule",
"section": {
"type": "forwarding_rule",
"index": "@i-1"
},
"option": {
"name": "mac_source_addr"
}
}
}
]
},
"MACSourceAddressFlag": {
"type": "boolean",
@ -67996,7 +68268,22 @@
"cwmp",
"usp"
],
"datatype": "boolean"
"datatype": "boolean",
"mapping": [
{
"type": "uci",
"uci": {
"file": "dmmap_forwarding_rule",
"section": {
"type": "forwarding_rule",
"index": "@i-1"
},
"option": {
"name": "mac_source_addr_flag"
}
}
}
]
},
"EtherType": {
"type": "unsignedInt",
@ -68006,7 +68293,22 @@
"cwmp",
"usp"
],
"datatype": "unsignedInt"
"datatype": "unsignedInt",
"mapping": [
{
"type": "uci",
"uci": {
"file": "dmmap_forwarding_rule",
"section": {
"type": "forwarding_rule",
"index": "@i-1"
},
"option": {
"name": "ether_type"
}
}
}
]
},
"EtherTypeFlag": {
"type": "boolean",
@ -68016,7 +68318,22 @@
"cwmp",
"usp"
],
"datatype": "boolean"
"datatype": "boolean",
"mapping": [
{
"type": "uci",
"uci": {
"file": "dmmap_forwarding_rule",
"section": {
"type": "forwarding_rule",
"index": "@i-1"
},
"option": {
"name": "ether_type_flag"
}
}
}
]
},
"Vid": {
"type": "unsignedInt",
@ -68032,7 +68349,22 @@
"min": 0,
"max": 4095
}
]
],
"mapping": [
{
"type": "uci",
"uci": {
"file": "dmmap_forwarding_rule",
"section": {
"type": "forwarding_rule",
"index": "@i-1"
},
"option": {
"name": "vid"
}
}
}
]
},
"VidFlag": {
"type": "boolean",
@ -68042,7 +68374,22 @@
"cwmp",
"usp"
],
"datatype": "boolean"
"datatype": "boolean",
"mapping": [
{
"type": "uci",
"uci": {
"file": "dmmap_forwarding_rule",
"section": {
"type": "forwarding_rule",
"index": "@i-1"
},
"option": {
"name": "vid_flag"
}
}
}
]
},
"PCP": {
"type": "unsignedInt",
@ -68058,7 +68405,22 @@
"min": 0,
"max": 7
}
]
],
"mapping": [
{
"type": "uci",
"uci": {
"file": "dmmap_forwarding_rule",
"section": {
"type": "forwarding_rule",
"index": "@i-1"
},
"option": {
"name": "pcp"
}
}
}
]
},
"PCPFlag": {
"type": "boolean",
@ -68068,7 +68430,22 @@
"cwmp",
"usp"
],
"datatype": "boolean"
"datatype": "boolean",
"mapping": [
{
"type": "uci",
"uci": {
"file": "dmmap_forwarding_rule",
"section": {
"type": "forwarding_rule",
"index": "@i-1"
},
"option": {
"name": "pcp_flag"
}
}
}
]
}
}
},
@ -69218,7 +69595,22 @@
"PBC",
"NFCNK"
]
}
},
"mapping": [
{
"type": "uci",
"uci": {
"file": "ieee1905",
"section": {
"type": "security",
"name": "security"
},
"option": {
"name": "method"
}
}
}
]
},
"Password": {
"type": "string",
@ -69228,7 +69620,22 @@
"cwmp",
"usp"
],
"datatype": "string"
"datatype": "string",
"mapping": [
{
"type": "uci",
"uci": {
"file": "ieee1905",
"section": {
"type": "security",
"name": "security"
},
"option": {
"name": "key"
}
}
}
]
}
},
"Device.IEEE1905.AL.NetworkingRegistrar.": {