|
@@ -13,8 +13,7 @@ static int test_dhcp_aoe_boot ( struct net_device *netdev,
|
13
|
13
|
return test_aoeboot ( netdev, aoename, drivenum );
|
14
|
14
|
}
|
15
|
15
|
|
16
|
|
-static int test_dhcp_iscsi_boot ( struct net_device *netdev __unused,
|
17
|
|
- char *iscsiname ) {
|
|
16
|
+static int test_dhcp_iscsi_boot ( char *iscsiname ) {
|
18
|
17
|
char *initiator_iqn = "iqn.1900-01.localdomain.localhost:initiator";
|
19
|
18
|
char *target_iqn;
|
20
|
19
|
union {
|
|
@@ -36,11 +35,35 @@ static int test_dhcp_iscsi_boot ( struct net_device *netdev __unused,
|
36
|
35
|
return test_iscsiboot ( initiator_iqn, &target.st, target_iqn );
|
37
|
36
|
}
|
38
|
37
|
|
|
38
|
+static int test_dhcp_hello ( char *helloname ) {
|
|
39
|
+ char *message;
|
|
40
|
+ union {
|
|
41
|
+ struct sockaddr_in sin;
|
|
42
|
+ struct sockaddr_tcpip st;
|
|
43
|
+ } target;
|
|
44
|
+
|
|
45
|
+ memset ( &target, 0, sizeof ( target ) );
|
|
46
|
+ target.sin.sin_family = AF_INET;
|
|
47
|
+ target.sin.sin_port = htons ( 80 );
|
|
48
|
+ message = strchr ( helloname, ':' );
|
|
49
|
+ *message++ = '\0';
|
|
50
|
+ if ( ! message ) {
|
|
51
|
+ printf ( "Invalid hello path\n" );
|
|
52
|
+ return -EINVAL;
|
|
53
|
+ }
|
|
54
|
+ inet_aton ( helloname, &target.sin.sin_addr );
|
|
55
|
+
|
|
56
|
+ test_hello ( &target.st, message );
|
|
57
|
+ return 0;
|
|
58
|
+}
|
|
59
|
+
|
39
|
60
|
static int test_dhcp_boot ( struct net_device *netdev, char *filename ) {
|
40
|
61
|
if ( strncmp ( filename, "aoe:", 4 ) == 0 ) {
|
41
|
62
|
return test_dhcp_aoe_boot ( netdev, &filename[4] );
|
42
|
63
|
} else if ( strncmp ( filename, "iscsi:", 6 ) == 0 ) {
|
43
|
|
- return test_dhcp_iscsi_boot ( netdev, &filename[6] );
|
|
64
|
+ return test_dhcp_iscsi_boot ( &filename[6] );
|
|
65
|
+ } else if ( strncmp ( filename, "hello:", 6 ) == 0 ) {
|
|
66
|
+ return test_dhcp_hello ( &filename[6] );
|
44
|
67
|
} else {
|
45
|
68
|
printf ( "Don't know how to boot %s\n", filename );
|
46
|
69
|
return -EPROTONOSUPPORT;
|