Atmel Software Framework

ping.c File Reference
#include "lwip/opt.h"
#include <assert.h>
#include "lwip/mem.h"
#include "lwip/raw.h"
#include "lwip/icmp.h"
#include "lwip/netif.h"
#include "lwip/sys.h"
#include "lwip/sockets.h"
#include "lwip/inet.h"
#include "lwip/inet_chksum.h"
#include "lwip/init.h"
#include "lwip/ip_addr.h"
#include <net/ping.h>
#include <ports/avr32/timer.h>
#include <util/util.h>
#include "getopt.h"

Data Structures

struct  ping_info_t
 

Macros

#define PING_ID   0xAFAF
 
#define PING_REPLY   (1 << 0)
 

Functions

cmd_state_t cmd_ping (int argc, char *argv[], void *ctx)
 
static int init_ping_info (int argc, char *argv[], struct ping_info_t *ping_info)
 
static void ping_finalize (struct ping_info_t *ping_info)
 
static void ping_prepare_echo (struct icmp_echo_hdr *iecho, struct ping_info_t *ping_info)
 Prepare a echo ICMP request. More...
 
static u8_t ping_recv (void *arg, struct raw_pcb *pcb, struct pbuf *p, struct ip_addr *addr)
 
static void ping_send (struct raw_pcb *raw, struct ping_info_t *ping_info)
 
void ping_set_callback (ping_complete_cb_t cb, void *ctx)
 
void ping_stop (uint32_t *tx_cnt, uint32_t *rx_cnt)
 
static void print_stats (struct ping_info_t *ping_info)
 

Variables

static struct ping_info_t INFO
 

#define PING_ID   0xAFAF

Referenced by ping_prepare_echo(), and ping_recv().

#define PING_REPLY   (1 << 0)

Referenced by cmd_ping(), and ping_recv().

static void ping_finalize ( struct ping_info_t ping_info)
static
static void ping_prepare_echo ( struct icmp_echo_hdr *  iecho,
struct ping_info_t ping_info 
)
static

Prepare a echo ICMP request.

References ping_info_t::data_size, htons, i, PING_ID, ping_info_t::seq_num, and ping_info_t::size.

Referenced by ping_send().

static u8_t ping_recv ( void *  arg,
struct raw_pcb *  pcb,
struct pbuf p,
struct ip_addr *  addr 
)
static
void ping_set_callback ( ping_complete_cb_t  cb,
void *  ctx 
)
void ping_stop ( uint32_t *  tx_cnt,
uint32_t *  rx_cnt 
)
static void print_stats ( struct ping_info_t ping_info)
static

struct ping_info_t INFO
static