- libibverbs-dev
- libssl-dev
- libssl1.0.0
- - libdnet-dev
- libsmi2-dev
- libcap-ng-dev
- libpcap-dev
endif()
cmake_pop_check_state()
-check_function_exists(dnet_htoa STDLIBS_HAVE_DNET_HTOA)
-if(STDLIBS_HAVE_DNET_HTOA)
- set(HAVE_DNET_HTOA TRUE)
-else(STDLIBS_HAVE_DNET_HTOA)
- check_library_exists(dnet dnet_htoa "" HAVE_DNET_HTOA)
- if(HAVE_DNET_HTOA)
- set(TCPDUMP_LINK_LIBRARIES dnet ${TCPDUMP_LINK_LIBRARIES})
- endif(HAVE_DNET_HTOA)
-endif(STDLIBS_HAVE_DNET_HTOA)
-if(HAVE_DNET_HTOA)
- #
- # OK, we have dnet_htoa(). Do we have netdnet/dnetdb.h?
- #
- check_include_files("sys/types.h;netdnet/dnetdb.h" HAVE_NETDNET_DNETDB_H)
- if(HAVE_NETDNET_DNETDB_H)
- #
- # Yes. Does it declare dnet_htoa()?
- #
- cmake_push_check_state()
- set(CMAKE_REQUIRED_LIBRARIES dnet)
- check_symbol_exists(dnet_htoa "sys/types.h;netdnet/dnetdb.h" NETDNET_DNETDB_H_DECLARES_DNET_HTOA)
- cmake_pop_check_state()
- endif(HAVE_NETDNET_DNETDB_H)
-
- #
- # Do we have netdnet/dn.h?
- #
- check_include_file(netdnet/dn.h HAVE_NETDNET_DN_H)
- if(HAVE_NETDNET_DN_H)
- #
- # Yes. Does it declare struct dn_naddr?
- #
- cmake_push_check_state()
- set(CMAKE_EXTRA_INCLUDE_FILES netdnet/dn.h)
- check_type_size("struct dn_naddr" STRUCT_DN_NADDR)
- cmake_pop_check_state()
- endif(HAVE_NETDNET_DN_H)
-endif(HAVE_DNET_HTOA)
-
#
# Data types.
#
tp->addr = dnaddr;
tp->nxt = newhnamemem(ndo);
- if (ndo->ndo_nflag)
- tp->name = dnnum_string(ndo, dnaddr);
- else
- tp->name = dnname_string(ndo, dnaddr);
+ tp->name = dnnum_string(ndo, dnaddr);
return(tp->name);
}
/* Define to 1 if you have the declaration of `ether_ntohost' */
#cmakedefine HAVE_DECL_ETHER_NTOHOST 1
-/* define if you have the dnet_htoa function */
-#cmakedefine HAVE_DNET_HTOA 1
-
/* Define to 1 if you have the `ether_ntohost' function. */
#cmakedefine HAVE_ETHER_NTOHOST 1
/* Define to 1 if you have the <memory.h> header file. */
#cmakedefine HAVE_MEMORY_H 1
-/* Define to 1 if you have the <netdnet/dnetdb.h> header file. */
-#cmakedefine HAVE_NETDNET_DNETDB_H 1
-
-/* Define to 1 if you have the <netdnet/dn.h> header file. */
-#cmakedefine HAVE_NETDNET_DN_H 1
-
/* Define to 1 if you have the <net/if.h> header file. */
#cmakedefine HAVE_NET_IF_H 1
/* Define to 1 if you have the `strsep' function. */
#cmakedefine HAVE_STRSEP 1
-/* Define to 1 if the system has the type `struct dn_naddr'. */
-#cmakedefine HAVE_STRUCT_DN_NADDR 1
-
/* Define to 1 if the system has the type `struct ether_addr'. */
#cmakedefine HAVE_STRUCT_ETHER_ADDR 1
/* define if libpcap has yydebug */
#cmakedefine HAVE_YYDEBUG 1
-/* Define to 1 if netenet/dnetdb.h declares `dnet_htoa' */
-#cmakedefine NETDNET_DNETDB_H_DECLARES_DNET_HTOA 1
-
/* Define to 1 if netinet/ether.h declares `ether_ntohost' */
#cmakedefine NETINET_ETHER_H_DECLARES_ETHER_NTOHOST 1
/* Define to 1 if you have the declaration of `ether_ntohost' */
#undef HAVE_DECL_ETHER_NTOHOST
-/* define if you have the dnet_htoa function */
-#undef HAVE_DNET_HTOA
-
/* Define to 1 if you have the `ether_ntohost' function. */
#undef HAVE_ETHER_NTOHOST
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
-/* Define to 1 if you have the <netdnet/dnetdb.h> header file. */
-#undef HAVE_NETDNET_DNETDB_H
-
-/* Define to 1 if you have the <netdnet/dn.h> header file. */
-#undef HAVE_NETDNET_DN_H
-
/* Define to 1 if you have the <net/if.h> header file. */
#undef HAVE_NET_IF_H
/* Define to 1 if you have the `strsep' function. */
#undef HAVE_STRSEP
-/* Define to 1 if the system has the type `struct dn_naddr'. */
-#undef HAVE_STRUCT_DN_NADDR
-
/* Define to 1 if the system has the type `struct ether_addr'. */
#undef HAVE_STRUCT_ETHER_ADDR
/* define if libpcap has yydebug */
#undef HAVE_YYDEBUG
-/* Define to 1 if netenet/dnetdb.h declares `dnet_htoa' */
-#undef NETDNET_DNETDB_H_DECLARES_DNET_HTOA
-
/* Define to 1 if netinet/ether.h declares `ether_ntohost' */
#undef NETINET_ETHER_H_DECLARES_ETHER_NTOHOST
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dnet_htoa" >&5
-$as_echo_n "checking for library containing dnet_htoa... " >&6; }
-if ${ac_cv_search_dnet_htoa+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dnet_htoa ();
-int
-main ()
-{
-return dnet_htoa ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' dnet; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_dnet_htoa=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_dnet_htoa+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_dnet_htoa+:} false; then :
-
-else
- ac_cv_search_dnet_htoa=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dnet_htoa" >&5
-$as_echo "$ac_cv_search_dnet_htoa" >&6; }
-ac_res=$ac_cv_search_dnet_htoa
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-
-$as_echo "#define HAVE_DNET_HTOA 1" >>confdefs.h
-
- #
- # OK, we have dnet_htoa(). Do we have netdnet/dnetdb.h?
- #
- for ac_header in netdnet/dnetdb.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "netdnet/dnetdb.h" "ac_cv_header_netdnet_dnetdb_h" "$ac_includes_default"
-if test "x$ac_cv_header_netdnet_dnetdb_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_NETDNET_DNETDB_H 1
-_ACEOF
-
-fi
-
-done
-
- if test "$ac_cv_header_netdnet_dnetdb_h" = "yes"; then
- #
- # Yes. Does it declare dnet_htoa()?
- #
- ac_fn_c_check_decl "$LINENO" "dnet_htoa" "ac_cv_have_decl_dnet_htoa" "
-$ac_includes_default
-#include <netdnet/dnetdb.h>
-
-"
-if test "x$ac_cv_have_decl_dnet_htoa" = xyes; then :
-
- # Yes.
-
-$as_echo "#define NETDNET_DNETDB_H_DECLARES_DNET_HTOA /**/" >>confdefs.h
-
-
-fi
-
- fi
-
- #
- # Do we have netdnet/dn.h?
- #
- for ac_header in netdnet/dn.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "netdnet/dn.h" "ac_cv_header_netdnet_dn_h" "$ac_includes_default"
-if test "x$ac_cv_header_netdnet_dn_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_NETDNET_DN_H 1
-_ACEOF
-
-fi
-
-done
-
- if test "$ac_cv_header_netdnet_dn_h" = "yes"; then
- #
- # Yes. Does it declare struct dn_naddr?
- #
- ac_fn_c_check_type "$LINENO" "struct dn_naddr" "ac_cv_type_struct_dn_naddr" "
-#include <netdnet/dn.h>
-
-"
-if test "x$ac_cv_type_struct_dn_naddr" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_DN_NADDR 1
-_ACEOF
-
-
-fi
-
- fi
-
-fi
-
-
ac_fn_c_check_func "$LINENO" "strlcat" "ac_cv_func_strlcat"
if test "x$ac_cv_func_strlcat" = xyes; then :
$as_echo "#define HAVE_STRLCAT 1" >>confdefs.h
fi
fi
-AC_SEARCH_LIBS(dnet_htoa, dnet,
-[
- AC_DEFINE(HAVE_DNET_HTOA, 1,
- [define if you have the dnet_htoa function])
- #
- # OK, we have dnet_htoa(). Do we have netdnet/dnetdb.h?
- #
- AC_CHECK_HEADERS(netdnet/dnetdb.h)
- if test "$ac_cv_header_netdnet_dnetdb_h" = "yes"; then
- #
- # Yes. Does it declare dnet_htoa()?
- #
- AC_CHECK_DECL(dnet_htoa,
- [
- # Yes.
- AC_DEFINE(NETDNET_DNETDB_H_DECLARES_DNET_HTOA,,
- [Define to 1 if netenet/dnetdb.h declares `dnet_htoa'])
- ],,
- [
-AC_INCLUDES_DEFAULT
-#include <netdnet/dnetdb.h>
- ])
- fi
-
- #
- # Do we have netdnet/dn.h?
- #
- AC_CHECK_HEADERS(netdnet/dn.h)
- if test "$ac_cv_header_netdnet_dn_h" = "yes"; then
- #
- # Yes. Does it declare struct dn_naddr?
- #
- AC_CHECK_TYPES(struct dn_naddr,,,
- [
-#include <netdnet/dn.h>
- ])
- fi
-])
-
AC_REPLACE_FUNCS(strlcat strlcpy strdup strsep getservent getopt_long)
AC_CHECK_FUNCS(fork vfork strftime)
AC_CHECK_FUNCS(setlinebuf)
extern int mask2plen(uint32_t);
extern int mask62plen(const u_char *);
-extern const char *dnname_string(netdissect_options *, u_short);
extern const char *dnnum_string(netdissect_options *, u_short);
extern int decode_prefix4(netdissect_options *, const u_char *, u_int, char *, size_t);
#include <stdlib.h>
#include <string.h>
-#ifdef HAVE_DNET_HTOA
- #ifdef HAVE_NETDNET_DN_H
- #include <netdnet/dn.h>
- #endif
- #ifndef HAVE_STRUCT_DN_NADDR
-#define DN_MAXADDL 20 /* max size of DECnet address */
-struct dn_naddr {
- unsigned short a_len; /* length of address */
- unsigned char a_addr[DN_MAXADDL]; /* address as bytes */
-};
- #endif /* HAVE_STRUCT_DN_NADDR */
- #ifdef HAVE_NETDNET_DNETDB_H
- #include <netdnet/dnetdb.h>
- #endif
- #ifndef NETDNET_DNETDB_H_DECLARES_DNET_HTOA
- extern char *dnet_htoa(struct dn_naddr *);
- #endif
-#endif
-
#include "netdissect.h"
#include "extract.h"
#include "addrtoname.h"
snprintf(str, siz, "%u.%u", area, node);
return(str);
}
-
-const char *
-dnname_string(netdissect_options *ndo, u_short dnaddr)
-{
-#ifdef HAVE_DNET_HTOA
- struct dn_naddr dna;
- char *dnname;
-
- dna.a_len = sizeof(short);
- memcpy((char *)dna.a_addr, (char *)&dnaddr, sizeof(short));
- dnname = dnet_htoa(&dna);
- if(dnname != NULL)
- return (strdup(dnname));
- else
- return(dnnum_string(ndo, dnaddr));
-#else
- return(dnnum_string(ndo, dnaddr)); /* punt */
-#endif
-}
smi_version_string = nd_smi_version_string();
if (smi_version_string != NULL)
(void)fprintf (stderr, "SMI-library: %s\n", smi_version_string);
-#ifdef HAVE_DNET_HTOA
- (void)fprintf(stderr, "libdnet unknown version\n");
-#endif
#if defined(__SANITIZE_ADDRESS__)
(void)fprintf (stderr, "Compiled with AddressSanitizer/GCC.\n");