Beispiel #1
0
static struct binary_data ipseckey_wirerdata(struct rr *rrv)
{
	RRCAST(ipseckey);
	struct binary_data helper;

	switch (rr->gateway_type) {
	case 0:
		if (rr->algorithm != 0)
			return compose_binary_data("111d", 1,
				rr->precedence, rr->gateway_type, rr->algorithm,
				rr->public_key);
		else
			return compose_binary_data("111", 1,
				rr->precedence, rr->gateway_type, rr->algorithm);
		break;
	case 1:
		helper.length = sizeof(rr->gateway.gateway_ipv4);
		helper.data = (void *)&rr->gateway.gateway_ipv4;

		if (rr->algorithm != 0)
			return compose_binary_data("111dd", 1,
				rr->precedence, rr->gateway_type, rr->algorithm,
				helper,
				rr->public_key);
		else
			return compose_binary_data("111d", 1,
				rr->precedence, rr->gateway_type, rr->algorithm,
				helper);
		break;
	case 2:

		helper.length = sizeof(rr->gateway.gateway_ipv6);
		helper.data = (void *)&rr->gateway.gateway_ipv6;

		if (rr->algorithm != 0)
			return compose_binary_data("111dd", 1,
				rr->precedence, rr->gateway_type, rr->algorithm,
				helper,
				rr->public_key);
		else
			return compose_binary_data("111d", 1,
				rr->precedence, rr->gateway_type, rr->algorithm,
				helper);
		break;
	case 3:
		if (rr->algorithm != 0)
			return compose_binary_data("111dd", 1,
				rr->precedence, rr->gateway_type, rr->algorithm,
				name2wire_name(rr->gateway.gateway_name),
				rr->public_key);
		else
			return compose_binary_data("111d", 1,
				rr->precedence, rr->gateway_type, rr->algorithm,
				name2wire_name(rr->gateway.gateway_name));
		break;
	}
    return bad_binary_data();
}
Beispiel #2
0
static struct binary_data afsdb_wirerdata(struct rr *rrv)
{
    RRCAST(afsdb);

    return compose_binary_data("2d", 1,
        rr->subtype, name2wire_name(rr->hostname));
}
Beispiel #3
0
static struct binary_data srv_wirerdata(struct rr *rrv)
{
	RRCAST(srv);
    return compose_binary_data("222d", 1,
		rr->priority, rr->weight, rr->port,
		name2wire_name(rr->target));
}
Beispiel #4
0
Datei: rt.c Projekt: jelu/validns
static struct binary_data rt_wirerdata(struct rr *rrv)
{
    RRCAST(rt);

    return compose_binary_data("2d", 1,
        rr->preference, name2wire_name(rr->intermediate_host));
}
Beispiel #5
0
static struct binary_data minfo_wirerdata(struct rr *rrv)
{
	RRCAST(minfo);
	return compose_binary_data("dd", 1,
		name2wire_name(rr->rmailbx),
		name2wire_name(rr->emailbx));
}
Beispiel #6
0
Datei: mx.c Projekt: umq/validns
static struct binary_data mx_wirerdata(struct rr *rrv)
{
	RRCAST(mx);

    return compose_binary_data("2d", 1,
		rr->preference, name2wire_name(rr->exchange));
}
Beispiel #7
0
static struct binary_data tlsa_smimea_wirerdata(struct rr *rrv)
{
    RRCAST(tlsa_smimea);

    return compose_binary_data("111d", 1,
        rr->cert_usage, rr->selector, rr->matching_type,
        rr->association_data);
}
Beispiel #8
0
static struct binary_data cert_wirerdata(struct rr *rrv)
{
	RRCAST(cert);

	return compose_binary_data("221d", 1,
		rr->type, rr->key_tag, rr->algorithm,
		rr->certificate);
}
Beispiel #9
0
static struct binary_data dlv_wirerdata(struct rr *rrv)
{
    RRCAST(dlv);

    return compose_binary_data("211d", 1,
        rr->key_tag, rr->algorithm, rr->digest_type,
        rr->digest);
}
Beispiel #10
0
static struct binary_data nsec3param_wirerdata(struct rr *rrv)
{
	RRCAST(nsec3param);

	return compose_binary_data("112b", 1,
		rr->hash_algorithm, rr->flags,
		rr->iterations, rr->salt);
}
Beispiel #11
0
static struct binary_data dnskey_wirerdata(struct rr *rrv)
{
	RRCAST(dnskey);

	return compose_binary_data("211d", 1,
		rr->flags, rr->protocol, rr->algorithm,
		rr->pubkey);
}
Beispiel #12
0
static struct binary_data nsec3_wirerdata(struct rr *rrv)
{
    struct rr_nsec3 *rr = (struct rr_nsec3 *)rrv;

    return compose_binary_data("112bbd", 1,
                               rr->hash_algorithm, rr->flags,
                               rr->iterations, rr->salt,
                               rr->next_hashed_owner, rr->type_bitmap);
}
Beispiel #13
0
static struct binary_data soa_wirerdata(struct rr *rrv)
{
    RRCAST(soa);

    return compose_binary_data("dd44444", 1,
        name2wire_name(rr->mname), name2wire_name(rr->rname),
        rr->serial, rr->refresh, rr->retry,
        rr->expire, rr->minimum);
}
Beispiel #14
0
static struct binary_data px_wirerdata(struct rr *rrv)
{
	RRCAST(px);

    return compose_binary_data("2dd", 1,
		rr->preference,
		name2wire_name(rr->map822),
		name2wire_name(rr->mapx400));
}
Beispiel #15
0
static struct binary_data naptr_wirerdata(struct rr *rrv)
{
    struct rr_naptr *rr = (struct rr_naptr *)rrv;

    return compose_binary_data("22bbbd", 1,
		rr->order, rr->preference,
		rr->flags, rr->services, rr->regexp,
		name2wire_name(rr->replacement));
}
Beispiel #16
0
static struct binary_data txt_wirerdata(struct rr *rrv)
{
    RRCAST(txt);
    struct binary_data r, t;
    struct rr_txt_segment *seg = rr->txt;

    r = bad_binary_data();
    t.length = 0;
    t.data = NULL;
    while (seg) {
        r = compose_binary_data("db", 1, t, seg->txt);
        t = r;
        seg = seg->next;
    }
    return r;
}
Beispiel #17
0
static struct binary_data nsap_wirerdata(struct rr *rrv)
{
	RRCAST(nsap);

	return compose_binary_data("d", 1, rr->data);
}
Beispiel #18
0
static struct binary_data l64_wirerdata(struct rr *rrv)
{
	RRCAST(l64);
    return compose_binary_data("28", 1, rr->preference, rr->locator64);
}
Beispiel #19
0
static struct binary_data x25_wirerdata(struct rr *rrv)
{
	RRCAST(x25);

	return compose_binary_data("b", 1, rr->psdn_address);
}
Beispiel #20
0
static struct binary_data l32_wirerdata(struct rr *rrv)
{
    RRCAST(l32);
    return compose_binary_data("24", 1, rr->preference, rr->locator32);
}
Beispiel #21
0
static struct binary_data nid_wirerdata(struct rr *rrv)
{
	RRCAST(nid);
    return compose_binary_data("28", 1, rr->preference, rr->node_id);
}