summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorsongyanchao <[email protected]>2022-04-11 06:02:45 -0400
committersongyanchao <[email protected]>2022-04-20 04:18:50 -0400
commit947fdfdcaf8d6c748ba0e5ab3de251a8f774bef7 (patch)
tree013bf472b6679ca295fd0541e39ddab3bf4f0831 /tools
parentd3360772ad5451e6d2da3ab14def5b479bf87591 (diff)
✨ feat(TSG-10158): Service 支持Vxlan Item
Offload Manage Service 支持Vxlan类型的Item
Diffstat (limited to 'tools')
-rw-r--r--tools/mrctl/mrctl.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/mrctl/mrctl.c b/tools/mrctl/mrctl.c
index de14a32..02f3c73 100644
--- a/tools/mrctl/mrctl.c
+++ b/tools/mrctl/mrctl.c
@@ -53,6 +53,7 @@ enum mr_cli_arg
MR_CLI_ITEM_TCP_FLAGS,
MR_CLI_ITEM_VXLAN,
MR_CLI_ITEM_VXLAN_VNI,
+ MR_CLI_ITEM_VXLAN_VNI_MASK,
MR_CLI_ACTION_COUNT,
MR_CLI_ACTION_COUNT_SHARED,
MR_CLI_ACTION_COUNT_ID,
@@ -116,6 +117,7 @@ static struct option cli_options[] =
{"tcp_flags", required_argument,NULL, MR_CLI_ITEM_TCP_FLAGS},
{"vxlan", no_argument,NULL, MR_CLI_ITEM_VXLAN},
{"vni", required_argument,NULL, MR_CLI_ITEM_VXLAN_VNI},
+ {"vni_mask", required_argument,NULL, MR_CLI_ITEM_VXLAN_VNI},
{"count", no_argument,NULL, MR_CLI_ACTION_COUNT},
{"shared", no_argument,NULL, MR_CLI_ACTION_COUNT_SHARED},
{"countid", required_argument,NULL, MR_CLI_ACTION_COUNT_ID},
@@ -493,6 +495,11 @@ int send_request_msg(struct mrctl_instance * instance, struct mrctl_offload_rule
{
cJSON_AddNumberToObject(cjson_vxlan_item, MR_CJSON_KEY_VXLAN_VNI, vxlan_item->vni);
}
+
+ if(vxlan_item->arg_flg & MR_RULE_FLOW_VXLAN_ARG_VNI_MASK_ENABLE)
+ {
+ cJSON_AddNumberToObject(cjson_vxlan_item, MR_CJSON_KEY_VXLAN_VNI_MASK, vxlan_item->vni_mask);
+ }
cJSON_AddItemToObject(cjson_item,MR_CJSON_KEY_VXLAN,cjson_vxlan_item);
}
@@ -938,6 +945,12 @@ int main(int argc, char * argv[])
vxlan_item->vni = (uint32_t)strtoull(optarg, &endptr, 0);
break;
}
+ case MR_CLI_ITEM_VXLAN_VNI_MASK:
+ {
+ vxlan_item->arg_flg |= MR_RULE_FLOW_VXLAN_ARG_VNI_MASK_ENABLE;
+ vxlan_item->vni_mask = (uint32_t)strtoull(optarg, &endptr, 0);
+ break;
+ }
/* Action */
/* Count */