vitasdk
Documentation of the vitasdk
pspnet_adhoc.h
Go to the documentation of this file.
1 
7 #ifndef _PSP2_PSPNET_ADHOC_H_
8 #define _PSP2_PSPNET_ADHOC_H_
9 
10 #include <vitasdk/build_utils.h>
11 #include <psp2/types.h>
12 #include <psp2/pspnet_adhocctl.h>
13 #include <psp2/net/net.h>
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
50 
52  int id;
53  int events;
54  int revents;
56 
57 typedef enum ScePspnetAdhocEvent {
68 
71  int id;
72  struct SceNetEtherAddr laddr;
74  unsigned int rcv_sb_cc;
76 
77 typedef enum ScePspnetAdhocPtpState {
84 
87  int id;
88  struct SceNetEtherAddr laddr;
89  struct SceNetEtherAddr paddr;
92  unsigned int snd_sb_cc;
93  unsigned int rcv_sb_cc;
94  int state;
95 };
96 
97 typedef enum ScePspnetAdhocFlags {
106 
107 #define SCE_NET_ADHOC_F_ALERTALL \
108  (SCE_NET_ADHOC_F_ALERTSEND \
109  |SCE_NET_ADHOC_F_ALERTRECV \
110  |SCE_NET_ADHOC_F_ALERTPOLL \
111  |SCE_NET_ADHOC_F_ALERTCONNECT \
112  |SCE_NET_ADHOC_F_ALERTACCEPT \
113  |SCE_NET_ADHOC_F_ALERTFLUSH \
114  )
115 
116 #define SCE_NET_ADHOC_PDP_MFS 1444
117 #define SCE_NET_ADHOC_PDP_MTU 65523
118 #define SCE_NET_ADHOC_PTP_MSS 1444
119 
120 int sceNetAdhocInit(void);
121 int sceNetAdhocTerm(void);
122 
123 int sceNetAdhocPollSocket(struct SceNetAdhocPollSd *sds, int nsds, unsigned int timeout, int flag);
124 int sceNetAdhocSetSocketAlert(int id, int flag);
125 int sceNetAdhocGetSocketAlert(int id, int *flag);
126 
127 int sceNetAdhocPdpCreate(const struct SceNetEtherAddr *saddr, SceUShort16 sport, unsigned int bufsize, int flag);
128 int sceNetAdhocPdpSend(int id, const struct SceNetEtherAddr *daddr, SceUShort16 dport, const void *data, int len, unsigned int timeout, int flag);
129 int sceNetAdhocPdpRecv(int id, struct SceNetEtherAddr *saddr, SceUShort16 *sport, void *buf, int *len, unsigned int timeout, int flag);
130 int sceNetAdhocPdpDelete(int id, int flag);
131 int sceNetAdhocGetPdpStat(int *buflen, void *buf);
132 
133 int sceNetAdhocPtpOpen(const struct SceNetEtherAddr *saddr, SceUShort16 sport, const struct SceNetEtherAddr *daddr, SceUShort16 dport, unsigned int bufsize, unsigned int rexmt_int, int rexmt_cnt, int flag);
134 int sceNetAdhocPtpConnect(int id, unsigned int timeout, int flag);
135 int sceNetAdhocPtpListen(const struct SceNetEtherAddr *saddr, SceUShort16 sport, unsigned int bufsize, unsigned int rexmt_int, int rexmt_cnt, int backlog, int flag);
136 int sceNetAdhocPtpAccept(int id, struct SceNetEtherAddr *addr, SceUShort16 *port, unsigned int timeout, int flag);
137 int sceNetAdhocPtpSend(int id, const void *data, int *len, unsigned int timeout, int flag);
138 int sceNetAdhocPtpRecv(int id, void *buf, int *len, unsigned int timeout, int flag);
139 int sceNetAdhocPtpFlush(int id, unsigned int timeout, int flag);
140 int sceNetAdhocPtpClose(int id, int flag) ;
141 int sceNetAdhocGetPtpStat(int *buflen, void *buf);
142 
143 #ifdef __cplusplus
144 }
145 #endif
146 
147 #endif /* _PSP2_PSPNET_ADHOC_H_ */
148 
unsigned char data[6]
Definition: net.h:436
Definition: net.h:435
VITASDK_BUILD_ASSERT_EX(SceNetAdhocPollSd, 0xC==sizeof(struct SceNetAdhocPollSd))
int id
Definition: pspnet_adhoc.h:87
int sceNetAdhocPtpOpen(const struct SceNetEtherAddr *saddr, SceUShort16 sport, const struct SceNetEtherAddr *daddr, SceUShort16 dport, unsigned int bufsize, unsigned int rexmt_int, int rexmt_cnt, int flag)
struct SceNetAdhocPdpStat * next
Definition: pspnet_adhoc.h:70
int sceNetAdhocPtpAccept(int id, struct SceNetEtherAddr *addr, SceUShort16 *port, unsigned int timeout, int flag)
SceUShort16 pport
Definition: pspnet_adhoc.h:91
int sceNetAdhocPtpClose(int id, int flag)
int sceNetAdhocTerm(void)
SceUShort16 lport
Definition: pspnet_adhoc.h:90
ScePspnetAdhocEvent
Definition: pspnet_adhoc.h:57
int sceNetAdhocPdpSend(int id, const struct SceNetEtherAddr *daddr, SceUShort16 dport, const void *data, int len, unsigned int timeout, int flag)
ScePspnetAdhocFlags
Definition: pspnet_adhoc.h:97
int sceNetAdhocInit(void)
int sceNetAdhocPtpListen(const struct SceNetEtherAddr *saddr, SceUShort16 sport, unsigned int bufsize, unsigned int rexmt_int, int rexmt_cnt, int backlog, int flag)
int sceNetAdhocGetSocketAlert(int id, int *flag)
int revents
Definition: pspnet_adhoc.h:54
int sceNetAdhocPollSocket(struct SceNetAdhocPollSd *sds, int nsds, unsigned int timeout, int flag)
unsigned int rcv_sb_cc
Definition: pspnet_adhoc.h:93
int sceNetAdhocGetPdpStat(int *buflen, void *buf)
int sceNetAdhocPtpConnect(int id, unsigned int timeout, int flag)
int id
Definition: pspnet_adhoc.h:71
int sceNetAdhocGetPtpStat(int *buflen, void *buf)
int sceNetAdhocPtpFlush(int id, unsigned int timeout, int flag)
struct SceNetEtherAddr laddr
Definition: pspnet_adhoc.h:88
unsigned int snd_sb_cc
Definition: pspnet_adhoc.h:92
ScePspnetAdhocErrorCode
Definition: pspnet_adhoc.h:19
int sceNetAdhocPdpRecv(int id, struct SceNetEtherAddr *saddr, SceUShort16 *sport, void *buf, int *len, unsigned int timeout, int flag)
int sceNetAdhocPtpSend(int id, const void *data, int *len, unsigned int timeout, int flag)
struct SceNetEtherAddr laddr
Definition: pspnet_adhoc.h:72
SceUShort16 lport
Definition: pspnet_adhoc.h:73
int events
Definition: pspnet_adhoc.h:53
struct SceNetAdhocPtpStat * next
Definition: pspnet_adhoc.h:86
struct SceNetEtherAddr paddr
Definition: pspnet_adhoc.h:89
int sceNetAdhocPdpDelete(int id, int flag)
int sceNetAdhocPdpCreate(const struct SceNetEtherAddr *saddr, SceUShort16 sport, unsigned int bufsize, int flag)
int id
Definition: pspnet_adhoc.h:52
int sceNetAdhocSetSocketAlert(int id, int flag)
unsigned int rcv_sb_cc
Definition: pspnet_adhoc.h:74
ScePspnetAdhocPtpState
Definition: pspnet_adhoc.h:77
int sceNetAdhocPtpRecv(int id, void *buf, int *len, unsigned int timeout, int flag)
int state
Definition: pspnet_adhoc.h:94
@ SCE_NET_ADHOC_EV_ACCEPT
Definition: pspnet_adhoc.h:61
@ SCE_NET_ADHOC_EV_CONNECT
Definition: pspnet_adhoc.h:60
@ SCE_NET_ADHOC_EV_FLUSH
Definition: pspnet_adhoc.h:62
@ SCE_NET_ADHOC_EV_DISCONNECT
Definition: pspnet_adhoc.h:66
@ SCE_NET_ADHOC_EV_DELETE
Definition: pspnet_adhoc.h:64
@ SCE_NET_ADHOC_EV_SEND
Definition: pspnet_adhoc.h:58
@ SCE_NET_ADHOC_EV_RECV
Definition: pspnet_adhoc.h:59
@ SCE_NET_ADHOC_EV_INVALID
Definition: pspnet_adhoc.h:63
@ SCE_NET_ADHOC_EV_ALERT
Definition: pspnet_adhoc.h:65
@ SCE_NET_ADHOC_F_ALERTCONNECT
Definition: pspnet_adhoc.h:102
@ SCE_NET_ADHOC_F_ALERTACCEPT
Definition: pspnet_adhoc.h:103
@ SCE_NET_ADHOC_F_ALERTRECV
Definition: pspnet_adhoc.h:100
@ SCE_NET_ADHOC_F_ALERTSEND
Definition: pspnet_adhoc.h:99
@ SCE_NET_ADHOC_F_ALERTPOLL
Definition: pspnet_adhoc.h:101
@ SCE_NET_ADHOC_F_NONBLOCK
Definition: pspnet_adhoc.h:98
@ SCE_NET_ADHOC_F_ALERTFLUSH
Definition: pspnet_adhoc.h:104
@ SCE_ERROR_NET_ADHOC_NOT_OPENED
Definition: pspnet_adhoc.h:32
@ SCE_ERROR_NET_ADHOC_ALREADY_CREATED
Definition: pspnet_adhoc.h:45
@ SCE_ERROR_NET_ADHOC_NOT_INITIALIZED
Definition: pspnet_adhoc.h:37
@ SCE_ERROR_NET_ADHOC_EXCEPTION_EVENT
Definition: pspnet_adhoc.h:42
@ SCE_ERROR_NET_ADHOC_NOT_CREATED
Definition: pspnet_adhoc.h:47
@ SCE_ERROR_NET_ADHOC_PORT_NOT_AVAIL
Definition: pspnet_adhoc.h:35
@ SCE_ERROR_NET_ADHOC_DISCONNECTED
Definition: pspnet_adhoc.h:31
@ SCE_ERROR_NET_ADHOC_INVALID_ARG
Definition: pspnet_adhoc.h:36
@ SCE_ERROR_NET_ADHOC_INVALID_ALIGNMENT
Definition: pspnet_adhoc.h:48
@ SCE_ERROR_NET_ADHOC_INVALID_DATALEN
Definition: pspnet_adhoc.h:24
@ SCE_ERROR_NET_ADHOC_SOCKET_ID_NOT_AVAIL
Definition: pspnet_adhoc.h:34
@ SCE_ERROR_NET_ADHOC_INVALID_BUFLEN
Definition: pspnet_adhoc.h:23
@ SCE_ERROR_NET_ADHOC_PORT_IN_USE
Definition: pspnet_adhoc.h:29
@ SCE_ERROR_NET_ADHOC_NOT_IN_GAMEMODE
Definition: pspnet_adhoc.h:46
@ SCE_ERROR_NET_ADHOC_NOT_ENOUGH_SPACE
Definition: pspnet_adhoc.h:25
@ SCE_ERROR_NET_ADHOC_BUSY
Definition: pspnet_adhoc.h:39
@ SCE_ERROR_NET_ADHOC_NOT_CONNECTED
Definition: pspnet_adhoc.h:30
@ SCE_ERROR_NET_ADHOC_THREAD_ABORTED
Definition: pspnet_adhoc.h:44
@ SCE_ERROR_NET_ADHOC_ALREADY_INITIALIZED
Definition: pspnet_adhoc.h:38
@ SCE_ERROR_NET_ADHOC_SOCKET_ALERTED
Definition: pspnet_adhoc.h:27
@ SCE_ERROR_NET_ADHOC_TIMEOUT
Definition: pspnet_adhoc.h:40
@ SCE_ERROR_NET_ADHOC_INVALID_ADDR
Definition: pspnet_adhoc.h:21
@ SCE_ERROR_NET_ADHOC_CONNECTION_REFUSED
Definition: pspnet_adhoc.h:43
@ SCE_ERROR_NET_ADHOC_NOT_LISTENED
Definition: pspnet_adhoc.h:33
@ SCE_ERROR_NET_ADHOC_SOCKET_DELETED
Definition: pspnet_adhoc.h:26
@ SCE_ERROR_NET_ADHOC_INVALID_PORT
Definition: pspnet_adhoc.h:22
@ SCE_ERROR_NET_ADHOC_NO_ENTRY
Definition: pspnet_adhoc.h:41
@ SCE_ERROR_NET_ADHOC_WOULD_BLOCK
Definition: pspnet_adhoc.h:28
@ SCE_ERROR_NET_ADHOC_INVALID_SOCKET_ID
Definition: pspnet_adhoc.h:20
@ SCE_NET_ADHOC_PTP_STATE_ESTABLISHED
Definition: pspnet_adhoc.h:82
@ SCE_NET_ADHOC_PTP_STATE_CLOSED
Definition: pspnet_adhoc.h:78
@ SCE_NET_ADHOC_PTP_STATE_SYN_SENT
Definition: pspnet_adhoc.h:80
@ SCE_NET_ADHOC_PTP_STATE_LISTEN
Definition: pspnet_adhoc.h:79
@ SCE_NET_ADHOC_PTP_STATE_SYN_RCVD
Definition: pspnet_adhoc.h:81
Definition: pspnet_adhoc.h:69
Definition: pspnet_adhoc.h:51
Definition: pspnet_adhoc.h:85
uint16_t SceUShort16
Definition: types.h:39