anchor.diff:  
   idle({join_request, Seq, Elements, #capwap_header{
   			   radio_id = RadioId, wb_id = WBID, flags = Flags}},
  -     State = #state{peer = {Address, _}}) ->
  +     State0 = #state{peer = {Address, _}}) ->
       ?DEBUG(?GREEN "Join-Request: ~p~n", [Elements]),
  +
       SessionId = proplists:get_value(session_id, Elements),
       capwap_wtp_reg:register_sessionid(Address, SessionId),
  +
  +    MacTypes = ie(wtp_mac_type, Elements),
  +    TunnelModes = ie(wtp_frame_tunnel_mode, Elements),
  +    State1 = State0#state{mac_types = MacTypes, tunnel_modes = TunnelModes},
  +
       RespElements = ac_info() ++ [#result_code{result_code = 0}],
       Header = #capwap_header{radio_id = RadioId, wb_id = WBID, flags = Flags},
  -    State1 = send_response(Header, join_response, Seq, RespElements, State),
  -    next_state(join, State1);
  +    State = send_response(Header, join_response, Seq, RespElements, State1),
  +    next_state(join, State);
   
   idle({Msg, Seq, Elements, Header}, State) ->
       ?DEBUG(?RED "in IDLE got unexpexted: ~p~n", [{Msg, Seq, Elements, Header}]),
  
positive.code:      {'Tunnel-Type', 'CAPWAP'},
       {'Tunnel-Medium-Type', tunnel_medium(Address)},
       {'Tunnel-Client-Endpoint', ip2str(Address)}].
  
negative.code: 	    ?DEBUG(?RED "AC for data session no found: ~p~n", [PeerId]),
  	    {error, not_found};
  	{ok, AC} ->
  	    case proplists:get_value(frame, Flags) of
  		'802.3' ->
  		    ?DEBUG(?RED "got 802.3 payload Frame, what TODO with it???"),
  		    case ieee80211_station:handle_ieee802_3_frame(AC, Frame) of
  			{add, RadioMAC, MAC, MacMode, TunnelMode} ->
  			    gen_fsm:send_event(AC, {add_station, Header, MAC}),
  			    ?DEBUG(?GREEN "MacMode: ~w, TunnelMode ~w~n", [MacMode, TunnelMode]),
  			    {add_flow, Address, Port, RadioMAC, MAC, MacMode, TunnelMode};
  			Other ->
  			    Other
  		    end;
  
  		native ->
  		    case ieee80211_station:handle_ieee80211_frame(AC, Frame) of
  			{reply, Reply} ->
  			    %% build capwap packet....
  			    RHeader = #capwap_header{
  			      radio_id = RadioId,
  			      wb_id = WBID,
  			      flags = [{frame, 'native'}]},
  			    Data = capwap_packet:encode(data, {RHeader, Reply}),
  			    {reply, Data};
  			{add, RadioMAC, MAC, MacMode, TunnelMode} ->
  			    gen_fsm:send_event(AC, {add_station, Header, MAC}),
  			    ?DEBUG(?GREEN "MacMode: ~w, TunnelMode ~w~n", [MacMode, TunnelMode]),
  			    {add_flow, Address, Port, RadioMAC, MAC, MacMode, TunnelMode};
  			Other ->
  			    Other
  		    end;
  
  		_ ->
  		    {error, unknown_frame_format}
  	    end
      end.
  
  