LCOV - code coverage report
Current view: top level - vnsw/agent/oper - packet_interface.h (source / functions) Hit Total Coverage
Test: OpenSDN C/C++ coverage (all TARGET_SET jobs) Lines: 16 17 94.1 %
Date: 2026-06-04 02:06:09 Functions: 8 9 88.9 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
       3             :  */
       4             : 
       5             : #ifndef vnsw_agent_packet_interface_hpp
       6             : #define vnsw_agent_packet_interface_hpp
       7             : 
       8             : /////////////////////////////////////////////////////////////////////////////
       9             : // Implementation of Pkt Interface. Interface is used to exchange packets
      10             : // between vrouter to agent
      11             : /////////////////////////////////////////////////////////////////////////////
      12             : 
      13             : struct PacketInterfaceData;
      14             : 
      15             : class PacketInterface : public Interface {
      16             : public:
      17             :     PacketInterface(const std::string &name);
      18             :     virtual ~PacketInterface();
      19             : 
      20         315 :     virtual bool CmpInterface(const DBEntry &rhs) const { return false; }
      21             : 
      22           0 :     std::string ToString() const { return "PKT <" + name() + ">"; }
      23             :     KeyPtr GetDBRequestKey() const;
      24             : 
      25             :     // Helper function to enqueue DBRequest to create a Pkt Interface
      26             :     static void CreateReq(InterfaceTable *table, const std::string &ifname,
      27             :                           Interface::Transport transport);
      28             :     static void Create(InterfaceTable *table, const std::string &ifname,
      29             :                        Interface::Transport transport);
      30             :     // Helper function to enqueue DBRequest to delete a Pkt Interface
      31             :     static void DeleteReq(InterfaceTable *table, const std::string &ifname);
      32             :     static void Delete(InterfaceTable *table, const std::string &ifname);
      33             :     void PostAdd();
      34             :     bool Delete(const DBRequest *req);
      35             :     bool OnChange(PacketInterfaceData *data);
      36             :     virtual void ObtainOsSpecificParams(const std::string &name, Agent *agent);
      37             : 
      38             : private:
      39             :     DISALLOW_COPY_AND_ASSIGN(PacketInterface);
      40             : };
      41             : 
      42             : struct PacketInterfaceKey : public InterfaceKey {
      43         178 :     PacketInterfaceKey(const boost::uuids::uuid &uuid,
      44         178 :                        const std::string &name) :
      45             :         InterfaceKey(AgentKey::ADD_DEL_CHANGE, Interface::PACKET, uuid, name,
      46         178 :                      false) {
      47         178 :     }
      48             : 
      49         606 :     virtual ~PacketInterfaceKey() {}
      50             : 
      51         170 :     Interface *AllocEntry(const InterfaceTable *table) const {
      52         170 :         return new PacketInterface(name_);
      53             :     }
      54           2 :     Interface *AllocEntry(const InterfaceTable *table,
      55             :                           const InterfaceData *data) const {
      56           2 :         return new PacketInterface(name_);
      57             :     }
      58             : 
      59         125 :     InterfaceKey *Clone() const {
      60         125 :         return new PacketInterfaceKey(*this);
      61             :     }
      62             : };
      63             : 
      64             : struct PacketInterfaceData : public InterfaceData {
      65           2 :     PacketInterfaceData(Interface::Transport transport) :
      66           2 :         InterfaceData(NULL, NULL, transport) {
      67           2 :         PktInit();
      68           2 :     }
      69             : };
      70             : 
      71             : #endif // vnsw_agent_packet_interface_hpp

Generated by: LCOV version 1.14