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());
OVSDB::OvsdbClient * ovsdb_client() const
#define OVSDB_TRACE(obj,...)
void AddIdlToConnectionState(const std::string &device_name, OvsdbClientIdl *idl)
virtual ~PhysicalSwitchTable()
static Agent * GetInstance()
KSyncEntry * Next(const KSyncEntry *entry) const
The TaskScheduler keeps track of what tasks are currently schedulable. When a task is enqueued it is ...
bool IsLess(const KSyncEntry &) const
char * ovsdb_wrapper_physical_switch_name(struct ovsdb_idl_row *row)
void SendResponse(HttpSession *session, const std::string &msg, int status_code)
std::set< struct ovsdb_idl_row * > InterfaceList
PhysicalSwitchTable(OvsdbClientIdl *idl)
virtual bool Run()
Code to execute. Returns true if task is completed. Return false to reschedule the task...
OvsdbPhysicalSwitchResp * resp_
std::string StateString() const
void TriggerDelete(PhysicalSwitchEntry *entry)
void Delete(KSyncEntry *entry)
ConnectionStateTable * connection_table()
void DelIdlToConnectionState(const std::string &device_name, OvsdbClientIdl *idl)
IdlEntryMap idl_entry_map_
virtual ~PhysicalSwitchSandeshTask()
void Register(EntryType type, NotifyCB cb)
KSyncEntry * FindActiveEntry(KSyncEntry *key)
struct ovsdb_idl_row * ovs_entry_
void DeletePortEntry(struct ovsdb_idl_row *row)
static TaskScheduler * GetInstance()
void Enqueue(Task *task)
Enqueues a task for running. Starts task if all policy rules are met else puts task in waitq...
PhysicalSwitchEntry * FindSwitchEntry(struct ovsdb_idl_row *row)
void ovsdb_wrapper_physical_switch_ports(struct ovsdb_idl_row *row, struct ovsdb_idl_row **ports, size_t n)
const std::string & name()
std::string Description() const
OvsdbClientIdl * client_idl()
#define DISALLOW_COPY_AND_ASSIGN(_Class)
void UpdatePorts(PhysicalSwitchEntry *entry)
void CreatePortEntry(struct ovsdb_idl_row *row, const std::string &physical_device)
virtual OvsdbClientSession * FindSession(Ip4Address ip, uint16_t port)=0
boost::asio::ip::address_v4 Ip4Address
KSyncEntry * Create(const KSyncEntry *key)
KSyncEntry * UnresolvedReference()
void Notify(OvsdbClientIdl::Op, struct ovsdb_idl_row *)
PhysicalPortTable * physical_port_table()
size_t ovsdb_wrapper_physical_switch_ports_count(struct ovsdb_idl_row *row)
void SendTrace(Trace event) const
PhysicalSwitchSandeshTask(std::string resp_ctx, const std::string &ip, uint32_t port)
KSyncEntry * Alloc(const KSyncEntry *key, uint32_t index)
void set_tunnel_ip(std::string ip)
Task is a wrapper over tbb::task to support policies.
virtual OvsdbClientSession * NextSession(OvsdbClientSession *session)=0
const char * ovsdb_wrapper_physical_switch_tunnel_ip(struct ovsdb_idl_row *row)
OvsdbClientIdl * client_idl()
PhysicalSwitchTable * physical_switch_table()