summaryrefslogtreecommitdiffstats
path: root/src/vpp
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2017-10-10 17:53:14 -0400
committerFlorin Coras <florin.coras@gmail.com>2017-10-13 20:20:09 +0000
commit6545716c073c88ad86458620c6dbc59ba1cd00bb (patch)
tree2bd8b7d9cd0e221669081aba27786e1ce5eee964 /src/vpp
parent7e550693dffd368b9dd8e0397674cfc4d10f9579 (diff)
VPP-1027: DNS name resolver
This patch is a plausible first-cut, suitable for initial testing by vcl (host stack client library). Main features; - recursive name resolution - multiple ip4/ip6 name servers - cache size limit enforcement - currently limited to 65K - ttl / aging - static mapping support - show / clear / debug CLI commands Binary APIs provided for the following: - add/delete name servers - enable/disable the name cache - resolve a name To Do list: - Respond to ip4/ip6 client DNS requests (vs. binary API requests) - Perf / scale tuning - map pending transaction ids to pool indices, so the cache can (greatly) exceed 65K entries - Security improvements - Use unpredictable dns transaction IDs, related to previous item - Make sure that response-packet src ip addresses match the server - Add binary APIs - deliver raw response data to clients - control recursive name resolution - Documentation Change-Id: I48c373d5c05d7108ccd814d4055caf8c75ca10b7 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vpp')
-rw-r--r--src/vpp/api/custom_dump.c44
1 files changed, 43 insertions, 1 deletions
diff --git a/src/vpp/api/custom_dump.c b/src/vpp/api/custom_dump.c
index 3abf4cdd298..46ce0b2659c 100644
--- a/src/vpp/api/custom_dump.c
+++ b/src/vpp/api/custom_dump.c
@@ -3127,6 +3127,16 @@ static void *vl_api_lldp_config_t_print
s = format (s, "system_name %s ", mp->system_name);
s = format (s, "tx_hold %d ", ntohl (mp->tx_hold));
s = format (s, "tx_interval %d ", ntohl (mp->tx_interval));
+ FINISH;
+}
+
+static void *vl_api_dns_enable_disable_t_print
+ (vl_api_dns_enable_disable_t * mp, void *handle)
+{
+ u8 *s;
+
+ s = format (0, "SCRIPT: dns_enable_disable ");
+ s = format (s, "%s ", mp->enable ? "enable" : "disable");
FINISH;
}
@@ -3160,6 +3170,35 @@ static void *vl_api_sw_interface_set_lldp_t_print
FINISH;
}
+static void *vl_api_dns_name_server_add_del_t_print
+ (vl_api_dns_name_server_add_del_t * mp, void *handle)
+{
+ u8 *s;
+
+ s = format (0, "SCRIPT: dns_name_server_add_del ");
+ if (mp->is_ip6)
+ s = format (s, "%U ", format_ip6_address,
+ (ip6_address_t *) mp->server_address);
+ else
+ s = format (s, "%U ", format_ip4_address,
+ (ip4_address_t *) mp->server_address);
+
+ if (mp->is_add == 0)
+ s = format (s, "del ");
+
+ FINISH;
+}
+
+static void *vl_api_dns_resolve_name_t_print
+ (vl_api_dns_resolve_name_t * mp, void *handle)
+{
+ u8 *s;
+
+ s = format (0, "SCRIPT: dns_resolve_name ");
+ s = format (s, "%s ", mp->name);
+ FINISH;
+}
+
#define foreach_custom_print_no_arg_function \
_(lisp_eid_table_vni_dump) \
_(lisp_map_resolver_dump) \
@@ -3352,7 +3391,10 @@ _(P2P_ETHERNET_DEL, p2p_ethernet_del) \
_(TCP_CONFIGURE_SRC_ADDRESSES, tcp_configure_src_addresses) \
_(APP_NAMESPACE_ADD_DEL, app_namespace_add_del) \
_(LLDP_CONFIG, lldp_config) \
-_(SW_INTERFACE_SET_LLDP, sw_interface_set_lldp)
+_(SW_INTERFACE_SET_LLDP, sw_interface_set_lldp) \
+_(DNS_ENABLE_DISABLE, dns_enable_disable) \
+_(DNS_NAME_SERVER_ADD_DEL, dns_name_server_add_del) \
+_(DNS_RESOLVE_NAME, dns_resolve_name)
void
vl_msg_api_custom_dump_configure (api_main_t * am)
{