Skip to content

Commit

Permalink
Macros for IPv6
Browse files Browse the repository at this point in the history
  • Loading branch information
msantos committed Apr 13, 2012
1 parent c153830 commit 0a42cd3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/pkt.hrl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
-define(IPPROTO_ICMP, 1). -define(IPPROTO_ICMP, 1).
-define(IPPROTO_TCP, 6). -define(IPPROTO_TCP, 6).
-define(IPPROTO_UDP, 17). -define(IPPROTO_UDP, 17).
-define(IPPROTO_IPV6, 41).
-define(IPPROTO_GRE, 47). -define(IPPROTO_GRE, 47).
-define(IPPROTO_ICMPV6, 58). -define(IPPROTO_ICMPV6, 58).
-define(IPPROTO_SCTP, 132). -define(IPPROTO_SCTP, 132).
Expand Down
2 changes: 2 additions & 0 deletions src/pkt.erl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -133,9 +133,11 @@ family(?PF_INET) -> ipv4;
family(?PF_INET6) -> ipv6; family(?PF_INET6) -> ipv6;
family(_) -> unsupported. family(_) -> unsupported.


proto(?IPPROTO_IP) -> ip;
proto(?IPPROTO_ICMP) -> icmp; proto(?IPPROTO_ICMP) -> icmp;
proto(?IPPROTO_TCP) -> tcp; proto(?IPPROTO_TCP) -> tcp;
proto(?IPPROTO_UDP) -> udp; proto(?IPPROTO_UDP) -> udp;
proto(?IPPROTO_IPV6) -> ipv6;
proto(?IPPROTO_SCTP) -> sctp; proto(?IPPROTO_SCTP) -> sctp;
proto(?IPPROTO_GRE) -> gre; proto(?IPPROTO_GRE) -> gre;
proto(?IPPROTO_RAW) -> raw; proto(?IPPROTO_RAW) -> raw;
Expand Down

0 comments on commit 0a42cd3

Please sign in to comment.