Skip to content

Commit

Permalink
Export types
Browse files Browse the repository at this point in the history
Add some basic types for use in the various codecs.
  • Loading branch information
msantos committed Mar 26, 2015
1 parent 42f16ab commit bf347e5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/pkt.erl
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,24 @@
dlt/1, link_type/1
]).

-type bit() :: 0 .. 1.
-type in_port_t() :: 0 .. 16#ffff.
-type nibble() :: 0 .. 16#ff.
-type uint16_t() :: 0 .. 16#ffff.
-type uint32_t() :: 0 .. 16#ffffffff.
-type in_addr() :: {byte(),byte(),byte(),byte()}.
-type in6_addr() :: {uint16_t(),uint16_t(),uint16_t(),uint16_t(),uint16_t(),uint16_t(),uint16_t(),uint16_t()}.

-export_type([
bit/0,
in6_addr/0,
in_addr/0,
in_port_t/0,
nibble/0,
uint16_t/0,
uint32_t/0
]).

% For integers, assume a whole frame and check the datalink type.
%
% Atoms can indicate any protocol type.
Expand Down

0 comments on commit bf347e5

Please sign in to comment.