pspsdk-1.0+beta2
pspnet_adhocctl.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_adhocctl.h - PSP Adhoc control 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_adhocctl.h 2433 2008-10-15 10:00:27Z iwn $
14  */
15 #ifndef __PSPNETCTL_ADHOC_H__
16 #define __PSPNETCTL_ADHOC_H__
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
24 {
26  int unknown;
28  char product[9];
30 
33 {
36  char nickname[128];
38  unsigned char mac[6];
40  unsigned char unknown[6];
42  unsigned long timestamp;
43 };
44 
47 {
50  int channel;
52  char name[8];
54  unsigned char bssid[6];
56  unsigned char unknown[2];
58  int unknown2;
59 };
60 
62 {
64  int count;
66  unsigned char macs[16][6];
67 };
68 
71 {
73  int channel;
75  char name[8];
77  unsigned char bssid[6];
79  char nickname[128];
80 };
81 
91 int sceNetAdhocctlInit(int stacksize, int priority, struct productStruct *product);
92 
98 int sceNetAdhocctlTerm(void);
99 
107 int sceNetAdhocctlConnect(const char *name);
108 
114 int sceNetAdhocctlDisconnect(void);
115 
123 int sceNetAdhocctlGetState(int *event);
124 
132 int sceNetAdhocctlCreate(const char *name);
133 
141 int sceNetAdhocctlJoin(struct SceNetAdhocctlScanInfo *scaninfo);
142 
150 int sceNetAdhocctlGetAdhocId(struct productStruct *product);
151 
164 int sceNetAdhocctlCreateEnterGameMode(const char *name, int unknown, int num, unsigned char *macs, unsigned int timeout, int unknown2);
165 
176 int sceNetAdhocctlJoinEnterGameMode(const char *name, unsigned char *hostmac, unsigned int timeout, int unknown);
177 
186 
193 
202 int sceNetAdhocctlGetPeerList(int *length, void *buf);
203 
213 int sceNetAdhocctlGetPeerInfo(unsigned char *mac, int size, struct SceNetAdhocctlPeerInfo *peerinfo);
214 
220 int sceNetAdhocctlScan(void);
221 
230 int sceNetAdhocctlGetScanInfo(int *length, void *buf);
231 
232 typedef void (*sceNetAdhocctlHandler)(int flag, int error, void *unknown);
233 
242 int sceNetAdhocctlAddHandler(sceNetAdhocctlHandler handler, void *unknown);
243 
251 int sceNetAdhocctlDelHandler(int id);
252 
261 int sceNetAdhocctlGetNameByAddr(unsigned char *mac, char *nickname);
262 
272 int sceNetAdhocctlGetAddrByName(char *nickname, int *length, void *buf);
273 
282 
283 #ifdef __cplusplus
284 }
285 #endif
286 
287 #endif