Exemplo n.º 1
0
Arquivo: l64.c Projeto: MikeAT/validns
static struct rr *l64_parse(char *name, long ttl, int type, char *s)
{
	struct rr_l64 *rr = getmem(sizeof(*rr));
	int preference;

	rr->preference = preference = extract_integer(&s, "L64 preference");
	if (preference < 0)
		return NULL;
	if (extract_u64(&s, "Locator64", &rr->locator64) < 0)
		return NULL;

	if (*s) {
		return bitch("garbage after valid L64 data");
	}

	return store_record(type, name, ttl, rr);
}
Exemplo n.º 2
0
static struct rr *nid_parse(char *name, long ttl, int type, char *s)
{
	struct rr_nid *rr = getmem(sizeof(*rr));
	int preference;

	rr->preference = preference = extract_integer(&s, "NID preference", NULL);
	if (preference < 0)
		return NULL;
	if (extract_u64(&s, "NodeID", &rr->node_id) < 0)
		return NULL;

	if (*s) {
		return bitch("garbage after valid NID data");
	}

	return store_record(type, name, ttl, rr);
}