OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PortIpcHandler Class Reference

#include <port_ipc_handler.h>

Collaboration diagram for PortIpcHandler:

Public Member Functions

 PortIpcHandler (Agent *agent, const std::string &dir)
 
virtual ~PortIpcHandler ()
 
void InitDone ()
 
void Shutdown ()
 
void ReloadAllPorts (const std::string &dir, bool check_port, bool vm_vn_port)
 
void ReloadAllPorts (bool check_port)
 
void SyncHandler ()
 
InterfaceConfigStaleCleanerinterface_stale_cleaner () const
 
bool AddPortArrayFromJson (const contrail_rapidjson::Value &d, const std::string &json, VmiSubscribeEntryPtrList &req_list, bool check_port, std::string &err_msg)
 
bool AddPortFromJson (const string &json, bool check_port, string &err_msg, bool write_file)
 
bool DeletePort (const string &url, string &err_msg)
 
void DeleteVmiUuidEntry (const boost::uuids::uuid &u, std::string &err_str)
 
bool GetPortInfo (const std::string &uuid_str, std::string &info) const
 
bool AddVgwFromJson (const std::string &json, std::string &err_msg) const
 
bool DelVgwFromJson (const std::string &json, std::string &err_msg) const
 
std::string MakeVmiUuidJson (const VmiSubscribeEntry *entry, bool meta_info) const
 
bool EnablePort (const string &url, string &err_msg)
 
bool DisablePort (const string &url, string &err_msg)
 
bool AddVmVnPort (const std::string &json, bool check_port, std::string &err_msg, bool write_file)
 
bool DeleteVmVnPort (const boost::uuids::uuid &vmi_uuid, string &err_msg)
 
bool DeleteVmVnPort (const std::string &json, const std::string &vm, string &err_msg)
 
bool GetVmVnPort (const std::string &vm_uuid, const std::string &vmi_uuid, std::string &info) const
 
bool GetVmVnCfgPort (const string &vm, string &info) const
 
boost::uuids::uuid VmVnToVmi (const boost::uuids::uuid &vm_uuid) const
 
bool MakeJsonFromVmi (const boost::uuids::uuid &vmi_uuid, std::string &resp) const
 
bool MakeJsonFromVmiConfig (const boost::uuids::uuid &vmi_uuid, string &resp) const
 
PortSubscribeTableport_subscribe_table () const
 

Static Public Attributes

static const std::string kPortsDir = "/var/lib/contrail/ports"
 

Private Member Functions

bool InterfaceExists (const std::string &name) const
 
VmiSubscribeEntryMakeAddVmiUuidRequest (const contrail_rapidjson::Value &d, bool check_port, std::string &err_msg) const
 
VmVnPortSubscribeEntryMakeAddVmVnPortRequest (const contrail_rapidjson::Value &d, bool check_port, std::string &err_msg) const
 
bool BuildGateway (const contrail_rapidjson::Value &d, const std::string &json, std::string &err_msg, VirtualGatewayInfo *req) const
 
bool HasAllGatewayFields (const contrail_rapidjson::Value &d, std::string &member_err, VirtualGatewayInfo *req) const
 
bool ValidGatewayJsonString (const contrail_rapidjson::Value &d, VirtualGatewayConfig::SubnetList *list) const
 
bool BuildGatewayArrayElement (const contrail_rapidjson::Value &d, VirtualGatewayConfig::Subnet *entry) const
 
bool AddVmiUuidEntry (PortSubscribeEntryPtr entry, const contrail_rapidjson::Value &d, bool write_file, std::string &err_msg) const
 
bool AddVmVnPortEntry (PortSubscribeEntryPtr entry, const contrail_rapidjson::Value &d, bool write_file, std::string &err_msg) const
 
bool ValidateMac (const std::string &mac) const
 
bool IsUUID (const std::string &uuid_str) const
 
void ProcessFile (const std::string &file, bool check_port, bool vm_vn_port)
 
void AddMember (const char *key, const char *value, contrail_rapidjson::Document *doc) const
 
bool WriteJsonToFile (VmiSubscribeEntry *entry, bool overwrite) const
 
bool WriteJsonToFile (VmVnPortSubscribeEntry *entry) const
 
void MakeVmVnPortJson (const VmVnPortSubscribeEntry *entry, string &info, bool meta_info) const
 
 DISALLOW_COPY_AND_ASSIGN (PortIpcHandler)
 

Private Attributes

Agentagent_
 
std::string ports_dir_
 
std::string vmvn_dir_
 
int version_
 
boost::scoped_ptr
< InterfaceConfigStaleCleaner
interface_stale_cleaner_
 
std::unique_ptr
< PortSubscribeTable
port_subscribe_table_
 

Friends

class PortIpcTest
 

Detailed Description

Definition at line 23 of file port_ipc_handler.h.

Constructor & Destructor Documentation

PortIpcHandler::PortIpcHandler ( Agent agent,
const std::string &  dir 
)

Definition at line 88 of file port_ipc_handler.cc.

Here is the call graph for this function:

PortIpcHandler::~PortIpcHandler ( )
virtual

Definition at line 117 of file port_ipc_handler.cc.

Member Function Documentation

void PortIpcHandler::AddMember ( const char *  key,
const char *  value,
contrail_rapidjson::Document *  doc 
) const
private

Definition at line 566 of file port_ipc_handler.cc.

bool PortIpcHandler::AddPortArrayFromJson ( const contrail_rapidjson::Value &  d,
const std::string &  json,
VmiSubscribeEntryPtrList req_list,
bool  check_port,
std::string &  err_msg 
)

Definition at line 180 of file port_ipc_handler.cc.

Here is the call graph for this function:

bool PortIpcHandler::AddPortFromJson ( const string &  json,
bool  check_port,
string &  err_msg,
bool  write_file 
)

Definition at line 205 of file port_ipc_handler.cc.

Here is the call graph for this function:

bool PortIpcHandler::AddVgwFromJson ( const std::string &  json,
std::string &  err_msg 
) const

Definition at line 728 of file port_ipc_handler.cc.

Here is the call graph for this function:

bool PortIpcHandler::AddVmiUuidEntry ( PortSubscribeEntryPtr  entry,
const contrail_rapidjson::Value &  d,
bool  write_file,
std::string &  err_msg 
) const
private

Definition at line 368 of file port_ipc_handler.cc.

Here is the call graph for this function:

bool PortIpcHandler::AddVmVnPort ( const std::string &  json,
bool  check_port,
std::string &  err_msg,
bool  write_file 
)

Definition at line 812 of file port_ipc_handler.cc.

Here is the call graph for this function:

bool PortIpcHandler::AddVmVnPortEntry ( PortSubscribeEntryPtr  entry,
const contrail_rapidjson::Value &  d,
bool  write_file,
std::string &  err_msg 
) const
private

Definition at line 843 of file port_ipc_handler.cc.

Here is the call graph for this function:

bool PortIpcHandler::BuildGateway ( const contrail_rapidjson::Value &  d,
const std::string &  json,
std::string &  err_msg,
VirtualGatewayInfo req 
) const
private

Definition at line 714 of file port_ipc_handler.cc.

Here is the call graph for this function:

bool PortIpcHandler::BuildGatewayArrayElement ( const contrail_rapidjson::Value &  d,
VirtualGatewayConfig::Subnet entry 
) const
private

Definition at line 643 of file port_ipc_handler.cc.

bool PortIpcHandler::DeletePort ( const string &  url,
string &  err_msg 
)

Definition at line 448 of file port_ipc_handler.cc.

Here is the call graph for this function:

void PortIpcHandler::DeleteVmiUuidEntry ( const boost::uuids::uuid u,
std::string &  err_str 
)

Definition at line 458 of file port_ipc_handler.cc.

Here is the call graph for this function:

bool PortIpcHandler::DeleteVmVnPort ( const boost::uuids::uuid vmi_uuid,
string &  err_msg 
)

Definition at line 989 of file port_ipc_handler.cc.

Here is the call graph for this function:

bool PortIpcHandler::DeleteVmVnPort ( const std::string &  json,
const std::string &  vm,
string &  err_msg 
)
bool PortIpcHandler::DelVgwFromJson ( const std::string &  json,
std::string &  err_msg 
) const

Definition at line 767 of file port_ipc_handler.cc.

Here is the call graph for this function:

bool PortIpcHandler::DisablePort ( const string &  url,
string &  err_msg 
)

Definition at line 518 of file port_ipc_handler.cc.

Here is the call graph for this function:

PortIpcHandler::DISALLOW_COPY_AND_ASSIGN ( PortIpcHandler  )
private
bool PortIpcHandler::EnablePort ( const string &  url,
string &  err_msg 
)

Definition at line 478 of file port_ipc_handler.cc.

Here is the call graph for this function:

bool PortIpcHandler::GetPortInfo ( const std::string &  uuid_str,
std::string &  info 
) const

Definition at line 618 of file port_ipc_handler.cc.

Here is the call graph for this function:

bool PortIpcHandler::GetVmVnCfgPort ( const string &  vm,
string &  info 
) const

Definition at line 1053 of file port_ipc_handler.cc.

Here is the call graph for this function:

bool PortIpcHandler::GetVmVnPort ( const std::string &  vm_uuid,
const std::string &  vmi_uuid,
std::string &  info 
) const

Definition at line 1141 of file port_ipc_handler.cc.

Here is the call graph for this function:

bool PortIpcHandler::HasAllGatewayFields ( const contrail_rapidjson::Value &  d,
std::string &  member_err,
VirtualGatewayInfo req 
) const
private

Definition at line 676 of file port_ipc_handler.cc.

Here is the call graph for this function:

void PortIpcHandler::InitDone ( )

Definition at line 634 of file port_ipc_handler.cc.

InterfaceConfigStaleCleaner* PortIpcHandler::interface_stale_cleaner ( ) const
inline

Definition at line 37 of file port_ipc_handler.h.

bool PortIpcHandler::InterfaceExists ( const std::string &  name) const
private

Definition at line 9 of file port_ipc_handler_os_impl.cc.

bool PortIpcHandler::IsUUID ( const std::string &  uuid_str) const
private

Definition at line 558 of file port_ipc_handler.cc.

Here is the call graph for this function:

VmiSubscribeEntry * PortIpcHandler::MakeAddVmiUuidRequest ( const contrail_rapidjson::Value &  d,
bool  check_port,
std::string &  err_msg 
) const
private

Definition at line 245 of file port_ipc_handler.cc.

Here is the call graph for this function:

VmVnPortSubscribeEntry * PortIpcHandler::MakeAddVmVnPortRequest ( const contrail_rapidjson::Value &  d,
bool  check_port,
std::string &  err_msg 
) const
private

Definition at line 866 of file port_ipc_handler.cc.

Here is the call graph for this function:

bool PortIpcHandler::MakeJsonFromVmi ( const boost::uuids::uuid vmi_uuid,
std::string &  resp 
) const

Definition at line 1176 of file port_ipc_handler.cc.

Here is the call graph for this function:

bool PortIpcHandler::MakeJsonFromVmiConfig ( const boost::uuids::uuid vmi_uuid,
string &  resp 
) const

Definition at line 1080 of file port_ipc_handler.cc.

Here is the call graph for this function:

std::string PortIpcHandler::MakeVmiUuidJson ( const VmiSubscribeEntry entry,
bool  meta_info 
) const

Definition at line 574 of file port_ipc_handler.cc.

Here is the call graph for this function:

void PortIpcHandler::MakeVmVnPortJson ( const VmVnPortSubscribeEntry entry,
string &  info,
bool  meta_info 
) const
private

Definition at line 920 of file port_ipc_handler.cc.

Here is the call graph for this function:

PortSubscribeTable* PortIpcHandler::port_subscribe_table ( ) const
inline

Definition at line 73 of file port_ipc_handler.h.

void PortIpcHandler::ProcessFile ( const std::string &  file,
bool  check_port,
bool  vm_vn_port 
)
private

Definition at line 162 of file port_ipc_handler.cc.

Here is the call graph for this function:

void PortIpcHandler::ReloadAllPorts ( const std::string &  dir,
bool  check_port,
bool  vm_vn_port 
)

Definition at line 120 of file port_ipc_handler.cc.

Here is the call graph for this function:

void PortIpcHandler::ReloadAllPorts ( bool  check_port)

Definition at line 143 of file port_ipc_handler.cc.

Here is the call graph for this function:

void PortIpcHandler::Shutdown ( )

Definition at line 638 of file port_ipc_handler.cc.

void PortIpcHandler::SyncHandler ( )

Definition at line 627 of file port_ipc_handler.cc.

Here is the call graph for this function:

bool PortIpcHandler::ValidateMac ( const std::string &  mac) const
private

Definition at line 429 of file port_ipc_handler.cc.

Here is the call graph for this function:

bool PortIpcHandler::ValidGatewayJsonString ( const contrail_rapidjson::Value &  d,
VirtualGatewayConfig::SubnetList list 
) const
private

Definition at line 661 of file port_ipc_handler.cc.

boost::uuids::uuid PortIpcHandler::VmVnToVmi ( const boost::uuids::uuid vm_uuid) const
bool PortIpcHandler::WriteJsonToFile ( VmiSubscribeEntry entry,
bool  overwrite 
) const
private

Definition at line 393 of file port_ipc_handler.cc.

Here is the call graph for this function:

bool PortIpcHandler::WriteJsonToFile ( VmVnPortSubscribeEntry entry) const
private

Definition at line 950 of file port_ipc_handler.cc.

Here is the call graph for this function:

Friends And Related Function Documentation

friend class PortIpcTest
friend

Definition at line 77 of file port_ipc_handler.h.

Member Data Documentation

Agent* PortIpcHandler::agent_
private

Definition at line 115 of file port_ipc_handler.h.

boost::scoped_ptr<InterfaceConfigStaleCleaner> PortIpcHandler::interface_stale_cleaner_
private

Definition at line 119 of file port_ipc_handler.h.

const std::string PortIpcHandler::kPortsDir = "/var/lib/contrail/ports"
static

Definition at line 25 of file port_ipc_handler.h.

std::unique_ptr<PortSubscribeTable> PortIpcHandler::port_subscribe_table_
private

Definition at line 120 of file port_ipc_handler.h.

std::string PortIpcHandler::ports_dir_
private

Definition at line 116 of file port_ipc_handler.h.

int PortIpcHandler::version_
private

Definition at line 118 of file port_ipc_handler.h.

std::string PortIpcHandler::vmvn_dir_
private

Definition at line 117 of file port_ipc_handler.h.


The documentation for this class was generated from the following files: