24 #include <dns/dns.api_enum.h> 25 #include <dns/dns.api_types.h> 54 d = (dns_header_t *) reply;
55 flags = clib_net_to_host_u16 (d->flags);
59 pool_index = clib_net_to_host_u16 (d->id);
68 DNS46_REPLY_ERROR_NO_ELT, 1);
188 clib_host_to_net_u16 (VL_API_DNS_RESOLVE_NAME_REPLY
195 rmp->
retval = clib_host_to_net_u32 (rv);
210 clib_host_to_net_u16 (VL_API_DNS_RESOLVE_IP_REPLY
217 rmp->
retval = clib_host_to_net_u32 (rv);
247 if (remove_count == 0)
249 u32 error_code = entry_was_valid ? DNS46_REPLY_ERROR_MULTIPLE_REPLY :
250 DNS46_REPLY_ERROR_NO_UNRESOLVED_ENTRY;
311 f64 timeout = 1000.0;
312 uword *event_data = 0;
332 for (i = 0; i <
vec_len (event_data); i++)
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.
for(i=1;i<=collision_buckets;i++)
static void retry_scan(dns_main_t *dm, f64 now)
static void resolve_event(dns_main_t *dm, f64 now, u8 *reply)
void * vl_msg_api_alloc(int nbytes)
void vnet_dns_create_resolver_process(dns_main_t *dm)
#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)
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.
#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
u32 vlib_process_create(vlib_main_t *vm, char *name, vlib_node_function_t *f, u32 log2_n_stack_bytes)
Create a vlib process.
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.
static void dns_cache_unlock(dns_main_t *dm)
sll srl srl sll sra u16x4 i
#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...)
u16 msg_id_base
message-ID base
#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
static void dns_cache_lock(dns_main_t *dm, int tag)
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.