Create "username" and "password" DHCP options, ready for placing this
information in NVS.
This commit is contained in:
parent
3f0b4d9ed8
commit
74c41fac06
|
@ -167,6 +167,24 @@
|
||||||
*/
|
*/
|
||||||
#define DHCP_EB_BIOS_DRIVE DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xbd )
|
#define DHCP_EB_BIOS_DRIVE DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xbd )
|
||||||
|
|
||||||
|
/** Username
|
||||||
|
*
|
||||||
|
* This will be used as the username for any required authentication.
|
||||||
|
* It is expected that this option's value will be held in
|
||||||
|
* non-volatile storage, rather than transmitted as part of a DHCP
|
||||||
|
* packet.
|
||||||
|
*/
|
||||||
|
#define DHCP_EB_USERNAME DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xbe )
|
||||||
|
|
||||||
|
/** Password
|
||||||
|
*
|
||||||
|
* This will be used as the password for any required authentication.
|
||||||
|
* It is expected that this option's value will be held in
|
||||||
|
* non-volatile storage, rather than transmitted as part of a DHCP
|
||||||
|
* packet.
|
||||||
|
*/
|
||||||
|
#define DHCP_EB_PASSWORD DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0xbf )
|
||||||
|
|
||||||
/** Maximum normal DHCP option */
|
/** Maximum normal DHCP option */
|
||||||
#define DHCP_MAX_OPTION 254
|
#define DHCP_MAX_OPTION 254
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,8 @@ static int test_dhcp_aoe_boot ( struct net_device *netdev,
|
||||||
|
|
||||||
static int test_dhcp_iscsi_boot ( struct net_device *netdev, char *iscsiname ) {
|
static int test_dhcp_iscsi_boot ( struct net_device *netdev, char *iscsiname ) {
|
||||||
char *initiator_iqn = "iqn.1900-01.localdomain.localhost:initiator";
|
char *initiator_iqn = "iqn.1900-01.localdomain.localhost:initiator";
|
||||||
char *username = "joe";
|
char username[32];
|
||||||
char *password = "secret";
|
char password[32];
|
||||||
char *target_iqn;
|
char *target_iqn;
|
||||||
union {
|
union {
|
||||||
struct sockaddr_in sin;
|
struct sockaddr_in sin;
|
||||||
|
@ -35,6 +35,11 @@ static int test_dhcp_iscsi_boot ( struct net_device *netdev, char *iscsiname ) {
|
||||||
}
|
}
|
||||||
inet_aton ( iscsiname, &target.sin.sin_addr );
|
inet_aton ( iscsiname, &target.sin.sin_addr );
|
||||||
|
|
||||||
|
dhcp_snprintf ( username, sizeof ( username ),
|
||||||
|
find_global_dhcp_option ( DHCP_EB_USERNAME ) );
|
||||||
|
dhcp_snprintf ( password, sizeof ( password ),
|
||||||
|
find_global_dhcp_option ( DHCP_EB_PASSWORD ) );
|
||||||
|
|
||||||
return test_iscsiboot ( initiator_iqn, &target.st, target_iqn,
|
return test_iscsiboot ( initiator_iqn, &target.st, target_iqn,
|
||||||
username, password, netdev );
|
username, password, netdev );
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue