1/* SPDX-License-Identifier: LGPL-2.1-or-later */
2/*
3 * Copyright (C) 2017 Red Hat, Inc.
4 */
5
6#ifndef NM_SETTING_TC_CONFIG_H
7#define NM_SETTING_TC_CONFIG_H
8
9#if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION)
10#error "Only <NetworkManager.h> can be included directly."
11#endif
12
13#include "nm-setting.h"
14
15G_BEGIN_DECLS
16
17typedef struct NMTCQdisc NMTCQdisc;
18
19NM_AVAILABLE_IN_1_12
20GType nm_tc_qdisc_get_type(void);
21
22NM_AVAILABLE_IN_1_12
23NMTCQdisc *nm_tc_qdisc_new(const char *kind, guint32 parent, GError **error);
24
25NM_AVAILABLE_IN_1_12
26void nm_tc_qdisc_ref(NMTCQdisc *qdisc);
27NM_AVAILABLE_IN_1_12
28void nm_tc_qdisc_unref(NMTCQdisc *qdisc);
29NM_AVAILABLE_IN_1_12
30gboolean nm_tc_qdisc_equal(NMTCQdisc *qdisc, NMTCQdisc *other);
31
32NM_AVAILABLE_IN_1_12
33NMTCQdisc *nm_tc_qdisc_dup(NMTCQdisc *qdisc);
34
35NM_AVAILABLE_IN_1_12
36const char *nm_tc_qdisc_get_kind(NMTCQdisc *qdisc);
37NM_AVAILABLE_IN_1_12
38guint32 nm_tc_qdisc_get_handle(NMTCQdisc *qdisc);
39NM_AVAILABLE_IN_1_12
40void nm_tc_qdisc_set_handle(NMTCQdisc *qdisc, guint32 handle);
41NM_AVAILABLE_IN_1_12
42guint32 nm_tc_qdisc_get_parent(NMTCQdisc *qdisc);
43
44NM_AVAILABLE_IN_1_18
45const char **nm_tc_qdisc_get_attribute_names(NMTCQdisc *qdisc);
46NM_AVAILABLE_IN_1_18
47GVariant *nm_tc_qdisc_get_attribute(NMTCQdisc *qdisc, const char *name);
48NM_AVAILABLE_IN_1_18
49void nm_tc_qdisc_set_attribute(NMTCQdisc *qdisc, const char *name, GVariant *value);
50
51typedef struct NMTCAction NMTCAction;
52
53NM_AVAILABLE_IN_1_12
54GType nm_tc_action_get_type(void);
55
56NM_AVAILABLE_IN_1_12
57NMTCAction *nm_tc_action_new(const char *kind, GError **error);
58
59NM_AVAILABLE_IN_1_12
60void nm_tc_action_ref(NMTCAction *action);
61NM_AVAILABLE_IN_1_12
62void nm_tc_action_unref(NMTCAction *action);
63NM_AVAILABLE_IN_1_12
64gboolean nm_tc_action_equal(NMTCAction *action, NMTCAction *other);
65
66NM_AVAILABLE_IN_1_12
67NMTCAction *nm_tc_action_dup(NMTCAction *action);
68
69NM_AVAILABLE_IN_1_12
70const char *nm_tc_action_get_kind(NMTCAction *action);
71
72NM_AVAILABLE_IN_1_12
73char **nm_tc_action_get_attribute_names(NMTCAction *action);
74NM_AVAILABLE_IN_1_12
75GVariant *nm_tc_action_get_attribute(NMTCAction *action, const char *name);
76NM_AVAILABLE_IN_1_12
77void nm_tc_action_set_attribute(NMTCAction *action, const char *name, GVariant *value);
78
79typedef struct NMTCTfilter NMTCTfilter;
80
81NM_AVAILABLE_IN_1_12
82GType nm_tc_tfilter_get_type(void);
83
84NM_AVAILABLE_IN_1_12
85NMTCTfilter *nm_tc_tfilter_new(const char *kind, guint32 parent, GError **error);
86
87NM_AVAILABLE_IN_1_12
88void nm_tc_tfilter_ref(NMTCTfilter *tfilter);
89NM_AVAILABLE_IN_1_12
90void nm_tc_tfilter_unref(NMTCTfilter *tfilter);
91NM_AVAILABLE_IN_1_12
92gboolean nm_tc_tfilter_equal(NMTCTfilter *tfilter, NMTCTfilter *other);
93
94NM_AVAILABLE_IN_1_12
95NMTCTfilter *nm_tc_tfilter_dup(NMTCTfilter *tfilter);
96
97NM_AVAILABLE_IN_1_12
98const char *nm_tc_tfilter_get_kind(NMTCTfilter *tfilter);
99NM_AVAILABLE_IN_1_12
100guint32 nm_tc_tfilter_get_handle(NMTCTfilter *tfilter);
101NM_AVAILABLE_IN_1_12
102void nm_tc_tfilter_set_handle(NMTCTfilter *tfilter, guint32 handle);
103NM_AVAILABLE_IN_1_12
104guint32 nm_tc_tfilter_get_parent(NMTCTfilter *tfilter);
105NM_AVAILABLE_IN_1_12
106NMTCAction *nm_tc_tfilter_get_action(NMTCTfilter *tfilter);
107NM_AVAILABLE_IN_1_12
108void nm_tc_tfilter_set_action(NMTCTfilter *tfilter, NMTCAction *action);
109
110#define NM_TYPE_SETTING_TC_CONFIG (nm_setting_tc_config_get_type())
111#define NM_SETTING_TC_CONFIG(obj) \
112 (G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_SETTING_TC_CONFIG, NMSettingTCConfig))
113#define NM_SETTING_TC_CONFIG_CLASS(klass) \
114 (G_TYPE_CHECK_CLASS_CAST((klass), NM_TYPE_SETTING_TC_CONFIG, NMSettingTCConfigClass))
115#define NM_IS_SETTING_TC_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), NM_TYPE_SETTING_TC_CONFIG))
116#define NM_IS_SETTING_TC_CONFIG_CLASS(klass) \
117 (G_TYPE_CHECK_CLASS_TYPE((klass), NM_TYPE_SETTING_TC_CONFIG))
118#define NM_SETTING_TC_CONFIG_GET_CLASS(obj) \
119 (G_TYPE_INSTANCE_GET_CLASS((obj), NM_TYPE_SETTING_TC_CONFIG, NMSettingTCConfigClass))
120
121#define NM_SETTING_TC_CONFIG_SETTING_NAME "tc"
122
123#define NM_SETTING_TC_CONFIG_QDISCS "qdiscs"
124#define NM_SETTING_TC_CONFIG_TFILTERS "tfilters"
125
126typedef struct _NMSettingTCConfigClass NMSettingTCConfigClass;
127
128GType nm_setting_tc_config_get_type(void);
129
130NM_AVAILABLE_IN_1_12
131NMSetting *nm_setting_tc_config_new(void);
132
133NM_AVAILABLE_IN_1_12
134guint nm_setting_tc_config_get_num_qdiscs(NMSettingTCConfig *setting);
135NM_AVAILABLE_IN_1_12
136NMTCQdisc *nm_setting_tc_config_get_qdisc(NMSettingTCConfig *setting, guint idx);
137NM_AVAILABLE_IN_1_12
138gboolean nm_setting_tc_config_add_qdisc(NMSettingTCConfig *setting, NMTCQdisc *qdisc);
139NM_AVAILABLE_IN_1_12
140void nm_setting_tc_config_remove_qdisc(NMSettingTCConfig *setting, guint idx);
141NM_AVAILABLE_IN_1_12
142gboolean nm_setting_tc_config_remove_qdisc_by_value(NMSettingTCConfig *setting, NMTCQdisc *qdisc);
143NM_AVAILABLE_IN_1_12
144void nm_setting_tc_config_clear_qdiscs(NMSettingTCConfig *setting);
145
146NM_AVAILABLE_IN_1_12
147guint nm_setting_tc_config_get_num_tfilters(NMSettingTCConfig *setting);
148NM_AVAILABLE_IN_1_12
149NMTCTfilter *nm_setting_tc_config_get_tfilter(NMSettingTCConfig *setting, guint idx);
150NM_AVAILABLE_IN_1_12
151gboolean nm_setting_tc_config_add_tfilter(NMSettingTCConfig *setting, NMTCTfilter *tfilter);
152NM_AVAILABLE_IN_1_12
153void nm_setting_tc_config_remove_tfilter(NMSettingTCConfig *setting, guint idx);
154NM_AVAILABLE_IN_1_12
155gboolean nm_setting_tc_config_remove_tfilter_by_value(NMSettingTCConfig *setting,
156 NMTCTfilter *tfilter);
157NM_AVAILABLE_IN_1_12
158void nm_setting_tc_config_clear_tfilters(NMSettingTCConfig *setting);
159
160G_END_DECLS
161
162#endif /* NM_SETTING_TC_CONFIG_H */
163

source code of include/libnm/nm-setting-tc-config.h