invalid json request to tshark
I've upgraded wireshark 3.4 -> 3.6 and the protocol for sharkd has changed.
I am doing cat contrib/info.json | socat UNIX-CONNECT:/tmp/sharkd.sock -
which returns
{"jsonrpc":"2.0","id":0,"error":`{"code":-32600,"message":"Invalid JSON(2)"}}`
I can't find how it is invalid.
for the following info.json:
{
"jsonrpc": "2.0"
, "id": 1
, "method":"info"
}
I've got a similar issue with the following json
{
"method":"load"
, "jsonrpc": "2.0"
, "id" : 1
, "params" : {
"file": "/home/teto/tcp/client_2_cleaned.pcapng"
}
}
NB: the doc at https://wiki.wireshark.org/Developmen... seems out of date
There have been several changes to the Wiki since the move to Gitlab in 2020.
There used to be links from the old to the new but looks like they got dropped when the old wiki was turned into a static site. Current wiki here:
sharkd
thanks for the link, looks like it is the same outdated documentation. I dont mind because I tend to look at the source anyway and the sharkd*.c files are easy to read. So I've dived a bit deeper and if I convert info.json to a one line string it works :s so it seems newlines are not accepted by sharkd ?!
17235: sharkd: Align the API with JSON-RPC 2.0
Maybe @PaulOfford has input on the changes?
thanks for trying. You should try my instructions with 3.6 though as the protocol changed, "req" is the old protocol.