|
@@ -115,7 +115,8 @@ find_or_build_config_setting ( const char *name,
|
115
|
115
|
return setting;
|
116
|
116
|
}
|
117
|
117
|
|
118
|
|
-/** Show value of setting
|
|
118
|
+/**
|
|
119
|
+ * Show value of setting
|
119
|
120
|
*
|
120
|
121
|
* @v context Configuration context
|
121
|
122
|
* @v name Configuration setting name
|
|
@@ -134,7 +135,8 @@ int show_setting ( struct config_context *context, const char *name,
|
134
|
135
|
return setting->type->show ( context, setting, buf, len );
|
135
|
136
|
}
|
136
|
137
|
|
137
|
|
-/** Set value of setting
|
|
138
|
+/**
|
|
139
|
+ * Set value of setting
|
138
|
140
|
*
|
139
|
141
|
* @v context Configuration context
|
140
|
142
|
* @v name Configuration setting name
|
|
@@ -152,6 +154,27 @@ int set_setting ( struct config_context *context, const char *name,
|
152
|
154
|
return setting->type->set ( context, setting, value );
|
153
|
155
|
}
|
154
|
156
|
|
|
157
|
+/**
|
|
158
|
+ * Clear setting
|
|
159
|
+ *
|
|
160
|
+ * @v context Configuration context
|
|
161
|
+ * @v name Configuration setting name
|
|
162
|
+ * @ret rc Return status code
|
|
163
|
+ */
|
|
164
|
+int clear_setting ( struct config_context *context, const char *name ) {
|
|
165
|
+ struct config_setting *setting;
|
|
166
|
+ struct config_setting tmp_setting;
|
|
167
|
+
|
|
168
|
+ setting = find_or_build_config_setting ( name, &tmp_setting );
|
|
169
|
+ if ( ! setting )
|
|
170
|
+ return -ENOENT;
|
|
171
|
+
|
|
172
|
+ /* All types of settings get cleared the same way */
|
|
173
|
+ delete_dhcp_option ( context->options, setting->tag );
|
|
174
|
+
|
|
175
|
+ return 0;
|
|
176
|
+}
|
|
177
|
+
|
155
|
178
|
/**
|
156
|
179
|
* Show value of string setting
|
157
|
180
|
*
|