problems though.
</para>
</sect1>
+ <sect1 id="adding-rr-types"><title>Adding new DNS record types</title>
+ <para>
+ Here are the full descriptions on how we added the TLSA record type to all PowerDNS products, with links to the actual source code.
+ </para>
+ <para>
+ First, define the TLSARecordContent class in <ulink url="http://wiki.powerdns.com/trac/browser/trunk/pdns/pdns/dnsrecords.hh?rev=2338#L307">dnsrecords.hh</ulink>:
+ </para>
+
+<screen>
+class TLSARecordContent : public DNSRecordContent
+{
+public:
+ includeboilerplate(TLSA)
+ uint8_t d_certusage, d_selector, d_matchtype;
+ string d_cert;
+};
+</screen>
+
+<para>
+The 'includeboilerplate(TLSA)' generates the four methods that do everything PowerDNS would ever want to do with a record:
+<itemizedlist>
+ <listitem>
+ <para>
+ read TLSA records from zonefile format
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+write out a TLSA record in zonefile format
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+read a TLSA record from a packet
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+write a TLSA record to a packet
+ </para>
+ </listitem>
+</itemizedlist>
+</para>
+<para>
+The <ulink url="http://wiki.powerdns.com/trac/browser/trunk/pdns/pdns/dnsrecords.cc?rev=2638#L226">actual parsing code</ulink>:
+</para>
+<screen>
+boilerplate_conv(TLSA, 52,
+ conv.xfr8BitInt(d_certusage);
+ conv.xfr8BitInt(d_selector);
+ conv.xfr8BitInt(d_matchtype);
+ conv.xfrHexBlob(d_cert, true);
+ )
+</screen>
+
+<para>
+ This code defines the TLSA rrtype number as 52. Secondly, it says there are 3 eight bit fields for Certificate Usage, Selector and Match type. Next, it defines that the rest of the record is the actual certificate (hash). <ulink url="http://wiki.powerdns.com/trac/browser/trunk/pdns/pdns/dnsparser.hh?rev=2338#L70">'conv'</ulink> methods are supplied for all DNS data types in use.
+</para>
+
+<para>
+Now add TLSRecordContent::report() to <ulink url="http://wiki.powerdns.com/trac/browser/trunk/pdns/pdns/dnsrecords.cc?rev=2338#L364">reportOtherTypes()</ulink>.
+</para>
+
+<para>
+ And that's it. For completeness, add TLSA and 52 to the QType enum in qtype.hh, which makes it easier to refer to the TLSA record in code if so required.
+</para>
+ </sect1>
+
+
+
</appendix>
<appendix id="backend-writers-guide"><title>Backend writers' guide</title>
<para>