留学生考试辅导 // counters

// counters
counter(8192, CounterType.packets) c;

action count(bit<32> index) {

Copyright By PowCoder代写 加微信 powcoder

//increment counter at index
c.count(index);

// registers
register>(16384) r;

action ipg(out bit<48> ival, bit<32> x) {
bit<48> last;
bit<48> now;
r.read(last, x);
now = std_meta.ingress_global_timestamp;
ival = now – last;
r.write(x, now);

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com