# new meters: verify SLB macros (1) -------------------------------------------
tcc -xif:err 2>&1 >/dev/null | grep -v '^#'
#include "meters.tc"

$p = SLB(cir 8kbps,cbs 2000B);

prio {
    class if SLB_ok($p);
}
EOF
block eth0 egress
bucket 1 = 1000 0 2000 2000 0
action 0 = unspec
action 1 = class 1:1
action 2 = count 1 action 1
action 3 = conform 1 action 2 action 0
match action 3
# new meters: verify SLB macros (2) -------------------------------------------
tcc -xif:err 2>&1 >/dev/null | grep -v '^#'
#include "meters.tc"

$p = SLB(cir 8kbps,cbs 2000B);

prio {
    class if SLB_else_drop($p);
}
EOF
block eth0 egress
bucket 1 = 1000 0 2000 2000 0
action 0 = drop
action 1 = class 1:1
action 2 = count 1 action 1
action 3 = conform 1 action 2 action 0
match action 3
# new meters: verify DLB macros (1) -------------------------------------------
tcc -xif:err 2>&1 >/dev/null | grep -v '^#'
#include "meters.tc"

$p = DLB(cir 8kbps,cbs 2000B,pir 12kbps,pbs 500B);

prio {
    class if DLB_ok($p);
}
EOF
block eth0 egress
bucket 1 = 1000 0 2000 2000 0
bucket 2 = 1500 0 500 500 0
action 0 = unspec
action 1 = class 1:1
action 2 = count 2 action 1
action 3 = count 1 action 2
action 4 = conform 2 action 3 action 0
action 5 = conform 1 action 4 action 0
match action 5
# new meters: verify DLB macros (2) -------------------------------------------
tcc -xif:err 2>&1 >/dev/null | grep -v '^#'
#include "meters.tc"

$p = DLB(cir 8kbps,cbs 2000B,pir 12kbps,pbs 500B);

prio {
    class if DLB_else_drop($p);
}
EOF
block eth0 egress
bucket 1 = 1000 0 2000 2000 0
bucket 2 = 1500 0 500 500 0
action 0 = drop
action 1 = class 1:1
action 2 = count 2 action 1
action 3 = count 1 action 2
action 4 = conform 2 action 3 action 0
action 5 = conform 1 action 4 action 0
match action 5
# new meters: verify set_srTCM macro ------------------------------------------
tcc -xif:err 2>&1 >/dev/null | grep bucket
#include "meters.tc"

$p = srTCM(cir 8kbps,cbs 2000B,ebs 500B);

prio {
    class if srTCM_green($p);
}
EOF
bucket 1 = 0 0 500 500 0
bucket 2 = 1000 0 2000 2000 1
# new meters: verify set_trTCM macro ------------------------------------------
tcc -xif:err 2>&1 >/dev/null | grep bucket
#include "meters.tc"

$p = trTCM(cir 8kbps,cbs 2000B,pir 12kbps,pbs 500B);

prio {
    class if trTCM_green($p);
}
EOF
bucket 1 = 1000 0 2000 2000 0
bucket 2 = 1500 0 500 500 0
# new meters: meter macro parameter names can be macros too (SLB) -------------
tcc -c -Wnounused
#include "meters.tc"

#define committed_information_rate cir

$p = SLB(committed_information_rate 8kbps,cbs 2000B);
EOF
# new meters: meter macro parameter names can be macros too (DLB) -------------
tcc -c -Wnounused
#include "meters.tc"

#define peak_information_rate pir
#define peak_burst_size pbs

$p = DLB(cir 8kbps,cbs 2000B,peak_information_rate 12kbps,
  peak_burst_size 500B);
EOF
# new meters: meter macro parameter names can be macros too (srTCM) -----------
tcc -c -Wnounused
#include "meters.tc"

#define extended_burst_size ebs

$p = srTCM(cir 8kbps,cbs 2000B,extended_burst_size 500B);
EOF
# new meters: meter macro parameter names can be macros too (srTCM) -----------
tcc -c -Wnounused
#include "meters.tc"

#define committed_information_rate cir
#define committed_burst_size cbs

$p = trTCM(committed_information_rate 8kbps,committed_burst_size 2000B,
  pir 12kbps,pbs 500B);
EOF
