summaryrefslogtreecommitdiff
path: root/source/nmbd/nmbd_namequery.c
diff options
context:
space:
mode:
authorChristopher R. Hertel <crh@samba.org>1998-06-09 01:56:18 +0000
committerChristopher R. Hertel <crh@samba.org>1998-06-09 01:56:18 +0000
commite420a4bd7d368a0e910893400fb7b46ab8694a08 (patch)
treee653e7613b5c3fa406864a596e51f42a47d3cb78 /source/nmbd/nmbd_namequery.c
parent530b54b8a2234a72d7a12606bff38648e56c5c1c (diff)
downloadsamba-e420a4bd7d368a0e910893400fb7b46ab8694a08.tar.gz
This is a first step toward moving long namelists into a database. I
split the name_record structure into pieces. The goal is that the key (the name) be separate from the data associated with the key. Databases such as gdbm store information in [key,content] pairs. There is no functional change in with this update. It's just a step in the direction that Jeremy and I have been discussing. Chris -)-----
Diffstat (limited to 'source/nmbd/nmbd_namequery.c')
-rw-r--r--source/nmbd/nmbd_namequery.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/source/nmbd/nmbd_namequery.c b/source/nmbd/nmbd_namequery.c
index 509b3b31072..7c2b0d4d760 100644
--- a/source/nmbd/nmbd_namequery.c
+++ b/source/nmbd/nmbd_namequery.c
@@ -37,7 +37,8 @@ static void query_name_response(struct subnet_record *subrec,
{
struct nmb_packet *nmb = &p->packet.nmb;
BOOL success = False;
- struct nmb_name *question_name = &rrec->packet->packet.nmb.question.question_name;
+ struct nmb_name *question_name =
+ &rrec->packet->packet.nmb.question.question_name;
struct in_addr answer_ip;
/* Ensure we don't retry the query but leave the response record cleanup
@@ -157,8 +158,9 @@ static BOOL query_local_namelists(struct subnet_record *subrec, struct nmb_name
if((namerec = find_name_on_subnet(subrec, nmbname, FIND_ANY_NAME))==NULL)
return False;
- if(NAME_IS_ACTIVE(namerec) && ((namerec->source == SELF_NAME) ||
- (namerec->source == LMHOSTS_NAME)) )
+ if( NAME_IS_ACTIVE(namerec)
+ && ( (namerec->data.source == SELF_NAME)
+ || (namerec->data.source == LMHOSTS_NAME) ) )
{
*namerecp = namerec;
return True;
@@ -198,23 +200,23 @@ BOOL query_name(struct subnet_record *subrec, char *name, int type,
rrec.rr_type = RR_TYPE_NB;
rrec.rr_class = RR_CLASS_IN;
rrec.ttl = PERMANENT_TTL;
- rrec.rdlength = namerec->num_ips * 6;
+ rrec.rdlength = namerec->data.num_ips * 6;
if(rrec.rdlength > MAX_DGRAM_SIZE)
{
DEBUG(0,("query_name: nmbd internal error - there are %d ip addresses for name %s.\n",
- namerec->num_ips, namestr(&nmbname) ));
+ namerec->data.num_ips, namestr(&nmbname) ));
return False;
}
- for( i = 0; i < namerec->num_ips; i++)
+ for( i = 0; i < namerec->data.num_ips; i++)
{
- set_nb_flags( &rrec.rdata[i*6], namerec->nb_flags );
- putip( &rrec.rdata[(i*6) + 2], (char *)&namerec->ip[i]);
+ set_nb_flags( &rrec.rdata[i*6], namerec->data.nb_flags );
+ putip( &rrec.rdata[(i*6) + 2], (char *)&namerec->data.ip[i]);
}
/* Call the success function directly. */
if(success_fn)
- (*success_fn)(subrec, userdata, &nmbname, namerec->ip[0], &rrec);
+ (*success_fn)(subrec, userdata, &nmbname, namerec->data.ip[0], &rrec);
return False;
}