/*
 *               Copyright (C) 2007, BroadOn Communications Corp.
 *
 *  These coded instructions, statements, and computer programs contain
 *  unpublished  proprietary information of BroadOn Communications Corp.,
 *  and  are protected by Federal copyright law. They may not be disclosed
 *  to  third  parties or copied or duplicated in any form, in whole or in
 *  part, without the prior written consent of BroadOn Communications Corp.
 *
 */


#ifndef __SKTP_H__
#define __SKTP_H__


#include <types.h>


#if !defined(GBA) && !defined(SC) && !defined(NITRO)
#pragma pack(push, 4)
#endif


#ifdef __cplusplus
extern "C" {
#endif


/* Error values */
#define SKTP_ERROR_OK               0
#define SKTP_ERROR_INVALID          -201
#define SKTP_ERROR_NOMEM            -202
#define SKTP_ERROR_SHR              -203
#define SKTP_ERROR_P2P              -204
#define SKTP_ERROR_NO_PROXY         -205
#define SKTP_ERROR_SSL              -206
#define SKTP_ERROR_CONNECT          -207
#define SKTP_ERROR_NOTCONN          -208
#define SKTP_ERROR_UNKNOWN          -209

typedef s32 SKTPError;


/* SKTP game info */
#define SKTP_GAME_ID            0x80000001
#define SKTP_TITLE_ID           0  /* an invalid titleId */
#define SKTP_GAME_KEYWORD       "SKTP GAME KEYWORD"
#define SKTP_GAME_ATTR_ID       6
#define SKTP_GAME_ATTR_VALUE    10023989
#define SKTP_GAME_STATUS        60248698
#define SKTP_NUM_PLAYERS        9


/* SKTPRequest definitions */
#define SKTP_RQ_OPEN            101
#define SKTP_RQ_ENABLE_SSL      102
#define SKTP_RQ_CONNECT         103
#define SKTP_RQ_WRITE           104
#define SKTP_RQ_READ            105
#define SKTP_RQ_SHUTDOWN        106
#define SKTP_RQ_CLOSE           107
#define SKTP_RQ_RESET_ALL       108

#define NUM_SKTP_REQUESTS       8

/* Definition of data passed between gba/nc libec and pc ncp (i.e. sktp) */
typedef u32 SKTPRequestType;


#define SKTP_RPC_CHANNEL_TAG    4
#define SKTP_MAX_OPEN_SOCKETS   16
#define SKTP_HOSTNAME_MAX_LEN   512

typedef struct {
    u8              hostname[SKTP_HOSTNAME_MAX_LEN];
    u32             port;
} SKTPConnectArg;

typedef struct {
    u32             bufSize;
} SKTPReadArg;


#ifdef __cplusplus
}
#endif //__cplusplus



#if !defined(GBA) && !defined(SC) && !defined(NITRO)
#pragma pack(pop)
#endif


#endif /*__SKTP_H__*/
