]> git.corax.cc Git - toolbox/commit
include/ipc: Simplify IPC endpoint API
authorMatthias Kruk <m@m10k.eu>
Tue, 15 Jun 2021 00:21:48 +0000 (09:21 +0900)
committerMatthias Kruk <m@m10k.eu>
Tue, 15 Jun 2021 00:21:48 +0000 (09:21 +0900)
commit5fd8b22b8c55a8bdd9002fc8474595637cfde9ef
tree46a75529e1c30648158168a45cdb410999e60fa9
parentc7137a7a53a57e549732ffac9fb759aed13f6bbf
include/ipc: Simplify IPC endpoint API

The current API of the ipc module expects the user to create an ipc_msg
and send that using the ipc_endpoint_send() function, however there is
nothing useful that can be done with an ipc_msg besides sending it, so
it makes no sense to have the user create the ipc_msg themselves.
Further, the ipc_endpoint_recv() function will return any received
ipc_msg to the user, including invalid or unauthenticated messages.
This commit changes the IPC endpoint API so that the user can pass the
data they intend to send right to ipc_endpoint_send() without having
to call ipc_msg_new(). Since ipc_msg_new() is not intended to be used
by the user directly, it is removed from the public API of the ipc
module.
Further, the ipc_endpoint_recv() function is modified to return only
valid, authenticated messages to the caller.
include/ipc.sh