#endif
}
+void
+persist_client_stats(struct context *c)
+{
+#ifdef ENABLE_MANAGEMENT
+ if (management)
+ {
+ man_persist_client_stats(management, c);
+ }
+#endif
+}
+
/*
* Initialize a tunnel instance, handle pre and post-init
* signal settings.
void remove_pid_file(void);
+void persist_client_stats(struct context *c);
+
#endif /* ifndef INIT_H */
}
}
+/* DCO resets stats on reconnect. Since client expects stats
+ * to be preserved across reconnects, we need to save DCO
+ * stats before tearing the tunnel down.
+ */
+void
+man_persist_client_stats(struct management *man, struct context *c)
+{
+ if (dco_enabled(&c->options) && (dco_get_peer_stats(c) == 0))
+ {
+ management_bytes_client(man, c->c2.dco_read_bytes, c->c2.dco_write_bytes);
+ }
+}
+
#else /* ifdef ENABLE_MANAGEMENT */
void
}
}
+void
+man_persist_client_stats(struct management *man, struct context *c);
+
#endif /* ifdef ENABLE_MANAGEMENT */
/**
perf_pop();
}
+ persist_client_stats(c);
+
uninit_management_callback();
/* tear down tunnel instance (unless --persist-tun) */