#include "Platform.h"
#include "Declarations.h"
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "Message.h"
#include "PacketQueue.h"
#include "ResponseWaitQueue.h"
#include "MessageBuffers.h"
#include "PeerList.h"
#include "NetworkQueue.h"
Go to the source code of this file.
Defines | |
#define | MAXLEN 1024 |
Functions | |
ONECHAR * | platformIPAddrConvert (const UINT32 ip_hostorder) |
UINT32 | platformIPAddrConvert (const ONECHAR *ip_addr_dotted_string) |
void | platformInitializeSocketSubsystem () |
void | platformDeinitializeSocketSubsystem () |
socktype | platformSocketCreateInet (INT32 type) |
create a socket for use with TCP or UDP wrapper | |
INT32 | platformSocketConnect (socktype s, const struct sockaddr *Saddr, size_t size_sockaddr) |
INT32 | platformSocketBind (socktype s, const struct sockaddr *Saddr, size_t size_sockaddr) |
INT32 | platformSocketClose (socktype s) |
INT32 | platformSocketSelect (int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout) |
INT32 | platformSocketReceiveFromFunction (socktype s, UINT8 *buf, UINT32 buflen, UINT32 &ip_hostorder, UINT16 &port_hostorder) |
INT32 | platformSocketSendToFunction (socktype s, const UINT8 *buf, UINT32 buflen, UINT32 ip_hostorder, UINT16 port_hostorder) |
INT32 | platformSocketDisconnectUDP (socktype s) |
INT32 | platformSocketSetNonblocking (socktype s) |
void | stoupper (char *s) |
int | _strnicmp (const char *string1, const char *string2, size_t count) |
VOID | platformSleepMilliseconds (UINT32 msec) |
UINT32 | platformGetTickCount () |
void | platformInitializeConsoleInput () |
void | platformDeinitializeConsoleInput () |
INT32 | platformgetch () |
INT32 | platformkbhit () |
Variables | |
const INT32 | platformMaxFdSets = PLF_MAX_FDSETS |
static char | strtmp1 [MAXLEN] |
static char | strtmp2 [MAXLEN] |
#define MAXLEN 1024 |
int _strnicmp | ( | const char * | string1, | |
const char * | string2, | |||
size_t | count | |||
) |
Definition at line 1885 of file Platform.cpp.
Referenced by main().
void platformDeinitializeConsoleInput | ( | ) |
Definition at line 2054 of file Platform.cpp.
Referenced by SimulateLocalPeer(), and SimulateRemotePeer().
void platformDeinitializeSocketSubsystem | ( | ) |
Definition at line 87 of file Platform.cpp.
Referenced by SimulateLocalPeer(), and SimulateRemotePeer().
INT32 platformgetch | ( | ) |
Definition at line 2073 of file Platform.cpp.
Referenced by SimulateLocalPeer(), and SimulateRemotePeer().
UINT32 platformGetTickCount | ( | ) |
Definition at line 1949 of file Platform.cpp.
Referenced by SimulateLocalPeer(), and SimulateRemotePeer().
void platformInitializeConsoleInput | ( | ) |
Definition at line 2023 of file Platform.cpp.
Referenced by SimulateLocalPeer(), and SimulateRemotePeer().
void platformInitializeSocketSubsystem | ( | ) |
Definition at line 77 of file Platform.cpp.
Referenced by SimulateLocalPeer(), and SimulateRemotePeer().
UINT32 platformIPAddrConvert | ( | const ONECHAR * | ip_addr_dotted_string | ) |
Definition at line 53 of file Platform.cpp.
ONECHAR* platformIPAddrConvert | ( | const UINT32 | ip_hostorder | ) |
Definition at line 39 of file Platform.cpp.
Referenced by CNetworkQueue::create(), CNetworkQueue::ReceiveProcessTask(), SimulateLocalPeer(), and SimulateRemotePeer().
INT32 platformkbhit | ( | ) |
Definition at line 2113 of file Platform.cpp.
Referenced by SimulateLocalPeer(), and SimulateRemotePeer().
VOID platformSleepMilliseconds | ( | UINT32 | msec | ) |
Definition at line 1911 of file Platform.cpp.
Referenced by CNetworkQueue::close(), CNetworkQueue::create(), SimulateLocalPeer(), and SimulateRemotePeer().
INT32 platformSocketBind | ( | socktype | s, | |
const struct sockaddr * | Saddr, | |||
size_t | size_sockaddr | |||
) |
Definition at line 213 of file Platform.cpp.
Referenced by CNetworkQueue::create().
INT32 platformSocketClose | ( | socktype | s | ) |
Definition at line 242 of file Platform.cpp.
Referenced by CNetworkQueue::close(), and CNetworkQueue::create().
INT32 platformSocketConnect | ( | socktype | s, | |
const struct sockaddr * | Saddr, | |||
size_t | size_sockaddr | |||
) |
Definition at line 182 of file Platform.cpp.
socktype platformSocketCreateInet | ( | INT32 | type | ) |
create a socket for use with TCP or UDP wrapper
type: SOCK_STREAM - tcp socket SOCK_DGRAM - udp socket
return: (socktype) SOCKET_ERROR on error an appropriate socket otherwise
This function is part of the platform-independence wrapping and will be accessed by platform-independent parts of the Network Queue.
Definition at line 108 of file Platform.cpp.
Referenced by CNetworkQueue::create().
INT32 platformSocketDisconnectUDP | ( | socktype | s | ) |
Definition at line 354 of file Platform.cpp.
INT32 platformSocketReceiveFromFunction | ( | socktype | s, | |
UINT8 * | buf, | |||
UINT32 | buflen, | |||
UINT32 & | ip_hostorder, | |||
UINT16 & | port_hostorder | |||
) |
Definition at line 297 of file Platform.cpp.
Referenced by CNetworkQueue::ReceiveProcessTask().
INT32 platformSocketSelect | ( | int | n, | |
fd_set * | readfds, | |||
fd_set * | writefds, | |||
fd_set * | exceptfds, | |||
struct timeval * | timeout | |||
) |
Definition at line 267 of file Platform.cpp.
Referenced by CNetworkQueue::ReceiveProcessTask(), and CNetworkQueue::SendProcessTask().
INT32 platformSocketSendToFunction | ( | socktype | s, | |
const UINT8 * | buf, | |||
UINT32 | buflen, | |||
UINT32 | ip_hostorder, | |||
UINT16 | port_hostorder | |||
) |
Definition at line 333 of file Platform.cpp.
Referenced by CNetworkQueue::SendProcessTask().
INT32 platformSocketSetNonblocking | ( | socktype | s | ) |
Definition at line 394 of file Platform.cpp.
Referenced by CNetworkQueue::create().
void stoupper | ( | char * | s | ) |
Definition at line 1866 of file Platform.cpp.
Referenced by _strnicmp().
const INT32 platformMaxFdSets = PLF_MAX_FDSETS |
Definition at line 35 of file Platform.cpp.
Referenced by CNetworkQueue::ReceiveProcessTask(), and CNetworkQueue::SendProcessTask().
char strtmp1[MAXLEN] [static] |
Definition at line 1879 of file Platform.cpp.
char strtmp2[MAXLEN] [static] |
Definition at line 1880 of file Platform.cpp.