net: ptp: do not reimplement PTP/BPF classifier
[cascardo/linux.git] / include / linux / ptp_classify.h
index 1dc420b..6d3b0a2 100644 (file)
 #include <linux/if_vlan.h>
 #include <linux/ip.h>
 #include <linux/filter.h>
-#ifdef __KERNEL__
 #include <linux/in.h>
-#else
-#include <netinet/in.h>
-#endif
 
 #define PTP_CLASS_NONE  0x00 /* not a PTP event message */
 #define PTP_CLASS_V1    0x01 /* protocol version 1 */
 #define OP_RETA        (BPF_RET | BPF_A)
 #define OP_RETK        (BPF_RET | BPF_K)
 
-static inline int ptp_filter_init(struct sock_filter *f, int len)
-{
-       if (OP_LDH == f[0].code)
-               return sk_chk_filter(f, len);
-       else
-               return 0;
-}
-
 #define PTP_FILTER \
        {OP_LDH,        0,   0, OFF_ETYPE               }, /*              */ \
        {OP_JEQ,        0,  12, ETH_P_IP                }, /* f goto L20   */ \
@@ -137,4 +125,6 @@ static inline int ptp_filter_init(struct sock_filter *f, int len)
        {OP_RETA,       0,   0, 0                       }, /*              */ \
 /*L6x*/        {OP_RETK,       0,   0, PTP_CLASS_NONE          },
 
+unsigned int ptp_classify_raw(const struct sk_buff *skb);
+
 #endif