|
Ripples 1.0
High Performant Software Architecture For Transaction Processing
|
#include <query.h>

Data Fields | |
| uint8_t | protocol |
| struct sockaddr_storage * | client_ip |
| struct sockaddr_storage * | local_ip |
| unsigned char * | request_buffer |
| size_t | request_buffer_size |
| size_t | request_buffer_len |
| rip_ns_header_t * | request_hdr |
| unsigned char * | query_label |
| uint16_t | query_label_size |
| uint16_t | query_label_len |
| uint16_t | query_q_type |
| uint16_t | query_q_class |
| edns_t | edns |
| unsigned char * | response_buffer |
| size_t | response_buffer_size |
| size_t | response_buffer_len |
| rip_ns_header_t * | response_hdr |
| rr_record_t * | answer_section [RIP_NS_RESP_MAX_ANSW] |
| uint8_t | answer_section_count |
| rr_record_t * | authority_section [RIP_NS_RESP_MAX_NS] |
| uint8_t | authority_section_count |
| rr_record_t * | additional_section [RIP_NS_RESP_MAX_ADDL] |
| uint8_t | additional_section_count |
| struct timespec | start_time |
| struct timespec | end_time |
| int | end_code |
| char | error_message [ERR_MSG_LENGTH] |
| const unsigned char * | dnptrs [DNS_RESPONSE_COMPRESSED_NAMES_MAX] |
Structure describes a DNS query.
| rr_record_t* query_s::additional_section[RIP_NS_RESP_MAX_ADDL] |
Array to put response additional section resource records. This excludes EDNS. These are then packed into response buffer.
| uint8_t query_s::additional_section_count |
Number of entries in additional_section array.
| rr_record_t* query_s::answer_section[RIP_NS_RESP_MAX_ANSW] |
Array to put response answer section resource records.
| uint8_t query_s::answer_section_count |
Number of entries in answer_section array.
| rr_record_t* query_s::authority_section[RIP_NS_RESP_MAX_NS] |
Array to put response authority section resource records. These are then packed into response buffer.
| uint8_t query_s::authority_section_count |
Number of entries in authority_section array.
| struct sockaddr_storage* query_s::client_ip |
Request client IP
| const unsigned char* query_s::dnptrs[DNS_RESPONSE_COMPRESSED_NAMES_MAX] |
Array of pointers used when packing RR records into response.
| edns_t query_s::edns |
Parsed EDNS(0) if present and valid.
| int query_s::end_code |
Query End code. Positive codes >=0 correspond to RCODE and it also means that response should be sent. RCODEs are enumerated in type rip_ns_rcode_t.
Code -1 means application is still processing the request. This is used by intermediary vectorloop functions as request is being processed to indicate if request processing is complete or not. I.e. if parsing the request indicated an error such that the end_code was set and answer packed, it indicates to next vectorloop step, which is resolve_query, that it should not handle this query in vector.
Negative codes <-1 correspond to other error where response is not sent. These are rare as most errors have a corresponding DNS message response code such as "BAD FORMAT" or "NOT IMPLEMENTED", "REFUSED", or "SERVFAIL".
ns_r_badvers ns_r_notzone ns_r_notauth ns_r_nxrrset ns_r_yxrrset ns_r_yxdomain ns_r_refused ns_r_notimpl ns_r_nxdomain ns_r_servfail 1 - ns_r_formerr 0 - ns_r_noerror -1 - decision not made, keep processing request as it traverses vectorloop functions. -2 - invalid format (incomplete header) -3 - invalid format datagram > RIP_NS_PACKETSZ
| struct timespec query_s::end_time |
Timestamp when query response was written to socket.
| char query_s::error_message[ERR_MSG_LENGTH] |
If applicable holds an error message useful for logging purpose. Any string populated MUST end with '\0' terminator.
| struct sockaddr_storage* query_s::local_ip |
Request local IP
| uint8_t query_s::protocol |
Transport protocol this query uses: 0 - UDP, 1 - TCP.
| unsigned char* query_s::query_label |
Buffer to extract query question label, unpacked & uncompressed and has "." at the end. Label is checked that it conforms to RFC limits, max length 255 for full domain name, and 63 for individual labels in domain name.
| uint16_t query_s::query_label_len |
Length of query_label string not including string '\0' terminator.
| uint16_t query_s::query_label_size |
Size of query_label buffer
| uint16_t query_s::query_q_class |
Query question class, is one of values in enum rip_ns_class_t. When parsing this from a query it MUST be one of the supported values as identified by function rip_ns_rr_class_supported.
| uint16_t query_s::query_q_type |
Query question type, is one of values in enum rip_ns_type_t. When parsing this from a query it MUST be one of the supported values as identified by function rip_ns_rr_type_supported.
| unsigned char* query_s::request_buffer |
Request buffer with raw DNS request.
| size_t query_s::request_buffer_len |
Length of request data in buffer.
| size_t query_s::request_buffer_size |
Request buffer size.
| rip_ns_header_t* query_s::request_hdr |
Request DNS message HEADER. Points to the place in request buffer where DNS message starts.
| unsigned char* query_s::response_buffer |
Response buffer to pack response into.
| size_t query_s::response_buffer_len |
Length of data in response buffer.
| size_t query_s::response_buffer_size |
Response buffer size.
| rip_ns_header_t* query_s::response_hdr |
Response DNS message HEADER. This points to place in response buffer where DNS message begins.
| struct timespec query_s::start_time |
Timestamp when query request was read in from socket.