diff options
| author | songyanchao <[email protected]> | 2024-04-08 06:25:33 +0000 |
|---|---|---|
| committer | songyanchao <[email protected]> | 2024-04-15 06:10:29 +0000 |
| commit | 0077eda5753ba103b891a3e91b3816e6d772c966 (patch) | |
| tree | df3ee279705a4d6d4a52537c8d4d493c2ddd519d /service/include | |
| parent | 87aab32d4cee98e59b8a71b81b1959a9823e3d85 (diff) | |
🎈 perf: Introduce drop reason struct for etherfabric node.
Introduce drop reason struct for etherfabric node.
Diffstat (limited to 'service/include')
| -rw-r--r-- | service/include/sc_node_common.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/service/include/sc_node_common.h b/service/include/sc_node_common.h index 53432dc..2c34c7c 100644 --- a/service/include/sc_node_common.h +++ b/service/include/sc_node_common.h @@ -1,5 +1,6 @@ #pragma once +#include <cJSON.h> #include <mrb_define.h> #include <netinet/in.h> #include <rte_common.h> @@ -117,3 +118,15 @@ static inline int mr_is_local_addr(struct mr_dev_desc * dev_desc, struct mr_gene #define MR_IS_IPV6_SOLICITED_NODE_MCAST(x) \ (x[0] == 0xFF && x[1] == 0x02 && x[2] == 0x00 && x[3] == 0x00 && x[4] == 0x00 && x[5] == 0x00 && x[6] == 0x00 && \ x[7] == 0x00 && x[8] == 0x00 && x[9] == 0x00 && x[10] == 0x00 && x[11] == 0x01 && x[12] == 0xFF) + + +static inline cJSON * create_uint64_array(const uint64_t * value, unsigned int nr_value) +{ + struct cJSON * uint64_array = cJSON_CreateArray(); + for (unsigned int i = 0; i < nr_value; i++) + { + cJSON_AddItemToArray(uint64_array, cJSON_CreateNumber(value[i])); + } + + return uint64_array; +} |
