1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301 USA.
19 * Copyright 2013 Red Hat, Inc.
22 #ifndef NM_SETTING_DCB_H
23 #define NM_SETTING_DCB_H
25 #include <nm-setting.h>
29 #define NM_TYPE_SETTING_DCB (nm_setting_dcb_get_type ())
30 #define NM_SETTING_DCB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_DCB, NMSettingDcb))
31 #define NM_SETTING_DCB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_DCB, NMSettingDcbClass))
32 #define NM_IS_SETTING_DCB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_DCB))
33 #define NM_IS_SETTING_DCB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SETTING_DCB))
34 #define NM_SETTING_DCB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_DCB, NMSettingDcbClass))
36 #define NM_SETTING_DCB_SETTING_NAME "dcb"
40 * @NM_SETTING_DCB_ERROR_UNKNOWN: unknown or unclassified error
41 * @NM_SETTING_DCB_ERROR_INVALID_PROPERTY: the property was invalid
42 * @NM_SETTING_DCB_ERROR_MISSING_PROPERTY: the property was missing and is
46 NM_SETTING_DCB_ERROR_UNKNOWN = 0, /*< nick=UnknownError >*/
47 NM_SETTING_DCB_ERROR_INVALID_PROPERTY, /*< nick=InvalidProperty >*/
48 NM_SETTING_DCB_ERROR_MISSING_PROPERTY /*< nick=MissingProperty >*/
51 #define NM_SETTING_DCB_ERROR nm_setting_dcb_error_quark ()
52 GQuark nm_setting_dcb_error_quark (void);
56 * @NM_SETTING_DCB_FLAG_NONE: no flag
57 * @NM_SETTING_DCB_FLAG_ENABLE: the feature is enabled
58 * @NM_SETTING_DCB_FLAG_ADVERTISE: the feature is advertised
59 * @NM_SETTING_DCB_FLAG_WILLING: the feature is willing to change based on
60 * peer configuration advertisements
67 NM_SETTING_DCB_FLAG_NONE = 0x00000000,
68 NM_SETTING_DCB_FLAG_ENABLE = 0x00000001,
69 NM_SETTING_DCB_FLAG_ADVERTISE = 0x00000002,
70 NM_SETTING_DCB_FLAG_WILLING = 0x00000004
74 * NM_SETTING_DCB_FCOE_MODE_FABRIC:
76 * Indicates that the FCoE controller should use "fabric" mode (default)
80 #define NM_SETTING_DCB_FCOE_MODE_FABRIC "fabric"
83 * NM_SETTING_DCB_FCOE_MODE_VN2VN:
85 * Indicates that the FCoE controller should use "VN2VN" mode.
89 #define NM_SETTING_DCB_FCOE_MODE_VN2VN "vn2vn"
93 #define NM_SETTING_DCB_APP_FCOE_FLAGS "app-fcoe-flags"
94 #define NM_SETTING_DCB_APP_FCOE_PRIORITY "app-fcoe-priority"
95 #define NM_SETTING_DCB_APP_FCOE_MODE "app-fcoe-mode"
97 #define NM_SETTING_DCB_APP_ISCSI_FLAGS "app-iscsi-flags"
98 #define NM_SETTING_DCB_APP_ISCSI_PRIORITY "app-iscsi-priority"
100 #define NM_SETTING_DCB_APP_FIP_FLAGS "app-fip-flags"
101 #define NM_SETTING_DCB_APP_FIP_PRIORITY "app-fip-priority"
103 #define NM_SETTING_DCB_PRIORITY_FLOW_CONTROL_FLAGS "priority-flow-control-flags"
104 #define NM_SETTING_DCB_PRIORITY_FLOW_CONTROL "priority-flow-control"
106 #define NM_SETTING_DCB_PRIORITY_GROUP_FLAGS "priority-group-flags"
107 #define NM_SETTING_DCB_PRIORITY_GROUP_ID "priority-group-id"
108 #define NM_SETTING_DCB_PRIORITY_GROUP_BANDWIDTH "priority-group-bandwidth"
109 #define NM_SETTING_DCB_PRIORITY_BANDWIDTH "priority-bandwidth"
110 #define NM_SETTING_DCB_PRIORITY_STRICT_BANDWIDTH "priority-strict-bandwidth"
111 #define NM_SETTING_DCB_PRIORITY_TRAFFIC_CLASS "priority-traffic-class"
119 NMSettingClass parent;
121 /* Padding for future expansion */
122 void (*_reserved1) (void);
123 void (*_reserved2) (void);
124 void (*_reserved3) (void);
125 void (*_reserved4) (void);
128 NM_AVAILABLE_IN_0_9_10
129 GType nm_setting_dcb_get_type (void);
131 NM_AVAILABLE_IN_0_9_10
132 NMSetting * nm_setting_dcb_new (void);
134 NMSettingDcbFlags nm_setting_dcb_get_app_fcoe_flags (NMSettingDcb *setting);
135 gint nm_setting_dcb_get_app_fcoe_priority (NMSettingDcb *setting);
136 const char * nm_setting_dcb_get_app_fcoe_mode (NMSettingDcb *setting);
138 NMSettingDcbFlags nm_setting_dcb_get_app_iscsi_flags (NMSettingDcb *setting);
139 gint nm_setting_dcb_get_app_iscsi_priority (NMSettingDcb *setting);
141 NMSettingDcbFlags nm_setting_dcb_get_app_fip_flags (NMSettingDcb *setting);
142 gint nm_setting_dcb_get_app_fip_priority (NMSettingDcb *setting);
144 /* Priority Flow Control */
145 NMSettingDcbFlags nm_setting_dcb_get_priority_flow_control_flags (NMSettingDcb *setting);
146 gboolean nm_setting_dcb_get_priority_flow_control (NMSettingDcb *setting,
147 guint user_priority);
148 void nm_setting_dcb_set_priority_flow_control (NMSettingDcb *setting,
152 /* Priority Groups */
153 NMSettingDcbFlags nm_setting_dcb_get_priority_group_flags (NMSettingDcb *setting);
155 guint nm_setting_dcb_get_priority_group_id (NMSettingDcb *setting,
156 guint user_priority);
157 void nm_setting_dcb_set_priority_group_id (NMSettingDcb *setting,
161 guint nm_setting_dcb_get_priority_group_bandwidth (NMSettingDcb *setting,
163 void nm_setting_dcb_set_priority_group_bandwidth (NMSettingDcb *setting,
165 guint bandwidth_percent);
167 guint nm_setting_dcb_get_priority_bandwidth (NMSettingDcb *setting,
168 guint user_priority);
169 void nm_setting_dcb_set_priority_bandwidth (NMSettingDcb *setting,
171 guint bandwidth_percent);
173 gboolean nm_setting_dcb_get_priority_strict_bandwidth (NMSettingDcb *setting,
174 guint user_priority);
175 void nm_setting_dcb_set_priority_strict_bandwidth (NMSettingDcb *setting,
179 guint nm_setting_dcb_get_priority_traffic_class (NMSettingDcb *setting,
180 guint user_priority);
181 void nm_setting_dcb_set_priority_traffic_class (NMSettingDcb *setting,
183 guint traffic_class);
187 #endif /* NM_SETTING_DCB_H */