3 /* private for dnsbitenc_... functions; do not access direcctly */
5 int npending; /* never more than 4 unless we're in the middle */
6 uint8_t *out, *bufstop; /* counts backwards */
11 * The only legal calling sequence is this:
18 void dnsbitenc_start(struct dnsbitenc *be, uint8_t *buf, int buflen);
20 void dnsbitenc_addbits(struct dnsbitenc *be, uint32_t val, int nbits);
21 /* adds the bottom nbits bits of val; must be enough space; nbits<=28 */
22 void dnsbitenc_addu32(struct dnsbitenc *be, uint32_t val);
23 /* must be enough space */
25 int dnsbitenc_restbytes(struct dnsbitenc *be, uint8_t *bytes, int qty);
26 /* returns number of bytes which did not fit */
28 uint8_t *dnsbitenc_getresult(struct dnsbitenc *be);
29 /* returns pointer into caller-supplied buffer; we have used
30 * bytes from the result to the end (so the caller needs to remember
31 * the buffer len to know what the encoded length is */