anchor.diff:      #mqtt_pingresp{};
   parse(<<?DISCONNECT:4, 0:4>>, <<>>) ->
       #mqtt_disconnect{};
  -parse(_, _) -> error.
  +parse(_, _) -> {error, cant_parse_variable_header}.
  +
  +parse_last_will_topic(0, _, _, Rest, Conn) -> {ok, Rest, Conn};
  +parse_last_will_topic(1, Retain, QoS, <<WillTopicLen:16/big, WillTopic:WillTopicLen/binary,
  +                           WillMsgLen:16/big, WillMsg:WillMsgLen/binary,
  +                           Rest/binary>>, Conn) ->
  +    LWillTopic = binary_to_list(WillTopic),
  +    case vmq_topic:validate({publish, LWillTopic}) of
  +        true ->
  +            {ok, Rest, Conn#mqtt_connect{will_msg=WillMsg,
  +                                         will_topic=LWillTopic,
  +                                         will_retain=Retain,
  +                                         will_qos=QoS}};
  +        false ->
  +            {error, cant_validate_last_will_topic}
  +    end;
  +parse_last_will_topic(1, _, _, _,_) ->
  +    {error, cant_parse_last_will}.
  +
  +parse_username(0, Rest, Conn) -> {ok, Rest, Conn};
  +parse_username(1, <<Len:16/big, UserName:Len/binary, Rest/binary>>, Conn) ->
  +    {ok, Rest, Conn#mqtt_connect{username=list(UserName)}};
  +parse_username(1, _, _) ->
  +    {error, cant_parse_username}.
  +
  +parse_password(0, Rest, Conn) -> {ok, Rest, Conn};
  +parse_password(1, <<Len:16/big, Password:Len/binary, Rest/binary>>, Conn) ->
  +    {ok, Rest, Conn#mqtt_connect{password=list(Password)}};
  +parse_password(1, _, _) ->
  +    {error, cant_parse_password}.
  +
   
   parse_topics(_, <<>>, []) -> error;
   parse_topics(_, <<>>, Topics) -> Topics;
  
positive.code:                           qos=0,
                            payload=Payload};
          false ->
              error
      end;
  parse(<<?PUBLISH:4, Dup:1, QoS:2, Retain:1>>, <<TopicLen:16/big, Topic:TopicLen/binary, MessageId:16/big, Payload/binary>>)
    when QoS < 3 ->
  
negative.code:         _ -> more
      end;
  parse(Data) when byte_size(Data) =< 8 -> more;
  parse(_) -> {error, cant_parse_fixed_header}.
  
  parse(<<?PUBLISH:4, Dup:1, 0:2, Retain:1>>, <<TopicLen:16/big, Topic:TopicLen/binary, Payload/binary>>) ->
      LTopic = binary_to_list(Topic),
  