rrset.h File Reference
`#include "config.h"`
`#include <ldns/ldns.h>`
`#include "status.h"`
`#include "signer/stats.h"`
`#include "libhsm.h"`
`#include "domain.h"`
`#include "zone.h"`
`#include "datastructure.h"`

Go to the source code of this file.

## Data Structures

struct | rrsig_struct
struct | rr_struct
struct | rrset_struct

## Typedefs

typedef struct rrsig_struct | rrsig_type
typedef struct rr_struct | rr_type
typedef struct rrset_struct | rrset_type

## Functions

void | log_rr (ldns_rr *rr, const char *pre, int level)
void | log_rrset (ldns_rdf *dname, ldns_rr_type type, const char *pre, int level)
const char * | rrset_type2str (ldns_rr_type type)
rrset_type * | rrset_create (zone_type *zone, ldns_rr_type type)
rr_type * | rrset_lookup_rr (rrset_type *rrset, ldns_rr *rr)
uint32_t | rrset_lookup_ttl (rrset_type *rrset, uint32_t default_ttl)
size_t | rrset_count_rr_is_added (rrset_type *rrset)
rr_type * | rrset_add_rr (rrset_type *rrset, ldns_rr *rr)
void | rrset_del_rr (rrset_type *rrset, uint16_t rrnum)
void | rrset_add_rrsig (rrset_type *rrset, ldns_rr *rr, const char *locator, uint32_t flags)
void | rrset_drop_rrsigs (zone_type *zone, rrset_type *rrset)
void | rrset_diff (rrset_type *rrset, unsigned is_ixfr, unsigned more_coming)
ods_status | rrset_sign (hsm_ctx_t *ctx, rrset_type *rrset, time_t signtime)
ods_status | rrset_getliteralrr (ldns_rr **dnskey, const char *resourcerecord, uint32_t ttl, ldns_rdf *apex)
void | rrset_print (FILE *fd, rrset_type *rrset, int skip_rrsigs, ods_status *status)
void | rrset_cleanup (rrset_type *rrset)
void | rrset_backup2 (FILE *fd, rrset_type *rrset)
collection_class | rrset_store_initialize (void)

## Typedef Documentation

## rr_type

typedef struct rr_struct rr_type

Definition at line 34 of file rrset.h.

## rrset_type

typedef struct rrset_struct rrset_type

Definition at line 35 of file rrset.h.

## rrsig_type

typedef struct rrsig_struct rrsig_type

Definition at line 33 of file rrset.h.

## Function Documentation

## log_rr()

void log_rr | ( | ldns_rr * | rr,
|  | const char * | pre,
|  | int | level
| ) |  |

Log RR.

Parameters

  [in] | rr | RR
  [in] | pre | log message
  [in] | level | log level

Log RR.

Definition at line 48 of file rrset.c.

Referenced by rrset_add_rr(), and rrset_del_rr().

## log_rrset()

void log_rrset | ( | ldns_rdf * | dname,
|  | ldns_rr_type | type,
|  | const char * | pre,
|  | int | level
| ) |  |

Log RRset.

Parameters

  [in] | dname | domain name
  [in] | type | RRtype
  [in] | pre | log message
  [in] | level | log level

Log RRset.

Definition at line 99 of file rrset.c.

References rrset_type2str().

Referenced by domain_add_rrset(), domain_diff(), domain_rollback(), namedb_examine(), rrset_print(), and rrset_sign().

## rrset_add_rr()

rr_type * rrset_add_rr | ( | rrset_type * | rrset,
|  | ldns_rr * | rr
| ) |  |

Add RR to RRset.

Parameters

  [in] | rrset | RRset
  [in] | rr | RR

Returns
  rr_type* added RR

Add RR to RRset.

Definition at line 299 of file rrset.c.

References rrset_struct::domain, rr_struct::exists, rr_struct::is_added, rr_struct::is_removed, log_rr(), rrset_struct::needs_signing, rr_struct::owner, rr_struct::rr, rrset_struct::rr_count, rrset_struct::rrs, and rrset_struct::rrtype.

Referenced by denial_add_rr(), zone_add_rr(), and zone_update_serial().

## rrset_add_rrsig()

void rrset_add_rrsig | ( | rrset_type * | rrset,
|  | ldns_rr * | rr,
|  | const char * | locator,
|  | uint32_t | flags
| ) |  |

Add RRSIG to RRset.

Parameters

  [in] | rrset | RRset
  [in] | rr | RRSIG
  [in] | locator | key locator
  [in] | flags | key flags

Add RRSIG to RRset.

Definition at line 435 of file rrset.c.

References rrset_struct::domain, rrsig_struct::key_flags, rrsig_struct::key_locator, rrsig_struct::owner, rrsig_struct::rr, and rrset_struct::rrsigs.

Referenced by backup_read_namedb(), and rrset_sign().

## rrset_backup2()

void rrset_backup2 | ( | FILE * | fd,
|  | rrset_type * | rrset
| ) |  |

Backup RRset.

Parameters

  [in] | fd | file descriptor
  [in] | rrset | RRset

Backup RRset.

Definition at line 951 of file rrset.c.

References rrsig_struct::key_flags, rrsig_struct::key_locator, rrsig_struct::rr, and rrset_struct::rrsigs.

Referenced by domain_backup2(), and namedb_backup2().

## rrset_cleanup()

void rrset_cleanup | ( | rrset_type * | rrset | ) |

Clean up RRset.

Parameters

  [in] | rrset | RRset to be cleaned up

Clean up RRset.

Definition at line 928 of file rrset.c.

References rrset_struct::domain, rrset_struct::next, rr_struct::owner, rr_struct::rr, rrset_struct::rr_count, rrset_struct::rrs, rrset_cleanup(), and rrset_struct::rrsigs.

Referenced by denial_cleanup(), domain_cleanup(), domain_diff(), domain_rollback(), namedb_wipe_denial(), and rrset_cleanup().

## rrset_count_rr_is_added()

size_t rrset_count_rr_is_added | ( | rrset_type * | rrset | ) |

Count the number of RRs in this RRset that have is_added.

Parameters

  [in] | rrset | RRset

Returns
  size_t number of RRs

Count the number of RRs in this RRset that have is_added.

Definition at line 278 of file rrset.c.

References rr_struct::is_added, rrset_struct::rr_count, and rrset_struct::rrs.

Referenced by domain_count_rrset_is_added(), and namedb_examine().

## rrset_create()

rrset_type * rrset_create | ( | zone_type * | zone,
|  | ldns_rr_type | type
| ) |  |

Create RRset.

Parameters

  [in] | zoneptr | zone reference
  [in] | type | RRtype

Returns
  rrset_type* RRset

Create RRset.

Definition at line 199 of file rrset.c.

References rrset_struct::domain, rrset_struct::needs_signing, rrset_struct::next, rrset_struct::rr_count, rrset_struct::rrs, rrset_struct::rrsigs, zone_struct::rrstore, rrset_struct::rrtype, and rrset_struct::zone.

Referenced by denial_add_rr(), and zone_add_rr().

## rrset_del_rr()

void rrset_del_rr | ( | rrset_type * | rrset,
|  | uint16_t | rrnum
| ) |  |

Delete RR from RRset.

Parameters

  [in] | rrset | RRset
  [in] | rrnum | position of RR

Delete RR from RRset.

Definition at line 334 of file rrset.c.

References log_rr(), rrset_struct::needs_signing, rr_struct::owner, rr_struct::rr, rrset_struct::rr_count, and rrset_struct::rrs.

Referenced by domain_rollback(), namedb_wipe_denial(), and rrset_diff().

## rrset_diff()

void rrset_diff | ( | rrset_type * | rrset,
|  | unsigned | is_ixfr,
|  | unsigned | more_coming
| ) |  |

Apply differences at RRset.

Parameters

  [in] | rrset | RRset
  [in] | is_ixfr | true if incremental change
  [in] | more_coming | more transactions possible

Apply differences at RRset.

Definition at line 366 of file rrset.c.

References zone_struct::db, rr_struct::exists, rr_struct::is_added, namedb_struct::is_initialized, rr_struct::is_removed, zone_struct::ixfr, ixfr_add_rr(), ixfr_del_rr(), ixfr_struct::ixfr_lock, rr_struct::rr, rrset_struct::rr_count, rrset_struct::rrs, rrset_del_rr(), rrset_drop_rrsigs(), rrset_struct::rrtype, and rrset_struct::zone.

Referenced by denial_diff(), domain_diff(), and zone_update_serial().

## rrset_drop_rrsigs()

void rrset_drop_rrsigs | ( | zone_type * | zone,
|  | rrset_type * | rrset
| ) |  |

Delete all RRSIG from RRset and add then to the zone's outgoing IXFR as change.

Parameters

  [in] | rrset | RRset
  [in] | rrnum | position of RRSIG

Remove signatures, deallocate storage and add then to the outgoing IFXR for that zone.

Definition at line 416 of file rrset.c.

References zone_struct::db, namedb_struct::is_initialized, zone_struct::ixfr, ixfr_del_rr(), ixfr_struct::ixfr_lock, rrsig_struct::rr, and rrset_struct::rrsigs.

Referenced by namedb_wipe_denial(), and rrset_diff().

## rrset_getliteralrr()

ods_status rrset_getliteralrr | ( | ldns_rr ** | dnskey,
|  | const char * | resourcerecord,
|  | uint32_t | ttl,
|  | ldns_rdf * | apex
| ) |  |

Obtain a resource record (containing a signature of a dnskeyset or a dnskeyset, but that is not a hard requirement), from a raw string

Parameters

  [out] | dnskey | the resulting resource record
  [in] | resourcerecord | the string representation of the resource record
  [in] | ttl | the time-to-live to use if non is specified
  [in] | apex | the owner domain is none can be determined from input string

Definition at line 851 of file rrset.c.

Referenced by rrset_sign(), and zone_publish_dnskeys().

## rrset_lookup_rr()

rr_type * rrset_lookup_rr | ( | rrset_type * | rrset,
|  | ldns_rr * | rr
| ) |  |

Lookup RR in RRset.

Parameters

  [in] | rrset | RRset
  [in] | rr | RR

Returns
  rr_type* RR if found

Lookup RR in RRset.

Definition at line 236 of file rrset.c.

References rr_struct::rr, rrset_struct::rr_count, and rrset_struct::rrs.

Referenced by zone_add_rr(), zone_del_rr(), zone_publish_dnskeys(), zone_rollback_dnskeys(), and zone_rollback_nsec3param().

## rrset_lookup_ttl()

uint32_t rrset_lookup_ttl | ( | rrset_type * | rrset,
|  | uint32_t | default_ttl
| ) |  |

What TTL should new RR's in this RRS get?

Definition at line 263 of file rrset.c.

References rr_struct::is_added, rr_struct::rr, rrset_struct::rr_count, and rrset_struct::rrs.

Referenced by zone_add_rr().

## rrset_print()

void rrset_print | ( | FILE * | fd,
|  | rrset_type * | rrset,
|  | int | skip_rrsigs,
|  | ods_status * | status
| ) |  |

Print RRset.

Parameters

  [in] | fd | file descriptor
  [in] | rrset | RRset to be printed
  [in] | skip_rrsigs | if true, don't print RRSIG records
  [out] | status | status

Print RRset.

Definition at line 871 of file rrset.c.

References zone_struct::adoutbound, adapter_struct::error, rr_struct::exists, log_rrset(), rrsig_struct::rr, rr_struct::rr, rrset_struct::rr_count, rrset_struct::rrs, rrset_struct::rrsigs, rrset_struct::rrtype, and rrset_struct::zone.

Referenced by adapi_printaxfr(), adapi_printixfr(), denial_print(), domain_backup2(), domain_print(), and namedb_backup2().

## rrset_sign()

ods_status rrset_sign | ( | hsm_ctx_t * | ctx,
|  | rrset_type * | rrset,
|  | time_t | signtime
| ) |  |

Sign RRset.

Parameters

  [in] | ctx | HSM context
  [in] | rrset | RRset
  [in] | signtime | time when the zone is being signed

Returns
  ods_status status

Sign RRset.

Definition at line 570 of file rrset.c.

References key_struct::algorithm, zone_struct::apex, zone_struct::db, signconf_struct::dnskey_signature, signconf_struct::dnskey_ttl, rrset_struct::domain, domain_is_delegpt(), domain_is_occluded(), key_struct::flags, namedb_struct::is_initialized, zone_struct::ixfr, ixfr_add_rr(), ixfr_del_rr(), ixfr_struct::ixfr_lock, rrsigkeymatching::key, keylist_struct::keys, signconf_struct::keys, key_struct::ksk, lhsm_sign(), key_struct::locator, log_rrset(), zone_struct::name, rrset_struct::needs_signing, key_struct::publish, rrsig_struct::rr, rr_struct::rr, rrset_struct::rrs, rrset_add_rrsig(), rrset_getliteralrr(), rrset_struct::rrsigs, rrset_struct::rrtype, stats_struct::sig_count, signconf_struct::sig_refresh_interval, stats_struct::sig_reuse, stats_struct::sig_soa_count, rrsigkeymatching::signature, zone_struct::signconf, zone_struct::stats, stats_struct::stats_lock, rrset_struct::zone, and key_struct::zsk.

Referenced by drudge().

## rrset_store_initialize()

collection_class rrset_store_initialize | ( | void |  | ) |

Definition at line 223 of file rrset.c.

Referenced by zone_create().

## rrset_type2str()

const char * rrset_type2str | ( | ldns_rr_type | type | ) |

Get the string-format of RRtype.

Parameters

  [in] | type | RRtype

Returns
  const char* string-format of RRtype

Get the string-format of RRtype.

Definition at line 158 of file rrset.c.

Referenced by log_rrset().