summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorLu Qiuwen <[email protected]>2022-06-09 13:13:09 -0400
committersongyanchao <[email protected]>2022-07-13 06:14:13 -0400
commit8bc44fee2e988c3a093e302eb6b20d39e5001984 (patch)
treeb6b5af7c56cc73666775282edc69a302c7a5a033 /tools
parent23c9f9f11fcd7b4261d8c1805415b903f36fbb9d (diff)
增加基于rte_graph的Packet Process Graph管理器实现。
Diffstat (limited to 'tools')
-rw-r--r--tools/mrctl/mrctl.c36
1 files changed, 3 insertions, 33 deletions
diff --git a/tools/mrctl/mrctl.c b/tools/mrctl/mrctl.c
index 83fcde6..51e3b24 100644
--- a/tools/mrctl/mrctl.c
+++ b/tools/mrctl/mrctl.c
@@ -1139,25 +1139,14 @@ int send_create_request_msg(struct mrctl_instance * instance, struct mrctl_flow_
if (ether_item->arg_flag & MR_RULE_FLOW_ETHER_ARG_SMAC_ENABLE)
{
char mac_addr[MR_RULE_MAC_ADDR_LEN];
-
-#if RTE_VERSION_NUM(21, 11, 0, 0) <= RTE_VERSION
ether_format_addr(mac_addr, sizeof(mac_addr), &ether_item->ether_hdr.src_addr);
-#else
- ether_format_addr(mac_addr, sizeof(mac_addr), &ether_item->ether_hdr.s_addr);
-#endif
cJSON_AddStringToObject(cjson_ether_item, MR_CJSON_KEY_ETHER_SMAC, mac_addr);
}
if (ether_item->arg_flag & MR_RULE_FLOW_ETHER_ARG_DMAC_ENABLE)
{
char mac_addr[MR_RULE_MAC_ADDR_LEN];
-
-#if RTE_VERSION_NUM(21,11,0,0) <= RTE_VERSION
ether_format_addr(mac_addr, sizeof(mac_addr), &ether_item->ether_hdr.dst_addr);
-#else
- ether_format_addr(mac_addr, sizeof(mac_addr), &ether_item->ether_hdr.d_addr);
-#endif
-
cJSON_AddStringToObject(cjson_ether_item, MR_CJSON_KEY_ETHER_DMAC, mac_addr);
}
@@ -1600,20 +1589,10 @@ int main(int argc, char * argv[])
}
case MR_CLI_ITEM_ETHER_SMAC:
{
-#if RTE_VERSION_NUM(21, 11, 0, 0) <= RTE_VERSION
if(string_to_mac(optarg,&ether_item->ether_hdr.src_addr) == RT_SUCCESS)
-#else
- if(string_to_mac(optarg,&ether_item->ether_hdr.s_addr) == RT_SUCCESS)
-#endif
-
{
ether_item->arg_flag |= MR_RULE_FLOW_ETHER_ARG_SMAC_ENABLE;
-
-#if RTE_VERSION_NUM(21, 11, 0, 0) <= RTE_VERSION
ether_format_addr(mac_addr, sizeof(mac_addr), &ether_item->ether_hdr.src_addr);
-#else
- ether_format_addr(mac_addr, sizeof(mac_addr), &ether_item->ether_hdr.s_addr);
-#endif
}
else
{
@@ -1625,6 +1604,7 @@ int main(int argc, char * argv[])
}
case MR_CLI_ITEM_ETHER_DMAC:
{
+<<<<<<< HEAD
#if RTE_VERSION_NUM(21, 11, 0, 0) <= RTE_VERSION
if(string_to_mac(optarg,&ether_item->ether_hdr.dst_addr) == RT_SUCCESS)
#else
@@ -1638,23 +1618,13 @@ int main(int argc, char * argv[])
#else
ether_format_addr(mac_addr, sizeof(mac_addr), &ether_item->ether_hdr.d_addr);
#endif
- }
- else
+=======
+ if(string_to_mac(optarg,&ether_item->ether_hdr.dst_addr) == RT_SUCCESS)
{
- printf("Bad MAC Address format: %s \n",mac_addr);
- printf("Use like: 0a:38:ca:f6:f3:20\n");
- return 0;
- }
- break;
- }
- case MR_CLI_ITEM_ETHER_SMAC_MASK:
- {
- if(string_to_mac(optarg,&ether_item->smac_mask) == RT_SUCCESS)
{
ether_item->arg_flag |= MR_RULE_FLOW_ETHER_ARG_SMAC_MASK_ENABLE;
ether_format_addr(mac_mask, sizeof(mac_mask), &ether_item->smac_mask);
- }
else
{
printf("Bad MAC Mask format: %s \n",mac_mask);