d561d0ad68
IP, and UDP, as well as a home brewn UDP based protocol, "remote disk", which provides random access to a single remote file/device. The Open Firmware flavored boot loader automatically initializes the net stack, searches for a remote disk, and tries to boot from it, if the boot device is a network device (e.g. when loading the boot loader via TFTP). This is quite nice for developing with a two-machine setup, since one doesn't even need to install Haiku on the test machine anymore, but can serve it directly from the development machine. When the networking support in the kernel is working, this method could even be used to fully boot, not just for loading kernel and initial modules. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15689 a95241bf-73f2-0310-859d-f6bbb57e9c96
56 lines
1.3 KiB
C++
56 lines
1.3 KiB
C++
/*
|
|
* Copyright 2005, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
|
|
* All rights reserved. Distributed under the terms of the MIT License.
|
|
*/
|
|
|
|
#ifndef _BOOT_NET_STACK_H
|
|
#define _BOOT_NET_STACK_H
|
|
|
|
#include <SupportDefs.h>
|
|
|
|
class EthernetInterface;
|
|
class EthernetService;
|
|
class ARPService;
|
|
class IPService;
|
|
class UDPService;
|
|
|
|
|
|
class NetStack {
|
|
private:
|
|
NetStack();
|
|
~NetStack();
|
|
|
|
status_t Init();
|
|
|
|
public:
|
|
static status_t CreateDefault();
|
|
static NetStack *Default();
|
|
|
|
status_t AddEthernetInterface(EthernetInterface *interface);
|
|
|
|
EthernetInterface *GetEthernetInterface() const
|
|
{ return fEthernetInterface; }
|
|
EthernetService *GetEthernetService() const { return fEthernetService; }
|
|
ARPService *GetARPService() const { return fARPService; }
|
|
IPService *GetIPService() const { return fIPService; }
|
|
UDPService *GetUDPService() const { return fUDPService; }
|
|
|
|
private:
|
|
static NetStack *sNetStack;
|
|
|
|
EthernetInterface *fEthernetInterface;
|
|
EthernetService *fEthernetService;
|
|
ARPService *fARPService;
|
|
IPService *fIPService;
|
|
UDPService *fUDPService;
|
|
};
|
|
|
|
|
|
// net_stack_init() creates the NetStack and calls platform_net_stack_init()
|
|
// afterwards, which is supposed to add network interfaces.
|
|
status_t net_stack_init();
|
|
status_t platform_net_stack_init();
|
|
|
|
|
|
#endif // _BOOT_NET_STACK_H
|