PSPSDK 2024-12-16
Loading...
Searching...
No Matches
pspnet_adhoc.h
Go to the documentation of this file.
1/*
2 * PSP Software Development Kit - https://github.com/pspdev
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 */
14#ifndef __PSPNET_ADHOC_H__
15#define __PSPNET_ADHOC_H__
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
27
34
45int sceNetAdhocPdpCreate(unsigned char *mac, unsigned short port, unsigned int bufsize, int unk1);
46
55int sceNetAdhocPdpDelete(int id, int unk1);
56
70int sceNetAdhocPdpSend(int id, unsigned char *destMacAddr, unsigned short port, void *data, unsigned int len, unsigned int timeout, int nonblock);
71
85int sceNetAdhocPdpRecv(int id, unsigned char *srcMacAddr, unsigned short *port, void *data, void *dataLength, unsigned int timeout, int nonblock);
86
90typedef struct pdpStatStruct
91{
95 int pdpId;
97 unsigned char mac[6];
99 unsigned short port;
101 unsigned int rcvdData;
103
113
123
133int sceNetAdhocGameModeCreateReplica(unsigned char *mac, void *data, int size);
134
141
151
158
167
182int sceNetAdhocPtpOpen(unsigned char *srcmac, unsigned short srcport, unsigned char *destmac, unsigned short destport, unsigned int bufsize, unsigned int delay, int count, int unk1);
183
193int sceNetAdhocPtpConnect(int id, unsigned int timeout, int nonblock);
194
208int sceNetAdhocPtpListen(unsigned char *srcmac, unsigned short srcport, unsigned int bufsize, unsigned int delay, int count, int queue, int unk1);
209
221int sceNetAdhocPtpAccept(int id, unsigned char *mac, unsigned short *port, unsigned int timeout, int nonblock);
222
234int sceNetAdhocPtpSend(int id, void *data, int *datasize, unsigned int timeout, int nonblock);
235
247int sceNetAdhocPtpRecv(int id, void *data, int *datasize, unsigned int timeout, int nonblock);
248
258int sceNetAdhocPtpFlush(int id, unsigned int timeout, int nonblock);
259
268int sceNetAdhocPtpClose(int id, int unk1);
269
273typedef struct ptpStatStruct
274{
278 int ptpId;
280 unsigned char mac[6];
282 unsigned char peermac[6];
284 unsigned short port;
286 unsigned short peerport;
288 unsigned int sentData;
290 unsigned int rcvdData;
292 int unk1;
294
304
305#ifdef __cplusplus
306}
307#endif
308
309#endif
int sceNetAdhocGameModeDeleteReplica(int id)
Delete peer game object type data.
int sceNetAdhocPtpSend(int id, void *data, int *datasize, unsigned int timeout, int nonblock)
Send data.
int sceNetAdhocGameModeUpdateMaster(void)
Update own game object type data.
int sceNetAdhocGameModeDeleteMaster(void)
Delete own game object type data.
int sceNetAdhocPdpCreate(unsigned char *mac, unsigned short port, unsigned int bufsize, int unk1)
Create a PDP object.
int sceNetAdhocPtpAccept(int id, unsigned char *mac, unsigned short *port, unsigned int timeout, int nonblock)
Accept an incoming PTP connection.
int sceNetAdhocPtpRecv(int id, void *data, int *datasize, unsigned int timeout, int nonblock)
Receive data.
int sceNetAdhocTerm(void)
Terminate the adhoc library.
int sceNetAdhocPtpConnect(int id, unsigned int timeout, int nonblock)
Wait for connection created by sceNetAdhocPtpOpen()
int sceNetAdhocPtpFlush(int id, unsigned int timeout, int nonblock)
Wait for data in the buffer to be sent.
int sceNetAdhocPdpDelete(int id, int unk1)
Delete a PDP object.
int sceNetAdhocInit(void)
Initialise the adhoc library.
int sceNetAdhocPtpClose(int id, int unk1)
Close a socket.
int sceNetAdhocGameModeCreateMaster(void *data, int size)
Create own game object type data.
int sceNetAdhocPtpOpen(unsigned char *srcmac, unsigned short srcport, unsigned char *destmac, unsigned short destport, unsigned int bufsize, unsigned int delay, int count, int unk1)
Open a PTP connection.
int sceNetAdhocPdpRecv(int id, unsigned char *srcMacAddr, unsigned short *port, void *data, void *dataLength, unsigned int timeout, int nonblock)
Receive a PDP packet.
int sceNetAdhocPtpListen(unsigned char *srcmac, unsigned short srcport, unsigned int bufsize, unsigned int delay, int count, int queue, int unk1)
Wait for an incoming PTP connection.
int sceNetAdhocGetPtpStat(int *size, ptpStatStruct *stat)
Get the status of all PTP objects.
int sceNetAdhocGameModeUpdateReplica(int id, int unk1)
Update peer game object type data.
int sceNetAdhocGetPdpStat(int *size, pdpStatStruct *stat)
Get the status of all PDP objects.
int sceNetAdhocPdpSend(int id, unsigned char *destMacAddr, unsigned short port, void *data, unsigned int len, unsigned int timeout, int nonblock)
Set a PDP packet to a destination.
int sceNetAdhocGameModeCreateReplica(unsigned char *mac, void *data, int size)
Create peer game object type data.
unsigned char size
Definition pspsysmem_kernel.h:6
float x
Definition psptypes.h:0
PDP status structure.
Definition pspnet_adhoc.h:91
unsigned short port
Port.
Definition pspnet_adhoc.h:99
unsigned int rcvdData
Bytes received.
Definition pspnet_adhoc.h:101
int pdpId
pdp ID
Definition pspnet_adhoc.h:95
unsigned char mac[6]
MAC address.
Definition pspnet_adhoc.h:97
struct pdpStatStruct * next
Pointer to next PDP structure in list.
Definition pspnet_adhoc.h:93
PTP status structure.
Definition pspnet_adhoc.h:274
int unk1
Unknown.
Definition pspnet_adhoc.h:292
unsigned char mac[6]
MAC address.
Definition pspnet_adhoc.h:280
unsigned int sentData
Bytes sent.
Definition pspnet_adhoc.h:288
int ptpId
ptp ID
Definition pspnet_adhoc.h:278
unsigned char peermac[6]
Peer MAC address.
Definition pspnet_adhoc.h:282
unsigned short peerport
Peer Port.
Definition pspnet_adhoc.h:286
unsigned int rcvdData
Bytes received.
Definition pspnet_adhoc.h:290
unsigned short port
Port.
Definition pspnet_adhoc.h:284
struct ptpStatStruct * next
Pointer to next PTP structure in list.
Definition pspnet_adhoc.h:276