Skip to content

Commit

Permalink
Encode fat flow config in vrouter ksync.
Browse files Browse the repository at this point in the history
Also, add introspect for fat flow config.

Change-Id: I9261c39a034b884b273619ee3b9bd55a2d5001b3
closes-bug: 1518234
  • Loading branch information
naveen-n committed Nov 28, 2015
1 parent 916eb2b commit c9821d4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/vnsw/agent/oper/agent.sandesh
Expand Up @@ -99,6 +99,7 @@ struct ItfSandeshData {
49: optional string ipv4_active;
50: list<string> fixed_ip4_list;
51: list<string> fixed_ip6_list;
52: list<string> fat_flow_list;
}

struct VnIpamData {
Expand Down
11 changes: 11 additions & 0 deletions src/vnsw/agent/oper/interface.cc
Expand Up @@ -930,6 +930,17 @@ void Interface::SetItfSandeshData(ItfSandeshData &data) const {
}
data.set_fixed_ip6_list(fixed_ip6_list);

std::vector<std::string> fat_flow_list;
VmInterface::FatFlowEntrySet::iterator fat_flow_it =
vintf->fat_flow_list().list_.begin();
while (fat_flow_it != vintf->fat_flow_list().list_.end()) {
ostringstream str;
str << (int)fat_flow_it->protocol << ":" << (int)fat_flow_it->port<<"";
fat_flow_list.push_back(str.str());
fat_flow_it++;
}
data.set_fat_flow_list(fat_flow_list);

if (vintf->fabric_port()) {
data.set_fabric_port("FabricPort");
} else {
Expand Down
10 changes: 10 additions & 0 deletions src/vnsw/agent/vrouter/ksync/interface_ksync.cc
Expand Up @@ -529,6 +529,16 @@ int InterfaceKSyncEntry::Encode(sandesh_op::type op, char *buf, int buf_len) {
((const int8_t *)smac(),
(const int8_t *)smac() + smac().size()));
}

if (fat_flow_list_.list_.size() != 0) {
std::vector<int32_t> fat_flow_list;
for (VmInterface::FatFlowEntrySet::const_iterator it =
fat_flow_list_.list_.begin(); it != fat_flow_list_.list_.end();
it++) {
fat_flow_list.push_back(it->protocol << 16 | it->port);
}
encoder.set_vifr_fat_flow_protocol_port(fat_flow_list);
}
break;
}

Expand Down

0 comments on commit c9821d4

Please sign in to comment.