Data Structures | |
struct | icmp_echo_hdr |
This is the standard ICMP header only that the u32_t data is splitted to two u16_t like ICMP echo needs it. More... | |
Macros | |
#define | ICMP_DUR 3 /* destination unreachable */ |
#define | ICMP_ECHO 8 /* echo */ |
#define | ICMP_ER 0 /* echo reply */ |
#define | ICMP_IR 16 /* information reply */ |
#define | ICMP_IRQ 15 /* information request */ |
#define | ICMP_PP 12 /* parameter problem */ |
#define | ICMP_RD 5 /* redirect */ |
#define | ICMP_SQ 4 /* source quench */ |
#define | ICMP_TE 11 /* time exceeded */ |
#define | ICMP_TS 13 /* timestamp */ |
#define | ICMP_TSR 14 /* timestamp reply */ |
#define | ICMPH_CODE(hdr) ((hdr)->code) |
#define | ICMPH_CODE_SET(hdr, c) ((hdr)->code = (c)) |
#define | ICMPH_TYPE(hdr) ((hdr)->type) |
#define | ICMPH_TYPE_SET(hdr, t) ((hdr)->type = (t)) |
Combines type and code to an u16_t. More... | |
Enumerations | |
enum | icmp_dur_type { ICMP_DUR_NET = 0, ICMP_DUR_HOST = 1, ICMP_DUR_PROTO = 2, ICMP_DUR_PORT = 3, ICMP_DUR_FRAG = 4, ICMP_DUR_SR = 5 } |
enum | icmp_te_type { ICMP_TE_TTL = 0, ICMP_TE_FRAG = 1 } |
Functions | |
void | icmp_dest_unreach (struct pbuf *p, enum icmp_dur_type t) |
Send an icmp 'destination unreachable' packet, called from ip_input() if the transport layer protocol is unknown and from udp_input() if the local port is not bound. More... | |
void | icmp_input (struct pbuf *p, struct netif *inp) |
Processes ICMP input packets, called from ip_input(). More... | |
void | icmp_time_exceeded (struct pbuf *p, enum icmp_te_type t) |
Send a 'time exceeded' packet, called from ip_forward() if TTL is 0. More... | |
Variables | |
PACK_STRUCT_BEGIN struct icmp_echo_hdr | PACK_STRUCT_STRUCT |
#define ICMP_DUR 3 /* destination unreachable */ |
Referenced by icmp_dest_unreach().
#define ICMP_ECHO 8 /* echo */ |
Referenced by icmp_input().
#define ICMP_ER 0 /* echo reply */ |
Referenced by icmp_input().
#define ICMP_IR 16 /* information reply */ |
#define ICMP_IRQ 15 /* information request */ |
#define ICMP_PP 12 /* parameter problem */ |
#define ICMP_RD 5 /* redirect */ |
#define ICMP_SQ 4 /* source quench */ |
#define ICMP_TE 11 /* time exceeded */ |
Referenced by icmp_time_exceeded().
#define ICMP_TS 13 /* timestamp */ |
#define ICMP_TSR 14 /* timestamp reply */ |
#define ICMPH_CODE | ( | hdr | ) | ((hdr)->code) |
#define ICMPH_CODE_SET | ( | hdr, | |
c | |||
) | ((hdr)->code = (c)) |
#define ICMPH_TYPE | ( | hdr | ) | ((hdr)->type) |
#define ICMPH_TYPE_SET | ( | hdr, | |
t | |||
) | ((hdr)->type = (t)) |
Combines type and code to an u16_t.
Referenced by icmp_input().
enum icmp_dur_type |
enum icmp_te_type |
void icmp_dest_unreach | ( | struct pbuf * | p, |
enum icmp_dur_type | t | ||
) |
Send an icmp 'destination unreachable' packet, called from ip_input() if the transport layer protocol is unknown and from udp_input() if the local port is not bound.
p | the input packet for which the 'unreachable' should be sent, p->payload pointing to the IP header |
t | type of the 'unreachable' packet |
References ICMP_DUR, and icmp_send_response().
Referenced by ip_input(), and udp_input().
Processes ICMP input packets, called from ip_input().
Currently only processes icmp echo requests and sends out the echo response.
p | the icmp echo request packet, p->payload pointing to the ip header |
inp | the netif on which this packet was received |
References current_iphdr_dest, ERR_OK, ICMP_DEBUG, ICMP_ECHO, ICMP_ER, ICMP_STATS_INC, ICMPH_TYPE_SET, if(), inet_chksum(), inet_chksum_pbuf(), ip_addr_copy, ip_addr_isbroadcast, ip_addr_ismulticast, ip_current_dest_addr, ip_current_src_addr, IP_HDRINCL, IP_HLEN, ip_output_if(), IP_PROTO_ICMP, IPH_CHKSUM_SET, IPH_HL, IPH_TTL_SET, iphdr, pbuf::len, LWIP_ASSERT, LWIP_DEBUGF, NULL, pbuf::payload, pbuf_alloc(), pbuf_copy(), pbuf_free(), pbuf_header(), PBUF_IP_HLEN, PBUF_LINK, PBUF_RAM, PP_HTONS, S16_F, snmp_inc_icmpinerrors, snmp_inc_icmpinmsgs, snmp_inc_icmpoutechoreps, snmp_inc_icmpoutmsgs, pbuf::tot_len, and U16_F.
Referenced by ip_input().
void icmp_time_exceeded | ( | struct pbuf * | p, |
enum icmp_te_type | t | ||
) |
Send a 'time exceeded' packet, called from ip_forward() if TTL is 0.
p | the input packet for which the 'time exceeded' should be sent, p->payload pointing to the IP header |
t | type of the 'time exceeded' packet |
References icmp_send_response(), and ICMP_TE.
Referenced by ip_reass_free_complete_datagram().
PACK_STRUCT_BEGIN struct icmp_echo_hdr PACK_STRUCT_STRUCT |