anchor.diff:  %%%===================================================================
   %%% Internal functions
   %%%===================================================================
  +
  +%%%===================================================================
  +%%% Verify Packet
  +%%% Pattern match to parse the IP part of the packet and if thats ok,
  +%%% then go onto verify the VRRP part...
  +%%% TTL must be 255, Protocol must be 112.
  +%%%===================================================================
  +verify_packet(Source,
  +              <<4:4/integer, 5:4/integer, _:8, Len:16/big-integer,
  +                _:16, _:2, _:1, 0:13, 255:8, 112:8/integer,
  +                _:16, Src_Ip:32/big-integer, Dst_Ip:32/big-integer,
  +                Remainder/binary>> = Pkt,
  +              State)
  +  when byte_size(Pkt) =:= Len ->
  +    %% Initial parse...
  +    
  +    %% <<4:4/integer,          % Ip Version
  +    %%  5:4/integer,      % Header Length
  +    %%  _:8/integer,           % Tos -- Ignored
  +    %%  Len:16/big-integer,    % Packet Length
  +    %%  _:16/big-integer, % Fragment Id
  +    %%  _:2/integer,           % Two first flags... ignored
  +    %%  Mf:1/integer,          % More Fragments flag
  +    %%  Offset:13/big-integer, % Fragment Offset
  +    %%  255:8/integer,           % TTL -- We are not routing(yet) so we don't care
  +    %%  112:8/integer,    % Upper layer protocol
  +    %%  _:16/big-integer,      % Checksum... Alredy checked
  +    %%  Src_Ip:32/big-integer, % Source Ip
  +    %%  Dst_Ip:32/big-integer, % Should check this against our Ip
  +    %%  Remainder/binary>> = Packet, % We don't do options yet 
  +    verify_vrrp(Source, Remainder, State);
  +verify_packet(_Source, _Packet, State) ->
  +    io:format("Z~n", []),
  +    {bad_packet, State}.
  +
  +verify_vrrp(Source,
  +            <<3:4, 1:4, ID:8/integer, Priority:8/integer, Count:8/integer, 
  +              0:4, Interval:12/big-integer, _CSum:16/big-integer,
  +              BinIPs/binary>>,
  +            State)
  + when Count == (byte_size(BinIPs)/4)->
  +    %% TODO - Check checksum..
  +
  +    %% Map IPs into something useful...
  +    IPs = [ {A, B, C, D} || <<A:8, B:8, C:8, D:8>> <= BinIPs ],
  +
  +    {#vrrp_packet{
  +        from = Source,
  +        version = 3,
  +        type = announce,
  +        id = ID,
  +        priority = Priority,
  +        interval = Interval,
  +        ips = IPs
  +       }, State};
  +verify_vrrp(_Source, _Packet, State) ->
  +    {bad_packet, State}.
  +
  +handle_packet({#vrrp_packet{id = Id} = Pkt, #state{mapping = D} = State}) ->
  +    case dict:find(Id, D) of
  +        {ok, {Pid, _MR}} ->
  +            vrrp_fsm:vrrp_msg(Pid, Pkt);
  +        error ->
  +            discard
  +    end,
  +    State;
  +handle_packet({bad_packet, State}) ->
  +    State.
  
positive.code:     %% One of our FSM's has shutdown normally...
      ND = dict:filter(fun(_K, {VP, _VR}) -> VP =/= Pid end, D),
      {noreply, State#state{mapping = ND}};
  handle_info(Info, State) ->
      io:format("vrrp_interface received: ~p~n", [Info]),
      {noreply, State}.
  
negative.code: 
  -behaviour(gen_server).
  
  -include("vrrp_protocol.hrl").
  
  %% API
  -export([start_link/1]).
  
  