1. A hardware-based method for policing traffic in a network node, the method comprising: receiving a programming input that defines a relationship between condition primitives and action primitives; storing a set of indexed action primitives according to the defined relationship; identifying a condition primitive in response to a datagram that is received at the network node; generating an index from the condition primitive; using the index to select an action primitive from the stored set of indexed action primitives; and performing a policing action related to the datagram in response to the selected action primitive.