Git Product home page Git Product logo

docsis's Introduction

Docsis utility

Build Status Coverage Status

This program encodes a DOCSIS binary configuration file from a human-readable text configuration file.

It was originaly developed at http://docsis.sourceforge.net and later on moved to https://github.com/rlaager/docsis

This build is an experimental one and is based on a fork from the GitHub project. Please use this build on your own risk.

This tool is fully compliant with the following specs:
CM-SP-eRouter-I12
DPoE-SP-DEMARCv1.0-I04
CM-SP-L2VPN-I13
CM-SP-MULPIv3.0-I24

Linux/Unix

This was tested on Ubuntu 14.10, Fedora 21, openSUSE 13.2 (little endian) and Debian 7.5 Sparc64 (big endian) and it is known to work without issues.

Dependencies:

Debian/Ubuntu:
apt-get install automake libtool libsnmp-dev bison make gcc flex git libglib2.0-dev libfl-dev

Fedore/RedHat/CentOS:
yum install autoconf automake libtool glib2-devel bison flex net-snmp-devel

openSUSE/SLES:
zypper install autoconf automake libtool glib2-devel bison flex net-snmp-devel

FreeBSD/OpenBSD/NetBSD
pkg install automake autoconf bison flex gcc libtool glib net-snmp

Mac OS X

Tested and working on OS X Mavericks. Dependencies should be installed using MacPorts:

sudo port install autoconf automake libtool glib2-devel bison flex net-snmp

Windows

Tested and working under Cygwin 2.0.2

Packages needed:

automake libtool net-snmp-utils net-snmp-devel bison make gcc-g++ flex libglib2.0-devel

Installation steps

Follow the following steps to download and install the utility.

git clone https://github.com/rlaager/docsis.git
cd docsis
./autogen.sh
./configure
make
make install (optional)

Bug reporting

Please use the GitHub system to report feature request and bugs.

Known issues

Quoting the hex strings will result in a crash. Known workaround is to not quote HEX definitions.

There are compilation problems on old gcc variants, you should get an error similar to: docsis.c: multiple definition of `main'. Known workaround is to upgrade to a newer version of gcc.

If you want to encode as string something similar to ""value"" you need to escape the extra characters. Config file value should look like ""value"".

docsis's People

Contributors

adriansimionov avatar ddcc avatar dennisvec avatar jeffhowe60 avatar jforhan avatar nickhilliard avatar nwidger avatar perezmeyer avatar rlaager avatar silverwind avatar tenpin784 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docsis's Issues

Issue with generated documentation

There is an issue with the script which generates documentation. I am assuming it is generate-setting.sh.

In some case, the generated TLV looks like:
MultIP addressleReceiveChannelSupport
Instead of:
MultipleReceiveChannelSupport

Build failure on Ubuntu 16

Build fails on ubuntu ( undefined reference to 'yywrap').

Solution:
apt install libfl-dev

and modify Makefiles to link against -lfl.

Abort Trap 6 when compiling CM file on MAC OS X 10.10.3

When creating a cm.bin file on MAC OS X 10.10.3 I get the following:

JonesyMacBookPro:Downloads cjones$ docsis -e CM.txt key CM,bin
Abort trap: 6
JonesyMacBookPro:Downloads cjones$

MAC generates a crash dump which I can send on request.

Arris MTA configfile error

The generated config file with docsis-0.9,6 is applicable for the cm and for the mta too.
The generated config file with docsis-0.9,9 is applicable for the cm but makes error on the mta

Program will crash if used with invalid parameter

By chance I've found that 0.9.9 will segfault if used with a bad first parameter (for example "docsis e").
This can be avoided by adding and extra condition to the last match used by the arg's parser (in docsis.c:430):

if (argc && encode_docsis)   {

Cheers
JC

incorrect-fsf-address

In all cases, upstream should be informed about this. This is the only requirement with respect to this error.

The license file, usually COPYING, must not be patched for legal reasons. Other files can be patched if deemed suitable. The updated GPL 2.0 license (the usual case) with correct address is at:

http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt

[TODO] OCHD2.1 support for TLV 38

It is defined in OC-SP-HOST2.1-CFR-I17

TLV Number Name Chapter
38 SNMPv3NotificationReceiver 15.2.7
38.1 SNMPv3NotificationReceiverIPv4Address 15.2.7.1
38.2 SNMPv3NotificationReceiverUDPPortNumber 15.2.7.2
38.3 SNMPv3NotificationReceiverTrapType 15.2.7.3
38.4 SNMPv3NotificationReceiverTimeout 15.2.7.4
38.5 SNMPv3NotificationReceiverRetries 15.2.7.5
38.6 SNMPv3NotificationReceiverFilteringParameters 15.2.7.6
38.7 SNMPv3NotificationReceiverSecurityName 15.2.7.7
38.8 SNMPv3NotificationReceiverIPv6Address 15.2.7.8

A test case should also be written.

implicit declaration of function ‘netsnmp_init_mib’

unable to compile it at latest CentOS 5.11 version.

md5.h:45:7: warning: no newline at end of file

docsis.c: In function ‘encode_one_file’:
docsis.c:576: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
docsis.c: In function ‘setup_mib_flags’:
docsis.c:652: error: implicit declaration of function ‘netsnmp_init_mib’
[root@376a331458ca docsis]# make
cd . && /bin/sh /mnt/git/docsis/missing --run autoheader
rm -f stamp-h1
touch config.h.in
cd . && /bin/sh ./config.status config.h
config.status: creating config.h
config.status: config.h is unchanged
make  all-recursive
make[1]: Entering directory `/mnt/git/docsis'
Making all in src
make[2]: Entering directory `/mnt/git/docsis/src'
if gcc -DHAVE_CONFIG_H -I. -I. -I..   -DINET6 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -g -lcrypto -DNETSNMP_NO_INLINE -Dlinux -I/usr/include/rpm -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -I. -I/usr/include/net-snmp   -Wall  -Waggregate-return -Wbad-function-cast -Wcast-align -Wdeclaration-after-statement -Wendif-labels -Werror-implicit-function-declaration -Wextra -Wno-unused-parameter -Wfloat-equal -Wformat-security -Winit-self -Wmissing-declarations -Wmissing-noreturn -Wmissing-prototypes -Wpointer-arith -Wundef -g -g -O2 -MT docsis.o -MD -MP -MF ".deps/docsis.Tpo" -c -o docsis.o docsis.c; \
    then mv -f ".deps/docsis.Tpo" ".deps/docsis.Po"; else rm -f ".deps/docsis.Tpo"; exit 1; fi
In file included from docsis.c:44:
md5.h:45:7: warning: no newline at end of file
docsis.c: In function ‘encode_one_file’:
docsis.c:576: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
docsis.c: In function ‘setup_mib_flags’:
docsis.c:652: error: implicit declaration of function ‘netsnmp_init_mib’
make[2]: *** [docsis.o] Error 1
make[2]: Leaving directory `/mnt/git/docsis/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/mnt/git/docsis'
make: *** [all] Error 2

Cannot run tests from clean clone

Hi,

Love this project and this is my first time using it.

Did a clean git clone, running on Linux, compiles without any warnings, Ubuntu stretch.

When I try running the tests, I only get through the first 5 files. Seems the first test fails with the lookup of sysName.0. I have all the MIBs installed in one directory and modified RunTests.sh with -M and the mibs location.

Not too sure how to troubleshoot this from here. Is there anything else I need to configure in order to get the SNMP portion of the tests to pass?

Thanks

PKTC Config Hash

Hi

I am using the 0.9.9-dev Docsis tool to generate a working MTA. I've used this in a past with a variety of modems. There is one modem that will not work though.

I've tracked the problem down to the OID used for pktcMtaDevProvConfigHash.0

It looks like there is more than just EU/NA - IETF as well? Anyway, in docsis.c, the relevant parts for generating the OID are -

NA (Hash == 1) - This corresponds with OID .1.3.6.1.4.1.4491.2.2.1.1.2.7.0 (pktcMtaDevProvConfigHash.0 from PKTC-MTA-MIB)

{
    memcpy (tlvbuf + tlvbuflen - 3, "\x0b\x28\x30\x26\x06\x0e\x2b\x06\x01\x04\x01\xa3\x0b\x02\x02\x01\x01\x02\x07\x00\x04\x14", 22);
    tlvbuflen += 19;
  }

EU (Hash == 2) - This corresponds with OID .1.3.6.1.4.1.7432.1.1.2.9.0 - I believe this is an Excentis MIB

{
    memcpy (tlvbuf + tlvbuflen - 3, "\x0b\x26\x30\x24\x06\x0c\x2b\x06\x01\x04\x01\xba\x08\x01\x01\x02\x09\x00\x04\x14", 20);
    tlvbuflen += 17;
  }

There appears to be a 3rd method. The OID is

.1.3.6.1.2.1.140.1.2.11.0

It is pktcMtaDevProvConfigHash.0 from PKTC-IETF-MTA-MIB. I need to use this OID for the modem I'm working on at the moment.

I have used OID converter from

[]((http://www.rtner.de/software/oid.html)

This generated

06 0C 01 03 06 01 02 01 81 0C 01 02 0B 00

Which is getting there, but there is a prefix that changes - the suffix looks like it is always \x04\x14

How is the string generated?

Bug concerning dialplan in docsis

The following lines inside docsis.c:add_dialplan() looks problematic:

local_char = 0x16 + fileSize;
if (local_char < 0x80) {
memcpy(tlvbuf + tlvbuflen, p_local_char, sizeof(local_char));
tlvbuflen += sizeof(local_char);
} else {
...

local_char is of type char, and the highlighted lines might overflow, and the resulting config file can't be recognized by PC2.0 eDVA.

Introducing an intermediate variable of type int can cure the problem:

local_char = local_char_w = 0x16 + fileSize;
if (local_char_w < 0x80) {
memcpy(tlvbuf + tlvbuflen, p_local_char, sizeof(local_char));
tlvbuflen += sizeof(local_char);
} else {
...

[TODO] OCHD2.1 support for TLV 54

It is defined in OC-SP-HOST2.1-CFR-I17

TLV Number Name Chapter
54 SNMPv3AccessViewConfiguration 15.2.2
54.1 SNMPv3AccessViewName 15.2.2.1
54.2 SNMPv3AccessViewSubtree 15.2.2.2
54.3 SNMPv3AccessViewMask 15.2.2.3
54.4 SNMPv3AccessViewType 54.4

A test case should also be written.

deb packaging

I am looking for someone to take the ownership of the deb packaging and submit it to Debian package management system.

Bug compiling MTA

Hello,

I don't know why but when I do compile the MTA with docsis -p or docsis -na -p, the provisioning just don't work.
It says something about pktcMtaDevEnabled inhexistent.

[WARNING] [PACM.PROVISION(pid=1958)]: added Error OID (null)/Unsupported OID (1.3.6.1.2.1.140.1.1.6.0)
[INFO] [PACM.SNMP(pid=1958)]: Populate Error OID 1.3.6.1.2.1.140.1.1.6.0 value=(null) reason=Unsupported OID
[WARNING] [PACM.PROVISION(pid=1958)]: added Error OID (null)/Unsupported OID (1.3.6.1.2.1.140.1.1.6.0)
[INFO] [PACM.SNMP(pid=1958)]: Populate Error OID 1.3.6.1.2.1.140.1.1.6.0 value=(null) reason=Unsupported OID
[WARNING] [PACM.CFM(pid=530)]: provStat != CFM OK. setting return code to pass with warning

When I do the same configuration, on a docsis version 0.9.6 it works perfectly

lexer does not work

Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.igpOEp
+ umask 022
+ cd /home/build/rpmbuild/BUILD
+ cd /home/build/rpmbuild/BUILD
+ rm -rf docsis-423fcb3b56be0536600aba02877426cbf60e61cb
+ /usr/bin/gzip -dc /home/build/rpmbuild/SOURCES/docsis-423fcb3.tar.gz
+ /usr/bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd docsis-423fcb3b56be0536600aba02877426cbf60e61cb
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ sed -i 's,.*/configure.*,,' autogen.sh
+ sh autogen.sh
autogenerating build system for 'docsis'
checking for autogen.args: not found.
checking for libtoolize... /bin/libtoolize
checking for glib-gettextize... /bin/glib-gettextize
checking for sed... /bin/sed
checking for aclocal... /bin/aclocal
checking for autoheader... /bin/autoheader
checking for automake... /bin/automake
checking for autoconf... /bin/autoconf
running /bin/libtoolize -c -f --automake... done.
running /bin/glib-gettextize --force --copy... done.
Creating po/ subdirectory
Copying file po/Makefile.in.in

Please add the files
  codeset.m4 gettext.m4 glibc21.m4 iconv.m4 isc-posix.m4 lcmessage.m4
  progtest.m4
from the /usr/share/aclocal directory to your autoconf macro directory
or directly to your aclocal.m4 file.
You will also need config.guess and config.sub, which you can get from
ftp://ftp.gnu.org/pub/gnu/config/.

running /bin/aclocal ... done.
aclocal: warning: autoconf input should be named 'configure.ac', not 'configure.in'
running /bin/autoheader ... done.
running /bin/automake -a -c --gnu... done.
automake: warning: autoconf input should be named 'configure.ac', not 'configure.in'
configure.in:7: installing './compile'
automake: warning: autoconf input should be named 'configure.ac', not 'configure.in'
parallel-tests: installing './test-driver'
src/Makefile.am:5: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
configure.in: installing './ylwrap'
running /bin/autoconf ... done.
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.zCRDgC
+ umask 022
+ cd /home/build/rpmbuild/BUILD
+ cd docsis-423fcb3b56be0536600aba02877426cbf60e61cb
+ CFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches  -m64 -mtune=generic'
+ export CFLAGS
+ CXXFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches  -m64 -mtune=generic'
+ export CXXFLAGS
+ FFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches  -m64 -mtune=generic -I/usr/lib64/gfortran/modules'
+ export FFLAGS
+ FCFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches  -m64 -mtune=generic -I/usr/lib64/gfortran/modules'
+ export FCFLAGS
+ LDFLAGS='-Wl,-z,relro '
+ export LDFLAGS
+ '[' 1 = 1 ']'
++ find . -name config.guess -o -name config.sub
+ for i in '$(find . -name config.guess -o -name config.sub)'
++ basename ./config.sub
+ '[' -f /usr/lib/rpm/redhat/config.sub ']'
+ /usr/bin/rm -f ./config.sub
++ basename ./config.sub
+ /usr/bin/cp -fv /usr/lib/rpm/redhat/config.sub ./config.sub
'/usr/lib/rpm/redhat/config.sub' -> './config.sub'
+ for i in '$(find . -name config.guess -o -name config.sub)'
++ basename ./config.guess
+ '[' -f /usr/lib/rpm/redhat/config.guess ']'
+ /usr/bin/rm -f ./config.guess
++ basename ./config.guess
+ /usr/bin/cp -fv /usr/lib/rpm/redhat/config.guess ./config.guess
'/usr/lib/rpm/redhat/config.guess' -> './config.guess'
+ '[' 1 = 1 ']'
+ '[' x '!=' x ']'
+ ./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
/home/build/rpmbuild/BUILD/docsis-423fcb3b56be0536600aba02877426cbf60e61cb/missing: Unknown `--is-lightweight' option
Try `/home/build/rpmbuild/BUILD/docsis-423fcb3b56be0536600aba02877426cbf60e61cb/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... x86_64-redhat-linux-gnu
checking host system type... x86_64-redhat-linux-gnu
checking how to print strings... printf
checking for style of include used by make... GNU
checking for x86_64-redhat-linux-gnu-gcc... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... none
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /bin/ld
checking if the linker (/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /bin/nm -B
checking the name lister (/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-redhat-linux-gnu file names to x86_64-redhat-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-redhat-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /bin/ld option to reload object files... -r
checking for x86_64-redhat-linux-gnu-objdump... no
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for x86_64-redhat-linux-gnu-dlltool... no
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for x86_64-redhat-linux-gnu-ar... no
checking for ar... ar
checking for archiver @FILE support... @
checking for x86_64-redhat-linux-gnu-strip... no
checking for strip... strip
checking for x86_64-redhat-linux-gnu-ranlib... no
checking for ranlib... ranlib
checking command to parse /bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for x86_64-redhat-linux-gnu-mt... no
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for flex... no
checking for lex... no
checking for inet_aton in -lresolv... yes
checking for cos in -lm... yes
checking for gm4... no
checking for gnum4... no
checking for m4... /usr/bin/m4
   found m4 (GNU M4) 1.4.17 at /usr/bin/m4 
checking for bison... /bin/bison
   found bison version 3000002, using /bin/bison -t -d -y
checking for net-snmp-config... /bin/net-snmp-config
checking net-snmp/net-snmp-config.h usability... yes
checking net-snmp/net-snmp-config.h presence... yes
checking for net-snmp/net-snmp-config.h... yes
   found net-snmp version 5007002
checking for Cygwin... no
checking for sed... /bin/sed
checking for -Waggregate-return option to gcc... no
checking for -Wbad-function-cast option to gcc... no
checking for -Wcast-align option to gcc... no
checking for -Wdeclaration-after-statement option to gcc... no
checking for -Wendif-labels option to gcc... no
checking for -Werror-implicit-function-declaration option to gcc... no
checking for -Wextra -Wno-unused-parameter option to gcc... no
checking for -Wfloat-equal option to gcc... no
checking for -Wformat-security option to gcc... no
checking for -Werror=format-security option to gcc... no
checking for -Winit-self option to gcc... no
checking for -Wmissing-declarations option to gcc... no
checking for -Wmissing-noreturn option to gcc... no
checking for -Wmissing-prototypes option to gcc... no
checking for -Wpointer-arith option to gcc... no
checking for -Wundef option to gcc... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating build_setup.nsi
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating doc/Makefile
config.status: creating examples/Makefile
config.status: creating mibs/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
+ make -j4
make  all-recursive
make[1]: Entering directory '/home/build/rpmbuild/BUILD/docsis-423fcb3b56be0536600aba02877426cbf60e61cb'
Making all in src
make[2]: Entering directory '/home/build/rpmbuild/BUILD/docsis-423fcb3b56be0536600aba02877426cbf60e61cb/src'
gcc -DHAVE_CONFIG_H -I. -I..  -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_RPM_4_4_COMPAT -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib64/perl5/CORE -I. -I/usr/include    -Wall  -g -O2 -g -pipe  -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c -o docsis.o docsis.c
gcc -DHAVE_CONFIG_H -I. -I..  -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_RPM_4_4_COMPAT -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib64/perl5/CORE -I. -I/usr/include    -Wall  -g -O2 -g -pipe  -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c -o ethermac.o ethermac.c
gcc -DHAVE_CONFIG_H -I. -I..  -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_RPM_4_4_COMPAT -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib64/perl5/CORE -I. -I/usr/include    -Wall  -g -O2 -g -pipe  -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c -o md5.o md5.c
gcc -DHAVE_CONFIG_H -I. -I..  -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_RPM_4_4_COMPAT -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib64/perl5/CORE -I. -I/usr/include    -Wall  -g -O2 -g -pipe  -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c -o docsis_encode.o docsis_encode.c
gcc -DHAVE_CONFIG_H -I. -I..  -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_RPM_4_4_COMPAT -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib64/perl5/CORE -I. -I/usr/include    -Wall  -g -O2 -g -pipe  -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c -o docsis_decode.o docsis_decode.c
gcc -DHAVE_CONFIG_H -I. -I..  -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_RPM_4_4_COMPAT -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib64/perl5/CORE -I. -I/usr/include    -Wall  -g -O2 -g -pipe  -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c -o docsis_snmp.o docsis_snmp.c
/bin/sh ../ylwrap docsis_yy.y y.tab.c docsis_yy.c y.tab.h `echo docsis_yy.c | sed -e s/cc$/hh/ -e s/cpp$/hpp/ -e s/cxx$/hxx/ -e s/c++$/h++/ -e s/c$/h/` y.output docsis_yy.output -- /bin/bison -t -d -y  
/bin/sh ../ylwrap docsis_lex.l .c docsis_lex.c -- :  
gcc -DHAVE_CONFIG_H -I. -I..  -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_RPM_4_4_COMPAT -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib64/perl5/CORE -I. -I/usr/include    -Wall  -g -O2 -g -pipe  -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c -o hmac_md5.o hmac_md5.c
docsis_snmp.c: In function '_docsis_snmp_build_var_op':
docsis_snmp.c:703:13: warning: variable 'tmpDataPtr' set but not used [-Wunused-but-set-variable]
     u_char  *tmpDataPtr;
             ^
gcc -DHAVE_CONFIG_H -I. -I..  -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_RPM_4_4_COMPAT -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib64/perl5/CORE -I. -I/usr/include    -Wall  -g -O2 -g -pipe  -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c -o docsis_lex.o docsis_lex.c
gcc: error: docsis_lex.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
Makefile:439: recipe for target 'docsis_lex.o' failed
make[2]: *** [docsis_lex.o] Error 4
make[2]: *** Waiting for unfinished jobs....
updating docsis_yy.h
make[2]: Leaving directory '/home/build/rpmbuild/BUILD/docsis-423fcb3b56be0536600aba02877426cbf60e61cb/src'
Makefile:473: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/build/rpmbuild/BUILD/docsis-423fcb3b56be0536600aba02877426cbf60e61cb'
Makefile:367: recipe for target 'all' failed
make: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.zCRDgC (%build)

VendorSpecific TLV 43 Cisco/SA Docsis 1.1/2.0 options encode/decode issue

I use docsis utility version 0.9.6 for encoding and decoding CM/EMTA bootfiles. Few days ago I have downloaded sources from github, compiled the docsis binary file and tried to encode and decode CM/EMTA bootfiles which were made with 0.9.6.
So I see the issue with encoding and decoding CM bootfiles with Cisco/SA VendorSpecific TLV 43 options for Docsis 1.1/2.0 devices in 0.9.8-dev.

In my bootfiles for Cisco/SA for Docsis 1.1/2.0 devices I have these VendorSpecific TLV 43 options:
VendorSpecific
{
VendorIdentifier 0x00407b;
GenericTLV TlvCode 4 TlvLength 1 TlvValue 0x00;
GenericTLV TlvCode 6 TlvLength 1 TlvValue 0x01;
}
VendorSpecific
{
VendorIdentifier 0x000f21;
GenericTLV TlvCode 4 TlvLength 1 TlvValue 0x00;
GenericTLV TlvCode 6 TlvLength 1 TlvValue 0x01;
}
VendorSpecific
{
VendorIdentifier 0x000a73;
GenericTLV TlvCode 4 TlvLength 1 TlvValue 0x00;
GenericTLV TlvCode 6 TlvLength 1 TlvValue 0x01;
}

I have encoded and decoded bootfile with docsis 0.9.6, I don't see any issue on these TLV options and SA/Cisco modems online on CMTS.

But when I tried to encode and decode my bootfiles with docsis 0.9.8-dev, I had error message “u_short length mismatch” on “GenericTLV TlvCode 4 TlvLength 1 TlvValue 0x00”;

$ docsis098
DOCSIS Configuration File creator, version 0.9.8-dev
Copyright (c) 1999,2000,2001 Cornel Ciocirlan, [email protected]
Copyright (c) 2002,2003,2004,2005 Evvolve Media SRL, [email protected]
Copyright (c) 2014 - 2015 Adrian Simionov, [email protected]

$ docsis098 -e text.cfg key.txt /tmp/text.bin

Calculating CMTS MIC using TLVs:

Main
{
VendorSpecific
{
VendorIdentifier 0x00407b;
u_short length mismatch
$
$ docsis098 -d /tmp/text.bin
Main
{
VendorSpecific
{
VendorIdentifier 0x00407b;
u_short length mismatch
$

When I tied to change length to 2 bytes “GenericTLV TlvCode 4 TlvLength 2 TlvValue 0x0000;” and encoded bootfile, my SA/Cisco DPX2203 modems begin reject this bootfile.

In sourceforge.net I found patch #1 Vendor Attributes SA DX233 (http://sourceforge.net/p/docsis/patches/1/).

According RFC (http://www.cablelabs.com/wp-content/uploads/specdocs/CM-SP-MULPIv3.0-I24-140403.pdf) and Excentis Docsis file editor (2.0) in bootfile can be a two types of TLV43 records:

  1. DOCSIS vendor specific Extension Field (43):

The DOCSIS Extension Field is used to extend the capabilities of the DOCSIS specification, through the use of new and/or vendor-specific features. The DOCSIS Extension Field must be encoded using TLV 43 and must include the Vendor ID field (refer to Annex C.1.3.1.41) to indicate whether the DOCSIS Extension Field applies to all devices, or only to devices from a specific vendor. In this context, the Vendor ID is NOT 0xFFFFFF and the DOCSIS Extension Field contains
vendor-specific information (see Annex C.1.1.18.2).

  1. DOCSIS Extension Field (43):

The DOCSIS Extension Field is used to extend the capabilities of the DOCSIS specification, through the use of new and/or vendor-specific features. The DOCSIS Extension Field must be encoded using TLV 43 and must include the Vendor ID field (refer to Annex C.1.3.1.41) to indicate whether the DOCSIS Extension Field applies to all devices, or only to devices from a specific vendor. In this context, the Vendor ID of 0xFFFFFF is reserved to signal that this DOCSIS Extension Field contains general extension information (see Annex C.1.1.18.1)

I created a simple test bootfile in which I added both types of TLV 43 option in Excentis Docsis file editor.

Euro-DOCSIS vendor specific Extension Field:010203/04020000060101
Euro-DOCSIS Extension Field
CM Ranging Class ID Extension:2
CM Load Balancing Group ID:3

When I decoded the bootfile in 0.9.8-dev I found, that TLV 43 records were incorrect parsed:

$ docsis098 -d new.cfg
Main
{
VendorSpecific
{
VendorIdentifier 0x010203;
CMRangingClassIDExtension 0;
ExtendedCMTSMICConfiguration
{
ExtendedCMTSMICHMACDigestType 15;
}
}
VendorSpecific
{
VendorIdentifier 0xffffff;
CMRangingClassIDExtension 2;
CMLoadBalancingGroupID 3;
}

But docsis 0.9.6 decoded bootfile correctly:

$ docsis -d new.cfg
Main
{
VendorSpecific
{
VendorIdentifier 0x010203;
GenericTLV TlvCode 4 TlvLength 2 TlvValue 0x0000;
GenericTLV TlvCode 6 TlvLength 1 TlvValue 0x01;
}
VendorSpecific
{
VendorIdentifier 0xffffff;
GenericTLV TlvCode 4 TlvLength 2 TlvValue 0x0002;
GenericTLV TlvCode 3 TlvLength 4 TlvValue 0x00000003;
}

In 'docsis_symtable.h' file I didn't find 'DOCSIS vendor specific Extension Field' lines according Annex C.1.1.18.2, but I found only 'DOCSIS Extension Field' lines by Annex C.1.1.18.1

{ 200, "VendorSpecific", 43, 28, (encode_nothing), (decode_aggregate), 0, 0 }, /* TLV 22.43 MULPIv3.0-I24 Annex C.2.1.11 /
{ 352, "CMLoadBalancingPolicyID", 1, 200, (encode_uint), (decode_uint), 0, 0 }, /
TLV 22.43.1 MULPIv3.0-I24 Annex C.1.1.18.1.1 /
{ 353, "CMLoadBalancingPriority", 2, 200, (encode_uint), (decode_uint), 0, 0 }, /
TLV 22.43.2 MULPIv3.0-I24 Annex C.1.1.18.1.2 /
{ 354, "CMLoadBalancingGroupID", 3, 200, (encode_uint), (decode_uint), 0, 0 }, /
TLV 22.43.3 MULPIv3.0-I24 Annex C.1.1.18.1.3 /
{ 355, "CMRangingClassIDExtension", 4, 200, (encode_ushort), (decode_ushort), 0, 0 }, /
TLV 22.43.4 MULPIv3.0-I24 Annex C.1.1.18.1.4 /
{ 202, "L2VPNEncoding", 5, 200, (encode_nothing), (decode_aggregate), 0, 0 }, /
TLV 22.43.5 MULPIv3.0-I24 Annex C.1.1.18.1.5 */

Please fix the code of docsis utility to correct encode and decode bootfiles with Cisco/SA VendorSpecific TLV options for Docsis 1.1/2.0 devices.

Add certificate chain file import to TLV 81 and 82 in bootfile encoding

Hello,

We need to have the ability to set certificate file path/name in "GenericTLV TlvCode 81" and "GenericTLV TlvCode 82" for file import during encoding DOCSIS 3.1 bootfiles. This will help to remove the manual inserting certificates as hex strings to bootfiles as we have now GenericTLV TlvCode 81 TlvLength 254 TlvValue 0x00 ... 00 ;.
It will be good if this will work like certificate import in options ManufacturerCVC and CoSignerCVC.

Please add this feature to "docsis" program.

Fail to encode IPv6 address

If the IPv6 address use IPv4-mapped IPv6 address: ::ffff:a.b.c.d/96
for example: ::ffff:1.2.3.4

It will get syntax error
3:syntax error token .2.3.4
Error parsing config file ddd

Test step:

  1. encode text file to cm ocnfig (::FFFF:102:304 = ::FFFF:1.2.3.3)
    Main
    {
    SwUpgradeServer6 ::FFFF:102:304 ;
    }

The output is
Main
{
SwUpgradeServer6 ::ffff:1.2.3.4;
/* CmMic 3510888c30355a1f3b4211cae90c99b1; /
/
CmtsMic 16ea3fa0d43e1a0914f4ca77061c6770; */
/EndOfDataMkr/
}

  1. Use the output text (or decode the output file to text) to encode again. The error will happen.

Write a test for TLV 23.13

A test should be written for TLV 23.13. This BUG is just a reminder not to forget about it. If someone has time for it, feel free to take it.

CMTS reject with: INVALID_MODEM_CONFIGURATION_SETTING_FORMAT

Dear developers,

I just tried to get a FritzBox Cable 6490 provisioned. The CMTS rejects the config file with:

Nov 9 13:30:26: %UBR7200-4-INVALID_MODEM_CONFIGURATION_SETTING_FORMAT

: <133>CMTS[DOCSIS]:<73011700> Invalid Modem Capabilities configuration setting . CM Mac Addr <xxxx.xxxx.xxxx>

Please check the configfile attached. (just remove the .jpg, it's a bin-file) I'm using a cisco UBR7246 with NPE-G2 and MC88V (System image file is "disk2:ubr7200p-jk9su2-mz.122-33.SCD4.BIN")

thanks
Oliver

avm6490 bin

docsis20_stresstest Test Failure

The docsis20_stresstest is the only test failing for me at the moment.

Debugging with this:

diff --git a/examples/Makefile.am b/examples/Makefile.am
index 9fa000f..2802883 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -46,6 +46,7 @@ EXTRA_DIST = $(examples_DATA)
 			rm -f [email protected] [email protected] ; \
 			true ; \
 		else \
+			diff -u [email protected] [email protected] ; \
 			rm -f $@ [email protected] [email protected] ; \
 			false ; \
 		fi

I get this:

$ make docsis20_stresstest.bin
export MIBDIRS="../mibs:../mibs/iana:../mibs/ietf" ; \
	../src/docsis -e docsis20_stresstest.cfg ./keyfile docsis20_stresstest.bin | \
	sed -n '/^Final content/,$p' | grep -v "^Final content" > docsis20_stresstest.bin.1.txt ; \
	../src/docsis -d docsis20_stresstest.bin > docsis20_stresstest.bin.2.txt ; \
	if cmp docsis20_stresstest.bin.1.txt docsis20_stresstest.bin.2.txt && cmp docsis20_stresstest.txt docsis20_stresstest.bin.2.txt ; then \
		rm -f docsis20_stresstest.bin.1.txt docsis20_stresstest.bin.2.txt ; \
		true ; \
	else \
		diff -u docsis20_stresstest.bin.1.txt docsis20_stresstest.bin.2.txt ; \
		rm -f docsis20_stresstest.bin docsis20_stresstest.bin.1.txt docsis20_stresstest.bin.2.txt ; \
		false ; \
	fi
docsis20_stresstest.bin.1.txt docsis20_stresstest.bin.2.txt differ: byte 12732, line 248
--- docsis20_stresstest.bin.1.txt	2016-11-01 14:06:01.279254714 -0500
+++ docsis20_stresstest.bin.2.txt	2016-11-01 14:06:01.407256201 -0500
@@ -245,5 +245,5 @@
 		ConcatenationSupport 204;
 	}
 	GenericTLV TlvCode 220 TlvLength 173 TlvValue 0x900c95015f66b4fb337408b5cc02de90450fb7d34a4c717430e0170b87356c641a42448297e9ccb76d5b7bbd601ba2fa7703ce3dd4ae038a4f67a5b733d8f1226a452d46950309e0e5a3a70a79ee593858d4d09b8437ab4577149afdccbab17d54a6a84cef9dd57be0c21e5664c2c3bc53836a2f84358cfae1f753a71c6263fc5609458b27728e317e406d6bcae820613d2ec5134b85a4e6ee10b34ec72f2b08663538d4c5cb17cf87e321041d;
-	GenericTLV TlvCode 153 TlvLength 77 TlvValue 0xef12017f0610cedde9cd7a34f366e172cf12f86bb52307104ba4e296c6f9aef93b83ae0dc5a2877cff000000000000000000000000000000000000000000000000000000000000000000000000;
+	GenericTLV TlvCode 153 TlvLength 77 TlvValue 0xef12017f0610cedde9cd7a34f366e172cf12f86bb52307104ba4e296c6f9aef93b83ae0dc5a2877cff0020020000000000006101000000000000c8fc7957027f0000c8fc7957027f0000400200;
 }

comment-in-comment not supportedFirst TLV is MtaConfigDelimiter, forcing PacketCable MTA file

Usually docsis breaks encoding if config file is malformed. According to our resent experience there may be at least one exception.

We got an issue by encoding MTA config file with nested/malformed comments. docsis encrypted our malformed foo.txt with only a complain:
line 6: comment-in-comment not supportedFirst TLV is MtaConfigDelimiter, forcing PacketCable MTA file..

I'm not entirely sure if it's a bug or expected behavior and therefor report it you know.
Below some information could help you to reproduce the issue.
Tested with 6b23fd2

  • foo.txt MTA configuration file
Main
{
  MtaConfigDelimiter 1;

  SnmpMibObject .1.3.6.1.6.3.18.1.1.1.2.1 String "foo12@";    /* malformed comment /
  SnmpMibObject .1.3.6.1.6.3.18.1.1.1.8.1 Integer 4;               /* well-formed comment */

  MtaConfigDelimiter 255;
}
  • encrypt command
    $ ./src/docsis -e foo.txt examples/keyfile foo.cfg

  • decrypt
    $ ./src/docsis -d foo.cfg examples/keyfile

Main 
{
        MtaConfigDelimiter 1;
        SnmpMibObject iso.3.6.1.6.3.18.1.1.1.2.1 String "foo12@";
        MtaConfigDelimiter 255;
}

FrameLossMeasurementTransmissionPeriodicity incorrect data type

All instances of FrameLossMeasurementTransmissionPeriodicity are using ushort but should be uchar. TLVs have a length of "1"

B.3.24.4.2.2 Frame Loss Measurement Transmission Periodicity
This subtype is used to configure the transmission periodicity of the Frame Loss measurement.
SubType Length Value
43.5.24.4.2.2 1 Integer times in milliseconds.
If value is = 0, then FLM test is to be run once.

292c292
< { 442,    "FrameLossMeasurementTransmissionPeriodicity", 2, 440, (encode_uchar),        (decode_uchar),         0,           0             }, /* TLV 22.43.5.24.4.2.2 L2VPN-I13 Annex B.3.24.4.2.2 */
---
> { 442,    "FrameLossMeasurementTransmissionPeriodicity", 2, 440, (encode_ushort),       (decode_ushort),         0,           0             }, /* TLV 22.43.5.24.4.2.2 L2VPN-I13 Annex B.3.24.4.2.2 */
489c489
< { 852,    "FrameLossMeasurementTransmissionPeriodicity", 2, 850, (encode_uchar),       (decode_uchar),         0,           0             }, /* TLV 23.43.5.24.4.2.2 L2VPN-I13 Annex B.3.24.4.2.2 */
---
> { 852,    "FrameLossMeasurementTransmissionPeriodicity", 2, 850, (encode_ushort),       (decode_ushort),         0,           0             }, /* TLV 23.43.5.24.4.2.2 L2VPN-I13 Annex B.3.24.4.2.2 */
659c659
< { 976,    "FrameLossMeasurementTransmissionPeriodicity", 2, 974, (encode_uchar),       (decode_uchar),         0,           0             }, /* TLV 24.43.5.24.4.2.2 L2VPN-I13 Annex B.3.24.4.2.2 */
---
> { 976,    "FrameLossMeasurementTransmissionPeriodicity", 2, 974, (encode_ushort),       (decode_ushort),         0,           0             }, /* TLV 24.43.5.24.4.2.2 L2VPN-I13 Annex B.3.24.4.2.2 */
820c820
< { 1103,   "FrameLossMeasurementTransmissionPeriodicity", 2, 1101, (encode_uchar),      (decode_uchar),         0,           0             }, /* TLV 25.43.5.24.4.2.2 L2VPN-I13 Annex B.3.24.4.2.2 */
---
> { 1103,   "FrameLossMeasurementTransmissionPeriodicity", 2, 1101, (encode_ushort),      (decode_ushort),         0,           0             }, /* TLV 25.43.5.24.4.2.2 L2VPN-I13 Annex B.3.24.4.2.2 */
963c963
< { 1234,   "FrameLossMeasurementTransmissionPeriodicity", 2, 1232, (encode_uchar),      (decode_uchar),         0,           0             }, /* TLV 26.43.5.24.4.2.2 L2VPN-I13 Annex B.3.24.4.2.2 */
---
> { 1234,   "FrameLossMeasurementTransmissionPeriodicity", 2, 1232, (encode_ushort),      (decode_ushort),         0,           0             }, /* TLV 26.43.5.24.4.2.2 L2VPN-I13 Annex B.3.24.4.2.2 */
1128c1128
< { 1384,   "FrameLossMeasurementTransmissionPeriodicity", 2, 1382, (encode_uchar),      (decode_uchar),         0,           0             }, /* TLV 43.5.24.4.2.2 L2VPN-I13 Annex B.3.24.4.2.2 */
---
> { 1384,   "FrameLossMeasurementTransmissionPeriodicity", 2, 1382, (encode_ushort),      (decode_ushort),         0,           0             }, /* TLV 43.5.24.4.2.2 L2VPN-I13 Annex B.3.24.4.2.2 */
1343c1343
< { 706,    "FrameLossMeasurementTransmissionPeriodicity", 2, 704, (encode_uchar),       (decode_uchar),         0,           0             }, /* TLV 60.43.5.24.4.2.2 L2VPN-I13 Annex B.3.24.4.2.2 */
---
> { 706,    "FrameLossMeasurementTransmissionPeriodicity", 2, 704, (encode_ushort),       (decode_ushort),         0,           0             }, /* TLV 60.43.5.24.4.2.2 L2VPN-I13 Annex B.3.24.4.2.2 */

cannot run autogen.sh under Cygwin64

When trying to install in Cygwin64 under Windows7, following error is produced:

/usr/bin/autoconf-2.69: line 255: 8932 Segmentation fault (core dumped) ( eval "$as_required" ) 2> /dev/null

Encode file for negative value

When I encode txt file (Attached file) including value is negative, the bin file will be changed "2's complement".

docsis -p MTA_bin_integer.txt MTA_bin_integer.bin

The OID type should be integer 32 to avoid transfer value is error.

Could you please provide some advice on how to fix it ?

I used tool to check the value when it had been changed bin file.
bin_file

MTA_bin_integer.txt

Unable to compile docsis on Ubuntu 10.04 LTS.

I've installed several dependencies to get docsis to compile, including automake, libglib2.0-dev, snmp... and I still get errors during the "make" stage.

They are as follows:

root@sandbox docsis # make
make all-recursive
make[1]: Entering directory /root/docsis' Making all in src make[2]: Entering directory/root/docsis/src'
gcc -DHAVE_CONFIG_H -I. -I.. -DNETSNMP_ENABLE_IPV6 -g -O2 -DNETSNMP_USE_INLINE -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/perl/5.10/CORE -I. -I/usr/include -Wall -Waggregate-return -Wbad-function-cast -Wcast-align -Wdeclaration-after-statement -Wendif-labels -Werror-implicit-function-declaration -Wextra -Wno-unused-parameter -Wfloat-equal -Wformat-security -Werror=format-security -Winit-self -Wmissing-declarations -Wmissing-noreturn -Wmissing-prototypes -Wpointer-arith -Wundef -g -g -O2 -MT docsis.o -MD -MP -MF .deps/docsis.Tpo -c -o docsis.o docsis.c
docsis.c:34:38: error: net-snmp/net-snmp-config.h: No such file or directory
docsis.c:35:33: error: net-snmp/config_api.h: No such file or directory
docsis.c:36:33: error: net-snmp/output_api.h: No such file or directory
docsis.c:37:30: error: net-snmp/mib_api.h: No such file or directory
docsis.c: In function ‘main’:
docsis.c:290: error: implicit declaration of function ‘shutdown_mib’
docsis.c: In function ‘setup_mib_flags’:
docsis.c:404: error: implicit declaration of function ‘init_mib’
docsis.c:406: error: implicit declaration of function ‘netsnmp_ds_get_boolean’
docsis.c:406: error: ‘NETSNMP_DS_LIBRARY_ID’ undeclared (first use in this function)
docsis.c:406: error: (Each undeclared identifier is reported only once
docsis.c:406: error: for each function it appears in.)
docsis.c:406: error: ‘NETSNMP_DS_LIB_PRINT_NUMERIC_OIDS’ undeclared (first use in this function)
docsis.c:408: error: implicit declaration of function ‘netsnmp_ds_toggle_boolean’
docsis.c:412: error: ‘NETSNMP_DS_LIB_PRINT_NUMERIC_ENUM’ undeclared (first use in this function)
docsis.c:418: error: ‘NETSNMP_DS_LIB_PRINT_FULL_OID’ undeclared (first use in this function)
docsis.c:424: error: ‘NETSNMP_DS_LIB_DONT_PRINT_UNITS’ undeclared (first use in this function)
docsis.c:430: error: ‘NETSNMP_DS_LIB_RANDOM_ACCESS’ undeclared (first use in this function)
docsis.c:436: error: ‘NETSNMP_DS_LIB_NUMERIC_TIMETICKS’ undeclared (first use in this function)
make[2]: *** [docsis.o] Error 1
make[2]: Leaving directory /root/docsis/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/root/docsis'
make: *** [all] Error 2

Is there something that I'm missing? Another dependency, perhaps?

Release a new version

Hello, I'm a developer with the MacPorts package management system. We were recently asked to add docsis 0.9.6 to MacPorts, which I've now done. The build failed for two different reasons. These problems have apparently been fixed in your repository years ago, but were never released, so I had to find the fixes and backport them to 0.9.6. Perhaps you could release a new version of docsis?

[TODO] OCHD2.1 support for TLV 53

It is defined in OC-SP-HOST2.1-CFR-I17

TLV Number Name Chapter
53 SNMPv1v2cCoexistenceConfiguration 15.2.1
53.1 SNMPv1v2cCommunityName 15.2.1.1
53.2 SNMPv1v2cTransportAddressAccess 15.2.1.2
53.2.1 SNMPv1v2cTransportAddress 15.2.1.2.1
53.2.2 SNMPv1v2cTransportAddressMask 15.2.1.2.2
53.3 SNMPv1v2cAccessViewType 15.2.1.3
53.4 SNMPv1v2cAccessViewName 15.2.1.4

A test case should also be written.

TLV81 encoding issue. DOCSIS 3.1 SSD

"docsis_symtable.h" has TLV81 as "encode_nothing". It should be able to encode it just fine as a hex string. TLV82 is set to encode as hex.

M-CVC: config file contains a Manufacturer CVC (TLV 32)
Co-CVC: config file contains a Cosigner CVC (TLV 33)
M-chain: config file contains a Manufacturer CVC-chain (TLV 81)
Co-chain: config file contains a Cosigner CVC-chain (TLV 82)

32/33 are for legacy modems (DOCSIS 1.x,2.0 & 3.0). For DOCSIS 3.1 a chain of certs is required (TLV81/82) rather than just the MfgCVCData.

The firmware I have is not co-signed so I need to be able to encode TLV81.

Jeff

PacketCable 2.0 dialplan OID (CL-PKTC-EUE-RST-MIB::pktcEUERSTDMValue)

I believe the docsis compiler is using wrong OID for the PacketCable 2.0 dialplan

Should be
CL-PKTC-EUE-RST-MIB::pktcEUERSTDMValue.1 (.1.3.6.1.4.1.4491.2.2.8.2.1.1.3.1.1.2.1)
rather than
CL-PKTC-EUE-RST-MIB::pktcEUERSTDMValue.0 (.1.3.6.1.4.1.4491.2.2.8.2.1.1.3.1.1.2.0)

I believe the fix is docsis.c, line 226 :

Should be :
memcpy(tlvbuf + tlvbuflen, "\x06\x12\x2b\x06\x01\x04\x01\xa3\x0b\x02\x02\x08\x02\x01\x01\x03\x01\x01\x02\x01", 20);

Rather than :
memcpy(tlvbuf + tlvbuflen, "\x06\x12\x2b\x06\x01\x04\x01\xa3\x0b\x02\x02\x08\x02\x01\x01\x03\x01\x01\x02\x00", 20);

Decode bootfiles with numeric OIDs is not working (option “-o”)

I tried to decode my bootfiles in docsis 098-dev with option “-o” and don't see numeric OIDs on outputs. I always see OID names.

$ docsis098 -d test.bin
Main
{
NetworkAccess 1;
SnmpMibObject docsDevEvControl.0 Integer 1; /* resetLog /
SnmpMibObject ifAdminStatus.1 Integer 1; /
up /
$
$ docsis098 -o -d test.bin
Main
{
NetworkAccess 1;
SnmpMibObject docsDevEvControl.0 Integer 1; /
resetLog /
SnmpMibObject ifAdminStatus.1 Integer 1; /
up */
$

Please fix the issue with decoding bootfiles with numeric OIDs.

Automake uses Obsolete Macros (in autogen.sh)

There is suggested to use -Wobsolete option while running the autoconf, automake, autoreconf, ... if you want to see relevant warnings. Also consider running autopoint but be careful when you are trying to prepare package for older distributions with not perfectly up2date tools.

[TODO] OCHD2.1 support for TLV 40

It is defined in OC-SP-HOST2.1-CFR-I17

TLV Number Name Chapter
40 SEBServerEnableTLSCipherSuites 15.2.8

A test case should also be written.

Backslash issue

I am now using docsis version 0.9.9-dev. It doesn't support a backslash() is using directory delimiter for Windows tftp server.
For example, I would like to use as below,
Main
{
SwUpgradeFilename "cisco\cm-v2.0.0.bin";
}

However, the backslash has translated a blank space. The following is result.
Main
{
SwUpgradeFilename "cisco cm-v2.0.0.bin";
}

Is there any idea to use it for Windows tftp server?

Trying to compile on cygwin and get "undefined reference errors"

Can someone please help me out. I am trying to compile on cygwin and I keep getting the following errors.

docsis.o: In function encode_one_file': /cygdrive/c/brett_docsis/docsis/src/docsis.c:340: undefined reference to__stack_chk_guard'
/cygdrive/c/brett_docsis/docsis/src/docsis.c:405: undefined reference to __stack_chk_guard' /cygdrive/c/brett_docsis/docsis/src/docsis.c:405: undefined reference to__stack_chk_fail'
docsis.o: In function main': /cygdrive/c/brett_docsis/docsis/src/docsis.c:177: undefined reference to__stack_chk_guard'
/cygdrive/c/brett_docsis/docsis/src/docsis.c:336: undefined reference to __stack_chk_guard' /cygdrive/c/brett_docsis/docsis/src/docsis.c:336: undefined reference to__stack_chk_fail'
docsis_encode.o: In function encode_ip6': /cygdrive/c/brett_docsis/docsis/src/docsis_encode.c:211: undefined reference to__stack_chk_guard'
/cygdrive/c/brett_docsis/docsis/src/docsis_encode.c:237: undefined reference to __stack_chk_guard' /cygdrive/c/brett_docsis/docsis/src/docsis_encode.c:237: undefined reference to__stack_chk_fail'
docsis_encode.o: In function encode_ip6_list': /cygdrive/c/brett_docsis/docsis/src/docsis_encode.c:240: undefined reference to__stack_chk_guard'
/cygdrive/c/brett_docsis/docsis/src/docsis_encode.c:265: undefined reference to __stack_chk_guard' /cygdrive/c/brett_docsis/docsis/src/docsis_encode.c:265: undefined reference to__stack_chk_fail'
docsis_encode.o: In function encode_ip6_prefix_list': /cygdrive/c/brett_docsis/docsis/src/docsis_encode.c:268: undefined reference to__stack_chk_guard'
/cygdrive/c/brett_docsis/docsis/src/docsis_encode.c:299: undefined reference to __stack_chk_guard' /cygdrive/c/brett_docsis/docsis/src/docsis_encode.c:299: undefined reference to__stack_chk_fail'
docsis_encode.o: In function encode_ip_ip6': /cygdrive/c/brett_docsis/docsis/src/docsis_encode.c:302: undefined reference to__stack_chk_guard'
/cygdrive/c/brett_docsis/docsis/src/docsis_encode.c:321: undefined reference to __stack_chk_guard' /cygdrive/c/brett_docsis/docsis/src/docsis_encode.c:321: undefined reference to__stack_chk_fail'
docsis_encode.o: In function encode_char_ip_ip6': /cygdrive/c/brett_docsis/docsis/src/docsis_encode.c:324: undefined reference to__stack_chk_guard'
/cygdrive/c/brett_docsis/docsis/src/docsis_encode.c:348: undefined reference to __stack_chk_guard' /cygdrive/c/brett_docsis/docsis/src/docsis_encode.c:348: undefined reference to__stack_chk_fail'
docsis_encode.o: In function encode_ip_ip6_port': /cygdrive/c/brett_docsis/docsis/src/docsis_encode.c:351: undefined reference to__stack_chk_guard'
/cygdrive/c/brett_docsis/docsis/src/docsis_encode.c:387: undefined reference to __stack_chk_guard' /cygdrive/c/brett_docsis/docsis/src/docsis_encode.c:387: undefined reference to__stack_chk_fail'
docsis_decode.o: In function decode_ip6': /cygdrive/c/brett_docsis/docsis/src/docsis_decode.c:121: undefined reference to__stack_chk_guard'
/cygdrive/c/brett_docsis/docsis/src/docsis_decode.c:132: undefined reference to __stack_chk_guard' /cygdrive/c/brett_docsis/docsis/src/docsis_decode.c:132: undefined reference to__stack_chk_fail'
docsis_decode.o: In function decode_ip6_list': /cygdrive/c/brett_docsis/docsis/src/docsis_decode.c:135: undefined reference to__stack_chk_guard'
/cygdrive/c/brett_docsis/docsis/src/docsis_decode.c:148: undefined reference to __stack_chk_guard' /cygdrive/c/brett_docsis/docsis/src/docsis_decode.c:148: undefined reference to__stack_chk_fail'
docsis_decode.o: In function decode_ip6_prefix_list': /cygdrive/c/brett_docsis/docsis/src/docsis_decode.c:151: undefined reference to__stack_chk_guard'
/cygdrive/c/brett_docsis/docsis/src/docsis_decode.c:163: undefined reference to __stack_chk_guard' /cygdrive/c/brett_docsis/docsis/src/docsis_decode.c:163: undefined reference to__stack_chk_fail'
docsis_decode.o: In function decode_ip_ip6': /cygdrive/c/brett_docsis/docsis/src/docsis_decode.c:166: undefined reference to__stack_chk_guard'
/cygdrive/c/brett_docsis/docsis/src/docsis_decode.c:178: undefined reference to __stack_chk_guard' /cygdrive/c/brett_docsis/docsis/src/docsis_decode.c:178: undefined reference to__stack_chk_fail'
docsis_decode.o: In function decode_char_ip_ip6': /cygdrive/c/brett_docsis/docsis/src/docsis_decode.c:181: undefined reference to__stack_chk_guard'
/cygdrive/c/brett_docsis/docsis/src/docsis_decode.c:193: undefined reference to __stack_chk_guard' /cygdrive/c/brett_docsis/docsis/src/docsis_decode.c:193: undefined reference to__stack_chk_fail'
docsis_decode.o: In function decode_ip_ip6_port': /cygdrive/c/brett_docsis/docsis/src/docsis_decode.c:196: undefined reference to__stack_chk_guard'
/cygdrive/c/brett_docsis/docsis/src/docsis_decode.c:208: undefined reference to __stack_chk_guard' /cygdrive/c/brett_docsis/docsis/src/docsis_decode.c:208: undefined reference to__stack_chk_fail'
docsis_decode.o: In function decode_unknown': /cygdrive/c/brett_docsis/docsis/src/docsis_decode.c:372: undefined reference to__stack_chk_guard'
/cygdrive/c/brett_docsis/docsis/src/docsis_decode.c:405: undefined reference to __stack_chk_guard' /cygdrive/c/brett_docsis/docsis/src/docsis_decode.c:405: undefined reference to__stack_chk_fail'
docsis_snmp.o: In function decode_vbind': /cygdrive/c/brett_docsis/docsis/src/docsis_snmp.c:283: undefined reference to__stack_chk_guard'
/cygdrive/c/brett_docsis/docsis/src/docsis_snmp.c:626: undefined reference to __stack_chk_guard' /cygdrive/c/brett_docsis/docsis/src/docsis_snmp.c:626: undefined reference to__stack_chk_fail'
docsis_snmp.o: In function encode_vbind': /cygdrive/c/brett_docsis/docsis/src/docsis_snmp.c:34: undefined reference to__stack_chk_guard'
/cygdrive/c/brett_docsis/docsis/src/docsis_snmp.c:278: undefined reference to __stack_chk_guard' /cygdrive/c/brett_docsis/docsis/src/docsis_snmp.c:278: undefined reference to__stack_chk_fail'
docsis_yy.o: In function create_external_file_tlv': /cygdrive/c/brett_docsis/docsis/src/docsis_yy.y:426: undefined reference to__stack_chk_guard'
/cygdrive/c/brett_docsis/docsis/src/docsis_yy.y:457: undefined reference to __stack_chk_guard' /cygdrive/c/brett_docsis/docsis/src/docsis_yy.y:457: undefined reference to__stack_chk_fail'
hmac_md5.o: In function hmac_md5': /cygdrive/c/brett_docsis/docsis/src/hmac_md5.c:57: undefined reference to__stack_chk_guard'
/cygdrive/c/brett_docsis/docsis/src/hmac_md5.c:122: undefined reference to __stack_chk_guard' /cygdrive/c/brett_docsis/docsis/src/hmac_md5.c:122: undefined reference to__stack_chk_fail'
collect2: error: ld returned 1 exit status
Makefile:415: recipe for target 'docsis.exe' failed
make[2]: *** [docsis.exe] Error 1
make[2]: Leaving directory '/cygdrive/c/brett_docsis/docsis/src'
Makefile:473: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/cygdrive/c/brett_docsis/docsis'
Makefile:367: recipe for target 'all' failed
make: *** [all] Error 2

Regards,

Will

[TODO] OCHD2.1 support for TLV 39

It is defined in OC-SP-HOST2.1-CFR-I17

TLV Number Name Chapter
39 HomeNetworkPrefixValidation 15.2.9
39.1 InstanceNumber 15.2.9.1
39.2 PrefixUsage 15.2.9.2
39.3 IPAddressVersion 15.2.9.3
39.4 IPv4PrefixLength 15.2.9.4
39.5 IPv4SubnetAddress 15.2.9.5
39.6 IPV6PrefixLength 15.2.9.6
39.7 IPv6NetworkAddress 15.2.9.7

A test case should also be written.

Warning when compiled under Cygwin

When compiling under Cygwin on Windows 7, following warning is generated:

./.libs/lt-docsis.c: In function 'lt_fatal':
./.libs/lt-docsis.c:593:1: warning: function might be candidate for attribute 'noreturn' [-Wsuggest-attribute=noreturn]
lt_fatal (const char *file, int line, const char *message, ...)
^

compile errors on centos 5.11

some errors occur while try to compile on centos 5.11 after commit 1e9378c

openssl related errors are gone after installing openssl-devel package
yum install -y openssl-devel
pls. update documentation.

however, I'm unable to compile it due to following errors:

docsis_lex.c:8486:5: warning: "YY_STACK_USED" is not defined
docsis_lex.c: In function ‘yylex’:
docsis_lex.l:164: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
docsis_lex.c:9642:5: warning: "YY_ALWAYS_INTERACTIVE" is not defined
docsis_lex.c:9645:5: warning: "YY_NEVER_INTERACTIVE" is not defined
docsis_lex.c:9936:5: warning: "YY_MAIN" is not defined
docsis_lex.c: In function ‘yy_fatal_error’:
docsis_lex.c:9840: warning: function might be possible candidate for attribute ‘noreturn’
docsis.o: In function `main':
/mnt/git/docsis/src/docsis.c:303: multiple definition of `main'
/usr/lib64/libfl.a(libmain.o):(.text+0x0): first defined here
/usr/bin/ld: Warning: size of symbol `main' changed from 20 in /usr/lib64/libfl.a(libmain.o) to 2007 in docsis.o
collect2: ld returned 1 exit status
make[2]: *** [docsis] Error 1
make[2]: Leaving directory `/mnt/git/docsis/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/mnt/git/docsis'
make: *** [all] Error 2

full output:

# make
make  all-recursive
make[1]: Entering directory `/mnt/git/docsis'
Making all in src
make[2]: Entering directory `/mnt/git/docsis/src'
if gcc -DHAVE_CONFIG_H -I. -I. -I..   -DINET6 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -g -lcrypto -DNETSNMP_NO_INLINE -Dlinux -I/usr/include/rpm -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -I. -I/usr/include/net-snmp   -Wall  -Waggregate-return -Wbad-function-cast -Wcast-align -Wdeclaration-after-statement -Wendif-labels -Werror-implicit-function-declaration -Wextra -Wno-unused-parameter -Wfloat-equal -Wformat-security -Winit-self -Wmissing-declarations -Wmissing-noreturn -Wmissing-prototypes -Wpointer-arith -Wundef -g -g -O2 -MT docsis.o -MD -MP -MF ".deps/docsis.Tpo" -c -o docsis.o docsis.c; \
    then mv -f ".deps/docsis.Tpo" ".deps/docsis.Po"; else rm -f ".deps/docsis.Tpo"; exit 1; fi
gcc: -lcrypto: linker input file unused because linking not done
if gcc -DHAVE_CONFIG_H -I. -I. -I..   -DINET6 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -g -lcrypto -DNETSNMP_NO_INLINE -Dlinux -I/usr/include/rpm -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -I. -I/usr/include/net-snmp   -Wall  -Waggregate-return -Wbad-function-cast -Wcast-align -Wdeclaration-after-statement -Wendif-labels -Werror-implicit-function-declaration -Wextra -Wno-unused-parameter -Wfloat-equal -Wformat-security -Winit-self -Wmissing-declarations -Wmissing-noreturn -Wmissing-prototypes -Wpointer-arith -Wundef -g -g -O2 -MT ethermac.o -MD -MP -MF ".deps/ethermac.Tpo" -c -o ethermac.o ethermac.c; \
    then mv -f ".deps/ethermac.Tpo" ".deps/ethermac.Po"; else rm -f ".deps/ethermac.Tpo"; exit 1; fi
gcc: -lcrypto: linker input file unused because linking not done
if gcc -DHAVE_CONFIG_H -I. -I. -I..   -DINET6 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -g -lcrypto -DNETSNMP_NO_INLINE -Dlinux -I/usr/include/rpm -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -I. -I/usr/include/net-snmp   -Wall  -Waggregate-return -Wbad-function-cast -Wcast-align -Wdeclaration-after-statement -Wendif-labels -Werror-implicit-function-declaration -Wextra -Wno-unused-parameter -Wfloat-equal -Wformat-security -Winit-self -Wmissing-declarations -Wmissing-noreturn -Wmissing-prototypes -Wpointer-arith -Wundef -g -g -O2 -MT md5.o -MD -MP -MF ".deps/md5.Tpo" -c -o md5.o md5.c; \
    then mv -f ".deps/md5.Tpo" ".deps/md5.Po"; else rm -f ".deps/md5.Tpo"; exit 1; fi
gcc: -lcrypto: linker input file unused because linking not done
if gcc -DHAVE_CONFIG_H -I. -I. -I..   -DINET6 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -g -lcrypto -DNETSNMP_NO_INLINE -Dlinux -I/usr/include/rpm -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -I. -I/usr/include/net-snmp   -Wall  -Waggregate-return -Wbad-function-cast -Wcast-align -Wdeclaration-after-statement -Wendif-labels -Werror-implicit-function-declaration -Wextra -Wno-unused-parameter -Wfloat-equal -Wformat-security -Winit-self -Wmissing-declarations -Wmissing-noreturn -Wmissing-prototypes -Wpointer-arith -Wundef -g -g -O2 -MT docsis_encode.o -MD -MP -MF ".deps/docsis_encode.Tpo" -c -o docsis_encode.o docsis_encode.c; \
    then mv -f ".deps/docsis_encode.Tpo" ".deps/docsis_encode.Po"; else rm -f ".deps/docsis_encode.Tpo"; exit 1; fi
gcc: -lcrypto: linker input file unused because linking not done
if gcc -DHAVE_CONFIG_H -I. -I. -I..   -DINET6 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -g -lcrypto -DNETSNMP_NO_INLINE -Dlinux -I/usr/include/rpm -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -I. -I/usr/include/net-snmp   -Wall  -Waggregate-return -Wbad-function-cast -Wcast-align -Wdeclaration-after-statement -Wendif-labels -Werror-implicit-function-declaration -Wextra -Wno-unused-parameter -Wfloat-equal -Wformat-security -Winit-self -Wmissing-declarations -Wmissing-noreturn -Wmissing-prototypes -Wpointer-arith -Wundef -g -g -O2 -MT docsis_decode.o -MD -MP -MF ".deps/docsis_decode.Tpo" -c -o docsis_decode.o docsis_decode.c; \
    then mv -f ".deps/docsis_decode.Tpo" ".deps/docsis_decode.Po"; else rm -f ".deps/docsis_decode.Tpo"; exit 1; fi
docsis_decode.c: In function ‘decode_snmp_object’:
docsis_decode.c:346: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
docsis_decode.c:351: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
docsis_decode.c:353: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
gcc: -lcrypto: linker input file unused because linking not done
if gcc -DHAVE_CONFIG_H -I. -I. -I..   -DINET6 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -g -lcrypto -DNETSNMP_NO_INLINE -Dlinux -I/usr/include/rpm -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -I. -I/usr/include/net-snmp   -Wall  -Waggregate-return -Wbad-function-cast -Wcast-align -Wdeclaration-after-statement -Wendif-labels -Werror-implicit-function-declaration -Wextra -Wno-unused-parameter -Wfloat-equal -Wformat-security -Winit-self -Wmissing-declarations -Wmissing-noreturn -Wmissing-prototypes -Wpointer-arith -Wundef -g -g -O2 -MT docsis_snmp.o -MD -MP -MF ".deps/docsis_snmp.Tpo" -c -o docsis_snmp.o docsis_snmp.c; \
    then mv -f ".deps/docsis_snmp.Tpo" ".deps/docsis_snmp.Po"; else rm -f ".deps/docsis_snmp.Tpo"; exit 1; fi
gcc: -lcrypto: linker input file unused because linking not done
/usr/bin/bison -t -d -y   docsis_yy.y
if test -f y.tab.h; then \
      to=`echo "docsis_yy_H" | sed \
                -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
                -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \
      sed -e "/^#/!b" -e "s/Y_TAB_H/$to/g" -e "s|y\.tab\.h|docsis_yy.h|" \
            y.tab.h >docsis_yy.ht; \
      rm -f y.tab.h; \
      if cmp -s docsis_yy.ht docsis_yy.h; then \
        rm -f docsis_yy.ht ;\
      else \
        mv docsis_yy.ht docsis_yy.h; \
      fi; \
    fi
if test -f y.output; then \
      mv y.output docsis_yy.output; \
    fi
sed '/^#/ s|y\.tab\.c|docsis_yy.c|' y.tab.c >docsis_yy.ct && mv docsis_yy.ct docsis_yy.c
rm -f y.tab.c
if gcc -DHAVE_CONFIG_H -I. -I. -I..   -DINET6 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -g -lcrypto -DNETSNMP_NO_INLINE -Dlinux -I/usr/include/rpm -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -I. -I/usr/include/net-snmp   -Wall  -Waggregate-return -Wbad-function-cast -Wcast-align -Wdeclaration-after-statement -Wendif-labels -Werror-implicit-function-declaration -Wextra -Wno-unused-parameter -Wfloat-equal -Wformat-security -Winit-self -Wmissing-declarations -Wmissing-noreturn -Wmissing-prototypes -Wpointer-arith -Wundef -g -g -O2 -MT docsis_yy.o -MD -MP -MF ".deps/docsis_yy.Tpo" -c -o docsis_yy.o docsis_yy.c; \
    then mv -f ".deps/docsis_yy.Tpo" ".deps/docsis_yy.Po"; else rm -f ".deps/docsis_yy.Tpo"; exit 1; fi
docsis_yy.c:285:6: warning: "YYENABLE_NLS" is not defined
docsis_yy.c:791:6: warning: "YYLTYPE_IS_TRIVIAL" is not defined
gcc: -lcrypto: linker input file unused because linking not done
flex   docsis_lex.l
sed '/^#/ s|lex.yy\.c|docsis_lex.c|' lex.yy.c >docsis_lex.c
rm -f lex.yy.c
if gcc -DHAVE_CONFIG_H -I. -I. -I..   -DINET6 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -g -lcrypto -DNETSNMP_NO_INLINE -Dlinux -I/usr/include/rpm -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -I. -I/usr/include/net-snmp   -Wall  -Waggregate-return -Wbad-function-cast -Wcast-align -Wdeclaration-after-statement -Wendif-labels -Werror-implicit-function-declaration -Wextra -Wno-unused-parameter -Wfloat-equal -Wformat-security -Winit-self -Wmissing-declarations -Wmissing-noreturn -Wmissing-prototypes -Wpointer-arith -Wundef -g -g -O2 -MT docsis_lex.o -MD -MP -MF ".deps/docsis_lex.Tpo" -c -o docsis_lex.o docsis_lex.c; \
    then mv -f ".deps/docsis_lex.Tpo" ".deps/docsis_lex.Po"; else rm -f ".deps/docsis_lex.Tpo"; exit 1; fi
docsis_lex.c:8486:5: warning: "YY_STACK_USED" is not defined
docsis_lex.c: In function ‘yylex’:
docsis_lex.l:164: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
docsis_lex.c:9642:5: warning: "YY_ALWAYS_INTERACTIVE" is not defined
docsis_lex.c:9645:5: warning: "YY_NEVER_INTERACTIVE" is not defined
docsis_lex.c:9936:5: warning: "YY_MAIN" is not defined
docsis_lex.c: In function ‘yy_fatal_error’:
docsis_lex.c:9840: warning: function might be possible candidate for attribute ‘noreturn’
gcc: -lcrypto: linker input file unused because linking not done
if gcc -DHAVE_CONFIG_H -I. -I. -I..   -DINET6 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -g -lcrypto -DNETSNMP_NO_INLINE -Dlinux -I/usr/include/rpm -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -I. -I/usr/include/net-snmp   -Wall  -Waggregate-return -Wbad-function-cast -Wcast-align -Wdeclaration-after-statement -Wendif-labels -Werror-implicit-function-declaration -Wextra -Wno-unused-parameter -Wfloat-equal -Wformat-security -Winit-self -Wmissing-declarations -Wmissing-noreturn -Wmissing-prototypes -Wpointer-arith -Wundef -g -g -O2 -MT hmac_md5.o -MD -MP -MF ".deps/hmac_md5.Tpo" -c -o hmac_md5.o hmac_md5.c; \
    then mv -f ".deps/hmac_md5.Tpo" ".deps/hmac_md5.Po"; else rm -f ".deps/hmac_md5.Tpo"; exit 1; fi
gcc: -lcrypto: linker input file unused because linking not done
gcc  -Wall  -Waggregate-return -Wbad-function-cast -Wcast-align -Wdeclaration-after-statement -Wendif-labels -Werror-implicit-function-declaration -Wextra -Wno-unused-parameter -Wfloat-equal -Wformat-security -Winit-self -Wmissing-declarations -Wmissing-noreturn -Wmissing-prototypes -Wpointer-arith -Wundef -g -g -O2   -o docsis  -L/usr/lib64 -L/usr/lib64 -lnetsnmp -lcrypto -lm -L/usr/lib64/lib -lwrap -lfl  docsis.o ethermac.o md5.o docsis_encode.o docsis_decode.o docsis_snmp.o docsis_yy.o docsis_lex.o hmac_md5.o  -lresolv 
docsis.o: In function `main':
/mnt/git/docsis/src/docsis.c:303: multiple definition of `main'
/usr/lib64/libfl.a(libmain.o):(.text+0x0): first defined here
/usr/bin/ld: Warning: size of symbol `main' changed from 20 in /usr/lib64/libfl.a(libmain.o) to 2007 in docsis.o
collect2: ld returned 1 exit status
make[2]: *** [docsis] Error 1
make[2]: Leaving directory `/mnt/git/docsis/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/mnt/git/docsis'
make: *** [all] Error 2

thanks for the support !

resolve_oids and NETSNMP_OID_OUTPUT_NUMERIC

the CLI parsing code in main() sets resolve_oids to zero and then calls netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_OID_OUTPUT_NUMERIC) to force the snmp libs to output in numeric format. This netsnmp call should be moved to setup_mib_flags(), where all the other snmp flags are set.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.