RetroArch
uip_icmp.h
Go to the documentation of this file.
1 #ifndef __UIP_ICMP_H__
2 #define __UIP_ICMP_H__
3 
4 #include "uip.h"
5 #include "uip_arch.h"
6 
7 #define UIP_ICMP_TTL 255
8 
9 #define UIP_ICMP_ER 0 /* echo reply */
10 #define UIP_ICMP_DUR 3 /* destination unreachable */
11 #define UIP_ICMP_SQ 4 /* source quench */
12 #define UIP_ICMP_RD 5 /* redirect */
13 #define UIP_ICMP_ECHO 8 /* echo */
14 #define UIP_ICMP_TE 11 /* time exceeded */
15 #define UIP_ICMP_PP 12 /* parameter problem */
16 #define UIP_ICMP_TS 13 /* timestamp */
17 #define UIP_ICMP_TSR 14 /* timestamp reply */
18 #define UIP_ICMP_IRQ 15 /* information request */
19 #define UIP_ICMP_IR 16 /* information reply */
20 
21 #define UIP_ICMPH_TYPE(hdr) (ntohs((hdr)->_type_code) >> 8)
22 #define UIP_ICMPH_CODE(hdr) (ntohs((hdr)->_type_code) & 0xff)
23 
24 #define UIP_ICMPH_TYPE_SET(hdr, type) ((hdr)->_type_code = htons(UIP_ICMPH_CODE(hdr) | ((type) << 8)))
25 #define UIP_ICMPH_CODE_SET(hdr, code) ((hdr)->_type_code = htons((code) | (UIP_ICMPH_TYPE(hdr) << 8)))
26 
28  UIP_ICMP_DUR_NET = 0, /* net unreachable */
29  UIP_ICMP_DUR_HOST = 1, /* host unreachable */
30  UIP_ICMP_DUR_PROTO = 2, /* protocol unreachable */
31  UIP_ICMP_DUR_PORT = 3, /* port unreachable */
32  UIP_ICMP_DUR_FRAG = 4, /* fragmentation needed and DF set */
33  UIP_ICMP_DUR_SR = 5 /* source route failed */
34 };
35 
38  PACK_STRUCT_FIELD(u16_t _type_code);
41  PACK_STRUCT_FIELD(u16_t seqno);
44 
47  PACK_STRUCT_FIELD(u16_t _type_code);
49  PACK_STRUCT_FIELD(u32_t unused);
52 
53 struct uip_pbuf;
54 struct uip_netif;
55 
56 
57 void uip_icmpinput(struct uip_pbuf *p,struct uip_netif *inp);
59 
60 #endif
static u32_t chksum(void *dataptr, u16_t len)
Definition: inet6.c:59
Definition: uip_icmp.h:30
Definition: uip_icmp.h:28
Definition: uip_icmp.h:46
#define PACK_STRUCT_BEGIN
Definition: arch.h:46
GLdouble GLdouble t
Definition: glext.h:6398
PACK_STRUCT_BEGIN struct uip_icmp_echo_hdr PACK_STRUCT_STRUCT
void uip_icmp_destunreach(struct uip_pbuf *p, enum uip_icmp_dur_type t)
Definition: uip_icmp.c:80
Definition: uip_pbuf.h:27
void uip_icmpinput(struct uip_pbuf *p, struct uip_netif *inp)
Definition: uip_icmp.c:23
uip_icmp_dur_type
Definition: uip_icmp.h:27
Definition: uip_icmp.h:37
Definition: uip_icmp.h:32
PACK_STRUCT_FIELD(u16_t _type_code)
Definition: uip_icmp.h:29
Definition: uip_icmp.h:31
GLfloat GLfloat p
Definition: glext.h:9809
#define PACK_STRUCT_END
Definition: arch.h:50
PACK_STRUCT_FIELD(u16_t _type_code)
Definition: uip_icmp.h:33
u32 u32_t
Definition: cc.h:47
Definition: uip_netif.h:29
u16 u16_t
Definition: cc.h:45