A method and system for identifying a data structure associated with a
packet of data. A processor internal to a packet processor may extract
one or more fields in a packet header field of a received packet of data
to generate a search key. The internal processor may then be configured
to select which table, e.g., routing table, quality of service table,
filter table, needs to be accessed using the search key in order to
process the received packet of data. A determination may then be made by
the internal processor as to whether a CAM or a hash table and a Patricia
Tree are used to identify the data structure associated with the received
packet of data. Based on table definitions in a register, the internal
processor may make such a determination.