1/* SPDX-License-Identifier: LGPL-2.1-or-later */
2/*
3 * Copyright (C) 2018 Red Hat, Inc.
4 */
5
6#ifndef NM_SETTING_MATCH_H
7#define NM_SETTING_MATCH_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
17#define NM_TYPE_SETTING_MATCH (nm_setting_match_get_type())
18#define NM_SETTING_MATCH(obj) \
19 (G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_SETTING_MATCH, NMSettingMatch))
20#define NM_SETTING_MATCH_CLASS(klass) \
21 (G_TYPE_CHECK_CLASS_CAST((klass), NM_TYPE_SETTING_MATCH, NMSettingMatchClass))
22#define NM_IS_SETTING_MATCH(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), NM_TYPE_SETTING_MATCH))
23#define NM_IS_SETTING_MATCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), NM_TYPE_SETTING_MATCH))
24#define NM_SETTING_MATCH_GET_CLASS(obj) \
25 (G_TYPE_INSTANCE_GET_CLASS((obj), NM_TYPE_SETTING_MATCH, NMSettingMatchClass))
26
27#define NM_SETTING_MATCH_SETTING_NAME "match"
28
29#define NM_SETTING_MATCH_INTERFACE_NAME "interface-name"
30#define NM_SETTING_MATCH_KERNEL_COMMAND_LINE "kernel-command-line"
31#define NM_SETTING_MATCH_DRIVER "driver"
32#define NM_SETTING_MATCH_PATH "path"
33
34typedef struct _NMSettingMatchClass NMSettingMatchClass;
35
36NM_AVAILABLE_IN_1_14
37GType nm_setting_match_get_type(void);
38NM_AVAILABLE_IN_1_32
39NMSetting *nm_setting_match_new(void);
40
41NM_AVAILABLE_IN_1_14
42guint nm_setting_match_get_num_interface_names(NMSettingMatch *setting);
43NM_AVAILABLE_IN_1_14
44const char *nm_setting_match_get_interface_name(NMSettingMatch *setting, int idx);
45NM_AVAILABLE_IN_1_14
46void nm_setting_match_remove_interface_name(NMSettingMatch *setting, int idx);
47NM_AVAILABLE_IN_1_14
48gboolean nm_setting_match_remove_interface_name_by_value(NMSettingMatch *setting,
49 const char *interface_name);
50NM_AVAILABLE_IN_1_14
51void nm_setting_match_add_interface_name(NMSettingMatch *setting, const char *interface_name);
52NM_AVAILABLE_IN_1_14
53void nm_setting_match_clear_interface_names(NMSettingMatch *setting);
54NM_AVAILABLE_IN_1_14
55const char *const *nm_setting_match_get_interface_names(NMSettingMatch *setting, guint *length);
56
57NM_AVAILABLE_IN_1_26
58guint nm_setting_match_get_num_kernel_command_lines(NMSettingMatch *setting);
59NM_AVAILABLE_IN_1_26
60const char *nm_setting_match_get_kernel_command_line(NMSettingMatch *setting, guint idx);
61NM_AVAILABLE_IN_1_26
62void nm_setting_match_remove_kernel_command_line(NMSettingMatch *setting, guint idx);
63NM_AVAILABLE_IN_1_26
64gboolean nm_setting_match_remove_kernel_command_line_by_value(NMSettingMatch *setting,
65 const char *kernel_command_line);
66NM_AVAILABLE_IN_1_26
67void nm_setting_match_add_kernel_command_line(NMSettingMatch *setting,
68 const char *kernel_command_line);
69NM_AVAILABLE_IN_1_26
70void nm_setting_match_clear_kernel_command_lines(NMSettingMatch *setting);
71NM_AVAILABLE_IN_1_26
72const char *const *nm_setting_match_get_kernel_command_lines(NMSettingMatch *setting,
73 guint *length);
74
75NM_AVAILABLE_IN_1_26
76guint nm_setting_match_get_num_drivers(NMSettingMatch *setting);
77NM_AVAILABLE_IN_1_26
78const char *nm_setting_match_get_driver(NMSettingMatch *setting, guint idx);
79NM_AVAILABLE_IN_1_26
80void nm_setting_match_remove_driver(NMSettingMatch *setting, guint idx);
81NM_AVAILABLE_IN_1_26
82gboolean nm_setting_match_remove_driver_by_value(NMSettingMatch *setting, const char *driver);
83NM_AVAILABLE_IN_1_26
84void nm_setting_match_add_driver(NMSettingMatch *setting, const char *driver);
85NM_AVAILABLE_IN_1_26
86void nm_setting_match_clear_drivers(NMSettingMatch *setting);
87NM_AVAILABLE_IN_1_26
88const char *const *nm_setting_match_get_drivers(NMSettingMatch *setting, guint *length);
89
90NM_AVAILABLE_IN_1_26
91guint nm_setting_match_get_num_paths(NMSettingMatch *setting);
92NM_AVAILABLE_IN_1_26
93const char *nm_setting_match_get_path(NMSettingMatch *setting, guint idx);
94NM_AVAILABLE_IN_1_26
95void nm_setting_match_remove_path(NMSettingMatch *setting, guint idx);
96NM_AVAILABLE_IN_1_26
97gboolean nm_setting_match_remove_path_by_value(NMSettingMatch *setting, const char *path);
98NM_AVAILABLE_IN_1_26
99void nm_setting_match_add_path(NMSettingMatch *setting, const char *path);
100NM_AVAILABLE_IN_1_26
101void nm_setting_match_clear_paths(NMSettingMatch *setting);
102NM_AVAILABLE_IN_1_26
103const char *const *nm_setting_match_get_paths(NMSettingMatch *setting, guint *length);
104
105G_END_DECLS
106
107#endif /* NM_SETTING_MATCH_H */
108

source code of include/libnm/nm-setting-match.h