#include <TargetConditionals.h>
#endif
-#if TARGET_OS_EMBEDDED
#include <stdio.h>
#include <err.h>
#include <stdlib.h>
#include <strings.h>
+#include <inttypes.h>
#include <sys/errno.h>
#include <sys/types.h>
static const char *mptcpstates[] = {
"CLOSED", "LISTEN", "ESTABLISHED", "CLOSE_WAIT", "FIN_WAIT_1",
- "CLOSING", "LAST_ACK", "FIN_WAIT_2", "TIME_WAIT", "FASTCLOSE_WAIT"
+ "CLOSING", "LAST_ACK", "FIN_WAIT_2", "TIME_WAIT", "TERMINATE"
};
int mptcp_done = 0;
mptcp_flow_t *flow;
int af;
- printf("mptcp/%-2.2d %69s\n", id,
- mptcpstates[mptcp->mptcpci_state]);
+ printf("mptcp/%-2.2d %-8.8x/%-8.8x %50s \n"
+ " [tok(%#"PRIx32") snd(%#"PRIx64") rcv(%#"PRIx64") "
+ "aid(%d)]\n", id,
+ mptcp->mptcpci_mpte_flags, mptcp->mptcpci_flags,
+ mptcpstates[mptcp->mptcpci_state], mptcp->mptcpci_rtoken,
+ mptcp->mptcpci_sndnxt, mptcp->mptcpci_rcvnxt,
+ mptcp->mptcpci_mpte_addrid);
+
+ flow = (mptcp_flow_t*)((caddr_t)mptcp + mptcp->mptcpci_flow_offset);
+
for (i = 0; i < mptcp->mptcpci_nflows; i++) {
- flow = &mptcp->mptcpci_flows[i];
src = &flow->flow_src;
dst = &flow->flow_dst;
af = src->ss_family;
#endif
#undef SIN
#undef SIN6
- tcpci = &flow->flow_ci;
- printf("%s\n", tcpstates[tcpci->tcpci_tcp_info.tcpi_state]);
+ tcpci = (conninfo_tcp_t*)((caddr_t)flow +
+ flow->flow_tcpci_offset);
+ printf("%s \n"
+ " [relseq(%-4.4d), err(%d)]\n",
+ tcpstates[tcpci->tcpci_tcp_info.tcpi_state],
+ flow->flow_relseq,
+ flow->flow_soerror);
+
+ flow = (mptcp_flow_t*)((caddr_t)flow + flow->flow_len);
}
}
}
free(buf);
}
-#endif /* TARGET_OS_EMBEDDED */