diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./config/configure.in ./config/configure.in
--- ./config/configure.in	2005-07-05 14:32:04.000000000 +0200
+++ ./config/configure.in	2005-07-09 08:59:30.000000000 +0200
@@ -12,6 +12,12 @@
 MINOR_VERSION=5
 SUB_VERSION1=30       # set to 0 if you want to disable this value
 SUB_VERSION2=17       # set to 0 if you want to disable this value
+
+# this will be the feature MLDonkey version number
+#MAJOR_VERSION=3
+#MINOR_VERSION=0
+#SUB_VERSION1=0   # range 0-7 due to eMule limitations
+
 if test -d .svn; then
   AC_MSG_NOTICE(checking SVN revision) 
   SUB_VERSION3="SVN"
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/daemon/common/guiDecoding.ml ./src/daemon/common/guiDecoding.ml
--- ./src/daemon/common/guiDecoding.ml	2005-07-07 02:25:45.000000000 +0200
+++ ./src/daemon/common/guiDecoding.ml	2005-07-09 08:32:18.000000000 +0200
@@ -686,6 +686,7 @@
       client_files = None;
       client_connect_time = 0;
       client_software = "";
+      client_release = "";
       client_emulemod = "";
       client_downloaded = zero;
       client_uploaded = zero;
@@ -733,6 +734,7 @@
     client_files = None;
     client_connect_time = connect_time;
     client_software = software;
+    client_release = "";
     client_emulemod = emulemod;
     client_downloaded = downloaded;
     client_uploaded = uploaded;
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/daemon/common/guiTypes.ml ./src/daemon/common/guiTypes.ml
--- ./src/daemon/common/guiTypes.ml	2005-05-17 15:18:05.000000000 +0200
+++ ./src/daemon/common/guiTypes.ml	2005-07-09 08:31:52.000000000 +0200
@@ -207,6 +207,7 @@
     mutable client_chat_port : int;
     mutable client_connect_time : int;
     mutable client_software : string;
+    mutable client_release : string;
     mutable client_emulemod : string;
     mutable client_downloaded : int64;
     mutable client_uploaded : int64;
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/daemon/driver/driverCommands.ml ./src/daemon/driver/driverCommands.ml
--- ./src/daemon/driver/driverCommands.ml	2005-07-07 02:25:45.000000000 +0200
+++ ./src/daemon/driver/driverCommands.ml	2005-07-09 09:59:18.000000000 +0200
@@ -313,23 +313,33 @@
         if args = ["all"] then begin 
             let buf = o.conn_buf in
             
-            if use_html_mods o then html_mods_table_header buf "vcTable" "vc" [ 
+            if use_html_mods o then html_mods_table_header buf "vcTable" "vc" ([ 
                 ( "1", "srh ac", "Client number", "Num" ) ; 
                 ( "0", "srh", "Network", "Network" ) ; 
                 ( "0", "srh", "IP address", "IP address" ) ; 
-                ( "0", "srh", "Client name", "Client name" ) ]; 
+                ( "0", "srh", "Client name", "Client name" ) ;
+		( "0", "srh", "Client brand", "CB" ) ;
+		( "0", "srh", "Client release", "CR" ) ;
+		] @
+		(if !!emule_mods_count then [( "0", "srh", "eMule MOD", "EM" )] else []));
             
             let counter = ref 0 in
             let all_clients_list = clients_get_all () in
             List.iter (fun num ->
                 let c = client_find num in
+		let i = client_info c in
                 if use_html_mods o then Printf.bprintf buf "\\<tr class=\\\"%s\\\" 
 			 title=\\\"Add as friend\\\" 
 			 onClick=\\\"parent.fstatus.location.href='submit?q=friend_add+%d'\\\" 
             onMouseOver=\\\"mOvr(this);\\\" 
             onMouseOut=\\\"mOut(this);\\\"\\>" 
                     (if (!counter mod 2 == 0) then "dl-1" else "dl-2") num;
-                client_print c o;
+		    client_print c o;
+        	    html_mods_td buf ([
+                    ("", "sr", i.client_software);
+                    ("", "sr", i.client_release);
+                    ] @
+                    (if !!emule_mods_count then [("", "sr", i.client_emulemod)] else []));
                 if use_html_mods o then Printf.bprintf buf "\\</tr\\>"
                 else Printf.bprintf buf "\n";
                 incr counter;
@@ -2021,6 +2031,7 @@
                   ( "0", "srh", "IP address", "IP address" ) ;
                   ( "0", "srh", "Connected time (minutes)", "CT" ) ;
                   ( "0", "srh", "Client brand", "CB" ) ;
+                  ( "0", "srh", "Client release", "CR" ) ;
                   ] @
                   (if !!emule_mods_count then [( "0", "srh", "eMule MOD", "EM" )] else [])
                   @ [
@@ -2052,6 +2063,7 @@
                             ("", "sr", (string_of_kind  i.client_kind));
                             ("", "sr", Printf.sprintf "%d" (((last_time ()) - i.client_connect_time) / 60));
                             ("", "sr", i.client_software);
+                            ("", "sr", i.client_release);
                             ] @
                             (if !!emule_mods_count then [("", "sr", i.client_emulemod)] else [])
                             @ [
@@ -2080,6 +2092,7 @@
                   ( "0", "srh", "Connection type [I]ndirect [D]irect", "C" ) ;
                   ( "0", "srh", "Client name", "Client name" ) ;
                   ( "0", "srh", "Client brand", "CB" ) ;
+                  ( "0", "srh", "Client release", "CR" ) ;
                   ] @
                   (if !!emule_mods_count then [( "0", "srh", "eMule MOD", "EM" )] else [])
                   @ [
@@ -2105,6 +2118,7 @@
                       
                       html_mods_td buf ([
                         ("", "sr", i.client_software);
+                        ("", "sr", i.client_release);
                         ] @
                         (if !!emule_mods_count then [("", "sr", i.client_emulemod )] else [])
                         @ [
@@ -2255,6 +2269,7 @@
               ( "0", "srh", "Client state", "CS" ) ; 
               ( "0", "srh", "Client name", "Name" ) ; 
               ( "0", "srh", "Client brand", "CB" ) ; 
+              ( "0", "srh", "Client release", "CR" ) ; 
             ] @
               (if !!emule_mods_count then [( "0", "srh", "eMule MOD", "EM" )] else [])
             @ [
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/networks/bittorrent/bTInteractive.ml ./src/networks/bittorrent/bTInteractive.ml
--- ./src/networks/bittorrent/bTInteractive.ml	2005-07-07 02:25:46.000000000 +0200
+++ ./src/networks/bittorrent/bTInteractive.ml	2005-07-09 08:34:09.000000000 +0200
@@ -549,6 +549,7 @@
     P.client_chat_port = 0 ;
     P.client_connect_time = BasicSocket.last_time ();
     P.client_software = c.client_software;
+    P.client_release = "";
     P.client_emulemod = "";
     P.client_downloaded = c.client_downloaded;
     P.client_uploaded = c.client_uploaded;
@@ -603,6 +604,7 @@
           (short_string_of_connection_state (client_state cc)));
         ((Sha1.to_string c.client_uid), "sr", cinfo.GuiTypes.client_name);
         ("", "sr", "bT"); (* cinfo.GuiTypes.client_software *)
+        ("", "sr", ""); (* cinfo.GuiTypes.client_release *)
       ] @
         (if !show_emulemods_column then [("", "sr", "")] else [])
       @ [
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/networks/direct_connect/dcInteractive.ml ./src/networks/direct_connect/dcInteractive.ml
--- ./src/networks/direct_connect/dcInteractive.ml	2004-11-01 12:23:00.000000000 +0100
+++ ./src/networks/direct_connect/dcInteractive.ml	2005-07-09 08:34:38.000000000 +0200
@@ -368,6 +368,7 @@
         P.client_chat_port = 0 ;
         P.client_connect_time = last_time ();
         P.client_software = "";
+        P.client_release = "";
         P.client_emulemod = "";
         P.client_downloaded = zero;
         P.client_uploaded = zero;
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/networks/donkey/donkeyClient.ml ./src/networks/donkey/donkeyClient.ml
--- ./src/networks/donkey/donkeyClient.ml	2005-07-05 14:24:21.000000000 +0200
+++ ./src/networks/donkey/donkeyClient.ml	2005-07-09 10:28:24.000000000 +0200
@@ -450,14 +450,8 @@
   if c.client_brand = Brand_unknown then
     let md4 = Md4.direct_to_string c.client_md4 in
     c.client_brand <- (
-      if String2.subcontains c.client_name "[ePlus]" then
-	Brand_emuleplus
-      else
-	if md4.[5] = Char.chr 14 && md4.[14] = Char.chr 111 then
-          if String2.subcontains c.client_name "shareaza.com" then
-            Brand_shareaza
-          else
-            Brand_newemule
+      if md4.[5] = Char.chr 14 && md4.[14] = Char.chr 111 then
+       Brand_newemule
       else if md4.[5] = 'M' && md4.[14] = 'L' then
         Brand_mldonkey2
     else
@@ -595,7 +589,6 @@
   !s 
 
 let identify_client_mod_brand c tags =
-
   if c.client_mod_brand = Brand_mod_unknown then begin
       List.iter (fun tag ->
         let s = to_lowercase (string_of_tag_value tag.tag_value) in 
@@ -619,8 +612,44 @@
    end
   end
 
+let identify_client_compat_brand num old_brand =
+    match num with
+      0 -> old_brand
+    | 1 -> Brand_cdonkey
+    | 2 -> Brand_lmule
+    | 3 -> Brand_amule
+    | 4 -> Brand_shareaza
+    | 5 -> Brand_emuleplus
+    | 6 -> Brand_hydranode
+    | 10 -> Brand_mldonkey3
+    | 20 -> Brand_lphant
+    | _ -> lprintf_nl "EDK: unknown compatibleclient %d (please report to dev team)" num; Brand_unknown
+
+let identify_emule_release num brand =
+     let s = Misc.dec2bin num 32 in
+     let block2 = (String.sub s 8 7) in
+     let block3 = (String.sub s 15 7) in
+     let block4 = (String.sub s 22 3) in
+     let rel = Printf.sprintf "%s.%s%s"
+        (string_of_int(Misc.bin2dec (int_of_string block2)))
+        (string_of_int(Misc.bin2dec (int_of_string block3)))
+        (if brand = Brand_newemule || brand = Brand_emuleplus then
+	   begin
+	     match Misc.bin2dec (int_of_string block4) with
+	       0 -> "a"
+	     | 1 -> "b"
+	     | 2 -> "c"
+	     | 3 -> "d"
+	     | 4 -> "e"
+	     | 5 -> "f"
+	     | 6 -> "g"
+	     | _ -> ""
+	   end
+	 else ("." ^ (string_of_int(Misc.bin2dec (int_of_string block4)))))
+     in 
+     if rel = "0.0.0" then "" else rel
+
 let update_client_from_tags c tags =
-  c.client_tags <- tags;
   List.iter (fun tag ->
       match tag.tag_name with
       | Field_UNKNOWN "name" -> ()
@@ -630,16 +659,31 @@
 (* Kademlia: we should use this client to bootstrap Kademlia *)
               if kad_port <> 0 && !!enable_kademlia then
                 DonkeyProtoKademlia.Kademlia.bootstrap 
-                  c.client_ip kad_port
-          )
-
+                  c.client_ip kad_port)
       | Field_UNKNOWN "emule_miscoptions1" ->
           for_int64_tag tag (fun i ->
               DonkeyProtoClient.update_emule_proto_from_miscoptions1
               c.client_emule_proto i)
       | Field_UNKNOWN "emule_version" ->
           for_int_tag tag (fun i ->
-              c.client_emule_proto.emule_version <- i)
+              c.client_emule_proto.emule_version <- i;
+	      let num = (int_of_string("0b" ^ String.sub (Misc.dec2bin i 32) 0 8)) in
+	        let brand = 
+		  identify_client_compat_brand num c.client_brand
+		in c.client_brand <- brand;
+              c.client_emule_proto.emule_release <- (identify_emule_release i c.client_brand))
+      | Field_UNKNOWN "mod_version" ->
+          let s = to_lowercase (string_of_tag_value tag.tag_value) in 
+            begin
+            let rec iter i len =
+              if i < len then
+                let sub = fst mod_array.(i) in
+                  if (String2.subcontains s sub) then
+                    c.client_mod_brand <- snd mod_array.(i)
+                  else iter (i+1) len
+            in
+              iter 0 (Array.length mod_array)
+           end
       | _ -> ()
   ) tags
     
@@ -647,18 +691,11 @@
   List.iter (fun tag ->
       match tag.tag_name with
         Field_UNKNOWN "compatibleclient" ->
-          for_int_tag tag (fun i ->
-              match i with
-                1 -> c.client_brand <- Brand_cdonkey
-              | 2 -> c.client_brand <- Brand_lmule
-              | 3 -> c.client_brand <- Brand_amule
-              | 4 -> c.client_brand <- Brand_shareaza
-              | 5 -> c.client_brand <- Brand_emuleplus
-              | 6 -> c.client_brand <- Brand_hydranode
-              | 10 -> c.client_brand <- Brand_mldonkey3
-              | 20 -> c.client_brand <- Brand_lphant
-              | _ -> ()
-          )
+	  for_int_tag tag (fun i ->
+	    let brand =
+	      identify_client_compat_brand i c.client_brand
+	    in c.client_brand <- brand;
+	    c.client_emule_proto.emule_release <- (identify_emule_release i c.client_brand))
       | Field_UNKNOWN "compression" ->
           for_int_tag tag (fun i ->
               c.client_emule_proto.emule_compression <- i)
@@ -678,7 +715,6 @@
       | Field_UNKNOWN "features" ->
           for_int_tag tag (fun i ->
               c.client_emule_proto.emule_secident <- i land 0x3)
-      
       | _ -> 
           if !verbose_msg_clients then
             lprintf "Unknown Emule tag: [%s]\n" (escaped_string_of_field tag)
@@ -903,7 +939,7 @@
       lprintf "Message from %s" (string_of_client c);
       CommonGlobals.print_localtime ();
       M.print t;
-      lprintf "\n"
+      lprintf_nl ""
     end;
   
   match t with
@@ -935,8 +971,7 @@
         if !!ban_identity_thieves then
           ban_client c sock "is probably using stolen client hashes";
 
-      update_client_from_tags c t.CR.tags;
-
+      c.client_tags <- t.CR.tags;
       List.iter (fun tag ->
           match tag with
             { tag_name = Field_UNKNOWN "name"; tag_value = String s } -> 
@@ -944,9 +979,22 @@
           | _ -> ()
       ) c.client_tags;
       identify_client_brand c;
+      update_client_from_tags c t.CR.tags;
       Hashtbl.add connected_clients t.CR.md4 c;
 (*      connection_ok c.client_connection_control; *)
-      
+      if !verbose_msg_clienttags then begin
+        M.ConnectReply.print t;
+	let s1 = c.client_emule_proto.emule_release in
+	let s2 = gbrand_mod_to_string c.client_mod_brand in
+	  if s1 <> "" then
+	    lprintf_nl "  [%s%s %s]\n"
+	      (gbrand_to_string c.client_brand)
+	      (if s2 <> "" then Printf.sprintf "(%s)" s2 else "")
+	      s1
+	  else
+	    lprintf_nl "\n"
+      end;
+
       begin
         match t.CR.server_info with
           Some (ip, port) -> if !!update_server_list_client then safe_add_server ip port
@@ -1725,7 +1773,7 @@
       if !verbose_unknown_messages then begin
           lprintf "Unused Client Message:\n"; 
           M.print t;
-          lprintf "\n"
+          lprintf_nl ""
         end
       
 let client_handler c sock event = 
@@ -1817,7 +1865,7 @@
       lprintf "Message from incoming client";
       CommonGlobals.print_localtime ();
       M.print m;
-      lprintf "\n"
+      lprintf_nl ""
     end;
 
   match m with
@@ -1846,12 +1894,12 @@
         if low_id t.CR.ip then
             match t.CR.server_info with
             | None ->
-                Invalid_address  (!name, Md4.to_string t.CR.md4)
+                Invalid_address (!name, Md4.to_string t.CR.md4)
             | Some (ip,port) ->
                 if Ip.valid ip && Ip.reachable ip then
                     Indirect_address (ip, port, id_of_ip t.CR.ip)
                 else
-                    Invalid_address  (!name, Md4.to_string t.CR.md4)
+                    Invalid_address (!name, Md4.to_string t.CR.md4)
         else
         if Ip.valid t.CR.ip && Ip.reachable t.CR.ip then
             Direct_address (t.CR.ip, t.CR.port)
@@ -1861,16 +1909,17 @@
       
       let c = new_client kind in
       
-      
-      
-      if c.client_debug || !verbose_msg_clients then begin  
-          lprintf "First Message\n";
+      if c.client_debug || !verbose_msg_clients || !verbose_msg_clienttags then begin  
+          lprintf "First Message: ";
           M.print m;
-          lprintf "\n";
+	  lprintf_nl "\n"
         end;
       
       Hashtbl.add connected_clients t.CR.md4 c;
-      
+
+      set_client_name c !name t.CR.md4;
+      c.client_tags <- t.CR.tags;
+      identify_client_brand c;
       update_client_from_tags c t.CR.tags;
       
       begin
@@ -1894,37 +1943,11 @@
             raise Not_found
       end;
 
-(*
-      begin
-        match c.client_source, kind with
-          None, Direct_address (ip, port) ->
-            let s = DonkeySources.create_source 0 (last_time ()) (ip, port) in
-            c.client_source <- Some s;
-            c.client_files := !(s.source_files);
-        | _ -> 
-            c.client_indirect_address <- indirect;
-      end;
-*)
-      
-      set_client_name c !name t.CR.md4;
-(*      connection_try c.client_connection_control;
-      connection_ok c.client_connection_control; *)
-      
-      if not (register_client_hash (peer_ip sock) t.CR.md4) &&
-        !!ban_identity_thieves then
+      if !!ban_identity_thieves && 
+        not (register_client_hash (peer_ip sock) t.CR.md4) then
         ban_client c sock "is probably using stolen client hashes";
       
-      List.iter (fun ban ->
-          if String2.subcontains c.client_name ban then begin
-              client_send c (
-                M.SayReq "[AUTOMATED WARNING] Sorry, you have not understood P2P");
-              set_client_state c BlackListedHost;
-              lprintf "Client[%d]: banned (%s)\n" (client_num c) ban;
-              raise Not_found
-            end)
-      ["Mison"]; (* People who don't understand P2P themselves please leave this list alone *)
-      
-      if  !!reliable_sources && 
+      if !!reliable_sources && 
         ip_reliability (peer_ip sock) = Reliability_suspicious 0 then begin
           set_client_state c BlackListedHost;
           raise Not_found
@@ -1940,14 +1963,6 @@
               end
       end;
 
-(*      List.iter (fun s ->
-		   match s.server_sock with
-		       None -> ()
-		     | Some _ -> if ?? = s.server_ip then
-			 c.client_brand <- Brand_server
-) (connected_servers ()) *)
-      identify_client_brand c;
-
       if supports_eep c.client_brand then
         begin
           (* lprintf "Emule Extended Protocol query\n"; *)
@@ -1971,18 +1986,6 @@
           }
         else
           begin
-(*	 if (c.client_brand == Brand_server) then begin
-          M.ConnectReplyReq {
-            C.md4 = !!server_client_md4;
-            C.ip = client_ip (Some sock);
-            C.port = !client_port;
-            C.tags = !client_tags;
-            C.server_info = t.CR.server_info;
-            C.left_bytes = left_bytes; 
-          }
-	 end
-	 else
-	 begin *)
             M.ConnectReplyReq {
               C.md4 = !!client_md4;
               C.ip = client_ip (Some sock);
@@ -1995,9 +1998,6 @@
           end;
       );
       
-      
-      
-      
       if DonkeySources.source_brand c.client_source then
         !activity.activity_client_overnet_indirect_connections <-
           !activity.activity_client_overnet_indirect_connections +1 
@@ -2013,7 +2013,7 @@
       Some c
       
   | M.NewUserIDReq _ ->
-      M.print m; lprintf "\n";
+      lprintf "NewUserIDReq: "; M.print m; lprintf_nl "";
       None
   
   | _ -> 
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/networks/donkey/donkeyInteractive.ml ./src/networks/donkey/donkeyInteractive.ml
--- ./src/networks/donkey/donkeyInteractive.ml	2005-06-23 13:41:12.000000000 +0200
+++ ./src/networks/donkey/donkeyInteractive.ml	2005-07-09 10:35:18.000000000 +0200
@@ -822,6 +822,23 @@
         CommonWeb.connect_redirector ();
         "done"
     ), ":\t\t\t\tsend the list of connected servers to the redirector";
+
+    "emule", Arg_one (fun arg o ->
+        let buf = o.conn_buf in
+	  let t = Misc.dec2bin (int_of_string arg) 32 in
+	  let block1 = (String.sub t 0 8) in
+	  let block2 = (String.sub t 8 7) in
+	  let block3 = (String.sub t 15 7) in
+	  let block4 = (String.sub t 22 3) in
+	  let block5 = (String.sub t 25 7) in
+	    Printf.bprintf buf "block1 %s\nblock2 %s\nblock3 %s\nblock4 %s\nblock5 %s\n"
+	     (string_of_int(Misc.bin2dec (int_of_string block1)))
+	     (string_of_int(Misc.bin2dec (int_of_string block2)))
+	     (string_of_int(Misc.bin2dec (int_of_string block3)))
+	     (string_of_int(Misc.bin2dec (int_of_string block4)))
+	     (string_of_int(Misc.bin2dec (int_of_string block5)));
+	"done"
+    ), "<number> :\t\t\tdecode emule version (for debugging)";
   
   ]
           
@@ -992,6 +1009,7 @@
         P.client_chat_port = 0 ;
         P.client_connect_time = c.client_connect_time;
         P.client_software = gbrand_to_string c.client_brand;
+        P.client_release = c.client_emule_proto.emule_release;
         P.client_emulemod = gbrand_mod_to_string c.client_mod_brand;
         P.client_downloaded = c.client_downloaded;
         P.client_uploaded = c.client_uploaded;
@@ -1168,6 +1186,7 @@
           ( "0", "srh", "Client state", "CS" ) ; 
           ( "0", "srh", "Client name", "Name" ) ; 
           ( "0", "srh", "Client brand", "CB" ) ; 
+          ( "0", "srh", "Client release", "CR" ) ; 
         ] @
           (if !!emule_mods_count then [( "0", "srh", "eMule MOD", "EM" )] else [])
         @ [
@@ -1228,6 +1247,7 @@
               (short_string_of_connection_state (client_state c)) );
             (String.escaped c.client_name, "sr", client_short_name c.client_name);
             (brand_to_string c.client_brand, "sr", gbrand_to_string c.client_brand);
+            ("", "sr", c.client_emule_proto.emule_release);
             ] @
             (if !!emule_mods_count then [(brand_mod_to_string c.client_mod_brand, "sr", gbrand_mod_to_string c.client_mod_brand)] else [])
             @ [
@@ -1487,6 +1507,7 @@
                         short_string_of_connection_state (client_state c));
                       (Md4.to_string c.client_md4, "sr", client_short_name c.client_name);
                       ("", "sr", gbrand_to_string c.client_brand);
+                      ("", "sr", c.client_emule_proto.emule_release);
                       ] @
                       (if !!emule_mods_count then [("", "sr", gbrand_mod_to_string c.client_mod_brand)] else [])
                       @ [
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/networks/donkey/donkeyProtoClient.ml ./src/networks/donkey/donkeyProtoClient.ml
--- ./src/networks/donkey/donkeyProtoClient.ml	2005-07-07 02:25:46.000000000 +0200
+++ ./src/networks/donkey/donkeyProtoClient.ml	2005-07-09 10:41:36.000000000 +0200
@@ -28,13 +28,25 @@
 open DonkeyTypes
 open DonkeyMftp
   
+let emule_version b1 b2 b3 b4 b5 =
+  let s = Printf.sprintf "%s"
+    (string_of_int(int_of_string("0b" ^
+    (Misc.dec2bin (int_of_string b1) 8) ^
+    (Misc.dec2bin (int_of_string b2) 7) ^
+    (Misc.dec2bin (int_of_string b3) 7) ^
+    (Misc.dec2bin (int_of_string b4) 3) ^
+    (Misc.dec2bin (int_of_string b5) 7))))
+  in s
+
 (* TODO : update this
 I downgraded some of those to get better results :
 We don't use emule udp extension, client_md4 in sourceexchange or complete sources in
 file request *)
 let mldonkey_emule_proto = {
     emule_comments = 1;
-    emule_version = 171720704;
+    emule_version = (int_of_string (emule_version "10" Autoconf.sub_version1 Autoconf.sub_version2 "0" "0"));
+      (* first parameter means compatibleclient, MLDonkeys value is 10 *)
+    emule_release = "";
     emule_secident = 0;
     emule_noviewshared = 0;
     emule_supportpreview = 0;
@@ -144,23 +156,22 @@
       }
     
     let print t = 
-      lprintf_nl "CONNECT:";
-      lprintf_nl "version: %d" t.version;
-      lprintf_nl "MD4: %s" (Md4.to_string t.md4); 
-      lprintf_nl "ip: %s" (Ip.to_string t.ip);
-      lprintf_nl "port: %d" t.port;
-      lprintf "tags: ";
-      print_tags t.tags;
-      lprintf_nl "";
+      lprintf "Connect (version %d) from [%s:%d] MD4: %s"
+        t.version
+        (Ip.to_string t.ip)
+	t.port
+        (Md4.to_string t.md4);
       (match t.server_info with
-          None -> ()
+          None -> lprintf_nl ""
         | Some (ip, port) ->
-            lprintf_nl "ip_server: %s" (Ip.to_string ip);
-            lprintf_nl "port_server: %d" port);
-      String.iter (fun c -> lprintf "(%d)" (int_of_char c)) 
-      t.left_bytes;
-      lprintf_nl ""
-    
+            lprintf_nl " on server: %s:%d" (Ip.to_string ip) port);
+      lprintf "tags: ";
+      print_tags t.tags;
+      if String.length t.left_bytes <> 0 then begin
+        lprintf "  left bytes = ";
+        String.iter (fun c -> lprintf "(%d)" (int_of_char c))
+        t.left_bytes  end
+
     let write buf t =
       buf_int8 buf t.version;
       buf_md4 buf t.md4;
@@ -223,21 +234,20 @@
       }
     
     let print t = 
-      lprintf_nl "CONNECT REPLY:";
-      lprintf_nl "MD4: %s" (Md4.to_string t.md4); 
-      lprintf_nl "ip: %s" (Ip.to_string t.ip);
-      lprintf_nl "port: %d" t.port;
-      lprintf "tags: ";
-      print_tags t.tags;
-      lprintf_nl "";
+      lprintf "Connect reply from [%s:%d] MD4: %s"
+        (Ip.to_string t.ip)
+	t.port
+        (Md4.to_string t.md4);
       (match t.server_info with
-          None -> ()
+          None -> lprintf_nl ""
         | Some (ip, port) ->
-            lprintf_nl "ip_server: %s" (Ip.to_string ip);
-            lprintf_nl "port_server: %d" port);
-      String.iter (fun c -> lprintf "(%d)" (int_of_char c)) 
-      t.left_bytes;
-      lprintf_nl ""
+            lprintf_nl " on server: %s:%d" (Ip.to_string ip) port);
+      lprintf "tags: ";
+      print_tags t.tags;
+      if String.length t.left_bytes <> 0 then begin
+        lprintf "  left bytes = ";
+        String.iter (fun c -> lprintf "(%d)" (int_of_char c))
+        t.left_bytes  end
       
     let write buf t =
       buf_md4 buf t.md4;
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/networks/donkey/donkeyTypes.ml ./src/networks/donkey/donkeyTypes.ml
--- ./src/networks/donkey/donkeyTypes.ml	2005-05-17 15:18:05.000000000 +0200
+++ ./src/networks/donkey/donkeyTypes.ml	2005-07-09 08:31:25.000000000 +0200
@@ -130,6 +130,7 @@
 type emule_proto = {
     mutable emule_comments : int;
     mutable emule_version : int;
+    mutable emule_release : string;
     mutable emule_secident : int;
     mutable emule_noviewshared : int;
     mutable emule_supportpreview : int;
@@ -931,6 +932,7 @@
 let dummy_emule_proto = {
     emule_comments = 0;
     emule_version = 0;
+    emule_release = "";
     emule_secident = 0;
     emule_noviewshared = 0;
     emule_supportpreview = 0;
@@ -945,4 +947,3 @@
 
 let emule_proto () = 
   { dummy_emule_proto with emule_version = 0 }
-  
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/networks/fileTP/fileTPInteractive.ml ./src/networks/fileTP/fileTPInteractive.ml
--- ./src/networks/fileTP/fileTPInteractive.ml	2005-04-24 21:44:16.000000000 +0200
+++ ./src/networks/fileTP/fileTPInteractive.ml	2005-07-09 08:46:05.000000000 +0200
@@ -125,6 +125,7 @@
         P.client_chat_port = 0 ;
         P.client_connect_time = BasicSocket.last_time ();
         P.client_software = "";
+        P.client_release = "";
         P.client_emulemod = "";
         P.client_downloaded = zero;
         P.client_uploaded = zero;
@@ -171,6 +172,7 @@
             (short_string_of_connection_state (client_state cc)));
           ("", "sr", cinfo.GuiTypes.client_name);
           ("", "sr", "TP"); (* cinfo.GuiTypes.client_software *)
+          ("", "sr", ""); (* cinfo.GuiTypes.client_release *)
           ] @
           (if !show_emulemods_column then [("", "sr", "")] else [])
           @ [
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/networks/gnutella/gnutellaInteractive.ml ./src/networks/gnutella/gnutellaInteractive.ml
--- ./src/networks/gnutella/gnutellaInteractive.ml	2005-05-17 15:18:05.000000000 +0200
+++ ./src/networks/gnutella/gnutellaInteractive.ml	2005-07-09 08:45:24.000000000 +0200
@@ -424,6 +424,7 @@
         P.client_chat_port = 0 ;
         P.client_connect_time = BasicSocket.last_time ();
         P.client_software = "";
+        P.client_release = "";
         P.client_emulemod = "";
         P.client_downloaded = zero;
         P.client_uploaded = zero;
@@ -476,6 +477,7 @@
             (short_string_of_connection_state (client_state cc)));
           ("", "sr", cinfo.GuiTypes.client_name);
           ("", "sr", "gN"); (* cinfo.GuiTypes.client_software *)
+          ("", "sr", ""); (* cinfo.GuiTypes.client_release *)
           ] @
           (if !show_emulemods_column then [("", "sr", "")] else [])
           @ [
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/networks/opennap/opennapInteractive.ml ./src/networks/opennap/opennapInteractive.ml
--- ./src/networks/opennap/opennapInteractive.ml	2005-05-17 15:18:05.000000000 +0200
+++ ./src/networks/opennap/opennapInteractive.ml	2005-07-09 08:34:48.000000000 +0200
@@ -248,6 +248,7 @@
         P.client_chat_port = 0 ;
         P.client_connect_time = BasicSocket.last_time ();
         P.client_software = "";
+        P.client_release = "";
         P.client_emulemod = "";
         P.client_downloaded = zero;
         P.client_uploaded = zero;
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/networks/soulseek/slskInteractive.ml ./src/networks/soulseek/slskInteractive.ml
--- ./src/networks/soulseek/slskInteractive.ml	2005-05-17 15:18:05.000000000 +0200
+++ ./src/networks/soulseek/slskInteractive.ml	2005-07-09 08:34:45.000000000 +0200
@@ -265,6 +265,7 @@
         P.client_chat_port = 0 ;
         P.client_connect_time = last_time ();
         P.client_software = "";
+        P.client_release = "";
         P.client_emulemod = "";
         P.client_downloaded = zero;
         P.client_uploaded = zero;
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/utils/lib/autoconf.ml.new.in ./src/utils/lib/autoconf.ml.new.in
--- ./src/utils/lib/autoconf.ml.new.in	2005-06-25 01:49:19.000000000 +0200
+++ ./src/utils/lib/autoconf.ml.new.in	2005-07-09 08:31:25.000000000 +0200
@@ -1,6 +1,10 @@
 let perl_path = "@PERL@"
 let check_bounds = @CHECKBOUNDS@
 let current_version = "@MLDONKEY_VERSION@"
+let major_version = "@MAJOR_VERSION@"
+let minor_version = "@MINOR_VERSION@"
+let sub_version1 = "@SUB_VERSION1@"
+let sub_version2 = "@SUB_VERSION2@"
 let scm_version = "@SCM_VERSION@"
 let ocaml_version = "@OCAML_VERSION@"
 let glibc_version = "@GLIBC_VERSION@"
diff -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/utils/lib/misc.ml ./src/utils/lib/misc.ml
--- ./src/utils/lib/misc.ml	2005-07-05 14:26:40.000000000 +0200
+++ ./src/utils/lib/misc.ml	2005-07-09 08:31:25.000000000 +0200
@@ -32,3 +32,19 @@
     if i < l then octal_aux (acc * 8 + (octal_of_char s.[i])) (i+1)
     else acc in
   octal_aux 0 0
+
+(* taken from http://kazaan.no-ip.com/~kazaan/item-1094206424.html *)
+let dec2bin num len =
+  let rec d2b v fig =
+    if fig < 0 then ""
+    else
+      match (v asr fig) land 1 with
+          0 -> "0" ^ (d2b v (fig - 1))
+	| x -> "1" ^ (d2b v (fig - 1))
+  in
+    d2b num (len-1)
+
+(* taken from http://www.hh.iij4u.or.jp/~kazaan/old/ObjectiveCaml.html *)
+let bin2dec num =
+  let s = string_of_int num in
+    int_of_string ("0b" ^ s)
