?? zl5011x.h
字號:
ZL5011X_CD,
ZL5011X_PW,
ZL5011X_IP_CD,
ZL5011X_IP_UDP,
ZL5011X_IP_UDP_PW,
ZL5011X_IP_UDP_CD,
ZL5011X_IP_UDP_RTP,
ZL5011X_IP_UDP_RTP_PW,
ZL5011X_IP_UDP_RTP_PW_ALT,
ZL5011X_IP_UDP_L2TPV2_PW,
ZL5011X_IP_L2TPV3_PW,
ZL5011X_IP_L2TPV3_RTP_PW,
ZL5011X_IP_PW_TS,
ZL5011X_MPLS,
ZL5011X_MPLS_PW,
ZL5011X_ECID_PW = ZL5011X_MPLS_PW,
ZL5011X_MPLS_MPLS_PW,
ZL5011X_MPLS_PW_RTP,
ZL5011X_ECID_PW_RTP = ZL5011X_MPLS_PW_RTP,
/* customised protocols, using proprietary 8 byte header for routing */
ZL5011X_CUSTOM8_PW,
ZL5011X_CUSTOM8_RTP_PW,
ZL5011X_CUSTOM8_PW_RTP,
/* Control Protocol Stacks */
ZL5011X_IP_UDP_RTCP_CTRL,
ZL5011X_IP_UDP_L2TPV2_CTRL,
ZL5011X_IP_L2TPV3_CTRL,
ZL5011X_IP_L2TPV3_RTCP_CTRL,
ZL5011X_MPLS_RTCP_CTRL,
/* Generic Ethernet Protocol */
ZL5011X_ETHERNET,
/* Illegal - this should remain the last entry in the
enumeration for range checking purposes in the implementation. */
ZL5011X_INVALID_PROTOCOL
} zl5011xProtocolTypeE;
/******************************************************************************
* enumerations + structures used for controlling the packet Tx
******************************************************************************/
/* The Tx Header structures for RTP block */
typedef struct
{
/* length of the header in bytes - must be a multiple of 2 bytes */
Uint8T txHighLength;
Uint8T txHighData[ZL5011X_RTP_HIGH_HEADER_MAX_LEN];
/* controls whether the timestamp and sequence numbers are taken from the
shadow header or this header during a context switch. When updating a context,
this should be set to false */
zl5011xBooleanE firstHighHeader;
/* enable and position of the length field */
zl5011xBooleanE layer4LengthEnable;
Uint8T layer4LengthPos;
/* enable and position of the checksum field */
zl5011xBooleanE layer4ChecksumEnable;
zl5011xBooleanE layer4ChecksumPresent;
Uint8T layer4ChecksumPos;
/* enable and position of the sequence number. Also control to set the
length to either 16 or 8 bits */
zl5011xBooleanE layer5SequenceNumEnable;
zl5011xBooleanE layer5SequenceNum16bit;
Uint8T layer5SequenceNumPos;
/* enable and position of the timestamp. Also control to set the
length to either 32 or 16 bits, and the timestamp increment to be
used for each packet */
zl5011xBooleanE layer5TimestampEnable;
zl5011xBooleanE layer5Timestamp32bit;
Uint8T layer5TimestampPos;
Uint16T layer5TimestampIncrement;
/* control to allow the RTP timestamp to be derived from the WAN interface
as opposed to the header itself (the default) */
zl5011xBooleanE layer5TimestampFromWan;
/* structure entries for internal use */
/* value for CTRL - 2 bit field */
Uint8T highSilenceCtrl;
/* outgoing context ID */
Uint32T highContextOut;
} zl5011xPacketTxHighHeaderS;
/*******************************************************************************/
typedef struct
{
Uint8T txLowLength;
Uint8T txLowData[ZL5011X_PTX_LOW_HEADER_MAX_LEN];
/* fields to control the insertion of the layer 2 length.
The position of the field is stored in bytes. The header entry,
is the value that should be used in the length field for a payload
of 0 bytes */
zl5011xBooleanE layer2LengthEnable;
Uint8T layer2LengthPos;
Uint16T layer2LengthValue;
/* fields to control the insertion of the layer 3 length.
The position of the field is stored in bytes. The header entry,
is the value that should be used in the length field for a payload
of 0 bytes */
zl5011xBooleanE layer3LengthEnable;
Uint8T layer3LengthPos;
Uint16T layer3LengthValue;
/* fields to control the insertion of the layer 3 checksum (IPv4).
The position of the field is stored in bytes. */
zl5011xBooleanE layer3ChecksumEnable;
Uint8T layer3ChecksumPos;
/* the following boolean, determines whether the ethernet source address
taken from the packet or from the ethernet MAC */
zl5011xBooleanE ethernetSrcAddressFromMac;
} zl5011xPacketTxLowHeaderS;
/******************/
typedef struct
{
zl5011xProtocolTypeE protocolType;
/* position of the pseudo wire status byte */
Uint8T pwStatusPos;
zl5011xContextHeaderSwitchE currentHeader;
zl5011xContextHeaderSwitchE shadowHeader;
zl5011xPacketTxHighHeaderS highHeader[2];
zl5011xPacketTxLowHeaderS lowHeader;
} zl5011xPacketTxHeaderS;
/******************************************************************************
* enums and structure used for the CPU interface
******************************************************************************/
/* Interrupts */
#define ZL5011X_CHECK_INTERRUPT_VALUE(X) \
((X < ZL5011X_INTERRUPT_ZERO) || (X > ZL5011X_INTERRUPT_FROZEN)) ? \
ZL5011X_PARAMETER_INVALID : ZL5011X_OK
/* ZL5011X_NUMBER_INTERRUPT_DEST - This is defined as the number
of entries in the zl5011xInterruptValueE enum definition */
#define ZL5011X_NUMBER_INTERRUPT_DEST 3
typedef enum
{
ZL5011X_INTERRUPT_ZERO = 0,
ZL5011X_INTERRUPT_ONE = 1,
ZL5011X_INTERRUPT_FROZEN = 2
} zl5011xInterruptValueE;
/* Interrupt enable values */
#define ZL5011X_CHECK_ENABLE_INTERRUPT(X) \
((X < ZL5011X_ENABLE_INT_0) || (X > ZL5011X_ENABLE_INT_0_1)) ? \
ZL5011X_PARAMETER_INVALID : ZL5011X_OK
typedef enum
{
ZL5011X_ENABLE_INT_0 = 0x00000001,
ZL5011X_ENABLE_INT_1 = 0x00000002,
ZL5011X_ENABLE_INT_0_1 = 0x00000003
} zl5011xEnableInterruptE;
typedef struct
{
zl5011xPacketTxHeaderS txHeader[ZL5011X_PKT_TX_NUM_CONTEXT_HEADERS + ZL5011X_PKT_TX_NUM_HOST_HEADERS];
} zl5011xPacketTxS;
/******************************************************************************
* enumerations + structures used for controlling the packet Rx
******************************************************************************/
typedef struct
{
zl5011xBooleanE ethertypeFilterEnable;
zl5011xQueueE ethertypeCpuQueue;
Uint16T ethertype;
zl5011xBooleanE macAddressFilterEnable;
zl5011xQueueE macAddressCpuQueue;
Uint8T macAddress[ZL5011X_MAC_SIZE];
Uint8T macAddressNumMaskBits;
} zl5011xPacketFilterMatchS;
typedef struct
{
zl5011xBooleanE filterReserved;
zl5011xBooleanE filterInUse;
/* pre processor setup information */
zl5011xPacketFilterMatchS filterMatch;
} zl5011xPkcFilterS;
/******************/
typedef struct
{
Uint8T extractClassifyBytes[ZL5011X_PKC_CLASSIFY_NUM_MATCH_FIELDS];
Uint8T extractCheckBytes[ZL5011X_PKC_CLASSIFY_NUM_CHECK_FIELDS];
Uint8T checkMask[ZL5011X_PKC_CLASSIFY_NUM_CHECK_FIELDS];
Uint8T extractPwByte;
/* the highest order bytes of the following fields, should have the highest
index number */
Uint8T extractSequenceBytes[ZL5011X_PKC_PROTOCOL_MAX_SEQ_BYTES];
Uint8T extractTimestampBytes[ZL5011X_PKC_PROTOCOL_MAX_TIMESTAMP_BYTES];
Uint8T extractLengthBytes[ZL5011X_PKC_PROTOCOL_MAX_LENGTH_BYTES];
zl5011xBooleanE discardUdpCheckFails;
zl5011xBooleanE protocolIpv4;
zl5011xBooleanE protocolVlan;
zl5011xBooleanE protocolTwoByteSeq;
Uint8T timestampShift;
} zl5011xPacketProtocolOutputS;
typedef struct
{
Uint8T protocolMatchBytes[ZL5011X_PKC_PROTOCOL_NUM_MATCH_FIELDS];
Uint8T protocolMaskBytes[ZL5011X_PKC_PROTOCOL_NUM_MATCH_FIELDS];
} zl5011xPacketProtocolMatchS;
typedef struct
{
zl5011xProtocolTypeE protocolType;
zl5011xBooleanE protocolReserved;
zl5011xBooleanE protocolInUse;
/* pre classifier setup information */
zl5011xPacketProtocolMatchS protocolMatch;
zl5011xPacketProtocolOutputS protocolOutput;
} zl5011xPkcProtocolS;
/******************/
typedef struct
{
Uint32T classifyMpid;
Uint8T classifyHeaderOffset;
Uint16T classifyLengthModifier;
zl5011xBooleanE classifyLengthNoCalc;
zl5011xBooleanE classifyTwoByteLength;
/* the following setting allows the length of the payload to be set to the
length of the received packet - header offset. When set to TRUE, the
length is derived by this means in preference to any calculation using the
length field from the packet */
zl5011xBooleanE classifyLengthFromPacket;
/* structure entries for internal use */
zl5011xFlowTypeE classifyFlow;
} zl5011xPacketClassifyOutputS;
typedef struct
{
Uint8T protocolMatchNum;
Uint8T classifyMatchBytes[ZL5011X_PKC_CLASSIFY_NUM_MATCH_FIELDS];
Uint8T classifyMaskBytes[ZL5011X_PKC_CLASSIFY_NUM_MATCH_FIELDS];
Uint8T classifyCheckBytes[ZL5011X_PKC_CLASSIFY_NUM_CHECK_FIELDS];
} zl5011xPacketClassifyMatchS;
typedef struct
{
zl5011xProtocolTypeE protocolType;
zl5011xBooleanE classifyReserved;
zl5011xBooleanE classifyInUse;
Uint32T classifyContext;
/* classifier setup information */
zl5011xPacketClassifyMatchS classifyMatch;
zl5011xPacketClassifyOutputS classifyOutput;
Uint32T context;
Uint32T pwInterruptMask;
} zl5011xPkcClassifyS;
/******************/
typedef enum
{
ZL5011X_PKC_STATE_MATCH_NOT_ALLOCATED,
ZL5011X_PKC_STATE_MATCH_UNUSED,
ZL5011X_PKC_STATE_MATCH_NEW_UPDATING,
ZL5011X_PKC_STATE_MATCH_OLD_UPDATING,
ZL5011X_PKC_STATE_MATCH_ACTIVE
} zl5011xContextRxPacketMatchStateE;
/* define the bit positions for the L and R bits in the PW status byte */
#define ZL5011X_PKT_PW_L_BIT_MASK 0x08
#define ZL5011X_PKT_PW_R_BIT_MASK 0x04
/* structure to maintain statistics for the L and R bits in the PW status byte */
typedef struct
{
Uint32T value;
Uint32T lCount;
Uint32T lTime;
Uint32T lTimePrev;
Uint32T rCount;
Uint32T rTime;
Uint32T rTimePrev;
} zl5011xPacketRxStatusByteS;
typedef struct
{
/* There can be up to 2 packet match definitions associated with each context.
One of these is associated with each of the states of the context switch bit in the
TFM. i.e. TFM context switch bit = 0 matches the first entry in the
following arrays etc. */
Uint32T pkcClassifyMatchNum[2];
zl5011xContextRxPacketMatchStateE contextMatchState[2];
zl5011xPacketRxStatusByteS statusByte;
} zl5011xContextRxPacketMatchS;
/******************/
typedef struct zl5011xProtocolStackS
{
/* protocolMatchNumber contains a valid number when the protocol has been set up
in the pre classifier. The first dimension of the array is for the presence
or absence of VLAN and the second is for IPv4 or IPv6. */
Uint8T protocolMatchNumber[2][2];
} zl5011xProtocolStackS;
typedef struct
{
/* filter matching information for the PKC pre-processor */
zl5011xPkcFilterS pkcFilter[ZL5011X_PKC_NUM_FILTER_ENTRIES];
/* protocol matching information for the PKC pre-classifier */
zl5011xBooleanE pkcProtocolDiscard;
zl5011xQueueE pkcProtocolCpuQueue;
zl5011xPkcProtocolS pkcProtocol[ZL5011X_PKC_NUM_PROTOCOL_ENTRIES];
/* context matching information for the PKC classifier */
zl5011xBooleanE pkcClassifyDiscard;
zl5011xQueueE pkcClassifyCpuQueue;
zl5011xBooleanE pkcVerifyDiscard;
zl5011xQueueE pkcVerifyCpuQueue;
zl5011xPkcClassifyS pkcClassify[ZL5011X_PKC_NUM_CLASSIFY_ENTRIES];
/* PKC match for Rx contexts */
zl5011xContextRxPacketMatchS contextRxPacketMatch[ZL5011X_MAX_NUMBER_CONTEXTS];
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -