A method, apparatus and computer program product are provided for
implementing conditional packet alterations based upon a transmit port. A
selection mechanism is provided for implementing packet alterations. A
sequence of frame alteration instructions and transmit port numbers
associated with a packet being transmitted is applied to the selection
mechanism. The selection mechanism performs alterations on the packet
being transmitted responsive to the applied sequence of frame alteration
instructions and port numbers associated with the packet. The selection
mechanism includes a multiplexer that sequentially receives frame
alteration instructions and port numbers associated with a packet being
transmitted, and an indirect data array for providing packet alteration
data from the indirect data array.