1. A network system comprising: a first ternary content-addressable memory (TCAM) supporting one or more first hardware capabilities; a second TCAM supporting one or more second hardware capabilities that are not supported by the first TCAM; a processor; and a non-transitory computer readable storage medium having stored thereon instructions that, when executed by the processor, cause the processor to: execute a first TCAM manager associated with the first TCAM; and execute a second TCAM manager associated with the second TCAM, wherein each of the first and second TCAM managers: exposes, to a network application running on the network system, a unified application programming interface (API) for programming a rule into its associated TCAM, the unified API being identical for the first and second TCAM managers; and upon receiving an invocation of the unified API from the network application, determines how to program the rule based on its associated TCAM's supported hardware capabilities.