static int xfrm_ae_print(const struct sockaddr_nl *who,
			     struct nlmsghdr *n, void *arg)
{
	FILE *fp = (FILE*)arg;
	struct xfrm_aevent_id *id = NLMSG_DATA(n);
	char abuf[256];

	fprintf(fp, "Async event ");
	xfrm_ae_flags_print(id->flags, arg);
	fprintf(fp,"\n\t");
	memset(abuf, '\0', sizeof(abuf));
	fprintf(fp, "src %s ", rt_addr_n2a(id->sa_id.family,
		sizeof(id->saddr), &id->saddr,
		abuf, sizeof(abuf)));
	memset(abuf, '\0', sizeof(abuf));
	fprintf(fp, "dst %s ", rt_addr_n2a(id->sa_id.family,
		sizeof(id->sa_id.daddr), &id->sa_id.daddr,
		abuf, sizeof(abuf)));
	fprintf(fp, " reqid 0x%x", id->reqid);
	fprintf(fp, " protocol %s ", strxf_proto(id->sa_id.proto));
	fprintf(fp, " SPI 0x%x", ntohl(id->sa_id.spi));

	fprintf(fp, "\n");
	fflush(fp);

	return 0;
}
Ejemplo n.º 2
0
static int xfrm_ae_print(struct nlmsghdr *n, void *arg)
{
	FILE *fp = (FILE *)arg;
	struct xfrm_aevent_id *id = NLMSG_DATA(n);

	fprintf(fp, "Async event ");
	xfrm_ae_flags_print(id->flags, arg);
	fprintf(fp, "\n\t");
	fprintf(fp, "src %s ", rt_addr_n2a(id->sa_id.family,
					   sizeof(id->saddr), &id->saddr));

	xfrm_usersa_print(&id->sa_id, id->reqid, fp);

	fprintf(fp, "\n");
	fflush(fp);

	return 0;
}
Ejemplo n.º 3
0
static int xfrm_ae_print(const struct sockaddr_nl *who,
			     struct nlmsghdr *n, void *arg)
{
	FILE *fp = (FILE*)arg;
	struct xfrm_aevent_id *id = NLMSG_DATA(n);
	char abuf[256];

	fprintf(fp, "Async event ");
	xfrm_ae_flags_print(id->flags, arg);
	fprintf(fp,"\n\t");
	memset(abuf, '\0', sizeof(abuf));
	fprintf(fp, "src %s ", rt_addr_n2a(id->sa_id.family,
					   sizeof(id->saddr), &id->saddr,
					   abuf, sizeof(abuf)));

	xfrm_usersa_print(&id->sa_id, id->reqid, fp);

	fprintf(fp, "\n");
	fflush(fp);

	return 0;
}