Ejemplo n.º 1
0
static Action_SkBuff
par4(arguments_t args, SkBuff b)
{
	function_t f0 = GET_ARG_0(function_t, args);
	function_t f1 = GET_ARG_1(function_t, args);
	function_t f2 = GET_ARG_2(function_t, args);
	function_t f3 = GET_ARG_3(function_t, args);
	fanout_t fout = PFQ_CB(b.skb)->monad->fanout;
        Action_SkBuff a;

	a = EVAL_FUNCTION(f0, b);
	if (a.value.skb && !is_drop(PFQ_CB(a.value.skb)->monad->fanout))
		return a;

	PFQ_CB(b.skb)->monad->fanout = fout;
	a = EVAL_FUNCTION(f1, b);

	if (a.value.skb && !is_drop(PFQ_CB(a.value.skb)->monad->fanout))
		return a;

	PFQ_CB(b.skb)->monad->fanout = fout;
	a = EVAL_FUNCTION(f2, b);

	if (a.value.skb && !is_drop(PFQ_CB(a.value.skb)->monad->fanout))
		return a;

	PFQ_CB(b.skb)->monad->fanout = fout;
	return EVAL_FUNCTION(f3, b);
}
Ejemplo n.º 2
0
static ActionSkBuff
par(arguments_t args, SkBuff skb)
{
	function_t f0 = GET_ARG_0(function_t, args);
	function_t f1 = GET_ARG_1(function_t, args);
	fanout_t fout = PFQ_CB(skb)->monad->fanout;
        ActionSkBuff a;

	a = EVAL_FUNCTION(f0, skb);
	if (a.skb && !is_drop(PFQ_CB(a.skb)->monad->fanout))
		return a;

	PFQ_CB(skb)->monad->fanout = fout;
	return EVAL_FUNCTION(f1, skb);
}
Ejemplo n.º 3
0
static ActionSkBuff
par8(arguments_t args, SkBuff skb)
{
	function_t f0 = GET_ARG_0(function_t, args);
	function_t f1 = GET_ARG_1(function_t, args);
	function_t f2 = GET_ARG_2(function_t, args);
	function_t f3 = GET_ARG_3(function_t, args);
	function_t f4 = GET_ARG_4(function_t, args);
	function_t f5 = GET_ARG_5(function_t, args);
	function_t f6 = GET_ARG_6(function_t, args);
	function_t f7 = GET_ARG_7(function_t, args);
	fanout_t fout = PFQ_CB(skb)->monad->fanout;
        ActionSkBuff a;

	a = EVAL_FUNCTION(f0, skb);
	if (a.skb && !is_drop(PFQ_CB(a.skb)->monad->fanout))
		return a;

	PFQ_CB(skb)->monad->fanout = fout;
	a = EVAL_FUNCTION(f1, skb);

	if (a.skb && !is_drop(PFQ_CB(a.skb)->monad->fanout))
		return a;

	PFQ_CB(skb)->monad->fanout = fout;
	a = EVAL_FUNCTION(f2, skb);

	if (a.skb && !is_drop(PFQ_CB(a.skb)->monad->fanout))
		return a;

	PFQ_CB(skb)->monad->fanout = fout;
	a = EVAL_FUNCTION(f3, skb);

	if (a.skb && !is_drop(PFQ_CB(a.skb)->monad->fanout))
		return a;

	PFQ_CB(skb)->monad->fanout = fout;
	a = EVAL_FUNCTION(f4, skb);

	if (a.skb && !is_drop(PFQ_CB(a.skb)->monad->fanout))
		return a;

	PFQ_CB(skb)->monad->fanout = fout;
	a = EVAL_FUNCTION(f5, skb);

	if (a.skb && !is_drop(PFQ_CB(a.skb)->monad->fanout))
		return a;

	PFQ_CB(skb)->monad->fanout = fout;
	a = EVAL_FUNCTION(f6, skb);

	if (a.skb && !is_drop(PFQ_CB(a.skb)->monad->fanout))
		return a;

	PFQ_CB(skb)->monad->fanout = fout;
	return EVAL_FUNCTION(f7, skb);
}
Ejemplo n.º 4
0
static Action_SkBuff
inv(arguments_t args, SkBuff b)
{
	function_t expr = GET_ARG(function_t, args);
	SkBuff nb = EVAL_FUNCTION(expr, b).value;

	if (!nb.skb || is_drop(PFQ_CB(nb.skb)->monad->fanout))
		return Copy(nb);

	return Drop(nb);
}
Ejemplo n.º 5
0
static inline ActionSkBuff
pfq_bind(SkBuff skb, struct pfq_functional_node *node)
{
	return EVAL_FUNCTION((function_t){&node->fun}, skb);
}