+ publishNotification(notificationMapping, key, subscribers, dstSubscribers, MappingChange.Removed);
+ notifyChildren(key, notificationMapping, MappingChange.Removed);
+ if (dstAddr != null) {
+ notifyChildren(dstAddr, notificationMapping, MappingChange.Removed);
+ }
+ }
+ }
+
+ public void notifyChange(Eid eid, MappingRecord mapping, MappingChange mappingChange) {
+ Set<Subscriber> subscribers = getSubscribers(eid);
+
+ Set<Subscriber> dstSubscribers = null;
+ // For SrcDst LCAF also send SMRs to Dst prefix
+ if (eid.getAddress() instanceof SourceDestKey) {
+ Eid dstAddr = SourceDestKeyHelper.getDstBinary(eid);
+ dstSubscribers = getSubscribers(dstAddr);
+ notifyChildren(dstAddr, mapping, mappingChange);
+ }
+ publishNotification(mapping, eid, subscribers, dstSubscribers, mappingChange);
+
+ notifyChildren(eid, mapping, mappingChange);
+ }
+
+ private void notifyChildren(Eid eid, MappingRecord mapping, MappingChange mappingChange) {
+ // Update/created only happens for NB mappings. We assume no overlapping prefix support for NB mappings - so
+ // this NB mapping should not have any children. Both for NB first and NB&SB cases all subscribers for SB
+ // prefixes that are equal or more specific to this NB prefix have to be notified of the potential change.
+ // Each subscriber is notified for the prefix that it is currently subscribed to, and MS should return to them
+ // a Map-Reply with the same prefix and update mapping in cases of EID_INTERSECTION_RLOC_NB_FIRST which is a
+ // new option we are creating TODO
+ Set<Eid> childPrefixes = getSubtree(MappingOrigin.Southbound, eid);
+ if (childPrefixes == null || childPrefixes.isEmpty()) {
+ return;
+ }
+
+ childPrefixes.remove(eid);
+ for (Eid prefix : childPrefixes) {
+ Set<Subscriber> subscribers = getSubscribers(prefix);
+ publishNotification(mapping, prefix, subscribers, null, mappingChange);