PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
ps2ip_rpc.h
Go to the documentation of this file.
1
7#ifndef __PS2IP_RPC_H__
8#define __PS2IP_RPC_H__
9
10#include <tamtypes.h>
11#include <tcpip.h>
12#include <sys/time.h>
13
14#define PS2IP_IRX 0xB0125F2
15
16enum PS2IPS_RPC_ID {
17 PS2IPS_ID_ACCEPT = 1,
18 PS2IPS_ID_BIND,
19 PS2IPS_ID_DISCONNECT,
20 PS2IPS_ID_CONNECT,
21 PS2IPS_ID_LISTEN,
22 PS2IPS_ID_RECV,
23 PS2IPS_ID_RECVFROM,
24 PS2IPS_ID_SEND,
25 PS2IPS_ID_SENDTO,
26 PS2IPS_ID_SOCKET,
27 PS2IPS_ID_SETCONFIG,
28 PS2IPS_ID_GETCONFIG,
29 PS2IPS_ID_SELECT,
30 PS2IPS_ID_IOCTL,
31 PS2IPS_ID_GETSOCKNAME,
32 PS2IPS_ID_GETPEERNAME,
33 PS2IPS_ID_GETSOCKOPT,
34 PS2IPS_ID_SETSOCKOPT,
35 PS2IPS_ID_GETHOSTBYNAME,
36#ifdef PS2IP_DNS
37 /* Not implemented:
38 gethostbyname_r -> Redudant because it gets called over the RPC.
39 freeaddrinfo -> too complicated and probably nobody uses it?
40 getaddrinfo -> too complicated and probably nobody uses it? */
41
42 PS2IPS_ID_DNS_SETSERVER,
43 PS2IPS_ID_DNS_GETSERVER,
44#endif
45
46 PS2IPS_ID_COUNT
47};
48
49typedef struct
50{
51 s32 domain;
52 s32 type;
53 s32 protocol;
55
56typedef struct
57{
58 s32 ssize;
59 s32 esize;
60 u8 *sbuf;
61 u8 *ebuf;
62 u8 sbuffer[64];
63 u8 ebuffer[64];
64} rests_pkt;
65
66typedef struct
67{
68 s32 socket;
69 s32 length;
70 s32 flags;
71 void *ee_addr;
72 struct sockaddr sockaddr; // sizeof = 16
73 s32 malign;
75 u8 malign_buff[64];
76} send_pkt;
77
78typedef struct
79{
80 s32 socket;
81 s32 length;
82 s32 flags;
83 void *ee_addr;
84 void *intr_data;
86
87typedef struct
88{
89 s32 ret;
90 struct sockaddr sockaddr;
92
93typedef struct
94{
95 s32 socket;
96 struct sockaddr sockaddr;
97 s32 len;
98} cmd_pkt;
99
100typedef struct
101{
102 s32 retval;
103 struct sockaddr sockaddr;
104} ret_pkt;
105
106typedef struct
107{
108 s32 s;
109 s32 backlog;
110} listen_pkt;
111
112typedef struct
113{
114 s32 s;
115 s32 level;
116 s32 optname;
118
119typedef struct
120{
121 s32 result;
122 s32 optlen;
123 u8 buffer[128];
125
126typedef struct
127{
128 s32 s;
129 s32 level;
130 s32 optname;
131 s32 optlen;
132 u8 buffer[128];
134
135typedef struct
136{
137 union
138 {
139 s32 maxfdp1;
140 s32 result;
141 };
142 struct timeval *timeout_p;
143 struct timeval timeout;
144 struct fd_set *readset_p;
145 struct fd_set *writeset_p;
146 struct fd_set *exceptset_p;
147 struct fd_set readset;
148 struct fd_set writeset;
149 struct fd_set exceptset;
150} select_pkt;
151
152typedef struct
153{
154 union
155 {
156 s32 s;
157 s32 result;
158 };
159 u32 cmd;
160 void *argp;
161 u32 value;
162} ioctl_pkt;
163
164#ifdef PS2IP_DNS
165struct hostent_res
166{
167 s16 h_addrtype;
168 s16 h_length;
169 ip_addr_t h_addr;
170};
171
172typedef struct
173{
174 s32 result;
175 struct hostent_res hostent;
176} gethostbyname_res_pkt;
177
178typedef struct
179{
180 ip_addr_t dnsserver;
181 u8 numdns;
182} dns_setserver_pkt;
183
184typedef struct
185{
186 ip_addr_t dnsserver;
187} dns_getserver_res_pkt;
188
189#endif
190
191#endif /* __PS2IP_RPC_H__ */
Definition time.h:29