mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
Cleanup code
This commit is contained in:
parent
a132a1915a
commit
0636a0f457
12 changed files with 112 additions and 1446 deletions
|
|
@ -222,37 +222,6 @@ int bbf_set_alias(struct dmctx *ctx, struct uci_section *s, char *option_name, c
|
|||
return 0;
|
||||
}
|
||||
|
||||
int bbf_get_reference_param(char *path, char *key_name, char *key_value, char **value) // To be removed later!!!!!!!!!!!!
|
||||
{
|
||||
BBF_ERR("Use bbfdm_get_references API in place of %s API, this API will be removed later!!!", __func__);
|
||||
|
||||
if (DM_STRLEN(path) == 0 || DM_STRLEN(key_name) == 0 || DM_STRLEN(key_value) == 0 || !value)
|
||||
return -1;
|
||||
|
||||
dmasprintf(value, "%s[%s==\"%s\"].", path, key_name, key_value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bbf_get_reference_args(char *value, struct dm_reference *reference_args) // To be removed later!!!!!!!!!!!!
|
||||
{
|
||||
BBF_ERR("Use bbfdm_get_reference_linker API in place of %s API, this API will be removed later!!!", __func__);
|
||||
|
||||
if (DM_STRLEN(value) == 0)
|
||||
return -1;
|
||||
|
||||
reference_args->path = value;
|
||||
|
||||
char *seperator = strstr(value, "=>");
|
||||
if (!seperator)
|
||||
return -1;
|
||||
|
||||
*seperator = 0;
|
||||
|
||||
reference_args->value = seperator + 2;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bbfdm_get_references(struct dmctx *ctx, int match_action, const char *base_path, char *key_name, char *key_value, char *out, size_t out_len)
|
||||
{
|
||||
char param_path[1024] = {0};
|
||||
|
|
@ -433,100 +402,29 @@ int bbfdm_operate_reference_linker(struct dmctx *ctx, char *reference_path, char
|
|||
return 0;
|
||||
}
|
||||
|
||||
__attribute__ ((deprecated)) int bbf_validate_string(char *value, int min_length, int max_length, char *enumeration[], char *pattern[])
|
||||
__attribute__ ((deprecated)) int bbf_get_reference_param(char *path, char *key_name, char *key_value, char **value)
|
||||
{
|
||||
struct dmctx ctx = {0};
|
||||
if (DM_STRLEN(path) == 0 || DM_STRLEN(key_name) == 0 || DM_STRLEN(key_value) == 0 || !value)
|
||||
return -1;
|
||||
|
||||
return bbfdm_validate_string(&ctx, value, min_length, max_length, enumeration, pattern);
|
||||
dmasprintf(value, "%s[%s==\"%s\"].", path, key_name, key_value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
__attribute__ ((deprecated)) int bbf_validate_boolean(char *value)
|
||||
__attribute__ ((deprecated)) int bbf_get_reference_args(char *value, struct dm_reference *reference_args)
|
||||
{
|
||||
struct dmctx ctx = {0};
|
||||
if (DM_STRLEN(value) == 0)
|
||||
return -1;
|
||||
|
||||
return bbfdm_validate_boolean(&ctx, value);
|
||||
}
|
||||
|
||||
__attribute__ ((deprecated)) int bbf_validate_unsignedInt(char *value, struct range_args r_args[], int r_args_size)
|
||||
{
|
||||
struct dmctx ctx = {0};
|
||||
|
||||
return bbfdm_validate_unsignedInt(&ctx, value, r_args, r_args_size);
|
||||
}
|
||||
|
||||
__attribute__ ((deprecated)) int bbf_validate_int(char *value, struct range_args r_args[], int r_args_size)
|
||||
{
|
||||
struct dmctx ctx = {0};
|
||||
|
||||
return bbfdm_validate_int(&ctx, value, r_args, r_args_size);
|
||||
}
|
||||
|
||||
__attribute__ ((deprecated)) int bbf_validate_unsignedLong(char *value, struct range_args r_args[], int r_args_size)
|
||||
{
|
||||
struct dmctx ctx = {0};
|
||||
|
||||
return bbfdm_validate_unsignedLong(&ctx, value, r_args, r_args_size);
|
||||
}
|
||||
|
||||
__attribute__ ((deprecated)) int bbf_validate_long(char *value, struct range_args r_args[], int r_args_size)
|
||||
{
|
||||
struct dmctx ctx = {0};
|
||||
|
||||
return bbfdm_validate_long(&ctx, value, r_args, r_args_size);
|
||||
}
|
||||
|
||||
__attribute__ ((deprecated)) int bbf_validate_dateTime(char *value)
|
||||
{
|
||||
struct dmctx ctx = {0};
|
||||
|
||||
return bbfdm_validate_dateTime(&ctx, value);
|
||||
}
|
||||
|
||||
__attribute__ ((deprecated)) int bbf_validate_hexBinary(char *value, struct range_args r_args[], int r_args_size)
|
||||
{
|
||||
struct dmctx ctx = {0};
|
||||
|
||||
return bbfdm_validate_hexBinary(&ctx, value, r_args, r_args_size);
|
||||
}
|
||||
|
||||
__attribute__ ((deprecated)) int bbf_validate_string_list(char *value, int min_item, int max_item, int max_size, int min, int max, char *enumeration[], char *pattern[])
|
||||
{
|
||||
struct dmctx ctx = {0};
|
||||
|
||||
return bbfdm_validate_string_list(&ctx, value, min_item,max_item, max_size, min, max, enumeration, pattern);
|
||||
}
|
||||
|
||||
__attribute__ ((deprecated)) int bbf_validate_unsignedInt_list(char *value, int min_item, int max_item, int max_size, struct range_args r_args[], int r_args_size)
|
||||
{
|
||||
struct dmctx ctx = {0};
|
||||
|
||||
return bbfdm_validate_unsignedInt_list(&ctx, value, min_item, max_item, max_size, r_args, r_args_size);
|
||||
}
|
||||
|
||||
__attribute__ ((deprecated)) int bbf_validate_int_list(char *value, int min_item, int max_item, int max_size, struct range_args r_args[], int r_args_size)
|
||||
{
|
||||
struct dmctx ctx = {0};
|
||||
|
||||
return bbfdm_validate_int_list(&ctx, value, min_item, max_item, max_size, r_args, r_args_size);
|
||||
}
|
||||
|
||||
__attribute__ ((deprecated)) int bbf_validate_unsignedLong_list(char *value, int min_item, int max_item, int max_size, struct range_args r_args[], int r_args_size)
|
||||
{
|
||||
struct dmctx ctx = {0};
|
||||
|
||||
return bbfdm_validate_unsignedLong_list(&ctx, value, min_item, max_item, max_size, r_args, r_args_size);
|
||||
}
|
||||
|
||||
__attribute__ ((deprecated)) int bbf_validate_long_list(char *value, int min_item, int max_item, int max_size, struct range_args r_args[], int r_args_size)
|
||||
{
|
||||
struct dmctx ctx = {0};
|
||||
|
||||
return bbfdm_validate_long_list(&ctx, value, min_item, max_item, max_size, r_args, r_args_size);
|
||||
}
|
||||
|
||||
__attribute__ ((deprecated)) int bbf_validate_hexBinary_list(char *value, int min_item, int max_item, int max_size, struct range_args r_args[], int r_args_size)
|
||||
{
|
||||
struct dmctx ctx = {0};
|
||||
|
||||
return bbfdm_validate_hexBinary_list(&ctx, value, min_item, max_item, max_size, r_args, r_args_size);
|
||||
reference_args->path = value;
|
||||
|
||||
char *seperator = strstr(value, "=>");
|
||||
if (!seperator)
|
||||
return -1;
|
||||
|
||||
*seperator = 0;
|
||||
|
||||
reference_args->value = seperator + 2;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ typedef struct dm_obj_s {
|
|||
struct dm_dynamic_leaf *dynamicleaf;
|
||||
struct dm_obj_s *nextobj;
|
||||
struct dm_leaf_s *leaf;
|
||||
int (*get_linker)(char *refparam, struct dmctx *dmctx, void *data, char *instance, char **linker);
|
||||
int (*get_linker)(char *refparam, struct dmctx *dmctx, void *data, char *instance, char **linker); // To be removed later!!!!!!!!!!!!
|
||||
int bbfdm_type;
|
||||
const char **unique_keys; // To be removed later!!!!!!!!!!!!
|
||||
} DMOBJ;
|
||||
|
|
@ -213,14 +213,6 @@ typedef struct dmnode {
|
|||
bool is_ubus_service;
|
||||
} DMNODE;
|
||||
|
||||
enum operate_ret_status {
|
||||
CMD_SUCCESS __attribute__ ((deprecated)),
|
||||
CMD_INVALID_ARGUMENTS __attribute__ ((deprecated)),
|
||||
CMD_FAIL __attribute__ ((deprecated)),
|
||||
CMD_NOT_FOUND __attribute__ ((deprecated)),
|
||||
__STATUS_MAX __attribute__ ((deprecated)),
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
const char **in;
|
||||
const char **out;
|
||||
|
|
@ -426,7 +418,7 @@ struct range_args {
|
|||
const char *max;
|
||||
};
|
||||
|
||||
struct dmmap_dup {
|
||||
struct __attribute__((deprecated("'dmmap_dup' is deprecated, please use the new structure 'dm_data'"))) dmmap_dup {
|
||||
struct list_head list;
|
||||
struct uci_section *config_section;
|
||||
struct uci_section *dmmap_section;
|
||||
|
|
|
|||
|
|
@ -15,55 +15,9 @@
|
|||
|
||||
#include "dmcommon.h"
|
||||
|
||||
char *Encapsulation[] = {"LLC", "VCMUX", NULL};
|
||||
char *LinkType[] = {"EoA", "IPoA", "PPPoA", "CIP", "Unconfigured", NULL};
|
||||
char *BridgeStandard[] = {"802.1D-2004", "802.1Q-2005", "802.1Q-2011", NULL};
|
||||
char *BridgeType[] = {"ProviderNetworkPort", "CustomerNetworkPort", "CustomerEdgePort", "CustomerVLANPort", "VLANUnawarePort", NULL};
|
||||
char *VendorClassIDMode[] = {"Exact", "Prefix", "Suffix", "Substring", NULL};
|
||||
char *DiagnosticsState[] = {"None", "Requested", "Canceled", "Complete", "Error", NULL};
|
||||
char *SupportedProtocols[] = {"HTTP", "HTTPS", NULL};
|
||||
char *InstanceMode[] = {"InstanceNumber", "InstanceAlias", NULL};
|
||||
char *NATProtocol[] = {"TCP", "UDP", NULL};
|
||||
char *Config[] = {"High", "Low", "Off", "Advanced", NULL};
|
||||
char *Target[] = {"Drop", "Accept", "Reject", "Return", "TargetChain", NULL};
|
||||
char *ServerConnectAlgorithm[] = {"DNS-SRV", "DNS", "ServerTable", "WebSocket", NULL};
|
||||
char *KeepAlivePolicy[] = {"ICMP", "None", NULL};
|
||||
char *DeliveryHeaderProtocol[] = {"IPv4", "IPv6", NULL};
|
||||
char *KeyIdentifierGenerationPolicy[] = {"Disabled", "Provisioned", "CPE_Generated", NULL};
|
||||
char *PreambleType[] = {"short", "long", "auto", NULL};
|
||||
char *MFPConfig[] = {"Disabled", "Optional", "Required", NULL};
|
||||
char *DuplexMode[] = {"Half", "Full", "Auto", NULL};
|
||||
char *RequestedState[] = {"Idle", "Active", NULL};
|
||||
char *BulkDataProtocols[] = {"Streaming", "File", "HTTP", NULL};
|
||||
char *EncodingTypes[] = {"XML", "XDR", "CSV", "JSON", NULL};
|
||||
char *CSVReportFormat[] = {"ParameterPerRow", "ParameterPerColumn", NULL};
|
||||
char *RowTimestamp[] = {"Unix-Epoch", "ISO-8601", "None", NULL};
|
||||
char *JSONReportFormat[] = {"ObjectHierarchy", "NameValuePair", NULL};
|
||||
char *StaticType[] = {"Static", "Inapplicable", "PrefixDelegation", "Child", NULL};
|
||||
char *ProtocolVersion[] = {"Any", "IPv4", "IPv6", NULL};
|
||||
char *ServerSelectionProtocol[] = {"ICMP", "UDP Echo", NULL};
|
||||
char *DHCPType[] = {"DHCPv4", "DHCPv6", NULL};
|
||||
char *DropAlgorithm[] = {"RED", "DT", "WRED", "BLUE", NULL};
|
||||
char *SchedulerAlgorithm[] = {"WFQ", "WRR", "SP", NULL};
|
||||
char *ProfileEnable[] = {"Disabled", "Quiescent", "Enabled", NULL};
|
||||
char *SupportedOperatingChannelBandwidth[] = {"20MHz", "40MHz", "80MHz", "160MHz", "320MHz", "80+80MHz", "Auto", NULL};
|
||||
char *SupportedStandards[] = {"a", "b", "g", "n", "ac", "ax", "be", NULL};
|
||||
char *SupportedFrequencyBands[] = {"2.4GHz", "5GHz", "6GHz", NULL};
|
||||
char *Provider_Bridge_Type[] = {"S-VLAN", "PE", NULL};
|
||||
char *AdvPreferredRouterFlag[] = {"High", "Medium", "Low", NULL};
|
||||
char *PowerState[] = {"On", "Power_Save", "Off", "Unsupported", NULL};
|
||||
char *FW_Mode[] = {"AnyTime", "Immediately", "WhenIdle", "ConfirmationNeeded", NULL};
|
||||
char *AKMsAllowed[] = {"psk", "dpp", "sae", "psk+sae", "dpp+sae", "dpp+psk+sae", "SuiteSelector", NULL};
|
||||
char *CellularDataPreference[] = {"Excluded", "Should not use", "Should use", NULL};
|
||||
char *IPLayerCapacityRole[] = {"Receiver", "Sender", NULL};
|
||||
char *UDPPayloadContent[] = {"zeroes", "random", NULL};
|
||||
char *IPLayerCapacityTestType[] = {"Search", "Fixed", NULL};
|
||||
char *RateAdjAlgorithm[] = {"B", "C", NULL};
|
||||
|
||||
char *PIN[] = {"^\\d{4}|\\d{8}$", NULL};
|
||||
char *DestinationAddress[] = {"^\\d+/\\d+$", NULL};
|
||||
char *RegulatoryDomain[] = {"^[A-Z][A-Z]$", "^[A-Z][A-Z][ OI]$", NULL};
|
||||
char *ConformingAction[] = {"^Null$", "^Drop$", "^[0-9]|[1-5][0-9]|6[0-3]$", "^:[0-7]$", "^([0-9]|[1-5][0-9]|6[0-3]):[0-7]$", NULL};
|
||||
char *DiagnosticsState[] = {"None", "Requested", "Canceled", "Complete", "Error", NULL};
|
||||
|
||||
char *IPv4Address[] = {"^$", "^((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])$", NULL};
|
||||
char *IPv6Address[] = {"^$", "^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$", NULL};
|
||||
char *IPAddress[] = {"^$", "^((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])$", "^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$", NULL};
|
||||
|
|
@ -72,101 +26,6 @@ char *IPPrefix[] = {"^$", "^/(3[0-2]|[012]?[0-9])$", "^((25[0-5]|2[0-4][0-9]|[01
|
|||
char *IPv4Prefix[] = {"^$", "^/(3[0-2]|[012]?[0-9])$", "^((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])/(3[0-2]|[012]?[0-9])$", NULL};
|
||||
char *IPv6Prefix[] = {"^$", "^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))/(12[0-8]|1[0-1][0-9]|[0-9]?[0-9])$", NULL};
|
||||
|
||||
struct dhcp_options_type DHCP_OPTIONS_ARRAY[] = {
|
||||
/* config_name, tag, type, length */
|
||||
{"subnet", 1, OPTION_IP, 4}, /* DHCP_SUBNET */
|
||||
{"timezone", 2, OPTION_INT, 4}, /* DHCP_TIME_OFFSET */
|
||||
{"router", 3, OPTION_IP|OPTION_LIST, 4}, /* DHCP_ROUTER */
|
||||
{"timesrv", 4, OPTION_IP|OPTION_LIST, 4}, /* DHCP_TIME_SERVER */
|
||||
{"namesrv", 5, OPTION_IP|OPTION_LIST, 4}, /* DHCP_NAME_SERVER */
|
||||
{"dns", 6, OPTION_IP|OPTION_LIST, 4}, /* DHCP_DNS_SERVER */
|
||||
{"logsrv", 7, OPTION_IP|OPTION_LIST, 4}, /* DHCP_LOG_SERVER */
|
||||
{"cookiesrv", 8, OPTION_IP|OPTION_LIST, 4}, /* DHCP_COOKIE_SERVER */
|
||||
{"lprsrv", 9, OPTION_IP|OPTION_LIST, 4}, /* DHCP_LPR_SERVER */
|
||||
{"", 10, OPTION_IP|OPTION_LIST, 4}, /* DHCP_IMPRESS_SERVER */
|
||||
{"", 11, OPTION_IP|OPTION_LIST, 4}, /* DHCP_RLP SERVER */
|
||||
{"hostname", 12, OPTION_STRING, 0}, /* DHCP_HOST_NAME */
|
||||
{"bootsize", 13, OPTION_INT, 2}, /* DHCP_BOOT_SIZE */
|
||||
{"domain", 15, OPTION_STRING, 0}, /* DHCP_DOMAIN_NAME */
|
||||
{"swapsrv", 16, OPTION_IP, 4}, /* DHCP_SWAP_SERVER */
|
||||
{"rootpath", 17, OPTION_STRING, 0}, /* DHCP_ROOT_PATH */
|
||||
{"", 19, OPTION_INT, 1}, /* DHCP_FORWARD */
|
||||
{"", 20, OPTION_INT, 1}, /* DHCP_SOURCE_ROUTING */
|
||||
{"", 21, OPTION_IP, 4}, /* DHCP_POLICY_FILTER */
|
||||
{"", 22, OPTION_INT, 2}, /* DHCP_MAX_DG_ASSEMBLY */
|
||||
{"ipttl", 23, OPTION_INT, 1}, /* DHCP_IP_TTL */
|
||||
{"", 24, OPTION_INT, 4}, /* DHCP_MTU_TIMEOUT */
|
||||
{"", 25, OPTION_INT, 2}, /* DHCP_MTU_PLATEAU */
|
||||
{"mtu", 26, OPTION_INT, 2}, /* DHCP_MTU_INTERFACE */
|
||||
{"", 27, OPTION_INT, 1}, /* DHCP_MTU_SUBNET */
|
||||
{"broadcast", 28, OPTION_IP, 4}, /* DHCP_BROADCAST */
|
||||
{"", 29, OPTION_INT, 1}, /* DHCP_MASK_DISCOVERY */
|
||||
{"", 30, OPTION_INT, 1}, /* DHCP_MASK_SUPPLIER */
|
||||
{"", 31, OPTION_INT, 1}, /* DHCP_ROUTER_DISCOVERY */
|
||||
{"", 32, OPTION_IP, 4}, /* DHCP_ROUTER_REQUEST */
|
||||
{"routes", 33, OPTION_IP|OPTION_LIST, 4}, /* DHCP_ROUTES */
|
||||
{"", 34, OPTION_INT, 1}, /* DHCP_TRAILER */
|
||||
{"", 35, OPTION_INT, 4}, /* DHCP_ARP_TIMEOUT */
|
||||
{"", 36, OPTION_INT, 1}, /* DHCP_ETHERNET */
|
||||
{"", 37, OPTION_INT, 1}, /* DHCP_DEFAULT_TCP_TTL */
|
||||
{"", 38, OPTION_INT, 4}, /* DHCP_KEEPALIVE_TIME */
|
||||
{"", 39, OPTION_INT, 1}, /* DHCP_KEEPALIVE_DATA */
|
||||
{"nisdomain", 40, OPTION_STRING, 0}, /* DHCP_NIS_DOMAIN */
|
||||
{"nissrv", 41, OPTION_IP|OPTION_LIST, 4}, /* DHCP_NIS_SERVER */
|
||||
{"ntpsrv", 42, OPTION_IP|OPTION_LIST, 4}, /* DHCP_NTP_SERVER */
|
||||
{"", 43, OPTION_HEX, 1}, /* DHCP_VENDOR_SPECIFIC */
|
||||
{"wins", 44, OPTION_IP|OPTION_LIST, 4}, /* DHCP_WINS_SERVER */
|
||||
{"", 46, OPTION_INT, 1}, /* DHCP_NETBIOS */
|
||||
{"", 50, OPTION_IP, 4}, /* DHCP_ADDRESS_REQUEST */
|
||||
{"lease", 51, OPTION_INT, 4}, /* DHCP_LEASE_TIME */
|
||||
{"", 52, OPTION_INT, 1}, /* DHCP_OVERLOAD */
|
||||
{"", 53, OPTION_INT, 1}, /* DHCP_MESSSAGE_TYPE */
|
||||
{"serverid", 54, OPTION_IP, 4}, /* DHCP_SERVER_ID */
|
||||
{"", 55, OPTION_INT|OPTION_LIST, 1}, /* DHCP_PARAM_LIST */
|
||||
{"message", 56, OPTION_STRING, 0}, /* DHCP_ERR_MESSAGE */
|
||||
{"", 57, OPTION_INT, 2}, /* DHCP_MAX_MESSAGE_SIZE */
|
||||
{"", 58, OPTION_INT, 4}, /* DHCP_RENEWAL_TIME */
|
||||
{"", 59, OPTION_INT, 4}, /* DHCP_REBINDING_TIME */
|
||||
{"vendor", 60, OPTION_STRING, 0}, /* DHCP_VENDOR */
|
||||
{"", 61, OPTION_HEX, 1}, /* DHCP_CLIENT_IDENTIFIER */
|
||||
{"", 65, OPTION_IP, 4}, /* DHCP_NIS_SERVER_ADDR */
|
||||
{"tftp", 66, OPTION_STRING, 0}, /* DHCP_TFTP_SERVER_NAME */
|
||||
{"bootfile", 67, OPTION_STRING, 0}, /* DHCP_BOOT_FILE */
|
||||
{"", 68, OPTION_IP, 4}, /* DHCP_HOME_AGENT */
|
||||
{"", 69, OPTION_IP, 4}, /* DHCP_SMTP_SERVER */
|
||||
{"", 70, OPTION_IP, 4}, /* DHCP_POP3_SERVER */
|
||||
{"", 71, OPTION_IP, 4}, /* DHCP_NNTP_SERVER */
|
||||
{"", 72, OPTION_IP, 4}, /* DHCP_WWW_SERVER */
|
||||
{"", 73, OPTION_IP, 4}, /* DHCP_FINGER_SERVER */
|
||||
{"", 74, OPTION_IP, 4}, /* DHCP_IRC_SERVER */
|
||||
{"", 75, OPTION_IP, 4}, /* DHCP_STREET_TALK_SERVER */
|
||||
{"", 76, OPTION_IP, 4}, /* DHCP_STDA_SERVER */
|
||||
{"userclass", 77, OPTION_STRING, 0}, /* DHCP_USER_CLASS */
|
||||
{"tzstr", 100, OPTION_STRING, 0}, /* DHCP_PCODE */
|
||||
{"tzdbstr", 101, OPTION_STRING, 0}, /* DHCP_TCODE */
|
||||
{"", 118, OPTION_IP, 4}, /* DHCP_SUBNET_SELECTION */
|
||||
{"search", 119, OPTION_STRING|OPTION_LIST, 0}, /* DHCP_DOMAIN_SEARCH */
|
||||
{"sipsrv", 120, OPTION_STRING, 0}, /* DHCP_SIP_SERVERS */
|
||||
{"staticroutes", 121, OPTION_STRING|OPTION_LIST, 0}, /* DHCP_STATIC_ROUTES */
|
||||
{"", 125, OPTION_HEX, 1}, /* DHCP_VI_VENDOR_SPECIFIC */
|
||||
{"vlanid", 132, OPTION_INT, 2}, /* DHCP_VLAN_ID */
|
||||
{"vlanpriority", 133, OPTION_INT, 1}, /* DHCP_VLAN_PRIORITY */
|
||||
{"", 145, OPTION_INT, 1}, /* DHCP_FORCERENEW */
|
||||
{"", 152, OPTION_INT, 4}, /* DHCP_BASE_TIME */
|
||||
{"", 153, OPTION_INT, 4}, /* DHCP_START_TIME */
|
||||
{"", 154, OPTION_INT, 4}, /* DHCP_QUERY_START_TIME */
|
||||
{"", 155, OPTION_INT, 4}, /* DHCP_QUERY_END_TIME */
|
||||
{"", 156, OPTION_INT, 1}, /* DHCP_STATE */
|
||||
{"", 157, OPTION_INT, 1}, /* DHCP_DATA_SOURCE */
|
||||
{"", 159, OPTION_INT, 4}, /* DHCP_PORT_PARAMS */
|
||||
{"pxeconffile", 209, OPTION_STRING, 0}, /* DHCP_PXE_CONF_FILE */
|
||||
{"pxepathprefix", 210, OPTION_STRING, 0}, /* DHCP_PXE_PATH_PREFIX */
|
||||
{"reboottime", 211, OPTION_INT, 4}, /* DHCP_REBOOT_TIME */
|
||||
{"ip6rd", 212, OPTION_STRING, 0}, /* DHCP_6RD */
|
||||
{"msstaticroutes", 249, OPTION_STRING|OPTION_LIST, 0}, /* DHCP_MS_STATIC_ROUTES */
|
||||
{"wpad", 225, OPTION_STRING, 0}, /* DHCP_WPAD */
|
||||
};
|
||||
|
||||
pid_t get_pid(const char *pname)
|
||||
{
|
||||
DIR* dir;
|
||||
|
|
@ -611,58 +470,6 @@ void synchronize_specific_config_sections_with_dmmap_cont(char *package, char *s
|
|||
}
|
||||
}
|
||||
|
||||
void add_sysfs_section_list(struct list_head *dup_list, struct uci_section *dmmap_section, char *file_name, char *file_path)
|
||||
{
|
||||
struct sysfs_dmsection *dmmap_sysfs;
|
||||
|
||||
dmmap_sysfs = dmcalloc(1, sizeof(struct sysfs_dmsection));
|
||||
list_add_tail(&dmmap_sysfs->list, dup_list);
|
||||
dmmap_sysfs->dmmap_section = dmmap_section;
|
||||
dmmap_sysfs->sysfs_folder_name = dmstrdup(file_name);
|
||||
dmmap_sysfs->sysfs_folder_path = dmstrdup(file_path);
|
||||
}
|
||||
|
||||
int synchronize_system_folders_with_dmmap_opt(char *sysfsrep, char *dmmap_package, char *dmmap_section, char *opt_name, char* inst_opt, struct list_head *dup_list)
|
||||
{
|
||||
struct uci_section *s = NULL, *stmp = NULL, *dmmap_sect = NULL;
|
||||
char sysfs_rep_path[512];
|
||||
DIR *dir;
|
||||
struct dirent *ent;
|
||||
|
||||
sysfs_foreach_file(sysfsrep, dir, ent) {
|
||||
if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0)
|
||||
continue;
|
||||
|
||||
/*
|
||||
* create/update corresponding dmmap section that have same config_section link and using param_value_array
|
||||
*/
|
||||
snprintf(sysfs_rep_path, sizeof(sysfs_rep_path), "%s/%s", sysfsrep, ent->d_name);
|
||||
if ((dmmap_sect = get_dup_section_in_dmmap_opt(dmmap_package, dmmap_section, opt_name, sysfs_rep_path)) == NULL) {
|
||||
dmuci_add_section_bbfdm(dmmap_package, dmmap_section, &dmmap_sect);
|
||||
dmuci_set_value_by_section_bbfdm(dmmap_sect, opt_name, sysfs_rep_path);
|
||||
}
|
||||
|
||||
/*
|
||||
* Add system and dmmap sections to the list
|
||||
*/
|
||||
add_sysfs_section_list(dup_list, dmmap_sect, ent->d_name, sysfs_rep_path);
|
||||
}
|
||||
if (dir)
|
||||
closedir(dir);
|
||||
|
||||
/*
|
||||
* Delete unused dmmap sections
|
||||
*/
|
||||
uci_path_foreach_sections_safe(bbfdm, dmmap_package, dmmap_section, stmp, s) {
|
||||
char *opt_val = NULL;
|
||||
|
||||
dmuci_get_value_by_section_string(s, opt_name, &opt_val);
|
||||
if (!folder_exists(opt_val))
|
||||
dmuci_delete_by_section(s, NULL, NULL);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void get_dmmap_section_of_config_section(char* dmmap_package, char* section_type, char *section_name, struct uci_section **dmmap_section)
|
||||
{
|
||||
struct uci_section *s;
|
||||
|
|
@ -1195,135 +1002,6 @@ void convert_hex_to_string(const char *hex, char *str, size_t size)
|
|||
str[pos] = '\0';
|
||||
}
|
||||
|
||||
int get_dhcp_option_number_by_name(const char *tag_name)
|
||||
{
|
||||
if (!DM_STRLEN(tag_name))
|
||||
return -1;
|
||||
|
||||
for (int i = 0; i < ARRAY_SIZE(DHCP_OPTIONS_ARRAY); i++) {
|
||||
|
||||
if (DM_STRLEN(DHCP_OPTIONS_ARRAY[i].config_name) == 0)
|
||||
continue;
|
||||
|
||||
if (strcmp(DHCP_OPTIONS_ARRAY[i].config_name, tag_name) == 0)
|
||||
return DHCP_OPTIONS_ARRAY[i].tag;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
void convert_str_option_to_hex(unsigned int tag, const char *str, char *hex, size_t size)
|
||||
{
|
||||
int idx = -1;
|
||||
|
||||
if (str == NULL || hex == NULL || size == 0)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < ARRAY_SIZE(DHCP_OPTIONS_ARRAY); i++) {
|
||||
if (DHCP_OPTIONS_ARRAY[i].tag == tag) {
|
||||
idx = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (idx == -1) {
|
||||
convert_string_to_hex(str, hex, size);
|
||||
return;
|
||||
}
|
||||
|
||||
char *pch = NULL, *spch = NULL;
|
||||
unsigned pos = 0;
|
||||
char buf[512] = {0};
|
||||
|
||||
DM_STRNCPY(buf, str, sizeof(buf));
|
||||
|
||||
char *separator = (DHCP_OPTIONS_ARRAY[idx].type & OPTION_LIST) ? "," : "\0";
|
||||
|
||||
for (pch = strtok_r(buf, separator, &spch); pch != NULL; pch = strtok_r(NULL, separator, &spch)) {
|
||||
if (DHCP_OPTIONS_ARRAY[idx].type & OPTION_IP) {
|
||||
struct in_addr ip_bin;
|
||||
|
||||
if (!inet_aton(pch, &ip_bin))
|
||||
continue;
|
||||
|
||||
unsigned int ip = ntohl(ip_bin.s_addr);
|
||||
|
||||
if (size - pos < DHCP_OPTIONS_ARRAY[idx].len * 2)
|
||||
return;
|
||||
|
||||
pos += snprintf(&hex[pos], size - pos, "%08X", ip);
|
||||
} else if (DHCP_OPTIONS_ARRAY[idx].type & OPTION_HEX) {
|
||||
for (int j = 0; j < DM_STRLEN(pch) && pos < size - 1; j++) {
|
||||
if (pch[j] == ':')
|
||||
continue;
|
||||
|
||||
pos += snprintf(&hex[pos], size - pos, "%c", pch[j]);
|
||||
}
|
||||
} else if (DHCP_OPTIONS_ARRAY[idx].type & OPTION_STRING) {
|
||||
convert_string_to_hex(pch, hex, size);
|
||||
} else {
|
||||
long int val = DM_STRTOL(pch);
|
||||
|
||||
if (size - pos < DHCP_OPTIONS_ARRAY[idx].len * 2)
|
||||
return;
|
||||
|
||||
pos += snprintf(&hex[pos], size - pos, (DHCP_OPTIONS_ARRAY[idx].len == 4) ? "%08lX" : (DHCP_OPTIONS_ARRAY[idx].len == 2) ? "%04lX" : "%02lX", val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void convert_hex_option_to_string(unsigned int tag, const char *hex, char *str, size_t size)
|
||||
{
|
||||
int idx = -1;
|
||||
|
||||
if (hex == NULL || str == NULL || size == 0)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < ARRAY_SIZE(DHCP_OPTIONS_ARRAY); i++) {
|
||||
if (DHCP_OPTIONS_ARRAY[i].tag == tag) {
|
||||
idx = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (idx == -1) {
|
||||
convert_hex_to_string(hex, str, size);
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned pos = 0;
|
||||
unsigned int str_len = DM_STRLEN(hex);
|
||||
unsigned int len = DHCP_OPTIONS_ARRAY[idx].len * 2;
|
||||
char buffer[32] = {0};
|
||||
char buf[16] = {0};
|
||||
|
||||
for (int i = 0; i + len <= str_len; i = i + len) {
|
||||
DM_STRNCPY(buf, &hex[i], len + 1);
|
||||
|
||||
if (DHCP_OPTIONS_ARRAY[idx].type & OPTION_IP) {
|
||||
struct in_addr addr;
|
||||
unsigned int ip;
|
||||
|
||||
sscanf(buf, "%X", &ip);
|
||||
addr.s_addr = htonl(ip);
|
||||
char *ipaddr = inet_ntoa(addr);
|
||||
snprintf(buffer, sizeof(buffer), "%s,", ipaddr);
|
||||
} else if (DHCP_OPTIONS_ARRAY[idx].type & OPTION_HEX) {
|
||||
snprintf(buffer, sizeof(buffer), "%s:", buf);
|
||||
} else {
|
||||
snprintf(buffer, sizeof(buffer), "%d,", (int)strtol(buf, NULL, 16));
|
||||
}
|
||||
|
||||
if (size - pos < DM_STRLEN(buffer) + 1)
|
||||
break;
|
||||
|
||||
pos += snprintf(&str[pos], size - pos, "%s", buffer);
|
||||
}
|
||||
|
||||
if (pos)
|
||||
str[pos - 1] = 0;
|
||||
}
|
||||
|
||||
bool match(const char *string, const char *pattern, size_t nmatch, regmatch_t pmatch[])
|
||||
{
|
||||
regex_t re;
|
||||
|
|
@ -2237,17 +1915,6 @@ exit:
|
|||
return ret;
|
||||
}
|
||||
|
||||
int check_browse_section(struct uci_section *s, void *data)
|
||||
{
|
||||
struct browse_args *browse_args = (struct browse_args *)data;
|
||||
char *opt_val;
|
||||
|
||||
dmuci_get_value_by_section_string(s, browse_args->option, &opt_val);
|
||||
if (DM_STRCMP(opt_val, browse_args->value) == 0)
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int parse_proc_intf6_line(const char *line, const char *device, char *ipstr, size_t str_len)
|
||||
{
|
||||
char ip6buf[INET6_ADDRSTRLEN] = {0}, dev[32] = {0};
|
||||
|
|
@ -2274,171 +1941,6 @@ int parse_proc_intf6_line(const char *line, const char *device, char *ipstr, siz
|
|||
return 0;
|
||||
}
|
||||
|
||||
// Get IPv4 address assigned to an interface using ioctl
|
||||
// return ==> dynamically allocated IPv4 address on success,
|
||||
// ==> empty string on failure
|
||||
// Note: Ownership of returned dynamically allocated IPv4 address is with caller
|
||||
char *ioctl_get_ipv4(char *interface_name)
|
||||
{
|
||||
struct ifreq ifr;
|
||||
char *ip = "";
|
||||
int fd;
|
||||
|
||||
if (!DM_STRLEN(interface_name))
|
||||
return ip;
|
||||
|
||||
fd = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
if (fd == -1)
|
||||
goto exit;
|
||||
|
||||
ifr.ifr_addr.sa_family = AF_INET;
|
||||
DM_STRNCPY(ifr.ifr_name, interface_name, IFNAMSIZ);
|
||||
|
||||
if (ioctl(fd, SIOCGIFADDR, &ifr) == -1)
|
||||
goto exit;
|
||||
|
||||
ip = dmstrdup(inet_ntoa(((struct sockaddr_in *)&ifr.ifr_addr )->sin_addr));
|
||||
|
||||
exit:
|
||||
close(fd);
|
||||
|
||||
return ip;
|
||||
}
|
||||
|
||||
// Get Global IPv6 address assigned to an interface using ifaddrs
|
||||
// return ==> dynamically allocated IPv6 address on success,
|
||||
// ==> empty string on failure
|
||||
// Note: Ownership of returned dynamically allocated IPv6 address is with caller
|
||||
char *ifaddrs_get_global_ipv6(char *interface_name)
|
||||
{
|
||||
struct ifaddrs *ifaddr = NULL,*ifa = NULL;
|
||||
void *in_addr = NULL;
|
||||
int family, err = 0;
|
||||
char *ip = "";
|
||||
|
||||
if (!DM_STRLEN(interface_name))
|
||||
return ip;
|
||||
|
||||
err = getifaddrs(&ifaddr);
|
||||
if (err != 0)
|
||||
return ip;
|
||||
|
||||
for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) {
|
||||
|
||||
if (ifa->ifa_addr == NULL || ifa->ifa_name == NULL || strcmp(ifa->ifa_name, interface_name) != 0)
|
||||
continue;
|
||||
|
||||
// Skip this result, if it is not an IPv6 node
|
||||
family = ifa->ifa_addr->sa_family;
|
||||
if (family != AF_INET6)
|
||||
continue;
|
||||
|
||||
#define NOT_GLOBAL_UNICAST(addr) \
|
||||
( (IN6_IS_ADDR_UNSPECIFIED(addr)) || (IN6_IS_ADDR_LOOPBACK(addr)) || \
|
||||
(IN6_IS_ADDR_MULTICAST(addr)) || (IN6_IS_ADDR_LINKLOCAL(addr)) || \
|
||||
(IN6_IS_ADDR_SITELOCAL(addr)) )
|
||||
|
||||
|
||||
char buf[INET6_ADDRSTRLEN] = {0};
|
||||
|
||||
in_addr = &((struct sockaddr_in6 *)ifa->ifa_addr)->sin6_addr;
|
||||
|
||||
// Skip this result, if it is an IPv6 address, but not globally routable
|
||||
if (NOT_GLOBAL_UNICAST((struct in6_addr *)in_addr))
|
||||
continue;
|
||||
|
||||
inet_ntop(family, in_addr, buf, sizeof(buf));
|
||||
|
||||
ip = dmstrdup(buf);
|
||||
break;
|
||||
}
|
||||
|
||||
if (ifaddr)
|
||||
freeifaddrs(ifaddr);
|
||||
|
||||
return ip;
|
||||
}
|
||||
|
||||
static bool validate_blob_dataval(struct blob_attr *src_attr, struct blob_attr *dst_attr)
|
||||
{
|
||||
if (!src_attr || !dst_attr)
|
||||
return false;
|
||||
|
||||
int src_type = blob_id(src_attr);
|
||||
int dst_type = blob_id(dst_attr);
|
||||
if (src_type != dst_type)
|
||||
return false;
|
||||
|
||||
void *src_val = blobmsg_data(src_attr);
|
||||
void *dst_val = blobmsg_data(dst_attr);
|
||||
|
||||
switch (src_type) {
|
||||
case BLOBMSG_TYPE_STRING:
|
||||
if (src_val == NULL && dst_val == NULL)
|
||||
return true;
|
||||
|
||||
if (src_val && dst_val && DM_STRCMP((char *)src_val, (char*)dst_val) == 0)
|
||||
return true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*********************************************************************//**
|
||||
**
|
||||
** validate_blob_message
|
||||
**
|
||||
** This API is to validate the 'src' blob message against 'dst' blob message. It
|
||||
** validates the attributes(key:value pair) present in 'src' are also exist in 'dst'.
|
||||
** 'dst' may have more attributes than 'src'.
|
||||
**
|
||||
** NOTE: currently we only support string type value in key:val i.e if the attribute
|
||||
** in 'src' blob message is other than of type string (like array, table etc) this
|
||||
** API will return false.
|
||||
**
|
||||
** \param src - blob message to validate
|
||||
** \param dst - blob message against which the validation is performed
|
||||
**
|
||||
** \return true: if all key:value pairs in 'src' are present in 'dst'
|
||||
** false: otherwise
|
||||
**
|
||||
**************************************************************************/
|
||||
bool validate_blob_message(struct blob_attr *src, struct blob_attr *dst)
|
||||
{
|
||||
if (!src || !dst)
|
||||
return false;
|
||||
|
||||
size_t src_len = (size_t)blobmsg_data_len(src);
|
||||
size_t dst_len = (size_t)blobmsg_data_len(dst);
|
||||
|
||||
if (dst_len < src_len)
|
||||
return false;
|
||||
|
||||
bool res = true;
|
||||
struct blob_attr *src_attr, *dst_attr;
|
||||
|
||||
__blob_for_each_attr(src_attr, blobmsg_data(src), src_len) {
|
||||
bool matched = false;
|
||||
__blob_for_each_attr(dst_attr, blobmsg_data(dst), dst_len) {
|
||||
if (DM_STRCMP(blobmsg_name(src_attr), blobmsg_name(dst_attr)) != 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
matched = validate_blob_dataval(src_attr, dst_attr);
|
||||
break;
|
||||
}
|
||||
if (matched == false) {
|
||||
res = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
char *diagnostics_get_option(char *sec_name, char *option)
|
||||
{
|
||||
char *value = NULL;
|
||||
|
|
@ -2577,447 +2079,3 @@ long upload_file(const char *file_path, const char *url, const char *username, c
|
|||
|
||||
return res_code;
|
||||
}
|
||||
|
||||
/**********************
|
||||
*
|
||||
* Deprecated functions
|
||||
*
|
||||
**********************/
|
||||
__attribute__ ((deprecated)) int dm_validate_string(char *value, int min_length, int max_length, char *enumeration[], char *pattern[])
|
||||
{
|
||||
struct dmctx ctx = {0};
|
||||
|
||||
/* check size */
|
||||
if (bbfdm_validate_string_length(&ctx, value, min_length, max_length))
|
||||
return -1;
|
||||
|
||||
/* check enumeration */
|
||||
if (enumeration && bbfdm_validate_string_enumeration(&ctx, value, enumeration))
|
||||
return -1;
|
||||
|
||||
/* check pattern */
|
||||
if (pattern && bbfdm_validate_string_pattern(&ctx, value, pattern))
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
__attribute__ ((deprecated)) int dm_validate_boolean(char *value)
|
||||
{
|
||||
/* check format */
|
||||
if ((value[0] == '1' && value[1] == '\0') ||
|
||||
(value[0] == '0' && value[1] == '\0') ||
|
||||
!strcasecmp(value, "true") ||
|
||||
!strcasecmp(value, "false")) {
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
__attribute__ ((deprecated)) int dm_validate_unsignedInt(char *value, struct range_args r_args[], int r_args_size)
|
||||
{
|
||||
if (!value || value[0] == 0)
|
||||
return -1;
|
||||
|
||||
/* check size for each range */
|
||||
for (int i = 0; i < r_args_size; i++) {
|
||||
unsigned long ui_val = 0, minval = 0, maxval = 0;
|
||||
char *endval = NULL, *endmin = NULL, *endmax = NULL;
|
||||
|
||||
if (r_args[i].min) minval = strtoul(r_args[i].min, &endmin, 10);
|
||||
if (r_args[i].max) maxval = strtoul(r_args[i].max, &endmax, 10);
|
||||
|
||||
/* reset errno to 0 before call */
|
||||
errno = 0;
|
||||
|
||||
ui_val = strtoul(value, &endval, 10);
|
||||
|
||||
if ((*value == '-') || (*endval != 0) || (errno != 0)) return -1;
|
||||
|
||||
if (r_args[i].min && r_args[i].max) {
|
||||
|
||||
if (minval == maxval) {
|
||||
if (strlen(value) == minval)
|
||||
break;
|
||||
} else {
|
||||
if (ui_val >= minval && ui_val <= maxval)
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == r_args_size - 1)
|
||||
return -1;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
/* check size */
|
||||
if ((r_args[i].min && ui_val < minval) || (r_args[i].max && ui_val > maxval) || (ui_val > (unsigned int)UINT_MAX))
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
__attribute__ ((deprecated)) int dm_validate_int(char *value, struct range_args r_args[], int r_args_size)
|
||||
{
|
||||
if (!value || value[0] == 0)
|
||||
return -1;
|
||||
|
||||
/* check size for each range */
|
||||
for (int i = 0; i < r_args_size; i++) {
|
||||
long i_val = 0, minval = 0, maxval = 0;
|
||||
char *endval = NULL, *endmin = NULL, *endmax = NULL;
|
||||
|
||||
if (r_args[i].min) minval = strtol(r_args[i].min, &endmin, 10);
|
||||
if (r_args[i].max) maxval = strtol(r_args[i].max, &endmax, 10);
|
||||
|
||||
/* reset errno to 0 before call */
|
||||
errno = 0;
|
||||
|
||||
i_val = strtol(value, &endval, 10);
|
||||
|
||||
if ((*endval != 0) || (errno != 0)) return -1;
|
||||
|
||||
if (r_args[i].min && r_args[i].max) {
|
||||
|
||||
if (i_val >= minval && i_val <= maxval)
|
||||
break;
|
||||
|
||||
if (i == r_args_size - 1)
|
||||
return -1;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
/* check size */
|
||||
if ((r_args[i].min && i_val < minval) || (r_args[i].max && i_val > maxval) || (i_val < INT_MIN) || (i_val > INT_MAX))
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
__attribute__ ((deprecated)) int dm_validate_unsignedLong(char *value, struct range_args r_args[], int r_args_size)
|
||||
{
|
||||
if (!value || value[0] == 0)
|
||||
return -1;
|
||||
|
||||
/* check size for each range */
|
||||
for (int i = 0; i < r_args_size; i++) {
|
||||
unsigned long ul_val = 0, minval = 0, maxval = 0;
|
||||
char *endval = NULL, *endmin = NULL, *endmax = NULL;
|
||||
|
||||
if (r_args[i].min) minval = strtoul(r_args[i].min, &endmin, 10);
|
||||
if (r_args[i].max) maxval = strtoul(r_args[i].max, &endmax, 10);
|
||||
|
||||
/* reset errno to 0 before call */
|
||||
errno = 0;
|
||||
|
||||
ul_val = strtoul(value, &endval, 10);
|
||||
|
||||
if ((*value == '-') || (*endval != 0) || (errno != 0)) return -1;
|
||||
|
||||
if (r_args[i].min && r_args[i].max) {
|
||||
|
||||
if (ul_val >= minval && ul_val <= maxval)
|
||||
break;
|
||||
|
||||
if (i == r_args_size - 1)
|
||||
return -1;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
/* check size */
|
||||
if ((r_args[i].min && ul_val < minval) || (r_args[i].max && ul_val > maxval) || (ul_val > (unsigned long)ULONG_MAX))
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
__attribute__ ((deprecated)) int dm_validate_long(char *value, struct range_args r_args[], int r_args_size)
|
||||
{
|
||||
if (!value || value[0] == 0)
|
||||
return -1;
|
||||
|
||||
/* check size for each range */
|
||||
for (int i = 0; i < r_args_size; i++) {
|
||||
long u_val = 0, minval = 0, maxval = 0;
|
||||
char *endval = NULL, *endmin = NULL, *endmax = NULL;
|
||||
|
||||
if (r_args[i].min) minval = strtol(r_args[i].min, &endmin, 10);
|
||||
if (r_args[i].max) maxval = strtol(r_args[i].max, &endmax, 10);
|
||||
|
||||
/* reset errno to 0 before call */
|
||||
errno = 0;
|
||||
|
||||
u_val = strtol(value, &endval, 10);
|
||||
|
||||
if ((*endval != 0) || (errno != 0)) return -1;
|
||||
|
||||
if (r_args[i].min && r_args[i].max) {
|
||||
|
||||
if (u_val >= minval && u_val <= maxval)
|
||||
break;
|
||||
|
||||
if (i == r_args_size - 1)
|
||||
return -1;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
/* check size */
|
||||
if ((r_args[i].min && u_val < minval) || (r_args[i].max && u_val > maxval))
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
__attribute__ ((deprecated)) int dm_validate_dateTime(char *value)
|
||||
{
|
||||
/*
|
||||
* Allowed format:
|
||||
* XXXX-XX-XXTXX:XX:XXZ
|
||||
* XXXX-XX-XXTXX:XX:XX.XXXZ
|
||||
* XXXX-XX-XXTXX:XX:XX.XXXXXXZ
|
||||
*/
|
||||
|
||||
char *p = NULL;
|
||||
struct tm tm;
|
||||
int m;
|
||||
|
||||
p = strptime(value, "%Y-%m-%dT%H:%M:%SZ", &tm);
|
||||
if (p && *p == '\0')
|
||||
return 0;
|
||||
|
||||
p = strptime(value, "%Y-%m-%dT%H:%M:%S.", &tm);
|
||||
if (!p || *p == '\0' || value[DM_STRLEN(value) - 1] != 'Z')
|
||||
return -1;
|
||||
|
||||
int num_parsed = sscanf(p, "%dZ", &m);
|
||||
if (num_parsed != 1 || (DM_STRLEN(p) != 7 && DM_STRLEN(p) != 4))
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
__attribute__ ((deprecated)) int dm_validate_hexBinary(char *value, struct range_args r_args[], int r_args_size)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* check format */
|
||||
for (i = 0; i < DM_STRLEN(value); i++) {
|
||||
if (!isxdigit(value[i]))
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* check size */
|
||||
for (i = 0; i < r_args_size; i++) {
|
||||
|
||||
if (r_args[i].min && r_args[i].max && (DM_STRTOL(r_args[i].min) == DM_STRTOL(r_args[i].max))) {
|
||||
|
||||
if (DM_STRLEN(value) == 2 * DM_STRTOL(r_args[i].max))
|
||||
break;
|
||||
|
||||
if (i == r_args_size - 1)
|
||||
return -1;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((r_args[i].min && (DM_STRLEN(value) < DM_STRTOL(r_args[i].min))) ||
|
||||
(r_args[i].max && (DM_STRLEN(value) > DM_STRTOL(r_args[i].max)))) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
__attribute__ ((deprecated)) int dm_validate_string_list(char *value, int min_item, int max_item, int max_size, int min, int max, char *enumeration[], char *pattern[])
|
||||
{
|
||||
struct dmctx ctx = {0};
|
||||
char *pch, *pchr;
|
||||
int nbr_item = 0;
|
||||
|
||||
if (!value)
|
||||
return -1;
|
||||
|
||||
/* check length of list */
|
||||
if ((max_size > 0) && (strlen(value) > max_size))
|
||||
return -1;
|
||||
|
||||
/* copy data in buffer */
|
||||
char buf[strlen(value)+1];
|
||||
DM_STRNCPY(buf, value, sizeof(buf));
|
||||
|
||||
/* for each value, validate string */
|
||||
for (pch = strtok_r(buf, ",", &pchr); pch != NULL; pch = strtok_r(NULL, ",", &pchr)) {
|
||||
if (bbfdm_validate_string(&ctx, pch, min, max, enumeration, pattern))
|
||||
return -1;
|
||||
nbr_item ++;
|
||||
}
|
||||
|
||||
/* check size of list */
|
||||
if (bbfdm_validate_size_list(&ctx, min_item, max_item, nbr_item))
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
__attribute__ ((deprecated)) int dm_validate_unsignedInt_list(char *value, int min_item, int max_item, int max_size, struct range_args r_args[], int r_args_size)
|
||||
{
|
||||
struct dmctx ctx = {0};
|
||||
char *tmp, *saveptr;
|
||||
int nbr_item = 0;
|
||||
|
||||
if (!value)
|
||||
return -1;
|
||||
|
||||
/* check length of list */
|
||||
if ((max_size > 0) && (strlen(value) > max_size))
|
||||
return -1;
|
||||
|
||||
/* copy data in buffer */
|
||||
char buf[strlen(value)+1];
|
||||
DM_STRNCPY(buf, value, sizeof(buf));
|
||||
|
||||
/* for each value, validate string */
|
||||
for (tmp = strtok_r(buf, ",", &saveptr); tmp != NULL; tmp = strtok_r(NULL, ",", &saveptr)) {
|
||||
if (bbfdm_validate_unsignedInt(&ctx, tmp, r_args, r_args_size))
|
||||
return -1;
|
||||
nbr_item ++;
|
||||
}
|
||||
|
||||
/* check size of list */
|
||||
if (bbfdm_validate_size_list(&ctx, min_item, max_item, nbr_item))
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
__attribute__ ((deprecated)) int dm_validate_int_list(char *value, int min_item, int max_item, int max_size, struct range_args r_args[], int r_args_size)
|
||||
{
|
||||
struct dmctx ctx = {0};
|
||||
char *token, *pchr;
|
||||
int nbr_item = 0;
|
||||
|
||||
if (!value)
|
||||
return -1;
|
||||
|
||||
/* check length of list */
|
||||
if ((max_size > 0) && (strlen(value) > max_size))
|
||||
return -1;
|
||||
|
||||
/* copy data in buffer */
|
||||
char buf[strlen(value)+1];
|
||||
DM_STRNCPY(buf, value, sizeof(buf));
|
||||
|
||||
/* for each value, validate string */
|
||||
for (token = strtok_r(buf, ",", &pchr); token != NULL; token = strtok_r(NULL, ",", &pchr)) {
|
||||
if (bbfdm_validate_int(&ctx, token, r_args, r_args_size))
|
||||
return -1;
|
||||
nbr_item ++;
|
||||
}
|
||||
|
||||
/* check size of list */
|
||||
if (bbfdm_validate_size_list(&ctx, min_item, max_item, nbr_item))
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
__attribute__ ((deprecated)) int dm_validate_unsignedLong_list(char *value, int min_item, int max_item, int max_size, struct range_args r_args[], int r_args_size)
|
||||
{
|
||||
struct dmctx ctx = {0};
|
||||
char *token, *tmp;
|
||||
int nbr_item = 0;
|
||||
|
||||
if (!value)
|
||||
return -1;
|
||||
|
||||
/* check length of list */
|
||||
if ((max_size > 0) && (strlen(value) > max_size))
|
||||
return -1;
|
||||
|
||||
/* copy data in buffer */
|
||||
char buf[strlen(value)+1];
|
||||
DM_STRNCPY(buf, value, sizeof(buf));
|
||||
|
||||
/* for each value, validate string */
|
||||
for (token = strtok_r(buf, ",", &tmp); token != NULL; token = strtok_r(NULL, ",", &tmp)) {
|
||||
if (bbfdm_validate_unsignedLong(&ctx, token, r_args, r_args_size))
|
||||
return -1;
|
||||
nbr_item ++;
|
||||
}
|
||||
|
||||
/* check size of list */
|
||||
if (bbfdm_validate_size_list(&ctx, min_item, max_item, nbr_item))
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
__attribute__ ((deprecated)) int dm_validate_long_list(char *value, int min_item, int max_item, int max_size, struct range_args r_args[], int r_args_size)
|
||||
{
|
||||
struct dmctx ctx = {0};
|
||||
char *pch, *saveptr;
|
||||
int nbr_item = 0;
|
||||
|
||||
if (!value)
|
||||
return -1;
|
||||
|
||||
/* check length of list */
|
||||
if ((max_size > 0) && (strlen(value) > max_size))
|
||||
return -1;
|
||||
|
||||
/* copy data in buffer */
|
||||
char buf[strlen(value)+1];
|
||||
DM_STRNCPY(buf, value, sizeof(buf));
|
||||
|
||||
/* for each value, validate string */
|
||||
for (pch = strtok_r(buf, ",", &saveptr); pch != NULL; pch = strtok_r(NULL, ",", &saveptr)) {
|
||||
if (bbfdm_validate_long(&ctx, pch, r_args, r_args_size))
|
||||
return -1;
|
||||
nbr_item ++;
|
||||
}
|
||||
|
||||
/* check size of list */
|
||||
if (bbfdm_validate_size_list(&ctx, min_item, max_item, nbr_item))
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
__attribute__ ((deprecated)) int dm_validate_hexBinary_list(char *value, int min_item, int max_item, int max_size, struct range_args r_args[], int r_args_size)
|
||||
{
|
||||
struct dmctx ctx = {0};
|
||||
char *pch, *spch;
|
||||
int nbr_item = 0;
|
||||
|
||||
if (!value)
|
||||
return -1;
|
||||
|
||||
/* check length of list */
|
||||
if ((max_size > 0) && (strlen(value) > max_size))
|
||||
return -1;
|
||||
|
||||
/* copy data in buffer */
|
||||
char buf[strlen(value)+1];
|
||||
DM_STRNCPY(buf, value, sizeof(buf));
|
||||
|
||||
/* for each value, validate string */
|
||||
for (pch = strtok_r(buf, ",", &spch); pch != NULL; pch = strtok_r(NULL, ",", &spch)) {
|
||||
if (bbfdm_validate_hexBinary(&ctx, pch, r_args, r_args_size))
|
||||
return -1;
|
||||
nbr_item ++;
|
||||
}
|
||||
|
||||
/* check size of list */
|
||||
if (bbfdm_validate_size_list(&ctx, min_item, max_item, nbr_item))
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,41 +67,7 @@
|
|||
#include "dmjson.h"
|
||||
#include "dmentry.h"
|
||||
|
||||
extern char *Encapsulation[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *LinkType[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *BridgeStandard[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *BridgeType[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *VendorClassIDMode[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *DiagnosticsState[];
|
||||
extern char *SupportedProtocols[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *InstanceMode[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *NATProtocol[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *Config[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *Target[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *ServerConnectAlgorithm[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *KeepAlivePolicy[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *DeliveryHeaderProtocol[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *KeyIdentifierGenerationPolicy[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *PreambleType[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *MFPConfig[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *DuplexMode[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *RequestedState[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *BulkDataProtocols[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *EncodingTypes[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *CSVReportFormat[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *RowTimestamp[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *JSONReportFormat[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *StaticType[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *ProtocolVersion[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *ServerSelectionProtocol[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *DHCPType[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *DropAlgorithm[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *SchedulerAlgorithm[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *ProfileEnable[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *PIN[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *DestinationAddress[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *RegulatoryDomain[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *ConformingAction[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *IPv4Address[];
|
||||
extern char *IPv6Address[];
|
||||
extern char *IPAddress[];
|
||||
|
|
@ -109,33 +75,13 @@ extern char *MACAddress[];
|
|||
extern char *IPPrefix[];
|
||||
extern char *IPv4Prefix[];
|
||||
extern char *IPv6Prefix[];
|
||||
extern char *SupportedOperatingChannelBandwidth[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *SupportedStandards[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *SupportedFrequencyBands[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *Provider_Bridge_Type[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *AdvPreferredRouterFlag[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *PowerState[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *FW_Mode[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *AKMsAllowed[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *CellularDataPreference[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *IPLayerCapacityRole[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *UDPPayloadContent[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *IPLayerCapacityTestType[]; // To be removed later!!!!!!!!!!!!
|
||||
extern char *RateAdjAlgorithm[]; // To be removed later!!!!!!!!!!!!
|
||||
|
||||
#define CRONTABS_ROOT "/etc/crontabs/root"
|
||||
#define ACTIVATE_HANDLER_FILE "/usr/share/bbfdm/scripts/bbf_activate_handler.sh"
|
||||
#define UPTIME "/proc/uptime"
|
||||
#define DEFAULT_CONFIG_DIR "/etc/config/"
|
||||
#define PROC_ROUTE "/proc/net/route"
|
||||
#define PROC_ROUTE6 "/proc/net/ipv6_route"
|
||||
#define PROC_INTF6 "/proc/net/if_inet6"
|
||||
#define MAX_DHCP_LEASES 256
|
||||
#define DHCP_LEASES_FILE "/tmp/dhcp.leases"
|
||||
#define DHCP_CLIENT_OPTIONS_FILE "/var/dhcp.client.options"
|
||||
#define SYSTEM_CERT_PATH "/etc/ssl/certs"
|
||||
#define BOARD_JSON_FILE "/etc/board.json"
|
||||
#define DMMAP "dmmap"
|
||||
#define DMMAP_DIAGNOSTIGS "dmmap_diagnostics"
|
||||
#define HTTP_URI "http"
|
||||
#define FTP_URI "ftp"
|
||||
|
|
@ -152,24 +98,6 @@ do { \
|
|||
} \
|
||||
} while(0)
|
||||
|
||||
#define dmstrappendstr(dest, src) \
|
||||
do { \
|
||||
int len = DM_STRLEN(src); \
|
||||
memcpy(dest, src, len); \
|
||||
dest += len; \
|
||||
} while(0)
|
||||
|
||||
#define dmstrappendchr(dest, c) \
|
||||
do { \
|
||||
*dest = c; \
|
||||
dest += 1; \
|
||||
} while(0)
|
||||
|
||||
#define dmstrappendend(dest) \
|
||||
do { \
|
||||
*dest = '\0'; \
|
||||
} while(0)
|
||||
|
||||
enum fs_size_type_enum {
|
||||
FS_SIZE_TOTAL,
|
||||
FS_SIZE_AVAILABLE,
|
||||
|
|
@ -188,19 +116,6 @@ enum option_type_enum {
|
|||
if ((dir = opendir(path)) == NULL) return 0; \
|
||||
while ((ent = readdir(dir)) != NULL) \
|
||||
|
||||
struct dmmap_sect {
|
||||
struct list_head list;
|
||||
char *section_name;
|
||||
char *instance;
|
||||
};
|
||||
|
||||
struct sysfs_dmsection {
|
||||
struct list_head list;
|
||||
char *sysfs_folder_path;
|
||||
char *sysfs_folder_name;
|
||||
struct uci_section *dmmap_section;
|
||||
};
|
||||
|
||||
struct browse_args {
|
||||
char *option;
|
||||
char *value;
|
||||
|
|
@ -230,19 +145,12 @@ void free_dmmap_config_dup_list(struct list_head *dup_list);
|
|||
void synchronize_specific_config_sections_with_dmmap(char *package, char *section_type, char *dmmap_package, struct list_head *dup_list);
|
||||
void synchronize_specific_config_sections_with_dmmap_eq(char *package, char *section_type, char *dmmap_package,char* option_name, char* option_value, struct list_head *dup_list);
|
||||
void synchronize_specific_config_sections_with_dmmap_cont(char *package, char *section_type, char *dmmap_package,char* option_name, char* option_value, struct list_head *dup_list);
|
||||
void add_sysfs_section_list(struct list_head *dup_list, struct uci_section *dmmap_section, char *file_name, char *file_path);
|
||||
void synchronize_specific_config_sections_with_dmmap_network(char *package, char *section_type, char *dmmap_package, struct list_head *dup_list);
|
||||
int synchronize_system_folders_with_dmmap_opt(char *sysfsrep, char *dmmap_package, char *dmmap_section, char *opt_name, char* inst_opt, struct list_head *dup_list);
|
||||
void get_dmmap_section_of_config_section(char* dmmap_package, char* section_type, char *section_name, struct uci_section **dmmap_section);
|
||||
void get_dmmap_section_of_config_section_eq(char* dmmap_package, char* section_type, char *opt, char* value, struct uci_section **dmmap_section);
|
||||
void get_dmmap_section_of_config_section_cont(char* dmmap_package, char* section_type, char *opt, char* value, struct uci_section **dmmap_section);
|
||||
void get_config_section_of_dmmap_section(char* package, char* section_type, char *section_name, struct uci_section **config_section);
|
||||
int adm_entry_get_reference_param(struct dmctx *ctx, char *param, char *linker, char **value);
|
||||
int adm_entry_get_reference_value(struct dmctx *ctx, char *param, char **value);
|
||||
int adm_entry_get_linker_param(struct dmctx *ctx, char *param, char *linker, char **value); // To be removed later!!!!!!!!!!!!
|
||||
int adm_entry_get_linker_value(struct dmctx *ctx, char *param, char **value); // To be removed later!!!!!!!!!!!!
|
||||
int dm_entry_validate_allowed_objects(struct dmctx *ctx, char *value, char *objects[]); // To be removed later!!!!!!!!!!!!
|
||||
int dm_entry_validate_external_linker_allowed_objects(struct dmctx *ctx, char *value, char *objects[]); // To be removed later!!!!!!!!!!!!
|
||||
int dm_validate_allowed_objects(struct dmctx *ctx, struct dm_reference *reference, char *objects[]);
|
||||
char *check_create_dmmap_package(const char *dmmap_package);
|
||||
unsigned int count_occurrences(const char *str, char c);
|
||||
|
|
@ -280,9 +188,6 @@ int dm_time_utc_format(time_t ts, char **dst);
|
|||
int dm_time_format(time_t ts, char **dst);
|
||||
void convert_string_to_hex(const char *str, char *hex, size_t size);
|
||||
void convert_hex_to_string(const char *hex, char *str, size_t size);
|
||||
void convert_str_option_to_hex(unsigned int tag, const char *str, char *hex, size_t size);
|
||||
void convert_hex_option_to_string(unsigned int tag, const char *hex, char *str, size_t size);
|
||||
int get_dhcp_option_number_by_name(const char *tag_name);
|
||||
bool match(const char *string, const char *pattern, size_t nmatch, regmatch_t pmatch[]);
|
||||
void bbfdm_set_fault_message(struct dmctx *ctx, const char *format, ...);
|
||||
int bbfdm_validate_boolean(struct dmctx *ctx, char *value);
|
||||
|
|
@ -301,8 +206,6 @@ int bbfdm_validate_string_list(struct dmctx *ctx, char *value, int min_item, int
|
|||
int bbfdm_validate_hexBinary_list(struct dmctx *ctx, char *value, int min_item, int max_item, int max_size, struct range_args r_args[], int r_args_size);
|
||||
int bbf_get_alias(struct dmctx *ctx, struct uci_section *s, char *option_name, char *instance, char **value);
|
||||
int bbf_set_alias(struct dmctx *ctx, struct uci_section *s, char *option_name, char *instance, char *value);
|
||||
int bbf_get_reference_param(char *path, char *key_name, char *key_value, char **value); // To be removed later!!!!!!!!!!!!
|
||||
int bbf_get_reference_args(char *value, struct dm_reference *reference_args); // To be removed later!!!!!!!!!!!!
|
||||
int bbfdm_get_references(struct dmctx *ctx, int match_action, const char *base_path, char *key_name, char *key_value, char *out, size_t out_len);
|
||||
int _bbfdm_get_references(struct dmctx *ctx, const char *base_path, char *key_name, char *key_value, char **value);
|
||||
int bbfdm_get_reference_linker(struct dmctx *ctx, char *reference_path, struct dm_reference *reference_args);
|
||||
|
|
@ -318,38 +221,15 @@ char *replace_char(char *str, char find, char replace);
|
|||
char *replace_str(const char *input_str, const char *old_substr, const char *new_substr, char *result_str, size_t buffer_len);
|
||||
int dm_file_to_buf(const char *filename, void *buf, size_t buf_size);
|
||||
int dm_file_copy(char *src, char *dst);
|
||||
int check_browse_section(struct uci_section *s, void *data);
|
||||
int parse_proc_intf6_line(const char *line, const char *device, char *ipstr, size_t str_len);
|
||||
char *ioctl_get_ipv4(char *interface_name);
|
||||
char *ifaddrs_get_global_ipv6(char *interface_name);
|
||||
bool validate_blob_message(struct blob_attr *src, struct blob_attr *dst);
|
||||
void strip_lead_trail_whitespace(char *str);
|
||||
int dm_buf_to_file(char *buf, const char *filename);
|
||||
|
||||
char *diagnostics_get_option(char *sec_name, char *option);
|
||||
char *diagnostics_get_option_fallback_def(char *sec_name, char *option, char *default_value);
|
||||
void diagnostics_set_option(char *sec_name, char *option, char *value);
|
||||
void diagnostics_reset_state(char *sec_name);
|
||||
char *diagnostics_get_interface_name(struct dmctx *ctx, char *value);
|
||||
|
||||
long download_file(char *file_path, const char *url, const char *username, const char *password);
|
||||
long upload_file(const char *file_path, const char *url, const char *username, const char *password);
|
||||
|
||||
/* Deprecated functions */
|
||||
__attribute__ ((deprecated("Use bbfdm_validate_string"))) int dm_validate_string(char *value, int min_length, int max_length, char *enumeration[], char *pattern[]);
|
||||
__attribute__ ((deprecated("Use bbfdm_validate_boolean"))) int dm_validate_boolean(char *value);
|
||||
__attribute__ ((deprecated("Use bbfdm_validate_unsignedInt"))) int dm_validate_unsignedInt(char *value, struct range_args r_args[], int r_args_size);
|
||||
__attribute__ ((deprecated("Use bbfdm_validate_int"))) int dm_validate_int(char *value, struct range_args r_args[], int r_args_size);
|
||||
__attribute__ ((deprecated("Use bbfdm_validate_unsignedLong"))) int dm_validate_unsignedLong(char *value, struct range_args r_args[], int r_args_size);
|
||||
__attribute__ ((deprecated("Use bbfdm_validate_long"))) int dm_validate_long(char *value, struct range_args r_args[], int r_args_size);
|
||||
__attribute__ ((deprecated("Use bbfdm_validate_dateTime"))) int dm_validate_dateTime(char *value);
|
||||
__attribute__ ((deprecated("Use bbfdm_validate_hexBinary"))) int dm_validate_hexBinary(char *value, struct range_args r_args[], int r_args_size);
|
||||
__attribute__ ((deprecated("Use bbfdm_validate_string_list"))) int dm_validate_string_list(char *value, int min_item, int max_item, int max_size, int min, int max, char *enumeration[], char *pattern[]);
|
||||
__attribute__ ((deprecated("Use bbfdm_validate_unsignedInt_list"))) int dm_validate_unsignedInt_list(char *value, int min_item, int max_item, int max_size, struct range_args r_args[], int r_args_size);
|
||||
__attribute__ ((deprecated("Use bbfdm_validate_int_list"))) int dm_validate_int_list(char *value, int min_item, int max_item, int max_size, struct range_args r_args[], int r_args_size);
|
||||
__attribute__ ((deprecated("Use bbfdm_validate_unsignedLong_list"))) int dm_validate_unsignedLong_list(char *value, int min_item, int max_item, int max_size, struct range_args r_args[], int r_args_size);
|
||||
__attribute__ ((deprecated("Use bbfdm_validate_long_list"))) int dm_validate_long_list(char *value, int min_item, int max_item, int max_size, struct range_args r_args[], int r_args_size);
|
||||
__attribute__ ((deprecated("Use bbfdm_validate_hexBinary_list"))) int dm_validate_hexBinary_list(char *value, int min_item, int max_item, int max_size, struct range_args r_args[], int r_args_size);
|
||||
/************************/
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -255,51 +255,6 @@ void bbf_global_clean(DMOBJ *dm_entryobj)
|
|||
dm_dynamic_cleanmem(&global_memhead);
|
||||
}
|
||||
|
||||
int dm_entry_validate_allowed_objects(struct dmctx *ctx, char *value, char *objects[]) // To be removed later!!!!!!!!!!!!
|
||||
{
|
||||
BBF_ERR("%s API will be removed later, don't use it!!!!!!", __func__);
|
||||
|
||||
if (!value || !objects)
|
||||
return -1;
|
||||
|
||||
if (*value == '\0')
|
||||
return 0;
|
||||
|
||||
for (; *objects; objects++) {
|
||||
|
||||
if (match(value, *objects, 0, NULL)) {
|
||||
char *linker = NULL;
|
||||
|
||||
adm_entry_get_linker_value(ctx, value, &linker);
|
||||
if (linker && *linker)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
bbfdm_set_fault_message(ctx, "'%s' value is not allowed.", value);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int dm_entry_validate_external_linker_allowed_objects(struct dmctx *ctx, char *value, char *objects[]) // To be removed later!!!!!!!!!!!!
|
||||
{
|
||||
BBF_ERR("%s API will be removed later, don't use it!!!!!!", __func__);
|
||||
|
||||
if (!value || !objects)
|
||||
return -1;
|
||||
|
||||
if (*value == '\0')
|
||||
return 0;
|
||||
|
||||
for (; *objects; objects++) {
|
||||
|
||||
if (match(value, *objects, 0, NULL))
|
||||
return 0;
|
||||
}
|
||||
|
||||
bbfdm_set_fault_message(ctx, "'%s' value is not allowed.", value);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int dm_validate_allowed_objects(struct dmctx *ctx, struct dm_reference *reference, char *objects[])
|
||||
{
|
||||
if (!reference || !objects)
|
||||
|
|
@ -372,52 +327,6 @@ int adm_entry_get_reference_value(struct dmctx *ctx, char *param, char **value)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int adm_entry_get_linker_param(struct dmctx *ctx, char *param, char *linker, char **value) // To be removed later!!!!!!!!!!!!
|
||||
{
|
||||
BBF_ERR("%s API will be removed later, don't use it!!!!!!", __func__);
|
||||
|
||||
struct dmctx dmctx = {0};
|
||||
*value = "";
|
||||
|
||||
if (!param || !linker || *linker == 0)
|
||||
return 0;
|
||||
|
||||
bbf_ctx_init_sub(&dmctx, ctx->dm_entryobj);
|
||||
|
||||
dmctx.in_param = param;
|
||||
dmctx.linker = linker;
|
||||
|
||||
dm_entry_get_linker(&dmctx);
|
||||
*value = dmctx.linker_param;
|
||||
|
||||
bbf_ctx_clean_sub(&dmctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int adm_entry_get_linker_value(struct dmctx *ctx, char *param, char **value) // To be removed later!!!!!!!!!!!!
|
||||
{
|
||||
BBF_ERR("%s API will be removed later, don't use it!!!!!!", __func__);
|
||||
|
||||
struct dmctx dmctx = {0};
|
||||
char linker[256] = {0};
|
||||
*value = NULL;
|
||||
|
||||
if (!param || param[0] == '\0')
|
||||
return 0;
|
||||
|
||||
snprintf(linker, sizeof(linker), "%s%c", param, (param[DM_STRLEN(param) - 1] != '.') ? '.' : '\0');
|
||||
|
||||
bbf_ctx_init_sub(&dmctx, ctx->dm_entryobj);
|
||||
|
||||
dmctx.in_param = linker;
|
||||
|
||||
dm_entry_get_linker_value(&dmctx);
|
||||
*value = dmctx.linker;
|
||||
|
||||
bbf_ctx_clean_sub(&dmctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool adm_entry_object_exists(struct dmctx *ctx, char *param) // To be removed later!!!!!!!!!!!! (After moving all Objects outside bbfdm core)
|
||||
{
|
||||
struct dmctx dmctx = {0};
|
||||
|
|
|
|||
|
|
@ -28,15 +28,10 @@ int bbf_entry_method(struct dmctx *ctx, int cmd);
|
|||
void bbf_global_init(DMOBJ *dm_entryobj, const char *plugin_path);
|
||||
void bbf_global_clean(DMOBJ *dm_entryobj);
|
||||
|
||||
int dm_entry_validate_allowed_objects(struct dmctx *ctx, char *value, char *objects[]); // To be removed later!!!!!!!!!!!!
|
||||
int dm_entry_validate_external_linker_allowed_objects(struct dmctx *ctx, char *value, char *objects[]); // To be removed later!!!!!!!!!!!!
|
||||
int dm_validate_allowed_objects(struct dmctx *ctx, struct dm_reference *reference, char *objects[]);
|
||||
|
||||
bool adm_entry_object_exists(struct dmctx *ctx, char *param); // To be removed later!!!!!!!!!!!! (After moving all Objects outside bbfdm core)
|
||||
|
||||
int adm_entry_get_linker_param(struct dmctx *ctx, char *param, char *linker, char **value); // To be removed later!!!!!!!!!!!!
|
||||
int adm_entry_get_linker_value(struct dmctx *ctx, char *param, char **value); // To be removed later!!!!!!!!!!!!
|
||||
|
||||
void bbf_entry_restart_services(struct blob_buf *bb, bool restart_services);
|
||||
void bbf_entry_revert_changes(struct blob_buf *bb);
|
||||
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ int bbf_uci_add_section(char *package, char *type, struct uci_section **s);
|
|||
** \param package - package name to delete the section
|
||||
** \param type - section type name
|
||||
** \param option - option name
|
||||
** \param value - not used (must be removed later)
|
||||
** \param value - not used
|
||||
**
|
||||
** \return 0 if the operation is successful, -1 otherwise
|
||||
**
|
||||
|
|
@ -173,7 +173,7 @@ int bbf_uci_add_section_bbfdm(char *package, char *type, struct uci_section **s)
|
|||
** \param package - package name to delete the section
|
||||
** \param type - section type name
|
||||
** \param option - option name
|
||||
** \param value - not used (must be removed later)
|
||||
** \param value - not used
|
||||
**
|
||||
** \return 0 if the operation is successful, -1 otherwise
|
||||
**
|
||||
|
|
@ -282,7 +282,7 @@ int bbf_uci_set_value_by_section(struct uci_section *s, char *option, char *valu
|
|||
**
|
||||
** \param s - section pointer of uci context
|
||||
** \param option - option name
|
||||
** \param value - not used (must be removed later)
|
||||
** \param value - not used
|
||||
**
|
||||
** \return 0 if the operation is successful, -1 otherwise
|
||||
**
|
||||
|
|
@ -584,36 +584,6 @@ int bbf_get_alias(struct dmctx *ctx, struct uci_section *s, char *option_name, c
|
|||
**************************************************************************/
|
||||
int bbf_set_alias(struct dmctx *ctx, struct uci_section *s, char *option_name, char *instance, char *value);
|
||||
|
||||
/*********************************************************************//**
|
||||
**
|
||||
** bbf_get_reference_param
|
||||
**
|
||||
** This API is used to get the reference parameter value
|
||||
**
|
||||
** \param path - parent path object
|
||||
** \param key_name - parameter name used to identify the object
|
||||
** \param key_value - value of parameter name used to identify the object
|
||||
** \param value - the value to be set
|
||||
**
|
||||
** \return 0 if operation is successful, -1 otherwise
|
||||
**
|
||||
**************************************************************************/
|
||||
int bbf_get_reference_param(char *path, char *key_name, char *key_value, char **value); // To be removed later!!!!!!!!!!!!
|
||||
|
||||
/*********************************************************************//**
|
||||
**
|
||||
** bbf_get_reference_args
|
||||
**
|
||||
** This API is used to get the reference arguments in order to set eexternal linker
|
||||
**
|
||||
** \param value -
|
||||
** \param reference -
|
||||
**
|
||||
** \return 0 if operation is successful, -1 otherwise
|
||||
**
|
||||
**************************************************************************/
|
||||
int bbf_get_reference_args(char *value, struct dm_reference *reference_args); // To be removed later!!!!!!!!!!!!
|
||||
|
||||
/*********************************************************************//**
|
||||
**
|
||||
** bbfdm_get_references
|
||||
|
|
@ -923,29 +893,12 @@ int bbfdm_validate_hexBinary_list(struct dmctx *ctx, char *value, int min_item,
|
|||
**************************************************************************/
|
||||
void bbfdm_set_fault_message(struct dmctx *ctx, const char *format, ...);
|
||||
|
||||
int bbf_get_reference_param(char *path, char *key_name, char *key_value, char **value);
|
||||
int bbf_get_reference_args(char *value, struct dm_reference *reference_args);
|
||||
|
||||
//TODO
|
||||
/**********************
|
||||
*
|
||||
* BBF DEPRECATED APIs
|
||||
*
|
||||
**********************/
|
||||
|
||||
__attribute__ ((deprecated("Use bbfdm_validate_string"))) int bbf_validate_string(char *value, int min_length, int max_length, char *enumeration[], char *pattern[]);
|
||||
__attribute__ ((deprecated("Use bbfdm_validate_boolean"))) int bbf_validate_boolean(char *value);
|
||||
__attribute__ ((deprecated("Use bbfdm_validate_unsignedInt"))) int bbf_validate_unsignedInt(char *value, struct range_args r_args[], int r_args_size);
|
||||
__attribute__ ((deprecated("Use bbfdm_validate_int"))) int bbf_validate_int(char *value, struct range_args r_args[], int r_args_size);
|
||||
__attribute__ ((deprecated("Use bbfdm_validate_unsignedLong"))) int bbf_validate_unsignedLong(char *value, struct range_args r_args[], int r_args_size);
|
||||
__attribute__ ((deprecated("Use bbfdm_validate_long"))) int bbf_validate_long(char *value, struct range_args r_args[], int r_args_size);
|
||||
__attribute__ ((deprecated("Use bbfdm_validate_dateTime"))) int bbf_validate_dateTime(char *value);
|
||||
__attribute__ ((deprecated("Use bbfdm_validate_hexBinary"))) int bbf_validate_hexBinary(char *value, struct range_args r_args[], int r_args_size);
|
||||
__attribute__ ((deprecated("Use bbfdm_validate_string_list"))) int bbf_validate_string_list(char *value, int min_item, int max_item, int max_size, int min, int max, char *enumeration[], char *pattern[]);
|
||||
__attribute__ ((deprecated("Use bbfdm_validate_unsignedInt_list"))) int bbf_validate_unsignedInt_list(char *value, int min_item, int max_item, int max_size, struct range_args r_args[], int r_args_size);
|
||||
__attribute__ ((deprecated("Use bbfdm_validate_int_list"))) int bbf_validate_int_list(char *value, int min_item, int max_item, int max_size, struct range_args r_args[], int r_args_size);
|
||||
__attribute__ ((deprecated("Use bbfdm_validate_unsignedLong_list"))) int bbf_validate_unsignedLong_list(char *value, int min_item, int max_item, int max_size, struct range_args r_args[], int r_args_size);
|
||||
__attribute__ ((deprecated("Use bbfdm_validate_long_list"))) int bbf_validate_long_list(char *value, int min_item, int max_item, int max_size, struct range_args r_args[], int r_args_size);
|
||||
__attribute__ ((deprecated("Use bbfdm_validate_hexBinary_list"))) int bbf_validate_hexBinary_list(char *value, int min_item, int max_item, int max_size, struct range_args r_args[], int r_args_size);
|
||||
__attribute__ ((deprecated("Use bbfdm_get_references"))) int bbf_get_reference_param(char *path, char *key_name, char *key_value, char **value);
|
||||
__attribute__ ((deprecated("Use bbfdm_get_reference_linker"))) int bbf_get_reference_args(char *value, struct dm_reference *reference_args);
|
||||
|
||||
#endif //__LIBBBFDM_API_H__
|
||||
|
|
|
|||
|
|
@ -1797,6 +1797,9 @@ static int get_operate_args_DeviceInfoFirmwareImage_Activate(char *refparam, str
|
|||
|
||||
static int operate_DeviceInfoFirmwareImage_Activate(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
#define CRONTABS_ROOT "/etc/crontabs/root"
|
||||
#define ACTIVATE_HANDLER_FILE "/usr/share/bbfdm/scripts/bbf_activate_handler.sh"
|
||||
|
||||
char *FW_Mode[] = {"AnyTime", "Immediately", "WhenIdle", "ConfirmationNeeded", NULL};
|
||||
char *start_time[MAX_TIME_WINDOW] = {0};
|
||||
char *end_time[MAX_TIME_WINDOW] = {0};
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@
|
|||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
|
||||
#define SYSTEM_CERT_PATH "/etc/ssl/certs"
|
||||
|
||||
static char certifcates_paths[MAX_CERT][CERT_PATH_LEN];
|
||||
|
||||
struct certificate_profile {
|
||||
|
|
|
|||
|
|
@ -613,89 +613,89 @@ static void test_bbf_api_validate(void **state)
|
|||
int validate = 0;
|
||||
|
||||
/*
|
||||
* Test of dm_validate_string function
|
||||
* Test of bbfdm_validate_string function
|
||||
*/
|
||||
|
||||
// dm_validate_string: test with wrong min value
|
||||
// bbfdm_validate_string: test with wrong min value
|
||||
validate = bbfdm_validate_string(&ctx, "test", 5, 8, NULL, NULL);
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_string: test with wrong max value
|
||||
// bbfdm_validate_string: test with wrong max value
|
||||
validate = bbfdm_validate_string(&ctx, "test", -1, 2, NULL, NULL);
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_string: test with wrong enumaration value
|
||||
// bbfdm_validate_string: test with wrong enumaration value
|
||||
validate = bbfdm_validate_string(&ctx, "test", -1, -1, DiagnosticsState, NULL);
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_string: test with wrong pattern value
|
||||
// bbfdm_validate_string: test with wrong pattern value
|
||||
validate = bbfdm_validate_string(&ctx, "test", -1, -1, NULL, IPv4Address);
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_string: test with correct min and max value
|
||||
// bbfdm_validate_string: test with correct min and max value
|
||||
validate = bbfdm_validate_string(&ctx, "bbftest", 5, 8, NULL, NULL);
|
||||
assert_int_equal(validate, 0);
|
||||
|
||||
// dm_validate_string: test with correct enumaration value
|
||||
// bbfdm_validate_string: test with correct enumaration value
|
||||
validate = bbfdm_validate_string(&ctx, "Requested", -1, -1, DiagnosticsState, NULL);
|
||||
assert_int_equal(validate, 0);
|
||||
|
||||
// dm_validate_string: test with correct pattern value
|
||||
// bbfdm_validate_string: test with correct pattern value
|
||||
validate = bbfdm_validate_string(&ctx, "10.10.9.80", -1, -1, NULL, IPv4Address);
|
||||
assert_int_equal(validate, 0);
|
||||
|
||||
|
||||
/*
|
||||
* Test of dm_validate_boolean function
|
||||
* Test of bbfdm_validate_boolean function
|
||||
*/
|
||||
|
||||
// dm_validate_boolean: test with wrong value
|
||||
// bbfdm_validate_boolean: test with wrong value
|
||||
validate = bbfdm_validate_boolean(&ctx, "test");
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_boolean: test with correct value
|
||||
// bbfdm_validate_boolean: test with correct value
|
||||
validate = bbfdm_validate_boolean(&ctx, "true");
|
||||
assert_int_equal(validate, 0);
|
||||
|
||||
|
||||
/*
|
||||
* Test of dm_validate_unsignedInt function
|
||||
* Test of bbfdm_validate_unsignedInt function
|
||||
*/
|
||||
|
||||
// dm_validate_unsignedInt: test with wrong value
|
||||
// bbfdm_validate_unsignedInt: test with wrong value
|
||||
validate = bbfdm_validate_unsignedInt(&ctx, "12t", RANGE_ARGS{{NULL,NULL}}, 1);
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_unsignedInt: test with wrong min value
|
||||
// bbfdm_validate_unsignedInt: test with wrong min value
|
||||
validate = bbfdm_validate_unsignedInt(&ctx, "1", RANGE_ARGS{{"12",NULL}}, 1);
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_unsignedInt: test with wrong max value
|
||||
// bbfdm_validate_unsignedInt: test with wrong max value
|
||||
validate = bbfdm_validate_unsignedInt(&ctx, "112", RANGE_ARGS{{NULL,"50"}}, 1);
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
|
||||
// dm_validate_unsignedInt: test without min/max value
|
||||
// bbfdm_validate_unsignedInt: test without min/max value
|
||||
validate = bbfdm_validate_unsignedInt(&ctx, "112", RANGE_ARGS{{NULL,NULL}}, 1);
|
||||
assert_int_equal(validate, 0);
|
||||
|
||||
// dm_validate_unsignedInt: test with correct min/max value
|
||||
// bbfdm_validate_unsignedInt: test with correct min/max value
|
||||
validate = bbfdm_validate_unsignedInt(&ctx, "112", RANGE_ARGS{{"10","1000"}}, 1);
|
||||
assert_int_equal(validate, 0);
|
||||
|
||||
// dm_validate_unsignedInt: test with multi range and wrong value
|
||||
// bbfdm_validate_unsignedInt: test with multi range and wrong value
|
||||
validate = bbfdm_validate_unsignedInt(&ctx, "5420", RANGE_ARGS{{"10","1000"},{"11200","45000"}}, 2);
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_unsignedInt: test with multi range and correct value
|
||||
// bbfdm_validate_unsignedInt: test with multi range and correct value
|
||||
validate = bbfdm_validate_unsignedInt(&ctx, "50", RANGE_ARGS{{"10","1000"},{"11200","45000"}}, 2);
|
||||
assert_int_equal(validate, 0);
|
||||
|
||||
// dm_validate_unsignedInt: test with wrong value
|
||||
// bbfdm_validate_unsignedInt: test with wrong value
|
||||
validate = bbfdm_validate_unsignedInt(&ctx, "112", RANGE_ARGS{{"4","4"}}, 1);
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_unsignedInt: test with correct value
|
||||
// bbfdm_validate_unsignedInt: test with correct value
|
||||
validate = bbfdm_validate_unsignedInt(&ctx, "1124", RANGE_ARGS{{"4","4"}}, 1);
|
||||
assert_int_equal(validate, 0);
|
||||
|
||||
|
|
@ -704,31 +704,31 @@ static void test_bbf_api_validate(void **state)
|
|||
* Test of dm_validate_int function
|
||||
*/
|
||||
|
||||
// dm_validate_int: test with wrong value
|
||||
// bbfdm_validate_int: test with wrong value
|
||||
validate = bbfdm_validate_int(&ctx, "-12t", RANGE_ARGS{{NULL,NULL}}, 1);
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_int: test with wrong min value
|
||||
// bbfdm_validate_int: test with wrong min value
|
||||
validate = bbfdm_validate_int(&ctx, "-1", RANGE_ARGS{{"12",NULL}}, 1);
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_int: test with wrong max value
|
||||
// bbfdm_validate_int: test with wrong max value
|
||||
validate = bbfdm_validate_int(&ctx, "-1", RANGE_ARGS{{NULL,"-5"}}, 1);
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_int: test without min/max value
|
||||
// bbfdm_validate_int: test without min/max value
|
||||
validate = bbfdm_validate_int(&ctx, "-112", RANGE_ARGS{{NULL,NULL}}, 1);
|
||||
assert_int_equal(validate, 0);
|
||||
|
||||
// dm_validate_int: test with correct min/max value
|
||||
// bbfdm_validate_int: test with correct min/max value
|
||||
validate = bbfdm_validate_int(&ctx, "-2", RANGE_ARGS{{"-10","1000"}}, 1);
|
||||
assert_int_equal(validate, 0);
|
||||
|
||||
// dm_validate_int: test with multi range and wrong value
|
||||
// bbfdm_validate_int: test with multi range and wrong value
|
||||
validate = bbfdm_validate_int(&ctx, "-2", RANGE_ARGS{{"-10","-3"},{"-1","45"}}, 2);
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_int: test with multi range and correct value
|
||||
// bbfdm_validate_int: test with multi range and correct value
|
||||
validate = bbfdm_validate_int(&ctx, "-7", RANGE_ARGS{{"-10","-3"},{"-1","45"}}, 2);
|
||||
assert_int_equal(validate, 0);
|
||||
|
||||
|
|
@ -736,31 +736,31 @@ static void test_bbf_api_validate(void **state)
|
|||
* Test of dm_validate_unsignedLong function
|
||||
*/
|
||||
|
||||
// dm_validate_unsignedLong: test with wrong value
|
||||
// bbfdm_validate_unsignedLong: test with wrong value
|
||||
validate = bbfdm_validate_unsignedLong(&ctx, "2t", RANGE_ARGS{{NULL,NULL}}, 1);
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_unsignedLong: test with wrong min value
|
||||
// bbfdm_validate_unsignedLong: test with wrong min value
|
||||
validate = bbfdm_validate_unsignedLong(&ctx, "1", RANGE_ARGS{{"12",NULL}}, 1);
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_unsignedLong: test with wrong max value
|
||||
// bbfdm_validate_unsignedLong: test with wrong max value
|
||||
validate = bbfdm_validate_unsignedLong(&ctx, "10", RANGE_ARGS{{NULL,"5"}}, 1);
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_unsignedLong: test without min/max value
|
||||
// bbfdm_validate_unsignedLong: test without min/max value
|
||||
validate = bbfdm_validate_unsignedLong(&ctx, "112", RANGE_ARGS{{NULL,NULL}}, 1);
|
||||
assert_int_equal(validate, 0);
|
||||
|
||||
// dm_validate_unsignedLong: test with correct min/max value
|
||||
// bbfdm_validate_unsignedLong: test with correct min/max value
|
||||
validate = bbfdm_validate_unsignedLong(&ctx, "20", RANGE_ARGS{{"10","1000"}}, 1);
|
||||
assert_int_equal(validate, 0);
|
||||
|
||||
// dm_validate_unsignedLong: test with multi range and wrong value
|
||||
// bbfdm_validate_unsignedLong: test with multi range and wrong value
|
||||
validate = bbfdm_validate_unsignedLong(&ctx, "5420", RANGE_ARGS{{"10","1000"},{"11200","45000"}}, 2);
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_unsignedLong: test with multi range and correct value
|
||||
// bbfdm_validate_unsignedLong: test with multi range and correct value
|
||||
validate = bbfdm_validate_unsignedLong(&ctx, "15000", RANGE_ARGS{{"10","1000"},{"11200","45000"}}, 2);
|
||||
assert_int_equal(validate, 0);
|
||||
|
||||
|
|
@ -769,31 +769,31 @@ static void test_bbf_api_validate(void **state)
|
|||
* Test of dm_validate_long function
|
||||
*/
|
||||
|
||||
// dm_validate_long: test with wrong value
|
||||
// bbfdm_validate_long: test with wrong value
|
||||
validate = bbfdm_validate_long(&ctx, "-12t", RANGE_ARGS{{NULL,NULL}}, 1);
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_long: test with wrong min value
|
||||
// bbfdm_validate_long: test with wrong min value
|
||||
validate = bbfdm_validate_long(&ctx, "-1", RANGE_ARGS{{"12",NULL}}, 1);
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_long: test with wrong max value
|
||||
// bbfdm_validate_long: test with wrong max value
|
||||
validate = bbfdm_validate_long(&ctx, "-1", RANGE_ARGS{{NULL,"-5"}}, 1);
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_long: test without min/max value
|
||||
// bbfdm_validate_long: test without min/max value
|
||||
validate = bbfdm_validate_long(&ctx, "-112", RANGE_ARGS{{NULL,NULL}}, 1);
|
||||
assert_int_equal(validate, 0);
|
||||
|
||||
// dm_validate_long: test with correct min/max value
|
||||
// bbfdm_validate_long: test with correct min/max value
|
||||
validate = bbfdm_validate_long(&ctx, "-2", RANGE_ARGS{{"-10","1000"}}, 1);
|
||||
assert_int_equal(validate, 0);
|
||||
|
||||
// dm_validate_long: test with multi range and wrong value
|
||||
// bbfdm_validate_long: test with multi range and wrong value
|
||||
validate = bbfdm_validate_long(&ctx, "-2", RANGE_ARGS{{"-10","-3"},{"-1","45"}}, 2);
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_long: test with multi range and correct value
|
||||
// bbfdm_validate_long: test with multi range and correct value
|
||||
validate = bbfdm_validate_long(&ctx, "-7", RANGE_ARGS{{"-10","-3"},{"-1","45"}}, 2);
|
||||
assert_int_equal(validate, 0);
|
||||
|
||||
|
|
@ -802,31 +802,31 @@ static void test_bbf_api_validate(void **state)
|
|||
* Test of dm_validate_dateTime function
|
||||
*/
|
||||
|
||||
// dm_validate_dateTime: test with wrong value
|
||||
// bbfdm_validate_dateTime: test with wrong value
|
||||
validate = bbfdm_validate_dateTime(&ctx, "2021-12-31T20:53:99");
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_dateTime: test with wrong value
|
||||
// bbfdm_validate_dateTime: test with wrong value
|
||||
validate = bbfdm_validate_dateTime(&ctx, "2021-12-31T20:53:99.12Z");
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_dateTime: test with wrong value
|
||||
// bbfdm_validate_dateTime: test with wrong value
|
||||
validate = bbfdm_validate_dateTime(&ctx, "2021-12-31T20:53:99+01:00Z");
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_dateTime: test with wrong value
|
||||
// bbfdm_validate_dateTime: test with wrong value
|
||||
validate = bbfdm_validate_dateTime(&ctx, "2021-12-31T20:53:99.12");
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_dateTime: test with correct value
|
||||
// bbfdm_validate_dateTime: test with correct value
|
||||
validate = bbfdm_validate_dateTime(&ctx, "2021-12-31T20:53:01Z");
|
||||
assert_int_equal(validate, 0);
|
||||
|
||||
// dm_validate_dateTime: test with correct value
|
||||
// bbfdm_validate_dateTime: test with correct value
|
||||
validate = bbfdm_validate_dateTime(&ctx, "2021-12-31T20:53:01.125Z");
|
||||
assert_int_equal(validate, 0);
|
||||
|
||||
// dm_validate_dateTime: test with correct value
|
||||
// bbfdm_validate_dateTime: test with correct value
|
||||
validate = bbfdm_validate_dateTime(&ctx, "2021-12-31T20:53:01.125345Z");
|
||||
assert_int_equal(validate, 0);
|
||||
|
||||
|
|
@ -835,43 +835,43 @@ static void test_bbf_api_validate(void **state)
|
|||
* Test of dm_validate_hexBinary function
|
||||
*/
|
||||
|
||||
// dm_validate_hexBinary: test with wrong value
|
||||
// bbfdm_validate_hexBinary: test with wrong value
|
||||
validate = bbfdm_validate_hexBinary(&ctx, "-12t", RANGE_ARGS{{NULL,NULL}}, 1);
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_hexBinary: test with wrong min value
|
||||
// bbfdm_validate_hexBinary: test with wrong min value
|
||||
validate = bbfdm_validate_hexBinary(&ctx, "123bcd", RANGE_ARGS{{"12",NULL}}, 1);
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_hexBinary: test with wrong max value
|
||||
// bbfdm_validate_hexBinary: test with wrong max value
|
||||
validate = bbfdm_validate_hexBinary(&ctx, "123bcd", RANGE_ARGS{{NULL,"4"}}, 1);
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_hexBinary: test with wrong value
|
||||
// bbfdm_validate_hexBinary: test with wrong value
|
||||
validate = bbfdm_validate_hexBinary(&ctx, "123b4cd", RANGE_ARGS{{"3","3"}}, 1);
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_hexBinary: test without min/max value
|
||||
// bbfdm_validate_hexBinary: test without min/max value
|
||||
validate = bbfdm_validate_hexBinary(&ctx, "123bcd", RANGE_ARGS{{NULL,NULL}}, 1);
|
||||
assert_int_equal(validate, 0);
|
||||
|
||||
// dm_validate_hexBinary: test with correct min/max value
|
||||
// bbfdm_validate_hexBinary: test with correct min/max value
|
||||
validate = bbfdm_validate_hexBinary(&ctx, "123bcd", RANGE_ARGS{{"1","8"}}, 1);
|
||||
assert_int_equal(validate, 0);
|
||||
|
||||
// dm_validate_hexBinary: test with correct value
|
||||
// bbfdm_validate_hexBinary: test with correct value
|
||||
validate = bbfdm_validate_hexBinary(&ctx, "123bcd", RANGE_ARGS{{"3","3"}}, 1);
|
||||
assert_int_equal(validate, 0);
|
||||
|
||||
// dm_validate_hexBinary: test with multi range and wrong value
|
||||
// bbfdm_validate_hexBinary: test with multi range and wrong value
|
||||
validate = bbfdm_validate_hexBinary(&ctx, "123bc", RANGE_ARGS{{"3","3"},{"5","5"}}, 2);
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_hexBinary: test with multi range and correct value
|
||||
// bbfdm_validate_hexBinary: test with multi range and correct value
|
||||
validate = bbfdm_validate_hexBinary(&ctx, "123bcd", RANGE_ARGS{{"3","3"},{"5","5"}}, 2);
|
||||
assert_int_equal(validate, 0);
|
||||
|
||||
// dm_validate_hexBinary: test with multi range and correct value
|
||||
// bbfdm_validate_hexBinary: test with multi range and correct value
|
||||
validate = bbfdm_validate_hexBinary(&ctx, "12345abcde", RANGE_ARGS{{"3","3"},{"5","5"}}, 2);
|
||||
assert_int_equal(validate, 0);
|
||||
|
||||
|
|
@ -880,23 +880,23 @@ static void test_bbf_api_validate(void **state)
|
|||
* Test of dm_validate_string_list function
|
||||
*/
|
||||
|
||||
// dm_validate_string_list: test with wrong min_item value
|
||||
// bbfdm_validate_string_list: test with wrong min_item value
|
||||
validate = bbfdm_validate_string_list(&ctx, "test", 2, -1, -1, -1, -1, NULL, NULL);
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_string_list: test with wrong max_item value
|
||||
// bbfdm_validate_string_list: test with wrong max_item value
|
||||
validate = bbfdm_validate_string_list(&ctx, "test1,test2,test3", -1, 2, -1, -1, -1, NULL, NULL);
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_string_list: test with wrong max_size value
|
||||
// bbfdm_validate_string_list: test with wrong max_size value
|
||||
validate = bbfdm_validate_string_list(&ctx, "test1,test2,test3", -1, -1, 10, -1, -1, NULL, NULL);
|
||||
assert_int_equal(validate, -1);
|
||||
|
||||
// dm_validate_string_list: test with correct min and max item/size value
|
||||
// bbfdm_validate_string_list: test with correct min and max item/size value
|
||||
validate = bbfdm_validate_string_list(&ctx, "bbftest", -1, -1, -1, -1, -1, NULL, NULL);
|
||||
assert_int_equal(validate, 0);
|
||||
|
||||
// dm_validate_string_list: test with correct min and max item/size value
|
||||
// bbfdm_validate_string_list: test with correct min and max item/size value
|
||||
validate = bbfdm_validate_string_list(&ctx, "test1,test2,test3", 2, 4, 20, -1, -1, NULL, NULL);
|
||||
assert_int_equal(validate, 0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ static int get_rule_icmp_type(char *refparam, struct dmctx *ctx, void *data, cha
|
|||
char *ptr = NULL;
|
||||
|
||||
dmasprintf(value, "%s", "");
|
||||
dmuci_get_value_by_section_list(((struct dmmap_dup *)data)->config_section, "icmp_type", &v);
|
||||
dmuci_get_value_by_section_list(((struct dm_data *)data)->config_section, "icmp_type", &v);
|
||||
if (v != NULL) {
|
||||
uci_foreach_element(v, e) {
|
||||
ptr = dmstrdup(*value);
|
||||
|
|
@ -38,7 +38,7 @@ static int get_rule_icmp_type(char *refparam, struct dmctx *ctx, void *data, cha
|
|||
static int get_rule_source_mac(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *v = NULL;
|
||||
dmuci_get_value_by_section_string(((struct dmmap_dup *)data)->config_section, "src_mac", &v);
|
||||
dmuci_get_value_by_section_string(((struct dm_data *)data)->config_section, "src_mac", &v);
|
||||
*value = (v) ? v : "";
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -52,7 +52,7 @@ static int get_time_span_supported_days(char *refparam, struct dmctx *ctx, void
|
|||
static int get_time_span_days(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *v;
|
||||
dmuci_get_value_by_section_string(((struct dmmap_dup *)data)->config_section, "weekdays", &v);
|
||||
dmuci_get_value_by_section_string(((struct dm_data *)data)->config_section, "weekdays", &v);
|
||||
*value = (v) ? v : "";
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -60,7 +60,7 @@ static int get_time_span_days(char *refparam, struct dmctx *ctx, void *data, cha
|
|||
static int get_time_span_start_time(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *v;
|
||||
dmuci_get_value_by_section_string(((struct dmmap_dup *)data)->config_section, "start_time", &v);
|
||||
dmuci_get_value_by_section_string(((struct dm_data *)data)->config_section, "start_time", &v);
|
||||
*value = (v) ? v : "";
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -68,7 +68,7 @@ static int get_time_span_start_time(char *refparam, struct dmctx *ctx, void *dat
|
|||
static int get_time_span_stop_time(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *v;
|
||||
dmuci_get_value_by_section_string(((struct dmmap_dup *)data)->config_section, "stop_time", &v);
|
||||
dmuci_get_value_by_section_string(((struct dm_data *)data)->config_section, "stop_time", &v);
|
||||
*value = (v) ? v : "";
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -84,10 +84,10 @@ static int set_rule_icmp_type(char *refparam, struct dmctx *ctx, void *data, cha
|
|||
//TODO
|
||||
break;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "icmp_type", "");
|
||||
dmuci_set_value_by_section(((struct dm_data *)data)->config_section, "icmp_type", "");
|
||||
devices = strsplit(value, " ", &length);
|
||||
for (i = 0; i < length; i++)
|
||||
dmuci_add_list_value_by_section(((struct dmmap_dup *)data)->config_section, "icmp_type", devices[i]);
|
||||
dmuci_add_list_value_by_section(((struct dm_data *)data)->config_section, "icmp_type", devices[i]);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -100,7 +100,7 @@ static int set_rule_source_mac(char *refparam, struct dmctx *ctx, void *data, ch
|
|||
//TODO
|
||||
break;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "src_mac", value);
|
||||
dmuci_set_value_by_section(((struct dm_data *)data)->config_section, "src_mac", value);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -125,7 +125,7 @@ static int set_time_span_days(char *refparam, struct dmctx *ctx, void *data, cha
|
|||
//TODO
|
||||
break;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "weekdays", value);
|
||||
dmuci_set_value_by_section(((struct dm_data *)data)->config_section, "weekdays", value);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -138,7 +138,7 @@ static int set_time_span_start_time(char *refparam, struct dmctx *ctx, void *dat
|
|||
//TODO
|
||||
break;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "start_time", value);
|
||||
dmuci_set_value_by_section(((struct dm_data *)data)->config_section, "start_time", value);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -151,7 +151,7 @@ static int set_time_span_stop_time(char *refparam, struct dmctx *ctx, void *data
|
|||
//TODO
|
||||
break;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "stop_time", value);
|
||||
dmuci_set_value_by_section(((struct dm_data *)data)->config_section, "stop_time", value);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -189,30 +189,6 @@
|
|||
"src/sshmngr.c"
|
||||
]
|
||||
},
|
||||
{
|
||||
"repo": "https://dev.iopsys.eu/voice/tr104.git",
|
||||
"proto": "git",
|
||||
"version": "devel",
|
||||
"dm_files": [
|
||||
"libdm/tr104/*.c"
|
||||
],
|
||||
"extra_dependencies": [
|
||||
"-I libdmtree",
|
||||
"-I libdm/common"
|
||||
]
|
||||
},
|
||||
{
|
||||
"repo": "https://dev.iopsys.eu/voice/tr104.git",
|
||||
"proto": "git",
|
||||
"version": "devel",
|
||||
"dm_files": [
|
||||
"libdm/extensions/iowrt/*.c"
|
||||
],
|
||||
"extra_dependencies": [
|
||||
"-I libdmtree",
|
||||
"-I libdm/common"
|
||||
]
|
||||
},
|
||||
{
|
||||
"repo": "https://dev.iopsys.eu/network/firewallmngr.git",
|
||||
"proto": "git",
|
||||
|
|
@ -252,8 +228,8 @@
|
|||
"proto": "git",
|
||||
"version": "devel",
|
||||
"dm_files": [
|
||||
"src/bridging.c",
|
||||
"src/common.c"
|
||||
"src/driver_vlan_backend/bridging.c",
|
||||
"src/driver_vlan_backend/common.c"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -261,8 +237,8 @@
|
|||
"proto": "git",
|
||||
"version": "devel",
|
||||
"dm_files": [
|
||||
"src/vendor.c",
|
||||
"src/common.c"
|
||||
"src/driver_vlan_backend/vendor.c",
|
||||
"src/driver_vlan_backend/common.c"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue