anchor.diff:  		_Else -> protocolError
   	    end
       end.	
  -		
  +
  +%% @doc @todo
  +add(_BindDN,_DN,_Attributes) ->
  +    success.
  +
  +%% @doc @todo
  +parse_response([Response]) ->
  +    case lists:keyfind(<<"err">>, 1, Response) of
  +	{<<"err">>, undefined} -> success;
  +	_Else -> protocolError
  +    end.
  +
  +%% @doc @todo
  +object_modify(Key, NewValue, Entry) when is_list(Key) ->
  +    object_modify(list_to_bitstring(Key), NewValue, Entry);
  +object_modify(Key, NewValue, Entry) when is_bitstring(Key),
  +					 is_list(NewValue) ->
  +    object_modify(Key, list_to_bitstring(NewValue), Entry);
  +object_modify(Key, NewValue, Entry) when is_bitstring(Key),
  +					 is_bitstring(NewValue) ->
  +    lists:keyreplace(Key, 1, Entry, {Key, NewValue}).
  +
  +%% @doc @todo
  +object_get(Key, Entry) when is_list(Key) ->
  +    object_get(list_to_bitstring(Key), Entry);
  +object_get(Key, Entry) when is_bitstring(Key) ->
  +    element(2, lists:keyfind(Key, 1, Entry)).
  +
  +%% @doc @todo
  +rdn(DN) ->
  +    lists:reverse(DN).
  +
  +%% @doc @todo
   item_to_attribute({_Name, {oid, _}}) ->
       [];
   item_to_attribute({<<"_rdn">>,_}) ->
       [];
   item_to_attribute({Name, Value}) when is_bitstring(Name),
   				      is_bitstring(Value) ->
  -    {'PartialAttribute', 
  -     bitstring_to_list(Name), 
  -     [bitstring_to_list(Value)]};
  +    {'PartialAttribute', bitstring_to_list(Name), [bitstring_to_list(Value)]};
   item_to_attribute({Name, {array, Value}}) when is_bitstring(Name), 
   					       is_list(Value) ->
       lists:map(fun(V) -> 
  -		      {'PartialAttribute', 
  -		       bitstring_to_list(Name),
  -		       [bitstring_to_list(V)]}
  +		      {'PartialAttribute', bitstring_to_list(Name), [bitstring_to_list(V)]}
   	      end, Value).
  +
  +%% @doc @todo
  +attribute_to_item({'PartialAttribute', Name, [Value]}) when is_list(Name),
  +							    is_list(Value) ->
  +    {Name, Value};
  +attribute_to_item({'PartialAttribute', Name, Value}) when is_list(Name),
  +							  is_list(Value) ->
  +    {Name, {array, Value}}.
   
   handle_cast({{bindRequest, Options}, MessageID,_BindDN, From}, State) ->
       {'BindRequest',_, BindDN, Creds} = Options,
  
positive.code: init(_) ->
      {ok, {}}.
  
  dispatch(Pid, ProtocolOp, MessageID, BindDN, From) ->
      gen_server:cast(Pid, {ProtocolOp, MessageID, BindDN, From}).
  
  rdn(DN) ->
      lists:reverse(DN).
  
  bind(BindDN, {simple, Password}) ->
      Filter = {equalityMatch, 
  	      {'AttributeValueAssertion', "userPassword", Password}},
  
negative.code: bind(_BindDN,_Creds) ->
      authMethodNotSupported.
  
  %% @doc @todo
  bind_reply(_From, BindResult,_MessageID) when is_atom(BindResult) ->
      BindResult;
  bind_reply(_From, [],_MessageID) ->
  