This commit is contained in:
Fijxu 2025-01-13 11:21:21 -03:00
parent b69cd74f1a
commit 6654d7cd75
Signed by: Fijxu
GPG key ID: 32C1DDF333EDA6A4

View file

@ -21,8 +21,8 @@ module NatPMP
# [RFC 6886 - 3.5. Result Codes](https://datatracker.ietf.org/doc/html/rfc6886#section-3.5)
enum OP : UInt8
NOOP = 0_u8
UDP = 1_u8
TCP = 2_u8
UDP = 1_u8
TCP = 2_u8
end
# You can use this struct to craft your own mapping packets in case you want
@ -54,7 +54,7 @@ module NatPMP
io.write_bytes(@internal_port, IO::ByteFormat::BigEndian)
io.write_bytes(@external_port, IO::ByteFormat::BigEndian)
io.write_bytes(@lifetime, IO::ByteFormat::BigEndian)
return io
io
end
# Converts the struct instance variables to an StaticArray.
@ -79,7 +79,7 @@ module NatPMP
slice[9] = l[1]
slice[10] = l[2]
slice[11] = l[3]
return slice
slice
end
end
@ -137,7 +137,7 @@ module NatPMP
end
end
return msg
msg
end
# Returns the external address response as a `Slice(UInt8)`
@ -147,7 +147,7 @@ module NatPMP
# ```
def send_external_address_request_as_bytes : Bytes
msg = send_external_address_request_
return msg
msg
end
# Returns the external address response as a `Tuple(UInt8, UInt8, UInt16, UInt32, String | Nil)`