mirror of
https://github.com/openvswitch/ovs
synced 2025-10-29 15:28:56 +00:00
166 lines
4.0 KiB
C
166 lines
4.0 KiB
C
|
|
#ifndef __LINUX_PKT_CLS_WRAPPER_H
|
||
|
|
#define __LINUX_PKT_CLS_WRAPPER_H 1
|
||
|
|
|
||
|
|
#if defined(__KERNEL__) || defined(HAVE_TCA_ACT_COOKIE)
|
||
|
|
#include_next <linux/pkt_cls.h>
|
||
|
|
#else
|
||
|
|
|
||
|
|
#include <linux/types.h>
|
||
|
|
#include <linux/pkt_sched.h>
|
||
|
|
|
||
|
|
/* Action attributes */
|
||
|
|
enum {
|
||
|
|
TCA_ACT_UNSPEC,
|
||
|
|
TCA_ACT_KIND,
|
||
|
|
TCA_ACT_OPTIONS,
|
||
|
|
TCA_ACT_INDEX,
|
||
|
|
TCA_ACT_STATS,
|
||
|
|
TCA_ACT_PAD,
|
||
|
|
TCA_ACT_COOKIE,
|
||
|
|
__TCA_ACT_MAX
|
||
|
|
};
|
||
|
|
|
||
|
|
#define TCA_ACT_MAX __TCA_ACT_MAX
|
||
|
|
#define TCA_OLD_COMPAT (TCA_ACT_MAX+1)
|
||
|
|
#define TCA_ACT_MAX_PRIO 32
|
||
|
|
#define TCA_ACT_BIND 1
|
||
|
|
#define TCA_ACT_NOBIND 0
|
||
|
|
#define TCA_ACT_UNBIND 1
|
||
|
|
#define TCA_ACT_NOUNBIND 0
|
||
|
|
#define TCA_ACT_REPLACE 1
|
||
|
|
#define TCA_ACT_NOREPLACE 0
|
||
|
|
|
||
|
|
#define TC_ACT_UNSPEC (-1)
|
||
|
|
#define TC_ACT_OK 0
|
||
|
|
#define TC_ACT_RECLASSIFY 1
|
||
|
|
#define TC_ACT_SHOT 2
|
||
|
|
#define TC_ACT_PIPE 3
|
||
|
|
#define TC_ACT_STOLEN 4
|
||
|
|
#define TC_ACT_QUEUED 5
|
||
|
|
#define TC_ACT_REPEAT 6
|
||
|
|
#define TC_ACT_REDIRECT 7
|
||
|
|
#define TC_ACT_JUMP 0x10000000
|
||
|
|
|
||
|
|
struct tc_police {
|
||
|
|
__u32 index;
|
||
|
|
int action;
|
||
|
|
#define TC_POLICE_UNSPEC TC_ACT_UNSPEC
|
||
|
|
#define TC_POLICE_OK TC_ACT_OK
|
||
|
|
#define TC_POLICE_RECLASSIFY TC_ACT_RECLASSIFY
|
||
|
|
#define TC_POLICE_SHOT TC_ACT_SHOT
|
||
|
|
#define TC_POLICE_PIPE TC_ACT_PIPE
|
||
|
|
|
||
|
|
__u32 limit;
|
||
|
|
__u32 burst;
|
||
|
|
__u32 mtu;
|
||
|
|
struct tc_ratespec rate;
|
||
|
|
struct tc_ratespec peakrate;
|
||
|
|
int refcnt;
|
||
|
|
int bindcnt;
|
||
|
|
__u32 capab;
|
||
|
|
};
|
||
|
|
|
||
|
|
struct tcf_t {
|
||
|
|
__u64 install;
|
||
|
|
__u64 lastuse;
|
||
|
|
__u64 expires;
|
||
|
|
__u64 firstuse;
|
||
|
|
};
|
||
|
|
|
||
|
|
#define tc_gen \
|
||
|
|
__u32 index; \
|
||
|
|
__u32 capab; \
|
||
|
|
int action; \
|
||
|
|
int refcnt; \
|
||
|
|
int bindcnt
|
||
|
|
|
||
|
|
enum {
|
||
|
|
TCA_POLICE_UNSPEC,
|
||
|
|
TCA_POLICE_TBF,
|
||
|
|
TCA_POLICE_RATE,
|
||
|
|
TCA_POLICE_PEAKRATE,
|
||
|
|
TCA_POLICE_AVRATE,
|
||
|
|
TCA_POLICE_RESULT,
|
||
|
|
TCA_POLICE_TM,
|
||
|
|
TCA_POLICE_PAD,
|
||
|
|
__TCA_POLICE_MAX
|
||
|
|
#define TCA_POLICE_RESULT TCA_POLICE_RESULT
|
||
|
|
};
|
||
|
|
|
||
|
|
/* tca flags definitions */
|
||
|
|
#define TCA_CLS_FLAGS_SKIP_HW (1 << 0)
|
||
|
|
#define TCA_CLS_FLAGS_SKIP_SW (1 << 1)
|
||
|
|
|
||
|
|
/* Basic filter */
|
||
|
|
|
||
|
|
enum {
|
||
|
|
TCA_BASIC_UNSPEC,
|
||
|
|
TCA_BASIC_CLASSID,
|
||
|
|
TCA_BASIC_EMATCHES,
|
||
|
|
TCA_BASIC_ACT,
|
||
|
|
TCA_BASIC_POLICE,
|
||
|
|
__TCA_BASIC_MAX
|
||
|
|
};
|
||
|
|
|
||
|
|
/* Flower classifier */
|
||
|
|
|
||
|
|
enum {
|
||
|
|
TCA_FLOWER_UNSPEC,
|
||
|
|
TCA_FLOWER_CLASSID,
|
||
|
|
TCA_FLOWER_INDEV,
|
||
|
|
TCA_FLOWER_ACT,
|
||
|
|
TCA_FLOWER_KEY_ETH_DST, /* ETH_ALEN */
|
||
|
|
TCA_FLOWER_KEY_ETH_DST_MASK, /* ETH_ALEN */
|
||
|
|
TCA_FLOWER_KEY_ETH_SRC, /* ETH_ALEN */
|
||
|
|
TCA_FLOWER_KEY_ETH_SRC_MASK, /* ETH_ALEN */
|
||
|
|
TCA_FLOWER_KEY_ETH_TYPE, /* be16 */
|
||
|
|
TCA_FLOWER_KEY_IP_PROTO, /* u8 */
|
||
|
|
TCA_FLOWER_KEY_IPV4_SRC, /* be32 */
|
||
|
|
TCA_FLOWER_KEY_IPV4_SRC_MASK, /* be32 */
|
||
|
|
TCA_FLOWER_KEY_IPV4_DST, /* be32 */
|
||
|
|
TCA_FLOWER_KEY_IPV4_DST_MASK, /* be32 */
|
||
|
|
TCA_FLOWER_KEY_IPV6_SRC, /* struct in6_addr */
|
||
|
|
TCA_FLOWER_KEY_IPV6_SRC_MASK, /* struct in6_addr */
|
||
|
|
TCA_FLOWER_KEY_IPV6_DST, /* struct in6_addr */
|
||
|
|
TCA_FLOWER_KEY_IPV6_DST_MASK, /* struct in6_addr */
|
||
|
|
TCA_FLOWER_KEY_TCP_SRC, /* be16 */
|
||
|
|
TCA_FLOWER_KEY_TCP_DST, /* be16 */
|
||
|
|
TCA_FLOWER_KEY_UDP_SRC, /* be16 */
|
||
|
|
TCA_FLOWER_KEY_UDP_DST, /* be16 */
|
||
|
|
|
||
|
|
TCA_FLOWER_FLAGS,
|
||
|
|
TCA_FLOWER_KEY_VLAN_ID, /* be16 */
|
||
|
|
TCA_FLOWER_KEY_VLAN_PRIO, /* u8 */
|
||
|
|
TCA_FLOWER_KEY_VLAN_ETH_TYPE, /* be16 */
|
||
|
|
|
||
|
|
TCA_FLOWER_KEY_ENC_KEY_ID, /* be32 */
|
||
|
|
TCA_FLOWER_KEY_ENC_IPV4_SRC, /* be32 */
|
||
|
|
TCA_FLOWER_KEY_ENC_IPV4_SRC_MASK,/* be32 */
|
||
|
|
TCA_FLOWER_KEY_ENC_IPV4_DST, /* be32 */
|
||
|
|
TCA_FLOWER_KEY_ENC_IPV4_DST_MASK,/* be32 */
|
||
|
|
TCA_FLOWER_KEY_ENC_IPV6_SRC, /* struct in6_addr */
|
||
|
|
TCA_FLOWER_KEY_ENC_IPV6_SRC_MASK,/* struct in6_addr */
|
||
|
|
TCA_FLOWER_KEY_ENC_IPV6_DST, /* struct in6_addr */
|
||
|
|
TCA_FLOWER_KEY_ENC_IPV6_DST_MASK,/* struct in6_addr */
|
||
|
|
|
||
|
|
TCA_FLOWER_KEY_TCP_SRC_MASK, /* be16 */
|
||
|
|
TCA_FLOWER_KEY_TCP_DST_MASK, /* be16 */
|
||
|
|
TCA_FLOWER_KEY_UDP_SRC_MASK, /* be16 */
|
||
|
|
TCA_FLOWER_KEY_UDP_DST_MASK, /* be16 */
|
||
|
|
TCA_FLOWER_KEY_SCTP_SRC_MASK, /* be16 */
|
||
|
|
TCA_FLOWER_KEY_SCTP_DST_MASK, /* be16 */
|
||
|
|
|
||
|
|
TCA_FLOWER_KEY_SCTP_SRC, /* be16 */
|
||
|
|
TCA_FLOWER_KEY_SCTP_DST, /* be16 */
|
||
|
|
|
||
|
|
TCA_FLOWER_KEY_ENC_UDP_SRC_PORT, /* be16 */
|
||
|
|
TCA_FLOWER_KEY_ENC_UDP_SRC_PORT_MASK, /* be16 */
|
||
|
|
TCA_FLOWER_KEY_ENC_UDP_DST_PORT, /* be16 */
|
||
|
|
TCA_FLOWER_KEY_ENC_UDP_DST_PORT_MASK, /* be16 */
|
||
|
|
__TCA_FLOWER_MAX,
|
||
|
|
};
|
||
|
|
|
||
|
|
#endif /* __KERNEL__ || !HAVE_TCA_ACT_COOKIE */
|
||
|
|
|
||
|
|
#endif /* __LINUX_PKT_CLS_WRAPPER_H */
|