Line data Source code
1 : /**
2 : * @file resolve_hostname.cpp Resolver test utility
3 : *
4 : * This is a simple test utility that gets the IPs from the given hostname
5 : *
6 : * This is part of the DUNE DAQ Application Framework, copyright 2020.
7 : * Licensing/copyright details are in the COPYING file that you should have
8 : * received with this code.
9 : */
10 :
11 : #include "utilities/get_ips.hpp"
12 :
13 : int
14 0 : main(int argc, char* argv[])
15 : {
16 :
17 0 : if (argc != 2) {
18 0 : std::cout << "Invalid number of arguments:\nresolve_hostname hostname\n"; // NOLINT
19 0 : exit(1);
20 : }
21 :
22 0 : auto results = dunedaq::utilities::get_hostname_ips(argv[1]); // NOLINT
23 0 : for (auto const& r : results)
24 0 : std::cout << r << "\n"; // NOLINT
25 :
26 0 : if (results.size() > 1)
27 : return 0;
28 : else
29 0 : return 1;
30 0 : }
|