#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 */ \
{OP_RETA, 0, 0, 0 }, /* */ \
/*L6x*/ {OP_RETK, 0, 0, PTP_CLASS_NONE },
+unsigned int ptp_classify_raw(const struct sk_buff *skb);
+
#endif