-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add IS_IPB packet and TINY_IPB subtype of IS_TINY #47
Labels
Comments
mkapal
added a commit
that referenced
this issue
Jul 28, 2024
You can use the IS_IPB packet to set up to 120 IPv4 addresses that are not allowed to join a host. fix #47
mkapal
added a commit
that referenced
this issue
Jul 28, 2024
Added `TINY_IPB` into the `TinyType` enum. fix #47
mkapal
added a commit
that referenced
this issue
Jul 28, 2024
You can use the IS_IPB packet to set up to 120 IPv4 addresses that are not allowed to join a host. The IP addresses assigned to the `BanIPs` property must be in a string format `X.X.X.X` where `X` is a number from 0 to 255. If some of the IP addresses are invalid, a `RangeError` will be thrown. fix #47
mkapal
added a commit
that referenced
this issue
Jul 28, 2024
Added `TINY_IPB` into the `TinyType` enum. fix #47
I have decided to do start simple and only work with strings on the consumer side. Also, I have added validation when sending a range of IPs. If some of the IPs don't conform to the IPv4 format, a RangeError will be thrown. See #48 |
mkapal
added a commit
that referenced
this issue
Jul 28, 2024
You can use the IS_IPB packet to set up to 120 IPv4 addresses that are not allowed to join a host. The IP addresses assigned to the `BanIPs` property must be in a string format `X.X.X.X` where `X` is a number from 0 to 255. If some of the IP addresses are invalid, a `RangeError` will be thrown. fix #47
mkapal
added a commit
that referenced
this issue
Jul 28, 2024
Added `TINY_IPB` into the `TinyType` enum. fix #47
mkapal
added a commit
that referenced
this issue
Jul 28, 2024
You can use the IS_IPB packet to set up to 120 IPv4 addresses that are not allowed to join a host. The IP addresses assigned to the `BanIPs` property must be in a string format `X.X.X.X` where `X` is a number from 0 to 255. If some of the IP addresses are invalid, a `RangeError` will be thrown. fix #47
mkapal
added a commit
that referenced
this issue
Jul 28, 2024
Added `TINY_IPB` into the `TinyType` enum. fix #47
mkapal
added a commit
that referenced
this issue
Jul 28, 2024
Added `TINY_IPB` into the `TinyType` enum. fix #47
🎉 This issue has been resolved in version 4.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A new IS_IPB packet was introduced in LFS version 0.7F.
Source code from InSim.txt:
Also the IS_TINY enum has been updated with a new subtype added at the end:
IP address handling
As of now, the only use case of handling IP addresses is in the IS_NCI packet:
node-insim/src/packets/IS_NCI.ts
Lines 31 to 32 in f81c75c
When the packet is received, the IP address is converted into a string:
node-insim/src/packets/IS_NCI.ts
Line 37 in f81c75c
Should it be handled the same in the new IS_IPB packet, or should all IP address fields be stored as a utility object, allowing the users to convert the IP address from/to bytes, perform validations and other useful operations?
Here are my proposed options:
Plain string
When a packet is received, the binary 4-byte integer is converted into string containing 4 numbers separated by dots.
When a packet is sent, the IP string is parsed and converted into the 4-byte integer.
Utility object
Make use of a library capable of converting an IP address between integer, hexadecimal, string etc. and able to parse and validate an input IP.
Examples of such libraries:
https://github.com/indutny/node-ip
https://github.com/beaugunderson/ip-address
The text was updated successfully, but these errors were encountered: