anchor.diff:  enc_cmd(R) when is_record(R, rad_request) ->
       Def = #rad_request{},
       {?Val_Packet_Type_Access_Request,
  -     [enc_attrib(#rad_request.user,      R, Def, ?User_Name,       binary),
  -      enc_attrib(#rad_request.passwd,    R, Def, ?User_Password,     binary),
  +     [enc_attrib(#rad_request.user,      R, Def, ?User_Name,       string),
  +      enc_attrib(#rad_request.passwd,    R, Def, ?User_Password,     string),
         enc_attrib(#rad_request.nas_ip,    R, Def, ?NAS_IP_Address,  ipaddr),
  -      enc_attrib(#rad_request.state,     R, Def, ?State,           binary)
  +      enc_attrib(#rad_request.state,     R, Def, ?State,           octets)
        ]};
   enc_cmd(R) when is_record(R, rad_accept) ->
       Def = #rad_accept{},
       {?Val_Packet_Type_Access_Accept,
  -     [enc_attrib(#rad_accept.user,        R, Def, ?User_Name,       binary),
  +     [enc_attrib(#rad_accept.user,        R, Def, ?User_Name,       string),
         lists:map(fun(RM) ->
   			<<?Vendor_Specific:8, (size(RM)+2):8, RM/binary>>
   		end,
  
positive.code: enc_cmd(R) when is_record(R, rad_challenge) ->
      Def = #rad_challenge{},
      {?Val_Packet_Type_Access_Challenge,
       [enc_attrib(#rad_challenge.state,   R, Def, ?State,           binary),
        lists:map(fun(RM) -> <<?Reply_Message:8, (size(RM)+2):8, RM/binary>> end,
  		R#rad_challenge.reply_msgs)]
      };
  
negative.code:     Val = type_conv(V, Type),
      <<Id, (size(Val) + 2):8, Val/binary>>.
  
  type_conv(V, integer) -> <<V:32>>;
  type_conv({A,B,C,D}, ipaddr) -> <<A:8, B:8, C:8, D:8>>;
  type_conv(V, string) when is_list(V) -> iolist_to_binary(V);
  