|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
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;
357 (
vm,
"dns-resolver-process",
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
#define DNS_RESOLVER_EVENT_RESOLVED
#define DNS_RCODE_REFUSED
dns_cache_entry_t * entries
Pool of cache entries.
u16 msg_id_base
message-ID base
@ DNS_API_PENDING_IP_TO_NAME
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
static void dns_cache_lock(dns_main_t *dm, int tag)
#define DNS_RCODE_NOT_IMPLEMENTED
#define DNS_RCODE_NAME_ERROR
DNS name resolution reply.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
void vnet_dns_send_dns6_request(vlib_main_t *vm, dns_main_t *dm, dns_cache_entry_t *ep, ip6_address_t *server)
@ DNS_API_PENDING_NAME_TO_IP
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
#define DNS_RCODE_NO_ERROR
#define vec_delete(V, N, M)
Delete N elements starting at element M.
static void dns_cache_unlock(dns_main_t *dm)
ip4_address_t * ip4_name_servers
upstream name servers, e.g.
int vnet_dns_cname_indirection_nolock(vlib_main_t *vm, dns_main_t *dm, u32 ep_index, u8 *reply)
Handle cname indirection.
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
dns_pending_request_t * pending_requests
Clients / peers awaiting responses.
void vnet_dns_create_resolver_process(vlib_main_t *vm, dns_main_t *dm)
ip6_address_t * ip6_name_servers
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,...
void vnet_send_dns_request(vlib_main_t *vm, dns_main_t *dm, dns_cache_entry_t *ep)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
u8 * name
The name in "normal human being" notation, e.g.
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)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
void vnet_dns_send_dns4_request(vlib_main_t *vm, dns_main_t *dm, dns_cache_entry_t *ep, ip4_address_t *server)
u32 vlib_process_create(vlib_main_t *vm, char *name, vlib_node_function_t *f, u32 log2_n_stack_bytes)
Create a vlib process.
An API client registration, only in vpp/vlib.
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)
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
sll srl srl sll sra u16x4 i
f64 expiration_time
Expiration time.
@ DNS_PEER_PENDING_IP_TO_NAME
vlib_node_registration_t dns46_reply_node
(constructor) VLIB_REGISTER_NODE (dns46_reply_node)
u8 * dns_response
Cached dns response.
#define vec_free(V)
Free vector's memory (no header).
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...
for(i=1;i<=collision_buckets;i++)
static void resolve_event(vlib_main_t *vm, dns_main_t *dm, f64 now, u8 *reply)
@ DNS_PEER_PENDING_NAME_TO_IP
vnet_interface_output_runtime_t * rt
#define DNS_RESOLVER_EVENT_PENDING
DNS ip->name resolution reply.
#define clib_warning(format, args...)
#define DNS_RCODE_FORMAT_ERROR
u32 resolver_process_node_index
resolver process node index
u32 * unresolved_entries
Pool indices of unresolved entries.
static void retry_scan(vlib_main_t *vm, dns_main_t *dm, f64 now)
static f64 vlib_time_now(vlib_main_t *vm)
int vnet_dns_delete_entry_by_index_nolock(dns_main_t *dm, u32 index)
#define DNS_RCODE_SERVER_FAILURE
int vnet_dns_response_to_reply(u8 *response, vl_api_dns_resolve_name_reply_t *rmp, u32 *min_ttlp)
int retry_count
Retry parameters.
#define DNS_CACHE_ENTRY_FLAG_VALID
we have Actual Data
void * vl_msg_api_alloc(int nbytes)
static uword dns_resolver_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
int vnet_dns_response_to_name(u8 *response, vl_api_dns_resolve_ip_reply_t *rmp, u32 *min_ttlp)
vl_api_wireguard_peer_flags_t flags