svn commit: samba r11033 - in branches/SAMBA_4_0: . source/wrepl_server

metze at samba.org metze at samba.org
Fri Oct 14 12:52:53 GMT 2005


Author: metze
Date: 2005-10-14 12:52:51 +0000 (Fri, 14 Oct 2005)
New Revision: 11033

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11033

Log:
 r10343 at SERNOX:  metze | 2005-09-20 11:03:20 +0200
 - reply to table_queries
 - reply to a send_request with an empty send_reply
 
 metze

Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/wrepl_server/wrepl_in_call.c


Changeset:

Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: svk:merge
   - 0c0555d6-39d7-0310-84fc-f1cc0bd64818:/branches/tmp/samba4-winsrepl:10342
3a72dc49-98ff-0310-ab52-9b7ed7945d91:/local/samba4:9495
a953eb74-4aff-0310-a63c-855d20285ebb:/local/samba4:11632
d349723c-e9fc-0310-b8a8-fdedf1c27407:/local/SAMBA_4_0:5616
d349723c-e9fc-0310-b8a8-fdedf1c27407:/local/samba-SAMBA_4_0:5609
   + 0c0555d6-39d7-0310-84fc-f1cc0bd64818:/branches/tmp/samba4-winsrepl:10343
3a72dc49-98ff-0310-ab52-9b7ed7945d91:/local/samba4:9495
a953eb74-4aff-0310-a63c-855d20285ebb:/local/samba4:11632
d349723c-e9fc-0310-b8a8-fdedf1c27407:/local/SAMBA_4_0:5616
d349723c-e9fc-0310-b8a8-fdedf1c27407:/local/samba-SAMBA_4_0:5609

Modified: branches/SAMBA_4_0/source/wrepl_server/wrepl_in_call.c
===================================================================
--- branches/SAMBA_4_0/source/wrepl_server/wrepl_in_call.c	2005-10-14 12:52:35 UTC (rev 11032)
+++ branches/SAMBA_4_0/source/wrepl_server/wrepl_in_call.c	2005-10-14 12:52:51 UTC (rev 11033)
@@ -29,6 +29,7 @@
 #include "lib/messaging/irpc.h"
 #include "librpc/gen_ndr/ndr_winsrepl.h"
 #include "wrepl_server/wrepl_server.h"
+#include "nbt_server/wins/winsdb.h"
 
 static NTSTATUS wreplsrv_in_start_association(struct wreplsrv_in_call *call)
 {
@@ -103,9 +104,66 @@
 	return wreplsrv_in_stop_assoc_ctx(call);
 }
 
+static NTSTATUS wreplsrv_in_table_query(struct wreplsrv_in_call *call)
+{
+	struct wreplsrv_service *service = call->wreplconn->service;
+	struct wrepl_replication *repl_out = &call->rep_packet.message.replication;
+	struct wrepl_table *table_out = &call->rep_packet.message.replication.info.table;
+	struct wreplsrv_owner *cur;
+	uint64_t local_max_version;
+	uint32_t i = 0;
+
+	repl_out->command = WREPL_REPL_TABLE_REPLY;
+
+	table_out->partner_count	= 0;
+	table_out->partners		= NULL;
+	table_out->initiator		= WINSDB_OWNER_LOCAL;
+
+	local_max_version = wreplsrv_local_max_version(service);
+	if (local_max_version > 0) {
+		table_out->partner_count++;
+	}
+
+	for (cur = service->table; cur; cur = cur->next) {
+		table_out->partner_count++;
+	}
+
+	table_out->partners = talloc_array(call, struct wrepl_wins_owner, table_out->partner_count);
+	NT_STATUS_HAVE_NO_MEMORY(table_out->partners);
+
+	if (local_max_version > 0) {
+		table_out->partners[i].address		= call->wreplconn->our_ip;
+		table_out->partners[i].min_version	= 0;
+		table_out->partners[i].max_version	= local_max_version;
+		table_out->partners[i].type		= 1;
+		i++;
+	}
+
+	for (cur = service->table; cur; cur = cur->next) {
+		table_out->partners[i] = cur->owner;
+		i++;
+	}
+
+	return NT_STATUS_OK;
+}
+
+static NTSTATUS wreplsrv_in_send_request(struct wreplsrv_in_call *call)
+{
+	struct wrepl_replication *repl_out = &call->rep_packet.message.replication;
+	struct wrepl_send_reply *reply_out = &call->rep_packet.message.replication.info.reply;
+
+	repl_out->command = WREPL_REPL_SEND_REPLY;
+
+	reply_out->num_names	= 0;
+	reply_out->names	= NULL;
+
+	return NT_STATUS_OK;
+}
+
 static NTSTATUS wreplsrv_in_replication(struct wreplsrv_in_call *call)
 {
 	struct wrepl_replication *repl_in = &call->req_packet.message.replication;
+	NTSTATUS status;
 
 	/*
 	 * w2k only check the assoc_ctx if the opcode has the 0x00007800 bits are set
@@ -125,24 +183,40 @@
 
 	switch (repl_in->command) {
 		case WREPL_REPL_TABLE_QUERY:
+			status = wreplsrv_in_table_query(call);
 			break;
+
 		case WREPL_REPL_TABLE_REPLY:
-			break;
+			return ERROR_INVALID_PARAMETER;
+
 		case WREPL_REPL_SEND_REQUEST:
+			status = wreplsrv_in_send_request(call);
 			break;
+
 		case WREPL_REPL_SEND_REPLY:
-			break;
+			return ERROR_INVALID_PARAMETER;
+	
 		case WREPL_REPL_UPDATE:
-			break;
+			return ERROR_INVALID_PARAMETER;
+
 		case WREPL_REPL_5:
-			break;
+			return ERROR_INVALID_PARAMETER;
+
 		case WREPL_REPL_INFORM:
-			break;
+			return ERROR_INVALID_PARAMETER;
+
 		case WREPL_REPL_9:
-			break;
+			return ERROR_INVALID_PARAMETER;
+
+		default:
+			return ERROR_INVALID_PARAMETER;
 	}
 
-	return ERROR_INVALID_PARAMETER;
+	if (NT_STATUS_IS_OK(status)) {
+		call->rep_packet.mess_type = WREPL_REPLICATION;
+	}
+
+	return status;
 }
 
 static NTSTATUS wreplsrv_in_invalid_assoc_ctx(struct wreplsrv_in_call *call)



More information about the samba-cvs mailing list