* @v name Configuration setting name
* @v buf Buffer to contain value
* @v len Length of buffer
- * @ret rc Return status code
+ * @ret len Length of formatted value, or negative error
*/
int show_named_setting ( struct config_context *context, const char *name,
char *buf, size_t len ) {
* @v setting Configuration setting
* @v buf Buffer to contain value
* @v len Length of buffer
- * @ret rc Return status code
+ * @ret len Length of formatted value, or negative error
*/
static int show_string ( struct config_context *context,
struct config_setting *setting,
option = find_dhcp_option ( context->options, setting->tag );
if ( ! option )
return -ENODATA;
- dhcp_snprintf ( buf, len, option );
- return 0;
+ return dhcp_snprintf ( buf, len, option );
}
/**
* @v setting Configuration setting
* @v buf Buffer to contain value
* @v len Length of buffer
- * @ret rc Return status code
+ * @ret len Length of formatted value, or negative error
*/
static int show_ipv4 ( struct config_context *context,
struct config_setting *setting,
if ( ! option )
return -ENODATA;
dhcp_ipv4_option ( option, &ipv4 );
- snprintf ( buf, len, inet_ntoa ( ipv4 ) );
- return 0;
+ return snprintf ( buf, len, inet_ntoa ( ipv4 ) );
}
/**
* @v setting Configuration setting
* @v buf Buffer to contain value
* @v len Length of buffer
- * @ret rc Return status code
+ * @ret len Length of formatted value, or negative error
*/
static int show_int ( struct config_context *context,
struct config_setting *setting,
if ( ! option )
return -ENODATA;
num = dhcp_num_option ( option );
- snprintf ( buf, len, "%ld", num );
- return 0;
+ return snprintf ( buf, len, "%ld", num );
}
/**