OpenCSD - CoreSight Trace Decode Library
0.14.1
|
Go to the documentation of this file.
36 #ifndef ARM_TRC_PKT_PROC_BASE_H_INCLUDED
37 #define ARM_TRC_PKT_PROC_BASE_H_INCLUDED
68 TrcPktProcI(
const char *component_name,
int instIDNum);
75 const uint32_t dataBlockSize,
76 const uint8_t *pDataBlock,
77 uint32_t *numBytesProcessed) = 0;
85 const uint32_t dataBlockSize,
86 const uint8_t *pDataBlock,
87 uint32_t *numBytesProcessed) = 0;
122 template <
class P,
class Pt,
class Pc>
137 const uint32_t dataBlockSize,
138 const uint8_t *pDataBlock,
139 uint32_t *numBytesProcessed);
166 const uint8_t *p_data);
221 const uint32_t dataBlockSize,
222 const uint8_t *pDataBlock,
223 uint32_t *numBytesProcessed)
230 if((dataBlockSize == 0) || (pDataBlock == 0) || (numBytesProcessed == 0))
232 if(numBytesProcessed)
233 *numBytesProcessed = 0;
238 resp = processData(index,dataBlockSize,pDataBlock,numBytesProcessed);
267 if(m_pkt_out_i.hasAttachedAndEnabled())
268 resp = m_pkt_out_i.first()->PacketDataIn(
OCSD_OP_RESET,index,0);
275 if(m_pkt_raw_mon_i.hasAttachedAndEnabled())
276 m_pkt_raw_mon_i.first()->RawPacketDataMon(
OCSD_OP_RESET,index,0,0,0);
287 if(m_pkt_out_i.hasAttachedAndEnabled())
292 resplocal = onFlush();
294 return (resplocal > resp) ? resplocal : resp;
303 resp = m_pkt_out_i.first()->PacketDataIn(
OCSD_OP_EOT,0,0);
306 if(m_pkt_raw_mon_i.hasAttachedAndEnabled())
307 m_pkt_raw_mon_i.first()->RawPacketDataMon(
OCSD_OP_EOT,0,0,0,0);
321 if(m_pkt_out_i.hasAttachedAndEnabled())
322 resp = m_pkt_out_i.first()->PacketDataIn(
OCSD_OP_DATA,index,pkt);
330 const uint8_t *p_data)
341 if(m_pkt_raw_mon_i.hasAttachedAndEnabled())
342 m_pkt_raw_mon_i.first()->RawPacketDataMon(
OCSD_OP_DATA,index_sop,pkt,size,p_data);
347 return m_pkt_raw_mon_i.hasAttachedAndEnabled();
353 if(m_pkt_indexer_i.hasAttachedAndEnabled())
354 m_pkt_indexer_i.first()->TracePktIndex(index_sop,packet_type);
359 indexPacket(index_sop,pkt_type);
360 if(pktdata.size() > 0)
361 outputRawPacketToMonitor(index_sop,pkt,(uint32_t)pktdata.size(),&pktdata[0]);
362 return outputDecodedPacket(index_sop,pkt);
367 indexPacket(index_sop,pkt_type);
368 outputRawPacketToMonitor(index_sop,pkt,pktlen,pktdata);
369 return outputDecodedPacket(index_sop,pkt);
378 m_config =
new (std::nothrow) Pc(*config);
380 err = onProtocolConfig();
400 if( (m_config != 0) &&
401 (m_pkt_out_i.hasAttached() || m_pkt_raw_mon_i.hasAttached())
410 #endif // ARM_TRC_PKT_PROC_BASE_H_INCLUDED
enum _ocsd_datapath_resp_t ocsd_datapath_resp_t
ocsd_datapath_resp_t outputDecodedPacket(const ocsd_trc_index_t index_sop, const P *pkt)
void indexPacket(const ocsd_trc_index_t index_sop, const Pt *packet_type)
componentAttachPt< ITrcPktIndexer< Pt > > * getTraceIDIndexerAttachPt()
Attachment point for a packet indexer.
#define OCSD_DATA_RESP_IS_CONT(x)
virtual ocsd_datapath_resp_t onReset()=0
Implementation function for the OCSD_OP_RESET operation.
componentAttachPt< IPktDataIn< P > > * getPacketOutAttachPt()
Attachement point for the protocol packet output.
virtual ocsd_err_t onProtocolConfig()=0
Called when the configuration object is passed to the decoder.
virtual ocsd_datapath_resp_t TraceDataIn(const ocsd_datapath_op_t op, const ocsd_trc_index_t index, const uint32_t dataBlockSize, const uint8_t *pDataBlock, uint32_t *numBytesProcessed)
const bool hasRawMon() const
componentAttachPt< IPktRawDataMon< P > > * getRawPacketMonAttachPt()
Attachment point for the protocol packet monitor.
enum _ocsd_err_t ocsd_err_t
@ OCSD_RESP_FATAL_INVALID_OP
virtual ocsd_datapath_resp_t onFlush()=0
Implementation function for the OCSD_OP_FLUSH operation.
virtual ocsd_datapath_resp_t onEOT()=0
Implementation function for the OCSD_OP_EOT operation.
enum _ocsd_datapath_op_t ocsd_datapath_op_t
Base class for all decode components in the library.
OpenCSD : Base trace decode component.
@ OCSD_ERR_INVALID_PARAM_VAL
uint32_t ocsd_trc_index_t
virtual ocsd_datapath_resp_t processData(const ocsd_trc_index_t index, const uint32_t dataBlockSize, const uint8_t *pDataBlock, uint32_t *numBytesProcessed)=0
Implementation function for the OCSD_OP_DATA operation.
Single component interface pointer attachment point.
virtual ocsd_datapath_resp_t TraceDataIn(const ocsd_datapath_op_t op, const ocsd_trc_index_t index, const uint32_t dataBlockSize, const uint8_t *pDataBlock, uint32_t *numBytesProcessed)=0
OpenCSD : Component attachment point interface class.
virtual const Pc * getProtocolConfig() const
virtual ~TrcPktProcBase()
TrcPktProcI(const char *component_name)
virtual const bool isBadPacket() const =0
check if the current packet is an error / bad packet
TrcPktProcBase(const char *component_name)
#define OCSD_OPFLG_PKTPROC_NOMON_BAD_PKTS
Base Packet processing interface.
Packet Processor base class. Provides common infrastructure and interconnections for packet processor...
@ OCSD_RESP_FATAL_INVALID_PARAM
ocsd_datapath_resp_t outputOnAllInterfaces(const ocsd_trc_index_t index_sop, const P *pkt, const Pt *pkt_type, std::vector< uint8_t > &pktdata)
virtual ocsd_err_t setProtocolConfig(const Pc *config)
< Set the protocol specific configuration for the decoder.
#define OCSD_OPFLG_PKTPROC_NOFWD_BAD_PKTS
#define OCSD_DATA_RESP_IS_FATAL(x)
Interface to either trace data frame deformatter or packet processor.
void outputRawPacketToMonitor(const ocsd_trc_index_t index_sop, const P *pkt, const uint32_t size, const uint8_t *p_data)