mirror of
http://thekelleys.org.uk/git/dnsmasq.git
synced 2026-10-30 13:00:38 +00:00
Helper function to walk through keydata chained blocks.
This commit is contained in:
1 parent
a7338645d7
commit
458824dcb4
2 files changed
+18
No files matched your search
+17
@@ -1364,6 +1364,23 @@ struct keydata *keydata_alloc(char *data, size_t len)
|
||||
return ret;
|
||||
}
|
||||
|
||||
size_t keydata_walk(struct keydata **key, unsigned char **p, size_t cnt)
|
||||
{
|
||||
size_t ret;
|
||||
|
||||
if (*p == NULL)
|
||||
*p = (*key)->key;
|
||||
else if (*p == (*key)->key + KEYBLOCK_LEN)
|
||||
{
|
||||
*key = (*key)->next;
|
||||
if (*key == NULL)
|
||||
return 0;
|
||||
*p = (*key)->key;
|
||||
}
|
||||
|
||||
return MIN(cnt, (*key)->key + KEYBLOCK_LEN - (*p));
|
||||
}
|
||||
|
||||
void keydata_free(struct keydata *blocks)
|
||||
{
|
||||
struct keydata *tmp;
|
||||
|
||||
@@ -925,6 +925,7 @@ char *cache_get_name(struct crec *crecp);
|
||||
struct crec *cache_enumerate(int init);
|
||||
#ifdef HAVE_DNSSEC
|
||||
struct keydata *keydata_alloc(char *data, size_t len);
|
||||
size_t keydata_walk(struct keydata **key, unsigned char **p, size_t cnt);
|
||||
void keydata_free(struct keydata *blocks);
|
||||
#endif
|
||||
|
||||
|
||||
Reference in new issue
Block a user