Skip to content
Snippets Groups Projects

change net.list() output format

Merged Tomas Krizek requested to merge netlist into master
All threads resolved!

Closes #448 (closed)

Edited by Vladimír Čunát

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Proposed format of the output:

    [1] => {
        [application] => {
            [protocol] => dns
        }
        [ip] => 127.0.0.1
        [transport] => {
            [protocol] => tcp
            [security] => tls
            [port] => 853
        }
    }
  • Tomas Krizek added 1 commit

    added 1 commit

    • decdebcb - daemon/bindings/net: change output format of net.list()

    Compare with previous version

  • By default, when listening on both IPv4 and IPv6 using UDP, TCP and TLS, this produces a lot of output. Adding something like net.summary() might be reasonable.

  • Implementation nitpick: s/lua_pushstring/lua_pushliteral/g docs

  • If it's too verbose, maybe we could cut it down a little? I might be over-engineering this :-) I wonder whether splitting protocol and security really helps. Lemme test it with variants that come into mind:

    description protocol security comment
    DNS over UDP udp none :ballot_box_with_check:
    DNS over TCP tcp none :ballot_box_with_check:
    DNS over TLS tcp tls :ballot_box_with_check:
    DNS over DTLS udp tls seems to fit the scheme perfectly
    DNS over HTTPS tcp* tls* so our fields won't differ from DoT? (except for port, but that seems mostly orthogonal property to me) Or would that be differentiated by .application.protocol = "http+dns" or something? [*] assuming HTTP < 3 – with =3 it might be udp+quic, probably.
    DNSCrypt udp dnscrypt? sounds OK
    DNS over QUIC (directly) udp quic? sounds OK

    ... so altogether it does seem to fit, except for those DoH considerations.

    Maybe .application.protocol could be collapsed to .app_protocol, unless we can anticipate adding some other member in future. It would save two lines, but not a big deal.

    Edited by Vladimír Čunát
  • More importantly, there's a problem in this MR's current model.

    $ kresd -a ::1#5353
    > net.list()
    [1] => {
        [application] => {
            [protocol] => dns
        }
        [ip] => ::1
        [transport] => {
            [protocol] => udp
            [security] => none
            [port] => 5353
        }
    }

    ... but it listens both on UDP and TCP on that port, of course.

    EDIT: well, we could simply double the output (in this case), but that might be a bit too much verbose.

    Edited by Vladimír Čunát
  • Tomas Krizek added 1 commit

    added 1 commit

    • 41f04fb2 - daemon/bindings/net: change output format of net.list()

    Compare with previous version

  • The list is flat by design, so every IP/transport combination creates a new entry. This is why it seems quite verbose - just localhost is 6 entries by default.

    DoH is supposed to be implemented using the application table. application.protocol could be http and it might introduce additional fields, such as endpoint, or a perhaps type (for plain DNS vs JSON). That's the reason I'd like to keep application as a separate table, so it is extensible.

  • OK, so the plan is to "double" the list items for the [security] => none cases, right? (They listen both on UDP and TCP.)

  • Example:

    [1] => {
        [application] => {
            [protocol] => dns
        }
        [ip] => 127.0.0.1
        [transport] => {
            [protocol] => udp
            [security] => none
            [port] => 53
        }
    }
    [2] => {
        [application] => {
            [protocol] => dns
        }
        [ip] => 127.0.0.1
        [transport] => {
            [protocol] => tcp
            [security] => none
            [port] => 53
        }
    }
    [3] => {
        [application] => {
            [protocol] => dns
        }
        [ip] => 127.0.0.1
        [transport] => {
            [protocol] => tcp
            [security] => tls
            [port] => 853
        }
    }

    I think this format is quite convenient to process from a script, but it can be quite verbose considering most people will have at least 3 interfaces (127.0.0.1, ::1, public IPv4, ...)

  • added 1 commit

    • 83d2d14f - tests: adapt to change of net.list() output

    Compare with previous version

  • mentioned in commit deckard@2ad8b2c0

  • mentioned in merge request deckard!158 (merged)

  • added 2 commits

    • 0691f234 - daemon/io nitpick: more const in parameters
    • a566326a - daemon/network: stop using combined UDP+TCP endpoints

    Compare with previous version

  • Vladimír Čunát unmarked as a Work In Progress

    unmarked as a Work In Progress

  • Vladimír Čunát marked as a Work In Progress

    marked as a Work In Progress

  • added 2 commits

    • e807c943 - fixup! daemon/network: stop using combined UDP+TCP endpoints
    • 3c1578ae - daemon/network: adapt _listen and _close to repeats

    Compare with previous version

  • mentioned in commit deckard@13f18ac9

  • Petr Špaček
  • added 4 commits

    • 01fd3d0f - tests: adapt to change of net.list() output
    • 25c613a7 - daemon/io nitpick: more const in parameters
    • 880b11d0 - daemon/network: stop using combined UDP+TCP endpoints
    • cc89e8c7 - daemon/network: adapt _listen and _close to repeats

    Compare with previous version

  • Vladimír Čunát added 10 commits

    added 10 commits

    • cc89e8c7...049d8451 - 3 commits from branch master
    • 899254e7 - daemon/bindings/net: change output format of net.list()
    • 661263a7 - tests: adapt to change of net.list() output
    • ed6ee84f - daemon/io nitpick: more const in parameters
    • 2ef5d9b3 - daemon/network: stop using combined UDP+TCP endpoints
    • 30e8eed2 - daemon/network: adapt _listen and _close to repeats
    • 31825948 - daemon/network: enum endpoint_flag -> endpoint_flags_t
    • 422848e0 - daemon/network endpoint_array_t: decrease indirection

    Compare with previous version

  • Vladimír Čunát unmarked as a Work In Progress

    unmarked as a Work In Progress

  • Vladimír Čunát added 263 commits

    added 263 commits

    • 422848e0...019ce4fb - 256 commits from branch master
    • ce7dd5ce - daemon/bindings/net: change output format of net.list()
    • 3386e2de - tests: adapt to change of net.list() output
    • 45960175 - daemon/io nitpick: more const in parameters
    • 33abbcb4 - daemon/network: stop using combined UDP+TCP endpoints
    • 115b2472 - daemon/network: adapt _listen and _close to repeats
    • de509369 - daemon/network: enum endpoint_flag -> endpoint_flags_t
    • 6ee3999a - daemon/network endpoint_array_t: decrease indirection

    Compare with previous version

  • Vladimír Čunát added 13 commits

    added 13 commits

    • 6ee3999a...37510f73 - 6 commits from branch master
    • 3046eb0e - daemon/bindings/net: change output format of net.list()
    • 807fc176 - tests: adapt to change of net.list() output
    • 63d152ed - daemon/io nitpick: more const in parameters
    • da36e463 - daemon/network: stop using combined UDP+TCP endpoints
    • 2667c5f0 - daemon/network: adapt _listen and _close to repeats
    • 9fb5866a - daemon/network: enum endpoint_flag -> endpoint_flags_t
    • 3367ea64 - daemon/network endpoint_array_t: decrease indirection

    Compare with previous version

  • Vladimír Čunát resolved all discussions

    resolved all discussions

  • Vladimír Čunát mentioned in issue #455

    mentioned in issue #455

  • Petr Špaček mentioned in commit 768ecc0d

    mentioned in commit 768ecc0d

  • merged

  • Please register or sign in to reply
    Loading