19 #include <ovsdb_types.h>
27 const std::string &name) :
OvsdbEntry(table), name_(name),
55 boost::system::error_code ec;
70 SandeshPhysicalSwitchInfo info;
74 info.set_op(
"Delete");
90 struct ovsdb_idl_row *row) {
99 if (entry != row_entry) {
138 while (entry != NULL) {
165 struct ovsdb_idl_row *ports[count];
170 if (old.erase(ports[i]) == 0) {
177 PhysicalSwitchEntry::InterfaceList::iterator it = old.begin();
178 while (it != old.end()) {
187 struct ovsdb_idl_row *row) {
204 resp_(new OvsdbPhysicalSwitchResp()), resp_data_(resp_ctx),
205 ip_(ip), port_(port) {
209 std::vector<OvsdbPhysicalSwitchEntry> pswitch;
214 boost::system::error_code ec;
215 Ip4Address ip_addr = Ip4Address::from_string(ip_, ec);
219 if (session != NULL && session->
client_idl() != NULL) {
224 while (entry != NULL) {
225 OvsdbPhysicalSwitchEntry pentry;
227 pentry.set_name(entry->
name());
229 pswitch.push_back(pentry);
233 resp_->set_pswitch(pswitch);
237 std::string
Description()
const {
return "PhysicalSwitchSandeshTask"; }
240 resp_->set_context(resp_data_);
241 resp_->set_more(
false);
252 void OvsdbPhysicalSwitchReq::HandleRequest()
const {
255 get_session_remote_port());
boost::asio::ip::address_v4 Ip4Address
OVSDB::OvsdbClient * ovsdb_client() const
static Agent * GetInstance()
std::string StateString() const
KSyncEntry * Next(const KSyncEntry *entry) const
KSyncEntry * Create(const KSyncEntry *key)
void Delete(KSyncEntry *entry)
void AddIdlToConnectionState(const std::string &device_name, OvsdbClientIdl *idl)
void DelIdlToConnectionState(const std::string &device_name, OvsdbClientIdl *idl)
PhysicalPortTable * physical_port_table()
PhysicalSwitchTable * physical_switch_table()
ConnectionStateTable * connection_table()
void Register(EntryType type, NotifyCB cb)
OvsdbClientIdl * client_idl()
virtual OvsdbClientSession * NextSession(OvsdbClientSession *session)=0
virtual OvsdbClientSession * FindSession(Ip4Address ip, uint16_t port)=0
struct ovsdb_idl_row * ovs_entry_
OvsdbClientIdl * client_idl()
KSyncEntry * FindActiveEntry(KSyncEntry *key)
void DeletePortEntry(struct ovsdb_idl_row *row)
void CreatePortEntry(struct ovsdb_idl_row *row, const std::string &physical_device)
KSyncEntry * UnresolvedReference()
const std::string & name()
void set_tunnel_ip(std::string ip)
std::set< struct ovsdb_idl_row * > InterfaceList
void SendTrace(Trace event) const
bool IsLess(const KSyncEntry &) const
PhysicalSwitchEntry * FindSwitchEntry(struct ovsdb_idl_row *row)
void UpdatePorts(PhysicalSwitchEntry *entry)
void Notify(OvsdbClientIdl::Op, struct ovsdb_idl_row *)
void TriggerDelete(PhysicalSwitchEntry *entry)
KSyncEntry * Alloc(const KSyncEntry *key, uint32_t index)
virtual ~PhysicalSwitchTable()
PhysicalSwitchTable(OvsdbClientIdl *idl)
IdlEntryMap idl_entry_map_
virtual bool Run()
Code to execute. Returns true if task is completed. Return false to reschedule the task.
PhysicalSwitchSandeshTask(std::string resp_ctx, const std::string &ip, uint32_t port)
OvsdbPhysicalSwitchResp * resp_
std::string Description() const
virtual ~PhysicalSwitchSandeshTask()
DISALLOW_COPY_AND_ASSIGN(PhysicalSwitchSandeshTask)
The TaskScheduler keeps track of what tasks are currently schedulable. When a task is enqueued it is ...
void Enqueue(Task *task)
Enqueues a task for running. Starts task if all policy rules are met else puts task in waitq....
static TaskScheduler * GetInstance()
Task is a wrapper over tbb::task to support policies.
void SendResponse(HttpSession *session, const std::string &msg, int status_code)
#define OVSDB_TRACE(obj,...)
size_t ovsdb_wrapper_physical_switch_ports_count(struct ovsdb_idl_row *row)
const char * ovsdb_wrapper_physical_switch_tunnel_ip(struct ovsdb_idl_row *row)
char * ovsdb_wrapper_physical_switch_name(struct ovsdb_idl_row *row)
void ovsdb_wrapper_physical_switch_ports(struct ovsdb_idl_row *row, struct ovsdb_idl_row **ports, size_t n)