LCOV - code coverage report
Current view: top level - vnsw/agent/test-xml - test_xml_packet.h (source / functions) Hit Total Coverage
Test: OpenSDN C/C++ coverage (all TARGET_SET jobs) Lines: 0 1 0.0 %
Date: 2026-11-09 02:10:49 Functions: 0 1 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :  * Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
       3             :  * Copyright Contributors to the OpenSDN project
       4             :  */
       5             : 
       6             : #ifndef vnsw_agent_test_xml_test_xml_packet_h
       7             : #define vnsw_agent_test_xml_test_xmk_packet_h
       8             : 
       9             : #include <agent_cmn.h>
      10             : #include <agent.h>
      11             : #include <oper/nexthop.h>
      12             : #include <pkt/pkt_handler.h>
      13             : 
      14             : /////////////////////////////////////////////////////////////////////////////
      15             : // Generic class to describe packets. Can be used for packet parse tests,
      16             : // flow tests etc...
      17             : /////////////////////////////////////////////////////////////////////////////
      18             : class AgentUtXmlPacketUtils {
      19             : public:
      20             :     AgentUtXmlPacketUtils();
      21             :     virtual ~AgentUtXmlPacketUtils();
      22             : 
      23             :     bool ReadXml(const pugi::xml_node &node);
      24             :     const string ToString();
      25             : 
      26             :     bool Inet6Packet(Interface *intf, Agent *agent, PktGen *pkt);
      27             :     bool InetPacket(Interface *intf, Agent *agent, PktGen *pkt);
      28             :     bool MakePacket(Agent *agent, PktGen *pkt);
      29             : 
      30             :     TunnelType::Type GetTunnelType() const;
      31             :     uint8_t GetIpProto() const;
      32             :     uint8_t GetTrapCode() const;
      33             :     PktHandler::PktModuleName GetPacketModule()const;
      34             :     bool IsL2Mode() const;
      35             :     bool IsL3Mode() const;
      36             : 
      37             : public:
      38             :     std::string name_;
      39             :     uint32_t len_;
      40             :     uint32_t vrf_id_;
      41             :     std::string vrf_str_;
      42             :     bool ingress_;
      43             :     std::string fwd_mode_;
      44             :     std::string pkt_module_;
      45             : 
      46             :     uint32_t intf_id_;
      47             :     std::string intf_;
      48             : 
      49             :     std::string tunnel_type_;
      50             :     std::string tunnel_sip_;
      51             :     std::string tunnel_dip_;
      52             :     uint32_t label_;
      53             :     uint32_t vxlan_id_;
      54             : 
      55             :     std::string smac_;
      56             :     std::string dmac_;
      57             :     std::string sip_;
      58             :     std::string dip_;
      59             :     uint16_t proto_id_;
      60             :     std::string proto_;
      61             :     uint16_t sport_;
      62             :     uint16_t dport_;
      63             :     bool tcp_ack_;
      64             : 
      65             :     std::string trap_code_;
      66             :     uint32_t hash_id_;
      67             : };
      68             : 
      69             : /////////////////////////////////////////////////////////////////////////////
      70             : //   Packet nodes
      71             : /////////////////////////////////////////////////////////////////////////////
      72             : class AgentUtXmlPacket : public AgentUtXmlNode {
      73             : public:
      74             :     AgentUtXmlPacket(const std::string &name, const pugi::xml_node &node,
      75             :                      AgentUtXmlTestCase *test_case);
      76             :     virtual ~AgentUtXmlPacket();
      77             : 
      78             :     virtual bool ReadXml();
      79             :     virtual bool ToXml(pugi::xml_node *parent);
      80             :     virtual std::string NodeType();
      81             :     virtual void ToString(std::string *str);
      82             :     virtual bool Run();
      83             : 
      84             :     bool TxInet6Packet();
      85             :     bool TxInetPacket();
      86             : private:
      87             :     AgentUtXmlPacketUtils pkt_;
      88             : };
      89             : 
      90             : /////////////////////////////////////////////////////////////////////////////
      91             : // Packet Parser Validation entries
      92             : /////////////////////////////////////////////////////////////////////////////
      93             : class AgentUtXmlPktParseValidate : public AgentUtXmlValidationNode {
      94             : public:
      95             :     AgentUtXmlPktParseValidate(const std::string &name,
      96             :                                const pugi::xml_node &node);
      97             :     virtual ~AgentUtXmlPktParseValidate();
      98             : 
      99             :     virtual bool ReadXml();
     100             :     virtual bool Validate();
     101             :     virtual const std::string ToString();
     102           0 :     virtual uint32_t wait_count() { return 2; }
     103             : 
     104             :     bool Validate(PktHandler::PktModuleName type, PktInfo *info);
     105             : private:
     106             :     AgentUtXmlPacketUtils pkt_;
     107             : };
     108             : 
     109             : #endif //  vnsw_agent_test_xml_test_xml_packet_h

Generated by: LCOV version 1.14