How to support dynamic configuration and reading of TCAM?
1. TCAM configuration includes matching and action. Matching is to set the fields of the matching message header (such as source, destination MAC, source, destination IP address, source, destination port, etc.), and action is to set how to handle the matching message (such as forwarding to a specific port, discarding, etc.).
2. Read configuration table information: TCAM rule configuration is ultimately based on port configuration, so it is necessary to calculate the switch chip port where a device (such as lidar) is located through the forwarding table inside the switch chip, and then apply the rule on the port.