diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2022-09-28 14:05:01 +0900 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2022-09-28 14:05:01 +0900 |
commit | 3ec2b451f938398eb4d2f92603f0659c26f6675c (patch) | |
tree | 03f34b6819b1422ad8da2e566908748e87cf9975 /src/gnsrecord | |
parent | 64480e6f4e07743a5fd20389eef92e0e9eadc563 (diff) | |
download | gnunet-3ec2b451f938398eb4d2f92603f0659c26f6675c.tar.gz gnunet-3ec2b451f938398eb4d2f92603f0659c26f6675c.zip |
NAMESTORE: Allow service-side record set filtering. Fixes #7193
This commit enables zone iteration APIs which allow you to set a record
set filter to determine which records should be returned or not.
In particular filtering of private records and maintenance records
(TOMBSTONE) for zonemaster.
Diffstat (limited to 'src/gnsrecord')
-rw-r--r-- | src/gnsrecord/gnsrecord_misc.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/src/gnsrecord/gnsrecord_misc.c b/src/gnsrecord/gnsrecord_misc.c index 5e3bbdb8c..880fc68c6 100644 --- a/src/gnsrecord/gnsrecord_misc.c +++ b/src/gnsrecord/gnsrecord_misc.c | |||
@@ -421,7 +421,7 @@ GNUNET_GNSRECORD_normalize_record_set (const char *label, | |||
421 | rd_public, | 421 | rd_public, |
422 | unsigned int *rd_count_public, | 422 | unsigned int *rd_count_public, |
423 | struct GNUNET_TIME_Absolute *expiry, | 423 | struct GNUNET_TIME_Absolute *expiry, |
424 | int include_private, | 424 | enum GNUNET_GNSRECORD_Filter filter, |
425 | char **emsg) | 425 | char **emsg) |
426 | { | 426 | { |
427 | struct GNUNET_TIME_Absolute now; | 427 | struct GNUNET_TIME_Absolute now; |
@@ -539,7 +539,7 @@ GNUNET_GNSRECORD_normalize_record_set (const char *label, | |||
539 | 539 | ||
540 | /* Ignore private records for public record set */ | 540 | /* Ignore private records for public record set */ |
541 | 541 | ||
542 | if ((GNUNET_NO == include_private) && | 542 | if ((0 != (filter & GNUNET_GNSRECORD_FILTER_OMIT_PRIVATE)) && |
543 | (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_PRIVATE))) | 543 | (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_PRIVATE))) |
544 | continue; | 544 | continue; |
545 | /* Skip expired records */ | 545 | /* Skip expired records */ |
@@ -561,27 +561,4 @@ GNUNET_GNSRECORD_normalize_record_set (const char *label, | |||
561 | } | 561 | } |
562 | 562 | ||
563 | 563 | ||
564 | enum GNUNET_GenericReturnValue | ||
565 | GNUNET_GNSRECORD_convert_records_for_export (const char *label, | ||
566 | const struct | ||
567 | GNUNET_GNSRECORD_Data *rd, | ||
568 | unsigned int rd_count, | ||
569 | struct GNUNET_GNSRECORD_Data * | ||
570 | rd_public, | ||
571 | unsigned int *rd_count_public, | ||
572 | struct GNUNET_TIME_Absolute *expiry, | ||
573 | char **emsg) | ||
574 | { | ||
575 | return GNUNET_GNSRECORD_normalize_record_set (label, | ||
576 | rd, | ||
577 | rd_count, | ||
578 | rd_public, | ||
579 | rd_count_public, | ||
580 | expiry, | ||
581 | GNUNET_NO, | ||
582 | emsg); | ||
583 | |||
584 | } | ||
585 | |||
586 | |||
587 | /* end of gnsrecord_misc.c */ | 564 | /* end of gnsrecord_misc.c */ |