Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Knot DNS
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
22
Issues
22
List
Boards
Labels
Service Desk
Milestones
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Knot projects
Knot DNS
Commits
821b509f
Commit
821b509f
authored
Sep 03, 2015
by
Dominik Taborsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zone-api: add zone_update _add and _remove RR functions.
parent
77fb144b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
2 deletions
+33
-2
src/knot/updates/ddns.c
src/knot/updates/ddns.c
+2
-2
src/knot/updates/zone-update.c
src/knot/updates/zone-update.c
+31
-0
No files found.
src/knot/updates/ddns.c
View file @
821b509f
...
...
@@ -465,14 +465,14 @@ static int add_rr_to_chgset(const knot_rrset_t *rr,
return
KNOT_EOK
;
}
return
changeset_add_rrset
(
&
update
->
chang
e
,
rr
);
return
zone_update_add
(
updat
e
,
rr
);
}
/*!< \brief Adds RR into remove section of changeset if it is deemed worthy. */
static
int
rem_rr_to_chgset
(
const
knot_rrset_t
*
rr
,
zone_update_t
*
update
)
{
return
changeset_rem_rrset
(
&
update
->
chang
e
,
rr
);
return
zone_update_remove
(
updat
e
,
rr
);
}
/*!< \brief Adds all RRs from RRSet into remove section of changeset. */
...
...
src/knot/updates/zone-update.c
View file @
821b509f
...
...
@@ -258,6 +258,37 @@ void zone_update_clear(zone_update_t *update)
}
}
int
zone_update_add
(
zone_update_t
*
update
,
const
knot_rrset_t
*
rrset
)
{
if
(
update
->
flags
&
UPDATE_WRITING_ITER
)
{
return
changeset_add_rrset
(
&
update
->
iteration_changes
,
rrset
);
}
else
if
(
update
->
flags
&
UPDATE_INCREMENTAL
)
{
return
changeset_add_rrset
(
&
update
->
change
,
rrset
);
}
else
if
(
update
->
flags
&
UPDATE_FULL
)
{
zone_node_t
*
n
=
NULL
;
return
zone_contents_add_rr
(
update
->
new_cont
,
rrset
,
&
n
);
}
else
{
return
KNOT_EINVAL
;
}
}
int
zone_update_remove
(
zone_update_t
*
update
,
const
knot_rrset_t
*
rrset
)
{
if
(
update
->
flags
&
UPDATE_WRITING_ITER
)
{
return
changeset_rem_rrset
(
&
update
->
iteration_changes
,
rrset
);
}
else
if
(
update
->
flags
&
UPDATE_INCREMENTAL
)
{
return
changeset_rem_rrset
(
&
update
->
change
,
rrset
);
}
else
{
// Removing from zone during creation does not make sense, ignore.
/* The comment right above does not make sense when the following line
* was uncommented. Anyway, right now we don't have a nice and clean way
* to remove an RR. FIXME
*/
//return zone_contents_remove_rr(update->new_cont, rrset);
return
KNOT_ENOTSUP
;
}
}
static
bool
apex_rr_changed
(
const
zone_node_t
*
old_apex
,
const
zone_node_t
*
new_apex
,
uint16_t
type
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment