Git Product home page Git Product logo

Comments (6)

kriip avatar kriip commented on September 28, 2024

This patch caused warnings when compiling:

In file included from docsis.c:42:
docsis_symtable.h:1480:1: warning: excess elements in array initializer
 { 237,    "SNMPv3AccessViewType",              4,      233,    (encode_uchar),          (decode_uchar),          1,           2             }, /* TLV 202.54.4 eRouter-I12 Annex B.4.6.4 */
 ^
docsis_symtable.h:1480:1: note: (near initialization for 'symtable')
docsis_symtable.h:1485:1: warning: excess elements in array initializer
 { 998,    "GenericTLV",                        0,      0,      (encode_nothing),        (decode_special),        0,           0             },
 ^
docsis_symtable.h:1485:1: note: (near initialization for 'symtable')
docsis_symtable.h:1487:1: warning: excess elements in array initializer
 { 157,    "MtaConfigDelimiter",                254,    0,      (encode_uchar),          (decode_uchar),          1,           255           }, /* TLV 254 PKT-SP-PROV1.5-I04 Chapter 9.1 */
 ^
docsis_symtable.h:1487:1: note: (near initialization for 'symtable')
docsis_symtable.h:1488:1: warning: excess elements in array initializer
 { 999,    "/*EndOfDataMkr*/",                  255,    0,      (encode_nothing),        (decode_special),        0,           0             }  /* TLV 255 MULPIv3.0-I24 Annex C.1.2.1 */
 ^
docsis_symtable.h:1488:1: note: (near initialization for 'symtable')

I think NUM_IDENTIFIERS in docsis_common.h must be incremented with 4 (clean compile with this change)

from docsis.

Sicarius128 avatar Sicarius128 commented on September 28, 2024

Hmm, odd. I didn't have to increment it myself and was able to compile it.

~/src/docsis/src$ grep "define NUM_IDENTIFIERS"  docsis_common.h
#define NUM_IDENTIFIERS 1427

However, when checking the identifiers, there are more than that number:

~/src/docsis/src$ grep encode_ docsis_symtable.h | grep "[{]"  | awk '{print $2}' | wc -l
1431

So, my 4 additions would put it over the max.

However, some of those are duplicates.

~/src/docsis/src$ grep encode_ docsis_symtable.h | grep "[{]"  | awk '{print $2}' | sort -n | uniq | wc -l
1424
~/src/docsis/src$ grep encode_ docsis_symtable.h | grep "[{]"  | awk '{print $2}' | sort -n | uniq -c | sort -n | grep -v "      1"
      2 227,
      2 239,
      2 254,
      2 340,
      2 378,
      2 998,
      2 999,

It's possible they're getting optimized out when I'm compiling it.
It's likely those need to get de-duplicated as they will probably be causing other issues.

from docsis.

kriip avatar kriip commented on September 28, 2024

@Sicarius128 Thank you for fast reply, and thank you for your patch :)

Just for the record, it did compile successfully without tweaking NUM_IDENTIFIERS, but there was the before mentioned warning with excess elements. I did not test the binary compiled with warnings.

The build platform i use is Docker "php:8-apache-buster" with following extra packages installed:
iproute2 net-tools iputils-ping unzip automake libtool libsnmp-dev bison make gcc flex libglib2.0-dev libfl-dev

I did test docsis-files compiled with your patch + NUM_IDENTIFIERS incremented, and it seems to work just fine, the modems accept the docsis-files and TLV84 signaling seems to work just fine

from docsis.

prushik avatar prushik commented on September 28, 2024

This patch compiles without incrementing NUM_IDENTIFIERS, however, it causes some problems at runtime. Specifically, it causes an extra malformed TLV to appear at the end of decoded binaries:
GenericTLV TlvCode 255 TlvLength 0 TlvValue 0x;
When NUM_IDENTIFIERS is incremented, however, everything appears to work correctly.

from docsis.

rlaager avatar rlaager commented on September 28, 2024

I merged this.

Usual disclaimer: I am just doing a "rescue maintainer" job here. I do not use this software any more.

from docsis.

rlaager avatar rlaager commented on September 28, 2024

Thanks @Sicarius128 @kriip @prushik !

from docsis.

Related Issues (20)

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.