From db5467e6c3b502f6e93a6f6c5d1f2a8f86a8eaa5 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 9 Nov 2024 08:32:33 -0800 Subject: Add new functions for socket identity. These functions were added in the main branch for NNG 2.0, and we add them here to facilitate converting any code that happened to use the options (`NNG_OPT_PROTO`, `NNG_OPT_PROTONAME`, `NNG_OPT_PEER`, `NNG_OPT_PEERNAME`, and `NNG_OPT_RAW`. Its unlikely that many applications need this, but providing these as a transition aid may help applications start adopting new APIs now. --- src/core/socket.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/core/socket.c') diff --git a/src/core/socket.c b/src/core/socket.c index c4e16f70..bf550a24 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -877,6 +877,12 @@ nni_sock_peer_name(nni_sock *sock) return (sock->s_peer_id.p_name); } +bool +nni_sock_raw(nni_sock *sock) +{ + return ((nni_sock_flags(sock) & NNI_PROTO_FLAG_RAW) != 0); +} + struct nni_proto_pipe_ops * nni_sock_proto_pipe_ops(nni_sock *sock) { -- cgit v1.2.3-70-g09d2