1266077Sdes/** 2266077Sdes * wire2str.h - txt presentation of RRs 3266077Sdes * 4266077Sdes * (c) NLnet Labs, 2005-2006 5266077Sdes * 6266077Sdes * See the file LICENSE for the license 7266077Sdes */ 8266077Sdes 9266077Sdes/** 10266077Sdes * \file 11266077Sdes * 12266077Sdes * Contains functions to translate the wireformat to text 13266077Sdes * representation, as well as functions to print them. 14266077Sdes */ 15266077Sdes 16266077Sdes#ifndef LDNS_WIRE2STR_H 17266077Sdes#define LDNS_WIRE2STR_H 18266077Sdes 19266077Sdes#ifdef __cplusplus 20266077Sdesextern "C" { 21266077Sdes#endif 22266077Sdesstruct sldns_struct_lookup_table; 23266077Sdes 24266077Sdes/* lookup tables for standard DNS stuff */ 25266077Sdes/** Taken from RFC 2535, section 7. */ 26266077Sdesextern struct sldns_struct_lookup_table* sldns_algorithms; 27266077Sdes/** DS record hash algorithms */ 28266077Sdesextern struct sldns_struct_lookup_table* sldns_hashes; 29266077Sdes/** Taken from RFC 2538, section 2.1. */ 30266077Sdesextern struct sldns_struct_lookup_table* sldns_cert_algorithms; 31266077Sdes/** Response codes */ 32266077Sdesextern struct sldns_struct_lookup_table* sldns_rcodes; 33266077Sdes/** Operation codes */ 34266077Sdesextern struct sldns_struct_lookup_table* sldns_opcodes; 35266077Sdes/** EDNS flags */ 36266077Sdesextern struct sldns_struct_lookup_table* sldns_edns_flags; 37266077Sdes/** EDNS option codes */ 38266077Sdesextern struct sldns_struct_lookup_table* sldns_edns_options; 39266077Sdes/** error string from wireparse */ 40266077Sdesextern struct sldns_struct_lookup_table* sldns_wireparse_errors; 41266077Sdes 42266077Sdes/** 43266077Sdes * Convert wireformat packet to a string representation 44266077Sdes * @param data: wireformat packet data (starting at ID bytes). 45266077Sdes * @param len: length of packet. 46266077Sdes * @return string(malloced) or NULL on failure. 47266077Sdes */ 48266077Sdeschar* sldns_wire2str_pkt(uint8_t* data, size_t len); 49266077Sdes 50266077Sdes/** 51266077Sdes * Convert wireformat RR to a string representation. 52266077Sdes * @param rr: the wireformat RR, in uncompressed form. Starts at the domain 53266077Sdes * name start, ends with the rdata of the RR. 54266077Sdes * @param len: length of the rr wireformat. 55266077Sdes * @return string(malloced) or NULL on failure. 56266077Sdes */ 57266077Sdeschar* sldns_wire2str_rr(uint8_t* rr, size_t len); 58266077Sdes 59266077Sdes/** 60266077Sdes * Conver wire dname to a string. 61266077Sdes * @param dname: the dname in uncompressed wireformat. 62266077Sdes * @param dname_len: length of the dname. 63266077Sdes * @return string or NULL on failure. 64266077Sdes */ 65266077Sdeschar* sldns_wire2str_dname(uint8_t* dname, size_t dname_len); 66266077Sdes 67266077Sdes/** 68266077Sdes * Convert wire RR type to a string, 'MX', 'TYPE1234'... 69266077Sdes * @param rrtype: the RR type in host order. 70266077Sdes * @return malloced string with the RR type or NULL on malloc failure. 71266077Sdes */ 72266077Sdeschar* sldns_wire2str_type(uint16_t rrtype); 73266077Sdes 74266077Sdes/** 75266077Sdes * Convert wire RR class to a string, 'IN', 'CLASS1'. 76266077Sdes * @param rrclass: the RR class in host order. 77266077Sdes * @return malloced string with the RR class or NULL on malloc failure. 78266077Sdes */ 79266077Sdeschar* sldns_wire2str_class(uint16_t rrclass); 80266077Sdes 81266077Sdes/** 82266077Sdes * Convert wire packet rcode to a string, 'NOERROR', 'NXDOMAIN'... 83266077Sdes * @param rcode: as integer, host order 84266077Sdes * @return malloced string with the rcode or NULL on malloc failure. 85266077Sdes */ 86266077Sdeschar* sldns_wire2str_rcode(int rcode); 87266077Sdes 88266077Sdes/** 89266077Sdes * Print to string, move string along for next content. With va_list. 90266077Sdes * @param str: string buffer. Adjusted at end to after the output. 91266077Sdes * @param slen: length of the string buffer. Adjusted at end. 92266077Sdes * @param format: printf format string. 93266077Sdes * @param args: arguments for printf. 94266077Sdes * @return number of characters needed. Can be larger than slen. 95266077Sdes */ 96266077Sdesint sldns_str_vprint(char** str, size_t* slen, const char* format, va_list args); 97266077Sdes 98266077Sdes/** 99266077Sdes * Print to string, move string along for next content. 100266077Sdes * @param str: string buffer. Adjusted at end to after the output. 101266077Sdes * @param slen: length of the string buffer. Adjusted at end. 102266077Sdes * @param format: printf format string and arguments for it. 103266077Sdes * @return number of characters needed. Can be larger than slen. 104266077Sdes */ 105266077Sdesint sldns_str_print(char** str, size_t* slen, const char* format, ...) 106266077Sdes ATTR_FORMAT(printf, 3, 4); 107266077Sdes 108266077Sdes/** 109266077Sdes * Convert wireformat packet to a string representation with user buffer 110266077Sdes * It appends every RR with default comments. 111266077Sdes * For more formatter options use the function: TBD(TODO) 112266077Sdes * @param data: wireformat packet data (starting at ID bytes). 113266077Sdes * @param data_len: length of packet. 114266077Sdes * @param str: the string buffer for the output. 115266077Sdes * If you pass NULL as the str the return value of the function is 116266077Sdes * the str_len you need for the entire packet. It does not include 117266077Sdes * the 0 byte at the end. 118266077Sdes * @param str_len: the size of the string buffer. If more is needed, it'll 119266077Sdes * silently truncate the output to fit in the buffer. 120266077Sdes * @return the number of characters for this element, excluding zerobyte. 121266077Sdes * Is larger than str_len if output was truncated. 122266077Sdes */ 123266077Sdesint sldns_wire2str_pkt_buf(uint8_t* data, size_t data_len, char* str, 124266077Sdes size_t str_len); 125266077Sdes 126266077Sdes/** 127266077Sdes * Scan wireformat packet to a string representation with user buffer 128266077Sdes * It appends every RR with default comments. 129266077Sdes * For more formatter options use the function: TBD(TODO) 130266077Sdes * @param data: wireformat packet data (starting at ID bytes). 131266077Sdes * @param data_len: length of packet. 132266077Sdes * @param str: the string buffer for the output. 133266077Sdes * @param str_len: the size of the string buffer. 134266077Sdes * @return number of characters for string. 135266077Sdes * returns the number of characters that are needed (except terminating null), 136266077Sdes * so it may return a value larger than str_len. 137266077Sdes * On error you get less output (i.e. shorter output in str (null terminated)) 138266077Sdes * On exit the data, data_len, str and str_len values are adjusted to move them 139266077Sdes * from their original position along the input and output for the content 140266077Sdes * that has been consumed (and produced) by this function. If the end of the 141266077Sdes * output string is reached, *str_len is set to 0. The output string is null 142266077Sdes * terminated (shortening the output if necessary). If the end of the input 143266077Sdes * is reached *data_len is set to 0. 144266077Sdes */ 145266077Sdesint sldns_wire2str_pkt_scan(uint8_t** data, size_t* data_len, char** str, 146266077Sdes size_t* str_len); 147266077Sdes 148266077Sdes/** 149266077Sdes * Scan wireformat rr to string, with user buffers. It shifts the arguments 150266077Sdes * to move along (see sldns_wire2str_pkt_scan). 151266077Sdes * @param data: wireformat data. 152266077Sdes * @param data_len: length of data buffer. 153266077Sdes * @param str: string buffer. 154266077Sdes * @param str_len: length of string buffer. 155266077Sdes * @param pkt: packet for decompression, if NULL no decompression. 156266077Sdes * @param pktlen: length of packet buffer. 157266077Sdes * @return number of characters (except null) needed to print. 158266077Sdes */ 159266077Sdesint sldns_wire2str_rr_scan(uint8_t** data, size_t* data_len, char** str, 160266077Sdes size_t* str_len, uint8_t* pkt, size_t pktlen); 161266077Sdes 162266077Sdes/** 163266077Sdes * Scan wireformat question rr to string, with user buffers. 164266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 165266077Sdes * @param data: wireformat data. 166266077Sdes * @param data_len: length of data buffer. 167266077Sdes * @param str: string buffer. 168266077Sdes * @param str_len: length of string buffer. 169266077Sdes * @param pkt: packet for decompression, if NULL no decompression. 170266077Sdes * @param pktlen: length of packet buffer. 171266077Sdes * @return number of characters (except null) needed to print. 172266077Sdes */ 173266077Sdesint sldns_wire2str_rrquestion_scan(uint8_t** data, size_t* data_len, char** str, 174266077Sdes size_t* str_len, uint8_t* pkt, size_t pktlen); 175266077Sdes 176266077Sdes/** 177266077Sdes * Scan wireformat RR to string in unknown RR format, with user buffers. 178266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 179266077Sdes * @param data: wireformat data. 180266077Sdes * @param data_len: length of data buffer. 181266077Sdes * @param str: string buffer. 182266077Sdes * @param str_len: length of string buffer. 183266077Sdes * @param pkt: packet for decompression, if NULL no decompression. 184266077Sdes * @param pktlen: length of packet buffer. 185266077Sdes * @return number of characters (except null) needed to print. 186266077Sdes */ 187266077Sdesint sldns_wire2str_rr_unknown_scan(uint8_t** data, size_t* data_len, char** str, 188266077Sdes size_t* str_len, uint8_t* pkt, size_t pktlen); 189266077Sdes 190266077Sdes/** 191266077Sdes * Print to string the RR-information comment in default format, 192266077Sdes * with user buffers. Moves string along. 193266077Sdes * @param str: string buffer. 194266077Sdes * @param str_len: length of string buffer. 195266077Sdes * @param rr: wireformat data. 196266077Sdes * @param rrlen: length of data buffer. 197266077Sdes * @param dname_off: offset in buffer behind owner dname, the compressed size 198266077Sdes * of the owner name. 199266077Sdes * @param rrtype: type of the RR, host format. 200266077Sdes * @return number of characters (except null) needed to print. 201266077Sdes */ 202266077Sdesint sldns_wire2str_rr_comment_print(char** str, size_t* str_len, uint8_t* rr, 203266077Sdes size_t rrlen, size_t dname_off, uint16_t rrtype); 204266077Sdes 205266077Sdes/** 206266077Sdes * Scan wireformat packet header to string, with user buffers. 207266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 208266077Sdes * @param data: wireformat data. 209266077Sdes * @param data_len: length of data buffer. 210266077Sdes * @param str: string buffer. 211266077Sdes * @param str_len: length of string buffer. 212266077Sdes * @return number of characters (except null) needed to print. 213266077Sdes */ 214266077Sdesint sldns_wire2str_header_scan(uint8_t** data, size_t* data_len, char** str, 215266077Sdes size_t* str_len); 216266077Sdes 217266077Sdes/** 218266077Sdes * Scan wireformat rdata to string, with user buffers. 219266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 220266077Sdes * @param data: wireformat data. 221266077Sdes * @param data_len: length of data buffer. The length of the rdata in the 222266077Sdes * buffer. The rdatalen itself has already been scanned, the data 223266077Sdes * points to the rdata after the rdatalen. 224266077Sdes * @param str: string buffer. 225266077Sdes * @param str_len: length of string buffer. 226266077Sdes * @param rrtype: RR type of Rdata, host format. 227266077Sdes * @param pkt: packet for decompression, if NULL no decompression. 228266077Sdes * @param pktlen: length of packet buffer. 229266077Sdes * @return number of characters (except null) needed to print. 230266077Sdes */ 231266077Sdesint sldns_wire2str_rdata_scan(uint8_t** data, size_t* data_len, char** str, 232266077Sdes size_t* str_len, uint16_t rrtype, uint8_t* pkt, size_t pktlen); 233266077Sdes 234266077Sdes/** 235266077Sdes * Scan wireformat rdata to string in unknown format, with user buffers. 236266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 237266077Sdes * @param data: wireformat data. 238266077Sdes * @param data_len: length of data buffer, the length of the rdata in buffer. 239266077Sdes * @param str: string buffer. 240266077Sdes * @param str_len: length of string buffer. 241266077Sdes * @return number of characters (except null) needed to print. 242266077Sdes */ 243266077Sdesint sldns_wire2str_rdata_unknown_scan(uint8_t** data, size_t* data_len, 244266077Sdes char** str, size_t* str_len); 245266077Sdes 246266077Sdes/** 247266077Sdes * Scan wireformat domain name to string, with user buffers. 248266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 249266077Sdes * @param data: wireformat data. 250266077Sdes * @param data_len: length of data buffer. 251266077Sdes * @param str: string buffer. 252266077Sdes * @param str_len: length of string buffer. 253266077Sdes * @param pkt: packet for decompression, if NULL no decompression. 254266077Sdes * @param pktlen: length of packet buffer. 255266077Sdes * @return number of characters (except null) needed to print. 256266077Sdes */ 257266077Sdesint sldns_wire2str_dname_scan(uint8_t** data, size_t* data_len, char** str, 258266077Sdes size_t* str_len, uint8_t* pkt, size_t pktlen); 259266077Sdes 260266077Sdes/** 261266077Sdes * Scan wireformat rr type to string, with user buffers. 262266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 263266077Sdes * @param data: wireformat data. 264266077Sdes * @param data_len: length of data buffer. 265266077Sdes * @param str: string buffer. 266266077Sdes * @param str_len: length of string buffer. 267266077Sdes * @return number of characters (except null) needed to print. 268266077Sdes */ 269266077Sdesint sldns_wire2str_type_scan(uint8_t** data, size_t* data_len, char** str, 270266077Sdes size_t* str_len); 271266077Sdes 272266077Sdes/** 273266077Sdes * Scan wireformat rr class to string, with user buffers. 274266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 275266077Sdes * @param data: wireformat data. 276266077Sdes * @param data_len: length of data buffer. 277266077Sdes * @param str: string buffer. 278266077Sdes * @param str_len: length of string buffer. 279266077Sdes * @return number of characters (except null) needed to print. 280266077Sdes */ 281266077Sdesint sldns_wire2str_class_scan(uint8_t** data, size_t* data_len, char** str, 282266077Sdes size_t* str_len); 283266077Sdes 284266077Sdes/** 285266077Sdes * Scan wireformat rr ttl to string, with user buffers. 286266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 287266077Sdes * @param data: wireformat data. 288266077Sdes * @param data_len: length of data buffer. 289266077Sdes * @param str: string buffer. 290266077Sdes * @param str_len: length of string buffer. 291266077Sdes * @return number of characters (except null) needed to print. 292266077Sdes */ 293266077Sdesint sldns_wire2str_ttl_scan(uint8_t** data, size_t* data_len, char** str, 294266077Sdes size_t* str_len); 295266077Sdes 296266077Sdes 297266077Sdes/** 298266077Sdes * Print host format rr type to string. Moves string along, user buffers. 299266077Sdes * @param str: string buffer. 300266077Sdes * @param str_len: length of string buffer. 301266077Sdes * @param rrtype: host format rr type. 302266077Sdes * @return number of characters (except null) needed to print. 303266077Sdes */ 304266077Sdesint sldns_wire2str_type_print(char** str, size_t* str_len, uint16_t rrtype); 305266077Sdes 306266077Sdes/** 307266077Sdes * Print host format rr class to string. Moves string along, user buffers. 308266077Sdes * @param str: string buffer. 309266077Sdes * @param str_len: length of string buffer. 310266077Sdes * @param rrclass: host format rr class. 311266077Sdes * @return number of characters (except null) needed to print. 312266077Sdes */ 313266077Sdesint sldns_wire2str_class_print(char** str, size_t* str_len, uint16_t rrclass); 314266077Sdes 315266077Sdes/** 316266077Sdes * Print host format rcode to string. Moves string along, user buffers. 317266077Sdes * @param str: string buffer. 318266077Sdes * @param str_len: length of string buffer. 319266077Sdes * @param rcode: host format rcode number. 320266077Sdes * @return number of characters (except null) needed to print. 321266077Sdes */ 322266077Sdesint sldns_wire2str_rcode_print(char** str, size_t* str_len, int rcode); 323266077Sdes 324266077Sdes/** 325266077Sdes * Print host format opcode to string. Moves string along, user buffers. 326266077Sdes * @param str: string buffer. 327266077Sdes * @param str_len: length of string buffer. 328266077Sdes * @param opcode: host format opcode number. 329266077Sdes * @return number of characters (except null) needed to print. 330266077Sdes */ 331266077Sdesint sldns_wire2str_opcode_print(char** str, size_t* str_len, int opcode); 332266077Sdes 333266077Sdes/** 334266077Sdes * Print host format EDNS0 option to string. Moves string along, user buffers. 335266077Sdes * @param str: string buffer. 336266077Sdes * @param str_len: length of string buffer. 337266077Sdes * @param opcode: host format option number. 338266077Sdes * @return number of characters (except null) needed to print. 339266077Sdes */ 340266077Sdesint sldns_wire2str_edns_option_code_print(char** str, size_t* str_len, 341266077Sdes uint16_t opcode); 342266077Sdes 343266077Sdes/** 344266077Sdes * Convert RR to string presentation format, on one line. User buffer. 345266077Sdes * @param rr: wireformat RR data 346266077Sdes * @param rr_len: length of the rr wire data. 347266077Sdes * @param str: the string buffer to write to. 348266077Sdes * If you pass NULL as the str, the return value of the function is 349266077Sdes * the str_len you need for the entire packet. It does not include 350266077Sdes * the 0 byte at the end. 351266077Sdes * @param str_len: the size of the string buffer. If more is needed, it'll 352266077Sdes * silently truncate the output to fit in the buffer. 353266077Sdes * @return the number of characters for this element, excluding zerobyte. 354266077Sdes * Is larger than str_len if output was truncated. 355266077Sdes */ 356266077Sdesint sldns_wire2str_rr_buf(uint8_t* rr, size_t rr_len, char* str, 357266077Sdes size_t str_len); 358266077Sdes 359266077Sdes/** 360266077Sdes * 3597 printout of an RR in unknown rr format. 361266077Sdes * There are more format and comment options available for printout 362266077Sdes * with the function: TBD(TODO) 363266077Sdes * @param rr: wireformat RR data 364266077Sdes * @param rr_len: length of the rr wire data. 365266077Sdes * @param str: the string buffer to write to. 366266077Sdes * If you pass NULL as the str, the return value of the function is 367266077Sdes * the str_len you need for the entire rr. It does not include 368266077Sdes * the 0 byte at the end. 369266077Sdes * @param str_len: the size of the string buffer. If more is needed, it'll 370266077Sdes * silently truncate the output to fit in the buffer. 371266077Sdes * @return the number of characters for this element, excluding zerobyte. 372266077Sdes * Is larger than str_len if output was truncated. 373266077Sdes */ 374266077Sdesint sldns_wire2str_rr_unknown_buf(uint8_t* rr, size_t rr_len, char* str, 375266077Sdes size_t str_len); 376266077Sdes 377266077Sdes/** 378266077Sdes * This creates the comment to print after the RR. ; keytag=... , and other 379266077Sdes * basic comments for RRs. 380266077Sdes * There are more format and comment options available for printout 381266077Sdes * with the function: TBD(TODO) 382266077Sdes * @param rr: wireformat RR data 383266077Sdes * @param rr_len: length of the rr wire data. 384266077Sdes * @param dname_len: length of the dname in front of the RR. 385266077Sdes * @param str: the string buffer to write to. 386266077Sdes * If you pass NULL as the str, the return value of the function is 387266077Sdes * the str_len you need for the entire comment. It does not include 388266077Sdes * the 0 byte at the end. 389266077Sdes * @param str_len: the size of the string buffer. If more is needed, it'll 390266077Sdes * silently truncate the output to fit in the buffer. 391266077Sdes * @return the number of characters for this element, excluding zerobyte. 392266077Sdes * Is larger than str_len if output was truncated. 393266077Sdes */ 394266077Sdesint sldns_wire2str_rr_comment_buf(uint8_t* rr, size_t rr_len, size_t dname_len, 395266077Sdes char* str, size_t str_len); 396266077Sdes 397266077Sdes/** 398266077Sdes * Convert RDATA to string presentation format, on one line. User buffer. 399266077Sdes * @param rdata: wireformat rdata part of an RR. 400266077Sdes * @param rdata_len: length of the rr wire data. 401266077Sdes * @param str: the string buffer to write to. 402266077Sdes * If you pass NULL as the str, the return value of the function is 403266077Sdes * the str_len you need for the entire packet. It does not include 404266077Sdes * the 0 byte at the end. 405266077Sdes * @param str_len: the size of the string buffer. If more is needed, it'll 406266077Sdes * silently truncate the output to fit in the buffer. 407266077Sdes * @param rrtype: rr type of the data 408266077Sdes * @return the number of characters for this element, excluding zerobyte. 409266077Sdes * Is larger than str_len if output was truncated. 410266077Sdes */ 411266077Sdesint sldns_wire2str_rdata_buf(uint8_t* rdata, size_t rdata_len, char* str, 412266077Sdes size_t str_len, uint16_t rrtype); 413266077Sdes 414266077Sdes/** 415266077Sdes * Convert wire RR type to a string, 'MX', 'TYPE12'. With user buffer. 416266077Sdes * @param rrtype: the RR type in host order. 417266077Sdes * @param str: the string to write to. 418266077Sdes * @param len: length of str. 419266077Sdes * @return the number of characters for this element, excluding zerobyte. 420266077Sdes * Is larger than str_len if output was truncated. 421266077Sdes */ 422266077Sdesint sldns_wire2str_type_buf(uint16_t rrtype, char* str, size_t len); 423266077Sdes 424266077Sdes/** 425266077Sdes * Convert wire RR class to a string, 'IN', 'CLASS12'. With user buffer. 426266077Sdes * @param rrclass: the RR class in host order. 427266077Sdes * @param str: the string to write to. 428266077Sdes * @param len: length of str. 429266077Sdes * @return the number of characters for this element, excluding zerobyte. 430266077Sdes * Is larger than str_len if output was truncated. 431266077Sdes */ 432266077Sdesint sldns_wire2str_class_buf(uint16_t rrclass, char* str, size_t len); 433266077Sdes 434266077Sdes/** 435266077Sdes * Convert wire RR rcode to a string, 'NOERROR', 'NXDOMAIN'. With user buffer. 436266077Sdes * @param rcode: rcode as integer in host order 437266077Sdes * @param str: the string to write to. 438266077Sdes * @param len: length of str. 439266077Sdes * @return the number of characters for this element, excluding zerobyte. 440266077Sdes * Is larger than str_len if output was truncated. 441266077Sdes */ 442266077Sdesint sldns_wire2str_rcode_buf(int rcode, char* str, size_t len); 443266077Sdes 444266077Sdes/** 445266077Sdes * Convert wire dname to a string, "example.com.". With user buffer. 446266077Sdes * @param dname: the dname in uncompressed wireformat. 447266077Sdes * @param dname_len: length of the dname. 448266077Sdes * @param str: the string to write to. 449266077Sdes * @param len: length of string. 450266077Sdes * @return the number of characters for this element, excluding zerobyte. 451266077Sdes * Is larger than str_len if output was truncated. 452266077Sdes */ 453266077Sdesint sldns_wire2str_dname_buf(uint8_t* dname, size_t dname_len, char* str, 454266077Sdes size_t len); 455266077Sdes 456266077Sdes/** 457266077Sdes * Scan wireformat rdf field to string, with user buffers. 458266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 459266077Sdes * @param data: wireformat data. 460266077Sdes * @param data_len: length of data buffer. 461266077Sdes * @param str: string buffer. 462266077Sdes * @param str_len: length of string buffer. 463266077Sdes * @param rdftype: the type of the rdata field, enum sldns_rdf_type. 464266077Sdes * @param pkt: packet for decompression, if NULL no decompression. 465266077Sdes * @param pktlen: length of packet buffer. 466266077Sdes * @return number of characters (except null) needed to print. 467266077Sdes * Can return -1 on failure. 468266077Sdes */ 469266077Sdesint sldns_wire2str_rdf_scan(uint8_t** data, size_t* data_len, char** str, 470266077Sdes size_t* str_len, int rdftype, uint8_t* pkt, size_t pktlen); 471266077Sdes 472266077Sdes/** 473266077Sdes * Scan wireformat int8 field to string, with user buffers. 474266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 475266077Sdes * @param data: wireformat data. 476266077Sdes * @param data_len: length of data buffer. 477266077Sdes * @param str: string buffer. 478266077Sdes * @param str_len: length of string buffer. 479266077Sdes * @return number of characters (except null) needed to print. 480266077Sdes * Can return -1 on failure. 481266077Sdes */ 482266077Sdesint sldns_wire2str_int8_scan(uint8_t** data, size_t* data_len, char** str, 483266077Sdes size_t* str_len); 484266077Sdes 485266077Sdes/** 486266077Sdes * Scan wireformat int16 field to string, with user buffers. 487266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 488266077Sdes * @param data: wireformat data. 489266077Sdes * @param data_len: length of data buffer. 490266077Sdes * @param str: string buffer. 491266077Sdes * @param str_len: length of string buffer. 492266077Sdes * @return number of characters (except null) needed to print. 493266077Sdes * Can return -1 on failure. 494266077Sdes */ 495266077Sdesint sldns_wire2str_int16_scan(uint8_t** data, size_t* data_len, char** str, 496266077Sdes size_t* str_len); 497266077Sdes 498266077Sdes/** 499266077Sdes * Scan wireformat int32 field to string, with user buffers. 500266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 501266077Sdes * @param data: wireformat data. 502266077Sdes * @param data_len: length of data buffer. 503266077Sdes * @param str: string buffer. 504266077Sdes * @param str_len: length of string buffer. 505266077Sdes * @return number of characters (except null) needed to print. 506266077Sdes * Can return -1 on failure. 507266077Sdes */ 508266077Sdesint sldns_wire2str_int32_scan(uint8_t** data, size_t* data_len, char** str, 509266077Sdes size_t* str_len); 510266077Sdes 511266077Sdes/** 512266077Sdes * Scan wireformat period field to string, with user buffers. 513266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 514266077Sdes * @param data: wireformat data. 515266077Sdes * @param data_len: length of data buffer. 516266077Sdes * @param str: string buffer. 517266077Sdes * @param str_len: length of string buffer. 518266077Sdes * @return number of characters (except null) needed to print. 519266077Sdes * Can return -1 on failure. 520266077Sdes */ 521266077Sdesint sldns_wire2str_period_scan(uint8_t** data, size_t* data_len, char** str, 522266077Sdes size_t* str_len); 523266077Sdes 524266077Sdes/** 525266077Sdes * Scan wireformat tsigtime field to string, with user buffers. 526266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 527266077Sdes * @param data: wireformat data. 528266077Sdes * @param data_len: length of data buffer. 529266077Sdes * @param str: string buffer. 530266077Sdes * @param str_len: length of string buffer. 531266077Sdes * @return number of characters (except null) needed to print. 532266077Sdes * Can return -1 on failure. 533266077Sdes */ 534266077Sdesint sldns_wire2str_tsigtime_scan(uint8_t** data, size_t* data_len, char** str, 535266077Sdes size_t* str_len); 536266077Sdes 537266077Sdes/** 538266077Sdes * Scan wireformat ip4 A field to string, with user buffers. 539266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 540266077Sdes * @param data: wireformat data. 541266077Sdes * @param data_len: length of data buffer. 542266077Sdes * @param str: string buffer. 543266077Sdes * @param str_len: length of string buffer. 544266077Sdes * @return number of characters (except null) needed to print. 545266077Sdes * Can return -1 on failure. 546266077Sdes */ 547266077Sdesint sldns_wire2str_a_scan(uint8_t** data, size_t* data_len, char** str, 548266077Sdes size_t* str_len); 549266077Sdes 550266077Sdes/** 551266077Sdes * Scan wireformat ip6 AAAA field to string, with user buffers. 552266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 553266077Sdes * @param data: wireformat data. 554266077Sdes * @param data_len: length of data buffer. 555266077Sdes * @param str: string buffer. 556266077Sdes * @param str_len: length of string buffer. 557266077Sdes * @return number of characters (except null) needed to print. 558266077Sdes * Can return -1 on failure. 559266077Sdes */ 560266077Sdesint sldns_wire2str_aaaa_scan(uint8_t** data, size_t* data_len, char** str, 561266077Sdes size_t* str_len); 562266077Sdes 563266077Sdes/** 564266077Sdes * Scan wireformat str field to string, with user buffers. 565266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 566266077Sdes * @param data: wireformat data. 567266077Sdes * @param data_len: length of data buffer. 568266077Sdes * @param str: string buffer. 569266077Sdes * @param str_len: length of string buffer. 570266077Sdes * @return number of characters (except null) needed to print. 571266077Sdes * Can return -1 on failure. 572266077Sdes */ 573266077Sdesint sldns_wire2str_str_scan(uint8_t** data, size_t* data_len, char** str, 574266077Sdes size_t* str_len); 575266077Sdes 576266077Sdes/** 577266077Sdes * Scan wireformat apl field to string, with user buffers. 578266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 579266077Sdes * @param data: wireformat data. 580266077Sdes * @param data_len: length of data buffer. 581266077Sdes * @param str: string buffer. 582266077Sdes * @param str_len: length of string buffer. 583266077Sdes * @return number of characters (except null) needed to print. 584266077Sdes * Can return -1 on failure. 585266077Sdes */ 586266077Sdesint sldns_wire2str_apl_scan(uint8_t** data, size_t* data_len, char** str, 587266077Sdes size_t* str_len); 588266077Sdes 589266077Sdes/** 590266077Sdes * Scan wireformat b32_ext field to string, with user buffers. 591266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 592266077Sdes * @param data: wireformat data. 593266077Sdes * @param data_len: length of data buffer. 594266077Sdes * @param str: string buffer. 595266077Sdes * @param str_len: length of string buffer. 596266077Sdes * @return number of characters (except null) needed to print. 597266077Sdes * Can return -1 on failure. 598266077Sdes */ 599266077Sdesint sldns_wire2str_b32_ext_scan(uint8_t** data, size_t* data_len, char** str, 600266077Sdes size_t* str_len); 601266077Sdes 602266077Sdes/** 603266077Sdes * Scan wireformat b64 field to string, with user buffers. 604266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 605266077Sdes * @param data: wireformat data. 606266077Sdes * @param data_len: length of data buffer. 607266077Sdes * @param str: string buffer. 608266077Sdes * @param str_len: length of string buffer. 609266077Sdes * @return number of characters (except null) needed to print. 610266077Sdes * Can return -1 on failure. 611266077Sdes */ 612266077Sdesint sldns_wire2str_b64_scan(uint8_t** data, size_t* data_len, char** str, 613266077Sdes size_t* str_len); 614266077Sdes 615266077Sdes/** 616266077Sdes * Scan wireformat hex field to string, with user buffers. 617266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 618266077Sdes * @param data: wireformat data. 619266077Sdes * @param data_len: length of data buffer. 620266077Sdes * @param str: string buffer. 621266077Sdes * @param str_len: length of string buffer. 622266077Sdes * @return number of characters (except null) needed to print. 623266077Sdes * Can return -1 on failure. 624266077Sdes */ 625266077Sdesint sldns_wire2str_hex_scan(uint8_t** data, size_t* data_len, char** str, 626266077Sdes size_t* str_len); 627266077Sdes 628266077Sdes/** 629266077Sdes * Scan wireformat nsec bitmap field to string, with user buffers. 630266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 631266077Sdes * @param data: wireformat data. 632266077Sdes * @param data_len: length of data buffer. 633266077Sdes * @param str: string buffer. 634266077Sdes * @param str_len: length of string buffer. 635266077Sdes * @return number of characters (except null) needed to print. 636266077Sdes * Can return -1 on failure. 637266077Sdes */ 638266077Sdesint sldns_wire2str_nsec_scan(uint8_t** data, size_t* data_len, char** str, 639266077Sdes size_t* str_len); 640266077Sdes 641266077Sdes/** 642266077Sdes * Scan wireformat nsec3_salt field to string, with user buffers. 643266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 644266077Sdes * @param data: wireformat data. 645266077Sdes * @param data_len: length of data buffer. 646266077Sdes * @param str: string buffer. 647266077Sdes * @param str_len: length of string buffer. 648266077Sdes * @return number of characters (except null) needed to print. 649266077Sdes * Can return -1 on failure. 650266077Sdes */ 651266077Sdesint sldns_wire2str_nsec3_salt_scan(uint8_t** data, size_t* data_len, char** str, 652266077Sdes size_t* str_len); 653266077Sdes 654266077Sdes/** 655266077Sdes * Scan wireformat cert_alg field to string, with user buffers. 656266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 657266077Sdes * @param data: wireformat data. 658266077Sdes * @param data_len: length of data buffer. 659266077Sdes * @param str: string buffer. 660266077Sdes * @param str_len: length of string buffer. 661266077Sdes * @return number of characters (except null) needed to print. 662266077Sdes * Can return -1 on failure. 663266077Sdes */ 664266077Sdesint sldns_wire2str_cert_alg_scan(uint8_t** data, size_t* data_len, char** str, 665266077Sdes size_t* str_len); 666266077Sdes 667266077Sdes/** 668266077Sdes * Scan wireformat alg field to string, with user buffers. 669266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 670266077Sdes * @param data: wireformat data. 671266077Sdes * @param data_len: length of data buffer. 672266077Sdes * @param str: string buffer. 673266077Sdes * @param str_len: length of string buffer. 674266077Sdes * @return number of characters (except null) needed to print. 675266077Sdes * Can return -1 on failure. 676266077Sdes */ 677266077Sdesint sldns_wire2str_alg_scan(uint8_t** data, size_t* data_len, char** str, 678266077Sdes size_t* str_len); 679266077Sdes 680266077Sdes/** 681266077Sdes * Scan wireformat type unknown field to string, with user buffers. 682266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 683266077Sdes * @param data: wireformat data. 684266077Sdes * @param data_len: length of data buffer. 685266077Sdes * @param str: string buffer. 686266077Sdes * @param str_len: length of string buffer. 687266077Sdes * @return number of characters (except null) needed to print. 688266077Sdes * Can return -1 on failure. 689266077Sdes */ 690266077Sdesint sldns_wire2str_unknown_scan(uint8_t** data, size_t* data_len, char** str, 691266077Sdes size_t* str_len); 692266077Sdes 693266077Sdes/** 694266077Sdes * Scan wireformat time field to string, with user buffers. 695266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 696266077Sdes * @param data: wireformat data. 697266077Sdes * @param data_len: length of data buffer. 698266077Sdes * @param str: string buffer. 699266077Sdes * @param str_len: length of string buffer. 700266077Sdes * @return number of characters (except null) needed to print. 701266077Sdes * Can return -1 on failure. 702266077Sdes */ 703266077Sdesint sldns_wire2str_time_scan(uint8_t** data, size_t* data_len, char** str, 704266077Sdes size_t* str_len); 705266077Sdes 706266077Sdes/** 707266077Sdes * Scan wireformat LOC field to string, with user buffers. 708266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 709266077Sdes * @param data: wireformat data. 710266077Sdes * @param data_len: length of data buffer. 711266077Sdes * @param str: string buffer. 712266077Sdes * @param str_len: length of string buffer. 713266077Sdes * @return number of characters (except null) needed to print. 714266077Sdes * Can return -1 on failure. 715266077Sdes */ 716266077Sdesint sldns_wire2str_loc_scan(uint8_t** data, size_t* data_len, char** str, 717266077Sdes size_t* str_len); 718266077Sdes 719266077Sdes/** 720266077Sdes * Scan wireformat WKS field to string, with user buffers. 721266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 722266077Sdes * @param data: wireformat data. 723266077Sdes * @param data_len: length of data buffer. 724266077Sdes * @param str: string buffer. 725266077Sdes * @param str_len: length of string buffer. 726266077Sdes * @return number of characters (except null) needed to print. 727266077Sdes * Can return -1 on failure. 728266077Sdes */ 729266077Sdesint sldns_wire2str_wks_scan(uint8_t** data, size_t* data_len, char** str, 730266077Sdes size_t* str_len); 731266077Sdes 732266077Sdes/** 733266077Sdes * Scan wireformat NSAP field to string, with user buffers. 734266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 735266077Sdes * @param data: wireformat data. 736266077Sdes * @param data_len: length of data buffer. 737266077Sdes * @param str: string buffer. 738266077Sdes * @param str_len: length of string buffer. 739266077Sdes * @return number of characters (except null) needed to print. 740266077Sdes * Can return -1 on failure. 741266077Sdes */ 742266077Sdesint sldns_wire2str_nsap_scan(uint8_t** data, size_t* data_len, char** str, 743266077Sdes size_t* str_len); 744266077Sdes 745266077Sdes/** 746266077Sdes * Scan wireformat ATMA field to string, with user buffers. 747266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 748266077Sdes * @param data: wireformat data. 749266077Sdes * @param data_len: length of data buffer. 750266077Sdes * @param str: string buffer. 751266077Sdes * @param str_len: length of string buffer. 752266077Sdes * @return number of characters (except null) needed to print. 753266077Sdes * Can return -1 on failure. 754266077Sdes */ 755266077Sdesint sldns_wire2str_atma_scan(uint8_t** data, size_t* data_len, char** str, 756266077Sdes size_t* str_len); 757266077Sdes 758266077Sdes/** 759266077Sdes * Scan wireformat IPSECKEY field to string, with user buffers. 760266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 761266077Sdes * @param data: wireformat data. 762266077Sdes * @param data_len: length of data buffer. 763266077Sdes * @param str: string buffer. 764266077Sdes * @param str_len: length of string buffer. 765266077Sdes * @param pkt: packet for decompression, if NULL no decompression. 766266077Sdes * @param pktlen: length of packet buffer. 767266077Sdes * @return number of characters (except null) needed to print. 768266077Sdes * Can return -1 on failure. 769266077Sdes */ 770266077Sdesint sldns_wire2str_ipseckey_scan(uint8_t** data, size_t* data_len, char** str, 771266077Sdes size_t* str_len, uint8_t* pkt, size_t pktlen); 772266077Sdes 773266077Sdes/** 774266077Sdes * Scan wireformat HIP (algo, HIT, pubkey) field to string, with user buffers. 775266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 776266077Sdes * @param data: wireformat data. 777266077Sdes * @param data_len: length of data buffer. 778266077Sdes * @param str: string buffer. 779266077Sdes * @param str_len: length of string buffer. 780266077Sdes * @return number of characters (except null) needed to print. 781266077Sdes * Can return -1 on failure. 782266077Sdes */ 783266077Sdesint sldns_wire2str_hip_scan(uint8_t** data, size_t* data_len, char** str, 784266077Sdes size_t* str_len); 785266077Sdes 786266077Sdes/** 787266077Sdes * Scan wireformat int16_data field to string, with user buffers. 788266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 789266077Sdes * @param data: wireformat data. 790266077Sdes * @param data_len: length of data buffer. 791266077Sdes * @param str: string buffer. 792266077Sdes * @param str_len: length of string buffer. 793266077Sdes * @return number of characters (except null) needed to print. 794266077Sdes * Can return -1 on failure. 795266077Sdes */ 796266077Sdesint sldns_wire2str_int16_data_scan(uint8_t** data, size_t* data_len, char** str, 797266077Sdes size_t* str_len); 798266077Sdes 799266077Sdes/** 800266077Sdes * Scan wireformat nsec3_next_owner field to string, with user buffers. 801266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 802266077Sdes * @param data: wireformat data. 803266077Sdes * @param data_len: length of data buffer. 804266077Sdes * @param str: string buffer. 805266077Sdes * @param str_len: length of string buffer. 806266077Sdes * @return number of characters (except null) needed to print. 807266077Sdes * Can return -1 on failure. 808266077Sdes */ 809266077Sdesint sldns_wire2str_nsec3_next_owner_scan(uint8_t** data, size_t* data_len, 810266077Sdes char** str, size_t* str_len); 811266077Sdes 812266077Sdes/** 813266077Sdes * Scan wireformat ILNP64 field to string, with user buffers. 814266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 815266077Sdes * @param data: wireformat data. 816266077Sdes * @param data_len: length of data buffer. 817266077Sdes * @param str: string buffer. 818266077Sdes * @param str_len: length of string buffer. 819266077Sdes * @return number of characters (except null) needed to print. 820266077Sdes * Can return -1 on failure. 821266077Sdes */ 822266077Sdesint sldns_wire2str_ilnp64_scan(uint8_t** data, size_t* data_len, char** str, 823266077Sdes size_t* str_len); 824266077Sdes 825266077Sdes/** 826266077Sdes * Scan wireformat EUI48 field to string, with user buffers. 827266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 828266077Sdes * @param data: wireformat data. 829266077Sdes * @param data_len: length of data buffer. 830266077Sdes * @param str: string buffer. 831266077Sdes * @param str_len: length of string buffer. 832266077Sdes * @return number of characters (except null) needed to print. 833266077Sdes * Can return -1 on failure. 834266077Sdes */ 835266077Sdesint sldns_wire2str_eui48_scan(uint8_t** data, size_t* data_len, char** str, 836266077Sdes size_t* str_len); 837266077Sdes 838266077Sdes/** 839266077Sdes * Scan wireformat EUI64 field to string, with user buffers. 840266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 841266077Sdes * @param data: wireformat data. 842266077Sdes * @param data_len: length of data buffer. 843266077Sdes * @param str: string buffer. 844266077Sdes * @param str_len: length of string buffer. 845266077Sdes * @return number of characters (except null) needed to print. 846266077Sdes * Can return -1 on failure. 847266077Sdes */ 848266077Sdesint sldns_wire2str_eui64_scan(uint8_t** data, size_t* data_len, char** str, 849266077Sdes size_t* str_len); 850266077Sdes 851266077Sdes/** 852266077Sdes * Scan wireformat TAG field to string, with user buffers. 853266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 854266077Sdes * @param data: wireformat data. 855266077Sdes * @param data_len: length of data buffer. 856266077Sdes * @param str: string buffer. 857266077Sdes * @param str_len: length of string buffer. 858266077Sdes * @return number of characters (except null) needed to print. 859266077Sdes * Can return -1 on failure. 860266077Sdes */ 861266077Sdesint sldns_wire2str_tag_scan(uint8_t** data, size_t* data_len, char** str, 862266077Sdes size_t* str_len); 863266077Sdes 864266077Sdes/** 865266077Sdes * Scan wireformat long_str field to string, with user buffers. 866266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 867266077Sdes * @param data: wireformat data. 868266077Sdes * @param data_len: length of data buffer. 869266077Sdes * @param str: string buffer. 870266077Sdes * @param str_len: length of string buffer. 871266077Sdes * @return number of characters (except null) needed to print. 872266077Sdes * Can return -1 on failure. 873266077Sdes */ 874266077Sdesint sldns_wire2str_long_str_scan(uint8_t** data, size_t* data_len, char** str, 875266077Sdes size_t* str_len); 876266077Sdes 877266077Sdes/** 878266077Sdes * Print EDNS LLQ option data to string. User buffers, moves string pointers. 879266077Sdes * @param str: string buffer. 880266077Sdes * @param str_len: length of string buffer. 881266077Sdes * @param option_data: buffer with EDNS option code data. 882266077Sdes * @param option_len: length of the data for this option. 883266077Sdes * @return number of characters (except null) needed to print. 884266077Sdes */ 885266077Sdesint sldns_wire2str_edns_llq_print(char** str, size_t* str_len, 886266077Sdes uint8_t* option_data, size_t option_len); 887266077Sdes 888266077Sdes/** 889266077Sdes * Print EDNS UL option data to string. User buffers, moves string pointers. 890266077Sdes * @param str: string buffer. 891266077Sdes * @param str_len: length of string buffer. 892266077Sdes * @param option_data: buffer with EDNS option code data. 893266077Sdes * @param option_len: length of the data for this option. 894266077Sdes * @return number of characters (except null) needed to print. 895266077Sdes */ 896266077Sdesint sldns_wire2str_edns_ul_print(char** str, size_t* str_len, 897266077Sdes uint8_t* option_data, size_t option_len); 898266077Sdes 899266077Sdes/** 900266077Sdes * Print EDNS NSID option data to string. User buffers, moves string pointers. 901266077Sdes * @param str: string buffer. 902266077Sdes * @param str_len: length of string buffer. 903266077Sdes * @param option_data: buffer with EDNS option code data. 904266077Sdes * @param option_len: length of the data for this option. 905266077Sdes * @return number of characters (except null) needed to print. 906266077Sdes */ 907266077Sdesint sldns_wire2str_edns_nsid_print(char** str, size_t* str_len, 908266077Sdes uint8_t* option_data, size_t option_len); 909266077Sdes 910266077Sdes/** 911266077Sdes * Print EDNS DAU option data to string. User buffers, moves string pointers. 912266077Sdes * @param str: string buffer. 913266077Sdes * @param str_len: length of string buffer. 914266077Sdes * @param option_data: buffer with EDNS option code data. 915266077Sdes * @param option_len: length of the data for this option. 916266077Sdes * @return number of characters (except null) needed to print. 917266077Sdes */ 918266077Sdesint sldns_wire2str_edns_dau_print(char** str, size_t* str_len, 919266077Sdes uint8_t* option_data, size_t option_len); 920266077Sdes 921266077Sdes/** 922266077Sdes * Print EDNS DHU option data to string. User buffers, moves string pointers. 923266077Sdes * @param str: string buffer. 924266077Sdes * @param str_len: length of string buffer. 925266077Sdes * @param option_data: buffer with EDNS option code data. 926266077Sdes * @param option_len: length of the data for this option. 927266077Sdes * @return number of characters (except null) needed to print. 928266077Sdes */ 929266077Sdesint sldns_wire2str_edns_dhu_print(char** str, size_t* str_len, 930266077Sdes uint8_t* option_data, size_t option_len); 931266077Sdes 932266077Sdes/** 933266077Sdes * Print EDNS N3U option data to string. User buffers, moves string pointers. 934266077Sdes * @param str: string buffer. 935266077Sdes * @param str_len: length of string buffer. 936266077Sdes * @param option_data: buffer with EDNS option code data. 937266077Sdes * @param option_len: length of the data for this option. 938266077Sdes * @return number of characters (except null) needed to print. 939266077Sdes */ 940266077Sdesint sldns_wire2str_edns_n3u_print(char** str, size_t* str_len, 941266077Sdes uint8_t* option_data, size_t option_len); 942266077Sdes 943266077Sdes/** 944266077Sdes * Print EDNS SUBNET option data to string. User buffers, moves string pointers. 945266077Sdes * @param str: string buffer. 946266077Sdes * @param str_len: length of string buffer. 947266077Sdes * @param option_data: buffer with EDNS option code data. 948266077Sdes * @param option_len: length of the data for this option. 949266077Sdes * @return number of characters (except null) needed to print. 950266077Sdes */ 951266077Sdesint sldns_wire2str_edns_subnet_print(char** str, size_t* str_len, 952266077Sdes uint8_t* option_data, size_t option_len); 953266077Sdes 954266077Sdes/** 955266077Sdes * Print an EDNS option as OPT: VALUE. User buffers, moves string pointers. 956266077Sdes * @param str: string buffer. 957266077Sdes * @param str_len: length of string buffer. 958266077Sdes * @param option_code: host format EDNS option code. 959266077Sdes * @param option_data: buffer with EDNS option code data. 960266077Sdes * @param option_len: length of the data for this option. 961266077Sdes * @return number of characters (except null) needed to print. 962266077Sdes */ 963266077Sdesint sldns_wire2str_edns_option_print(char** str, size_t* str_len, 964266077Sdes uint16_t option_code, uint8_t* option_data, size_t option_len); 965266077Sdes 966266077Sdes/** 967266077Sdes * Scan wireformat EDNS OPT to string, with user buffers. 968266077Sdes * It shifts the arguments to move along (see sldns_wire2str_pkt_scan). 969266077Sdes * @param data: wireformat data. 970266077Sdes * @param data_len: length of data buffer. 971266077Sdes * @param str: string buffer. 972266077Sdes * @param str_len: length of string buffer. 973266077Sdes * @param pkt: packet with header and other info (may be NULL) 974266077Sdes * @param pktlen: length of packet buffer. 975266077Sdes * @return number of characters (except null) needed to print. 976266077Sdes */ 977266077Sdesint sldns_wire2str_edns_scan(uint8_t** data, size_t* data_len, char** str, 978266077Sdes size_t* str_len, uint8_t* pkt, size_t pktlen); 979266077Sdes 980266077Sdes#ifdef __cplusplus 981266077Sdes} 982266077Sdes#endif 983266077Sdes 984266077Sdes#endif /* LDNS_WIRE2STR_H */ 985