#include <string.h>
#include <stdio.h>
#include <io.h>
#include <errno.h>
#include <dev/board.h>
#include <sys/thread.h>
#include <sys/timer.h>
#include <sys/socket.h>
#include <sys/confnet.h>
#include <arpa/inet.h>
#include <net/route.h>
Go to the source code of this file.
Defines | |
#define | MY_MAC {0x00,0x06,0x98,0x20,0x00,0x00} |
#define | MY_IP "192.168.1.100" |
#define | MY_MASK "255.255.255.0" |
#define | MY_GATE "192.168.1.254" |
#define | UDP_ECHO_IP "192.168.1.103" |
#define | UDP_ECHO_PORT 7 |
#define | UDP_BUFF_SIZE 256 |
Functions | |
void | print_udp_icmp_error (uint32_t remote_ip, uint16_t remote_port, int error) |
void | UDPReceiver (void *arg) |
int | main (void) |
#define MY_MAC {0x00,0x06,0x98,0x20,0x00,0x00} |
Definition at line 68 of file icmp-udp.c.
#define MY_IP "192.168.1.100" |
Definition at line 69 of file icmp-udp.c.
Referenced by main().
#define MY_MASK "255.255.255.0" |
Definition at line 70 of file icmp-udp.c.
Referenced by main().
#define MY_GATE "192.168.1.254" |
Definition at line 71 of file icmp-udp.c.
Referenced by main().
#define UDP_ECHO_IP "192.168.1.103" |
#define UDP_ECHO_PORT 7 |
#define UDP_BUFF_SIZE 256 |
Definition at line 92 of file icmp-udp.c.
Referenced by main(), and UDPReceiver().
Definition at line 101 of file icmp-udp.c.
References ECONNREFUSED, EHOSTDOWN, EHOSTUNREACH, EMSGSIZE, ENETUNREACH, ENOPROTOOPT, EOPNOTSUPP, inet_ntoa(), and printf.
Referenced by main(), and UDPReceiver().
void UDPReceiver | ( | void * | arg | ) |
Definition at line 133 of file icmp-udp.c.
References NutUdpError(), NutUdpReceiveFrom(), print_udp_icmp_error(), printf, and UDP_BUFF_SIZE.
Referenced by main().
int main | ( | void | ) |
Definition at line 163 of file icmp-udp.c.
References _fileno(), _ioctl(), DEV_CONSOLE, DEV_CONSOLE_NAME, DEV_ETHER, freopen(), inet_addr(), inet_ntoa(), MY_GATE, MY_IP, MY_MASK, NutIpRouteAdd(), NutNetIfConfig(), NutRegisterDevice(), NutSleep(), NutThreadCreate(), NutUdpCreateSocket(), NutUdpError(), NutUdpSendTo(), NutUdpSetSockOpt(), print_udp_icmp_error(), printf, puts, SO_RCVBUF, sprintf, stdout, UART_SETSPEED, UDP_BUFF_SIZE, UDP_ECHO_IP, UDP_ECHO_PORT, and UDPReceiver().