diff options
| author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2018-05-12 11:53:39 +0000 | 
|---|---|---|
| committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2018-05-12 11:53:39 +0000 | 
| commit | 6cacf549d3c2d5bddb0dcadd620e1db2897c7f26 (patch) | |
| tree | e187e7d708a063f1628697fe779e2bb101d451b8 /sldns/wire2str.c | |
| parent | fbdb9ac866a647da0919b224f05cca039afc02fa (diff) | |
Diffstat (limited to 'sldns/wire2str.c')
| -rw-r--r-- | sldns/wire2str.c | 31 | 
1 files changed, 31 insertions, 0 deletions
| diff --git a/sldns/wire2str.c b/sldns/wire2str.c index 0efa65f756645..b2ca6192c6492 100644 --- a/sldns/wire2str.c +++ b/sldns/wire2str.c @@ -47,6 +47,8 @@ static sldns_lookup_table sldns_algorithms_data[] = {  	{ LDNS_ECC_GOST, "ECC-GOST"},  	{ LDNS_ECDSAP256SHA256, "ECDSAP256SHA256"},  	{ LDNS_ECDSAP384SHA384, "ECDSAP384SHA384"}, +	{ LDNS_ED25519, "ED25519"}, +	{ LDNS_ED448, "ED448"},  	{ LDNS_INDIRECT, "INDIRECT" },  	{ LDNS_PRIVATEDNS, "PRIVATEDNS" },  	{ LDNS_PRIVATEOID, "PRIVATEOID" }, @@ -165,6 +167,7 @@ static sldns_lookup_table sldns_edns_options_data[] = {  	{ 6, "DHU" },  	{ 7, "N3U" },  	{ 8, "edns-client-subnet" }, +	{ 11, "edns-tcp-keepalive"},  	{ 12, "Padding" },  	{ 0, NULL}  }; @@ -270,6 +273,12 @@ int sldns_wire2str_rcode_buf(int rcode, char* s, size_t slen)  	return sldns_wire2str_rcode_print(&s, &slen, rcode);  } +int sldns_wire2str_opcode_buf(int opcode, char* s, size_t slen) +{ +	/* use arguments as temporary variables */ +	return sldns_wire2str_opcode_print(&s, &slen, opcode); +} +  int sldns_wire2str_dname_buf(uint8_t* d, size_t dlen, char* s, size_t slen)  {  	/* use arguments as temporary variables */ @@ -1838,6 +1847,25 @@ int sldns_wire2str_edns_subnet_print(char** s, size_t* sl, uint8_t* data,  	return w;  } +int sldns_wire2str_edns_keepalive_print(char** s, size_t* sl, uint8_t* data, +	size_t len) +{ +	int w = 0; +	uint16_t timeout; +	if(!(len == 0 || len == 2)) { +		w += sldns_str_print(s, sl, "malformed keepalive "); +		w += print_hex_buf(s, sl, data, len); +		return w; +	} +	if(len == 0 ) { +		w += sldns_str_print(s, sl, "no timeout value (only valid for client option) "); +	} else { +		timeout = sldns_read_uint16(data); +		w += sldns_str_print(s, sl, "timeout value in units of 100ms %u", (int)timeout); +	} +	return w; +} +  int sldns_wire2str_edns_option_print(char** s, size_t* sl,  	uint16_t option_code, uint8_t* optdata, size_t optlen)  { @@ -1866,6 +1894,9 @@ int sldns_wire2str_edns_option_print(char** s, size_t* sl,  	case LDNS_EDNS_CLIENT_SUBNET:  		w += sldns_wire2str_edns_subnet_print(s, sl, optdata, optlen);  		break; +	 case LDNS_EDNS_KEEPALIVE: +		w += sldns_wire2str_edns_keepalive_print(s, sl, optdata, optlen); +		break;  	case LDNS_EDNS_PADDING:  		w += print_hex_buf(s, sl, optdata, optlen);  		break; | 
