16 #ifndef included_dns_h 17 #define included_dns_h 79 #define DNS_CACHE_ENTRY_FLAG_VALID (1<<0) 80 #define DNS_CACHE_ENTRY_FLAG_STATIC (1<<1) 81 #define DNS_CACHE_ENTRY_FLAG_CNAME (1<<2) 83 #define DNS_RETRIES_PER_SERVER 3 85 #define DNS_RESOLVER_EVENT_RESOLVED 1 86 #define DNS_RESOLVER_EVENT_PENDING 2 128 #define foreach_dns46_request_error \ 129 _(NONE, "No error") \ 130 _(UNIMPLEMENTED, "Unimplemented") \ 131 _(PROCESSED, "DNS request pkts processed") \ 132 _(IP_OPTIONS, "DNS pkts with ip options (dropped)") \ 133 _(BAD_REQUEST, "DNS pkts with serious discrepanices (dropped)") \ 134 _(TOO_MANY_REQUESTS, "DNS pkts asking too many questions") \ 135 _(RESOLUTION_REQUIRED, "DNS pkts pending upstream name resolution") 139 #define _(sym,str) DNS46_REQUEST_ERROR_##sym, 145 #define foreach_dns46_reply_error \ 146 _(DISABLED, "DNS pkts punted (feature disabled)") \ 147 _(PROCESSED, "DNS reply pkts processed") \ 148 _(NO_ELT, "No DNS pool element") \ 149 _(FORMAT_ERROR, "DNS format errors") \ 150 _(TEST_DROP, "DNS reply pkt dropped for test purposes") 154 #define _(sym,str) DNS46_REPLY_ERROR_##sym, 184 u8 ** parse_from_here);
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)
void vnet_dns_send_dns4_request(dns_main_t *dm, dns_cache_entry_t *ep, ip4_address_t *server)
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.
int vnet_dns_resolve_name(dns_main_t *dm, u8 *name, dns_pending_request_t *t, dns_cache_entry_t **retp)
void vnet_dns_send_dns6_request(dns_main_t *dm, dns_cache_entry_t *ep, ip6_address_t *server)
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.
#define clib_atomic_test_and_set(a)
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)
int udp_ports_registered
udp port registration complete
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)
struct _vlib_node_registration vlib_node_registration_t
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.