Add generic event functionality, use it for connection data
- We generalise the
ProgressEvent
machinery to work with a new generic version ofOnionmasqEvent
, which now includes connection details.- Note that this is a BREAKING CHANGE for the Java side -- cc @cyberta
- This is done with a Rust
enum
,TunnelEvent
, which contains all the event types (Bootstrap
,NewConnection
,FailedConnection
, andClosedConnection
), and some Java logic that looks at the enum tag to deserialize it as a subclass ofOnionmasqEvent
. - Users can then destructure the event with Java
instanceof
. - In the sample app, we just log all events received in a relatively
human-readable format, as a proof of concept.
- Note that this suffers from none of the privacy issues of the previous implementations, since the logs aren't visible by other apps like they would be if put in logcat.
(Side note: I'm honestly astounded that this worked first time; I don't actually have any experience writing Java, so I'd have expected all my class deserialisation shenanigans to not work at all!)
Related to #38 (closed) -- this is most of the functionality apart from GeoIP/country code stuff.
This patch series also has some minor onion-tunnel fixes and refactorings to make it work better, fixing #56 (closed).
Edited by eta