24 #include <dns/dns.api_enum.h> 25 #include <dns/dns.api_types.h> 53 d = (dns_header_t *) reply;
54 flags = clib_net_to_host_u16 (d->flags);
58 pool_index = clib_net_to_host_u16 (d->id);
67 DNS46_REPLY_ERROR_NO_ELT, 1);
187 clib_host_to_net_u16 (VL_API_DNS_RESOLVE_NAME_REPLY
194 rmp->
retval = clib_host_to_net_u32 (rv);
209 clib_host_to_net_u16 (VL_API_DNS_RESOLVE_IP_REPLY
216 rmp->
retval = clib_host_to_net_u32 (rv);
246 if (remove_count == 0)
248 u32 error_code = entry_was_valid ? DNS46_REPLY_ERROR_MULTIPLE_REPLY :
249 DNS46_REPLY_ERROR_NO_UNRESOLVED_ENTRY;
310 f64 timeout = 1000.0;
311 uword *event_data = 0;
331 for (i = 0; i <
vec_len (event_data); i++)
357 (vm,
"dns-resolver-process",
void vnet_send_dns4_reply(vlib_main_t *vm, dns_main_t *dm, dns_pending_request_t *pr, dns_cache_entry_t *ep, vlib_buffer_t *b0)
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...
vl_api_wireguard_peer_flags_t flags
#define DNS_CACHE_ENTRY_FLAG_VALID
we have Actual Data
vlib_node_registration_t dns46_reply_node
(constructor) VLIB_REGISTER_NODE (dns46_reply_node)
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.
void vnet_send_dns6_reply(vlib_main_t *vm, dns_main_t *dm, dns_pending_request_t *pr, dns_cache_entry_t *ep, vlib_buffer_t *b0)
for(i=1;i<=collision_buckets;i++)
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.
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.
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.
void vnet_send_dns_request(vlib_main_t *vm, dns_main_t *dm, dns_cache_entry_t *ep)
static void dns_cache_unlock(dns_main_t *dm)
sll srl srl sll sra u16x4 i
int vnet_dns_cname_indirection_nolock(vlib_main_t *vm, dns_main_t *dm, u32 ep_index, u8 *reply)
Handle cname indirection.
#define vec_free(V)
Free vector's memory (no header).
static void resolve_event(vlib_main_t *vm, dns_main_t *dm, f64 now, u8 *reply)
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
void vnet_dns_send_dns4_request(vlib_main_t *vm, dns_main_t *dm, dns_cache_entry_t *ep, ip4_address_t *server)
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)
void vnet_dns_create_resolver_process(vlib_main_t *vm, dns_main_t *dm)
#define DNS_RCODE_NAME_ERROR
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static void retry_scan(vlib_main_t *vm, dns_main_t *dm, f64 now)
void vnet_dns_send_dns6_request(vlib_main_t *vm, 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)
f64 expiration_time
Expiration time.
DNS name resolution reply.
#define DNS_RESOLVER_EVENT_PENDING
dns_cache_entry_t * entries
Pool of cache entries.