EDNS for the client.

git-svn-id: file:///svn/unbound/trunk@288 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards
2007-05-07 13:17:27 +00:00
parent 841d09ff08
commit f3c0cd34d8
8 changed files with 156 additions and 16 deletions
+13
View File
@@ -189,6 +189,8 @@ struct rr_parse {
#define EDNS_RCODE_BADVERS 16 /** bad EDNS version */
/** largest valid compression offset */
#define PTR_MAX_OFFSET 0x3fff
/** bits for EDNS bitfield */
#define EDNS_DO 0x8000 /* Dnssec Ok */
/**
* EDNS data storage
@@ -244,4 +246,15 @@ int parse_packet(ldns_buffer* pkt, struct msg_parse* msg,
*/
int parse_extract_edns(struct msg_parse* msg, struct edns_data* edns);
/**
* If EDNS data follows a query section, extract it and initialize edns struct.
* @param pkt: the packet. position at start must be right after the query
* section. At end, right after EDNS data or no movement if failed.
* @param edns: the edns data allocated by the caller. Does not have to be
* initialised.
* @return: 0 on success, or an RCODE on error.
* RCODE formerr if OPT is badly formatted and so on.
*/
int parse_edns_from_pkt(ldns_buffer* pkt, struct edns_data* edns);
#endif /* UTIL_DATA_MSGPARSE_H */