summaryrefslogtreecommitdiff
path: root/libnm-core/nm-setting-tc-config.h
blob: 648e6403eefcdc93e68c1cb0b434eb4a70bcfdd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
// SPDX-License-Identifier: LGPL-2.1+
/*
 * Copyright (C) 2017 Red Hat, Inc.
 */

#ifndef NM_SETTING_TC_CONFIG_H
#define NM_SETTING_TC_CONFIG_H

#if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION)
#error "Only <NetworkManager.h> can be included directly."
#endif

#include "nm-setting.h"

G_BEGIN_DECLS

typedef struct NMTCQdisc NMTCQdisc;

NM_AVAILABLE_IN_1_12
GType       nm_tc_qdisc_get_type             (void);

NM_AVAILABLE_IN_1_12
NMTCQdisc  *nm_tc_qdisc_new                  (const char *kind,
                                              guint32 parent,
                                              GError **error);

NM_AVAILABLE_IN_1_12
void        nm_tc_qdisc_ref                  (NMTCQdisc *qdisc);
NM_AVAILABLE_IN_1_12
void        nm_tc_qdisc_unref                (NMTCQdisc *qdisc);
NM_AVAILABLE_IN_1_12
gboolean    nm_tc_qdisc_equal                (NMTCQdisc *qdisc,
                                              NMTCQdisc *other);

NM_AVAILABLE_IN_1_12
NMTCQdisc  *nm_tc_qdisc_dup                  (NMTCQdisc  *qdisc);

NM_AVAILABLE_IN_1_12
const char *nm_tc_qdisc_get_kind             (NMTCQdisc *qdisc);
NM_AVAILABLE_IN_1_12
guint32     nm_tc_qdisc_get_handle           (NMTCQdisc *qdisc);
NM_AVAILABLE_IN_1_12
void        nm_tc_qdisc_set_handle           (NMTCQdisc *qdisc,
                                              guint32 handle);
NM_AVAILABLE_IN_1_12
guint32     nm_tc_qdisc_get_parent           (NMTCQdisc *qdisc);

NM_AVAILABLE_IN_1_18
const char **nm_tc_qdisc_get_attribute_names (NMTCQdisc *qdisc);
NM_AVAILABLE_IN_1_18
GVariant   *nm_tc_qdisc_get_attribute        (NMTCQdisc *qdisc,
                                              const char *name);
NM_AVAILABLE_IN_1_18
void        nm_tc_qdisc_set_attribute        (NMTCQdisc *qdisc,
                                              const char *name,
                                              GVariant *value);

typedef struct NMTCAction NMTCAction;

NM_AVAILABLE_IN_1_12
GType       nm_tc_action_get_type            (void);

NM_AVAILABLE_IN_1_12
NMTCAction  *nm_tc_action_new                (const char *kind,
                                              GError **error);

NM_AVAILABLE_IN_1_12
void        nm_tc_action_ref                 (NMTCAction *action);
NM_AVAILABLE_IN_1_12
void        nm_tc_action_unref               (NMTCAction *action);
NM_AVAILABLE_IN_1_12
gboolean    nm_tc_action_equal               (NMTCAction *action,
                                              NMTCAction *other);

NM_AVAILABLE_IN_1_12
NMTCAction  *nm_tc_action_dup                (NMTCAction  *action);

NM_AVAILABLE_IN_1_12
const char *nm_tc_action_get_kind            (NMTCAction *action);

NM_AVAILABLE_IN_1_12
char      **nm_tc_action_get_attribute_names (NMTCAction *action);
NM_AVAILABLE_IN_1_12
GVariant   *nm_tc_action_get_attribute       (NMTCAction *action,
                                              const char *name);
NM_AVAILABLE_IN_1_12
void        nm_tc_action_set_attribute       (NMTCAction *action,
                                              const char *name,
                                              GVariant *value);

typedef struct NMTCTfilter NMTCTfilter;

NM_AVAILABLE_IN_1_12
GType       nm_tc_tfilter_get_type           (void);

NM_AVAILABLE_IN_1_12
NMTCTfilter  *nm_tc_tfilter_new              (const char *kind,
                                              guint32 parent,
                                              GError **error);

NM_AVAILABLE_IN_1_12
void        nm_tc_tfilter_ref                (NMTCTfilter *tfilter);
NM_AVAILABLE_IN_1_12
void        nm_tc_tfilter_unref              (NMTCTfilter *tfilter);
NM_AVAILABLE_IN_1_12
gboolean    nm_tc_tfilter_equal              (NMTCTfilter *tfilter,
                                              NMTCTfilter *other);

NM_AVAILABLE_IN_1_12
NMTCTfilter  *nm_tc_tfilter_dup              (NMTCTfilter  *tfilter);

NM_AVAILABLE_IN_1_12
const char *nm_tc_tfilter_get_kind           (NMTCTfilter *tfilter);
NM_AVAILABLE_IN_1_12
guint32     nm_tc_tfilter_get_handle         (NMTCTfilter *tfilter);
NM_AVAILABLE_IN_1_12
void        nm_tc_tfilter_set_handle         (NMTCTfilter *tfilter,
                                              guint32 handle);
NM_AVAILABLE_IN_1_12
guint32     nm_tc_tfilter_get_parent         (NMTCTfilter *tfilter);
NM_AVAILABLE_IN_1_12
NMTCAction *nm_tc_tfilter_get_action         (NMTCTfilter *tfilter);
NM_AVAILABLE_IN_1_12
void        nm_tc_tfilter_set_action         (NMTCTfilter *tfilter, NMTCAction *action);

#define NM_TYPE_SETTING_TC_CONFIG            (nm_setting_tc_config_get_type ())
#define NM_SETTING_TC_CONFIG(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_TC_CONFIG, NMSettingTCConfig))
#define NM_SETTING_TC_CONFIG_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_TC_CONFIG, NMSettingTCConfigClass))
#define NM_IS_SETTING_TC_CONFIG(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_TC_CONFIG))
#define NM_IS_SETTING_TC_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SETTING_TC_CONFIG))
#define NM_SETTING_TC_CONFIG_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_TC_CONFIG, NMSettingTCConfigClass))

#define NM_SETTING_TC_CONFIG_SETTING_NAME    "tc"

#define NM_SETTING_TC_CONFIG_QDISCS          "qdiscs"
#define NM_SETTING_TC_CONFIG_TFILTERS        "tfilters"

typedef struct _NMSettingTCConfigClass NMSettingTCConfigClass;

GType nm_setting_tc_config_get_type (void);

NM_AVAILABLE_IN_1_12
NMSetting *nm_setting_tc_config_new (void);

NM_AVAILABLE_IN_1_12
guint      nm_setting_tc_config_get_num_qdiscs          (NMSettingTCConfig *setting);
NM_AVAILABLE_IN_1_12
NMTCQdisc *nm_setting_tc_config_get_qdisc               (NMSettingTCConfig *setting,
                                                         guint idx);
NM_AVAILABLE_IN_1_12
gboolean   nm_setting_tc_config_add_qdisc               (NMSettingTCConfig *setting,
                                                         NMTCQdisc *qdisc);
NM_AVAILABLE_IN_1_12
void       nm_setting_tc_config_remove_qdisc            (NMSettingTCConfig *setting,
                                                         guint idx);
NM_AVAILABLE_IN_1_12
gboolean   nm_setting_tc_config_remove_qdisc_by_value   (NMSettingTCConfig *setting,
                                                         NMTCQdisc *qdisc);
NM_AVAILABLE_IN_1_12
void       nm_setting_tc_config_clear_qdiscs            (NMSettingTCConfig *setting);

NM_AVAILABLE_IN_1_12
guint      nm_setting_tc_config_get_num_tfilters        (NMSettingTCConfig *setting);
NM_AVAILABLE_IN_1_12
NMTCTfilter *nm_setting_tc_config_get_tfilter           (NMSettingTCConfig *setting,
                                                         guint idx);
NM_AVAILABLE_IN_1_12
gboolean   nm_setting_tc_config_add_tfilter             (NMSettingTCConfig *setting,
                                                         NMTCTfilter *tfilter);
NM_AVAILABLE_IN_1_12
void       nm_setting_tc_config_remove_tfilter          (NMSettingTCConfig *setting,
                                                         guint idx);
NM_AVAILABLE_IN_1_12
gboolean   nm_setting_tc_config_remove_tfilter_by_value (NMSettingTCConfig *setting,
                                                         NMTCTfilter *tfilter);
NM_AVAILABLE_IN_1_12
void       nm_setting_tc_config_clear_tfilters          (NMSettingTCConfig *setting);

G_END_DECLS

#endif /* NM_SETTING_TC_CONFIG_H */