Ripples 1.0
High Performant Software Architecture For Transaction Processing
Loading...
Searching...
No Matches
query_s Struct Reference

#include <query.h>

Collaboration diagram for query_s:

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_trequest_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_tresponse_hdr
 
rr_record_tanswer_section [RIP_NS_RESP_MAX_ANSW]
 
uint8_t answer_section_count
 
rr_record_tauthority_section [RIP_NS_RESP_MAX_NS]
 
uint8_t authority_section_count
 
rr_record_tadditional_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]
 

Detailed Description

Structure describes a DNS query.

Field Documentation

◆ additional_section

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.

◆ additional_section_count

uint8_t query_s::additional_section_count

Number of entries in additional_section array.

◆ answer_section

rr_record_t* query_s::answer_section[RIP_NS_RESP_MAX_ANSW]

Array to put response answer section resource records.

◆ answer_section_count

uint8_t query_s::answer_section_count

Number of entries in answer_section array.

◆ authority_section

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.

◆ authority_section_count

uint8_t query_s::authority_section_count

Number of entries in authority_section array.

◆ client_ip

struct sockaddr_storage* query_s::client_ip

Request client IP

◆ dnptrs

const unsigned char* query_s::dnptrs[DNS_RESPONSE_COMPRESSED_NAMES_MAX]

Array of pointers used when packing RR records into response.

◆ edns

edns_t query_s::edns

Parsed EDNS(0) if present and valid.

◆ end_code

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

◆ end_time

struct timespec query_s::end_time

Timestamp when query response was written to socket.

◆ error_message

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.

◆ local_ip

struct sockaddr_storage* query_s::local_ip

Request local IP

◆ protocol

uint8_t query_s::protocol

Transport protocol this query uses: 0 - UDP, 1 - TCP.

◆ query_label

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.

◆ query_label_len

uint16_t query_s::query_label_len

Length of query_label string not including string '\0' terminator.

◆ query_label_size

uint16_t query_s::query_label_size

Size of query_label buffer

◆ query_q_class

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.

◆ query_q_type

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.

◆ request_buffer

unsigned char* query_s::request_buffer

Request buffer with raw DNS request.

◆ request_buffer_len

size_t query_s::request_buffer_len

Length of request data in buffer.

Note
If protocol is TCP then this does NOT include the 2 bytes prefix.

◆ request_buffer_size

size_t query_s::request_buffer_size

Request buffer size.

◆ request_hdr

rip_ns_header_t* query_s::request_hdr

Request DNS message HEADER. Points to the place in request buffer where DNS message starts.

◆ response_buffer

unsigned char* query_s::response_buffer

Response buffer to pack response into.

Note
If protocol is TCP then packing the response needs to account for this and populate the 2 byte prefix and include it in response length. Hence, this points to place where the 2 byte prefix begins.

◆ response_buffer_len

size_t query_s::response_buffer_len

Length of data in response buffer.

Note
If protocol is TCP then packing the response needs to account for this and populate the 2 byte prefix and include it in response length.

◆ response_buffer_size

size_t query_s::response_buffer_size

Response buffer size.

◆ response_hdr

rip_ns_header_t* query_s::response_hdr

Response DNS message HEADER. This points to place in response buffer where DNS message begins.

Note
If TCP this does not point to the place where 2 byte prefix is, it points to where DNS response header begins.

◆ start_time

struct timespec query_s::start_time

Timestamp when query request was read in from socket.


The documentation for this struct was generated from the following file: