http_udp_core.h

来自「AMLOGIC DPF source code」· C头文件 代码 · 共 80 行

H
80
字号
/*******************************************************************
 * 
 *  Copyright C 2005 by Amlogic, Inc. All Rights Reserved.
 *
 *  Description: 
 *
 *  Author: Eric Knudstrup
 *  Created: Mon Jun 27 11:47:27 2005
 *
 *******************************************************************/

#ifndef HTTP_UDP_CORE_H
#define HTTP_UDP_CORE_H

/**
 * @file http_udp_core.h
 */

/** @defgroup http_udp_core HTTP UDP connection functions and data structures
 * @ingroup Network
 */

/** @addtogroup http_udp_core */
/* @{ */

typedef struct http_udp_con_s  HTTPUdpConnection_t;

/** UDP message receive callback definition */
typedef void (*HTTPUdpCb_t) (HTTPUdpConnection_t *client, HTTPInputMessage_t *message,
                             struct ip_addr *addr, u16_t port);

struct http_udp_con_s {
    struct udp_pcb *pcb;
    HTTPParser *http_parser;
    HTTPUdpCb_t completion_cb;
    HTTPOutHeaderList_t http_append_headers; /* Static headers to append to requests */
    void *user_context;
};

/*;emacs generated header for file http_udp_core.c. Global function declarations only. */
/**
 * Send a connectionless HTTP message. The \a message will not be freed.
 *
 * @param[in] conn Connection to send to.
 * @param[in] message HTTPOutputMessage_t to send.
 * @param[in] addr Address of remote.
 * @param[in] port Remote port number in host's byte order.
 *
 * @returns ERR_OK if successful, may return ERR_MEM if an allocation failed.
 */
extern err_t
http_udp_send(HTTPUdpConnection_t *conn, HTTPOutputMessage_t *message,
 struct ip_addr *addr, u16_t port);

/**
 * Release all context associated with \a conn.
 */
extern void
http_udp_destroy(HTTPUdpConnection_t *conn);

/**
 * Create a new connectionless HTTP connection.
 *
 * @param[in] receive_callback Message receive callback.
 * @param[in] parser HTTPParser to bind to.
 * @param[in] user_context Opaque context returned to the application when a message is received.
 * @param[in] port Local UDP port to bind to in host byte order. If 0, one will be
 * allocated.
 * @returns An HTTPUdpConnection_t pointer if successful, NULL if allocation failed.
 */
extern HTTPUdpConnection_t *
http_udp_create(HTTPUdpCb_t receive_callback, HTTPParser *parser,
 void *user_context, u16_t port);


/*;end emacs generated header for file http_udp_core.c. Global function declarations only. */

#endif
/*@}*/

⌨️ 快捷键说明

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