コード例 #1
0
ファイル: libebt_arpreply.c プロジェクト: PKRoma/iptables
static void brarpreply_print(const void *ip, const struct xt_entry_target *t, int numeric)
{
	struct ebt_arpreply_info *replyinfo = (void *)t->data;

	printf("--arpreply-mac ");
	xtables_print_mac(replyinfo->mac);
	if (replyinfo->target == EBT_DROP)
		return;
	printf(" --arpreply-target %s", ebt_target_name(replyinfo->target));
}
コード例 #2
0
ファイル: libebt_mark.c プロジェクト: AmVPN/iptables
static void brmark_print(const void *ip, const struct xt_entry_target *target,
			 int numeric)
{
	struct ebt_mark_t_info *info = (struct ebt_mark_t_info *)target->data;
	int tmp;

	tmp = info->target & ~EBT_VERDICT_BITS;
	if (tmp == MARK_SET_VALUE)
		printf("--mark-set");
	else if (tmp == MARK_OR_VALUE)
		printf("--mark-or");
	else if (tmp == MARK_XOR_VALUE)
		printf("--mark-xor");
	else if (tmp == MARK_AND_VALUE)
		printf("--mark-and");
	else
		xtables_error(PARAMETER_PROBLEM, "Unknown mark action");

	printf(" 0x%lx", info->mark);
	tmp = info->target | ~EBT_VERDICT_BITS;
	printf(" --mark-target %s", ebt_target_name(tmp));
}