Example #1
0
static Action_SkBuff
par(arguments_t args, SkBuff b)
{
	function_t f0 = GET_ARG_0(function_t, args);
	function_t f1 = GET_ARG_1(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;
	return EVAL_FUNCTION(f1, b);
}
Example #2
0
static ActionSkBuff
par4(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);
	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;
	return EVAL_FUNCTION(f3, skb);
}
Example #3
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);
}
Example #4
0
struct sk_buff __GC *
GC_copy_buff(struct GC_data *gc, struct sk_buff __GC * orig)
{
	struct sk_buff *skb;
	struct sk_buff __GC * ret;

	if (gc->pool.len >= Q_GC_POOL_QUEUE_LEN) {
		pr_devel("[PFQ] GC: pool exhausted!\n");
		ret = NULL;
		return ret;
	}

	skb = skb_copy(PFQ_SKB(orig), GFP_ATOMIC);
	if (skb == NULL) {
		pr_devel("[PFQ] GC: out of memory!\n");
		ret = NULL;
		return ret;
	}

	skb->mac_len = orig->mac_len;

	/* GC_make_buff can't fail now */

	ret = GC_make_buff(gc, skb);

	PFQ_CB(ret)->group_mask = PFQ_CB(orig)->group_mask;
	PFQ_CB(ret)->direct     = PFQ_CB(orig)->direct;
	PFQ_CB(ret)->monad      = PFQ_CB(orig)->monad;

	return ret;
}
Example #5
0
struct sk_buff __GC *
GC_make_buff(struct GC_data *gc, struct sk_buff *skb)
{
	struct sk_buff __GC * ret;

	if (gc->pool.len >= Q_GC_POOL_QUEUE_LEN) {
		ret = NULL;
	}
	else {
                PFQ_CB(skb)->log = &gc->log[gc->pool.len];
		ret = gc->pool.queue[gc->pool.len++] = (struct sk_buff __force __GC *) skb;
	}

	return ret;
}
Example #6
0
static Action_SkBuff
par8(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);
	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(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;
	a = EVAL_FUNCTION(f3, 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(f4, 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(f5, 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(f6, 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(f7, b);
}