upnphttp.h

来自「这同样是FS8610相关的代码.看起来不错啊.」· C头文件 代码 · 共 48 行

H
48
字号
#ifndef __UPNPHTTP_H__
#define __UPNPHTTP_H__
#include "arch/system.h"

/* UPNP HTTP Method */
#define		UPNPHTTP_METHOD_ERR		       0		/**< Error Method. */
#define		UPNPHTTP_METHOD_GET		       1		/**< GET Method.   */
#define		UPNPHTTP_METHOD_POST		   2		/**< POST Method.  */
#define		UPNPHTTP_METHOD_MPOST		   3		/**< MPOST Method.  */
#define		UPNPHTTP_METHOD_SUBSCRIBE      4		/**< SUBSCRIBE Method.  */
#define		UPNPHTTP_METHOD_UNSUBSCRIBE	   5		/**< POST Method.  */

#define UPNP_XML_HEAD_OK "HTTP/1.1 200 OK\r\nContent-Type: text/xml\r\nContent-Length: "

/** Structure of HTTP REQUEST */
typedef struct 
{
	UINT8	method;					/**< request method. */
	char    path[40];   			/**< request type.   */
	union par_u
    {
        struct post_par_s
        {
            char actionName[20];
            char *msgBody;
            //char varName[20];
            //UINT32 varValue;
        }post_par;
        struct subscribe_par_s
        {
            union arg_u
            {
                char callback[44];
                char sid[44];
            }arg;
        }subscribe_par;
        struct unsubscribe_par_s
        {
            char sid[44];
        }unsubscribe_par;
    }par;
}upnphttp_request_t;


INT8 upnphttp_parse_request(upnphttp_request_t * request, UINT8 * buf);
void upnphttp_proc_request(UINT8 s, UINT8 * buf, INT16 length);

#endif /* __UPNPHTTP_H__ */

⌨️ 快捷键说明

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