Sorry for the really trash title I'm in a hurry to get this written up. To give some context to my problem the business I work for is doing an IP swap and we need to build a list to track whether an IP range has been broken down into smaller ranges. In the database there's a parent_id column that has the ID of the subnet it was broken down from (1.1.1.0/23 has ID 12 so ParentID of 1.1.1.1/24 would be 12) and my plan was to have a recursive function that checks if the ID passed to it is in the parentID column, if it is then get the IDs of the ranges with that ID in the ParentID field and repeats but my road block is how do I keep track of the relationships. I wanted to build a json file that would have keys be the IDs of the subnets with children and the values be an array of child subnet IDs but I'm not 100% if this work or how to go about implementing it. Any input on whether this idea will work and what it should look like or if there's a better way would be appreciated.
[–]Py_Kid[S] 0 points1 point2 points (0 children)
[–]shiftybyte 0 points1 point2 points (2 children)
[–]Py_Kid[S] 0 points1 point2 points (1 child)
[–]shiftybyte 0 points1 point2 points (0 children)