mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-14 12:16:21 +08:00
altcp: added 'addrinfo' and 'tcp_state' functions
This commit is contained in:
@@ -39,8 +39,6 @@
|
||||
*
|
||||
* Author: Simon Goldschmidt <goldsimon@gmx.de>
|
||||
*
|
||||
* @todo:
|
||||
* - access to local/remote ip/port
|
||||
*/
|
||||
#ifndef LWIP_HDR_ALTCP_H
|
||||
#define LWIP_HDR_ALTCP_H
|
||||
@@ -112,11 +110,14 @@ u16_t altcp_mss(struct altcp_pcb *conn);
|
||||
u16_t altcp_sndbuf(struct altcp_pcb *conn);
|
||||
u16_t altcp_sndqueuelen(struct altcp_pcb *conn);
|
||||
|
||||
#define TCP_PRIO_MIN 1
|
||||
#define TCP_PRIO_NORMAL 64
|
||||
#define TCP_PRIO_MAX 127
|
||||
void altcp_setprio(struct altcp_pcb *conn, u8_t prio);
|
||||
|
||||
err_t altcp_get_tcp_addrinfo(struct altcp_pcb *conn, int local, ip_addr_t *addr, u16_t *port);
|
||||
|
||||
#ifdef LWIP_DEBUG
|
||||
enum tcp_state altcp_dbg_get_tcp_state(struct altcp_pcb *conn);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -157,6 +158,12 @@ void altcp_setprio(struct altcp_pcb *conn, u8_t prio);
|
||||
#define altcp_sndqueuelen tcp_sndqueuelen
|
||||
#define altcp_setprio tcp_setprio
|
||||
|
||||
#define altcp_get_tcp_addrinfo tcp_get_tcp_addrinfo
|
||||
|
||||
#ifdef LWIP_DEBUG
|
||||
#define altcp_dbg_get_tcp_state tcp_dbg_get_tcp_state
|
||||
#endif
|
||||
|
||||
#endif /* LWIP_ALTCP */
|
||||
|
||||
#endif /* LWIP_HDR_ALTCP_H */
|
||||
|
||||
@@ -78,6 +78,11 @@ typedef void (*altcp_setprio_fn)(struct altcp_pcb *conn, u8_t prio);
|
||||
|
||||
typedef void (*altcp_dealloc_fn)(struct altcp_pcb *conn);
|
||||
|
||||
typedef err_t (*altcp_get_tcp_addrinfo_fn)(struct altcp_pcb *conn, int local, ip_addr_t *addr, u16_t *port);
|
||||
#ifdef LWIP_DEBUG
|
||||
typedef enum tcp_state (*altcp_dbg_get_tcp_state_fn)(struct altcp_pcb *conn);
|
||||
#endif
|
||||
|
||||
struct altcp_functions {
|
||||
altcp_set_poll_fn set_poll;
|
||||
altcp_recved_fn recved;
|
||||
@@ -94,6 +99,10 @@ struct altcp_functions {
|
||||
altcp_sndqueuelen_fn sndqueuelen;
|
||||
altcp_setprio_fn setprio;
|
||||
altcp_dealloc_fn dealloc;
|
||||
altcp_get_tcp_addrinfo_fn addrinfo;
|
||||
#ifdef LWIP_DEBUG
|
||||
altcp_dbg_get_tcp_state_fn dbg_get_tcp_state;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -395,8 +395,9 @@ void tcp_setprio (struct tcp_pcb *pcb, u8_t prio);
|
||||
|
||||
err_t tcp_output (struct tcp_pcb *pcb);
|
||||
|
||||
err_t tcp_tcp_get_tcp_addrinfo(struct tcp_pcb *pcb, int local, ip_addr_t *addr, u16_t *port);
|
||||
|
||||
const char* tcp_debug_state_str(enum tcp_state s);
|
||||
#define tcp_dbg_get_tcp_state(pcb) ((pcb)->state)
|
||||
|
||||
/* for compatibility with older implementation */
|
||||
#define tcp_new_ip6() tcp_new_ip_type(IPADDR_TYPE_V6)
|
||||
|
||||
@@ -75,6 +75,8 @@ enum tcp_state {
|
||||
#define TCP_PRIO_NORMAL 64
|
||||
#define TCP_PRIO_MAX 127
|
||||
|
||||
const char* tcp_debug_state_str(enum tcp_state s);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user