|
@@ -123,7 +123,7 @@ find_or_build_config_setting ( const char *name,
|
123
|
123
|
* @v name Configuration setting name
|
124
|
124
|
* @v buf Buffer to contain value
|
125
|
125
|
* @v len Length of buffer
|
126
|
|
- * @ret rc Return status code
|
|
126
|
+ * @ret len Length of formatted value, or negative error
|
127
|
127
|
*/
|
128
|
128
|
int show_named_setting ( struct config_context *context, const char *name,
|
129
|
129
|
char *buf, size_t len ) {
|
|
@@ -180,7 +180,7 @@ int set_setting ( struct config_context *context,
|
180
|
180
|
* @v setting Configuration setting
|
181
|
181
|
* @v buf Buffer to contain value
|
182
|
182
|
* @v len Length of buffer
|
183
|
|
- * @ret rc Return status code
|
|
183
|
+ * @ret len Length of formatted value, or negative error
|
184
|
184
|
*/
|
185
|
185
|
static int show_string ( struct config_context *context,
|
186
|
186
|
struct config_setting *setting,
|
|
@@ -190,8 +190,7 @@ static int show_string ( struct config_context *context,
|
190
|
190
|
option = find_dhcp_option ( context->options, setting->tag );
|
191
|
191
|
if ( ! option )
|
192
|
192
|
return -ENODATA;
|
193
|
|
- dhcp_snprintf ( buf, len, option );
|
194
|
|
- return 0;
|
|
193
|
+ return dhcp_snprintf ( buf, len, option );
|
195
|
194
|
}
|
196
|
195
|
|
197
|
196
|
/**
|
|
@@ -229,7 +228,7 @@ struct config_setting_type config_setting_type_string __config_setting_type = {
|
229
|
228
|
* @v setting Configuration setting
|
230
|
229
|
* @v buf Buffer to contain value
|
231
|
230
|
* @v len Length of buffer
|
232
|
|
- * @ret rc Return status code
|
|
231
|
+ * @ret len Length of formatted value, or negative error
|
233
|
232
|
*/
|
234
|
233
|
static int show_ipv4 ( struct config_context *context,
|
235
|
234
|
struct config_setting *setting,
|
|
@@ -241,8 +240,7 @@ static int show_ipv4 ( struct config_context *context,
|
241
|
240
|
if ( ! option )
|
242
|
241
|
return -ENODATA;
|
243
|
242
|
dhcp_ipv4_option ( option, &ipv4 );
|
244
|
|
- snprintf ( buf, len, inet_ntoa ( ipv4 ) );
|
245
|
|
- return 0;
|
|
243
|
+ return snprintf ( buf, len, inet_ntoa ( ipv4 ) );
|
246
|
244
|
}
|
247
|
245
|
|
248
|
246
|
/**
|
|
@@ -283,7 +281,7 @@ struct config_setting_type config_setting_type_ipv4 __config_setting_type = {
|
283
|
281
|
* @v setting Configuration setting
|
284
|
282
|
* @v buf Buffer to contain value
|
285
|
283
|
* @v len Length of buffer
|
286
|
|
- * @ret rc Return status code
|
|
284
|
+ * @ret len Length of formatted value, or negative error
|
287
|
285
|
*/
|
288
|
286
|
static int show_int ( struct config_context *context,
|
289
|
287
|
struct config_setting *setting,
|
|
@@ -295,8 +293,7 @@ static int show_int ( struct config_context *context,
|
295
|
293
|
if ( ! option )
|
296
|
294
|
return -ENODATA;
|
297
|
295
|
num = dhcp_num_option ( option );
|
298
|
|
- snprintf ( buf, len, "%ld", num );
|
299
|
|
- return 0;
|
|
296
|
+ return snprintf ( buf, len, "%ld", num );
|
300
|
297
|
}
|
301
|
298
|
|
302
|
299
|
/**
|