summaryrefslogtreecommitdiffstats
path: root/source/nmbsync.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1996-06-04 15:14:47 +0000
committerAndrew Tridgell <tridge@samba.org>1996-06-04 15:14:47 +0000
commit045014aa57721b9701ca379bcab055b908773184 (patch)
tree3728ee54adc0c956ae3762f260958b16f9fb370e /source/nmbsync.c
parentbc4a2994377ab078d3d1a900f79fda9dfe4d0e6a (diff)
downloadsamba-045014aa57721b9701ca379bcab055b908773184.tar.gz
samba-045014aa57721b9701ca379bcab055b908773184.tar.xz
samba-045014aa57721b9701ca379bcab055b908773184.zip
Did more integration of Lukes code ready for the first release.
I've now got WINS registration working, and refresh working. Its looking pretty good so far, but needs lots of testing.
Diffstat (limited to 'source/nmbsync.c')
-rw-r--r--source/nmbsync.c132
1 files changed, 66 insertions, 66 deletions
diff --git a/source/nmbsync.c b/source/nmbsync.c
index 5a6c07086ab..c3e3f43e517 100644
--- a/source/nmbsync.c
+++ b/source/nmbsync.c
@@ -58,78 +58,78 @@ adds information retrieved from a NetServerEnum call
****************************************************************************/
static BOOL add_info(struct domain_record *d, struct work_record *work, int servertype)
{
- char *rparam = NULL;
- char *rdata = NULL;
- int rdrcnt,rprcnt;
- char *p;
- pstring param;
- int uLevel = 1;
- int count = -1;
-
- /* now send a SMBtrans command with api ServerEnum? */
- p = param;
- SSVAL(p,0,0x68); /* api number */
- p += 2;
- strcpy(p,"WrLehDz");
- p = skip_string(p,1);
-
- strcpy(p,"B16BBDz");
-
- p = skip_string(p,1);
- SSVAL(p,0,uLevel);
- SSVAL(p,2,0x2000); /* buf length */
- p += 4;
- SIVAL(p,0,servertype);
- p += 4;
-
- strcpy(p, work->work_group);
- p = skip_string(p,1);
-
- if (cli_call_api(PTR_DIFF(p,param),0, 8,10000,
- &rprcnt,&rdrcnt, param,NULL,
- &rparam,&rdata))
+ char *rparam = NULL;
+ char *rdata = NULL;
+ int rdrcnt,rprcnt;
+ char *p;
+ pstring param;
+ int uLevel = 1;
+ int count = -1;
+
+ /* now send a SMBtrans command with api ServerEnum? */
+ p = param;
+ SSVAL(p,0,0x68); /* api number */
+ p += 2;
+ strcpy(p,"WrLehDz");
+ p = skip_string(p,1);
+
+ strcpy(p,"B16BBDz");
+
+ p = skip_string(p,1);
+ SSVAL(p,0,uLevel);
+ SSVAL(p,2,0x2000); /* buf length */
+ p += 4;
+ SIVAL(p,0,servertype);
+ p += 4;
+
+ strcpy(p, work->work_group);
+ p = skip_string(p,1);
+
+ if (cli_call_api(PTR_DIFF(p,param),0, 8,10000,
+ &rprcnt,&rdrcnt, param,NULL,
+ &rparam,&rdata))
+ {
+ int res = SVAL(rparam,0);
+ int converter=SVAL(rparam,2);
+ int i;
+
+ if (res == 0)
{
- int res = SVAL(rparam,0);
- int converter=SVAL(rparam,2);
- int i;
-
- if (res == 0)
+ count=SVAL(rparam,4);
+ p = rdata;
+
+ for (i = 0;i < count;i++, p += 26)
+ {
+ char *sname = p;
+ uint32 stype = IVAL(p,18);
+ int comment_offset = IVAL(p,22) & 0xFFFF;
+ char *cmnt = comment_offset?(rdata+comment_offset-converter):"";
+
+ struct work_record *w = work;
+
+ DEBUG(4, ("\t%-16.16s %08x %s\n", sname, stype, cmnt));
+
+ if (stype & SV_TYPE_DOMAIN_ENUM)
{
- count=SVAL(rparam,4);
- p = rdata;
-
- for (i = 0;i < count;i++, p += 26)
+ /* creates workgroup on remote subnet */
+ if ((w = find_workgroupstruct(d,sname, False)))
+ {
+ if (ip_equal(bcast_ip, d->bcast_ip))
{
- char *sname = p;
- uint32 stype = IVAL(p,18);
- int comment_offset = IVAL(p,22) & 0xFFFF;
- char *cmnt = comment_offset?(rdata+comment_offset-converter):"";
-
- struct work_record *w = work;
-
- DEBUG(4, ("\t%-16.16s %08x %s\n", sname, stype, cmnt));
-
- if (stype & SV_TYPE_DOMAIN_ENUM)
- {
- /* creates workgroup on remote subnet */
- if ((w = find_workgroupstruct(d,sname, False)))
- {
- if (ip_equal(bcast_ip, d->bcast_ip))
- {
- announce_request(w, d->bcast_ip);
- }
- }
- }
-
- add_server_entry(d,w,sname,stype,lp_max_ttl(),cmnt,False);
+ announce_request(w, d->bcast_ip);
}
+ }
}
+
+ add_server_entry(d,w,sname,stype,lp_max_ttl(),cmnt,False);
+ }
}
-
- if (rparam) free(rparam);
- if (rdata) free(rdata);
-
- return(True);
+ }
+
+ if (rparam) free(rparam);
+ if (rdata) free(rdata);
+
+ return(True);
}