From bf347e534552e7ca077461bac1e290ab5d14340a Mon Sep 17 00:00:00 2001 From: Michael Santos Date: Thu, 26 Mar 2015 08:09:59 -0400 Subject: [PATCH] Export types Add some basic types for use in the various codecs. --- src/pkt.erl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/pkt.erl b/src/pkt.erl index c75a39e..8f1e51a 100644 --- a/src/pkt.erl +++ b/src/pkt.erl @@ -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.