From 96bc4042779570e6239b2626888ea0ca9be17391 Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Tue, 9 Jun 1998 01:56:18 +0000 Subject: 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 -)----- (This used to be commit e420a4bd7d368a0e910893400fb7b46ab8694a08) --- source3/nmbd/nmbd_namequery.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'source3/nmbd/nmbd_namequery.c') diff --git a/source3/nmbd/nmbd_namequery.c b/source3/nmbd/nmbd_namequery.c index 509b3b3107..7c2b0d4d76 100644 --- a/source3/nmbd/nmbd_namequery.c +++ b/source3/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; } -- cgit