From 9980129098c35a2441d681b7a74c43823a9285fb Mon Sep 17 00:00:00 2001 From: sharath Date: Mon, 22 Oct 2018 20:45:22 +0530 Subject: suppressing get_sockopt error for iperf + lwip Change-Id: Ib0746f908cca0bafbde87b25d99b246fe350636b Signed-off-by: sharath --- stacks/lwip_stack/lwip_src/api/spl_api_msg.c | 8 +++++++- stacks/lwip_stack/lwip_src/common/stackx_common_opt.h | 1 + stacks/lwip_stack/lwip_src/common/stackx_spl_msg.h | 2 ++ stacks/lwip_stack/lwip_src/socket/stackx_tcp.c | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) 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 #include +#include #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 +#include #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; -- cgit 1.2.3-korg