aboutsummaryrefslogtreecommitdiffstats
path: root/ctrl/libhicnctrl/src/modules/hicn_light/stats.h
diff options
context:
space:
mode:
Diffstat (limited to 'ctrl/libhicnctrl/src/modules/hicn_light/stats.h')
-rw-r--r--ctrl/libhicnctrl/src/modules/hicn_light/stats.h44
1 files changed, 21 insertions, 23 deletions
diff --git a/ctrl/libhicnctrl/src/modules/hicn_light/stats.h b/ctrl/libhicnctrl/src/modules/hicn_light/stats.h
index 34594bb72..9509be86c 100644
--- a/ctrl/libhicnctrl/src/modules/hicn_light/stats.h
+++ b/ctrl/libhicnctrl/src/modules/hicn_light/stats.h
@@ -1,26 +1,24 @@
+/*
+ * Copyright (c) 2022 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
-#if 0
+#ifndef HICNCTRL_MODULE_HICNLIGHT_STATS_H
+#define HICNCTRL_MODULE_HICNLIGHT_STATS_H
-int hc_stats_snprintf(char *s, size_t size, const hicn_light_stats_t *stats) {
- return snprintf(
- s, size,
- "pkts processed: %u\n\tinterests: %u\n\t"
- "data: %u\npkts from cache count: %u\npkts no pit count: "
- "%u\nexpired:\n\t interests: "
- "%u\n\t data: %u\ninterests aggregated: "
- "%u\nlru evictions: "
- "%u\ndropped: "
- "%u\ninterests retx: "
- "%u\npit entries: %u\ncs entries: %u",
- stats->forwarder.countReceived, stats->forwarder.countInterestsReceived,
- stats->forwarder.countObjectsReceived,
- stats->forwarder.countInterestsSatisfiedFromStore,
- stats->forwarder.countDroppedNoReversePath,
- stats->forwarder.countInterestsExpired, stats->forwarder.countDataExpired,
- stats->pkt_cache.n_lru_evictions, stats->forwarder.countDropped,
- stats->forwarder.countInterestsAggregated,
- stats->forwarder.countInterestsRetransmitted,
- stats->pkt_cache.n_pit_entries, stats->pkt_cache.n_cs_entries);
-}
+#include "../../module.h"
-#endif
+DECLARE_MODULE_OBJECT_OPS_H(hicnlight, stats);
+DECLARE_MODULE_OBJECT_OPS_H(hicnlight, face_stats);
+
+#endif /* HICNCTRL_MODULE_HICNLIGHT_STATS_H */