Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

Commit

Permalink
Add c-ares based dns query support
Browse files Browse the repository at this point in the history
Adds seastar::net::dns_resolver with methods to query names/addresses.
Wraps nasty state machine to emulate bsd-nonblocking IO on seastar
and uses our patched virtual IO provider struct for c-ares.

Like seastar, only handles ipv4 atm.
  • Loading branch information
Calle Wilund committed Feb 1, 2017
1 parent 39f3261 commit fea5d80
Show file tree
Hide file tree
Showing 4 changed files with 1,150 additions and 1 deletion.
8 changes: 7 additions & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ def sanitize_vptr_flag(compiler):
'tests/scollectd_test',
'tests/perf/perf_fstream',
'tests/json_formatter_test',
'tests/dns_test',
]

apps = [
Expand Down Expand Up @@ -274,6 +275,7 @@ def sanitize_vptr_flag(compiler):
'net/dhcp.cc',
'net/tls.cc',
'net/inet_address.cc',
'net/dns.cc',
]

core = [
Expand Down Expand Up @@ -436,6 +438,7 @@ def have_xen():
'tests/scollectd_test': ['tests/scollectd_test.cc'] + core,
'tests/perf/perf_fstream': ['tests/perf/perf_fstream.cc'] + core,
'tests/json_formatter_test': ['tests/json_formatter_test.cc'] + core + http,
'tests/dns_test': ['tests/dns_test.cc'] + core + libnet,
}

boost_tests = [
Expand All @@ -456,6 +459,7 @@ def have_xen():
'tests/connect_test',
'tests/scollectd_test',
'tests/json_formatter_test',
'tests/dns_test',
]

for bt in boost_tests:
Expand Down Expand Up @@ -706,6 +710,7 @@ def have_hwloc():
build {dpdk_deps} : dpdkmake {dpdk_sources}
''').format(**globals()))
for mode in build_modes:
objdeps = {}
modeval = modes[mode]
if modeval['sanitize'] and not do_sanitize:
print('Note: --static disables debug mode sanitizers')
Expand Down Expand Up @@ -744,6 +749,7 @@ def have_hwloc():
build $builddir/{mode}/{cares_src_lib} : caresmake_{mode} $builddir/{mode}/{cares_dir}/Makefile | {cares_sources}
build $builddir/{mode}/lib{cares_lib}.a : copy_file $builddir/{mode}/{cares_src_lib}
''').format(srcdir = os.getcwd(), cares_opts=modeval['cares_opts'], **globals()))
objdeps['$builddir/' + mode + '/net/dns.o'] = ' $builddir/' + mode + '/' + cares_dir + '/ares_build.h'
compiles = {}
ragels = {}
swaggers = {}
Expand Down Expand Up @@ -806,7 +812,7 @@ def have_hwloc():
for obj in compiles:
src = compiles[obj]
gen_headers = list(ragels.keys()) + list(swaggers.keys()) + list(protobufs.keys())
f.write('build {}: cxx.{} {} || {} \n'.format(obj, mode, src, ' '.join(gen_headers) + dpdk_deps))
f.write('build {}: cxx.{} {} || {} \n'.format(obj, mode, src, ' '.join(gen_headers) + dpdk_deps + objdeps.get(obj, '')))
for hh in ragels:
src = ragels[hh]
f.write('build {}: ragel {}\n'.format(hh, src))
Expand Down
Loading

0 comments on commit fea5d80

Please sign in to comment.