MCPcopy Create free account
hub / github.com/Netis/cloud-probe / packets_stats_json_dump

Function packets_stats_json_dump

cpworker/src/task.c:678–690  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

676}
677
678static int packets_stats_json_dump(packets_stats_t st, cJSON *obj)
679{
680 cJSON *packets = cJSON_CreateNumber(st.packets);
681 if (!packets)
682 return -1;
683 cJSON_AddItemToObject(obj, "packets", packets);
684
685 cJSON *peta = cJSON_CreateNumber(st.peta);
686 if (!peta)
687 return -1;
688 cJSON_AddItemToObject(obj, "peta", peta);
689 return 0;
690}
691
692static int capture_stats_json_dump(capture_stats_t *stats, cJSON *capture)
693{

Callers 2

capture_stats_json_dumpFunction · 0.85
output_stats_json_dumpFunction · 0.85

Calls 2

cJSON_CreateNumberFunction · 0.85
cJSON_AddItemToObjectFunction · 0.85

Tested by

no test coverage detected