| 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 | |
| 15 | G_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 | |
| 34 | typedef struct _NMSettingMatchClass NMSettingMatchClass; |
| 35 | |
| 36 | NM_AVAILABLE_IN_1_14 |
| 37 | GType nm_setting_match_get_type(void); |
| 38 | NM_AVAILABLE_IN_1_32 |
| 39 | NMSetting *nm_setting_match_new(void); |
| 40 | |
| 41 | NM_AVAILABLE_IN_1_14 |
| 42 | guint nm_setting_match_get_num_interface_names(NMSettingMatch *setting); |
| 43 | NM_AVAILABLE_IN_1_14 |
| 44 | const char *nm_setting_match_get_interface_name(NMSettingMatch *setting, int idx); |
| 45 | NM_AVAILABLE_IN_1_14 |
| 46 | void nm_setting_match_remove_interface_name(NMSettingMatch *setting, int idx); |
| 47 | NM_AVAILABLE_IN_1_14 |
| 48 | gboolean nm_setting_match_remove_interface_name_by_value(NMSettingMatch *setting, |
| 49 | const char *interface_name); |
| 50 | NM_AVAILABLE_IN_1_14 |
| 51 | void nm_setting_match_add_interface_name(NMSettingMatch *setting, const char *interface_name); |
| 52 | NM_AVAILABLE_IN_1_14 |
| 53 | void nm_setting_match_clear_interface_names(NMSettingMatch *setting); |
| 54 | NM_AVAILABLE_IN_1_14 |
| 55 | const char *const *nm_setting_match_get_interface_names(NMSettingMatch *setting, guint *length); |
| 56 | |
| 57 | NM_AVAILABLE_IN_1_26 |
| 58 | guint nm_setting_match_get_num_kernel_command_lines(NMSettingMatch *setting); |
| 59 | NM_AVAILABLE_IN_1_26 |
| 60 | const char *nm_setting_match_get_kernel_command_line(NMSettingMatch *setting, guint idx); |
| 61 | NM_AVAILABLE_IN_1_26 |
| 62 | void nm_setting_match_remove_kernel_command_line(NMSettingMatch *setting, guint idx); |
| 63 | NM_AVAILABLE_IN_1_26 |
| 64 | gboolean nm_setting_match_remove_kernel_command_line_by_value(NMSettingMatch *setting, |
| 65 | const char *kernel_command_line); |
| 66 | NM_AVAILABLE_IN_1_26 |
| 67 | void nm_setting_match_add_kernel_command_line(NMSettingMatch *setting, |
| 68 | const char *kernel_command_line); |
| 69 | NM_AVAILABLE_IN_1_26 |
| 70 | void nm_setting_match_clear_kernel_command_lines(NMSettingMatch *setting); |
| 71 | NM_AVAILABLE_IN_1_26 |
| 72 | const char *const *nm_setting_match_get_kernel_command_lines(NMSettingMatch *setting, |
| 73 | guint *length); |
| 74 | |
| 75 | NM_AVAILABLE_IN_1_26 |
| 76 | guint nm_setting_match_get_num_drivers(NMSettingMatch *setting); |
| 77 | NM_AVAILABLE_IN_1_26 |
| 78 | const char *nm_setting_match_get_driver(NMSettingMatch *setting, guint idx); |
| 79 | NM_AVAILABLE_IN_1_26 |
| 80 | void nm_setting_match_remove_driver(NMSettingMatch *setting, guint idx); |
| 81 | NM_AVAILABLE_IN_1_26 |
| 82 | gboolean nm_setting_match_remove_driver_by_value(NMSettingMatch *setting, const char *driver); |
| 83 | NM_AVAILABLE_IN_1_26 |
| 84 | void nm_setting_match_add_driver(NMSettingMatch *setting, const char *driver); |
| 85 | NM_AVAILABLE_IN_1_26 |
| 86 | void nm_setting_match_clear_drivers(NMSettingMatch *setting); |
| 87 | NM_AVAILABLE_IN_1_26 |
| 88 | const char *const *nm_setting_match_get_drivers(NMSettingMatch *setting, guint *length); |
| 89 | |
| 90 | NM_AVAILABLE_IN_1_26 |
| 91 | guint nm_setting_match_get_num_paths(NMSettingMatch *setting); |
| 92 | NM_AVAILABLE_IN_1_26 |
| 93 | const char *nm_setting_match_get_path(NMSettingMatch *setting, guint idx); |
| 94 | NM_AVAILABLE_IN_1_26 |
| 95 | void nm_setting_match_remove_path(NMSettingMatch *setting, guint idx); |
| 96 | NM_AVAILABLE_IN_1_26 |
| 97 | gboolean nm_setting_match_remove_path_by_value(NMSettingMatch *setting, const char *path); |
| 98 | NM_AVAILABLE_IN_1_26 |
| 99 | void nm_setting_match_add_path(NMSettingMatch *setting, const char *path); |
| 100 | NM_AVAILABLE_IN_1_26 |
| 101 | void nm_setting_match_clear_paths(NMSettingMatch *setting); |
| 102 | NM_AVAILABLE_IN_1_26 |
| 103 | const char *const *nm_setting_match_get_paths(NMSettingMatch *setting, guint *length); |
| 104 | |
| 105 | G_END_DECLS |
| 106 | |
| 107 | #endif /* NM_SETTING_MATCH_H */ |
| 108 | |