anchor.diff:      register_node(Name,?DUMMY_PORT).
   
   register_node(Name, Port) ->
  -    case connect() of
  +    case send_req([?EPMD_ALIVE_REQ, put16(Port), Name]) of
   	{ok,Sock} ->
  -	    M = [?EPMD_ALIVE_REQ, put16(Port), Name],
  -	    case send(Sock, [size16(M), M]) of
  -		ok ->
  -		    case recv(Sock,3) of
  -			{ok, [?EPMD_ALIVE_OK_RESP,_D1,_D0]} ->
  -			    {ok,Sock};
  -			Other ->
  -			    test_server:format("recv on sock ~w: ~p~n",
  -					       [Sock,Other]),
  -			    error
  -		    end;
  +	    case recv(Sock,3) of
  +		{ok, [?EPMD_ALIVE_OK_RESP,_D1,_D0]} ->
  +		    {ok,Sock};
   		Other ->
  -		    test_server:format("send on sock ~w: ~w~n",[Sock,Other]),
  +		    test_server:format("recv on sock ~w: ~p~n",
  +				       [Sock,Other]),
   		    error
   	    end;
  +	error ->
  +	    error
  +    end.
  +
  +register_node_v2(Port, NodeType, Prot, HVsn, LVsn, Name, Extra) ->
  +    Req = [?EPMD_ALIVE2_REQ, put16(Port), NodeType, Prot,
  +	   put16(HVsn), put16(LVsn),
  +	   size16(Name), Name,
  +	   size16(Extra), Extra],
  +    case send_req(Req) of
  +	{ok,Sock} ->
  +	    case recv(Sock,4) of
  +		{ok, [?EPMD_ALIVE2_RESP,_Res=0,_C0,_C1]} ->
  +		    {ok,Sock};
  +		Other ->
  +		    test_server:format("recv on sock ~w: ~p~n",
  +				       [Sock,Other]),
  +		    error
  +	    end;
  +	error ->
  +	    error
  +    end.
  +
  +% Internal function to fetch information about a node
  +
  +port_please_v2(Name) ->
  +    case send_req([?EPMD_PORT_PLEASE2_REQ, Name]) of
  +	{ok,Sock} ->
  +	    case recv_until_sock_closes(Sock) of
  +		{ok, Resp} ->
  +		    parse_port2_resp(Resp);
  +		Other ->
  +		    test_server:format("recv on sock ~w: ~p~n",
  +				       [Sock,Other]),
  +		    error
  +	    end;
  +	error ->
  +	    error
  +    end.
  +
  +parse_port2_resp(Resp) ->
  +    case list_to_binary(Resp) of
  +	<<?EPMD_PORT2_RESP,Res,Port:16,NodeType,Prot,HVsn:16,LVsn:16,
  +	  NLen:16,NodeName:NLen/binary,
  +	  ELen:16,Extra:ELen/binary>> when Res =:= 0 ->
  +	    {ok, #node_info{port=Port,node_type=NodeType,prot=Prot,
  +			    hvsn=HVsn,lvsn=LVsn,
  +			    node_name=binary_to_list(NodeName),
  +			    extra=binary_to_list(Extra)}};
   	Other ->
  -	    test_server:format("Connect on port ~w: ~p~n",[Port,Other]),
  +	    test_server:format("invalid port2 resp: ~p~n",
  +			       [Resp]),
   	    error
       end.
  -
  -
   
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   
  
positive.code:     ?line ok = send(Sock, [size16(M), M]),
      sleep(?MEDIUM_PAUSE),
      ?line closed = recv(Sock,1),
      ok.
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
negative.code: -define(REG_REPEAT_LIM,1000).
  
  % Message codes in epmd protocol
  -define(EPMD_ALIVE_REQ,		$a).
  -define(EPMD_ALIVE2_REQ,	$x).
  -define(EPMD_ALIVE_OK_RESP,	$Y).
  -define(EPMD_ALIVE2_RESP,	$y).
  -define(EPMD_PORT_REQ,		$p).
  -define(EPMD_PORT_PLEASE2_REQ,	$z).
  -define(EPMD_PORT2_RESP,	$w).
  -define(EPMD_NAMES_REQ,	$n).
  -define(EPMD_DUMP_REQ,	$d).
  -define(EPMD_KILL_REQ,	$k).
  