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
net: telnet: Switch TELNET shell backend to use sockets #69612
Merged
dleach02
merged 4 commits into
zephyrproject-rtos:main
from
rlubos:net/switch-telnet-to-socket-service
Mar 11, 2024
Merged
net: telnet: Switch TELNET shell backend to use sockets #69612
dleach02
merged 4 commits into
zephyrproject-rtos:main
from
rlubos:net/switch-telnet-to-socket-service
Mar 11, 2024
Conversation
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
Socket service pollfd count should not exceed the configured NET_SOCKETS_POLL_MAX limit, as poll() will not be able to monitor sockets beyond that limit anyway. Adding +1 there prevented the library from catching the configuration error. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
zephyrbot
added
area: Shell
Shell subsystem
area: Sockets
Networking sockets
area: Networking
labels
Feb 29, 2024
zephyrbot
requested review from
carlescufi,
jakub-uC,
jukkar,
ssharks and
tbursztyka
February 29, 2024 12:41
rlubos
force-pushed
the
net/switch-telnet-to-socket-service
branch
from
February 29, 2024 12:52
bb994c0
to
6a7fc4e
Compare
jukkar
reviewed
Feb 29, 2024
rlubos
force-pushed
the
net/switch-telnet-to-socket-service
branch
from
March 1, 2024 08:38
6a7fc4e
to
8a8fea8
Compare
pdgendt
reviewed
Mar 1, 2024
Rework TELNET shell backend to use socket API for communication and socket service library for socket monitoring. Additionally, rework the TX part so that non-blocking TX is used when sending from the system work queue. In case transfer is not possible at the moment, the TX work is rescheduled instead of blocking the system work queue. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Current TELNET implementation wrongly assumed that if the command is present, it will always be included at the beginning of the packet/data buffer. Such assumptions however are not valid for STREAM sockets, where the actual stream data could be fragmented in any way. Therefore, the command parsing needed rework, so that we analyze each byte received for the command escape code, and once received we enter "command parsing" mode. Once no more commands are identified in a data streak, the command bytes are removed from the data buffer before the buffer is provided to the shell subsystem for processing. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Rename command defines to make checkpatch happy. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
rlubos
force-pushed
the
net/switch-telnet-to-socket-service
branch
from
March 4, 2024 08:24
8a8fea8
to
c835188
Compare
pdgendt
approved these changes
Mar 4, 2024
jukkar
approved these changes
Mar 4, 2024
ping @jakub-uC, PTAL |
jakub-uC
approved these changes
Mar 11, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not a telnet expert :) However it looks good to me.
I asked your review because you are the assignee of the PR, and there seems to be a rule that the assignee should +1 the PR before merging. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rework TELNET shell backend to use socket API for communication and socket service library for socket monitoring.
Improve TELNET command parsing to make it more robust against possible stream fragmentation.