chiark / gitweb /
src/: Lay the groundwork for variably-sized record structures.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 31 May 2014 23:13:20 +0000 (00:13 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 12 Oct 2014 19:39:46 +0000 (20:39 +0100)
commit042b090961d5f03df515162a3fcb63bef6bfebc4
tree1beaedb656df6e26259a09fcb41ba68068ade9c2
parent7f5937118639156f1fb201c42298c00e1f54c3cc
src/: Lay the groundwork for variably-sized record structures.

All records in a particular answer are going to be the same size: that's
not going to change.  The case we're dealing with here is that we're
going to want to include new information (e.g., new kinds of address
families) which will make the structures larger -- and would break old
binary clients.

The plan is for new clients to encode a flag saying that they understand
the extended structure in the type field (implicitly, through a header-
file change).  But all of this means that just dredging `typei->rrsz'
out of the typeinfo structure isn't going to cut it any more, so we add
a type hook to compute the right size, and make sure that we use it by
renaming the slot containing the fixed value.  Most places in the code
can avoid having to call the hook by grabbing the record size from the
answer structure.

This involves adding an extra parameter to the postsort hook, which
otherwise might not be able to determine the right size for itself.

Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
src/general.c
src/internal.h
src/query.c
src/reply.c
src/types.c