16 #ifndef included_dns_h 17 #define included_dns_h 78 #define DNS_CACHE_ENTRY_FLAG_VALID (1<<0) 79 #define DNS_CACHE_ENTRY_FLAG_STATIC (1<<1) 80 #define DNS_CACHE_ENTRY_FLAG_CNAME (1<<2) 82 #define DNS_RETRIES_PER_SERVER 3 84 #define DNS_RESOLVER_EVENT_RESOLVED 1 85 #define DNS_RESOLVER_EVENT_PENDING 2 124 #define foreach_dns46_request_error \ 125 _(NONE, "No error") \ 126 _(UNIMPLEMENTED, "Unimplemented") \ 127 _(PROCESSED, "DNS request pkts processed") \ 128 _(IP_OPTIONS, "DNS pkts with ip options (dropped)") \ 129 _(BAD_REQUEST, "DNS pkts with serious discrepanices (dropped)") \ 130 _(TOO_MANY_REQUESTS, "DNS pkts asking too many questions") \ 131 _(RESOLUTION_REQUIRED, "DNS pkts pending upstream name resolution") 135 #define _(sym,str) DNS46_REQUEST_ERROR_##sym, 141 #define foreach_dns46_reply_error \ 142 _(DISABLED, "DNS pkts punted (feature disabled)") \ 143 _(PROCESSED, "DNS reply pkts processed") \ 144 _(NO_ELT, "No DNS pool element") \ 145 _(FORMAT_ERROR, "DNS format errors") \ 146 _(TEST_DROP, "DNS reply pkt dropped for test purposes") 150 #define _(sym,str) DNS46_REPLY_ERROR_##sym, 173 u8 ** parse_from_here);
182 while (__sync_lock_test_and_set (dm->
cache_lock, 1))
void vnet_send_dns4_reply(dns_main_t *dm, dns_pending_request_t *t, dns_cache_entry_t *ep, vlib_buffer_t *b0)
ip6_address_t * ip6_name_servers
u8 * vnet_dns_labels_to_name(u8 *label, u8 *full_text, u8 **parse_from_here)
arc-function for the above.
vlib_node_registration_t dns46_reply_node
(constructor) VLIB_REGISTER_NODE (dns46_reply_node)
vlib_node_registration_t dns4_request_node
(constructor) VLIB_REGISTER_NODE (dns4_request_node)
u8 * dns_response
Cached dns response.
int retry_count
Retry parameters.
struct _vlib_node_registration vlib_node_registration_t
int vnet_dns_resolve_name(dns_main_t *dm, u8 *name, dns_pending_request_t *t, dns_cache_entry_t **retp)
u8 * dns_request
Cached dns request, for sending retries.
u32 * unresolved_entries
Pool indices of unresolved entries.
dns_pending_request_t * pending_requests
Clients / peers awaiting responses.
ip4_address_t * ip4_name_servers
upstream name servers, e.g.
u8 * cname
For CNAME records, the "next name" to resolve.
u8 * name
The name in "normal human being" notation, e.g.
#define foreach_dns46_reply_error
int vnet_dns_cname_indirection_nolock(dns_main_t *dm, u32 ep_index, u8 *reply)
Handle cname indirection.
dns_pending_request_type_t
static void dns_cache_unlock(dns_main_t *dm)
int vnet_dns_delete_entry_by_index_nolock(dns_main_t *dm, u32 index)
static void dns_cache_lock(dns_main_t *dm)
void vnet_send_dns6_reply(dns_main_t *dm, dns_pending_request_t *t, dns_cache_entry_t *ep, vlib_buffer_t *b0)
uword * cache_entry_by_name
Find cached record by name.
vlib_node_registration_t dns_resolver_node
(constructor) VLIB_REGISTER_NODE (dns_resolver_node)
vlib_node_registration_t dns6_request_node
(constructor) VLIB_REGISTER_NODE (dns6_request_node)
u32 name_cache_size
config parameters
format_function_t format_dns_reply
void vnet_send_dns_request(dns_main_t *dm, dns_cache_entry_t *ep)
#define CLIB_MEMORY_BARRIER()
f64 expiration_time
Expiration time.
#define foreach_dns46_request_error
int is_enabled
enable / disable flag
dns_cache_entry_t * entries
Pool of cache entries.