Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
BIND
Commits
e800570a
Commit
e800570a
authored
Feb 06, 1999
by
Bob Halley
Browse files
add dns_rdataslab_size(); remove dns_rdataslab_tordataset()
parent
1366b783
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/dns/include/dns/rdataslab.h
View file @
e800570a
...
...
@@ -30,14 +30,14 @@
* This module deals with low-level byte streams. Errors in any of
* the functions are likely to crash the server or corrupt memory.
*
* If the caller passes invalid memory references, these functions are
* likely to crash the server or corrupt memory.
*
* Resources:
* None.
*
* Security:
*
* Very little range checking is done in these functions for rdata
* copied in or out. It is assumed that the caller knows what is
* going on.
* None.
*
* Standards:
* None.
...
...
@@ -77,26 +77,16 @@ dns_rdataslab_fromrdataset(dns_rdataset_t *rdataset, isc_mem_t *mctx,
* <XXX others>
*/
dns_result_t
dns_rdataslab_tordataset
(
dns_rdataset_t
*
rdataset
,
isc_region_t
*
region
,
unsigned
int
reservelen
);
unsigned
int
dns_rdataslab_size
(
unsigned
char
*
slab
,
unsigned
int
reservelen
);
/*
*
Unslabify
a rdatas
et. The slab is not deallocated
.
*
Return the total size of
a
n
rdatas
lab
.
*
* Requires:
* 'rdataset' is valid.
*
* 'region' points to a region of memory that contains the slabified
* data at offset 'reservelen'.
*
* Ensures:
* 'rdataset' contains the structure version of data in 'region'.
* 'slab' points to a slab.
*
* Returns:
* DNS_R_SUCCESS - successful completion
* DNS_R_NOMEM - no memory.
* <XXX others>
* The number of bytes in the slab, including the reservelen.
*/
#endif
/* DNS_RDATADLAB_H */
lib/dns/rdataslab.c
View file @
e800570a
...
...
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: rdataslab.c,v 1.
1
1999/0
1/27 08:44:10 explorer
Exp $ */
/* $Id: rdataslab.c,v 1.
2
1999/0
2/06 00:07:08 halley
Exp $ */
#include
<config.h>
...
...
@@ -104,14 +104,22 @@ dns_rdataslab_fromrdataset(dns_rdataset_t *rdataset, isc_mem_t *mctx,
return
(
DNS_R_SUCCESS
);
}
dns_result_t
dns_rdataslab_tordataset
(
dns_rdataset_t
*
rdataset
,
isc_region_t
*
region
,
unsigned
int
reservelen
)
{
/* XXX shut up compiler */
rdataset
=
rdataset
;
region
=
region
;
reservelen
=
reservelen
;
return
(
DNS_R_NOTIMPLEMENTED
);
unsigned
int
dns_rdataslab_size
(
unsigned
char
*
slab
,
unsigned
int
reservelen
)
{
unsigned
int
count
,
length
;
unsigned
char
*
current
;
REQUIRE
(
slab
!=
NULL
);
current
=
slab
+
reservelen
;
count
=
*
current
++
*
256
;
count
+=
*
current
++
;
while
(
count
>
0
)
{
count
--
;
length
=
*
current
++
*
256
;
length
+=
*
current
++
;
current
+=
length
;
}
return
((
unsigned
int
)(
current
-
slab
));
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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