Name change to make naming more uniform.

git-svn-id: file:///svn/unbound/trunk@345 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2007-05-29 12:31:02 +00:00
parent 1065ff7c17
commit d2318c50cd
6 changed files with 17 additions and 16 deletions

View file

@ -137,7 +137,7 @@ replyerror_fillbuf(int r, struct comm_reply* repinfo, uint16_t id,
ldns_buffer_write(buf, &flags, sizeof(uint16_t));
ldns_buffer_write(buf, &flags, sizeof(uint16_t));
ldns_buffer_write(buf, &flags, sizeof(uint16_t));
ldns_buffer_write(buf, qinfo->qname, qinfo->qnamesize);
ldns_buffer_write(buf, qinfo->qname, qinfo->qname_len);
ldns_buffer_write_u16(buf, qinfo->qtype);
ldns_buffer_write_u16(buf, qinfo->qclass);
ldns_buffer_flip(buf);

View file

@ -3,6 +3,7 @@
- lookup message from msg cache (and copy to region).
- fixed cast error in dns msg lookup.
- message with duplicate rrset does not increase its TTLs twice.
- 'qnamesize' changed to 'qname_len' for similar naming scheme.
25 May 2007: Wouter
- Acknowledge use of unbound-java code in iterator. Nicer readme.

View file

@ -125,7 +125,7 @@ fwd_new(struct module_qstate* qstate, int id)
outbound_list_init(&iq->outlist);
if(qstate->qinfo.has_cd)
flags |= BIT_CD;
e = (*env->send_query)(qstate->qinfo.qname, qstate->qinfo.qnamesize,
e = (*env->send_query)(qstate->qinfo.qname, qstate->qinfo.qname_len,
qstate->qinfo.qtype, qstate->qinfo.qclass, flags, dnssec,
&ie->fwd_addr, ie->fwd_addrlen, qstate);
if(!e)
@ -327,7 +327,7 @@ processInitRequest(struct module_qstate* qstate, struct iter_qstate* iq,
* we just look for the closest set of server to the parent of qname.
*/
delname = qstate->qinfo.qname;
delnamelen = qstate->qinfo.qnamesize;
delnamelen = qstate->qinfo.qname_len;
if(qstate->qinfo.qtype == LDNS_RR_TYPE_DS && delname[0] != 0) {
/* do not adjust root label */
size_t lablen = delname[0] + 1;

View file

@ -286,7 +286,7 @@ tomsg(struct module_env* env, struct msgreply_entry* e, struct reply_info* r,
return NULL;
memcpy(&msg->qinfo, &e->key, sizeof(struct query_info));
msg->qinfo.qname = region_alloc_init(region, e->key.qname,
e->key.qnamesize);
e->key.qname_len);
if(!msg->qinfo.qname)
return NULL;
/* allocate replyinfo struct and rrset key array separately */
@ -326,7 +326,7 @@ dns_cache_lookup(struct module_env* env,
/* lookup first, this has both NXdomains and ANSWER responses */
k.qname = qname;
k.qnamesize = qnamelen;
k.qname_len = qnamelen;
k.qtype = qtype;
k.qclass = qclass;
k.has_cd = has_cd;

View file

@ -68,7 +68,7 @@ parse_create_qinfo(ldns_buffer* pkt, struct msg_parse* msg,
if(!qinf->qname) return 0;
dname_pkt_copy(pkt, qinf->qname, msg->qname);
} else qinf->qname = 0;
qinf->qnamesize = msg->qname_len;
qinf->qname_len = msg->qname_len;
qinf->qtype = msg->qtype;
qinf->qclass = msg->qclass;
qinf->has_cd = 0;
@ -430,7 +430,7 @@ query_info_parse(struct query_info* m, ldns_buffer* query)
m->has_cd = LDNS_CD_WIRE(q)?1:0;
ldns_buffer_skip(query, LDNS_HEADER_SIZE);
m->qname = ldns_buffer_current(query);
if((m->qnamesize = query_dname_len(query)) == 0)
if((m->qname_len = query_dname_len(query)) == 0)
return 0; /* parse error */
if(ldns_buffer_remaining(query) < 4)
return 0; /* need qtype, qclass */
@ -443,11 +443,11 @@ int
query_info_allocqname(struct query_info* m)
{
uint8_t* q = m->qname;
if(!(m->qname = (uint8_t*)malloc(m->qnamesize))) {
if(!(m->qname = (uint8_t*)malloc(m->qname_len))) {
log_err("query_info_allocqname: out of memory");
return 0; /* out of memory */
}
memcpy(m->qname, q, m->qnamesize);
memcpy(m->qname, q, m->qname_len);
return 1;
}
@ -467,7 +467,7 @@ query_info_compare(void* m1, void* m2)
COMPARE_IT(msg1->qtype, msg2->qtype);
if((mc = query_dname_compare(msg1->qname, msg2->qname)) != 0)
return mc;
log_assert(msg1->qnamesize == msg2->qnamesize);
log_assert(msg1->qname_len == msg2->qname_len);
COMPARE_IT(msg1->has_cd, msg2->has_cd);
COMPARE_IT(msg1->qclass, msg2->qclass);
return 0;
@ -487,7 +487,7 @@ msgreply_sizefunc(void* k, void* d)
struct query_info* q = (struct query_info*)k;
struct reply_info* r = (struct reply_info*)d;
size_t s = sizeof(struct msgreply_entry) + sizeof(struct reply_info)
+ q->qnamesize;
+ q->qname_len;
s += (r->rrset_count-1) * sizeof(struct rrset_ref);
s += r->rrset_count * sizeof(struct ub_packed_rrset_key*);
return s;
@ -1021,13 +1021,13 @@ int reply_info_encode(struct query_info* qinfo, struct reply_info* rep,
/* insert query section */
if(rep->qdcount) {
if(ldns_buffer_remaining(buffer) <
qinfo->qnamesize+sizeof(uint16_t)*2)
qinfo->qname_len+sizeof(uint16_t)*2)
return 0; /* buffer too small */
if(!compress_tree_store(&tree, qinfo->qname,
dname_count_labels(qinfo->qname),
ldns_buffer_position(buffer), region, NULL))
return 0;
ldns_buffer_write(buffer, qinfo->qname, qinfo->qnamesize);
ldns_buffer_write(buffer, qinfo->qname, qinfo->qname_len);
ldns_buffer_write_u16(buffer, qinfo->qtype);
ldns_buffer_write_u16(buffer, qinfo->qclass);
}
@ -1152,7 +1152,7 @@ query_info_entrysetup(struct query_info* q, struct reply_info* r,
lock_protect(&e->entry.lock, &e->key, sizeof(e->key));
lock_protect(&e->entry.lock, &e->entry.hash, sizeof(e->entry.hash) +
sizeof(e->entry.key) + sizeof(e->entry.data));
lock_protect(&e->entry.lock, e->key.qname, e->key.qnamesize);
lock_protect(&e->entry.lock, e->key.qname, e->key.qname_len);
q->qname = NULL;
return e;
}
@ -1169,7 +1169,7 @@ qinfo_query_encode(ldns_buffer* pkt, struct query_info* qinfo)
ldns_buffer_write_u16(pkt, flags);
ldns_buffer_write_u16(pkt, 1); /* query count */
ldns_buffer_write(pkt, "\000\000\000\000\000\000", 6); /* counts */
ldns_buffer_write(pkt, qinfo->qname, qinfo->qnamesize);
ldns_buffer_write(pkt, qinfo->qname, qinfo->qname_len);
ldns_buffer_write_u16(pkt, qinfo->qtype);
ldns_buffer_write_u16(pkt, qinfo->qclass);
ldns_buffer_flip(pkt);

View file

@ -61,7 +61,7 @@ struct query_info {
*/
uint8_t* qname;
/** length of qname (including last 0 octet) */
size_t qnamesize;
size_t qname_len;
/** qtype, host byte order */
uint16_t qtype;
/** qclass, host byte order */