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

📄 mess_mms_transfer.h

📁 彩信的编码解码(代码化)
💻 H
📖 第 1 页 / 共 2 页
字号:
#define 	Kazakh						0x39 
#define 	Uighur						0x7F
#define 	Greenlandic 				0x8A 
#define 	Ukrainian					0x50
#define 	Cambodian					0x3B 
#define 	Urdu						0x21
#define 	Kannada 					0x3C 
#define 	Uzbek						0x23
#define 	Korean						0x3D 
#define 	Vietnamese					0x2F
#define 	Kashmiri					0x3E 
#define 	Volapuk 					0x85
#define 	Kurdish 					0x3F 
#define 	Wolof						0x31
#define 	Kirghiz 					0x40 
#define 	Xhosa						0x32
#define 	Latin						0x8B 
#define 	Yiddish 					0x88
#define 	Lingala 					0x42 
#define 	Yoruba						0x35
#define 	Laothian					0x43 
#define 	Zhuang						0x3A
#define 	Lithuanian					0x44 
#define 	Chinese 					0x41
#define 	Latvian 					0x45 
#define 	Zulu						0x5C
#define 	Malagasy					0x46

/* value of Accept_Ranges */
#define 	None						0x80
#define 	Bytes						0x81

/* value of Cache_control */
#define 	No_cache					0x80
#define 	No_store					0x81
#define 	Max_age 					0x82
#define 	Max_stale					0x83
#define 	Min_fresh					0x84
#define 	Only_if_cached				0x85
#define 	Public						0x86
#define 	Private 					0x87
#define 	No_transform				0x88
#define 	Must_revalidate 			0x89
#define 	Proxy_revalidate			0x8A

/* value of Content_Encoding */
#define 	Gzip						0x80
#define 	Compress					0x81
#define 	Deflate 					0x82

/* value of Range */
#define 	Byte_range					0x80
#define 	Suffix_byte_range			0x81

/* valve of Connection */
#define 	Close						0x80

/* valve of Transfer_Encoding */
#define 	Chunked 					0x80

/* value of Content_disposition */
#define 	Form_data					0x80
#define 	Attachment					0x81


/*---------------------------------  Variable Declarations ----------------------------------*/

typedef unsigned char UC;
typedef char C;
typedef unsigned long UL32;
typedef long L32;
typedef short S;
typedef double D;
typedef int I;

typedef enum 
{
	UNUSE = 0,
	Ok, 						 
	Error_unspecified,			 
	Error_service_denied,		 
	Error_message_format_corrupt,		 
	Error_sending_address_unresolved,	 
	Error_message_not_found,			 
	Error_network_problem,				 
	Error_content_not_accepted, 		 
	Error_unsupported_message,			 
	Error_transient_failure,			 
	Error_transient_sending_address_unresolved, 		 
	Error_transient_message_not_found,					 
	Error_transient_network_problem,						 
	Error_transient_partial_success,						 
	Error_permanent_failure,								 
	Error_permanent_service_denied, 					 
	Error_permanent_message_format_corrupt, 			 
	Error_permanent_sending_address_unresolved, 		 
	Error_permanent_message_not_found,					 
	Error_permanent_content_not_accepted,				 
	Error_permanent_reply_UCging_limitations_not_met,	 
	Error_permanent_reply_UCging_request_not_accepted,	 
	Error_permanent_reply_UCging_forwarding_denied,  
	Error_permanent_reply_UCging_not_supported, 		 
	Error_permanent_address_hiding_not_supported,		 
	Error_permanent_content_unsupported,  
	Success,								 
	Error_permanent_mmbox_full					 
}CommonError;

typedef struct	 
{
	L32 year;
	L32 month;
	L32 day;
	L32 hour;
	L32 minute;
	L32 second;
}DATE_T;

typedef struct	 
{
	UC *content;
	UL32 font;	//	maybe  NULL
	UL32 length;
}SUBJECT;

typedef struct	 
{
	DATE_T datecontent;    //In seconds from 1970_01_01, 00:00:00 GMT
	UL32 datelength;
}DATE;

typedef struct	 
{
	UC *content; 
	UL32 number;
}TO;

typedef struct	 
{
	UC *content;
	UL32 number;
}CC;

typedef struct	 
{
	UC *content; 
	UL32 number;
}BCC;

typedef struct	 
{
	DATE_T datecontent;
	UL32 length;
	UL32 datelength;  
	UC tokentype;	//for parameter  "expiry" and  "deliverytime"  having
}EXPIRY;

typedef struct	 
{
	DATE_T datecontent;
	UL32 length;
	UL32 datelength;  
	UC tokentype;	//for parameter  "expiry" and  "deliverytime"  having
}DELIVERYTIME;

typedef struct	 //for parameter "from"  having
{
	UC *content;
	UL32 length;
	UC type;
}FROM;

typedef struct 
{
	UC contentypename;
	UL32 contentypelength;	
	UC *contentypetext; //derect to contentype throught text, example for 32 - 127

	UC *accept; 		
	
	UL32 characterset;	//	Accept-Charset,字体设置 
	UC *charactersetext;   //token-text of characterset

	UC *acceptencoding; 
	
	UL32 acceptlanguage; 
	UC *acceptlanguagetext;   //token-text of acceptlanguage
	
	UC acceptranges; 
	UC *acceptrangestext;  //token-text of acceptranges 

	DATE age;											
	UC *allow;										
	UC *authorization; 
	
	UC cachecontrol;	
	UC *cachecontroltext; //token-text of cachecontrol 

	UC connection; 
	UC *connectiontext; //token-text of connection 

	UC *contentbase;	
	
	UC contentencoding; 
	UC *contentencodingtext; //token-text of contentencoding	

	UC contentlanguage; 
	UC *contentlanguagetext; //token-text of contentlanguage	

	UL32 contentlength; 								
	UC *contentlocation;							
	UC *contentmd5; 								
	UC *contentrange;								
	UC *contenttype;									
	DATE date; 
	UC *etag;		
	DATE expires;
	UC *from;	
	UC *host;											
	DATE ifmodifiedsince;							
	UC *ifmatch;										
	UC *ifnonematch;								
	UC *ifrange;										
	DATE ifunmodifiedsince; 							
	UC *location;										
	DATE lastmodified;								
	UC *maxforwards;								
	UC *pragma; 										
	UC *proxyauthenticate;							
	UC *proxauthorization;																	
	UC range;										
	UC *referer;										
	UC *retryafter; 									
	UC *server; 	
	
	UC transferencoding; 
	UC *transferencodingtext; //token-text of contentlanguage	

	UC *upgrade;										
	UC *useragent;									
	UC *vary;											
	UC *via;										
	UC *warning;									
	UC *wwwauthenticate;						
	UC contentdisposition;							
	UC *wapapplicationid;						
	UC *wapcontenturl;							
	UC *wapinitiatorurl;							
	UC *acceptapplication;							
	UC *bearerindication;							
	UC *pushflag;									
	UC *profile;										
	UC *profilediff;									
	UC *profilewarning; 

	UC *contentid;
	UC *contentidname;	 //直接用字符表示关键字contentid
}CONTENTYPE_STRUCTION;

typedef struct 
{
	UL32 typenumber;   //彩信中包含的多媒体个数
	UL32 headerlength; //头和content_type的长度
	UL32 datalength;  //多媒体数据的长度
	UC *mediarray;	 // 用于外部解码的多媒体数据
	CONTENTYPE_STRUCTION Contentype;
}MMS_BODY;

typedef struct 
{
	UC messagetype;
	UC *transcationid;	//Transaction_ID
	D version;
	DATE date;	  //In seconds from 1970-01-01, 00:00:00 GMT
	FROM from;	
	TO *to;
	CC *cc;
	BCC *bcc;
	SUBJECT subject;

	UC messageclass;
	UC *messageclasstext;  //token-text of messageclass,该关键字的值域直接用字符表示

	EXPIRY expiry;
	DELIVERYTIME deliverytime; 
	UC deliveryreport;//MMS_Delivery_Report  81|80	 No | Yes
	UC priority;	//value = Low | Normal | High
	UC sendervisibility;  //Sender_Visibility  80|81   Hide | Show
	UC store;//MMS_Store 81|80	 No | Yes
	UC mmstate;    // MMS_State  value = Draft | Sent | New | Retrieved | Forwarded
	CommonError responsestate;//Mms_Response_Status  Response错误
	UC *responsetext; //Mms_Response_Text	
	UC *messageid;
	UC *contentlocation;  
	CommonError storestate;//Mms_Store_Status  Store错误
	UC *storestatustext;  
	UL32 messagesize;
	UC distributionindicator;//Mms_Distribution_Indicator  81|80   No | Yes
	UC *elementdescriptor;	  
	UC reportallowed;//Mms_Report_Allowed  81|80   No | Yes
	//UC *Mms_Previously_Sent_By;  //string
	UC readreport;//Mms_Read_Report  81|80	 No | Yes
	UC readstatus;	  //  value =  Read <80>  |  Deleted without being read <81>
	CommonError retrievestate;//Mms_Retrieve_Status  Retrieve错误
	UC *retrievetext;
	CONTENTYPE_STRUCTION Contentype;
	MMS_BODY *body;
}MMS_STRUCTION;



/*	 彩信解码编码接口  */

/******************************************************************
	Amoi_MmsDecode(UC MMSStream[]);  //解码接口,返回一个彩信结构体;
	
		   其中,MMSDataStream是需要外部传入的彩信流,其空间需要外部进行控制。

	Amoi_MmsDecodeSpaceFree(MMS_STRUCTION *messmms);   //解码空间释放接口,该函数返回空值,
	
		   其中,messmms为Amoi_MmsDecode()返回的彩信结构体。
******************************************************************/
extern MMS_STRUCTION *Amoi_MmsDecode(UC MMSStream[]); 

extern void Amoi_MmsDecodeSpaceFree(MMS_STRUCTION *messmms);

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

Amoi_MmsEncode(MMS_STRUCTION *messmms);  //编码接口,messmms为当前彩信结构体,
	
	  由外部定义、申请释放空间,该函数返回彩信编码后的数组。其中,这个存储数组空间由内部
	  
		申请,但用完后需外部进行释放或置NULL。
******************************************************************/
extern UC *Amoi_MmsEncode(MMS_STRUCTION *messmms); 



⌨️ 快捷键说明

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