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