A dynamic searching method of provisioning instance identifiers (PRIDs) is
disclosed, which finds available PRIDs used by a network policy in data
tables when adding the network policy to a policy database. A last data
table without PRID assignment is first founded and then the number of
used PRIDs in the last data table is retrieved to determine whether the
last data table has an available PRID. If so, a field value for the
available PRID is determined by the greatest or smallest field value used
by the used PRIDs, or the available PRID is determined and assigned by
dynamically comparing a count from a counter with the first and last
PRIDs. After all data tables are successfully assigned with corresponding
available PRIDs, the network policy is processed completely.