linux/drivers/net/ethernet/freescale/dpaa2/dpkg.h

/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
/* Copyright 2013-2015 Freescale Semiconductor Inc.
 */
#ifndef __FSL_DPKG_H_
#define __FSL_DPKG_H_

#include <linux/types.h>

/* Data Path Key Generator API
 * Contains initialization APIs and runtime APIs for the Key Generator
 */

/** Key Generator properties */

/**
 * DPKG_NUM_OF_MASKS - Number of masks per key extraction
 */
#define DPKG_NUM_OF_MASKS

/**
 * DPKG_MAX_NUM_OF_EXTRACTS - Number of extractions per key profile
 */
#define DPKG_MAX_NUM_OF_EXTRACTS

/**
 * enum dpkg_extract_from_hdr_type - Selecting extraction by header types
 * @DPKG_FROM_HDR: Extract selected bytes from header, by offset
 * @DPKG_FROM_FIELD: Extract selected bytes from header, by offset from field
 * @DPKG_FULL_FIELD: Extract a full field
 */
enum dpkg_extract_from_hdr_type {};

/**
 * enum dpkg_extract_type - Enumeration for selecting extraction type
 * @DPKG_EXTRACT_FROM_HDR: Extract from the header
 * @DPKG_EXTRACT_FROM_DATA: Extract from data not in specific header
 * @DPKG_EXTRACT_FROM_PARSE: Extract from parser-result;
 *	e.g. can be used to extract header existence;
 *	please refer to 'Parse Result definition' section in the parser BG
 */
enum dpkg_extract_type {};

/**
 * struct dpkg_mask - A structure for defining a single extraction mask
 * @mask: Byte mask for the extracted content
 * @offset: Offset within the extracted content
 */
struct dpkg_mask {};

/* Protocol fields */

/* Ethernet fields */
#define NH_FLD_ETH_DA
#define NH_FLD_ETH_SA
#define NH_FLD_ETH_LENGTH
#define NH_FLD_ETH_TYPE
#define NH_FLD_ETH_FINAL_CKSUM
#define NH_FLD_ETH_PADDING
#define NH_FLD_ETH_ALL_FIELDS

/* VLAN fields */
#define NH_FLD_VLAN_VPRI
#define NH_FLD_VLAN_CFI
#define NH_FLD_VLAN_VID
#define NH_FLD_VLAN_LENGTH
#define NH_FLD_VLAN_TYPE
#define NH_FLD_VLAN_ALL_FIELDS

#define NH_FLD_VLAN_TCI

/* IP (generic) fields */
#define NH_FLD_IP_VER
#define NH_FLD_IP_DSCP
#define NH_FLD_IP_ECN
#define NH_FLD_IP_PROTO
#define NH_FLD_IP_SRC
#define NH_FLD_IP_DST
#define NH_FLD_IP_TOS_TC
#define NH_FLD_IP_ID
#define NH_FLD_IP_ALL_FIELDS

/* IPV4 fields */
#define NH_FLD_IPV4_VER
#define NH_FLD_IPV4_HDR_LEN
#define NH_FLD_IPV4_TOS
#define NH_FLD_IPV4_TOTAL_LEN
#define NH_FLD_IPV4_ID
#define NH_FLD_IPV4_FLAG_D
#define NH_FLD_IPV4_FLAG_M
#define NH_FLD_IPV4_OFFSET
#define NH_FLD_IPV4_TTL
#define NH_FLD_IPV4_PROTO
#define NH_FLD_IPV4_CKSUM
#define NH_FLD_IPV4_SRC_IP
#define NH_FLD_IPV4_DST_IP
#define NH_FLD_IPV4_OPTS
#define NH_FLD_IPV4_OPTS_COUNT
#define NH_FLD_IPV4_ALL_FIELDS

/* IPV6 fields */
#define NH_FLD_IPV6_VER
#define NH_FLD_IPV6_TC
#define NH_FLD_IPV6_SRC_IP
#define NH_FLD_IPV6_DST_IP
#define NH_FLD_IPV6_NEXT_HDR
#define NH_FLD_IPV6_FL
#define NH_FLD_IPV6_HOP_LIMIT
#define NH_FLD_IPV6_ID
#define NH_FLD_IPV6_ALL_FIELDS

/* ICMP fields */
#define NH_FLD_ICMP_TYPE
#define NH_FLD_ICMP_CODE
#define NH_FLD_ICMP_CKSUM
#define NH_FLD_ICMP_ID
#define NH_FLD_ICMP_SQ_NUM
#define NH_FLD_ICMP_ALL_FIELDS

/* IGMP fields */
#define NH_FLD_IGMP_VERSION
#define NH_FLD_IGMP_TYPE
#define NH_FLD_IGMP_CKSUM
#define NH_FLD_IGMP_DATA
#define NH_FLD_IGMP_ALL_FIELDS

/* TCP fields */
#define NH_FLD_TCP_PORT_SRC
#define NH_FLD_TCP_PORT_DST
#define NH_FLD_TCP_SEQ
#define NH_FLD_TCP_ACK
#define NH_FLD_TCP_OFFSET
#define NH_FLD_TCP_FLAGS
#define NH_FLD_TCP_WINDOW
#define NH_FLD_TCP_CKSUM
#define NH_FLD_TCP_URGPTR
#define NH_FLD_TCP_OPTS
#define NH_FLD_TCP_OPTS_COUNT
#define NH_FLD_TCP_ALL_FIELDS

/* UDP fields */
#define NH_FLD_UDP_PORT_SRC
#define NH_FLD_UDP_PORT_DST
#define NH_FLD_UDP_LEN
#define NH_FLD_UDP_CKSUM
#define NH_FLD_UDP_ALL_FIELDS

/* UDP-lite fields */
#define NH_FLD_UDP_LITE_PORT_SRC
#define NH_FLD_UDP_LITE_PORT_DST
#define NH_FLD_UDP_LITE_ALL_FIELDS

/* UDP-encap-ESP fields */
#define NH_FLD_UDP_ENC_ESP_PORT_SRC
#define NH_FLD_UDP_ENC_ESP_PORT_DST
#define NH_FLD_UDP_ENC_ESP_LEN
#define NH_FLD_UDP_ENC_ESP_CKSUM
#define NH_FLD_UDP_ENC_ESP_SPI
#define NH_FLD_UDP_ENC_ESP_SEQUENCE_NUM
#define NH_FLD_UDP_ENC_ESP_ALL_FIELDS

/* SCTP fields */
#define NH_FLD_SCTP_PORT_SRC
#define NH_FLD_SCTP_PORT_DST
#define NH_FLD_SCTP_VER_TAG
#define NH_FLD_SCTP_CKSUM
#define NH_FLD_SCTP_ALL_FIELDS

/* DCCP fields */
#define NH_FLD_DCCP_PORT_SRC
#define NH_FLD_DCCP_PORT_DST
#define NH_FLD_DCCP_ALL_FIELDS

/* IPHC fields */
#define NH_FLD_IPHC_CID
#define NH_FLD_IPHC_CID_TYPE
#define NH_FLD_IPHC_HCINDEX
#define NH_FLD_IPHC_GEN
#define NH_FLD_IPHC_D_BIT
#define NH_FLD_IPHC_ALL_FIELDS

/* SCTP fields */
#define NH_FLD_SCTP_CHUNK_DATA_TYPE
#define NH_FLD_SCTP_CHUNK_DATA_FLAGS
#define NH_FLD_SCTP_CHUNK_DATA_LENGTH
#define NH_FLD_SCTP_CHUNK_DATA_TSN
#define NH_FLD_SCTP_CHUNK_DATA_STREAM_ID
#define NH_FLD_SCTP_CHUNK_DATA_STREAM_SQN
#define NH_FLD_SCTP_CHUNK_DATA_PAYLOAD_PID
#define NH_FLD_SCTP_CHUNK_DATA_UNORDERED
#define NH_FLD_SCTP_CHUNK_DATA_BEGGINING
#define NH_FLD_SCTP_CHUNK_DATA_END
#define NH_FLD_SCTP_CHUNK_DATA_ALL_FIELDS

/* L2TPV2 fields */
#define NH_FLD_L2TPV2_TYPE_BIT
#define NH_FLD_L2TPV2_LENGTH_BIT
#define NH_FLD_L2TPV2_SEQUENCE_BIT
#define NH_FLD_L2TPV2_OFFSET_BIT
#define NH_FLD_L2TPV2_PRIORITY_BIT
#define NH_FLD_L2TPV2_VERSION
#define NH_FLD_L2TPV2_LEN
#define NH_FLD_L2TPV2_TUNNEL_ID
#define NH_FLD_L2TPV2_SESSION_ID
#define NH_FLD_L2TPV2_NS
#define NH_FLD_L2TPV2_NR
#define NH_FLD_L2TPV2_OFFSET_SIZE
#define NH_FLD_L2TPV2_FIRST_BYTE
#define NH_FLD_L2TPV2_ALL_FIELDS

/* L2TPV3 fields */
#define NH_FLD_L2TPV3_CTRL_TYPE_BIT
#define NH_FLD_L2TPV3_CTRL_LENGTH_BIT
#define NH_FLD_L2TPV3_CTRL_SEQUENCE_BIT
#define NH_FLD_L2TPV3_CTRL_VERSION
#define NH_FLD_L2TPV3_CTRL_LENGTH
#define NH_FLD_L2TPV3_CTRL_CONTROL
#define NH_FLD_L2TPV3_CTRL_SENT
#define NH_FLD_L2TPV3_CTRL_RECV
#define NH_FLD_L2TPV3_CTRL_FIRST_BYTE
#define NH_FLD_L2TPV3_CTRL_ALL_FIELDS

#define NH_FLD_L2TPV3_SESS_TYPE_BIT
#define NH_FLD_L2TPV3_SESS_VERSION
#define NH_FLD_L2TPV3_SESS_ID
#define NH_FLD_L2TPV3_SESS_COOKIE
#define NH_FLD_L2TPV3_SESS_ALL_FIELDS

/* PPP fields */
#define NH_FLD_PPP_PID
#define NH_FLD_PPP_COMPRESSED
#define NH_FLD_PPP_ALL_FIELDS

/* PPPoE fields */
#define NH_FLD_PPPOE_VER
#define NH_FLD_PPPOE_TYPE
#define NH_FLD_PPPOE_CODE
#define NH_FLD_PPPOE_SID
#define NH_FLD_PPPOE_LEN
#define NH_FLD_PPPOE_SESSION
#define NH_FLD_PPPOE_PID
#define NH_FLD_PPPOE_ALL_FIELDS

/* PPP-Mux fields */
#define NH_FLD_PPPMUX_PID
#define NH_FLD_PPPMUX_CKSUM
#define NH_FLD_PPPMUX_COMPRESSED
#define NH_FLD_PPPMUX_ALL_FIELDS

/* PPP-Mux sub-frame fields */
#define NH_FLD_PPPMUX_SUBFRM_PFF
#define NH_FLD_PPPMUX_SUBFRM_LXT
#define NH_FLD_PPPMUX_SUBFRM_LEN
#define NH_FLD_PPPMUX_SUBFRM_PID
#define NH_FLD_PPPMUX_SUBFRM_USE_PID
#define NH_FLD_PPPMUX_SUBFRM_ALL_FIELDS

/* LLC fields */
#define NH_FLD_LLC_DSAP
#define NH_FLD_LLC_SSAP
#define NH_FLD_LLC_CTRL
#define NH_FLD_LLC_ALL_FIELDS

/* NLPID fields */
#define NH_FLD_NLPID_NLPID
#define NH_FLD_NLPID_ALL_FIELDS

/* SNAP fields */
#define NH_FLD_SNAP_OUI
#define NH_FLD_SNAP_PID
#define NH_FLD_SNAP_ALL_FIELDS

/* LLC SNAP fields */
#define NH_FLD_LLC_SNAP_TYPE
#define NH_FLD_LLC_SNAP_ALL_FIELDS

/* ARP fields */
#define NH_FLD_ARP_HTYPE
#define NH_FLD_ARP_PTYPE
#define NH_FLD_ARP_HLEN
#define NH_FLD_ARP_PLEN
#define NH_FLD_ARP_OPER
#define NH_FLD_ARP_SHA
#define NH_FLD_ARP_SPA
#define NH_FLD_ARP_THA
#define NH_FLD_ARP_TPA
#define NH_FLD_ARP_ALL_FIELDS

/* RFC2684 fields */
#define NH_FLD_RFC2684_LLC
#define NH_FLD_RFC2684_NLPID
#define NH_FLD_RFC2684_OUI
#define NH_FLD_RFC2684_PID
#define NH_FLD_RFC2684_VPN_OUI
#define NH_FLD_RFC2684_VPN_IDX
#define NH_FLD_RFC2684_ALL_FIELDS

/* User defined fields */
#define NH_FLD_USER_DEFINED_SRCPORT
#define NH_FLD_USER_DEFINED_PCDID
#define NH_FLD_USER_DEFINED_ALL_FIELDS

/* Payload fields */
#define NH_FLD_PAYLOAD_BUFFER
#define NH_FLD_PAYLOAD_SIZE
#define NH_FLD_MAX_FRM_SIZE
#define NH_FLD_MIN_FRM_SIZE
#define NH_FLD_PAYLOAD_TYPE
#define NH_FLD_FRAME_SIZE
#define NH_FLD_PAYLOAD_ALL_FIELDS

/* GRE fields */
#define NH_FLD_GRE_TYPE
#define NH_FLD_GRE_ALL_FIELDS

/* MINENCAP fields */
#define NH_FLD_MINENCAP_SRC_IP
#define NH_FLD_MINENCAP_DST_IP
#define NH_FLD_MINENCAP_TYPE
#define NH_FLD_MINENCAP_ALL_FIELDS

/* IPSEC AH fields */
#define NH_FLD_IPSEC_AH_SPI
#define NH_FLD_IPSEC_AH_NH
#define NH_FLD_IPSEC_AH_ALL_FIELDS

/* IPSEC ESP fields */
#define NH_FLD_IPSEC_ESP_SPI
#define NH_FLD_IPSEC_ESP_SEQUENCE_NUM
#define NH_FLD_IPSEC_ESP_ALL_FIELDS

/* MPLS fields */
#define NH_FLD_MPLS_LABEL_STACK
#define NH_FLD_MPLS_LABEL_STACK_ALL_FIELDS

/* MACSEC fields */
#define NH_FLD_MACSEC_SECTAG
#define NH_FLD_MACSEC_ALL_FIELDS

/* GTP fields */
#define NH_FLD_GTP_TEID

/* Supported protocols */
enum net_prot {};

/**
 * struct dpkg_extract - A structure for defining a single extraction
 * @type: Determines how the union below is interpreted:
 *	DPKG_EXTRACT_FROM_HDR: selects 'from_hdr';
 *	DPKG_EXTRACT_FROM_DATA: selects 'from_data';
 *	DPKG_EXTRACT_FROM_PARSE: selects 'from_parse'
 * @extract: Selects extraction method
 * @extract.from_hdr: Used when 'type = DPKG_EXTRACT_FROM_HDR'
 * @extract.from_data: Used when 'type = DPKG_EXTRACT_FROM_DATA'
 * @extract.from_parse:  Used when 'type = DPKG_EXTRACT_FROM_PARSE'
 * @extract.from_hdr.prot: Any of the supported headers
 * @extract.from_hdr.type: Defines the type of header extraction:
 *	DPKG_FROM_HDR: use size & offset below;
 *	DPKG_FROM_FIELD: use field, size and offset below;
 *	DPKG_FULL_FIELD: use field below
 * @extract.from_hdr.field: One of the supported fields (NH_FLD_)
 * @extract.from_hdr.size: Size in bytes
 * @extract.from_hdr.offset: Byte offset
 * @extract.from_hdr.hdr_index: Clear for cases not listed below;
 *	Used for protocols that may have more than a single
 *	header, 0 indicates an outer header;
 *	Supported protocols (possible values):
 *	NET_PROT_VLAN (0, HDR_INDEX_LAST);
 *	NET_PROT_MPLS (0, 1, HDR_INDEX_LAST);
 *	NET_PROT_IP(0, HDR_INDEX_LAST);
 *	NET_PROT_IPv4(0, HDR_INDEX_LAST);
 *	NET_PROT_IPv6(0, HDR_INDEX_LAST);
 * @extract.from_data.size: Size in bytes
 * @extract.from_data.offset: Byte offset
 * @extract.from_parse.size: Size in bytes
 * @extract.from_parse.offset: Byte offset
 * @num_of_byte_masks: Defines the number of valid entries in the array below;
 *		This is	also the number of bytes to be used as masks
 * @masks: Masks parameters
 */
struct dpkg_extract {};

/**
 * struct dpkg_profile_cfg - A structure for defining a full Key Generation
 *				profile (rule)
 * @num_extracts: Defines the number of valid entries in the array below
 * @extracts: Array of required extractions
 */
struct dpkg_profile_cfg {};

#endif /* __FSL_DPKG_H_ */