svn commit: samba r9624 - in branches/SAMBA_4_0/source/lib/samba3: .

jelmer at samba.org jelmer at samba.org
Thu Aug 25 22:57:56 GMT 2005


Author: jelmer
Date: 2005-08-25 22:57:56 +0000 (Thu, 25 Aug 2005)
New Revision: 9624

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

Log:
Support writing wins.ldif

Modified:
   branches/SAMBA_4_0/source/lib/samba3/upgrade.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/samba3/upgrade.c
===================================================================
--- branches/SAMBA_4_0/source/lib/samba3/upgrade.c	2005-08-25 22:29:55 UTC (rev 9623)
+++ branches/SAMBA_4_0/source/lib/samba3/upgrade.c	2005-08-25 22:57:56 UTC (rev 9624)
@@ -121,8 +121,29 @@
 	return -1;
 }
 
-int samba3_upgrade_winsdb(struct samba3 *samba3, struct ldb_context *ctx, struct ldb_message ***msgs)
+int samba3_upgrade_winsdb(struct samba3 *samba3, struct ldb_context *ldb, struct ldb_message ***msgs)
 {
-	/* FIXME */
-	return -1;
+	int i;
+	int count = 0;
+	
+	for (i = 0; i < samba3->winsdb_count; i++) {
+		struct samba3_winsdb_entry *e = &samba3->winsdb_entries[i];
+		int j;
+		struct ldb_message *msg = msg_array_add(ldb, msgs, &count);
+
+		msg->dn = ldb_dn_string_compose(ldb, NULL, "type=%d,name=%s", e->type, e->name);
+
+		ldb_msg_add_string(ldb, msg, "name", e->name);
+		ldb_msg_add_fmt(ldb, msg, "type", "%d", e->type);
+		ldb_msg_add_string(ldb, msg, "objectClass", "wins");
+		ldb_msg_add_fmt(ldb, msg, "nbFlags", "%x", e->nb_flags);
+		ldb_msg_add_string(ldb, msg, "expires", 
+				  ldap_timestring(msg, e->ttl));
+
+		for (j = 0; j < e->ip_count; j++) {
+			ldb_msg_add_string(ldb, msg, "address", sys_inet_ntoa(e->ips[j]));
+		}
+	}
+
+	return count;
 }



More information about the samba-cvs mailing list