Skip to content

Commit 29d60b5

Browse files
committed
nso-nipap: Added support for deallocate from-prefix
1 parent 531073a commit 29d60b5

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

nso-nipap/nso-nipap/src/java/src/net/spritelink/nsonipap/ConfigCdbSub.java

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,9 @@ else if (req.op == Operation.DEALLOCATE && (req.t == Type.Request)) {
475475

476476
LOGGER.info("Deallocate Prefix (" + path + ")");
477477

478-
removePrefixFromNIPAP(path);
478+
if(maapi.exists(th, path + "/" + nipap._prefix_)){
479+
removePrefixFromNIPAP(path);
480+
}
479481

480482
removeResponseFromCDB(path);
481483
}
@@ -485,6 +487,15 @@ else if (req.op == Operation.DEALLOCATE && (req.t == Type.Request)) {
485487
*/
486488
else if (req.op == Operation.DEALLOCATE && (req.t == Type.FromPrefixRequest)) {
487489

490+
String path = req.path + "/" + nipap._response_;
491+
492+
LOGGER.info("Deallocate Prefix (" + path + ")");
493+
494+
if(maapi.exists(th, path + "/" + nipap._prefix_)){
495+
removePrefixFromNIPAP(path);
496+
}
497+
498+
removeResponseFromCDB(path);
488499

489500
}
490501
/*
@@ -611,10 +622,18 @@ else if (kp[1].toString().equals("nipap:from-prefix-request") &&
611622
r.t = Type.Request;
612623
r.op = Operation.DEALLOCATE;
613624
reqs.add(r);
614-
//we dont need to look at children
615-
return DiffIterateResultFlag.ITER_CONTINUE;
616625
}
617-
break;
626+
else if (kp[1].toString().equals("nipap:from-prefix-request") &&
627+
kp.length == 8){
628+
r.prefix_key = (ConfKey)kp[0];
629+
r.request_key = (ConfKey)kp[2];
630+
r.pool_key = (ConfKey)kp[4];
631+
r.t = Type.FromPrefixRequest;
632+
r.op = Operation.DEALLOCATE;
633+
reqs.add(r);
634+
}
635+
//we dont need to look at children
636+
return DiffIterateResultFlag.ITER_CONTINUE;
618637
}
619638
case MOP_VALUE_SET: {
620639
if (kp[1].toString().equals("nipap:attributes") &&

0 commit comments

Comments
 (0)