RetroArch
bt.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 __BT_H__
52 #define __BT_H__
53 
54 #include "btopt.h"
55 #include "btarch.h"
56 
57 #define ERR_OK 0
58 #define ERR_MEM -1
59 #define ERR_BUF -2
60 #define ERR_ABRT -3
61 #define ERR_RST -4
62 #define ERR_CLSD -5
63 #define ERR_CONN -6
64 #define ERR_VAL -7
65 #define ERR_ARG -8
66 #define ERR_RTE -9
67 #define ERR_USE -10
68 #define ERR_IF -11
69 #define ERR_PKTSIZE -17
70 
71 #define PROTO_ICMP 1
72 #define PROTO_TCP 6
73 #define PROTO_UDP 17
74 
75 /* Headezes. */
76 #define IP_HLEN 20 /* Size of IP header */
77 #define TRANSPORT_HLEN 20
78 
79 #define UDP_HLEN 8 /* Size of UDP header */
80 #define TCP_HLEN 20 /* Size of TCP header */
81 #define IPUDP_HLEN 28 /* Size of IP + UDP header */
82 #define IPTCP_HLEN 40 /* Size of IP + TCP header */
83 
93 #ifndef HTONS
94 # if BYTE_ORDER == BIG_ENDIAN
95 # define HTONS(n) (n)
96 # else /* BYTE_ORDER == BIG_ENDIAN */
97 # define HTONS(n) ((((u16_t)((n) & 0xff)) << 8) | (((n) & 0xff00) >> 8))
98 # endif /* BYTE_ORDER == BIG_ENDIAN */
99 #endif /* HTONS */
100 
101 
109 #ifndef htons
111 #endif /* htons */
112 
115 #endif /* __UIP_H__ */
116 
117 
GLuint GLfloat * val
Definition: glext.h:7847
#define htons(x)
Definition: inet.h:68
u16 u16_t
Definition: cc.h:45