aboutsummaryrefslogtreecommitdiffstats
path: root/stacks
diff options
context:
space:
mode:
Diffstat (limited to 'stacks')
-rw-r--r--stacks/lwip_stack/lwip_src/api/spl_api_msg.c8
-rw-r--r--stacks/lwip_stack/lwip_src/common/stackx_common_opt.h1
-rw-r--r--stacks/lwip_stack/lwip_src/common/stackx_spl_msg.h2
-rw-r--r--stacks/lwip_stack/lwip_src/socket/stackx_tcp.c1
4 files changed, 11 insertions, 1 deletions
diff --git a/stacks/lwip_stack/lwip_src/api/spl_api_msg.c b/stacks/lwip_stack/lwip_src/api/spl_api_msg.c
index 1c9bf92..d8e088a 100644
--- a/stacks/lwip_stack/lwip_src/api/spl_api_msg.c
+++ b/stacks/lwip_stack/lwip_src/api/spl_api_msg.c
@@ -22,6 +22,7 @@
//#include "sockets.h"
#include <netinet/in.h>
#include <errno.h>
+#include <netinet/tcp.h>
#include "stackx_prot_com.h"
#include "spl_api.h"
@@ -2523,7 +2524,12 @@ do_get_tcpproto_getsockopt_internal (struct common_pcb *cpcb,
NSPOL_LOGDBG (SOCKETS_DEBUG, "]fd=%d,SPL_TCP_KEEPCNT=%d",
cpcb->socket, *(int *) optval);
break;
-
+ case SPL_TCP_INFO:
+ ((struct tcp_info *) optval)->tcpi_total_retrans = (int) tpcb->nrtx;
+ ((struct tcp_info *) optval)->tcpi_snd_mss = (int) tpcb->mss;
+ ((struct tcp_info *) optval)->tcpi_rtt = (int) tpcb->sa;
+ ((struct tcp_info *) optval)->tcpi_snd_cwnd = (int) tpcb->cwnd;
+ break;
default:
NSPOL_LOGDBG (SOCKETS_DEBUG, "unsupported]optname=%d", optname);
SET_MSG_ERR (m, EOPNOTSUPP);
diff --git a/stacks/lwip_stack/lwip_src/common/stackx_common_opt.h b/stacks/lwip_stack/lwip_src/common/stackx_common_opt.h
index d2d01e5..feccc3f 100644
--- a/stacks/lwip_stack/lwip_src/common/stackx_common_opt.h
+++ b/stacks/lwip_stack/lwip_src/common/stackx_common_opt.h
@@ -102,6 +102,7 @@ extern "C" {
#define SPL_TCP_KEEPCNT 0x06
#define SPL_TCP_LINGER2 0x08
#define SPL_TCP_DEFER_ACCEPT 0x09
+#define SPL_TCP_INFO 0x0B
typedef enum spl_netconn_type
{
diff --git a/stacks/lwip_stack/lwip_src/common/stackx_spl_msg.h b/stacks/lwip_stack/lwip_src/common/stackx_spl_msg.h
index 119c26a..3088150 100644
--- a/stacks/lwip_stack/lwip_src/common/stackx_spl_msg.h
+++ b/stacks/lwip_stack/lwip_src/common/stackx_spl_msg.h
@@ -21,6 +21,7 @@
#include "stackx_spl_share.h"
#include "stackx_common_opt.h"
#include <sys/socket.h>
+#include <netinet/tcp.h>
#ifdef __cplusplus
/* *INDENT-OFF* */
@@ -207,6 +208,7 @@ typedef struct
//struct in_addr inaddr_optval;
//struct linger _linger;
struct timeval timeval_optval;
+ struct tcp_info tpinfo;
//ipmreq ipmreq_optval; //Multicast support later
} optval;
diff --git a/stacks/lwip_stack/lwip_src/socket/stackx_tcp.c b/stacks/lwip_stack/lwip_src/socket/stackx_tcp.c
index 3225c2f..0042e54 100644
--- a/stacks/lwip_stack/lwip_src/socket/stackx_tcp.c
+++ b/stacks/lwip_stack/lwip_src/socket/stackx_tcp.c
@@ -498,6 +498,7 @@ sbr_getsockopt_ipproto_tcp (int optname, void *optval, socklen_t optlen)
case SPL_TCP_KEEPIDLE:
case SPL_TCP_KEEPINTVL:
case SPL_TCP_KEEPCNT:
+ case SPL_TCP_INFO:
break;
default:
err = ENOPROTOOPT;