-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
85af6b0
commit 788eb07
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,8 @@ | |
// Contributors: | ||
// ZettaScale Zenoh Team, <[email protected]> | ||
|
||
#include "zenoh-pico/transport/raweth/transport.h" | ||
|
||
#include <stdbool.h> | ||
#include <stddef.h> | ||
#include <stdint.h> | ||
|
@@ -28,6 +30,28 @@ | |
|
||
#if Z_FEATURE_RAWETH_TRANSPORT == 1 | ||
|
||
void _zp_raweth_fetch_zid(const _z_transport_t *zt, z_owned_closure_zid_t *callback) { | ||
void *ctx = callback->context; | ||
_z_transport_peer_entry_list_t *l = zt->_transport._multicast._peers; | ||
for (; l != NULL; l = _z_transport_peer_entry_list_tail(l)) { | ||
_z_transport_peer_entry_t *val = _z_transport_peer_entry_list_head(l); | ||
z_id_t id = val->_remote_zid; | ||
|
||
callback->call(&id, ctx); | ||
} | ||
} | ||
|
||
void _zp_raweth_info_session(const _z_transport_t *zt, _z_config_t *ps) { | ||
_z_transport_peer_entry_list_t *xs = zt->_transport._multicast._peers; | ||
while (xs != NULL) { | ||
_z_transport_peer_entry_t *peer = _z_transport_peer_entry_list_head(xs); | ||
_z_bytes_t remote_zid = _z_bytes_wrap(peer->_remote_zid.id, _z_id_len(peer->_remote_zid)); | ||
_zp_config_insert(ps, Z_INFO_PEER_PID_KEY, _z_string_from_bytes(&remote_zid)); | ||
|
||
xs = _z_transport_peer_entry_list_tail(xs); | ||
} | ||
} | ||
|
||
int8_t _z_raweth_transport_create(_z_transport_t *zt, _z_link_t *zl, _z_transport_multicast_establish_param_t *param) { | ||
int8_t ret = _Z_RES_OK; | ||
|
||
|