Patent ID: 7362753

Claim:
A method for implementing frame alteration commands in a communications network processor for a plurality of packet types comprising the steps of: defining a set of frame alteration instruction templates in a table within hardware; each of said set of frame alteration instruction templates having different frame alteration commands to be performed on a packet and including a plurality of bytes; each of said set of frame alteration instruction templates being enabled to obtain data from an original header data together with data from classification leafs hit during a packet classification including from table lookup results and from memory; providing a packet type recognition hardware function for receiving a packet header and identifying a frame alteration instruction template from said set of frame alteration instruction templates based upon a packet type recognition result; and providing a mask with each byte of said plurality of bytes 0 -N of said identified frame alteration instruction template for creating frame alteration data and generating a frame alteration instruction stream utilizing said identified frame alteration instruction template; said mask includes a plurality of bits 0 -N, each bit of said mask being used to select a byte from said identified frame alteration instruction template, and to select a byte pointed to by the frame alteration instruction template in one or more of said original packet data, said table lookup results, and said memory.