struct in_addr netmask_addr = { 0 };
unsigned int netmask_count = 0;
struct settings *parent = netdev_settings ( netdev );
+ struct settings *origin;
int rc;
/* Fill in common header */
nic->header.flags = ( IBFT_FL_NIC_BLOCK_VALID |
IBFT_FL_NIC_FIRMWARE_BOOT_SELECTED );
+ /* Determine origin of IP address */
+ fetch_setting ( parent, &ip_setting, &origin, NULL, NULL, 0 );
+ nic->origin = ( ( origin == parent ) ?
+ IBFT_NIC_ORIGIN_MANUAL : IBFT_NIC_ORIGIN_DHCP );
+ DBG ( "iBFT NIC origin = %d\n", nic->origin );
+
/* Extract values from configuration settings */
ibft_set_ipaddr_setting ( parent, &nic->ip_address, &ip_setting, 1 );
DBG ( "iBFT NIC IP = %s\n", ibft_ipaddr ( &nic->ip_address ) );
/** NIC global / link local */
#define IBFT_FL_NIC_GLOBAL 0x04
+/** NIC IP address origin */
+#define IBFT_NIC_ORIGIN_OTHER 0x00
+#define IBFT_NIC_ORIGIN_MANUAL 0x01
+#define IBFT_NIC_ORIGIN_WELLKNOWN 0x02
+#define IBFT_NIC_ORIGIN_DHCP 0x03
+#define IBFT_NIC_ORIGIN_RA 0x04
+#define IBFT_NIC_ORIGIN_UNCHANGED 0x0f
+
/**
* iBFT Target structure
*