主权项 |
1. A method for modifying a data packet by a hardware-based packet editor, comprising:
receiving, by the packet editor, a packet editing script comprising one or more script entries indicating modifications to be applied to the data packet and a data block comprising data for the modified data packet; determining whether a script entry of the one or more script entries is a first script entry for the modified data packet; in response to determining that the given script entry is a first script entry for the modified data packet, reserving a packet buffer for the modified data packet; for each given script entry in the packet editing script, copying, by the packet editor, data in the data block at a location and a size identified in the given script entry into the packet buffer; and generating, by the packet editor, a modified data packet with the data in the packet buffer. |