Giter Site home page Giter Site logo

Comments (5)

kellyjonbrazil avatar kellyjonbrazil commented on May 27, 2024

Thank you for reporting this! I'll try the change and make sure it doesn't break any tests.

from jc.

kellyjonbrazil avatar kellyjonbrazil commented on May 27, 2024

I updated the iptables parser in the dev branch:

https://github.com/kellyjonbrazil/jc/blob/dev/jc/parsers/iptables.py

You can test by copy/pasting the file into your parser plugin folder:

  • Linux/unix: $HOME/.local/share/jc/jcparsers
  • macOS: $HOME/Library/Application Support/jc/jcparsers
  • Windows: $LOCALAPPDATA\jc\jc\jcparsers

from jc.

IsmaelSF avatar IsmaelSF commented on May 27, 2024

I was doing some additional tests with very large counters that I found in one of my systems and seems that one additional character is needed in the condition "<=3" .

Looking directly to iptables source code confirm it:

        if (!(format & FMT_NOCOUNTS)) {
                if (format & FMT_KILOMEGAGIGA) {
                        printf(FMT("%5s ","%s "), "pkts");
                        printf(FMT("%5s ","%s "), "bytes");
                } else {
                        printf(FMT("%8s ","%s "), "pkts");
                        printf(FMT("%10s ","%s "), "bytes");
                }
        }

If you want to update the test case:

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
    pkts      bytes target     prot opt in     out     source               destination
11291792498 217331852907122 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
  555958 33533576 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0
128628404869 172804745659762 INPUT_direct  all  --  *      *       0.0.0.0/0            0.0.0.0/0
128627559128 172804718596050 INPUT_ZONES_SOURCE  all  --  *      *       0.0.0.0/0            0.0.0.0/0
128627559125 172804718595966 INPUT_ZONES  all  --  *      *       0.0.0.0/0            0.0.0.0/0
   26599  1082920 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0            ctstate INVALID
    1761    79571 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

And one additional minor change, update parser docs to include "-x" as supported.

from jc.

kellyjonbrazil avatar kellyjonbrazil commented on May 27, 2024

Thanks - I figured that might be the case. 😄 I'll update the parser and tests.

from jc.

kellyjonbrazil avatar kellyjonbrazil commented on May 27, 2024

Added in v1.25.2

from jc.

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.