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 #if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION)
26 #error "Only <NetworkManager.h> can be included directly."
29 #include <nm-setting.h>
33 #define NM_TYPE_SETTING_DCB (nm_setting_dcb_get_type ())
34 #define NM_SETTING_DCB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_DCB, NMSettingDcb))
35 #define NM_SETTING_DCB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_DCB, NMSettingDcbClass))
36 #define NM_IS_SETTING_DCB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_DCB))
37 #define NM_IS_SETTING_DCB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SETTING_DCB))
38 #define NM_SETTING_DCB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_DCB, NMSettingDcbClass))
40 #define NM_SETTING_DCB_SETTING_NAME "dcb"
44 * @NM_SETTING_DCB_FLAG_NONE: no flag
45 * @NM_SETTING_DCB_FLAG_ENABLE: the feature is enabled
46 * @NM_SETTING_DCB_FLAG_ADVERTISE: the feature is advertised
47 * @NM_SETTING_DCB_FLAG_WILLING: the feature is willing to change based on
48 * peer configuration advertisements
52 typedef enum { /*< flags >*/
53 NM_SETTING_DCB_FLAG_NONE = 0x00000000,
54 NM_SETTING_DCB_FLAG_ENABLE = 0x00000001,
55 NM_SETTING_DCB_FLAG_ADVERTISE = 0x00000002,
56 NM_SETTING_DCB_FLAG_WILLING = 0x00000004
60 * NM_SETTING_DCB_FCOE_MODE_FABRIC:
62 * Indicates that the FCoE controller should use "fabric" mode (default)
64 #define NM_SETTING_DCB_FCOE_MODE_FABRIC "fabric"
67 * NM_SETTING_DCB_FCOE_MODE_VN2VN:
69 * Indicates that the FCoE controller should use "VN2VN" mode.
71 #define NM_SETTING_DCB_FCOE_MODE_VN2VN "vn2vn"
75 #define NM_SETTING_DCB_APP_FCOE_FLAGS "app-fcoe-flags"
76 #define NM_SETTING_DCB_APP_FCOE_PRIORITY "app-fcoe-priority"
77 #define NM_SETTING_DCB_APP_FCOE_MODE "app-fcoe-mode"
79 #define NM_SETTING_DCB_APP_ISCSI_FLAGS "app-iscsi-flags"
80 #define NM_SETTING_DCB_APP_ISCSI_PRIORITY "app-iscsi-priority"
82 #define NM_SETTING_DCB_APP_FIP_FLAGS "app-fip-flags"
83 #define NM_SETTING_DCB_APP_FIP_PRIORITY "app-fip-priority"
85 #define NM_SETTING_DCB_PRIORITY_FLOW_CONTROL_FLAGS "priority-flow-control-flags"
86 #define NM_SETTING_DCB_PRIORITY_FLOW_CONTROL "priority-flow-control"
88 #define NM_SETTING_DCB_PRIORITY_GROUP_FLAGS "priority-group-flags"
89 #define NM_SETTING_DCB_PRIORITY_GROUP_ID "priority-group-id"
90 #define NM_SETTING_DCB_PRIORITY_GROUP_BANDWIDTH "priority-group-bandwidth"
91 #define NM_SETTING_DCB_PRIORITY_BANDWIDTH "priority-bandwidth"
92 #define NM_SETTING_DCB_PRIORITY_STRICT_BANDWIDTH "priority-strict-bandwidth"
93 #define NM_SETTING_DCB_PRIORITY_TRAFFIC_CLASS "priority-traffic-class"
96 struct _NMSettingDcb {
101 NMSettingClass parent;
107 GType nm_setting_dcb_get_type (void);
109 NMSetting * nm_setting_dcb_new (void);
111 NMSettingDcbFlags nm_setting_dcb_get_app_fcoe_flags (NMSettingDcb *setting);
112 gint nm_setting_dcb_get_app_fcoe_priority (NMSettingDcb *setting);
113 const char * nm_setting_dcb_get_app_fcoe_mode (NMSettingDcb *setting);
115 NMSettingDcbFlags nm_setting_dcb_get_app_iscsi_flags (NMSettingDcb *setting);
116 gint nm_setting_dcb_get_app_iscsi_priority (NMSettingDcb *setting);
118 NMSettingDcbFlags nm_setting_dcb_get_app_fip_flags (NMSettingDcb *setting);
119 gint nm_setting_dcb_get_app_fip_priority (NMSettingDcb *setting);
121 /* Priority Flow Control */
122 NMSettingDcbFlags nm_setting_dcb_get_priority_flow_control_flags (NMSettingDcb *setting);
123 gboolean nm_setting_dcb_get_priority_flow_control (NMSettingDcb *setting,
124 guint user_priority);
125 void nm_setting_dcb_set_priority_flow_control (NMSettingDcb *setting,
129 /* Priority Groups */
130 NMSettingDcbFlags nm_setting_dcb_get_priority_group_flags (NMSettingDcb *setting);
132 guint nm_setting_dcb_get_priority_group_id (NMSettingDcb *setting,
133 guint user_priority);
134 void nm_setting_dcb_set_priority_group_id (NMSettingDcb *setting,
138 guint nm_setting_dcb_get_priority_group_bandwidth (NMSettingDcb *setting,
140 void nm_setting_dcb_set_priority_group_bandwidth (NMSettingDcb *setting,
142 guint bandwidth_percent);
144 guint nm_setting_dcb_get_priority_bandwidth (NMSettingDcb *setting,
145 guint user_priority);
146 void nm_setting_dcb_set_priority_bandwidth (NMSettingDcb *setting,
148 guint bandwidth_percent);
150 gboolean nm_setting_dcb_get_priority_strict_bandwidth (NMSettingDcb *setting,
151 guint user_priority);
152 void nm_setting_dcb_set_priority_strict_bandwidth (NMSettingDcb *setting,
156 guint nm_setting_dcb_get_priority_traffic_class (NMSettingDcb *setting,
157 guint user_priority);
158 void nm_setting_dcb_set_priority_traffic_class (NMSettingDcb *setting,
160 guint traffic_class);
164 #endif /* __NM_SETTING_DCB_H__ */