16 #ifndef included_dns_h 17 #define included_dns_h 81 #define DNS_CACHE_ENTRY_FLAG_VALID (1<<0) 82 #define DNS_CACHE_ENTRY_FLAG_STATIC (1<<1) 83 #define DNS_CACHE_ENTRY_FLAG_CNAME (1<<2) 85 #define DNS_RETRIES_PER_SERVER 3 87 #define DNS_RESOLVER_EVENT_RESOLVED 1 88 #define DNS_RESOLVER_EVENT_PENDING 2 137 #define foreach_dns46_request_error \ 138 _(NONE, "No error") \ 139 _(UNIMPLEMENTED, "Unimplemented") \ 140 _(PROCESSED, "DNS request pkts processed") \ 141 _(IP_OPTIONS, "DNS pkts with ip options (dropped)") \ 142 _(BAD_REQUEST, "DNS pkts with serious discrepancies (dropped)") \ 143 _(TOO_MANY_REQUESTS, "DNS pkts asking too many questions") \ 144 _(RESOLUTION_REQUIRED, "DNS pkts pending upstream name resolution") 148 #define _(sym,str) DNS46_REQUEST_ERROR_##sym, 154 #define foreach_dns46_reply_error \ 155 _(DISABLED, "DNS pkts punted (feature disabled)") \ 156 _(PROCESSED, "DNS reply pkts processed") \ 157 _(NO_ELT, "No DNS pool element") \ 158 _(FORMAT_ERROR, "DNS format errors") \ 159 _(TEST_DROP, "DNS reply pkt dropped for test purposes") \ 160 _(MULTIPLE_REPLY, "DNS multiple reply packets") \ 161 _(NO_UNRESOLVED_ENTRY, "No unresolved entry for pkt") 165 #define _(sym,str) DNS46_REPLY_ERROR_##sym, 195 u8 ** parse_from_here);
static_always_inline void clib_spinlock_unlock(clib_spinlock_t *p)
static_always_inline void clib_spinlock_lock(clib_spinlock_t *p)
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)
clib_spinlock_t cache_lock
u8 * dns_request
Cached dns request, for sending retries.
u32 * unresolved_entries
Pool indices of unresolved entries.
u32 resolver_process_node_index
resolver process node index
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
API main structure, used by both vpp and binary API clients.
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)
u16 msg_id_base
message-ID base
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 dns6_request_node
(constructor) VLIB_REGISTER_NODE (dns6_request_node)
struct _vlib_node_registration vlib_node_registration_t
static void dns_cache_lock(dns_main_t *dm, int tag)
void vnet_dns_create_resolver_process(dns_main_t *dm)
u32 name_cache_size
config parameters
VLIB buffer representation.
format_function_t format_dns_reply
API common definitions See api_doc.md for more info.
void vnet_send_dns_request(dns_main_t *dm, dns_cache_entry_t *ep)
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.