Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Per Cederqvist
lyskom-server-ceder-1616-generations-topgit
Commits
6ca99f81
Commit
6ca99f81
authored
Jul 22, 2003
by
Per Cederqvist
Browse files
Updated for new macro names in dlist.h.
parent
f29cebcc
Changes
10
Hide whitespace changes
Inline
Side-by-side
src/libraries/adns/client/adh-query.c
View file @
6ca99f81
...
...
@@ -103,7 +103,7 @@ void of_ptr(const struct optioninfo *oi, const char *arg, const char *arg2) {
&
qun
->
qu
);
if
(
r
)
sysfail
(
"adns_submit_reverse"
,
r
);
LIST_LINK_TAIL
(
outstanding
,
qun
);
ADNS_
LIST_LINK_TAIL
(
outstanding
,
qun
);
}
void
of_reverse
(
const
struct
optioninfo
*
oi
,
const
char
*
arg
,
const
char
*
arg2
)
{
...
...
@@ -126,7 +126,7 @@ void of_reverse(const struct optioninfo *oi, const char *arg, const char *arg2)
&
qun
->
qu
);
if
(
r
)
sysfail
(
"adns_submit_reverse"
,
r
);
LIST_LINK_TAIL
(
outstanding
,
qun
);
ADNS_
LIST_LINK_TAIL
(
outstanding
,
qun
);
}
void
query_do
(
const
char
*
domain
)
{
...
...
@@ -142,11 +142,11 @@ void query_do(const char *domain) {
&
qun
->
qu
);
if
(
r
)
sysfail
(
"adns_submit"
,
r
);
LIST_LINK_TAIL
(
outstanding
,
qun
);
ADNS_
LIST_LINK_TAIL
(
outstanding
,
qun
);
}
static
void
dequeue_query
(
struct
query_node
*
qun
)
{
LIST_UNLINK
(
outstanding
,
qun
);
ADNS_
LIST_UNLINK
(
outstanding
,
qun
);
free
(
qun
->
id
);
free
(
qun
->
owner
);
free
(
qun
);
...
...
src/libraries/adns/client/adnsresfilter.c
View file @
6ca99f81
...
...
@@ -225,7 +225,7 @@ static void queueoutchar(int c) {
entry
->
textp
=
entry
->
buffer
;
entry
->
textlen
=
0
;
entry
->
addr
=
0
;
LIST_LINK_TAIL
(
outqueue
,
entry
);
ADNS_
LIST_LINK_TAIL
(
outqueue
,
entry
);
outqueuelen
++
;
}
entry
->
textp
[
entry
->
textlen
++
]
=
c
;
...
...
@@ -250,7 +250,7 @@ static void writestdout(struct outqueuenode *entry) {
entry
->
textlen
-=
r
;
}
if
(
!
entry
->
textlen
)
{
LIST_UNLINK
(
outqueue
,
entry
);
ADNS_
LIST_UNLINK
(
outqueue
,
entry
);
free
(
entry
->
buffer
);
free
(
entry
);
outqueuelen
--
;
...
...
@@ -336,7 +336,7 @@ static void procaddr(void) {
entry
->
textlen
=
inbuf
;
entry
->
addr
=
foundthing
;
entry
->
printbefore
=
printbefore
;
LIST_LINK_TAIL
(
outqueue
,
entry
);
ADNS_
LIST_LINK_TAIL
(
outqueue
,
entry
);
outqueuelen
++
;
inbuf
=
0
;
cbyte
=
-
1
;
...
...
src/libraries/adns/regress/hcommon.c
View file @
6ca99f81
...
...
@@ -231,7 +231,7 @@ void *Hmalloc(size_t sz) {
char
*
ep
;
assert
(
sz
);
newnode
=
malloc
(
MALLOCHSZ
+
sz
);
if
(
!
newnode
)
Tnomem
();
LIST_LINK_TAIL
(
mallocedlist
,
newnode
);
ADNS_
LIST_LINK_TAIL
(
mallocedlist
,
newnode
);
newnode
->
sz
=
sz
;
newnode
->
count
=
++
malloccount
;
if
(
!
mallocfailat
)
{
...
...
@@ -251,7 +251,7 @@ void Hfree(void *ptr) {
struct
malloced
*
oldnode
;
if
(
!
ptr
)
return
;
oldnode
=
(
void
*
)((
char
*
)
ptr
-
MALLOCHSZ
);
LIST_UNLINK
(
mallocedlist
,
oldnode
);
ADNS_
LIST_UNLINK
(
mallocedlist
,
oldnode
);
memset
(
&
oldnode
->
data
,
0x38
,
oldnode
->
sz
);
free
(
oldnode
);
}
...
...
src/libraries/adns/regress/hcommon.c.m4
View file @
6ca99f81
...
...
@@ -258,7 +258,7 @@ void *Hmalloc(size_t sz) {
newnode= malloc(MALLOCHSZ + sz); if (!newnode) Tnomem();
LIST_LINK_TAIL(mallocedlist,newnode);
ADNS_
LIST_LINK_TAIL(mallocedlist,newnode);
newnode->sz= sz;
newnode->count= ++malloccount;
if (!mallocfailat) {
...
...
@@ -281,7 +281,7 @@ void Hfree(void *ptr) {
if (!ptr) return;
oldnode= (void*)((char*)ptr - MALLOCHSZ);
LIST_UNLINK(mallocedlist,oldnode);
ADNS_
LIST_UNLINK(mallocedlist,oldnode);
memset(&oldnode->data,0x38,oldnode->sz);
free(oldnode);
}
...
...
src/libraries/adns/src/event.c
View file @
6ca99f81
...
...
@@ -204,7 +204,7 @@ static void timeouts_queue(adns_state ads, int act,
inter_maxtoabs
(
tv_io
,
tvbuf
,
now
,
qu
->
timeout
);
}
else
{
if
(
!
act
)
{
inter_immed
(
tv_io
,
tvbuf
);
return
;
}
LIST_UNLINK
(
*
queue
,
qu
);
ADNS_
LIST_UNLINK
(
*
queue
,
qu
);
if
(
qu
->
state
!=
query_tosend
)
{
adns__query_fail
(
qu
,
adns_s_timeout
);
}
else
{
...
...
@@ -228,7 +228,7 @@ static void tcp_events(adns_state ads, int act,
nqu
=
qu
->
next
;
assert
(
qu
->
state
==
query_tcpw
);
if
(
qu
->
retries
>
ads
->
nservers
)
{
LIST_UNLINK
(
ads
->
tcpw
,
qu
);
ADNS_
LIST_UNLINK
(
ads
->
tcpw
,
qu
);
adns__query_fail
(
qu
,
adns_s_allservfail
);
}
}
...
...
@@ -666,7 +666,7 @@ int adns__internal_check(adns_state ads,
}
else
{
if
(
qu
->
id
>=
0
)
return
EAGAIN
;
}
LIST_UNLINK
(
ads
->
output
,
qu
);
ADNS_
LIST_UNLINK
(
ads
->
output
,
qu
);
*
answer
=
qu
->
answer
;
if
(
context_r
)
*
context_r
=
qu
->
ctx
.
ext
;
*
query_io
=
qu
;
...
...
src/libraries/adns/src/query.c
View file @
6ca99f81
...
...
@@ -48,9 +48,9 @@ static adns_query query_alloc(adns_state ads, const typeinfo *typei,
qu
->
ads
=
ads
;
qu
->
state
=
query_tosend
;
qu
->
back
=
qu
->
next
=
qu
->
parent
=
0
;
LIST_INIT
(
qu
->
children
);
LINK_INIT
(
qu
->
siblings
);
LIST_INIT
(
qu
->
allocations
);
ADNS_
LIST_INIT
(
qu
->
children
);
ADNS_
LINK_INIT
(
qu
->
siblings
);
ADNS_
LIST_INIT
(
qu
->
allocations
);
qu
->
interim_allocd
=
0
;
qu
->
preserved_allocd
=
0
;
qu
->
final_allocspace
=
0
;
...
...
@@ -334,7 +334,7 @@ static void *alloc_common(adns_query qu, size_t sz) {
assert
(
!
qu
->
final_allocspace
);
an
=
malloc
(
MEM_ROUND
(
MEM_ROUND
(
sizeof
(
*
an
))
+
sz
));
if
(
!
an
)
return
0
;
LIST_LINK_TAIL
(
qu
->
allocations
,
an
);
ADNS_
LIST_LINK_TAIL
(
qu
->
allocations
,
an
);
return
(
byte
*
)
an
+
MEM_ROUND
(
sizeof
(
*
an
));
}
...
...
@@ -371,8 +371,8 @@ void adns__transfer_interim(adns_query from, adns_query to, void *block, size_t
assert
(
!
to
->
final_allocspace
);
assert
(
!
from
->
final_allocspace
);
LIST_UNLINK
(
from
->
allocations
,
an
);
LIST_LINK_TAIL
(
to
->
allocations
,
an
);
ADNS_
LIST_UNLINK
(
from
->
allocations
,
an
);
ADNS_
LIST_LINK_TAIL
(
to
->
allocations
,
an
);
sz
=
MEM_ROUND
(
sz
);
from
->
interim_allocd
-=
sz
;
...
...
@@ -419,7 +419,7 @@ static void free_query_allocs(adns_query qu) {
cancel_children
(
qu
);
for
(
an
=
qu
->
allocations
.
head
;
an
;
an
=
ann
)
{
ann
=
an
->
next
;
free
(
an
);
}
LIST_INIT
(
qu
->
allocations
);
ADNS_
LIST_INIT
(
qu
->
allocations
);
adns__vbuf_free
(
&
qu
->
vb
);
adns__vbuf_free
(
&
qu
->
search_vb
);
free
(
qu
->
query_dgram
);
...
...
@@ -431,19 +431,19 @@ void adns_cancel(adns_query qu) {
ads
=
qu
->
ads
;
adns__consistency
(
ads
,
qu
,
cc_entex
);
if
(
qu
->
parent
)
LIST_UNLINK_PART
(
qu
->
parent
->
children
,
qu
,
siblings
.);
if
(
qu
->
parent
)
ADNS_
LIST_UNLINK_PART
(
qu
->
parent
->
children
,
qu
,
siblings
.);
switch
(
qu
->
state
)
{
case
query_tosend
:
LIST_UNLINK
(
ads
->
udpw
,
qu
);
ADNS_
LIST_UNLINK
(
ads
->
udpw
,
qu
);
break
;
case
query_tcpw
:
LIST_UNLINK
(
ads
->
tcpw
,
qu
);
ADNS_
LIST_UNLINK
(
ads
->
tcpw
,
qu
);
break
;
case
query_childw
:
LIST_UNLINK
(
ads
->
childw
,
qu
);
ADNS_
LIST_UNLINK
(
ads
->
childw
,
qu
);
break
;
case
query_done
:
LIST_UNLINK
(
ads
->
output
,
qu
);
ADNS_
LIST_UNLINK
(
ads
->
output
,
qu
);
break
;
default:
abort
();
...
...
@@ -530,15 +530,15 @@ void adns__query_done(adns_query qu) {
ans
->
expires
=
qu
->
expires
;
parent
=
qu
->
parent
;
if
(
parent
)
{
LIST_UNLINK_PART
(
parent
->
children
,
qu
,
siblings
.);
LIST_UNLINK
(
qu
->
ads
->
childw
,
parent
);
ADNS_
LIST_UNLINK_PART
(
parent
->
children
,
qu
,
siblings
.);
ADNS_
LIST_UNLINK
(
qu
->
ads
->
childw
,
parent
);
qu
->
ctx
.
callback
(
parent
,
qu
);
free_query_allocs
(
qu
);
free
(
qu
->
answer
);
free
(
qu
);
}
else
{
makefinal_query
(
qu
);
LIST_LINK_TAIL
(
qu
->
ads
->
output
,
qu
);
ADNS_
LIST_LINK_TAIL
(
qu
->
ads
->
output
,
qu
);
qu
->
state
=
query_done
;
}
}
...
...
src/libraries/adns/src/reply.c
View file @
6ca99f81
...
...
@@ -100,8 +100,8 @@ void adns__procdgram(adns_state ads, const byte *dgram, int dglen,
}
if
(
qu
)
{
/* We're definitely going to do something with this query now */
if
(
viatcp
)
LIST_UNLINK
(
ads
->
tcpw
,
qu
);
else
LIST_UNLINK
(
ads
->
udpw
,
qu
);
if
(
viatcp
)
ADNS_
LIST_UNLINK
(
ads
->
tcpw
,
qu
);
else
ADNS_
LIST_UNLINK
(
ads
->
udpw
,
qu
);
}
}
...
...
@@ -333,7 +333,7 @@ void adns__procdgram(adns_state ads, const byte *dgram, int dglen,
/* This may have generated some child queries ... */
if
(
qu
->
children
.
head
)
{
qu
->
state
=
query_childw
;
LIST_LINK_TAIL
(
ads
->
childw
,
qu
);
ADNS_
LIST_LINK_TAIL
(
ads
->
childw
,
qu
);
return
;
}
adns__query_done
(
qu
);
...
...
src/libraries/adns/src/setup.c
View file @
6ca99f81
...
...
@@ -467,10 +467,10 @@ static int init_begin(adns_state *ads_r, adns_initflags flags, FILE *diagfile) {
ads
->
iflags
=
flags
;
ads
->
diagfile
=
diagfile
;
ads
->
configerrno
=
0
;
LIST_INIT
(
ads
->
udpw
);
LIST_INIT
(
ads
->
tcpw
);
LIST_INIT
(
ads
->
childw
);
LIST_INIT
(
ads
->
output
);
ADNS_
LIST_INIT
(
ads
->
udpw
);
ADNS_
LIST_INIT
(
ads
->
tcpw
);
ADNS_
LIST_INIT
(
ads
->
childw
);
ADNS_
LIST_INIT
(
ads
->
output
);
ads
->
forallnext
=
0
;
ads
->
nextid
=
0x311f
;
ads
->
udpsocket
=
ads
->
tcpsocket
=
-
1
;
...
...
src/libraries/adns/src/transmit.c
View file @
6ca99f81
...
...
@@ -216,7 +216,7 @@ static void query_usetcp(adns_query qu, struct timeval now) {
qu
->
state
=
query_tcpw
;
qu
->
timeout
=
now
;
timevaladd
(
&
qu
->
timeout
,
TCPWAITMS
);
LIST_LINK_TAIL
(
qu
->
ads
->
tcpw
,
qu
);
ADNS_
LIST_LINK_TAIL
(
qu
->
ads
->
tcpw
,
qu
);
adns__querysend_tcp
(
qu
,
now
);
adns__tcp_tryconnect
(
qu
->
ads
,
now
);
}
...
...
@@ -255,5 +255,5 @@ void adns__query_send(adns_query qu, struct timeval now) {
qu
->
udpsent
|=
(
1
<<
serv
);
qu
->
udpnextserver
=
(
serv
+
1
)
%
ads
->
nservers
;
qu
->
retries
++
;
LIST_LINK_TAIL
(
ads
->
udpw
,
qu
);
ADNS_
LIST_LINK_TAIL
(
ads
->
udpw
,
qu
);
}
src/libraries/adns/src/types.c
View file @
6ca99f81
...
...
@@ -449,7 +449,7 @@ static void icb_hostaddr(adns_query parent, adns_query child) {
adns__transfer_interim
(
child
,
parent
,
rrp
->
addrs
,
rrp
->
naddrs
*
sizeof
(
adns_rr_addr
));
if
(
parent
->
children
.
head
)
{
LIST_LINK_TAIL
(
ads
->
childw
,
parent
);
ADNS_
LIST_LINK_TAIL
(
ads
->
childw
,
parent
);
}
else
{
adns__query_done
(
parent
);
}
...
...
@@ -501,7 +501,7 @@ static adns_status pap_hostaddr(const parseinfo *pai, int *cbyte_io,
if
(
st
)
return
st
;
nqu
->
parent
=
pai
->
qu
;
LIST_LINK_TAIL_PART
(
pai
->
qu
->
children
,
nqu
,
siblings
.);
ADNS_
LIST_LINK_TAIL_PART
(
pai
->
qu
->
children
,
nqu
,
siblings
.);
return
adns_s_ok
;
}
...
...
@@ -704,7 +704,7 @@ static void icb_ptr(adns_query parent, adns_query child) {
adns__query_done
(
parent
);
return
;
}
else
{
LIST_LINK_TAIL
(
ads
->
childw
,
parent
);
ADNS_
LIST_LINK_TAIL
(
ads
->
childw
,
parent
);
return
;
}
}
...
...
@@ -776,7 +776,7 @@ static adns_status pa_ptr(const parseinfo *pai, int dmstart, int max, void *data
if
(
st
)
return
st
;
nqu
->
parent
=
pai
->
qu
;
LIST_LINK_TAIL_PART
(
pai
->
qu
->
children
,
nqu
,
siblings
.);
ADNS_
LIST_LINK_TAIL_PART
(
pai
->
qu
->
children
,
nqu
,
siblings
.);
return
adns_s_ok
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment