34 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 66 d = (dns_header_t *) reply;
67 flags = clib_net_to_host_u16 (d->flags);
71 pool_index = clib_net_to_host_u16 (d->id);
78 DNS46_REPLY_ERROR_NO_ELT, 1);
177 clib_host_to_net_u16 (VL_API_DNS_RESOLVE_NAME_REPLY);
183 rmp->
retval = clib_host_to_net_u32 (rv);
198 clib_host_to_net_u16 (VL_API_DNS_RESOLVE_IP_REPLY);
204 rmp->
retval = clib_host_to_net_u32 (rv);
231 clib_warning (
"pool index %d AWOL from unresolved vector", pool_index);
287 f64 timeout = 1000.0;
288 uword *event_data = 0;
308 for (i = 0; i <
vec_len (event_data); i++)
330 .name =
"dns-resolver-process",
ip6_address_t * ip6_name_servers
static f64 vlib_process_wait_for_event_or_clock(vlib_main_t *vm, f64 dt)
Suspend a cooperative multi-tasking thread Waits for an event, or for the indicated number of seconds...
#define DNS_CACHE_ENTRY_FLAG_VALID
we have Actual Data
vlib_node_registration_t dns46_reply_node
(constructor) VLIB_REGISTER_NODE (dns46_reply_node)
int vnet_dns_cname_indirection_nolock(dns_main_t *dm, u32 ep_index, u8 *reply)
Handle cname indirection.
static f64 vlib_time_now(vlib_main_t *vm)
#define DNS_RCODE_REFUSED
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
#define DNS_RCODE_NO_ERROR
u8 * dns_response
Cached dns response.
int vnet_dns_delete_entry_by_index_nolock(dns_main_t *dm, u32 index)
int retry_count
Retry parameters.
static void retry_scan(dns_main_t *dm, f64 now)
vlib_node_registration_t dns_resolver_node
(constructor) VLIB_REGISTER_NODE (dns_resolver_node)
static void resolve_event(dns_main_t *dm, f64 now, u8 *reply)
void * vl_msg_api_alloc(int nbytes)
#define DNS_RCODE_NOT_IMPLEMENTED
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
void vnet_send_dns_request(dns_main_t *dm, dns_cache_entry_t *ep)
static uword vlib_process_get_events(vlib_main_t *vm, uword **data_vector)
Return the first event type which has occurred and a vector of per-event data of that type...
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
u32 * unresolved_entries
Pool indices of unresolved entries.
void vnet_send_dns4_reply(dns_main_t *dm, dns_pending_request_t *pr, dns_cache_entry_t *ep, vlib_buffer_t *b0)
dns_pending_request_t * pending_requests
Clients / peers awaiting responses.
ip4_address_t * ip4_name_servers
upstream name servers, e.g.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
u8 * name
The name in "normal human being" notation, e.g.
#define DNS_RCODE_SERVER_FAILURE
DNS ip->name resolution reply.
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
An API client registration, only in vpp/vlib.
#define VLIB_REGISTER_NODE(x,...)
static void dns_cache_unlock(dns_main_t *dm)
#define vec_free(V)
Free vector's memory (no header).
int vnet_dns_response_to_name(u8 *response, vl_api_dns_resolve_ip_reply_t *rmp, u32 *min_ttlp)
#define clib_warning(format, args...)
static void dns_cache_lock(dns_main_t *dm)
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
#define DNS_RCODE_FORMAT_ERROR
#define vec_delete(V, N, M)
Delete N elements starting at element M.
#define DNS_RESOLVER_EVENT_RESOLVED
struct _vlib_node_registration vlib_node_registration_t
static uword dns_resolver_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
#define DNS_RCODE_NAME_ERROR
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
void vnet_send_dns6_reply(dns_main_t *dm, dns_pending_request_t *pr, dns_cache_entry_t *ep, vlib_buffer_t *b0)
void vnet_dns_send_dns6_request(dns_main_t *dm, dns_cache_entry_t *ep, ip6_address_t *server)
int vnet_dns_response_to_reply(u8 *response, vl_api_dns_resolve_name_reply_t *rmp, u32 *min_ttlp)
void vnet_dns_send_dns4_request(dns_main_t *dm, dns_cache_entry_t *ep, ip4_address_t *server)
f64 expiration_time
Expiration time.
DNS name resolution reply.
#define DNS_RESOLVER_EVENT_PENDING
dns_cache_entry_t * entries
Pool of cache entries.