PageRenderTime 105ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/headers/private/kernel/boot/net/RemoteDiskDefs.h

http://github.com/Barrett17/Haiku-services-branch
C Header | 64 lines | 28 code | 15 blank | 21 comment | 0 complexity | beeb959041b6d0015bd92abfa70e4c5c MD5 | raw file
Possible License(s): GPL-2.0, GPL-3.0, LGPL-2.0, LGPL-2.1, BSD-2-Clause, ISC, Apache-2.0, AGPL-1.0, MIT, MPL-2.0-no-copyleft-exception, Unlicense, BSD-3-Clause, LGPL-3.0
  1. /*
  2. * Copyright 2005-2007, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
  3. * All rights reserved. Distributed under the terms of the MIT License.
  4. */
  5. #ifndef _BOOT_REMOTE_DISK_DEFS_H
  6. #define _BOOT_REMOTE_DISK_DEFS_H
  7. #include <inttypes.h>
  8. enum {
  9. REMOTE_DISK_SERVER_PORT = 8765,
  10. REMOTE_DISK_BLOCK_SIZE = 1024,
  11. };
  12. enum {
  13. // requests
  14. REMOTE_DISK_HELLO_REQUEST = 0,
  15. // port: client port
  16. REMOTE_DISK_READ_REQUEST = 1,
  17. // port: client port
  18. // offset: byte offset of data to read
  19. // size: number of bytes to read (server might serve more, though)
  20. REMOTE_DISK_WRITE_REQUEST = 2,
  21. // port: client port
  22. // offset: byte offset of data to write
  23. // size: number of bytes to write
  24. // data: the data
  25. // replies
  26. REMOTE_DISK_HELLO_REPLY = 3,
  27. // offset: disk size
  28. REMOTE_DISK_READ_REPLY = 4, // port unused
  29. // offset: byte offset of read data
  30. // size: number of bytes of data read; < 0 => error
  31. // data: read data
  32. REMOTE_DISK_WRITE_REPLY = 5, // port, data unused
  33. // offset: byte offset of data written
  34. // size: number of bytes of data written; < 0 => error
  35. };
  36. // errors
  37. enum {
  38. REMOTE_DISK_IO_ERROR = -1,
  39. REMOTE_DISK_BAD_REQUEST = -2,
  40. };
  41. struct remote_disk_header {
  42. uint64_t offset;
  43. uint64_t request_id;
  44. int16_t size;
  45. uint16_t port;
  46. uint8_t command;
  47. uint8_t data[0];
  48. } __attribute__ ((__packed__));
  49. #endif // _BOOT_REMOTE_DISK_DEFS_H