Hello, I'm trying to apply an action based on the number of packets that pass between the data plan. For example, for each N packets, I clone one packet and reset the counter.
My first idea was to use registers, but it didn't work when I compared the value stored in the registers.
...
register.read (tmp, 0)
if (tmp> = N) {
clone...
tmp = 0
} else {
tmp ++
}
register.write (0, tmp)
......
My second idea was to use Micro-C to manage the decision, but the result is similar, the updated header values in the micro-c didn't work when I compare it in the if.
In this two cases, if the value is received with the packet, for example by configuring diffServ, the conditional works well.
My third idea is to clone the package directly in the micro-c code, but in this case I didn't find in the documentation how to do the cloning in the micro-c or if it is possible.
I don't know now if it is possible or not to use registers or clone packages by micro-c, can someone help me in this case?