Services processor having a packet editing unit
A services processor includes an editing unit, which performs various functions for editing data packets, such as packet creation, packet encapsulation, and packet replication.
1. A method for creating a data packet in a services processor from a packet template, the method comprising:
creating an image of the packet template in an associated memory, the image having fields corresponding to a data packet to be created;
initializing the fields of the image; and
copying the image to a cache memory for use by the services processor.
2. A services processor for creating a data packet in a services processor from a packet template, the services processor encoded with instructions for:
creating an image of the packet template in an associated memory, the image having fields corresponding to a data packet to be created;
initializing the fields of the image; and
copying the image to a cache memory for use by the services processor.
3. A method for adding an encapsulation to a data packet, the data packet associated with a packet context in a services processor wherein the packet context includes a set of encapsulation pointers, the method comprising:
retrieving an encapsulation template that defines one or more encapsulation pointers; and
copying the encapsulation pointers from the encapsulation template into the packet context for the data packet.
4. A services processor for adding an encapsulation to a data packet, the services processor encoded with instructions for:
retrieving an encapsulation template that defines one or more encapsulation pointers; and
copying the one or more encapsulation pointers from the encapsulation template into a packet context for the data packet.
5. A method for replicating a data packet, the data packet associated with a packet context in a services processor, the method comprising:
sending a processed original data packet and a switch bit to a scheduler for output,
wherein the switch bit indicates whether the processed original data packet is to be replicated; and
responsive to the switch bit,
making a copy of the original data packet in an associated memory,
queuing the original or the copied data packet for output, and
continuing to process the non-queued data packet in the packet context.
6. A services processor for adding an encapsulation to a data packet, the data packet associated with a packet context in a services processor wherein the packet context includes a set of encapsulation pointers, the services processor encoded with instructions for:
retrieving an encapsulation template that defines one or more encapsulation pointers; and
copying the encapsulation pointers from the encapsulation template into the packet context for the data packet.