Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ This extension contributes the following settings:
* `name`: a name to identify
* `steps`: similar to filterSteps but for the "extract DLT from pcap file..." function.
* `tSharkArgs`: arguments used for tshark to extract the DLT message payload from the pcap file.

* `vsc-webshark.sharkdConfigurations`: An array of configurations for sharkd. For more details, refer to [setconf](https://wiki.wireshark.org/sharkd-JSON-RPC-Request-Syntax#setconf).
Each configuration item includes:
* `name`: The name of the property.
* `value`: The corresponding value for the configuration.

## Known Issues

Expand Down
18 changes: 18 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,24 @@
},
"default": [],
"description": "Steps offered for the 'Remove TECMP from pcap file...' function"
},
"vsc-webshark.sharkdConfigurations": {
"type": "array",
"items": {
"type": "object",
"title": "sharkd configurations",
"properties": {
"name": {
"type": "string",
"description": "config name, check https://wiki.wireshark.org/sharkd-JSON-RPC-Request-Syntax#setconf for more infomation"
},
"value": {
"description": "config value"
}
}
},
"default": [],
"description": "Load sharkd config by setconf when open webshharkview."
}
}
}
Expand Down
14 changes: 14 additions & 0 deletions src/websharkView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,20 @@ export class WebsharkView implements vscode.Disposable {
}
}
};

// load config for sharkd

const sharkdConf = <any[]>(vscode.workspace.getConfiguration().get("vsc-webshark.sharkdConfigurations"));
for (const conf of sharkdConf) {
this.sharkd2Request({ req: 'setconf', params: { name: conf.name, value: conf.value } }, (res: any) => {
console.log(`WebsharkView sharkd2 'setconf ${conf.name}=${conf.value}' got res=${JSON.stringify(res)}`);
if ('error' in res) {
console.error(`WebsharkView sharkd2 'setconf' got error=${res.error}`);
// if not err: 0 we could e.g. kill and don't offer time services...
}
});
}

// load the file here as well: todo might delay until the first one has fully loaded the file
// but with all our multi-core cpus it should run fine in parallel... todo
// as long as sharkd2 is not ready it's not granted that requests are done in fifo order.
Expand Down