This update is to have cmd/stun-nat-behaviour strictly follow RFC5780
& RFC4787
- Fix typo in attributes of RFC5780
- Add RESPONSE-ORIGIN and other attributes' types in RFC5780
- Expose GetFromAs() & AddToAs() from addr.go
- Add cmd/stun-nat-behaviour parameters: timeout, verbose
- Generate new transacion id for each Binding Request
- NAT mapping tests: 2 tests -> 3 tests (add missing Test II)
- Refactor functions & update docs
Changes:
modified: addr.go
modified: attributes.go
modified: cmd/stun-nat-behaviour/main.go
modified: cmd/stun-nat-behaviour/README.md
modified: README.md
modified: testdata/stun-parameters-4.csv
Signed-off-by: Will LE <lexuandinhct@gmail.com>
This commit adds two attributes needed for the implementation of RFC
5780 (NAT Behavior Discovery Using STUN). The OTHER-ADDRESS attribute is
returned by a compatable STUN server and includes as its value the
server's second address. The CHANGE-REQUEST attribute is sent by a
client and contains as its value a 32-bit integer that encodes two
flags: one to indicate that the server should respond to the request
from a different IP address, and the other to request a change of port.