# Metadata Lookup Metadata lookup is responsible for determining what operations to do to the packet, what data to append to the packet (ip address, port). It also stores the keys and counters for crypto, and increments the counters in the case of packet that are encrypted. The packet types we care about are: 1. Incoming IP frames to be encrypted, check dest_ip 2. Incoming Wireguard frames to be decrypted, check source ip, wireguard type 3. Incoming Wireguard frames to go to cpu, check source ip, wireguard type, So really we need to check the IP addreses, and the wireguard info. We can use a TCAM to check if they match. for the wireguard packets, we want a different rule for the type 4 packets than the other types, since all other types go to cpu and type 4 gets decrypted. So in terms of searching, we need to search the source/dest ip, and wireguard type. Since 0 is an invalid wireguard type, we know that if the type is 0 then it was not a wireguard packet.