anchor.diff:  peer_log_str(#state{id = Id, peer = Peer}) ->
       io_lib:format("~s[~s]", [Id, format_peer(Peer)]).
   
  -log_capwap_control(Id, MsgType, SeqNo, Elements,
  -		   #capwap_header{radio_id = RadioId, wb_id = WBID}) ->
  -    lager:info("~s: ~s(Seq: ~w, R-Id: ~w, WB-Id: ~w): ~p", [Id, capwap_packet:msg_description(MsgType), SeqNo, RadioId, WBID, [lager:pr(E, ?MODULE) || E <- Elements]]).
  -
   next_state(NextStateName, State)
     when NextStateName == idle; NextStateName == run ->
       {next_state, NextStateName, State};
  
positive.code: 	Peer = format_peer({Address, Port}),
  	case capwap_packet:decode(control, Packet) of
  	    {Header, {discovery_request, 1, Seq, Elements}} ->
  		log_capwap_control(Peer, discovery_request, Seq, Elements, Header),
  		Answer = answer_discover(Peer, Seq, Elements, Header),
  		{reply, Answer};
  	    {Header, {join_request, 1, Seq, Elements}} ->
  		log_capwap_control(Peer, join_request, Seq, Elements, Header),
  		handle_plain_join(Peer, Seq, Elements, Header);
  	    Pkt ->
  		lager:warning("unexpected CAPWAP packet: ~p", [Pkt]),
  
negative.code: 	    lager:warning("Rejecting JOIN without DTLS from ~s", [Peer]),
  	    RespElems = [#result_code{result_code = 18}],
  	    Header = #capwap_header{radio_id = RadioId, wb_id = WBID, flags = Flags},
  	    ?log_capwap_control(Peer, join_response, Seq, RespElems, Header),
  	    Answer = hd(capwap_packet:encode(control, {Header, {join_response, Seq, RespElems}})),
  	    {reply, Answer}
      end.
  