xref: /freebsd/contrib/opencsd/decoder/include/interfaces/trc_pkt_in_i.h (revision c120c5646da1a1d2c4d90fd069a7e2a8d559eb46)
1*c120c564SAndrew Turner /*
2*c120c564SAndrew Turner  * \file       trc_pkt_in_i.h
3*c120c564SAndrew Turner  * \brief      OpenCSD : Interface for trace protocol packet input
4*c120c564SAndrew Turner  *
5*c120c564SAndrew Turner  * \copyright  Copyright (c) 2015, ARM Limited. All Rights Reserved.
6*c120c564SAndrew Turner  */
7*c120c564SAndrew Turner 
8*c120c564SAndrew Turner 
9*c120c564SAndrew Turner /*
10*c120c564SAndrew Turner  * Redistribution and use in source and binary forms, with or without modification,
11*c120c564SAndrew Turner  * are permitted provided that the following conditions are met:
12*c120c564SAndrew Turner  *
13*c120c564SAndrew Turner  * 1. Redistributions of source code must retain the above copyright notice,
14*c120c564SAndrew Turner  * this list of conditions and the following disclaimer.
15*c120c564SAndrew Turner  *
16*c120c564SAndrew Turner  * 2. Redistributions in binary form must reproduce the above copyright notice,
17*c120c564SAndrew Turner  * this list of conditions and the following disclaimer in the documentation
18*c120c564SAndrew Turner  * and/or other materials provided with the distribution.
19*c120c564SAndrew Turner  *
20*c120c564SAndrew Turner  * 3. Neither the name of the copyright holder nor the names of its contributors
21*c120c564SAndrew Turner  * may be used to endorse or promote products derived from this software without
22*c120c564SAndrew Turner  * specific prior written permission.
23*c120c564SAndrew Turner  *
24*c120c564SAndrew Turner  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
25*c120c564SAndrew Turner  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26*c120c564SAndrew Turner  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
27*c120c564SAndrew Turner  * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
28*c120c564SAndrew Turner  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29*c120c564SAndrew Turner  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30*c120c564SAndrew Turner  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
31*c120c564SAndrew Turner  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32*c120c564SAndrew Turner  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33*c120c564SAndrew Turner  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34*c120c564SAndrew Turner  */
35*c120c564SAndrew Turner 
36*c120c564SAndrew Turner #ifndef ARM_TRC_PKT_IN_I_H_INCLUDED
37*c120c564SAndrew Turner #define ARM_TRC_PKT_IN_I_H_INCLUDED
38*c120c564SAndrew Turner 
39*c120c564SAndrew Turner #include "trc_abs_typed_base_i.h"
40*c120c564SAndrew Turner 
41*c120c564SAndrew Turner /*!
42*c120c564SAndrew Turner  * @class IPktDataIn
43*c120c564SAndrew Turner  * @ingroup ocsd_interfaces
44*c120c564SAndrew Turner  * @brief Interface class providing an input for discrete protocol packets.
45*c120c564SAndrew Turner  *
46*c120c564SAndrew Turner  * Implemented by trace protocol packet decoders to convert packets into
47*c120c564SAndrew Turner  * generic trace elements.
48*c120c564SAndrew Turner  *
49*c120c564SAndrew Turner  * Packet class used will contain information on the latest packet,
50*c120c564SAndrew Turner  * and any intra-packet state.
51*c120c564SAndrew Turner  *
52*c120c564SAndrew Turner  */
53*c120c564SAndrew Turner template<class P>
54*c120c564SAndrew Turner class IPktDataIn : public ITrcTypedBase
55*c120c564SAndrew Turner {
56*c120c564SAndrew Turner public:
IPktDataIn()57*c120c564SAndrew Turner     IPktDataIn() {}; /**< Default constructor. */
~IPktDataIn()58*c120c564SAndrew Turner     virtual ~IPktDataIn() {}; /**< Default destructor. */
59*c120c564SAndrew Turner 
60*c120c564SAndrew Turner     /*!
61*c120c564SAndrew Turner      * Interface function to process a single protocol packet.
62*c120c564SAndrew Turner      * Pass a trace index for the start of packet and a pointer to a packet when the
63*c120c564SAndrew Turner      * datapath operation is OCSD_OP_DATA.
64*c120c564SAndrew Turner      *
65*c120c564SAndrew Turner      * @param op : Datapath operation.
66*c120c564SAndrew Turner      * @param index_sop : Trace index for the start of the packet, 0 if not OCSD_OP_DATA.
67*c120c564SAndrew Turner      * @param *p_packet_in : Protocol Packet - when data path operation is OCSD_OP_DATA. null otherwise.
68*c120c564SAndrew Turner      *
69*c120c564SAndrew Turner      * @return ocsd_datapath_resp_t  : Standard data path response.
70*c120c564SAndrew Turner      */
71*c120c564SAndrew Turner     virtual ocsd_datapath_resp_t PacketDataIn( const ocsd_datapath_op_t op,
72*c120c564SAndrew Turner                                                 const ocsd_trc_index_t index_sop,
73*c120c564SAndrew Turner                                                 const P *p_packet_in) = 0;
74*c120c564SAndrew Turner 
75*c120c564SAndrew Turner 
76*c120c564SAndrew Turner };
77*c120c564SAndrew Turner 
78*c120c564SAndrew Turner #endif // ARM_TRC_PKT_IN_I_H_INCLUDED
79*c120c564SAndrew Turner 
80*c120c564SAndrew Turner /* End of File trc_proc_pkt_in_i.h */
81