david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

Add block identification to debug messages

This commit is contained in:
Michael Brown 2006-07-19 17:58:27 +00:00
parent 6d9d48537e
commit 3369f93036
1 changed files with 12 additions and 8 deletions

View File

@ -153,8 +153,9 @@ find_dhcp_option_with_encap ( struct dhcp_option_block *options,
break; break;
/* Check for matching tag */ /* Check for matching tag */
if ( option->tag == tag ) { if ( option->tag == tag ) {
DBG ( "Found DHCP option %s (length %d)\n", DBG ( "Found DHCP option %s (length %d) in block %p\n",
dhcp_tag_name ( original_tag ), option->len ); dhcp_tag_name ( original_tag ), option->len,
options );
return option; return option;
} }
/* Check for explicit end marker */ /* Check for explicit end marker */
@ -221,8 +222,8 @@ void register_dhcp_options ( struct dhcp_option_block *options ) {
/* Determine priority of new block */ /* Determine priority of new block */
options->priority = find_dhcp_num_option ( options, DHCP_EB_PRIORITY ); options->priority = find_dhcp_num_option ( options, DHCP_EB_PRIORITY );
DBG ( "Registering DHCP options block with priority %d\n", DBG ( "Registering DHCP options block %p with priority %d\n",
options->priority ); options, options->priority );
/* Insert after any existing blocks which have a higher priority */ /* Insert after any existing blocks which have a higher priority */
list_for_each_entry ( existing, &option_blocks, list ) { list_for_each_entry ( existing, &option_blocks, list ) {
@ -260,6 +261,9 @@ void init_dhcp_options ( struct dhcp_option_block *options,
option = options->data; option = options->data;
option->tag = DHCP_END; option->tag = DHCP_END;
options->len = 1; options->len = 1;
DBG ( "DHCP options block %p initialised (data %p max_len %#zx)\n",
options, options->data, options->max_len );
} }
/** /**
@ -365,12 +369,12 @@ struct dhcp_option * set_dhcp_option ( struct dhcp_option_block *options,
option = find_dhcp_option_with_encap ( options, tag, &encapsulator ); option = find_dhcp_option_with_encap ( options, tag, &encapsulator );
if ( option ) { if ( option ) {
old_len = dhcp_option_len ( option ); old_len = dhcp_option_len ( option );
DBG ( "Resizing DHCP option %s from length %d to %d\n", DBG ( "Resizing DHCP option %s from length %d to %d in block "
dhcp_tag_name ( tag ), option->len, len ); "%p\n", dhcp_tag_name (tag), option->len, len, options );
} else { } else {
old_len = 0; old_len = 0;
DBG ( "Creating DHCP option %s (length %d)\n", DBG ( "Creating DHCP option %s (length %d) in block %p\n",
dhcp_tag_name ( tag ), new_len ); dhcp_tag_name ( tag ), len, options );
} }
/* Ensure that encapsulator exists, if required */ /* Ensure that encapsulator exists, if required */