⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cms_wsp.h

📁 wap 协议栈 包括1.2 和2.0 由c开发 基于brew平台
💻 H
字号:
/******************************************************************************

 C   H E A D E R   F I L E

 (c) Copyright MobileSoft Technology (NanJing) Co.,LTD. 2001-2002
 ALL RIGHTS RESERVED

*******************************************************************************

 Project Name: WAP STACK Ver 1.20
 
 File Name   : Cms_WSP.h

 Description : To Implement Browser application

 Last Modify : 06/22/2002
 
 Written By  : Mobilesoft Technology

******************************************************************************/

#ifndef _CMS_WSP_H
#define _CMS_WSP_H

/********************************************************/

#include "Cms_WAPTypes.h"

#include "Cms_WAPOctStr.h"
#include "Cms_WTP.h"
#include "Cms_WAPGWLIB.h"

/********************************************************/

/*
 * these capability maximum values are real maximum
 * values to our server. It cannot negotiate larger values
 * than these. No way.
 */

#define WSP_MAX_CLIENT_SDU 0
#define WSP_MAX_SERVER_SDU 0
#define WSP_MAX_PROTOCOL_OPTIONS 0x00
#define WSP_MAX_METHOD_MOR 1
#define WSP_MAX_PUSH_MOR 1

   
#define WSP_CSDU_SET 	1
#define WSP_SSDU_SET 	2
#define WSP_PO_SET 	4
#define WSP_MMOR_SET	8
#define WSP_PMOR_SET	16
#define WSP_EM_SET	32
#define WSP_HCP_SET	64
#define WSP_A_SET	128

typedef struct WSPMachine WSPMachine;
typedef struct WSPMethodMachine WSPMethodMachine;
typedef struct WSPEvent WSPEvent;

enum wsp_abort_reason{
   WSPERRUNKNOWN = 0x00,
   WSPPROTOERR = 0xE0,
   DISCONNECT ,
   SUSPEND ,
   RESUME ,
   CONGESTION ,
   CONNECTERR ,
   MRUEXCEEDED ,
   MOREXCEEDED ,
   PEERREQ ,
   NETERR,
   USERREQ,
   USERRFS,
   USERPND,
   USERDCR,
   USERDCU
};    

typedef enum 
{               
	NOUSE1=-1

	#define WSP_EVENT(name, fields) ,name
	#define INTEGER
	#define OCTSTR
	#define WTP_MACHINE
	#define SESSION_MACHINE
	#define HTTPHEADER
	#include "Cms_WSPEventDecl.h"

} WSPEventType;

typedef enum 
{  
	NOUSE= -1

	#define STATE_NAME(name) ,name
	#define ROW(state, event, condition, action, next_state)
	#include "Cms_WSPStateDecl.h"

} WSPState;

	#define INTEGER(name) CMS_S32 name
	#define OCTSTR(name) Octstr *name
	#define WTP_MACHINE(name) WTPMachine *name
	#define SESSION_MACHINE(name) WSPMachine *name
	#define HTTPHEADER(name) HTTPHeader *name
	#define WSP_EVENT(name, fields) struct name fields;
	#include "Cms_WSPEventDecl.h"


struct WSPEvent 
{
	WSPEventType type;
	WSPEvent *next;

	#define INTEGER(name) 
	#define OCTSTR(name) 
	#define WTP_MACHINE(name) 
	#define SESSION_MACHINE(name) 
	#define HTTPHEADER(name) 
	#define WSP_EVENT(name, fields) struct name name;
	#include "Cms_WSPEventDecl.h"
};


struct WSPMachine
	#define OCTSTR(name)  Octstr *name
	#define INTEGER(name) CMS_S64 name
	#define EVENT_POINTER(name) WSPEvent *name
	#define SESSION_MACHINE(fields) fields
	#include "Cms_WSPMachineDecl.h"
;

//2003.9.1
typedef enum 
{
	WSP_ABORT_USERREQ = 1,
	WSP_ABORT_PROERR,
}WSP_ABORT_INDICATION_TYPE;
/*********************************************************/

/*
 * Initialize the WSP subsystem. This MUST be called before any other
 * functions in this header.
 */
CMS_VOID wsp_init(CMS_VOID);

CMS_VOID wsp_machine_destroy(WSPMachine *machine);
/*
 * Create a WSPEvent structure and initialize it to be empty. Return a
 * pointer to the structure or NULL if there was a failure.
 */
WSPEvent *wsp_event_create(WSPEventType type);


/*
 * Destroy a WSPEvent structure, including all its members.
 */
CMS_VOID wsp_event_destroy(WSPEvent *event);


/*
 * Find the correct WSPMachine to send the event to, or create a new
 * one, and then make that machine handle the event.
 */
CMS_VOID wsp_dispatch_event(WTPMachine *wtp_sm, WSPEvent *event);


/*
 * Create a WSPMachine structure and initialize it to be empty. Return a
 * pointer to the structure or NULL if there was a failure.
 */
WSPMachine *wsp_machine_create(CMS_VOID);


/*
 * Output (with `debug' in wapitlib.h) a WSPMachine and its fields.
 */
CMS_VOID wsp_machine_dump(WSPMachine *machine);




/*
 * Feed a WSPEvent to a WSPMachine. Handle errors, do not report them to
 * the caller.
 */
CMS_VOID wsp_handle_event(WSPMachine *machine, WSPEvent *event);


CMS_S32 wsp_deduce_pdu_type(Octstr *pdu, CMS_S32 connectionless);


/*********************************************************/


#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -