RetroArch
uip.h
Go to the documentation of this file.
1 
18 /*
19  * Copyright (c) 2001-2003, Adam Dunkels.
20  * All rights reserved.
21  *
22  * Redistribution and use in source and binary forms, with or without
23  * modification, are permitted provided that the following conditions
24  * are met:
25  * 1. Redistributions of source code must retain the above copyright
26  * notice, this list of conditions and the following disclaimer.
27  * 2. Redistributions in binary form must reproduce the above copyright
28  * notice, this list of conditions and the following disclaimer in the
29  * documentation and/or other materials provided with the distribution.
30  * 3. The name of the author may not be used to endorse or promote
31  * products derived from this software without specific prior
32  * written permission.
33  *
34  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
35  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
36  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
37  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
38  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
39  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
40  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
41  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
42  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
43  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
44  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
45  *
46  * This file is part of the uIP TCP/IP stack.
47  *
48  *
49  */
50 
51 #ifndef __UIP_H__
52 #define __UIP_H__
53 
54 #include "uipopt.h"
55 #include "uip_arch.h"
56 #include "uip_ip.h"
57 
58 #define UIP_ERR_OK 0
59 #define UIP_ERR_MEM -1
60 #define UIP_ERR_BUF -2
61 #define UIP_ERR_ABRT -3
62 #define UIP_ERR_RST -4
63 #define UIP_ERR_CLSD -5
64 #define UIP_ERR_CONN -6
65 #define UIP_ERR_VAL -7
66 #define UIP_ERR_ARG -8
67 #define UIP_ERR_RTE -9
68 #define UIP_ERR_USE -10
69 #define UIP_ERR_IF -11
70 #define UIP_ERR_PKTSIZE -17
71 
72 #define UIP_PROTO_ICMP 1
73 #define UIP_PROTO_TCP 6
74 #define UIP_PROTO_UDP 17
75 
76 /* Header sizes. */
77 #define UIP_IP_HLEN 20 /* Size of IP header */
78 #define UIP_TRANSPORT_HLEN 20
79 
80 #define UIP_UDP_HLEN 8 /* Size of UDP header */
81 #define UIP_TCP_HLEN 20 /* Size of TCP header */
82 #define UIP_IPUDP_HLEN 28 /* Size of IP + UDP header */
83 #define UIP_IPTCP_HLEN 40 /* Size of IP + TCP header */
84 
94 #ifndef HTONS
95 # if BYTE_ORDER == BIG_ENDIAN
96 # define HTONS(n) (n)
97 # else /* BYTE_ORDER == BIG_ENDIAN */
98 # define HTONS(n) ((((u16_t)((n) & 0xff)) << 8) | (((n) & 0xff00) >> 8))
99 # endif /* BYTE_ORDER == BIG_ENDIAN */
100 #endif /* HTONS */
101 
107 struct uip_stats {
108  struct {
127  } ip;
128  struct {
129  uip_stats_t drop;
130  uip_stats_t recv;
131  uip_stats_t sent;
134  } icmp;
135  struct {
136  uip_stats_t drop;
137  uip_stats_t recv;
138  uip_stats_t sent;
149  } tcp;
150 };
151 
157 extern struct uip_stats uip_stat;
158 
166 #ifndef htons
168 #endif /* htons */
169 
172 #endif /* __UIP_H__ */
173 
174 
GLuint GLfloat * val
Definition: glext.h:7847
uip_stats_t protoerr
Definition: uip.h:125
struct uip_stats uip_stat
uip_stats_t synrst
Definition: uip.h:147
struct uip_stats::@871 icmp
uip_stats_t ackerr
Definition: uip.h:141
Definition: uip.h:107
uip_stats_t fragerr
Definition: uip.h:121
uip_stats_t sent
Definition: uip.h:113
uip_stats_t hblenerr
Definition: uip.h:117
uip_stats_t rst
Definition: uip.h:143
uip_stats_t syndrop
Definition: uip.h:145
struct uip_stats::@870 ip
#define htons(x)
Definition: inet.h:68
uip_stats_t rexmit
Definition: uip.h:144
uip_stats_t chkerr
Definition: uip.h:123
uip_stats_t vhlerr
Definition: uip.h:115
uip_stats_t recv
Definition: uip.h:111
uip_stats_t drop
Definition: uip.h:109
struct uip_stats::@872 tcp
uip_stats_t lblenerr
Definition: uip.h:119
u16 uip_stats_t
Definition: uipopt.h:123
u16 u16_t
Definition: cc.h:45
uip_stats_t typeerr
Definition: uip.h:132