OpenSDN source code
packet_interface.h
Go to the documentation of this file.
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
9
// Implementation of Pkt Interface. Interface is used to exchange packets
10
// between vrouter to agent
12
13
struct
PacketInterfaceData
;
14
15
class
PacketInterface
:
public
Interface
{
16
public
:
17
PacketInterface
(
const
std::string &
name
);
18
virtual
~PacketInterface
();
19
20
virtual
bool
CmpInterface
(
const
DBEntry
&rhs)
const
{
return
false
; }
21
22
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
PacketInterfaceKey
(
const
boost::uuids::uuid
&
uuid
,
44
const
std::string &name) :
45
InterfaceKey
(
AgentKey
::
ADD_DEL_CHANGE
,
Interface
::PACKET,
uuid
, name,
46
false) {
47
}
48
49
virtual
~PacketInterfaceKey
() {}
50
51
Interface
*
AllocEntry
(
const
InterfaceTable
*table)
const
{
52
return
new
PacketInterface
(
name_
);
53
}
54
Interface
*
AllocEntry
(
const
InterfaceTable
*table,
55
const
InterfaceData
*data)
const
{
56
return
new
PacketInterface
(
name_
);
57
}
58
59
InterfaceKey
*
Clone
()
const
{
60
return
new
PacketInterfaceKey
(*
this
);
61
}
62
};
63
64
struct
PacketInterfaceData
:
public
InterfaceData
{
65
PacketInterfaceData
(
Interface::Transport
transport) :
66
InterfaceData
(NULL, NULL, transport) {
67
PktInit
();
68
}
69
};
70
71
#endif
// vnsw_agent_packet_interface_hpp
Agent
Definition:
agent.h:360
DBEntryBase::KeyPtr
std::unique_ptr< DBRequestKey > KeyPtr
Definition:
db_entry.h:25
DBEntryBase::Delete
void Delete()
Definition:
db_entry.cc:131
DBEntry
Definition:
db_entry.h:97
InterfaceTable
Definition:
interface.h:301
Interface
Definition:
interface.h:23
Interface::Transport
Transport
Definition:
interface.h:62
Interface::name
const std::string & name() const
Definition:
interface.h:114
Interface::transport
Interface::Transport transport() const
Definition:
interface.h:138
PacketInterface
Definition:
packet_interface.h:15
PacketInterface::OnChange
bool OnChange(PacketInterfaceData *data)
Definition:
interface.cc:698
PacketInterface::ObtainOsSpecificParams
virtual void ObtainOsSpecificParams(const std::string &name, Agent *agent)
Definition:
interface_params.cc:59
PacketInterface::DeleteReq
static void DeleteReq(InterfaceTable *table, const std::string &ifname)
Definition:
interface.cc:683
PacketInterface::DISALLOW_COPY_AND_ASSIGN
DISALLOW_COPY_AND_ASSIGN(PacketInterface)
PacketInterface::~PacketInterface
virtual ~PacketInterface()
Definition:
interface.cc:646
PacketInterface::Create
static void Create(InterfaceTable *table, const std::string &ifname, Interface::Transport transport)
Definition:
interface.cc:674
PacketInterface::CreateReq
static void CreateReq(InterfaceTable *table, const std::string &ifname, Interface::Transport transport)
Definition:
interface.cc:665
PacketInterface::PacketInterface
PacketInterface(const std::string &name)
Definition:
interface.cc:642
PacketInterface::CmpInterface
virtual bool CmpInterface(const DBEntry &rhs) const
Definition:
packet_interface.h:20
PacketInterface::GetDBRequestKey
KeyPtr GetDBRequestKey() const
Definition:
interface.cc:649
PacketInterface::PostAdd
void PostAdd()
Definition:
interface.cc:654
PacketInterface::ToString
std::string ToString() const
Definition:
packet_interface.h:22
AgentKey
Definition:
agent_db.h:95
AgentKey::ADD_DEL_CHANGE
@ ADD_DEL_CHANGE
Definition:
agent_db.h:98
DBRequest
Definition:
db_table.h:35
InterfaceData
Definition:
interface.h:250
InterfaceData::PktInit
void PktInit()
Definition:
interface.h:258
InterfaceKey
Definition:
interface.h:198
InterfaceKey::name_
std::string name_
Definition:
interface.h:245
PacketInterfaceData
Definition:
packet_interface.h:64
PacketInterfaceData::PacketInterfaceData
PacketInterfaceData(Interface::Transport transport)
Definition:
packet_interface.h:65
PacketInterfaceKey
Definition:
packet_interface.h:42
PacketInterfaceKey::AllocEntry
Interface * AllocEntry(const InterfaceTable *table) const
Definition:
packet_interface.h:51
PacketInterfaceKey::AllocEntry
Interface * AllocEntry(const InterfaceTable *table, const InterfaceData *data) const
Definition:
packet_interface.h:54
PacketInterfaceKey::~PacketInterfaceKey
virtual ~PacketInterfaceKey()
Definition:
packet_interface.h:49
PacketInterfaceKey::Clone
InterfaceKey * Clone() const
Definition:
packet_interface.h:59
PacketInterfaceKey::PacketInterfaceKey
PacketInterfaceKey(const boost::uuids::uuid &uuid, const std::string &name)
Definition:
packet_interface.h:43
uuid
boost::uuids::uuid uuid
Definition:
vnsw/agent/filter/policy.h:11
contrail
controller
src
vnsw
agent
oper
packet_interface.h
Generated by
1.9.1