summaryrefslogtreecommitdiff
path: root/test/dns-dump.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/dns-dump.cc')
-rw-r--r--test/dns-dump.cc35
1 files changed, 0 insertions, 35 deletions
diff --git a/test/dns-dump.cc b/test/dns-dump.cc
deleted file mode 100644
index 023de36..0000000
--- a/test/dns-dump.cc
+++ /dev/null
@@ -1,35 +0,0 @@
-#include <sys/types.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-#include <iostream>
-#include <vector>
-
-#include "dns-proto.h"
-
-namespace ares {
-
-static void ShowFile(const char* filename) {
- int fd = open(filename, O_RDONLY);
- if (fd < 0) {
- std::cerr << "Failed to open '" << filename << "'" << std::endl;
- return;
- }
- std::vector<unsigned char> contents;
- while (true) {
- unsigned char buffer[1024];
- int len = read(fd, buffer, sizeof(buffer));
- if (len <= 0) break;
- contents.insert(contents.end(), buffer, buffer + len);
- }
- std::cout << PacketToString(contents) << std::endl;
-}
-
-} // namespace ares
-
-int main(int argc, char* argv[]) {
- for (int ii = 1; ii < argc; ++ii) {
- ares::ShowFile(argv[ii]);
- }
-}
-