pspsdk-1.0+beta2
pspnet_adhoc.h
Go to the documentation of this file.
1 /*
2  * PSP Software Development Kit - http://www.pspdev.org
3  * -----------------------------------------------------------------------
4  * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
5  *
6  * pspnet_adhoc.h - PSP Adhoc networking libraries.
7  *
8  * Copyright (c) 2006 James F.
9  * Copyright (c) 2008 InsertWittyName <tias_dp@hotmail.com>
10  *
11  * Based on the adhoc code in SMS Plus
12  *
13  * $Id: pspnet_adhoc.h 2400 2008-07-06 22:46:56Z iwn $
14  */
15 #ifndef __PSPNET_ADHOC_H__
16 #define __PSPNET_ADHOC_H__
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
27 int sceNetAdhocInit(void);
28 
34 int sceNetAdhocTerm(void);
35 
46 int sceNetAdhocPdpCreate(unsigned char *mac, unsigned short port, unsigned int bufsize, int unk1);
47 
56 int sceNetAdhocPdpDelete(int id, int unk1);
57 
71 int sceNetAdhocPdpSend(int id, unsigned char *destMacAddr, unsigned short port, void *data, unsigned int len, unsigned int timeout, int nonblock);
72 
86 int sceNetAdhocPdpRecv(int id, unsigned char *srcMacAddr, unsigned short *port, void *data, void *dataLength, unsigned int timeout, int nonblock);
87 
91 typedef struct pdpStatStruct
92 {
96  int pdpId;
98  unsigned char mac[6];
100  unsigned short port;
102  unsigned int rcvdData;
103 } pdpStatStruct;
104 
113 int sceNetAdhocGetPdpStat(int *size, pdpStatStruct *stat);
114 
123 int sceNetAdhocGameModeCreateMaster(void *data, int size);
124 
134 int sceNetAdhocGameModeCreateReplica(unsigned char *mac, void *data, int size);
135 
142 
151 int sceNetAdhocGameModeUpdateReplica(int id, int unk1);
152 
159 
168 
183 int sceNetAdhocPtpOpen(unsigned char *srcmac, unsigned short srcport, unsigned char *destmac, unsigned short destport, unsigned int bufsize, unsigned int delay, int count, int unk1);
184 
194 int sceNetAdhocPtpConnect(int id, unsigned int timeout, int nonblock);
195 
209 int sceNetAdhocPtpListen(unsigned char *srcmac, unsigned short srcport, unsigned int bufsize, unsigned int delay, int count, int queue, int unk1);
210 
222 int sceNetAdhocPtpAccept(int id, unsigned char *mac, unsigned short *port, unsigned int timeout, int nonblock);
223 
235 int sceNetAdhocPtpSend(int id, void *data, int *datasize, unsigned int timeout, int nonblock);
236 
248 int sceNetAdhocPtpRecv(int id, void *data, int *datasize, unsigned int timeout, int nonblock);
249 
259 int sceNetAdhocPtpFlush(int id, unsigned int timeout, int nonblock);
260 
269 int sceNetAdhocPtpClose(int id, int unk1);
270 
274 typedef struct ptpStatStruct
275 {
279  int ptpId;
281  unsigned char mac[6];
283  unsigned char peermac[6];
285  unsigned short port;
287  unsigned short peerport;
289  unsigned int sentData;
291  unsigned int rcvdData;
293  int unk1;
294 } ptpStatStruct;
295 
304 int sceNetAdhocGetPtpStat(int *size, ptpStatStruct *stat);
305 
306 #ifdef __cplusplus
307 }
308 #endif
309 
310 #endif