Sony PlayStation2 Study
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

172 lines
2.7 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /**
  2. * @file
  3. * PS2IP RPC definitions
  4. * This header conflicts with fileXio.h
  5. */
  6. #ifndef __PS2IP_RPC_H__
  7. #define __PS2IP_RPC_H__
  8. #include <tamtypes.h>
  9. #include <tcpip.h>
  10. #include <sys/time.h>
  11. #define PS2IP_IRX 0xB0125F2
  12. enum PS2IPS_RPC_ID{
  13. PS2IPS_ID_ACCEPT = 1,
  14. PS2IPS_ID_BIND,
  15. PS2IPS_ID_DISCONNECT,
  16. PS2IPS_ID_CONNECT,
  17. PS2IPS_ID_LISTEN,
  18. PS2IPS_ID_RECV,
  19. PS2IPS_ID_RECVFROM,
  20. PS2IPS_ID_SEND,
  21. PS2IPS_ID_SENDTO,
  22. PS2IPS_ID_SOCKET,
  23. PS2IPS_ID_SETCONFIG,
  24. PS2IPS_ID_GETCONFIG,
  25. PS2IPS_ID_SELECT,
  26. PS2IPS_ID_IOCTL,
  27. PS2IPS_ID_GETSOCKNAME,
  28. PS2IPS_ID_GETPEERNAME,
  29. PS2IPS_ID_GETSOCKOPT,
  30. PS2IPS_ID_SETSOCKOPT,
  31. PS2IPS_ID_GETHOSTBYNAME,
  32. #ifdef PS2IP_DNS
  33. /* Not implemented:
  34. gethostbyname_r -> Redudant because it gets called over the RPC.
  35. freeaddrinfo -> too complicated and probably nobody uses it?
  36. getaddrinfo -> too complicated and probably nobody uses it? */
  37. PS2IPS_ID_DNS_SETSERVER,
  38. PS2IPS_ID_DNS_GETSERVER,
  39. #endif
  40. PS2IPS_ID_COUNT
  41. };
  42. typedef struct {
  43. s32 domain;
  44. s32 type;
  45. s32 protocol;
  46. } socket_pkt;
  47. typedef struct {
  48. s32 ssize;
  49. s32 esize;
  50. u8 *sbuf;
  51. u8 *ebuf;
  52. u8 sbuffer[64];
  53. u8 ebuffer[64];
  54. } rests_pkt;
  55. typedef struct {
  56. s32 socket;
  57. s32 length;
  58. s32 flags;
  59. void *ee_addr;
  60. struct sockaddr sockaddr; // sizeof = 16
  61. s32 malign;
  62. /** buffer for sending misaligned portion */
  63. u8 malign_buff[64];
  64. } send_pkt;
  65. typedef struct {
  66. s32 socket;
  67. s32 length;
  68. s32 flags;
  69. void *ee_addr;
  70. void *intr_data;
  71. } s_recv_pkt;
  72. typedef struct {
  73. s32 ret;
  74. struct sockaddr sockaddr;
  75. } r_recv_pkt;
  76. typedef struct {
  77. s32 socket;
  78. struct sockaddr sockaddr;
  79. s32 len;
  80. } cmd_pkt;
  81. typedef struct {
  82. s32 retval;
  83. struct sockaddr sockaddr;
  84. } ret_pkt;
  85. typedef struct {
  86. s32 s;
  87. s32 backlog;
  88. } listen_pkt;
  89. typedef struct {
  90. s32 s;
  91. s32 level;
  92. s32 optname;
  93. } getsockopt_pkt;
  94. typedef struct {
  95. s32 result;
  96. s32 optlen;
  97. u8 buffer[128];
  98. } getsockopt_res_pkt;
  99. typedef struct {
  100. s32 s;
  101. s32 level;
  102. s32 optname;
  103. s32 optlen;
  104. u8 buffer[128];
  105. } setsockopt_pkt;
  106. typedef struct {
  107. union {
  108. s32 maxfdp1;
  109. s32 result;
  110. };
  111. struct timeval *timeout_p;
  112. struct timeval timeout;
  113. struct fd_set *readset_p;
  114. struct fd_set *writeset_p;
  115. struct fd_set *exceptset_p;
  116. struct fd_set readset;
  117. struct fd_set writeset;
  118. struct fd_set exceptset;
  119. } select_pkt;
  120. typedef struct {
  121. union {
  122. s32 s;
  123. s32 result;
  124. };
  125. u32 cmd;
  126. void *argp;
  127. u32 value;
  128. } ioctl_pkt;
  129. #ifdef PS2IP_DNS
  130. struct hostent_res{
  131. s16 h_addrtype;
  132. s16 h_length;
  133. ip_addr_t h_addr;
  134. };
  135. typedef struct {
  136. s32 result;
  137. struct hostent_res hostent;
  138. } gethostbyname_res_pkt;
  139. typedef struct {
  140. ip_addr_t dnsserver;
  141. u8 numdns;
  142. } dns_setserver_pkt;
  143. typedef struct {
  144. ip_addr_t dnsserver;
  145. } dns_getserver_res_pkt;
  146. #endif
  147. #endif /* __PS2IP_RPC_H__ */