Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Userspace notifications #87

Open
lstipakov opened this issue Oct 18, 2024 · 0 comments
Open

Userspace notifications #87

lstipakov opened this issue Oct 18, 2024 · 0 comments
Assignees

Comments

@lstipakov
Copy link
Member

Existing mechanism of userspace notifications (by erroring out pending read requests) is not flexible enough to be used by multipeer. For instance, we need to pass:

  • peer-id
  • event type - peer deleted, key rotate, peer floated etc

For that, add a new IOCTL, which client will send and then will expect response via, for example, overlapped IO.

@lstipakov lstipakov self-assigned this Oct 18, 2024
lstipakov added a commit to lstipakov/ovpn-dco-win that referenced this issue Oct 22, 2024
Existing mechanism of userspace notifications
(by erroring out pending read requests) is not
flexible enough to be used by multipeer.

This adds a new OVPN_IOCTL_NOTIFY_EVENT ioctl.
When request arrives, we check if there are pending
notifications. If yes, then we complete request, writing
notification command, peer-id and peer delete reason (if applicable).
If there are no pending notifications, request is queued.

When notification occurs (such as peer keepalive timeout),
we check if there is a pending requests in the queue (see above).
If yes, we complete request with notification details. If there
are no pending requests, we add notification event to a queue.

Events queue is implemented with a C++ class and a kernel linked
lists. The queue is a member of device context. Since there is no
C++ runtime and constructors are not called for context members,
we have to use a separate method for initialization.

GitHub: OpenVPN#87

Signed-off-by: Lev Stipakov <[email protected]>
lstipakov added a commit to lstipakov/ovpn-dco-win that referenced this issue Oct 22, 2024
Use overlapped I/O with OVPN_IOCTL_NOTIFY_EVENT ioctl
to get notifications from the kernel.

Factor out read/write/notification callbacks into own
functions for better readability.

GitHub: OpenVPN#87

Signed-off-by: Lev Stipakov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant