summaryrefslogtreecommitdiff
path: root/src/core/cgroup.h
diff options
context:
space:
mode:
authorDaniel Mack <daniel@zonque.org>2017-09-05 19:27:53 +0200
committerSven Eden <yamakuzure@gmx.net>2017-11-21 07:13:53 +0100
commite89725d34d1d43980147dfd71d80760443a750b5 (patch)
tree428d23a3279786c6fdf2303061bf81d95aec40c2 /src/core/cgroup.h
parenta2026f4227e4216ed06a882d8e5445275cf548d9 (diff)
cgroup, unit, fragment parser: make use of new firewall functions
Diffstat (limited to 'src/core/cgroup.h')
-rw-r--r--src/core/cgroup.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/core/cgroup.h b/src/core/cgroup.h
index 11705be00..a7100d1fc 100644
--- a/src/core/cgroup.h
+++ b/src/core/cgroup.h
@@ -128,6 +128,16 @@ struct CGroupContext {
bool delegate;
};
+/* Used when querying IP accounting data */
+typedef enum CGroupIPAccountingMetric {
+ CGROUP_IP_INGRESS_BYTES,
+ CGROUP_IP_INGRESS_PACKETS,
+ CGROUP_IP_EGRESS_BYTES,
+ CGROUP_IP_EGRESS_PACKETS,
+ _CGROUP_IP_ACCOUNTING_METRIC_MAX,
+ _CGROUP_IP_ACCOUNTING_METRIC_INVALID = -1,
+} CGroupIPAccountingMetric;
+
#include "unit.h"
void cgroup_context_init(CGroupContext *c);
@@ -150,6 +160,8 @@ CGroupMask unit_get_subtree_mask(Unit *u);
CGroupMask unit_get_target_mask(Unit *u);
CGroupMask unit_get_enable_mask(Unit *u);
+bool unit_get_needs_bpf(Unit *u);
+
void unit_update_cgroup_members_masks(Unit *u);
char *unit_default_cgroup_path(Unit *u);
@@ -181,7 +193,10 @@ int unit_watch_all_pids(Unit *u);
int unit_get_memory_current(Unit *u, uint64_t *ret);
int unit_get_tasks_current(Unit *u, uint64_t *ret);
int unit_get_cpu_usage(Unit *u, nsec_t *ret);
-int unit_reset_cpu_usage(Unit *u);
+int unit_get_ip_accounting(Unit *u, CGroupIPAccountingMetric metric, uint64_t *ret);
+
+int unit_reset_cpu_accounting(Unit *u);
+int unit_reset_ip_accounting(Unit *u);
bool unit_cgroup_delegate(Unit *u);
@@ -191,6 +206,7 @@ int manager_notify_cgroup_empty(Manager *m, const char *group);
#if 0 /// UNNEEDED by elogind
void unit_invalidate_cgroup(Unit *u, CGroupMask m);
+void unit_invalidate_cgroup_bpf(Unit *u);
void manager_invalidate_startup_units(Manager *m);