1. A network device, comprising: a plurality of ports configured to receive and to transmit packets on a network; a packet processing pipeline comprising a plurality of hardware stages, wherein at least one hardware stage is configured to output a data structure comprising a field extracted from a received packet based on a first packet processing operation performed on the packet or the data structure, wherein the data structure is associated with the packet; and a configurable processor coupled to the at least one hardware stage of the packet processing pipeline, wherein the configurable processor is configured to modify the field in the data structure to generate a modified data structure and to pass the modified data structure to a subsequent hardware stage that is configured to perform a second packet processing operation on the data structure using the field modified by the configurable processor.