aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/mactime/mactime_test.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2019-06-03 10:23:30 -0400
committerDamjan Marion <dmarion@me.com>2019-06-04 07:47:24 +0000
commit0c6ac791dde099346af1752aa92d0eb05fc2db11 (patch)
treef6dade9bb0beae5efb79cb04feb1fc62ed894679 /src/plugins/mactime/mactime_test.c
parentd5cf64f8c2a08d2f41327cc99dd2d96f77d82ca3 (diff)
mactime: upstream new features
Add per mac address data quotas (simple version) Add mini-ACLs to turf "call home" traffic from a certain species of security DVR. Add FEATURE.yaml Update the API version number Type: feature Feature-name: mactime Change-Id: Ida6945f7791ab43909afa68dcf2f652b20c53afd Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/plugins/mactime/mactime_test.c')
-rw-r--r--src/plugins/mactime/mactime_test.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/mactime/mactime_test.c b/src/plugins/mactime/mactime_test.c
index 351493daf24..36ee063135d 100644
--- a/src/plugins/mactime/mactime_test.c
+++ b/src/plugins/mactime/mactime_test.c
@@ -159,6 +159,8 @@ api_mactime_add_del_range (vat_main_t * vam)
u8 is_add = 1;
u8 allow = 0;
u8 drop = 0;
+ u8 no_udp_10001 = 0;
+ u64 data_quota = 0;
int ret;
int ii;
@@ -180,10 +182,16 @@ api_mactime_add_del_range (vat_main_t * vam)
allow = 1;
else if (unformat (i, "drop-static"))
drop = 1;
+ else if (unformat (i, "no-udp-10001"))
+ no_udp_10001 = 1;
else if (unformat (i, "mac %U", my_unformat_mac_address, mac_address))
mac_set = 1;
else if (unformat (i, "del"))
is_add = 0;
+ else if (unformat (i, "data-quota %lldM", &data_quota))
+ data_quota <<= 20;
+ else if (unformat (i, "data-quota %lldG", &data_quota))
+ data_quota <<= 30;
else
break;
}
@@ -226,6 +234,8 @@ api_mactime_add_del_range (vat_main_t * vam)
mp->is_add = is_add;
mp->drop = drop;
mp->allow = allow;
+ mp->no_udp_10001 = no_udp_10001;
+ mp->data_quota = clib_host_to_net_u64 (data_quota);
memcpy (mp->mac_address, mac_address, sizeof (mp->mac_address));
memcpy (mp->device_name, device_name, vec_len (device_name));
mp->count = clib_host_to_net_u32 (vec_len (rp));