Ticket #5240: tcp-test-1.diff

File tcp-test-1.diff, 1.3 KB (added by andreasf, 14 years ago)

test code for ppc

  • src/system/boot/platform/openfirmware/devices.cpp

    diff --git a/src/system/boot/platform/openfirmware/devices.cpp b/src/system/boot/platform/openfirmware/devices.cpp
    index 601ac50..706d379 100644
    a b  
    1212#include <boot/stage2.h>
    1313#include <boot/net/NetStack.h>
    1414#include <boot/net/RemoteDisk.h>
     15#include <boot/net/TCP.h>
    1516#include <platform/openfirmware/devices.h>
    1617#include <platform/openfirmware/openfirmware.h>
    1718#include <util/kernel_cpp.h>
     
    2223char sBootPath[192];
    2324
    2425
     26void myTest()
     27{
     28    TCPSocket socket;
     29    status_t error = socket.Connect(0x0A000304, 8888);
     30    if (error != B_OK) {
     31        printf("Connect fehlgeschlagen\n");
     32        of_exit();
     33        return;
     34    }
     35    printf("connected, closing socket...\n");
     36    error = socket.Close();
     37    if (error == B_OK)
     38        printf("TEST APPARENTLY SUCCESSFUL!\n");
     39    of_exit();
     40}
     41
    2542status_t
    2643platform_add_boot_device(struct stage2_args *args, NodeList *devicesList)
    2744{
    platform_add_boot_device(struct stage2_args *args, NodeList *devicesList)  
    4562            status_t error = net_stack_init();
    4663            if (error != B_OK)
    4764                return error;
    48        
     65
     66            myTest();
     67
    4968            // init a remote disk, if possible
    5069            RemoteDisk *remoteDisk = RemoteDisk::FindAnyRemoteDisk();
    5170            if (!remoteDisk)