-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add endian-proofing for stream size
- Loading branch information
1 parent
b38e94e
commit 8169165
Showing
7 changed files
with
33 additions
and
20 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 |
---|---|---|
|
@@ -12,15 +12,26 @@ | |
// ZettaScale Zenoh Team, <[email protected]> | ||
// | ||
|
||
#include "zenoh-pico/transport/multicast/rx.h" | ||
#include "zenoh-pico/transport/common/rx.h" | ||
|
||
#include <stddef.h> | ||
|
||
#include "zenoh-pico/protocol/codec/transport.h" | ||
#include "zenoh-pico/transport/multicast/rx.h" | ||
#include "zenoh-pico/transport/unicast/rx.h" | ||
#include "zenoh-pico/utils/endianness.h" | ||
#include "zenoh-pico/utils/logging.h" | ||
|
||
/*------------------ Reception helper ------------------*/ | ||
uint16_t _z_read_stream_size(_z_zbuf_t *zbuf) { | ||
uint8_t stream_size[_Z_MSG_LEN_ENC_SIZE]; | ||
// Read the bytes from stream | ||
for (uint8_t i = 0; i < _Z_MSG_LEN_ENC_SIZE; i++) { | ||
stream_size[i] = _z_zbuf_read(zbuf); | ||
} | ||
return _z_host_le_load16(stream_size); | ||
} | ||
|
||
int8_t _z_link_recv_t_msg(_z_transport_message_t *t_msg, const _z_link_t *zl) { | ||
int8_t ret = _Z_RES_OK; | ||
|
||
|
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
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
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