Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
242 commits
Select commit Hold shift + click to select a range
21a26f1
initial ovsdb change
Oct 18, 2014
9c19b35
initial ovsdb change
Oct 18, 2014
dce81ae
Set display-name as name for physical-router, physical-interface and
praveenkv Oct 18, 2014
133fc3c
Merge branch 'psethi_openvswitch' of ssh://github.com/manishsing/cont…
praveenkv Oct 18, 2014
75d5b64
Integration fixes
Oct 18, 2014
f143998
use VN UUID as Logical switch name.
Oct 19, 2014
42b9499
Support adding l2 routes from OVS clients
praveenkv Oct 20, 2014
327936d
adding introspect trace support for ovsdb
Oct 20, 2014
8293200
Merge branch 'psethi_openvswitch' of ssh://github.com/manishsing/cont…
Oct 20, 2014
8978379
Changes to create ovs peer
Oct 20, 2014
ab696a9
fix for reoute export to bgp.
Oct 20, 2014
f2d3a7c
Support for unicast remote mac in ovsdb.
Oct 20, 2014
2681204
Adding support for exporting routes to ovsdb.
Oct 20, 2014
a88a6d7
Removing tunnel type check for exporting routes to OVSDB
Oct 21, 2014
6202bab
OVSDB Enhancements
Oct 21, 2014
d849297
Support to withdraw route on ovsdb notification
Oct 21, 2014
edacc1c
Fix parsing of MAC address in retract string.
Oct 21, 2014
5c33b52
Handling unicast route to reuse physical locator.
Oct 21, 2014
08f9583
Merge branch 'psethi_openvswitch' of ssh://github.com/manishsing/cont…
Oct 21, 2014
bf05f9d
TSN agent changes for OVS.
manishsing Oct 22, 2014
527b467
fix initializing ovsdb_entry row pointer for locator
Oct 22, 2014
baefc9e
Merge branch 'psethi_openvswitch' of ssh://github.com/manishsing/cont…
Oct 22, 2014
810a7da
Add TSN directory and tsn_vrf_listener.
manishsing Oct 22, 2014
858556f
Merge branch 'psethi_openvswitch' of ssh://github.com/manishsing/cont…
manishsing Oct 22, 2014
47f79bf
fixing sub directory inclusion and compilation for tor-agent
Oct 22, 2014
f111868
Derive ip family from prefix while provisioning static routes
Sep 29, 2014
42122a6
This bug adds the ModuleId from the Messages into the field
arvindvis Oct 3, 2014
e34fd51
Schema change to link loadbalancer pool to VMI
rrugge Oct 15, 2014
58e67c3
If the API client updates a network object with subnets and does not …
Oct 15, 2014
2662c48
bug 1381704 - update cassandra db with sequence when upgrading from e…
Oct 15, 2014
ebe89d6
Adding skeleton for a new daemon: prc-manager
Oct 14, 2014
2ab18d7
Catch PermissionDenied exception on security_group_update so that we …
Oct 15, 2014
81ab4cf
Fix circular route re-origination bug with transit VN
Oct 15, 2014
71e2861
Add vrouter-instance ServiceInstanceType
Oct 15, 2014
d3c093b
Cleanup and refactor code in service_chain_test.cc
Oct 13, 2014
d717aa7
Schema changes for VCPE feature.
ashoksr Oct 17, 2014
939c95e
Bug:#1380771 Adding the load balancer session persistence parameters …
divakardhar Oct 14, 2014
158d3ec
Export underlay source port as 0 when encapsulation type is MPLSoGRE.
ashoksr Oct 17, 2014
88f5a3c
Run config unit tests from scons
Sep 7, 2014
4f6cdf1
Rename prc-manager to device-manager
Oct 17, 2014
e8125f8
Display description from the NodeStatusUve when service is in
Oct 18, 2014
6703cfa
Change calls to update_subnet_uuid with new name.
Oct 20, 2014
b3d55a9
The dependent route list maintained by path_preference_module for a g…
ashoksr Oct 20, 2014
72b91bb
Ensures that permissions are set when _http_put_common
Oct 7, 2014
8597276
Making file names consistent.
chandanjuniper Oct 18, 2014
88319df
Enable build for device-manager from config directory
Oct 17, 2014
8dcddf3
Allow multiple xmpp client connections from same IP
Oct 18, 2014
3b98b84
Additional cfg tests for v4 and v6 pool allocation
Oct 20, 2014
a5660d8
Rename table for service monitor
rrugge Oct 20, 2014
b45a77b
Fix null UUID in id perms
rrugge Oct 21, 2014
3f35c74
Send the IPv6 RA message to all nodes on local link (ff02::1).
haripk Oct 21, 2014
5f75220
Use IANA codepoints for Tunnel Encapsulation types
Oct 20, 2014
780fb36
missing Import SandeshLevel
Oct 21, 2014
b9299f1
Handle query error in get_query_result()
Oct 21, 2014
66a4281
Remove flushing of UVE cache from contrail-analytics.rules
Oct 21, 2014
50458b3
Use correct variable name while deleting routing instance. This could…
Oct 21, 2014
29f0aa6
Limits fields that can be updated
Oct 21, 2014
17fb81d
Initial support for physical devices, physical ports and logical ports
praveenkv Sep 24, 2014
9673758
Merge with master
Oct 21, 2014
0c95419
Fix libtbb_debug issue
Oct 21, 2014
ae1ed1b
Add config knob for cgitb traceback logs
zioc Oct 21, 2014
baf76c8
Fix merge errors from mainline
Oct 22, 2014
750efd1
Initial support for physical devices, physical ports and logical ports
praveenkv Sep 24, 2014
c779672
Code for adding TOR composite NH.
manishsing Sep 29, 2014
82a8a00
Support dynamic registration of config-node and validation node
praveenkv Oct 2, 2014
c230e94
Initial support for physical devices, physical ports and logical ports
praveenkv Sep 24, 2014
acb9587
Code for adding TOR composite NH.
manishsing Sep 29, 2014
b7cba3f
Add support for physical-device and virtual-network DBTable
praveenkv Sep 29, 2014
6aaabad
Support config processing for physical-device tables
praveenkv Oct 2, 2014
30520c7
Add UT for physical-devices
praveenkv Oct 4, 2014
9e5d2c9
Replace host_name() by agent_name() as vrouter-name
Oct 10, 2014
a258e58
Use agent_name_ in all InitGenerator calls
Oct 10, 2014
5ffdc20
Remove duplicate definitions added by merge
Oct 22, 2014
0a1967a
Fix rebase errors
Oct 22, 2014
1a8e8fc
Fix merge errors from mainline
Oct 22, 2014
472da08
Set host-name based on tor-agent instance
Oct 22, 2014
17a77ff
Adding Entry Filter to KSyncdBObject.
Oct 22, 2014
b7738f9
Get agent_name from config file
Oct 23, 2014
0891ade
cleanup : remove redundant code
haripk Oct 24, 2014
cb1832b
TorAgent should not register for multicast pacekts
Oct 25, 2014
4f4fda3
Agent Restart functionality.
Oct 27, 2014
4d37606
Merge branch 'psethi_openvswitch' of ssh://github.com/manishsing/cont…
Oct 27, 2014
ff17f41
initial ovsdb change
Oct 18, 2014
0cdcf2b
Set display-name as name for physical-router, physical-interface and
praveenkv Oct 18, 2014
4fb78aa
Integration fixes
Oct 18, 2014
ee54312
use VN UUID as Logical switch name.
Oct 19, 2014
6a60f6d
Support adding l2 routes from OVS clients
praveenkv Oct 20, 2014
8687e47
adding introspect trace support for ovsdb
Oct 20, 2014
526d4bb
Changes to create ovs peer
Oct 20, 2014
29b3309
fix for reoute export to bgp.
Oct 20, 2014
ed7de78
Support for unicast remote mac in ovsdb.
Oct 20, 2014
39f605a
Adding support for exporting routes to ovsdb.
Oct 20, 2014
fe12689
Removing tunnel type check for exporting routes to OVSDB
Oct 21, 2014
05616b8
OVSDB Enhancements
Oct 21, 2014
3d854a9
Support to withdraw route on ovsdb notification
Oct 21, 2014
5d097d9
Fix parsing of MAC address in retract string.
Oct 21, 2014
b239864
Handling unicast route to reuse physical locator.
Oct 21, 2014
6433ea0
TSN agent changes for OVS.
manishsing Oct 22, 2014
daaf73f
fix initializing ovsdb_entry row pointer for locator
Oct 22, 2014
f0300eb
Add TSN directory and tsn_vrf_listener.
manishsing Oct 22, 2014
bbdcc20
fixing sub directory inclusion and compilation for tor-agent
Oct 22, 2014
5bafb28
Fix merge errors from mainline
Oct 22, 2014
454e80a
Fix rebase errors
Oct 22, 2014
a42e3fb
Set host-name based on tor-agent instance
Oct 22, 2014
6258108
Adding Entry Filter to KSyncdBObject.
Oct 22, 2014
20016bd
Get agent_name from config file
Oct 23, 2014
f1c56bd
cleanup : remove redundant code
haripk Oct 24, 2014
c4132d8
TorAgent should not register for multicast pacekts
Oct 25, 2014
e799199
Agent Restart functionality.
Oct 27, 2014
8e10023
Merge branch 'psethi_openvswitch' of github.com:manishsing/contrail-c…
haripk Oct 27, 2014
b150250
fix compilation issues
haripk Oct 27, 2014
8e4ad3f
Add Mac address validation in pkt_handler.cc
Oct 27, 2014
a442337
Allocate an IP address from each subnet for service node (dns_server_…
manishsing Oct 27, 2014
817ebfc
Remove hardcoded value from multicast
manishsing Oct 27, 2014
6cd7cf8
Add VN NULL check
haripk Oct 27, 2014
645d704
Merge branch 'psethi_openvswitch' of github.com:manishsing/contrail-c…
haripk Oct 27, 2014
3af0efb
send correct GW in DHCP response
haripk Oct 27, 2014
65763aa
Move subnet route to point to l2comp and fix bmap usage in agent_path
manishsing Oct 29, 2014
4585706
add physical device name in vlan port binding
haripk Oct 29, 2014
8e07acb
Merge branch 'psethi_openvswitch' of github.com:manishsing/contrail-c…
haripk Oct 29, 2014
ace8b70
Handle VM Interface creation from Config or Nova message
Oct 29, 2014
6ada08f
Fix delete handling for <physical_device, vn>
Oct 29, 2014
d10d062
Handle vrf delete using liftimeref.
Oct 29, 2014
1d052ba
Initial VCPE changes
ashoksr Oct 29, 2014
83805d7
Add logic to check we don't program routes
Oct 30, 2014
3924df9
Fix wrong reporting of Active state for ToR interfaces
Oct 30, 2014
71c57de
Add new VM interface subtype for VCPE and make this interface active …
ashoksr Oct 30, 2014
6e98f3b
--Fix issue of resolve route not getting deleted when VM interface su…
ashoksr Oct 31, 2014
67f44e3
add logic to wait for vn to be present before eporting routes.
Oct 31, 2014
d5f4c21
Merge branch 'psethi_openvswitch' of ssh://github.com/manishsing/cont…
Oct 31, 2014
046a126
move the address creation for service node from neutron plugin to api…
haripk Nov 1, 2014
c867a7c
Build physical-device-vn table based on logical-interface config
Nov 3, 2014
2e72456
Fixes stale nexthop issue. If none of the relevant composite NH is pr…
manishsing Nov 3, 2014
80eb3ea
Fix memory leak in physical-device-vn UT
Nov 3, 2014
e55cbc5
remove the earlier change done in neutron plugin for allocating dns s…
haripk Nov 3, 2014
6467809
Merge branch 'psethi_openvswitch' of github.com:manishsing/contrail-c…
haripk Nov 3, 2014
89c3cda
Merge branch 'master' into psethi_openvswitch
haripk Nov 4, 2014
ca472fb
Handle NULL ptr expection.
Nov 4, 2014
7e1b7ba
fix logical_switch_table sync api to update all fields before returning.
Nov 4, 2014
ac85a97
Fixing renew of ksync db entry with a new oper db entry.
Nov 5, 2014
d758935
fixing agent.gdb macro to use common definition
Nov 5, 2014
e12ce85
contrail-collector does UVE Updates based on messages from generators.
anishmehta Oct 21, 2014
f606477
Check for deleted AgentXmppChannel while updating new set of XmppServ…
Oct 24, 2014
7596df8
Rename namespace manager class. It is going to be used to manage diff…
Oct 24, 2014
c8ecd14
- "vcenter.datacenter" and "vcenter.dvswitch" added to properties f…
vaidyasd Oct 24, 2014
de83b38
Cosmetic changes to rtarget_group.cc
Oct 23, 2014
2eb82f2
Preserve SiteOfOrigin when creating ServiceChain routes
Oct 26, 2014
0a51255
Handling no-security-group on VMIs
anbu-enovance Oct 17, 2014
748d6a8
SVC Monitor is not scheduling the vrouter for lbaas
numansiddique Oct 27, 2014
096989f
If no subnet on network, don't try to iterate on None
Oct 27, 2014
69066f8
Config components unit test from scons refinement
Oct 25, 2014
a846112
MxProvisioner does all work of adding route target.
Oct 27, 2014
505dbfa
Catch appropriate error while creating ACL object
Oct 27, 2014
c0b0942
1. Add handling of enums in protobuf server. Enum names will be
Oct 27, 2014
e87f464
Return dict for external_gateway_info in router as spec'd by API.
Oct 28, 2014
cedcc0b
Bug #1385538
kirandesai Oct 28, 2014
2c08da2
Add basic support for a few EVPN communities
Oct 27, 2014
ddfac92
In discovery client we were moving the process connection state to
Oct 28, 2014
291b5e2
Make module id of discovery server and dns agent consistent:
chandanjuniper Oct 28, 2014
0a52e2d
Fix delete handling for <physical_device, vn>
Oct 29, 2014
03965d4
Handle vrf delete using liftimeref.
Oct 29, 2014
ca7e0ee
closes-bug:#1387064. Extracting right VN's uuid from Nova VIF plugin …
divakardhar Oct 29, 2014
b4e1b7c
UUID reset to None in id_perms
Oct 29, 2014
1c18b11
Set generate_url to an empty function if none is provided. This will …
Oct 29, 2014
f294878
Closes-Bug: #1360623
Oct 28, 2014
33d7d6f
Verify ASN in SecurityGroup extended community
Aug 26, 2014
e1adda3
Add logic to check we don't program routes
Oct 30, 2014
052ffa1
Fix pagination issue in flow introspect page. FlowKey comparison func…
ashoksr Oct 30, 2014
eff5c18
Fix wrong reporting of Active state for ToR interfaces
Oct 30, 2014
fd99469
Initialize the variables in the constructor - this was causing issues…
haripk Oct 30, 2014
5c2e820
Few files were still using the term prc_manager instead of device_man…
Oct 30, 2014
4345f05
Cleanup a few APIs in mock agent
Oct 30, 2014
3b6e6f0
raise SecurityGroupCannotRemoveDefault only if not admin
Oct 30, 2014
3b2960b
Ignore 503 Service Unavailable, any api call will connect to api-serv…
cijohnson Oct 27, 2014
672bc01
add logic to wait for vn to be present before eporting routes.
Oct 31, 2014
dbe61d6
move the address creation for service node from neutron plugin to api…
haripk Nov 1, 2014
5fefb09
Fix#1: L2 multicast route not getting deleted.
manishsing Oct 31, 2014
0a6680e
In case of VMWare, set promiscous mode for ethernet port connecting t…
Oct 29, 2014
3b44c7c
Minor cleanup of BgpRoute introspect code
Nov 2, 2014
f8b252d
Build physical-device-vn table based on logical-interface config
Nov 3, 2014
219d687
Fixes stale nexthop issue. If none of the relevant composite NH is pr…
manishsing Nov 3, 2014
ff073b5
Fix memory leak in physical-device-vn UT
Nov 3, 2014
283f4cb
remove the earlier change done in neutron plugin for allocating dns s…
haripk Nov 3, 2014
bab912d
Fix couple of corner cases in bgp_xmpp_test
Nov 3, 2014
706be26
Handle NULL ptr expection.
Nov 4, 2014
2e73e5d
fix logical_switch_table sync api to update all fields before returning.
Nov 4, 2014
db979b6
Fixing renew of ksync db entry with a new oper db entry.
Nov 5, 2014
fbe04b4
fixing agent.gdb macro to use common definition
Nov 5, 2014
9f9fd28
Initial VCPE changes
ashoksr Oct 29, 2014
ddacd2a
Enhancements to support tunnel/tap interface as physical ports
Nov 5, 2014
9b9b835
1) Dont advertise non L2 multicast.
manishsing Nov 6, 2014
7d6ed83
Fix encap change for composite NH.
manishsing Nov 7, 2014
2833ae5
1. Send GW in DHCP response (not set it to service address)
haripk Nov 7, 2014
cdfad79
Merge branch 'psethi_openvswitch' of github.com:manishsing/contrail-c…
haripk Nov 7, 2014
6e7a4d3
Fix VN and VMI order dependency.
Nov 7, 2014
7db2106
Merge branch 'psethi_openvswitch' of ssh://github.com/manishsing/cont…
Nov 7, 2014
2c810fa
Fix UT for noarp and point-to-point flag on eth interface
praveenkv Nov 8, 2014
2e5fbd7
Fix unit test case.
manishsing Nov 8, 2014
8512a99
Merge branch 'master' into psethi_openvswitch
praveenkv Nov 10, 2014
6f7565e
Initial VCPE changes
ashoksr Oct 29, 2014
2a8042b
Add new VM interface subtype for VCPE and make this interface active …
ashoksr Oct 30, 2014
09c3775
--Fix issue of resolve route not getting deleted when VM interface su…
ashoksr Oct 31, 2014
1a1c7ea
Fix wrong reporting of Active state for ToR interfaces
Oct 30, 2014
5605b2b
Build physical-device-vn table based on logical-interface config
Nov 3, 2014
d9ce3b7
Initial VCPE changes
ashoksr Oct 29, 2014
4ad68fb
Enhancements to support tunnel/tap interface as physical ports
Nov 5, 2014
07375ef
Fix UT for noarp and point-to-point flag on eth interface
praveenkv Nov 8, 2014
700db93
Merge branch 'vcpe_integration' of ssh://github.com/manishsing/contra…
praveenkv Nov 10, 2014
39e2feb
Remove tsn_ip_1 and tsn_ip_2 parsing from agent. It was meant as hack…
manishsing Nov 10, 2014
04a3423
add default GW route, fix vn_uve crash when VM is not present
haripk Nov 11, 2014
50d116c
check unresolved reference only if logical switch name is present.
Nov 11, 2014
07842e5
Merge remote-tracking branch 'manishsing-fork/psethi_openvswitch' int…
praveenkv Nov 12, 2014
d597f18
Fix merge errors
praveenkv Nov 12, 2014
ec69c54
Fix compilation errors in Ubuntu 14.04
praveenkv Nov 12, 2014
08afc76
Merge branch 'psethi_openvswitch' of ssh://github.com/manishsing/cont…
Nov 12, 2014
199a1ed
fixing compilation.
Nov 12, 2014
3e20e75
Fix for multicast.
manishsing Nov 12, 2014
152add8
Fixes for agent to work with un-numbered vhost0
praveenkv Nov 12, 2014
41eee2b
Rename vhost_service_ip to compute_node_ip
praveenkv Nov 12, 2014
6c3ef46
If device_vn is deleted and same removed from mcast olist and olist i…
manishsing Nov 13, 2014
36f69d0
Merge branch 'psethi_openvswitch' into vcpe_integration
praveenkv Nov 13, 2014
16ca345
Add Uve initialization
Nov 13, 2014
523c089
Merge branch 'psethi_openvswitch' of ssh://github.com/manishsing/cont…
Nov 13, 2014
3f3812b
take vxlan id as well in the key for the MAC to interface binding map
haripk Nov 13, 2014
7a083b1
Fix to find active entry for add/del operation.
Nov 14, 2014
cbe9fbe
Merge branch 'psethi_openvswitch' of ssh://github.com/manishsing/cont…
Nov 14, 2014
2ba75f9
* Upon change of physical interface or logical interface resync vm
naveen-n Nov 15, 2014
4b2fb97
Adding introspect to dump ovsdb Objects.
Nov 15, 2014
f684f01
fix updation of logical switch name, when vm intf is resolved.
Nov 15, 2014
a9e411d
Add error string to the transaction failed message.
Nov 17, 2014
90871b3
Add stats in physical ports.
Nov 17, 2014
9daf763
Fix bug where vxlan id change was not getting reflected in multicast …
manishsing Nov 18, 2014
7401adf
change for tcp session to use non blocking socket
Nov 18, 2014
686f976
Merge branch 'psethi_openvswitch' of ssh://github.com/manishsing/cont…
Nov 18, 2014
6c7b6cb
Fix message parsing if multiple json messages are received in single …
Nov 19, 2014
a0f3546
Fix the check of tsn_enabled.
manishsing Nov 20, 2014
cd71774
bug fixes: initialize configurer variable, remove interface reference…
haripk Nov 20, 2014
8bc4e1a
Issue: vrf delete timeout, Find of deleted VN fails and
Nov 20, 2014
37f224e
Merge branch 'psethi_openvswitch' of ssh://github.com/manishsing/cont…
Nov 20, 2014
cd77a94
Delete subnet route whenever L2 route path is deleted.
manishsing Nov 20, 2014
461bec2
For subnet route delete all multicast paths from route if local_peer …
manishsing Nov 22, 2014
a6c161e
Merge branch 'psethi_openvswitch' into vcpe_integration
haripk Nov 25, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/base/test/task_test_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ do { \
#define TASK_UTIL_EXPECT_VECTOR_EQ(actual, expected) \
do { \
TASK_UTIL_EXPECT_EQ((expected).size(), (actual).size()); \
for (int i = 0; i < (expected).size(); i++) { \
for (int i = 0; i < (int)((expected).size()); i++) { \
TASK_UTIL_EXPECT_EQ((expected)[i], (actual)[i]); \
} \
} while (false)
Expand Down
64 changes: 58 additions & 6 deletions src/config/api-server/vnc_addr_mgmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,20 @@ def __str__(self):
# end AddrMgmtInvalidGatewayIp


class AddrMgmtInvalidServiceNodeIp(AddrMgmtError):

def __init__(self, subnet_val, service_address):
self.subnet_val = subnet_val
self.service_address = service_address
# end __init__

def __str__(self):
return "subnet(%s) has Invalid Service Node ip address(%s)" %\
(self.subnet_val, self.service_address)
# end __str__
# end AddrMgmtInvalidServiceNodeIp


class AddrMgmtInvalidDnsNameServer(AddrMgmtError):

def __init__(self, subnet_val, name_server):
Expand Down Expand Up @@ -152,7 +166,7 @@ def set_db_conn(cls, db_conn):
# end set_db_conn

def __init__(self, name, prefix, prefix_len,
gw=None, enable_dhcp=True,
gw=None, service_address=None, enable_dhcp=True,
dns_nameservers=None,
alloc_pool_list=None,
addr_from_start=False):
Expand Down Expand Up @@ -184,6 +198,20 @@ def __init__(self, name, prefix, prefix_len,
else:
gw_ip = IPAddress(network.last - 1)

# check service_address
if service_address:
try:
service_node_address = IPAddress(service_address)
except AddrFormatError:
raise AddrMgmtInvalidServiceNodeIp(name, service_node_address)

else:
# reserve a service address ip in subnet
if addr_from_start:
service_node_address = IPAddress(network.first + 2)
else:
service_node_address = IPAddress(network.last - 2)

# check dns_nameservers
for nameserver in dns_nameservers or []:
try:
Expand All @@ -208,11 +236,12 @@ def __init__(self, name, prefix, prefix_len,
'end':int(IPAddress(alloc_pool['end']))}
alloc_int_list.append(alloc_int)

# exclude gw_ip if it is within allocation-pool
# exclude gw_ip, service_node_address if they are within allocation-pool
for alloc_int in alloc_int_list:
if alloc_int['start'] <= int(gw_ip) <= alloc_int['end']:
exclude.append(gw_ip)
break
if alloc_int['start'] <= int(service_node_address) <= alloc_int['end']:
exclude.append(service_node_address)
self._db_conn.subnet_create_allocator(name, alloc_int_list,
addr_from_start)

Expand All @@ -225,6 +254,7 @@ def __init__(self, name, prefix, prefix_len,
self._version = network.version
self._exclude = exclude
self.gw_ip = gw_ip
self.dns_server_address = service_node_address
self._alloc_pool_list = alloc_pool_list
self.enable_dhcp = enable_dhcp
self.dns_nameservers = dns_nameservers
Expand Down Expand Up @@ -344,6 +374,7 @@ def _get_subnet_dicts(self, vn_fq_name, vn_dict=None):
for ipam_subnet in ipam_subnets:
subnet_dict = copy.deepcopy(ipam_subnet['subnet'])
subnet_dict['gw'] = ipam_subnet.get('default_gateway', None)
subnet_dict['dns_server_address'] = ipam_subnet.get('dns_server_address', None)
subnet_dict['allocation_pools'] = \
ipam_subnet.get('allocation_pools', None)
subnet_dict['enable_dhcp'] = ipam_subnet.get('enable_dhcp', True)
Expand Down Expand Up @@ -372,20 +403,23 @@ def _create_subnet_objs(self, vn_fq_name_str, vn_dict):
subnet['ip_prefix_len'])

gateway_ip = ipam_subnet.get('default_gateway', None)
service_address = ipam_subnet.get('dns_server_address', None)
allocation_pools = ipam_subnet.get('allocation_pools', None)
dhcp_config = ipam_subnet.get('enable_dhcp', True)
nameservers = ipam_subnet.get('dns_nameservers', None)
addr_start = ipam_subnet.get('addr_from_start', False)
subnet_obj = Subnet(
'%s:%s' % (vn_fq_name_str, subnet_name),
subnet['ip_prefix'], str(subnet['ip_prefix_len']),
gw=gateway_ip, enable_dhcp=dhcp_config,
gw=gateway_ip, service_address=service_address,
enable_dhcp=dhcp_config,
dns_nameservers=nameservers,
alloc_pool_list=allocation_pools,
addr_from_start=addr_start)
self._subnet_objs[vn_fq_name_str][subnet_name] = \
subnet_obj
ipam_subnet['default_gateway'] = str(subnet_obj.gw_ip)
ipam_subnet['dns_server_address'] = str(subnet_obj.dns_server_address)
# end _create_subnet_objs

def config_log(self, msg, level):
Expand Down Expand Up @@ -436,8 +470,8 @@ def net_update_req(self, vn_fq_name, db_vn_dict, req_vn_dict, obj_uuid=None):

# check db_subnet_dicts and req_subnet_dicts
# following parameters are same for subnets present in both dicts
# 1. enable_dhcp, 2. default_gateway, 3. allocation_pool
# 4 dns_nameservers
# 1. enable_dhcp, 2. default_gateway, 3. dns_server_address
# 4. allocation_pool, 5. dns_nameservers
for key in req_subnet_dicts.keys():
req_subnet = req_subnet_dicts[key]
if key in db_subnet_dicts.keys():
Expand All @@ -446,6 +480,8 @@ def net_update_req(self, vn_fq_name, db_vn_dict, req_vn_dict, obj_uuid=None):
req_subnet['enable_dhcp'] = True
if (req_subnet['gw'] != db_subnet['gw']):
raise AddrMgmtSubnetInvalid(vn_fq_name_str, key)
if (req_subnet['dns_server_address'] != db_subnet['dns_server_address']):
raise AddrMgmtSubnetInvalid(vn_fq_name_str, key)

req_alloc_list = req_subnet['allocation_pools'] or []
db_alloc_list = db_subnet['allocation_pools'] or []
Expand Down Expand Up @@ -641,6 +677,16 @@ def net_check_subnet(self, db_vn_dict, req_vn_dict):
err_msg = "gateway Ip of configured subnets conflicting " \
"in deciding forwarding mode for virtual network."
return False, err_msg

# check service address
service_address = ipam_subnet.get('dns_server_address', None)
if service_address is not None:
try:
service_node_address = IPAddress(service_address)
except AddrFormatError:
err_msg = "Invalid Dns Server Ip address:%s" \
%(service_address)
return False, err_msg
return True, ""
# end net_check_subnet

Expand Down Expand Up @@ -747,6 +793,7 @@ def ip_alloc_req(self, vn_fq_name, sub=None, asked_ip_addr=None,
subnet_dict['ip_prefix'],
subnet_dict['ip_prefix_len'],
gw=subnet_dict['gw'],
service_address=subnet_dict['dns_server_address'],
enable_dhcp=subnet_dict['enable_dhcp'],
dns_nameservers=subnet_dict['dns_nameservers'],
alloc_pool_list=subnet_dict['allocation_pools'],
Expand All @@ -757,6 +804,8 @@ def ip_alloc_req(self, vn_fq_name, sub=None, asked_ip_addr=None,
continue
if asked_ip_addr == str(subnet_obj.gw_ip):
return asked_ip_addr
if asked_ip_addr == str(subnet_obj.dns_server_address):
return asked_ip_addr
if asked_ip_addr and not subnet_obj.ip_belongs(asked_ip_addr):
continue
try:
Expand Down Expand Up @@ -792,6 +841,7 @@ def ip_alloc_notify(self, ip_addr, vn_fq_name):
subnet_dict['ip_prefix'],
subnet_dict['ip_prefix_len'],
gw=subnet_dict['gw'],
service_address=subnet_dict['dns_server_address'],
enable_dhcp=subnet_dict['enable_dhcp'],
dns_nameservers=subnet_dict['dns_nameservers'],
alloc_pool_list=subnet_dict['allocation_pools'],
Expand Down Expand Up @@ -827,6 +877,7 @@ def ip_free_req(self, ip_addr, vn_fq_name, sub=None):
subnet_dict['ip_prefix'],
subnet_dict['ip_prefix_len'],
gw=subnet_dict['gw'],
service_address=subnet_dict['dns_server_address'],
enable_dhcp=subnet_dict['enable_dhcp'],
dns_nameservers=subnet_dict['dns_nameservers'],
alloc_pool_list=subnet_dict['allocation_pools'],
Expand Down Expand Up @@ -861,6 +912,7 @@ def is_ip_allocated(self, ip_addr, vn_fq_name, sub=None):
subnet_dict['ip_prefix'],
subnet_dict['ip_prefix_len'],
gw=subnet_dict['gw'],
service_address=subnet_dict['dns_server_address'],
enable_dhcp=subnet_dict['enable_dhcp'],
dns_nameservers=subnet_dict['dns_nameservers'],
alloc_pool_list=subnet_dict['allocation_pools'],
Expand Down
3 changes: 3 additions & 0 deletions src/ifmap/ifmap_graph_walker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ void IFMapGraphWalker::AddNodesToWhitelist() {
traversal_white_list_->include_vertex.insert("loadbalancer-pool");
traversal_white_list_->include_vertex.insert("loadbalancer-member");
traversal_white_list_->include_vertex.insert("loadbalancer-healthmonitor");
traversal_white_list_->include_vertex.insert("subnet");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please get this reviewed by Tapan

}

void IFMapGraphWalker::AddLinksToWhitelist() {
Expand Down Expand Up @@ -321,6 +322,8 @@ void IFMapGraphWalker::AddLinksToWhitelist() {
"source=loadbalancer-pool,target=virtual-ip");
traversal_white_list_->include_edge.insert(
"source=loadbalancer-pool,target=loadbalancer-member");
traversal_white_list_->include_edge.insert(
"source=virtual-machine-interface,target=subnet");

// Manually add required links not picked by the
// IFMapGraphTraversalFilterCalculator
Expand Down
3 changes: 3 additions & 0 deletions src/ksync/ksync_entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ class KSyncEntry {
// Returns true if entry is resolved and referring entry can be written
bool IsResolved();

// Returns true if the entry data is resolved
virtual bool IsDataResolved() {return true;}

// User define KSync Response handler
virtual void Response() { };

Expand Down
76 changes: 73 additions & 3 deletions src/ksync/ksync_object.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,19 @@ KSyncEntry *KSyncObject::Find(const KSyncEntry *key) {
return NULL;
}

KSyncEntry *KSyncObject::Next(const KSyncEntry *entry) {
Tree::const_iterator it;
if (entry == NULL) {
it = tree_.begin();
} else {
it = tree_.iterator_to(*entry);
it++;
}
if (it != tree_.end()) {
return const_cast<KSyncEntry *>(it.operator->());
}
return NULL;
}
KSyncEntry *KSyncObject::CreateImpl(const KSyncEntry *key) {
KSyncEntry *entry;
if (need_index_) {
Expand Down Expand Up @@ -160,6 +173,11 @@ void KSyncDBObject::UnregisterDb(DBTableBase *table) {
table_ = NULL;
}

KSyncDBObject::DBFilterResp KSyncDBObject::DBEntryFilter(const DBEntry *entry) {
// Default accept all
return DBFilterAccept;
}

void KSyncDBObject::set_test_id(DBTableBase::ListenerId id) {
test_id_ = id;
}
Expand Down Expand Up @@ -193,8 +211,13 @@ void KSyncDBObject::Notify(DBTablePartBase *partition, DBEntryBase *e) {
assert(table_ == table);
DBState *state = entry->GetState(table, id_);
KSyncDBEntry *ksync = static_cast<KSyncDBEntry *>(state);
DBFilterResp resp = DBFilterAccept;

if (!entry->IsDeleted()) {
resp = DBEntryFilter(entry);
}

if (entry->IsDeleted()) {
if (entry->IsDeleted() || resp == DBFilterDelete) {
// We may get duplicate delete notification in
// case of db entry reuse
// add -> change ->delete(Notify) -> change -> delete(Notify)
Expand All @@ -204,6 +227,10 @@ void KSyncDBObject::Notify(DBTablePartBase *partition, DBEntryBase *e) {
NotifyEvent(ksync, KSyncEntry::DEL_REQ);
}
} else {
if (resp == DBFilterIgnore) {
// DB filter tells us to ignore this Add/Change.
return;
}
bool need_sync = false;
if (ksync == NULL) {
KSyncEntry *key, *found;
Expand All @@ -218,7 +245,17 @@ void KSyncDBObject::Notify(DBTablePartBase *partition, DBEntryBase *e) {
}
delete key;
entry->SetState(table, id_, ksync);
assert(ksync->GetDBEntry() == NULL);
DBEntry *old_db_entry = ksync->GetDBEntry();
if (old_db_entry != NULL) {
// cleanup previous state id the old db entry is delete marked.
if (old_db_entry->IsDeleted()) {
CleanupOnDel(ksync);
} else {
// something wrong! two db entry in oper db points to same
// KSync entry.
assert(false);
}
}
ksync->SetDBEntry(entry);
need_sync = true;
}
Expand All @@ -241,6 +278,8 @@ bool KSyncEntry::IsResolved() {
KSyncObject *obj = GetObject();
if (obj->IsIndexValid() && index_ == kInvalidIndex)
return false;
if (IsDataResolved() == false)
return false;
return ((state_ >= IN_SYNC) && (state_ < DEL_DEFER_SYNC));
}

Expand Down Expand Up @@ -947,6 +986,7 @@ void KSyncObject::NotifyEvent(KSyncEntry *entry, KSyncEntry::KSyncEvent event) {
break;

case KSyncEntry::SYNC_WAIT:
dep_reval = true;
state = KSyncSM_SyncWait(this, entry, event);
break;

Expand Down Expand Up @@ -1107,11 +1147,41 @@ KSyncObjectManager::~KSyncObjectManager() {

SandeshTraceBufferPtr KSyncTraceBuf(SandeshTraceBufferCreate("KSync", 1000));

void KSyncObjectManager::Init() {
KSyncObjectManager *KSyncObjectManager::Init() {
singleton_ = new KSyncObjectManager();
return singleton_;
}

void KSyncObjectManager::Shutdown() {
delete singleton_;
singleton_ = NULL;
}

// Create a dummy KSync Entry. This entry will all ways be in deferred state
// Any back-ref added to it will never get resolved.
// Can be used to defer an incomplete entry

class KSyncDummyEntry : public KSyncEntry {
public:
KSyncDummyEntry() : KSyncEntry() { }
virtual ~KSyncDummyEntry() { }
virtual bool IsLess(const KSyncEntry &rhs) const {
return false;
}
std::string ToString() const { return "Dummy"; }
bool Add() { return false;}
bool Change() { return false; }
bool Delete() { return false; }
KSyncObject *GetObject() { return NULL; }
KSyncEntry *UnresolvedReference() { return NULL; }
bool IsDataResolved() {return false;}
private:
DISALLOW_COPY_AND_ASSIGN(KSyncDummyEntry);
};

KSyncEntry *KSyncObjectManager::default_defer_entry() {
if (default_defer_entry_.get() == NULL) {
default_defer_entry_.reset(new KSyncDummyEntry());
}
return default_defer_entry_.get();
}
Loading