Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d675c989 authored by Thomas Graf's avatar Thomas Graf Committed by David S. Miller
Browse files

[PKT_SCHED]: Packet classification based on textsearch (ematch)



Signed-off-by: default avatarThomas Graf <tgraf@suug.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3fc7e8a6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -408,6 +408,7 @@ enum
	TCF_EM_NBYTE,
	TCF_EM_U32,
	TCF_EM_META,
	TCF_EM_TEXT,
	__TCF_EM_MAX
};

+5 −2
Original line number Diff line number Diff line
@@ -892,10 +892,13 @@ extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const voi
		 goto rtattr_failure; \
   	__rta_fill(skb, attrtype, attrlen, data); }) 

#define RTA_PUT_NOHDR(skb, attrlen, data) \
#define RTA_APPEND(skb, attrlen, data) \
({	if (unlikely(skb_tailroom(skb) < (int)(attrlen))) \
		goto rtattr_failure; \
	memcpy(skb_put(skb, RTA_ALIGN(attrlen)), data, attrlen); })
	memcpy(skb_put(skb, attrlen), data, attrlen); })

#define RTA_PUT_NOHDR(skb, attrlen, data) \
	RTA_APPEND(skb, RTA_ALIGN(attrlen), data)

#define RTA_PUT_U8(skb, attrtype, value) \
({	u8 _tmp = (value); \
+19 −0
Original line number Diff line number Diff line
#ifndef __LINUX_TC_EM_TEXT_H
#define __LINUX_TC_EM_TEXT_H

#include <linux/pkt_cls.h>

#define TC_EM_TEXT_ALGOSIZ	16

struct tcf_em_text
{
	char		algo[TC_EM_TEXT_ALGOSIZ];
	__u16		from_offset;
	__u16		to_offset;
	__u16		pattern_len;
	__u8		from_layer:4;
	__u8		to_layer:4;
	__u8		pad;
};

#endif
+11 −0
Original line number Diff line number Diff line
@@ -449,6 +449,17 @@ config NET_EMATCH_META
	  To compile this code as a module, choose M here: the
	  module will be called em_meta.

config NET_EMATCH_TEXT
	tristate "Textsearch"
	depends on NET_EMATCH
	---help---
	  Say Y here if you want to be ablt to classify packets based on
	  textsearch comparisons. Please select the appropriate textsearch
	  algorithms in the Library section.

	  To compile this code as a module, choose M here: the
	  module will be called em_text.

config NET_CLS_ACT
	bool "Packet ACTION"
	depends on EXPERIMENTAL && NET_CLS && NET_QOS
+1 −0
Original line number Diff line number Diff line
@@ -40,3 +40,4 @@ obj-$(CONFIG_NET_EMATCH_CMP) += em_cmp.o
obj-$(CONFIG_NET_EMATCH_NBYTE)	+= em_nbyte.o
obj-$(CONFIG_NET_EMATCH_U32)	+= em_u32.o
obj-$(CONFIG_NET_EMATCH_META)	+= em_meta.o
obj-$(CONFIG_NET_EMATCH_TEXT)	+= em_text.o
Loading