|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
16 #ifndef included_dns_h
17 #define included_dns_h
86 #define DNS_CACHE_ENTRY_FLAG_VALID (1<<0)
87 #define DNS_CACHE_ENTRY_FLAG_STATIC (1<<1)
88 #define DNS_CACHE_ENTRY_FLAG_CNAME (1<<2)
90 #define DNS_RETRIES_PER_SERVER 3
92 #define DNS_RESOLVER_EVENT_RESOLVED 1
93 #define DNS_RESOLVER_EVENT_PENDING 2
141 #define foreach_dns46_request_error \
142 _(NONE, "No error") \
143 _(UNIMPLEMENTED, "Unimplemented") \
144 _(PROCESSED, "DNS request pkts processed") \
145 _(IP_OPTIONS, "DNS pkts with ip options (dropped)") \
146 _(BAD_REQUEST, "DNS pkts with serious discrepancies (dropped)") \
147 _(TOO_MANY_REQUESTS, "DNS pkts asking too many questions") \
148 _(RESOLUTION_REQUIRED, "DNS pkts pending upstream name resolution")
152 #define _(sym,str) DNS46_REQUEST_ERROR_##sym,
158 #define foreach_dns46_reply_error \
159 _(DISABLED, "DNS pkts punted (feature disabled)") \
160 _(PROCESSED, "DNS reply pkts processed") \
161 _(NO_ELT, "No DNS pool element") \
162 _(FORMAT_ERROR, "DNS format errors") \
163 _(TEST_DROP, "DNS reply pkt dropped for test purposes") \
164 _(MULTIPLE_REPLY, "DNS multiple reply packets") \
165 _(NO_UNRESOLVED_ENTRY, "No unresolved entry for pkt")
169 #define _(sym,str) DNS46_REPLY_ERROR_##sym,
178 u32 ep_index,
u8 * reply);
202 u8 ** parse_from_here);
void vnet_send_dns6_reply(vlib_main_t *vm, dns_main_t *dm, dns_pending_request_t *t, dns_cache_entry_t *ep, vlib_buffer_t *b0)
dns_cache_entry_t * entries
Pool of cache entries.
int is_enabled
enable / disable flag
u16 msg_id_base
message-ID base
@ DNS_API_PENDING_IP_TO_NAME
static void dns_cache_lock(dns_main_t *dm, int tag)
void vnet_send_dns4_reply(vlib_main_t *vm, dns_main_t *dm, dns_pending_request_t *t, dns_cache_entry_t *ep, vlib_buffer_t *b0)
int vnet_dns_resolve_name(vlib_main_t *vm, dns_main_t *dm, u8 *name, dns_pending_request_t *t, dns_cache_entry_t **retp)
@ DNS_API_PENDING_NAME_TO_IP
vlib_node_registration_t dns4_request_node
(constructor) VLIB_REGISTER_NODE (dns4_request_node)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
int udp_ports_registered
udp port registration complete
static void dns_cache_unlock(dns_main_t *dm)
ip4_address_t * ip4_name_servers
upstream name servers, e.g.
int vnet_dns_delete_entry_by_index_nolock(dns_main_t *dm, u32 index)
#define foreach_dns46_request_error
u8 * vnet_dns_labels_to_name(u8 *label, u8 *full_text, u8 **parse_from_here)
arc-function for the above.
dns_pending_request_t * pending_requests
Clients / peers awaiting responses.
ip6_address_t * ip6_name_servers
u8 * name
The name in "normal human being" notation, e.g.
clib_spinlock_t cache_lock
vlib_node_registration_t dns6_request_node
(constructor) VLIB_REGISTER_NODE (dns6_request_node)
uword * cache_entry_by_name
Find cached record by name.
static_always_inline void clib_spinlock_lock(clib_spinlock_t *p)
int vnet_dns_cname_indirection_nolock(vlib_main_t *vm, dns_main_t *dm, u32 ep_index, u8 *reply)
Handle cname indirection.
dns_pending_request_type_t
f64 expiration_time
Expiration time.
@ DNS_PEER_PENDING_IP_TO_NAME
struct _vlib_node_registration vlib_node_registration_t
vlib_node_registration_t dns46_reply_node
(constructor) VLIB_REGISTER_NODE (dns46_reply_node)
API main structure, used by both vpp and binary API clients.
u8 * dns_request
Cached dns request, for sending retries.
u8 * dns_response
Cached dns response.
u8 * cname
For CNAME records, the "next name" to resolve.
int dns_resolve_name(u8 *name, dns_cache_entry_t **ep, dns_pending_request_t *t0, dns_resolve_name_t *rn)
void vnet_send_dns_request(vlib_main_t *vm, dns_main_t *dm, dns_cache_entry_t *ep)
u32 name_cache_size
config parameters
format_function_t format_dns_reply
void vnet_dns_send_dns6_request(vlib_main_t *vm, dns_main_t *dm, dns_cache_entry_t *ep, ip6_address_t *server)
static_always_inline void clib_spinlock_unlock(clib_spinlock_t *p)
@ DNS_PEER_PENDING_NAME_TO_IP
u32 resolver_process_node_index
resolver process node index
u32 * unresolved_entries
Pool indices of unresolved entries.
void vnet_dns_send_dns4_request(vlib_main_t *vm, dns_main_t *dm, dns_cache_entry_t *ep, ip4_address_t *server)
void vnet_dns_create_resolver_process(vlib_main_t *vm, dns_main_t *dm)
int retry_count
Retry parameters.
#define foreach_dns46_reply_error
VLIB buffer representation.