Microchip® Advanced Software Framework

winc1500/iperf_server_example/iperf.c File Reference

WINC1500 iperf.

Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.

#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include "asf.h"
#include "iperf.h"
#include "driver/include/m2m_wifi.h"
#include "socket/include/socket.h"
#include "conf_winc.h"

Data Structures

struct  tstrIperfSocketInfo
 
struct  tstrIperfUdpMsg
 
struct  tstrIperfUdpServerMsg
 
struct  tstrIperfUdpState
 
struct  tstrIperfUint64
 

Macros

#define IPERF_MAX_UDP_STATE   4
 

Functions

static char * inet_ntoa (uint32 in)
 
static void Iperf1msTimerCB (void)
 
static void IperfAddUint64 (tstrIperfUint64 *pstrUint64, uint32 u32Inc)
 
static uint32 IperfCalculateBandwidthKbps (tstrIperfUint64 *pstrUint64, uint32 u32Time)
 
NMI_API sint8 IperfCreate (tstrIperfInit *pstrIperfInit, bool bIsPaused)
 
static void IperfDecrementTimerUse (void)
 
static void IperfIncrementTimerUse (void)
 
NMI_API void IperfInit (void)
 
NMI_API void IperfPrintStats (SOCKET sock)
 
static void IperfPrintUdpServerStats (SOCKET sock, uint8 u8UdpStateIdx)
 
NMI_API sint8 IperfSocketClose (SOCKET sock)
 
void IperfSocketEventHandler (SOCKET sock, uint8 u8Msg, void *pvMsg)
 
static sint8 IperfSocketStop (SOCKET sock)
 
NMI_API sint8 IperfStart (void)
 
NMI_API sint8 IperfStop (SOCKET sock)
 
void IperfTCP_Client_SendTestPacket (void)
 
static sint8 IperfTCP_ClientStart (tstrIperfInit *pstrIperfInit, bool bIsPaused)
 
static sint8 IperfTCP_SendTestPacket (SOCKET sock)
 
static sint8 IperfTCP_ServerStart (tstrIperfInit *pstrIperfInit)
 
static SOCKET IperfUDP_ClientStart (tstrIperfInit *pstrIperfInit, bool bIsPaused)
 
static sint8 IperfUDP_SendTestPacket (SOCKET sock, struct sockaddr_in *paddr)
 
static sint8 IperfUDP_ServerStart (tstrIperfInit *pstrIperfInit)
 
static sint8 IperfUDP_WriteFIN (SOCKET sock)
 
NMI_API void IperfUpdate (void)
 
static uint32_t ntohl (uint32_t n)
 

Variables

uint32 clientIPAddress
 
static tstrIperfSocketInfo gastrIperfSocketInfo [MAX_SOCKET]
 
static tstrIperfUdpState gastrIperfUdpState [IPERF_MAX_UDP_STATE]
 
static tstrIperfUdpMsg gstrRxMsgBuffer
 
static tstrIperfUdpMsg gstrTxMsgBuffer
 
static tstrIperfUdpServerMsg gstrTxSrvMsg
 
uint32 gu32IPAddress
 
static uint8 gu8NumSockets
 
app_status iperf_app_stat
 
static client_hdr iperf_tcp_serv
 
SOCKET tcp_client_sock
 
uint32_t tcp_serv_pack_recv
 
static uint32_t u32LastStatsTime
 
static uint32_t u32msTicks
 
uint32_t udp_serv_pack_recv
 
SOCKET udp_server_sock
 

#define IPERF_MAX_UDP_STATE   4

static char* inet_ntoa ( uint32  in)
static
static void Iperf1msTimerCB ( void  )
static

References u32msTicks.

Referenced by IperfIncrementTimerUse().

static void IperfAddUint64 ( tstrIperfUint64 pstrUint64,
uint32  u32Inc 
)
static
static uint32 IperfCalculateBandwidthKbps ( tstrIperfUint64 pstrUint64,
uint32  u32Time 
)
static
NMI_API sint8 IperfCreate ( tstrIperfInit pstrIperfInit,
bool  bIsPaused 
)

Referenced by main().

static void IperfDecrementTimerUse ( void  )
static
NMI_API void IperfInit ( void  )

Referenced by main().

NMI_API void IperfPrintStats ( SOCKET  sock)
void IperfSocketEventHandler ( SOCKET  sock,
uint8  u8Msg,
void *  pvMsg 
)

Referenced by main().

static sint8 IperfSocketStop ( SOCKET  sock)
static
NMI_API sint8 IperfStop ( SOCKET  sock)
void IperfTCP_Client_SendTestPacket ( void  )

Referenced by main().

NMI_API void IperfUpdate ( void  )

Referenced by main().

static uint32_t ntohl ( uint32_t  n)
static

Referenced by IperfSocketEventHandler().

uint32 clientIPAddress

Referenced by IperfSocketEventHandler(), and main().

tstrIperfSocketInfo gastrIperfSocketInfo[MAX_SOCKET]
static
tstrIperfUdpState gastrIperfUdpState[IPERF_MAX_UDP_STATE]
static
tstrIperfUdpMsg gstrRxMsgBuffer
static
tstrIperfUdpMsg gstrTxMsgBuffer
static
tstrIperfUdpServerMsg gstrTxSrvMsg
static
uint8 gu8NumSockets
static
app_status iperf_app_stat
client_hdr iperf_tcp_serv
static
SOCKET tcp_client_sock
uint32_t tcp_serv_pack_recv

Referenced by IperfPrintStats(), and main().

uint32_t u32LastStatsTime
static
uint32_t udp_serv_pack_recv

Referenced by IperfPrintUdpServerStats(), and main().

SOCKET udp_server_sock

Referenced by IperfSocketEventHandler(), and main().