Microchip® Advanced Software Framework

simple-udp-ping.c File Reference
#include "contiki.h"
#include "lib/random.h"
#include "sys/ctimer.h"
#include "sys/etimer.h"
#include "net/ip/uip.h"
#include "net/ip/uip-debug.h"
#include "net/ipv6/uip-icmp6.h"
#include "net/ipv6/uip-ds6.h"
#include "dev/leds.h"
#include "simple-udp.h"
#include "simple-udp-ping.h"
#include <stdio.h>
#include <string.h>

Data Structures

struct  pingconn_t
 

Macros

#define _DEBUG_   1
 
#define DATALEN   4
 
#define MAX_DESTINATIONS   NBR_TABLE_CONF_MAX_NEIGHBORS
 
#define PERIOD   (2 * CLOCK_SECOND)
 
#define UDP_PORT   3117
 

Functions

static struct pingconn_tallocate_pingconn (const uip_ipaddr_t *addr)
 
static void echo_reply_callback (uip_ipaddr_t *sender, uint8_t ttl, uint8_t *data, uint16_t datalen)
 
static struct pingconn_tget_pingconn (const uip_ipaddr_t *addr)
 
 PROCESS (simple_udp_ping_process,"Simple ping over UDP")
 
 PROCESS_THREAD (simple_udp_ping_process, ev, data)
 
void simple_udp_ping_clear_conn (uip_ipaddr_t *addr)
 
int simple_udp_ping_get_delay (uip_ipaddr_t *addr)
 
int simple_udp_ping_has_reply (uip_ipaddr_t *addr)
 
int simple_udp_ping_has_sent (uip_ipaddr_t *addr)
 
void simple_udp_ping_init (void)
 
int simple_udp_ping_send_ping (const uip_ipaddr_t *addr)
 

Variables

static struct pingconn_t pingconns [MAX_DESTINATIONS]
 

#define _DEBUG_   1
#define DATALEN   4
#define MAX_DESTINATIONS   NBR_TABLE_CONF_MAX_NEIGHBORS
#define PERIOD   (2 * CLOCK_SECOND)

Referenced by PROCESS_THREAD().

#define UDP_PORT   3117

static struct pingconn_t* allocate_pingconn ( const uip_ipaddr_t addr)
static
static void echo_reply_callback ( uip_ipaddr_t sender,
uint8_t  ttl,
uint8_t *  data,
uint16_t  datalen 
)
static
PROCESS ( simple_udp_ping_process  ,
"Simple ping over UDP"   
)
void simple_udp_ping_clear_conn ( uip_ipaddr_t addr)
int simple_udp_ping_get_delay ( uip_ipaddr_t addr)
int simple_udp_ping_has_reply ( uip_ipaddr_t addr)

References get_pingconn(), NULL, and pingconn_t::replied.

Referenced by make_neighbor(), and make_route().

int simple_udp_ping_has_sent ( uip_ipaddr_t addr)
void simple_udp_ping_init ( void  )

References NULL, and process_start().

Referenced by httpd_cgi_init().

int simple_udp_ping_send_ping ( const uip_ipaddr_t addr)

struct pingconn_t pingconns[MAX_DESTINATIONS]
static