主权项 |
1. A method for processing a network packet, comprising:
receiving, by a packet transformation device, the network packet, wherein the network packet includes a packet key that includes one or more source-destination field pairs, and wherein each source-destination field pair that is included in the one or more source-destination field pairs includes a source field and a destination field; for each selected source-destination field pair included in the one or more source-destination field pairs:
selecting, by the packet transformation device, a first section and a second section in the packet key; andextracting, by the packet transformation device, a source field value from the source field and a destination field value from the destination field of the selected source-destination field pair; for each source bit of the source field value:
selecting, by the packet transformation device, from the destination field value, a destination bit located at a same bit position as the source bit;applying, by the packet transformation device, an OR logic function to the source bit and the destination bit to generate a first resulting value;storing, by the packet transformation device, the first resulting value at the same bit position as the source bit in the first section;applying, by the packet transformation device, an AND logic function to the source bit and the destination bit to generate a second resulting value; andstoring, by the packet transformation device, the second resulting value at the same bit position as the source bit in the second section. |