anchor.diff:  decode_options(<<OptionData/binary>>, Acc) ->
       [{error, {unknown_opt_data, OptionData}} | Acc].
   
  +encode_options(OptionList) ->
  +    iolist_to_binary([encode_option(Opt)
  +                      || Opt <- OptionList]).
  +
  +encode_option(nop) ->
  +    <<1>>;
  +encode_option({mss, MSS}) ->
  +    <<2, 4, MSS:16/big>>;
  +encode_option({window_size_shift, Shift}) ->
  +    <<3, 3, Shift:8>>;
  +encode_option(sack_ok) ->
  +    <<4, 2>>;
  +encode_option({sack, SackData}) ->
  +    <<5, ( byte_size(SackData) + 2):8,
  +      SackData/binary>>;
  +encode_option({timestamp, TSVal, TSReply}) ->
  +    <<8, 10, TSVal:32, TSReply:32>>.
  +
  +
   check_sum(16#FFFF, _IPH, _Length, _Data) ->
       no_checksum;
   check_sum(Csum, #ipv4_pseudo_hdr{src=Src, dst=Dst, proto=Proto},
  
positive.code: %% End of Options List (padding?)
  decode_options(<<0, Rest/binary>>, Acc) -> decode_options(Rest, Acc);
  %% Nop
  decode_options(<<1, Rest/binary>>, Acc) -> decode_options(Rest, Acc);
  %% MSS
  decode_options(<<2, 4, MSS:16/big, Rest/binary>>, Acc) ->
      decode_options(Rest, [{mss, MSS} | Acc]);
  %% Window Size Shift
  decode_options(<<3, 3, Shift, Rest/binary>>, Acc) ->
      decode_options(Rest, [{window_size_shift, Shift} | Acc]);
  %% SACK Permitted
  decode_options(<<4, 2, Rest/binary>>, Acc) ->
  
negative.code: 
  %% API
  -export([decode/2
           ,encode/2
           ,decode_port/1
           ,encode_port/1]).
  
  -include_lib("eunit/include/eunit.hrl").
  
  -include("enet_types.hrl").
  -define(TCP_HEADER_MIN_LEN, 20).
  -define(TCP_OPTS_ALIGNMENT, 4).
  
  %%====================================================================
  %% API
  