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 | |
15 | G_BEGIN_DECLS |
16 | |
17 | typedef struct NMTCQdisc NMTCQdisc; |
18 | |
19 | NM_AVAILABLE_IN_1_12 |
20 | GType nm_tc_qdisc_get_type(void); |
21 | |
22 | NM_AVAILABLE_IN_1_12 |
23 | NMTCQdisc *nm_tc_qdisc_new(const char *kind, guint32 parent, GError **error); |
24 | |
25 | NM_AVAILABLE_IN_1_12 |
26 | void nm_tc_qdisc_ref(NMTCQdisc *qdisc); |
27 | NM_AVAILABLE_IN_1_12 |
28 | void nm_tc_qdisc_unref(NMTCQdisc *qdisc); |
29 | NM_AVAILABLE_IN_1_12 |
30 | gboolean nm_tc_qdisc_equal(NMTCQdisc *qdisc, NMTCQdisc *other); |
31 | |
32 | NM_AVAILABLE_IN_1_12 |
33 | NMTCQdisc *nm_tc_qdisc_dup(NMTCQdisc *qdisc); |
34 | |
35 | NM_AVAILABLE_IN_1_12 |
36 | const char *nm_tc_qdisc_get_kind(NMTCQdisc *qdisc); |
37 | NM_AVAILABLE_IN_1_12 |
38 | guint32 nm_tc_qdisc_get_handle(NMTCQdisc *qdisc); |
39 | NM_AVAILABLE_IN_1_12 |
40 | void nm_tc_qdisc_set_handle(NMTCQdisc *qdisc, guint32 handle); |
41 | NM_AVAILABLE_IN_1_12 |
42 | guint32 nm_tc_qdisc_get_parent(NMTCQdisc *qdisc); |
43 | |
44 | NM_AVAILABLE_IN_1_18 |
45 | const char **nm_tc_qdisc_get_attribute_names(NMTCQdisc *qdisc); |
46 | NM_AVAILABLE_IN_1_18 |
47 | GVariant *nm_tc_qdisc_get_attribute(NMTCQdisc *qdisc, const char *name); |
48 | NM_AVAILABLE_IN_1_18 |
49 | void nm_tc_qdisc_set_attribute(NMTCQdisc *qdisc, const char *name, GVariant *value); |
50 | |
51 | typedef struct NMTCAction NMTCAction; |
52 | |
53 | NM_AVAILABLE_IN_1_12 |
54 | GType nm_tc_action_get_type(void); |
55 | |
56 | NM_AVAILABLE_IN_1_12 |
57 | NMTCAction *nm_tc_action_new(const char *kind, GError **error); |
58 | |
59 | NM_AVAILABLE_IN_1_12 |
60 | void nm_tc_action_ref(NMTCAction *action); |
61 | NM_AVAILABLE_IN_1_12 |
62 | void nm_tc_action_unref(NMTCAction *action); |
63 | NM_AVAILABLE_IN_1_12 |
64 | gboolean nm_tc_action_equal(NMTCAction *action, NMTCAction *other); |
65 | |
66 | NM_AVAILABLE_IN_1_12 |
67 | NMTCAction *nm_tc_action_dup(NMTCAction *action); |
68 | |
69 | NM_AVAILABLE_IN_1_12 |
70 | const char *nm_tc_action_get_kind(NMTCAction *action); |
71 | |
72 | NM_AVAILABLE_IN_1_12 |
73 | char **nm_tc_action_get_attribute_names(NMTCAction *action); |
74 | NM_AVAILABLE_IN_1_12 |
75 | GVariant *nm_tc_action_get_attribute(NMTCAction *action, const char *name); |
76 | NM_AVAILABLE_IN_1_12 |
77 | void nm_tc_action_set_attribute(NMTCAction *action, const char *name, GVariant *value); |
78 | |
79 | typedef struct NMTCTfilter NMTCTfilter; |
80 | |
81 | NM_AVAILABLE_IN_1_12 |
82 | GType nm_tc_tfilter_get_type(void); |
83 | |
84 | NM_AVAILABLE_IN_1_12 |
85 | NMTCTfilter *nm_tc_tfilter_new(const char *kind, guint32 parent, GError **error); |
86 | |
87 | NM_AVAILABLE_IN_1_12 |
88 | void nm_tc_tfilter_ref(NMTCTfilter *tfilter); |
89 | NM_AVAILABLE_IN_1_12 |
90 | void nm_tc_tfilter_unref(NMTCTfilter *tfilter); |
91 | NM_AVAILABLE_IN_1_12 |
92 | gboolean nm_tc_tfilter_equal(NMTCTfilter *tfilter, NMTCTfilter *other); |
93 | |
94 | NM_AVAILABLE_IN_1_12 |
95 | NMTCTfilter *nm_tc_tfilter_dup(NMTCTfilter *tfilter); |
96 | |
97 | NM_AVAILABLE_IN_1_12 |
98 | const char *nm_tc_tfilter_get_kind(NMTCTfilter *tfilter); |
99 | NM_AVAILABLE_IN_1_12 |
100 | guint32 nm_tc_tfilter_get_handle(NMTCTfilter *tfilter); |
101 | NM_AVAILABLE_IN_1_12 |
102 | void nm_tc_tfilter_set_handle(NMTCTfilter *tfilter, guint32 handle); |
103 | NM_AVAILABLE_IN_1_12 |
104 | guint32 nm_tc_tfilter_get_parent(NMTCTfilter *tfilter); |
105 | NM_AVAILABLE_IN_1_12 |
106 | NMTCAction *nm_tc_tfilter_get_action(NMTCTfilter *tfilter); |
107 | NM_AVAILABLE_IN_1_12 |
108 | void 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 | |
126 | typedef struct _NMSettingTCConfigClass NMSettingTCConfigClass; |
127 | |
128 | GType nm_setting_tc_config_get_type(void); |
129 | |
130 | NM_AVAILABLE_IN_1_12 |
131 | NMSetting *nm_setting_tc_config_new(void); |
132 | |
133 | NM_AVAILABLE_IN_1_12 |
134 | guint nm_setting_tc_config_get_num_qdiscs(NMSettingTCConfig *setting); |
135 | NM_AVAILABLE_IN_1_12 |
136 | NMTCQdisc *nm_setting_tc_config_get_qdisc(NMSettingTCConfig *setting, guint idx); |
137 | NM_AVAILABLE_IN_1_12 |
138 | gboolean nm_setting_tc_config_add_qdisc(NMSettingTCConfig *setting, NMTCQdisc *qdisc); |
139 | NM_AVAILABLE_IN_1_12 |
140 | void nm_setting_tc_config_remove_qdisc(NMSettingTCConfig *setting, guint idx); |
141 | NM_AVAILABLE_IN_1_12 |
142 | gboolean nm_setting_tc_config_remove_qdisc_by_value(NMSettingTCConfig *setting, NMTCQdisc *qdisc); |
143 | NM_AVAILABLE_IN_1_12 |
144 | void nm_setting_tc_config_clear_qdiscs(NMSettingTCConfig *setting); |
145 | |
146 | NM_AVAILABLE_IN_1_12 |
147 | guint nm_setting_tc_config_get_num_tfilters(NMSettingTCConfig *setting); |
148 | NM_AVAILABLE_IN_1_12 |
149 | NMTCTfilter *nm_setting_tc_config_get_tfilter(NMSettingTCConfig *setting, guint idx); |
150 | NM_AVAILABLE_IN_1_12 |
151 | gboolean nm_setting_tc_config_add_tfilter(NMSettingTCConfig *setting, NMTCTfilter *tfilter); |
152 | NM_AVAILABLE_IN_1_12 |
153 | void nm_setting_tc_config_remove_tfilter(NMSettingTCConfig *setting, guint idx); |
154 | NM_AVAILABLE_IN_1_12 |
155 | gboolean nm_setting_tc_config_remove_tfilter_by_value(NMSettingTCConfig *setting, |
156 | NMTCTfilter *tfilter); |
157 | NM_AVAILABLE_IN_1_12 |
158 | void nm_setting_tc_config_clear_tfilters(NMSettingTCConfig *setting); |
159 | |
160 | G_END_DECLS |
161 | |
162 | #endif /* NM_SETTING_TC_CONFIG_H */ |
163 | |