X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/adns/blobdiff_plain/61b923b38be853072bce998602c8921d469f189e..86e7b8d96483d2f55561aa76ac96e7663840b796:/src/internal.h diff --git a/src/internal.h b/src/internal.h index 257953f..852c05c 100644 --- a/src/internal.h +++ b/src/internal.h @@ -82,9 +82,21 @@ typedef union { typedef struct { adns_rrtype type; - const char *name; + const char *rrtname; + const char *fmtname; int rrsz; + void (*makefinal)(adns_query qu, void *data); + /* Change memory management of *data. + * Previously, used alloc_interim, now use alloc_final. + */ + + adns_status (*convstring)(vbuf *vb, const void *data); + /* Converts the RR data to a string representation in vbuf. + * vbuf will be appended to (it must have been initialised), + * and will not be null-terminated by convstring. + */ + adns_status (*parse)(adns_query qu, int serv, const byte *dgram, int dglen, int cbyte, int max, void *store_r); @@ -96,11 +108,6 @@ typedef struct { * If there is an overrun which might indicate truncation, it should set * *rdstart to -1; otherwise it may set it to anything else positive. */ - - void (*makefinal)(adns_query qu, void *data); - /* Change memory management of *data. - * Previously, used alloc_interim, now use alloc_final. - */ } typeinfo; typedef struct allocnode { @@ -487,16 +494,16 @@ static inline int ctype_alpha(int c) { #define LIST_LINK_TAIL_PART(list,node,part) \ do { \ - (node)->part back= 0; \ - (node)->part next= (list).tail; \ - if ((list).tail) (list).tail->part back= (node); else (list).part head= (node); \ + (node)->part next= 0; \ + (node)->part back= (list).tail; \ + if ((list).tail) (list).tail->part next= (node); else (list).part head= (node); \ (list).tail= (node); \ } while(0) #define LIST_UNLINK(list,node) LIST_UNLINK_PART(list,node,) #define LIST_LINK_TAIL(list,node) LIST_LINK_TAIL_PART(list,node,) -#define GETIL_B(cb) (dgram[(cb)++]) +#define GETIL_B(cb) (((dgram)[(cb)++]) & 0x0ff) #define GET_B(cb,tv) ((tv)= GETIL_B((cb))) #define GET_W(cb,tv) ((tv)=0, (tv)|=(GETIL_B((cb))<<8), (tv)|=GETIL_B(cb), (tv))