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

Downstream and upstream packet length is limited to 16 bits. #79

Closed
tomgoff opened this issue Jan 16, 2018 · 3 comments
Closed

Downstream and upstream packet length is limited to 16 bits. #79

tomgoff opened this issue Jan 16, 2018 · 3 comments
Assignees

Comments

@tomgoff
Copy link

tomgoff commented Jan 16, 2018

Commit b88fa0a added support for sending and receiving OTA messages larger than 65535 bytes, but the length processing of downstream and upstream packets did not change.

The attached patch allows sending and receiving downstream and upstream packets that are larger than 65535 bytes.
emane-downstream-upstream-packet-length.patch.txt

@sgalgano
Copy link
Member

This patch allows you to prepend and remove length prefix frames for individual packet headers that are greater than 65535. Packets and headers are capable of being larger. We made a conscious decision not to increase the maximum supported length prefix frame size so not to change (break) the packet API. You can still add larger headers with or without your own larger length prefix frame.

You may have to modify how you are creating your packets if this is a problem.

@sgalgano sgalgano self-assigned this Jan 16, 2018
@tomgoff
Copy link
Author

tomgoff commented Jan 23, 2018

Fair enough regarding backward compatibility.

It might be worth considering adding helper methods like:

void DownstreamPacket::prependLengthPrefixFramingLong(std::uint32_t u32Length);

std::uint32_t UpstreamPacket::stripLengthPrefixFramingLong();

so models that send/receive large OTA messages don't have to implement their own functionality and can have similar logic to the standard EMANE models.

sgalgano added a commit that referenced this issue Jan 26, 2018
frames.

Added DownstreamPacket prependLengthPrefixFramingLong method to
prepend a 4 byte length prefix frame.

Added UpstreamPacket stripLengthPrefixFramingLong method to strip and
return a 4 byte length prefix frame.

Reported-by: Tom Goff <https://github.com/tomgoff>
See #79
@sgalgano
Copy link
Member

Thanks for the suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants