What are the roles of the RPC methods, defined in proto file? #1164
Replies: 2 comments 1 reply
-
Hi @Prateeknandle ! The Notifications channel is mainly used to send "Actions" from the server (UI) to the daemon, and receive the result of the action: opensnitch/daemon/ui/notifications.go Line 270 in 1984fb9 daemon -> (daemon/ui/client) Subscribe() -> server (UI). UI -> Apply rule -> Notifications() <<(grpc channel)>> -> daemon -> handleNotification() -> protocol.Action_CHANGE_RULE -> result Ok/Error
Those events are sent via the Ping() gRPC method. The daemon collects statistics about the monitored events (connections blocked/allowed), and send them to the server (UI) every second. new connection -> (daemon/statistics/) OnConnectionEvent -> add to circular buffer opensnitch/daemon/statistics/stats.go Line 119 in 1984fb9 opensnitch/daemon/statistics/stats.go Line 192 in 1984fb9 at the same time, the collected stats are sent to the server (UI): (daemon/ui/client.go) Client.ping() -> stats.Serialize() opensnitch/daemon/ui/client.go Line 300 in 1984fb9 opensnitch/daemon/statistics/stats.go Line 255 in 1984fb9 and every time the collected stats are sent, they're deleted from the daemon. |
Beta Was this translation helpful? Give feedback.
-
Hey thanks @gustavo-iniguez-goya for detailed explanation, much appreciate your help. |
Beta Was this translation helpful? Give feedback.
-
I found there are five RPC calls defined in proto, but there is no mention of which RPC provides what kind of service in the documentation.
I was building a service which wants to connect with the daemon (ui is not present), and it seems out of 5 RPC calls only
Notifications
is the one which streams data, but I do not find daemon is sending any data to it. I need an alerts/events stream where any deny action or allowed action takes place, defined by the rules, the service will get the alerts/events.Is this even possible with current codebase?
Beta Was this translation helpful? Give feedback.
All reactions