/* * Copyright 2006-2015, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: * Axel Dörfler, axeld@pinc-software.de * Oliver Tappe, zooey@hirschkaefer.de * Atis Elsts, the.kfx@gmail.com */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include extern "C" { # include # include # include } #include "MediaTypes.h" extern const char* __progname; const char* kProgramName = __progname; enum preferred_output_format { PREFER_OUTPUT_MASK, PREFER_OUTPUT_PREFIX_LENGTH, }; struct address_family { int family; const char* name; const char* identifiers[4]; preferred_output_format preferred_format; }; static const address_family kFamilies[] = { { AF_INET, "inet", {"AF_INET", "inet", "ipv4", NULL}, PREFER_OUTPUT_MASK }, { AF_INET6, "inet6", {"AF_INET6", "inet6", "ipv6", NULL}, PREFER_OUTPUT_PREFIX_LENGTH }, { -1, NULL, {NULL}, PREFER_OUTPUT_MASK } }; static void usage(int status) { printf("usage: %s [ [
] [
[] | " "auto-config] [