Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new NIF for retrieving the integer protocol values using atoms. For socket levels in getsockopt/4 and setsockopt/4, first search socket_level/1 before checking socket_protocol/1. socket_protocol/1 duplicates the hard coded values provided by protocol/1. Since protocol/1 is not exported and is used only with open/1, it can be replaced with: protocol(ip) -> socket_protocol('IPPROTO_IP'); protocol(icmp) -> socket_protocol('IPPROTO_ICMP'); protocol(tcp) -> socket_protocol('IPPROTO_TCP'); ... Or even: protocol(Constant) -> socket_protocol(list_to_atom("IPPROTO_" ++ string:to_upper(atom_to_list(Constant)))).
- Loading branch information
Showing
3 changed files
with
65 additions
and
3 deletions.
There are no files selected for viewing
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
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
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