#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_t * | allocate_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_t * | get_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 |
Referenced by allocate_pingconn(), get_pingconn(), and PROCESS_THREAD().
#define PERIOD (2 * CLOCK_SECOND) |
Referenced by PROCESS_THREAD().
#define UDP_PORT 3117 |
|
static |
References pingconn_t::host, i, pingconn_t::in_use, MAX_DESTINATIONS, pingconns, and uip_ipaddr_copy.
Referenced by simple_udp_ping_send_ping().
|
static |
References CLOCK_SECOND, clock_time(), pingconn_t::delay, pingconn_t::echo_time, pingconn_t::echo_time2, get_pingconn(), NULL, printf, pingconn_t::replied, RTIMER_NOW, RTIMER_SECOND, pingconn_t::sent, and uip_debug_ipaddr_print().
Referenced by PROCESS_THREAD().
|
static |
PROCESS | ( | simple_udp_ping_process | , |
"Simple ping over UDP" | |||
) |
PROCESS_THREAD | ( | simple_udp_ping_process | , |
ev | , | ||
data | |||
) |
References clock_time(), echo_reply_callback(), pingconn_t::echo_time, pingconn_t::echo_time2, etimer_expired(), etimer_set(), pingconn_t::host, i, ICMP6_ECHO_REQUEST, pingconn_t::in_use, MAX_DESTINATIONS, PERIOD, pingconns, printf, PROCESS_BEGIN, PROCESS_END, PROCESS_WAIT_EVENT_UNTIL, pingconn_t::replied, RTIMER_NOW, pingconn_t::sent, uip_debug_ipaddr_print(), uip_icmp6_echo_reply_callback_add(), uip_icmp6_send(), and pingconn_t::waiting.
void simple_udp_ping_clear_conn | ( | uip_ipaddr_t * | addr | ) |
References get_pingconn(), NULL, pingconn_t::replied, and pingconn_t::sent.
int simple_udp_ping_get_delay | ( | uip_ipaddr_t * | addr | ) |
References pingconn_t::delay, get_pingconn(), NULL, pingconn_t::replied, and RTIMER_SECOND.
Referenced by make_neighbor(), and make_route().
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 | ) |
References get_pingconn(), NULL, pingconn_t::sent, and pingconn_t::waiting.
Referenced by make_neighbor(), and make_route().
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 | ) |
References allocate_pingconn(), get_pingconn(), NULL, printf, pingconn_t::replied, uip_debug_ipaddr_print(), and pingconn_t::waiting.
|
static |
Referenced by allocate_pingconn(), get_pingconn(), and PROCESS_THREAD().