Rev 3886 | Rev 3991 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3886 | Rev 3912 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /* |
1 | /* |
2 | * Copyright (c) 2008 Lukas Mejdrech |
2 | * Copyright (c) 2009 Lukas Mejdrech |
3 | * All rights reserved. |
3 | * All rights reserved. |
4 | * |
4 | * |
5 | * Redistribution and use in source and binary forms, with or without |
5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions |
6 | * modification, are permitted provided that the following conditions |
7 | * are met: |
7 | * are met: |
Line 24... | Line 24... | ||
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | */ |
27 | */ |
28 | 28 | ||
29 | /** @addtogroup net |
29 | /** @addtogroup ip |
30 | * @{ |
30 | * @{ |
31 | */ |
31 | */ |
32 | 32 | ||
33 | /** |
- | |
34 | * @file |
33 | /** @file |
35 | * Interent protocol header and options definitions. |
34 | * Internet protocol header and options definitions. |
36 | * Names according to the linux src/include/linux/ip.h header file. |
35 | * Names according to the linux src/include/linux/ip.h header file. |
37 | */ |
36 | */ |
38 | 37 | ||
39 | #ifndef __NET_IP_HEADER_H__ |
38 | #ifndef __NET_IP_HEADER_H__ |
40 | #define __NET_IP_HEADER_H__ |
39 | #define __NET_IP_HEADER_H__ |
41 | 40 | ||
42 | #include <byteorder.h> |
41 | #include <byteorder.h> |
43 | #include <types.h> |
42 | #include <types.h> |
44 | 43 | ||
- | 44 | /** Type definition of the internet header. |
|
- | 45 | * @see ip_header |
|
- | 46 | */ |
|
45 | typedef struct ip_header ip_header_t; |
47 | typedef struct ip_header ip_header_t; |
- | 48 | ||
- | 49 | /** Type definition of the internet header pointer. |
|
- | 50 | * @see ip_header |
|
- | 51 | */ |
|
46 | typedef ip_header_t * ip_header_ref; |
52 | typedef ip_header_t * ip_header_ref; |
47 | 53 | ||
- | 54 | ||
48 | /** Internet header. |
55 | /** Internet header. |
49 | * The variable options should be included after the header itself and indicated by the increased header length value. |
56 | * The variable options should be included after the header itself and indicated by the increased header length value. |
50 | */ |
57 | */ |
51 | struct ip_header{ |
58 | struct ip_header{ |
52 | #ifdef ARCH_IS_BIG_ENDIAN |
59 | #ifdef ARCH_IS_BIG_ENDIAN |
Line 153... | Line 160... | ||
153 | }; |
160 | }; |
154 | 161 | ||
155 | #define IPTOS_TOS_MASK 0x1E |
162 | #define IPTOS_TOS_MASK 0x1E |
156 | #define IPTOS_PRECEDENCE_SHIFT 5 |
163 | #define IPTOS_PRECEDENCE_SHIFT 5 |
157 | #define IPTOS_DELAY_SHIFT 4 |
164 | #define IPTOS_DELAY_SHIFT 4 |
158 | #define IPTOS_TROUGHPUT_SHIFT 3 |
165 | #define IPTOS_THROUGHPUT_SHIFT 3 |
159 | #define IPTOS_RELIABILITY_SHIFT 2 |
166 | #define IPTOS_RELIABILITY_SHIFT 2 |
160 | #define IPTOS_COST_SHIFT 1 |
167 | #define IPTOS_COST_SHIFT 1 |
161 | 168 | ||
162 | #define IPTOS_NORMALDELAY ( 0x0 << IPTOS_DELAY_SHIFT ) |
169 | #define IPTOS_NORMALDELAY ( 0x0 << IPTOS_DELAY_SHIFT ) |
163 | #define IPTOS_LOWDELAY ( 0x1 << IPTOS_DELAY_SHIFT ) |
170 | #define IPTOS_LOWDELAY ( 0x1 << IPTOS_DELAY_SHIFT ) |