2 * Copyright 2005-2007, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
3 * All rights reserved. Distributed under the terms of the MIT License.
5 #ifndef _BOOT_REMOTE_DISK_H
6 #define _BOOT_REMOTE_DISK_H
8 #include <netinet/in.h>
10 #include <SupportDefs.h>
12 #include <boot/net/RemoteDiskDefs.h>
20 status_t
Init(uint32 serverAddress
, uint16 serverPort
,
23 status_t
FindAnyRemoteDisk();
25 ssize_t
ReadAt(off_t pos
, void *buffer
,
27 ssize_t
WriteAt(off_t pos
, const void *buffer
,
31 { return fImageSize
; }
33 bool IsReadOnly() const
36 // uint32 ServerIPAddress() const
37 // { return fServerAddress; }
38 // uint16 ServerPort() const
39 // { return fServerPort; }
44 ssize_t
_ReadFromPacket(off_t
& pos
, uint8
*& buffer
,
47 status_t
_SendRequest(remote_disk_header
*request
,
48 size_t size
, uint8 expectedReply
,
49 sockaddr_in
* peerAddress
= NULL
);
50 status_t
_SendRequest(remote_disk_header
*request
,
51 size_t size
, uint8 expectedReply
,
52 sockaddr_in
* peerAddress
,
54 size_t receiveBufferSize
,
55 int32
* bytesReceived
);
58 sockaddr_in fSocketAddress
;
59 sockaddr_in fServerAddress
;
67 #endif // _BOOT_REMOTE_DISK_H