Ejemplo n.º 1
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));
}
Ejemplo n.º 2
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();
}
Ejemplo n.º 3
0
Archivo: soa.c Proyecto: jelu/validns
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);
}
Ejemplo n.º 4
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));
}
Ejemplo n.º 5
0
Archivo: mx.c Proyecto: 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));
}
Ejemplo n.º 6
0
Archivo: rt.c Proyecto: 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));
}
Ejemplo n.º 7
0
Archivo: afsdb.c Proyecto: jelu/validns
static struct binary_data afsdb_wirerdata(struct rr *rrv)
{
    RRCAST(afsdb);

    return compose_binary_data("2d", 1,
        rr->subtype, name2wire_name(rr->hostname));
}
Ejemplo n.º 8
0
Archivo: srv.c Proyecto: MikeAT/validns
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));
}
Ejemplo n.º 9
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));
}
Ejemplo n.º 10
0
Archivo: mr.c Proyecto: MikeAT/validns
static struct binary_data mr_wirerdata(struct rr *rrv)
{
	RRCAST(mr);
	return name2wire_name(rr->newname);
}