mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
Moved DNS dm to dnsmngr
This commit is contained in:
parent
870d903d0c
commit
533c1bfa7c
6 changed files with 38 additions and 1043 deletions
|
|
@ -25,7 +25,6 @@
|
|||
#include "ppp.h"
|
||||
#include "routing.h"
|
||||
#include "firewall.h"
|
||||
#include "dns.h"
|
||||
#include "dsl.h"
|
||||
#include "fast.h"
|
||||
#include "dhcpv6.h"
|
||||
|
|
@ -107,7 +106,6 @@ DMOBJ tDeviceObj[] = {
|
|||
{"PPP", &DMREAD, NULL, NULL, "file:/lib/netifd/proto/ppp.sh,/etc/config/network", NULL, NULL, NULL, tPPPObj, tPPPParams, NULL, BBFDM_BOTH, NULL},
|
||||
{"Routing", &DMREAD, NULL, NULL, "file:/etc/config/network", NULL, NULL, NULL, tRoutingObj, tRoutingParams, NULL, BBFDM_BOTH, NULL},
|
||||
{"Firewall", &DMREAD, NULL, NULL, "file:/etc/config/firewall", NULL, NULL, NULL, tFirewallObj, tFirewallParams, NULL, BBFDM_BOTH, NULL},
|
||||
{"DNS", &DMREAD, NULL, NULL, "file:/etc/config/network", NULL, NULL, NULL, tDNSObj, tDNSParams, NULL, BBFDM_BOTH, NULL},
|
||||
{"IEEE1905", &DMREAD, NULL, NULL, "file:/etc/config/ieee1905", NULL, NULL, NULL, tIEEE1905Obj, tIEEE1905Params, NULL, BBFDM_BOTH, NULL},
|
||||
{"InterfaceStack", &DMREAD, NULL, NULL, "file:/etc/config/network", browseInterfaceStackInst, NULL, NULL, NULL, tInterfaceStackParams, NULL, BBFDM_BOTH, NULL},
|
||||
{"USB", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tUSBObj, tUSBParams, NULL, BBFDM_BOTH, NULL},
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@
|
|||
*/
|
||||
|
||||
#include "dhcpv4.h"
|
||||
#include "dns.h"
|
||||
|
||||
#define DHCP_OPTION_VENDORID 60
|
||||
#define DHCP_OPTION_CLIENTID 61
|
||||
|
|
@ -66,6 +65,20 @@ struct dhcp_client_option_args {
|
|||
char *value;
|
||||
};
|
||||
|
||||
/* Returns dnsmasq section name belongs to LAN network */
|
||||
char *get_dnsmasq_section_name(void)
|
||||
{
|
||||
struct uci_section *s = NULL;
|
||||
|
||||
uci_foreach_sections("dhcp", "dnsmasq", s) {
|
||||
char *sec = section_name(s);
|
||||
if (DM_STRCMP(sec, "dns_client") != 0)
|
||||
return sec;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* INIT
|
||||
**************************************************************/
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,31 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2019 iopsys Software Solutions AB
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License version 2.1
|
||||
* as published by the Free Software Foundation
|
||||
*
|
||||
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
|
||||
*/
|
||||
|
||||
#ifndef _DNS_H
|
||||
#define _DNS_H
|
||||
|
||||
#include "libbbfdm-api/dmcommon.h"
|
||||
|
||||
extern DMOBJ tDNSObj[];
|
||||
extern DMLEAF tDNSParams[];
|
||||
extern DMLEAF tDNSClientParams[];
|
||||
extern DMOBJ tDNSClientObj[];
|
||||
extern DMLEAF tDNSClientServerParams[];
|
||||
extern DMLEAF tDNSRelayParams[];
|
||||
extern DMOBJ tDNSRelayObj[];
|
||||
extern DMLEAF tDNSRelayForwardingParams[];
|
||||
extern DMOBJ tDNSDiagnosticsObj[];
|
||||
extern DMLEAF tDNSDiagnosticsParams[];
|
||||
extern DMLEAF tDNSDiagnosticsNSLookupDiagnosticsParams[];
|
||||
extern DMOBJ tDNSDiagnosticsNSLookupDiagnosticsObj[];
|
||||
extern DMLEAF tDNSDiagnosticsNSLookupDiagnosticsResultParams[];
|
||||
|
||||
char *get_dnsmasq_section_name(void);
|
||||
#endif
|
||||
|
|
@ -9,12 +9,25 @@
|
|||
*/
|
||||
|
||||
#include "dhcpv4.h"
|
||||
#include "dns.h"
|
||||
#include "routeradvertisement.h"
|
||||
|
||||
/*************************************************************
|
||||
* COMMON FUNCTIONS
|
||||
**************************************************************/
|
||||
/* Returns dnsmasq section name belonging to LAN network */
|
||||
char *get_dhcp_dnsmasq_section_name(void)
|
||||
{
|
||||
struct uci_section *s = NULL;
|
||||
|
||||
uci_foreach_sections("dhcp", "dnsmasq", s) {
|
||||
char *sec = section_name(s);
|
||||
if (DM_STRCMP(sec, "dns_client") != 0)
|
||||
return sec;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
static int radv_get_option_value(struct uci_section *s, char *option_list, const char *option_value, char **value)
|
||||
{
|
||||
struct uci_list *uci_list = NULL;
|
||||
|
|
@ -188,7 +201,7 @@ static int delObjRouterAdvertisementInterfaceSettingOption(char *refparam, struc
|
|||
/*#Device.RouterAdvertisement.Enable!UCI:dhcp/dnsmasq,@dnsmasq[0]/raserver*/
|
||||
static int get_RouterAdvertisement_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *sec = get_dnsmasq_section_name();
|
||||
char *sec = get_dhcp_dnsmasq_section_name();
|
||||
|
||||
if (DM_STRLEN(sec) == 0)
|
||||
return 0;
|
||||
|
|
@ -208,7 +221,7 @@ static int set_RouterAdvertisement_Enable(char *refparam, struct dmctx *ctx, voi
|
|||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
sec = get_dnsmasq_section_name();
|
||||
sec = get_dhcp_dnsmasq_section_name();
|
||||
if (DM_STRLEN(sec) == 0)
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -131,6 +131,14 @@
|
|||
"src/dynamicdnsmngr.c"
|
||||
]
|
||||
},
|
||||
{
|
||||
"repo": "https://dev.iopsys.eu/network/dnsmngr.git",
|
||||
"proto": "git",
|
||||
"version": "devel",
|
||||
"dm_files": [
|
||||
"src/dnsmngr.c"
|
||||
]
|
||||
},
|
||||
{
|
||||
"repo": "https://dev.iopsys.eu/voice/tr104.git",
|
||||
"proto": "git",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue