change net.list() output format
Closes #448 (closed)
Merge request reports
Activity
added 1 commit
- decdebcb - daemon/bindings/net: change output format of net.list()
Implementation nitpick:
s/lua_pushstring/lua_pushliteral/g
docsIf it's too verbose, maybe we could cut it down a little? I might be over-engineering this :-) I wonder whether splitting
protocol
andsecurity
really helps. Lemme test it with variants that come into mind:description protocol security comment DNS over UDP udp none DNS over TCP tcp none DNS over TLS tcp tls 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átMore 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átadded 1 commit
- 41f04fb2 - daemon/bindings/net: change output format of net.list()
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 behttp
and it might introduce additional fields, such asendpoint
, or a perhapstype
(for plain DNS vs JSON). That's the reason I'd like to keepapplication
as a separate table, so it is extensible.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, ...)mentioned in commit deckard@2ad8b2c0
mentioned in merge request deckard!158 (merged)
mentioned in commit deckard@13f18ac9
- Resolved by Vladimír Čunát
- Resolved by Vladimír Čunát
- Resolved by Vladimír Čunát
- Resolved by Vladimír Čunát
- Resolved by Vladimír Čunát
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
Toggle commit list-
cc89e8c7...049d8451 - 3 commits from branch
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
Toggle commit list-
422848e0...019ce4fb - 256 commits from branch
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
Toggle commit list-
6ee3999a...37510f73 - 6 commits from branch
mentioned in issue #455
mentioned in commit 768ecc0d