diff -Nru lldpd-1.0.3/ChangeLog lldpd-1.0.4/ChangeLog --- lldpd-1.0.3/ChangeLog 2018-12-10 14:03:42.000000000 +0000 +++ lldpd-1.0.4/ChangeLog 2019-06-15 09:14:45.000000000 +0000 @@ -1,3 +1,29 @@ +1.0.4 [2019-06-15 11:09:44 +0200]: + + - [1507a0035694] release: 1.0.4 (Vincent Bernat) + - [4a1fb0acb1e4] lldpd: document expectation for LLDP-MED device configuration (Vincent Bernat) + - [66a551ed239d] netlink: make the netlink socket totally non blocking (Vincent Bernat) + - [6c3697f21295] netlink: handle blocking read from netlink socket (Vincent Bernat) + - [8ca3da075bfc] snmp: implement lldpRemOrgDefInfoTable for remote custom TLVs (Vincent Bernat) + - [10da5bcb106b] debian: depends on lsb-base (Vincent Bernat) + - [fe28f2c441fc] debian: no need to BD on lsb-release anymore (Vincent Bernat) + - [653838a396cc] doc: update Android instructions for ARM64 (Vincent Bernat) + - [fbb30189306c] client: use bold instead of a color for command completions (Vincent Bernat) + - [26b82f3f7c35] agent: do not increase statsAgeoutsTotal when receiving a shutdown frame (Vincent Bernat) + - [109bcd423cd5] lldp: increase statsTLVsUnrecognizedTotal on unknown TLV (Vincent Bernat) + - [da94dd1fff77] tests: update pytest (Vincent Bernat) + - [6e3cb2f550fb] client: rename max-neighbor command (Vincent Bernat) + - [1adf91794dd5] tests: add test for global configuration settings (Vincent Bernat) + - [ba1bdf6aaf76] client: ability to set maximum of neighbors from lldpcli (Vincent Bernat) + - [b2eebb31fc21] priv: include limits.h for PATH_MAX (Sören Tempel) + - [0ca212866b3c] lib: use an unique variable as iterator in foreach macro (Vincent Bernat) + - [d0058aa62e1c] build: warn on implicit fallthrough for case statements (Vincent Bernat) + - [adbb26bc0a49] build: enable increased reliability of stack overflow detection (Vincent Bernat) + - [a636b31d72ea] interfaces/linux: make dsa special (Brandon Streiff) + - [4e7ec8233cd1] build: fix compilation with `--enable-fdp --disable-cdp` (Vincent Bernat) + - [cd752e02254d] daemon: allow lseek for seccomp (Vincent Bernat) + - [499046a8dfd1] osx: update version in HomeBrew formula (Vincent Bernat) + 1.0.3 [2018-12-10 15:02:58 +0100]: - [0c08843c9014] release: 1.0.3 (Vincent Bernat) diff -Nru lldpd-1.0.3/configure lldpd-1.0.4/configure --- lldpd-1.0.3/configure 2018-12-10 14:03:26.000000000 +0000 +++ lldpd-1.0.4/configure 2019-06-15 09:14:20.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for lldpd 1.0.3. +# Generated by GNU Autoconf 2.69 for lldpd 1.0.4. # # Report bugs to . # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='lldpd' PACKAGE_TARNAME='lldpd' -PACKAGE_VERSION='1.0.3' -PACKAGE_STRING='lldpd 1.0.3' +PACKAGE_VERSION='1.0.4' +PACKAGE_STRING='lldpd 1.0.4' PACKAGE_BUGREPORT='https://github.com/vincentbernat/lldpd/issues' PACKAGE_URL='http://vincentbernat.github.io/lldpd/' @@ -1517,7 +1517,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures lldpd 1.0.3 to adapt to many kinds of systems. +\`configure' configures lldpd 1.0.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1588,7 +1588,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of lldpd 1.0.3:";; + short | recursive ) echo "Configuration of lldpd 1.0.4:";; esac cat <<\_ACEOF @@ -1805,7 +1805,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -lldpd configure 1.0.3 +lldpd configure 1.0.4 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2285,7 +2285,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by lldpd $as_me 1.0.3, which was +It was created by lldpd $as_me 1.0.4, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3159,7 +3159,7 @@ # Define the identity of the package. PACKAGE='lldpd' - VERSION='1.0.3' + VERSION='1.0.4' cat >>confdefs.h <<_ACEOF @@ -16258,6 +16258,70 @@ ;; esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking CFLAGS for gcc -Wimplicit-fallthrough" >&5 +$as_echo_n "checking CFLAGS for gcc -Wimplicit-fallthrough... " >&6; } +if ${ac_cv_cflags_gcc_option__Wimplicit_fallthrough+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_cflags_gcc_option__Wimplicit_fallthrough="no, unknown" + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + ac_save_CFLAGS="$CFLAGS" +for ac_arg in "-pedantic -Werror % -Wimplicit-fallthrough" "-pedantic % -Wimplicit-fallthrough %% no, obsolete" # +do CFLAGS="$ac_save_CFLAGS $LLDP_CFLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_cflags_gcc_option__Wimplicit_fallthrough=`echo $ac_arg | sed -e 's,.*% *,,'` ; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done + CFLAGS="$ac_save_CFLAGS" + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags_gcc_option__Wimplicit_fallthrough" >&5 +$as_echo "$ac_cv_cflags_gcc_option__Wimplicit_fallthrough" >&6; } +ac_res=$ac_cv_cflags_gcc_option__Wimplicit_fallthrough +case ".${ac_res}" in + .ok|.ok,*) ;; + .|.no|.no,*) ;; + *) + if echo " $LLDP_CFLAGS " | grep " ${ac_res} " 2>&1 >/dev/null + then { { $as_echo "$as_me:${as_lineno-$LINENO}: : LLDP_CFLAGS does contain \${ac_res}"; } >&5 + (: LLDP_CFLAGS does contain ${ac_res}) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + else { { $as_echo "$as_me:${as_lineno-$LINENO}: : LLDP_CFLAGS=\"\$LLDP_CFLAGS \${ac_res}\""; } >&5 + (: LLDP_CFLAGS="$LLDP_CFLAGS ${ac_res}") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + LLDP_CFLAGS="$LLDP_CFLAGS ${ac_res}" + fi + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking CFLAGS for gcc -Wfatal-errors" >&5 $as_echo_n "checking CFLAGS for gcc -Wfatal-errors... " >&6; } if ${ac_cv_cflags_gcc_option__Wfatal_errors+:} false; then : @@ -17372,6 +17436,70 @@ ;; esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking CFLAGS for gcc -fstack-clash-protection" >&5 +$as_echo_n "checking CFLAGS for gcc -fstack-clash-protection... " >&6; } +if ${ac_cv_cflags_gcc_option__fstack_clash_protection+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_cflags_gcc_option__fstack_clash_protection="no, unknown" + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + ac_save_CFLAGS="$CFLAGS" +for ac_arg in "-pedantic -Werror % -fstack-clash-protection" "-pedantic % -fstack-clash-protection %% no, obsolete" # +do CFLAGS="$ac_save_CFLAGS $LLDP_CFLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_cflags_gcc_option__fstack_clash_protection=`echo $ac_arg | sed -e 's,.*% *,,'` ; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done + CFLAGS="$ac_save_CFLAGS" + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags_gcc_option__fstack_clash_protection" >&5 +$as_echo "$ac_cv_cflags_gcc_option__fstack_clash_protection" >&6; } +ac_res=$ac_cv_cflags_gcc_option__fstack_clash_protection +case ".${ac_res}" in + .ok|.ok,*) ;; + .|.no|.no,*) ;; + *) + if echo " $LLDP_CFLAGS " | grep " ${ac_res} " 2>&1 >/dev/null + then { { $as_echo "$as_me:${as_lineno-$LINENO}: : LLDP_CFLAGS does contain \${ac_res}"; } >&5 + (: LLDP_CFLAGS does contain ${ac_res}) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + else { { $as_echo "$as_me:${as_lineno-$LINENO}: : LLDP_CFLAGS=\"\$LLDP_CFLAGS \${ac_res}\""; } >&5 + (: LLDP_CFLAGS="$LLDP_CFLAGS ${ac_res}") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + LLDP_CFLAGS="$LLDP_CFLAGS ${ac_res}" + fi + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking CFLAGS for gcc -D_FORTIFY_SOURCE=2" >&5 $as_echo_n "checking CFLAGS for gcc -D_FORTIFY_SOURCE=2... " >&6; } if ${ac_cv_cflags_gcc_option__D_FORTIFY_SOURCE_2+:} false; then : @@ -22934,7 +23062,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by lldpd $as_me 1.0.3, which was +This file was extended by lldpd $as_me 1.0.4, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -23001,7 +23129,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -lldpd config.status 1.0.3 +lldpd config.status 1.0.4 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru lldpd-1.0.3/configure.ac lldpd-1.0.4/configure.ac --- lldpd-1.0.3/configure.ac 2018-10-02 18:36:07.000000000 +0000 +++ lldpd-1.0.4/configure.ac 2019-03-17 15:24:10.000000000 +0000 @@ -76,6 +76,7 @@ AX_CFLAGS_GCC_OPTION([-Wextra], [LLDP_CFLAGS]) AX_CFLAGS_GCC_OPTION([-Wformat], [LLDP_CFLAGS]) AX_CFLAGS_GCC_OPTION([-Wformat-security], [LLDP_CFLAGS]) +AX_CFLAGS_GCC_OPTION([-Wimplicit-fallthrough], [LLDP_CFLAGS]) AX_CFLAGS_GCC_OPTION([-Wfatal-errors], [LLDP_CFLAGS]) AX_CFLAGS_GCC_OPTION([-Wcast-align], [LLDP_CFLAGS]) AX_CFLAGS_GCC_OPTION([-Wheader-guard], [LLDP_CFLAGS]) @@ -108,6 +109,7 @@ AX_CFLAGS_GCC_OPTION([-fstack-protector-all], [LLDP_CFLAGS]) AX_CFLAGS_GCC_OPTION([-fstack-protector-strong], [LLDP_CFLAGS]) AX_CFLAGS_GCC_OPTION([-fstack-protector-strong], [LLDP_CFLAGS]) + AX_CFLAGS_GCC_OPTION([-fstack-clash-protection], [LLDP_CFLAGS]) AX_CFLAGS_GCC_OPTION([-D_FORTIFY_SOURCE=2], [LLDP_CPPFLAGS]) fi if test x"$pie" = x"yes"; then diff -Nru lldpd-1.0.3/debian/changelog lldpd-1.0.4/debian/changelog --- lldpd-1.0.3/debian/changelog 2019-01-14 20:01:35.000000000 +0000 +++ lldpd-1.0.4/debian/changelog 2019-07-07 08:42:05.000000000 +0000 @@ -1,8 +1,10 @@ -lldpd (1.0.3-1build1) disco; urgency=medium +lldpd (1.0.4-1) unstable; urgency=medium - * No-change rebuild for readline soname change. + * New upstream release. + * d/{post,pre}{inst,rm}: remove use of maintainer script. + * d/watch: add OpenPGP signature. - -- Matthias Klose Mon, 14 Jan 2019 20:01:35 +0000 + -- Vincent Bernat Sun, 07 Jul 2019 10:42:05 +0200 lldpd (1.0.3-1) unstable; urgency=medium diff -Nru lldpd-1.0.3/debian/lldpd.postinst lldpd-1.0.4/debian/lldpd.postinst --- lldpd-1.0.3/debian/lldpd.postinst 2018-12-10 15:16:57.000000000 +0000 +++ lldpd-1.0.4/debian/lldpd.postinst 2019-07-07 08:42:05.000000000 +0000 @@ -15,8 +15,6 @@ ;; esac -dpkg-maintscript-helper rm_conffile /etc/bash_completion.d/lldpcli.bash-completion 0.7.15~ lldpd -- "$@" - #DEBHELPER# exit 0 diff -Nru lldpd-1.0.3/debian/lldpd.postrm lldpd-1.0.4/debian/lldpd.postrm --- lldpd-1.0.3/debian/lldpd.postrm 2018-12-10 15:16:57.000000000 +0000 +++ lldpd-1.0.4/debian/lldpd.postrm 2019-07-07 08:42:05.000000000 +0000 @@ -4,8 +4,6 @@ #DEBHELPER# -dpkg-maintscript-helper rm_conffile /etc/bash_completion.d/lldpcli.bash-completion 0.7.15~ lldpd -- "$@" - case "$1" in purge) dpkg-statoverride --remove /usr/sbin/lldpcli diff -Nru lldpd-1.0.3/debian/lldpd.preinst lldpd-1.0.4/debian/lldpd.preinst --- lldpd-1.0.3/debian/lldpd.preinst 2018-12-10 15:16:57.000000000 +0000 +++ lldpd-1.0.4/debian/lldpd.preinst 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -#!/bin/sh - -set -e - -dpkg-maintscript-helper rm_conffile /etc/bash_completion.d/lldpcli.bash-completion 0.7.15~ lldpd -- "$@" - -#DEBHELPER# - -exit 0 diff -Nru lldpd-1.0.3/debian/lldpd.prerm lldpd-1.0.4/debian/lldpd.prerm --- lldpd-1.0.3/debian/lldpd.prerm 2018-12-10 15:16:57.000000000 +0000 +++ lldpd-1.0.4/debian/lldpd.prerm 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -#!/bin/sh - -set -e - -dpkg-maintscript-helper rm_conffile /etc/bash_completion.d/lldpcli.bash-completion 0.7.15~ lldpd -- "$@" - -#DEBHELPER# - -exit 0 diff -Nru lldpd-1.0.3/debian/upstream/signing-key.asc lldpd-1.0.4/debian/upstream/signing-key.asc --- lldpd-1.0.3/debian/upstream/signing-key.asc 1970-01-01 00:00:00.000000000 +0000 +++ lldpd-1.0.4/debian/upstream/signing-key.asc 2019-07-07 08:42:05.000000000 +0000 @@ -0,0 +1,89 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBE/cpVkBEACi8ZoEu+dhI604/5zMuuAlPt7e1GDj75UgXZh5f21JYRt/laVs +xiK07BG9NkTCpFzoAFRfndf7HvvTcKrumgPUFw0bYy9uvkrDDAzRV3slA+rL+n6h +ugbxMrtWM+sSoB7pteZcfADDwfcO3SjvQV9mGdVcBOQq3lABdbWP7IAG5myrIvoz +C/Li8v8w1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watch lldpd-1.0.4/debian/watch --- lldpd-1.0.3/debian/watch 2018-12-10 15:16:57.000000000 +0000 +++ lldpd-1.0.4/debian/watch 2019-07-07 08:42:05.000000000 +0000 @@ -1,2 +1,3 @@ version=3 +opts=pgpsigurlmangle=s/$/.gpg/ \ https://vincent.bernat.im/en/projects .*/lldpd-([\d.]+).tar.gz diff -Nru lldpd-1.0.3/.dist-version lldpd-1.0.4/.dist-version --- lldpd-1.0.3/.dist-version 2018-12-10 14:03:43.000000000 +0000 +++ lldpd-1.0.4/.dist-version 2019-06-15 09:14:46.000000000 +0000 @@ -1 +1 @@ -1.0.3 +1.0.4 diff -Nru lldpd-1.0.3/Makefile.in lldpd-1.0.4/Makefile.in --- lldpd-1.0.3/Makefile.in 2018-12-10 14:03:27.000000000 +0000 +++ lldpd-1.0.4/Makefile.in 2019-06-15 09:14:21.000000000 +0000 @@ -234,7 +234,7 @@ CSCOPE = cscope am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/doxygen.am ChangeLog NEWS ar-lib compile \ - config.guess config.sub install-sh ltmain.sh missing + config.guess config.sub depcomp install-sh ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) diff -Nru lldpd-1.0.3/NEWS lldpd-1.0.4/NEWS --- lldpd-1.0.3/NEWS 2018-12-10 13:54:19.000000000 +0000 +++ lldpd-1.0.4/NEWS 2019-06-12 19:51:07.000000000 +0000 @@ -1,3 +1,13 @@ +lldpd (1.0.4) + * Changes: + + Add "configure system max-neighbors XX" command to modify maximum + of neighbors accepted per port. + + Implement lldpRemOrgDefInfoTable table for custom TLVs. + * Fix: + + Better compliance for statsTLVsUnrecognizedTotal and + statsAgeoutsTotal counters. + + On Linux, handle rare blocking case in Netlink code. + lldpd (1.0.3) * Fix: + Fix creation of chroot directory. diff -Nru lldpd-1.0.3/README.md lldpd-1.0.4/README.md --- lldpd-1.0.3/README.md 2018-11-07 19:19:58.000000000 +0000 +++ lldpd-1.0.4/README.md 2019-05-18 15:46:44.000000000 +0000 @@ -115,11 +115,11 @@ ---------------------- You need to download [Android NDK][]. Once unpacked, you can generate -a toolchain using the following command: +a toolchain using the following command (for ARM64): ./build/tools/make-standalone-toolchain.sh \ - --platform=android-9 \ - --arch=arm \ + --platform=android-24 \ + --arch=arm64 \ --install-dir=../android-toolchain export TOOLCHAIN=$PWD/../android-toolchain @@ -128,7 +128,7 @@ mkdir build && cd build export PATH=$PATH:$TOOLCHAIN/bin ../configure \ - --host=arm-linux-androideabi \ + --host=arm64-linux-androideabi \ --with-sysroot=$TOOLCHAIN/sysroot \ --prefix=/system \ --sbindir=/system/bin \ diff -Nru lldpd-1.0.3/src/client/commands.c lldpd-1.0.4/src/client/commands.c --- lldpd-1.0.3/src/client/commands.c 2017-01-16 07:23:42.000000000 +0000 +++ lldpd-1.0.4/src/client/commands.c 2019-05-04 08:56:21.000000000 +0000 @@ -504,7 +504,7 @@ if (!complete) { snprintf(fmt, sizeof(fmt), "%s%%%ds%s %%s\n", - "\033[1;30m", (int)maxl, "\033[0m"); + "\033[1m", (int)maxl, "\033[0m"); fprintf(stderr, fmt, cword->word ? cword->word : "WORD", cword->doc ? cword->doc : "..."); diff -Nru lldpd-1.0.3/src/client/conf-system.c lldpd-1.0.4/src/client/conf-system.c --- lldpd-1.0.3/src/client/conf-system.c 2018-03-17 16:07:11.000000000 +0000 +++ lldpd-1.0.4/src/client/conf-system.c 2019-04-06 15:03:01.000000000 +0000 @@ -298,6 +298,30 @@ return 1; } +static int +cmd_maxneighs(struct lldpctl_conn_t *conn, struct writer *w, + struct cmd_env *env, void *arg) +{ + log_debug("lldpctl", "set maximum neighbors"); + + lldpctl_atom_t *config = lldpctl_get_configuration(conn); + if (config == NULL) { + log_warnx("lldpctl", "unable to get configuration from lldpd. %s", + lldpctl_last_strerror(conn)); + return 0; + } + if (lldpctl_atom_set_str(config, + lldpctl_k_config_max_neighbors, cmdenv_get(env, "max-neighbors")) == NULL) { + log_warnx("lldpctl", "unable to set maximum of neighbors. %s", + lldpctl_last_strerror(conn)); + lldpctl_atom_dec_ref(config); + return 0; + } + log_info("lldpctl", "maximum neighbors set to new value %s", cmdenv_get(env, "max-neighbors")); + lldpctl_atom_dec_ref(config); + return 1; +} + /** * Register `configure system bond-slave-src-mac-type` */ @@ -440,6 +464,16 @@ NEWLINE, "Don't override system name", NULL, cmd_hostname, NULL); + commands_new( + commands_new( + commands_new(configure_system, + "max-neighbors", "Set maximum number of neighbors per port", + cmd_check_no_env, NULL, "ports"), + NULL, "Maximum number of neighbors", + NULL, cmd_store_env_value, "max-neighbors"), + NEWLINE, "Set maximum number of neighbors per port", + NULL, cmd_maxneighs, NULL); + commands_new( commands_new( commands_new( diff -Nru lldpd-1.0.3/src/client/display.c lldpd-1.0.4/src/client/display.c --- lldpd-1.0.3/src/client/display.c 2018-03-17 16:07:11.000000000 +0000 +++ lldpd-1.0.4/src/client/display.c 2019-04-06 15:03:01.000000000 +0000 @@ -886,6 +886,8 @@ lldpctl_atom_get_str(configuration, lldpctl_k_config_tx_interval)); tag_datatag(w, "tx-hold", "Transmit hold", lldpctl_atom_get_str(configuration, lldpctl_k_config_tx_hold)); + tag_datatag(w, "max-neighbors", "Maximum number of neighbors", + lldpctl_atom_get_str(configuration, lldpctl_k_config_max_neighbors)); tag_datatag(w, "rx-only", "Receive mode", lldpctl_atom_get_int(configuration, lldpctl_k_config_receiveonly)? "yes":"no"); diff -Nru lldpd-1.0.3/src/client/lldpcli.8.in lldpd-1.0.4/src/client/lldpcli.8.in --- lldpd-1.0.3/src/client/lldpcli.8.in 2018-03-17 16:07:11.000000000 +0000 +++ lldpd-1.0.4/src/client/lldpcli.8.in 2019-04-06 15:03:01.000000000 +0000 @@ -434,6 +434,14 @@ .Ed .Cd configure +.Cd system max-neighbors Ar neighbors +.Bd -ragged -offset XXXXXX +Change the maximum number of neighbors accepted (for each protocol) on +an interface. This is a global value. The default is 32. This setting +only applies to future neighbors. +.Ed + +.Cd configure .Cd lldp agent-type .Cd nearest-bridge | nearest-non-tpmr-bridge | nearest-customer-bridge .Bd -ragged -offset XXXXXX diff -Nru lldpd-1.0.3/src/daemon/agent.c lldpd-1.0.4/src/daemon/agent.c --- lldpd-1.0.3/src/daemon/agent.c 2018-10-02 18:36:20.000000000 +0000 +++ lldpd-1.0.4/src/daemon/agent.c 2019-06-08 14:49:52.000000000 +0000 @@ -295,6 +295,40 @@ return header_index_best(); } +#ifdef ENABLE_CUSTOM +static struct lldpd_custom* +header_tprcustomindexed_table(struct variable *vp, oid *name, size_t *length, + int exact, size_t *var_len, WriteMethod **write_method) +{ + struct lldpd_hardware *hardware; + struct lldpd_port *port; + struct lldpd_custom *custom; + oid index[8]; + oid idx; + + if (!header_index_init(vp, name, length, exact, var_len, write_method)) return NULL; + TAILQ_FOREACH(hardware, &scfg->g_hardware, h_entries) { + TAILQ_FOREACH(port, &hardware->h_rports, p_entries) { + if (SMART_HIDDEN(port)) continue; + idx = 1; + TAILQ_FOREACH(custom, &port->p_custom_list, next) { + index[0] = lastchange(port); + index[1] = hardware->h_ifindex; + index[2] = port->p_chassis->c_index; + index[3] = custom->oui[0]; + index[4] = custom->oui[1]; + index[5] = custom->oui[2]; + index[6] = custom->subtype; + index[7] = idx++; + if (header_index_add(index, 8, custom)) + return custom; + } + } + } + return header_index_best(); +} +#endif + #ifdef ENABLE_LLDPMED #define TPR_VARIANT_MED_POLICY 2 #define TPR_VARIANT_MED_LOCATION 3 @@ -552,6 +586,8 @@ #define LLDP_SNMP_ADDR_IFSUBTYPE 2 #define LLDP_SNMP_ADDR_IFID 3 #define LLDP_SNMP_ADDR_OID 4 +/* Custom TLVs */ +#define LLDP_SNMP_ORG_DEF_INFO 1 /* LLDP-MED */ #define LLDP_SNMP_MED_CAP_AVAILABLE 1 #define LLDP_SNMP_MED_CAP_ENABLED 2 @@ -1407,6 +1443,33 @@ return agent_v_management(vp, var_len, mgmt); } +#ifdef ENABLE_CUSTOM +static u_char* +agent_v_custom(struct variable *vp, size_t *var_len, struct lldpd_custom *custom) +{ + switch (vp->magic) { + case LLDP_SNMP_ORG_DEF_INFO: + *var_len = custom->oui_info_len; + return (u_char *)custom->oui_info; + default: + break; + } + return NULL; +} +static u_char* +agent_h_remote_custom(struct variable *vp, oid *name, size_t *length, + int exact, size_t *var_len, WriteMethod **write_method) +{ + struct lldpd_custom *custom; + + if ((custom = header_tprcustomindexed_table(vp, name, length, + exact, var_len, write_method)) == NULL) + return NULL; + + return agent_v_custom(vp, var_len, custom); +} +#endif + /* Here is how it works: a agent_h_*() function will handle incoming requests. It will use an appropriate header_*indexed_table() @@ -1477,8 +1540,13 @@ {1, 4, 2, 1, 4}}, {LLDP_SNMP_ADDR_OID, ASN_OBJECT_ID, RONLY, agent_h_remote_management, 5, {1, 4, 2, 1, 5}}, - /* Dot3, local ports */ +#ifdef ENABLE_CUSTOM + /* Custom TLVs */ + {LLDP_SNMP_ORG_DEF_INFO, ASN_OCTET_STR, RONLY, agent_h_remote_custom, 5, + {1, 4, 4, 1, 4}}, +#endif #ifdef ENABLE_DOT3 + /* Dot3, local ports */ {LLDP_SNMP_DOT3_AUTONEG_SUPPORT, ASN_INTEGER, RONLY, agent_h_local_port, 8, {1, 5, 4623, 1, 2, 1, 1, 1}}, {LLDP_SNMP_DOT3_AUTONEG_ENABLED, ASN_INTEGER, RONLY, agent_h_local_port, 8, diff -Nru lldpd-1.0.3/src/daemon/client.c lldpd-1.0.4/src/daemon/client.c --- lldpd-1.0.3/src/daemon/client.c 2018-08-08 20:45:27.000000000 +0000 +++ lldpd-1.0.4/src/daemon/client.c 2019-04-06 15:03:01.000000000 +0000 @@ -87,6 +87,11 @@ cfg->g_config.c_ttl = cfg->g_config.c_tx_interval * cfg->g_config.c_tx_hold; } + if (CHANGED(c_max_neighbors) && config->c_max_neighbors > 0) { + log_debug("rpc", "client change maximum neighbors to %d", + config->c_max_neighbors); + cfg->g_config.c_max_neighbors = config->c_max_neighbors; + } if (CHANGED(c_lldp_portid_type) && config->c_lldp_portid_type > LLDP_PORTID_SUBTYPE_UNKNOWN && config->c_lldp_portid_type <= LLDP_PORTID_SUBTYPE_MAX) { diff -Nru lldpd-1.0.3/src/daemon/event.c lldpd-1.0.4/src/daemon/event.c --- lldpd-1.0.3/src/daemon/event.c 2017-02-19 13:00:06.000000000 +0000 +++ lldpd-1.0.4/src/daemon/event.c 2019-06-12 19:51:07.000000000 +0000 @@ -756,8 +756,7 @@ { log_debug("event", "subscribe to interface changes from socket %d", socket); - if (cfg->g_iface_cb == NULL) - levent_make_socket_nonblocking(socket); + levent_make_socket_nonblocking(socket); cfg->g_iface_event = event_new(cfg->g_base, socket, EV_READ | EV_PERSIST, levent_iface_recv, cfg); if (cfg->g_iface_event == NULL) { @@ -914,3 +913,29 @@ } return 0; } + +#ifdef HOST_OS_LINUX +/* Receive and log error from a socket when there is suspicion of an error. */ +void +levent_recv_error(int fd, const char *source) +{ + do { + ssize_t n; + char buf[1024] = {}; + struct msghdr msg = { + .msg_control = buf, + .msg_controllen = sizeof(buf) + }; + if ((n = recvmsg(fd, &msg, MSG_ERRQUEUE | MSG_DONTWAIT)) <= 0) { + return; + } + struct cmsghdr *cmsg = CMSG_FIRSTHDR(&msg); + if (cmsg == NULL) + log_warnx("event", "received unknown error on %s", + source); + else + log_warnx("event", "received error (level=%d/type=%d) on %s", + cmsg->cmsg_level, cmsg->cmsg_type, source); + } while (1); +} +#endif diff -Nru lldpd-1.0.3/src/daemon/interfaces-linux.c lldpd-1.0.4/src/daemon/interfaces-linux.c --- lldpd-1.0.3/src/daemon/interfaces-linux.c 2018-11-30 21:37:06.000000000 +0000 +++ lldpd-1.0.4/src/daemon/interfaces-linux.c 2019-06-12 19:51:07.000000000 +0000 @@ -71,29 +71,6 @@ buffer, size); } -static void -iflinux_error_recv(struct lldpd_hardware *hardware, int fd) -{ - do { - ssize_t n; - char buf[1024] = {}; - struct msghdr msg = { - .msg_control = buf, - .msg_controllen = sizeof(buf) - }; - if ((n = recvmsg(fd, &msg, MSG_ERRQUEUE)) <= 0) { - return; - } - struct cmsghdr *cmsg = CMSG_FIRSTHDR(&msg); - if (cmsg == NULL) - log_warnx("interfaces", "received unknown error on %s", - hardware->h_ifname); - else - log_warnx("interfaces", "received error (level=%d/type=%d) on %s", - cmsg->cmsg_level, cmsg->cmsg_type, hardware->h_ifname); - } while (1); -} - static int iflinux_generic_recv(struct lldpd_hardware *hardware, int fd, char *buffer, size_t size, @@ -110,7 +87,7 @@ &fromlen)) == -1) { if (errno == EAGAIN && retry == 0) { /* There may be an error queued in the socket. Clear it and retry. */ - iflinux_error_recv(hardware, fd); + levent_recv_error(fd, hardware->h_ifname); retry++; goto retry; } @@ -994,7 +971,7 @@ } /* If the interface is linked to another one, skip it too. */ - if (iface->lower && (!iface->driver || strcmp(iface->driver, "veth"))) { + if (iface->lower && (!iface->driver || (strcmp(iface->driver, "veth") && strcmp(iface->driver, "dsa")))) { log_debug("interfaces", "skip %s: there is a lower interface (%s)", iface->name, iface->lower->name); continue; diff -Nru lldpd-1.0.3/src/daemon/lldpd.8.in lldpd-1.0.4/src/daemon/lldpd.8.in --- lldpd-1.0.3/src/daemon/lldpd.8.in 2017-08-29 18:19:40.000000000 +0000 +++ lldpd-1.0.4/src/daemon/lldpd.8.in 2019-06-12 20:10:49.000000000 +0000 @@ -243,15 +243,21 @@ .Em !* ) , the system name is used as a chassis ID instead. .It Fl M Ar class -Enable emission of LLDP-MED frame. The class should be one of the -following value: +Enable emission of LLDP-MED frame. Depending on the selected class, +the standard defines which set of TLV should be transmitted. See +section 10.2.1. Some devices may be strict about this aspect. The +class should be one of the following value: .Bl -tag -width "0:XX" -compact .It Sy 1 Generic Endpoint (Class I) .It Sy 2 -Media Endpoint (Class II) +Media Endpoint (Class II). In this case, the standard requires to +define at least one network policy through +.Nm lldpcli . .It Sy 3 -Communication Device Endpoints (Class III) +Communication Device Endpoints (Class III). In this case, the standard +requires to define at least one network policy through +.Nm lldpcli . .It Sy 4 Network Connectivity Device .El diff -Nru lldpd-1.0.3/src/daemon/lldpd.h lldpd-1.0.4/src/daemon/lldpd.h --- lldpd-1.0.3/src/daemon/lldpd.h 2018-12-01 09:47:34.000000000 +0000 +++ lldpd-1.0.4/src/daemon/lldpd.h 2019-06-12 19:51:07.000000000 +0000 @@ -127,6 +127,9 @@ void levent_schedule_cleanup(struct lldpd *); int levent_make_socket_nonblocking(int); int levent_make_socket_blocking(int); +#ifdef HOST_OS_LINUX +void levent_recv_error(int, const char*); +#endif /* lldp.c */ int lldp_send_shutdown(PROTO_SEND_SIG); diff -Nru lldpd-1.0.3/src/daemon/netlink.c lldpd-1.0.4/src/daemon/netlink.c --- lldpd-1.0.3/src/daemon/netlink.c 2018-11-07 19:19:58.000000000 +0000 +++ lldpd-1.0.4/src/daemon/netlink.c 2019-06-12 19:51:07.000000000 +0000 @@ -442,8 +442,7 @@ struct interfaces_device_list *ifs, struct interfaces_address_list *ifas) { - int end = 0, ret = 0; - int flags = MSG_PEEK | MSG_TRUNC; + int end = 0, ret = 0, flags, retry = 0; struct iovec iov; int link_update = 0; int s = cfg->g_netlink->nl_socket; @@ -471,12 +470,16 @@ .msg_name = &peer, .msg_namelen = sizeof(struct sockaddr_nl) }; - + flags = MSG_PEEK | MSG_TRUNC; retry: len = recvmsg(s, &rtnl_reply, flags); if (len == -1) { if (errno == EAGAIN || errno == EWOULDBLOCK) { - log_debug("netlink", "should have received something, but didn't"); + if (retry++ == 0) { + levent_recv_error(s, "netlink socket"); + goto retry; + } + log_warnx("netlink", "should have received something, but didn't"); ret = 0; goto out; } @@ -650,7 +653,6 @@ msg->nlmsg_type, msg->nlmsg_len); } } - flags = MSG_PEEK | MSG_TRUNC; } end: if (link_update) { diff -Nru lldpd-1.0.3/src/daemon/priv.c lldpd-1.0.4/src/daemon/priv.c --- lldpd-1.0.3/src/daemon/priv.c 2018-12-10 13:51:55.000000000 +0000 +++ lldpd-1.0.4/src/daemon/priv.c 2019-04-06 15:03:01.000000000 +0000 @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff -Nru lldpd-1.0.3/src/daemon/priv-seccomp.c lldpd-1.0.4/src/daemon/priv-seccomp.c --- lldpd-1.0.3/src/daemon/priv-seccomp.c 2017-11-16 17:42:15.000000000 +0000 +++ lldpd-1.0.4/src/daemon/priv-seccomp.c 2018-12-10 16:21:35.000000000 +0000 @@ -149,6 +149,7 @@ (rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(write), 0)) < 0 || /* write needed for */ (rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(open), 0)) < 0 || (rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(openat), 0)) < 0 || + (rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(lseek), 0)) < 0 || (rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(fcntl), 0)) < 0 || (rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(kill), 0)) < 0 || (rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(socket), 0)) < 0 || diff -Nru lldpd-1.0.3/src/daemon/protocols/lldp.c lldpd-1.0.4/src/daemon/protocols/lldp.c --- lldpd-1.0.3/src/daemon/protocols/lldp.c 2018-10-02 18:36:20.000000000 +0000 +++ lldpd-1.0.4/src/daemon/protocols/lldp.c 2019-04-06 19:17:16.000000000 +0000 @@ -1147,6 +1147,7 @@ default: log_warnx("lldp", "unknown tlv (%d) received on %s", tlv_type, hardware->h_ifname); + hardware->h_rx_unrecognized_cnt++; goto malformed; } if (pos > tlv + tlv_size) { diff -Nru lldpd-1.0.3/src/lib/atoms/config.c lldpd-1.0.4/src/lib/atoms/config.c --- lldpd-1.0.3/src/lib/atoms/config.c 2018-03-17 16:07:11.000000000 +0000 +++ lldpd-1.0.4/src/lib/atoms/config.c 2019-04-06 15:03:01.000000000 +0000 @@ -244,6 +244,8 @@ #endif case lldpctl_k_config_tx_hold: return c->config->c_tx_hold; + case lldpctl_k_config_max_neighbors: + return c->config->c_max_neighbors; default: return SET_ERROR(atom->conn, LLDPCTL_ERR_NOT_EXIST); } @@ -292,6 +294,10 @@ config.c_tx_hold = value; if (value > 0) c->config->c_tx_hold = value; break; + case lldpctl_k_config_max_neighbors: + config.c_max_neighbors = value; + if (value > 0) c->config->c_max_neighbors = value; + break; case lldpctl_k_config_bond_slave_src_mac_type: config.c_bond_slave_src_mac_type = value; c->config->c_bond_slave_src_mac_type = value; diff -Nru lldpd-1.0.3/src/lib/lldpctl.h lldpd-1.0.4/src/lib/lldpctl.h --- lldpd-1.0.3/src/lib/lldpctl.h 2018-06-16 16:45:43.000000000 +0000 +++ lldpd-1.0.4/src/lib/lldpctl.h 2019-04-06 15:03:01.000000000 +0000 @@ -790,6 +790,7 @@ lldpctl_k_config_bond_slave_src_mac_type, /**< `(I,WO)` bond slave src mac type. */ lldpctl_k_config_lldp_portid_type, /**< `(I,WO)` LLDP PortID TLV Subtype */ lldpctl_k_config_lldp_agent_type, /**< `(I,WO)` LLDP agent type */ + lldpctl_k_config_max_neighbors, /**< `(I,WO)`Maximum number of neighbors per port. */ lldpctl_k_custom_tlvs = 5000, /**< `(AL)` custom TLVs */ lldpctl_k_custom_tlvs_clear, /** `(I,WO)` clear list of custom TLVs */ @@ -1035,10 +1036,10 @@ * reference count of the provided value is decremented. If you need to use it * outside of the loop, you need to increment it. */ -#define lldpctl_atom_foreach(atom, value) \ - for (lldpctl_atom_iter_t *iter = lldpctl_atom_iter(atom); \ - iter && (value = lldpctl_atom_iter_value(atom, iter)); \ - iter = lldpctl_atom_iter_next(atom, iter), \ +#define lldpctl_atom_foreach(atom, value) \ + for (lldpctl_atom_iter_t *iter##_LINE_ = lldpctl_atom_iter(atom); \ + iter##_LINE_ && (value = lldpctl_atom_iter_value(atom, iter##_LINE_)); \ + iter##_LINE_ = lldpctl_atom_iter_next(atom, iter##_LINE_), \ lldpctl_atom_dec_ref(value)) /** diff -Nru lldpd-1.0.3/src/lldpd-structs.c lldpd-1.0.4/src/lldpd-structs.c --- lldpd-1.0.3/src/lldpd-structs.c 2018-03-17 16:07:11.000000000 +0000 +++ lldpd-1.0.4/src/lldpd-structs.c 2019-04-09 07:01:16.000000000 +0000 @@ -175,7 +175,7 @@ del = all; if (!all && expire && (now >= port->p_lastupdate + port->p_ttl)) { - hardware->h_ageout_cnt++; + if (port->p_ttl > 0) hardware->h_ageout_cnt++; del = 1; } if (del) { diff -Nru lldpd-1.0.3/src/lldpd-structs.h lldpd-1.0.4/src/lldpd-structs.h --- lldpd-1.0.3/src/lldpd-structs.h 2018-10-02 19:11:41.000000000 +0000 +++ lldpd-1.0.4/src/lldpd-structs.h 2019-01-10 14:05:14.000000000 +0000 @@ -129,7 +129,7 @@ MARSHAL(lldpd_dot3_power); #endif -#ifdef ENABLE_CDP +#if defined (ENABLE_CDP) || defined (ENABLE_FDP) struct cdpv2_power { u_int16_t request_id; u_int16_t management_id; @@ -273,7 +273,7 @@ struct lldpd_med_power p_med_power; #endif -#ifdef ENABLE_CDP +#if defined (ENABLE_CDP) || defined (ENABLE_FDP) struct cdpv2_power p_cdp_power; #endif diff -Nru lldpd-1.0.3/tests/check_snmp.c lldpd-1.0.4/tests/check_snmp.c --- lldpd-1.0.3/tests/check_snmp.c 2017-02-19 13:00:06.000000000 +0000 +++ lldpd-1.0.4/tests/check_snmp.c 2019-06-08 14:49:52.000000000 +0000 @@ -246,10 +246,38 @@ .data_len = 15, }, { .format = 0 }, { .format = 0 }, }, -#endif +#endif } }; +#ifdef ENABLE_CUSTOM +struct lldpd_custom custom1 = { + .oui = { 33, 44, 55 }, + .subtype = 44, + .oui_info = (u_int8_t*)"OUI content", +}; +struct lldpd_custom custom2 = { + .oui = { 33, 44, 55 }, + .subtype = 44, + .oui_info = (u_int8_t*)"More content", +}; +struct lldpd_custom custom3 = { + .oui = { 33, 44, 55 }, + .subtype = 45, + .oui_info = (u_int8_t*)"More more content", +}; +struct lldpd_custom custom4 = { + .oui = { 33, 44, 56 }, + .subtype = 44, + .oui_info = (u_int8_t*)"Even more content", +}; +struct lldpd_custom custom5 = { + .oui = { 33, 44, 55 }, + .subtype = 44, + .oui_info = (u_int8_t*)"Still more content", +}; +#endif + #ifdef ENABLE_DOT1 struct lldpd_vlan vlan47 = { .v_name = "VLAN #47", @@ -308,6 +336,21 @@ TAILQ_INIT(&test_cfg.g_hardware); TAILQ_INSERT_TAIL(&test_cfg.g_hardware, &hardware1, h_entries); TAILQ_INSERT_TAIL(&test_cfg.g_hardware, &hardware2, h_entries); +#ifdef ENABLE_CUSTOM + custom1.oui_info_len = strlen((char*)custom1.oui_info); + custom2.oui_info_len = strlen((char*)custom2.oui_info); + custom3.oui_info_len = strlen((char*)custom3.oui_info); + custom4.oui_info_len = strlen((char*)custom4.oui_info); + custom5.oui_info_len = strlen((char*)custom5.oui_info); + TAILQ_INIT(&hardware1.h_lport.p_custom_list); + TAILQ_INIT(&hardware2.h_lport.p_custom_list); + TAILQ_INIT(&port2.p_custom_list); + TAILQ_INSERT_TAIL(&hardware2.h_lport.p_custom_list, &custom1, next); + TAILQ_INSERT_TAIL(&hardware2.h_lport.p_custom_list, &custom2, next); + TAILQ_INSERT_TAIL(&hardware2.h_lport.p_custom_list, &custom3, next); + TAILQ_INSERT_TAIL(&hardware2.h_lport.p_custom_list, &custom4, next); + TAILQ_INSERT_TAIL(&hardware1.h_lport.p_custom_list, &custom5, next); +#endif #ifdef ENABLE_DOT1 TAILQ_INIT(&hardware1.h_lport.p_vlans); TAILQ_INSERT_TAIL(&hardware1.h_lport.p_vlans, &vlan47, v_entries); @@ -525,6 +568,20 @@ { .string = { .octet = (char *)zeroDotZero, .len = sizeof(zeroDotZero) }} }, +#ifdef ENABLE_CUSTOM + /* lldpRemOrgDefInfo */ + { {1, 4, 4, 1, 4, 0, 3, 1, 33, 44, 55, 44, 1 }, 13, ASN_OCTET_STR, + { .string = { .octet = "OUI content", .len = 11 }} }, + { {1, 4, 4, 1, 4, 0, 3, 1, 33, 44, 55, 44, 2 }, 13, ASN_OCTET_STR, + { .string = { .octet = "More content", .len = 12 }} }, + { {1, 4, 4, 1, 4, 0, 3, 1, 33, 44, 55, 45, 3 }, 13, ASN_OCTET_STR, + { .string = { .octet = "More more content", .len = 17 }} }, + { {1, 4, 4, 1, 4, 0, 3, 1, 33, 44, 56, 44, 4 }, 13, ASN_OCTET_STR, + { .string = { .octet = "Even more content", .len = 17 }} }, + { {1, 4, 4, 1, 4, 10000, 4, 1, 33, 44, 55, 44, 1 }, 13, ASN_OCTET_STR, + { .string = { .octet = "Still more content", .len = 18 }} }, +#endif + #ifdef ENABLE_DOT3 /* lldpXdot3LocPortAutoNegSupported */ { {1, 5, 4623, 1, 2, 1, 1, 1, 3 }, 9, ASN_INTEGER, { .integer = 1 }},