Rev 3466 | Rev 3685 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3466 | Rev 3666 | ||
---|---|---|---|
1 | /* |
1 | /* |
2 | * Copyright (c) 2008 Lukas Mejdrech |
2 | * Copyright (c) 2008 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: |
8 | * |
8 | * |
9 | * - Redistributions of source code must retain the above copyright |
9 | * - Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. |
10 | * notice, this list of conditions and the following disclaimer. |
11 | * - Redistributions in binary form must reproduce the above copyright |
11 | * - Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the |
12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. |
13 | * documentation and/or other materials provided with the distribution. |
14 | * - The name of the author may not be used to endorse or promote products |
14 | * - The name of the author may not be used to endorse or promote products |
15 | * derived from this software without specific prior written permission. |
15 | * derived from this software without specific prior written permission. |
16 | * |
16 | * |
17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
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 net |
30 | * @{ |
30 | * @{ |
31 | */ |
31 | */ |
32 | 32 | ||
33 | /** @file |
33 | /** @file |
34 | */ |
34 | */ |
35 | 35 | ||
- | 36 | #define NET_NETIF_COUNT 7 |
|
- | 37 | #define NET_NETWORKING_COUNT 4 |
|
- | 38 | #define NET_LL_COUNT 5 |
|
- | 39 | #define NET_ETHERNET_COUNT 0 |
|
- | 40 | #define NET_IL_COUNT 2 |
|
- | 41 | #define NET_IP_COUNT 4 |
|
- | 42 | #define NET_ARP_COUNT 0 |
|
- | 43 | #define NET_RARP_COUNT 0 |
|
- | 44 | #define NET_ICMP_COUNT 0 |
|
- | 45 | #define NET_UDP_COUNT 0 |
|
- | 46 | #define NET_TCP_COUNT 0 |
|
- | 47 | #define NET_SOCKET_COUNT 0 |
|
- | 48 | ||
36 | #define NET_FIRST 2000 |
49 | #define NET_FIRST 2000 |
- | 50 | ||
37 | #define NET_NETWORKING_FIRST NET_FIRST |
51 | #define NET_NETIF_FIRST NET_FIRST |
- | 52 | #define NET_NETIF_LAST ( NET_NETIF_FIRST + NET_NETIF_COUNT ) |
|
- | 53 | ||
38 | #define NET_NETWORKING_LAST ( NET_NETWORKING_FIRST + 0 ) |
54 | #define NET_NETWORKING_FIRST ( NET_NETIF_LAST + 0 ) |
- | 55 | #define NET_NETWORKING_LAST ( NET_NETWORKING_FIRST + NET_NETWORKING_COUNT ) |
|
- | 56 | ||
39 | #define NET_IP_FIRST ( NET_NETWORKING_LAST + 0 ) |
57 | #define NET_LL_FIRST ( NET_NETWORKING_LAST + 0 ) |
- | 58 | #define NET_LL_LAST ( NET_LL_FIRST + NET_LL_COUNT ) |
|
- | 59 | #define NET_ETHERNET_FIRST ( NET_LL_LAST + 0 ) |
|
- | 60 | #define NET_ETHERNET_LAST ( NET_ETHERNET_FIRST + NET_ETHERNET_COUNT ) |
|
- | 61 | ||
- | 62 | #define NET_IL_FIRST ( NET_ETHERNET_LAST + 0 ) |
|
- | 63 | #define NET_IL_LAST ( NET_IL_FIRST + NET_IL_COUNT ) |
|
40 | #define NET_IP_LAST ( NET_IP_FIRST + 1 ) |
64 | #define NET_IP_FIRST ( NET_IL_LAST + 0 ) |
- | 65 | #define NET_IP_LAST ( NET_IP_FIRST + NET_IP_COUNT ) |
|
- | 66 | ||
41 | #define NET_ARP_FIRST ( NET_IP_LAST + 0 ) |
67 | #define NET_ARP_FIRST ( NET_IP_LAST + 0 ) |
42 | #define NET_ARP_LAST ( NET_ARP_FIRST + 0 ) |
68 | #define NET_ARP_LAST ( NET_ARP_FIRST + NET_ARP_COUNT ) |
43 | #define NET_RARP_FIRST ( NET_ARP_LAST + 0 ) |
69 | #define NET_RARP_FIRST ( NET_ARP_LAST + 0 ) |
44 | #define NET_RARP_LAST ( NET_RARP_FIRST + 0 ) |
70 | #define NET_RARP_LAST ( NET_RARP_FIRST + NET_RARP_COUNT ) |
45 | #define NET_ICMP_FIRST ( NET_RARP_LAST + 0 ) |
71 | #define NET_ICMP_FIRST ( NET_RARP_LAST + 0 ) |
46 | #define NET_ICMP_LAST ( NET_ICMP_FIRST + 0 ) |
72 | #define NET_ICMP_LAST ( NET_ICMP_FIRST + NET_ICMP_COUNT ) |
47 | #define NET_UDP_FIRST ( NET_ICMP_LAST + 0 ) |
73 | #define NET_UDP_FIRST ( NET_ICMP_LAST + 0 ) |
48 | #define NET_UDP_LAST ( NET_UDP_FIRST + 0 ) |
74 | #define NET_UDP_LAST ( NET_UDP_FIRST + NET_UDP_COUNT ) |
49 | #define NET_TCP_FIRST ( NET_UDP_LAST + 0 ) |
75 | #define NET_TCP_FIRST ( NET_UDP_LAST + 0 ) |
50 | #define NET_TCP_LAST ( NET_TCP_FIRST + 0 ) |
76 | #define NET_TCP_LAST ( NET_TCP_FIRST + NET_TCP_COUNT ) |
- | 77 | ||
51 | #define NET_SOCKET_FIRST ( NET_TCP_LAST + 0 ) |
78 | #define NET_SOCKET_FIRST ( NET_TCP_LAST + 0 ) |
52 | #define NET_SOCKET_LAST ( NET_SOCKET_FIRST + 0 ) |
79 | #define NET_SOCKET_LAST ( NET_SOCKET_FIRST + NET_SOCKET_COUNT ) |
- | 80 | ||
53 | #define NET_ETHERNET_FIRST ( NET_SOCKET_LAST + 0 ) |
81 | #define NET_LAST NET_SOCKET_LAST |
- | 82 | ||
54 | #define NET_ETHERNET_LAST ( NET_ETHERNET_FIRST + 0 ) |
83 | #define NET_COUNT ( NET_LAST - NET_FIRST ) |
- | 84 | ||
- | 85 | #define IS_IN_INTERVAL( item, first_inclusive, last_exclusive ) ((( item ) >= ( first_inclusive )) && (( item ) < ( last_exclusive ))) |
|
- | 86 | ||
55 | #define NET_LAST NET_ETHERNET_LAST |
87 | #define IS_NET_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( call ), NET_FIRST, NET_LAST ) |
- | 88 | #define IS_NET_NETWORKING_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( call ), NET_NETWORKING_FIRST, NET_NETWORKING_LAST ) |
|
- | 89 | #define IS_NET_LL_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( call ), NET_LL_FIRST, NET_LL_LAST ) |
|
- | 90 | #define IS_NET_ETHERNET_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( call ), NET_ETHERNET_FIRST, NET_SOCKET_LAST ) |
|
- | 91 | #define IS_NET_IL_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( call ), NET_IL_FIRST, NET_IL_LAST ) |
|
- | 92 | #define IS_NET_IP_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( call ), NET_IP_FIRST, NET_IP_LAST ) |
|
- | 93 | #define IS_NET_ARP_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( call ), NET_ARP_FIRST, NET_ARP_LAST ) |
|
- | 94 | #define IS_NET_RARP_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( call ), NET_RARP_FIRST, NET_RARP_LAST ) |
|
- | 95 | #define IS_NET_UDP_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( call ), NET_UDP_FIRST, NET_UDP_LAST ) |
|
- | 96 | #define IS_NET_TCP_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( call ), NET_TCP_FIRST, NET_TCP_LAST ) |
|
- | 97 | #define IS_NET_SOCKET_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( call ), NET_SOCKET_FIRST, NET_SOCKET_LAST ) |
|
56 | 98 | ||
57 | typedef enum { |
99 | typedef enum { |
- | 100 | NET_NETIF_PROBE = NET_NETIF_FIRST, |
|
- | 101 | NET_NETIF_PROBE_AUTO, |
|
- | 102 | NET_NETIF_REGISTER, |
|
- | 103 | NET_NETIF_SEND, |
|
- | 104 | NET_NETIF_START, |
|
- | 105 | NET_NETIF_STATS, |
|
- | 106 | NET_NETIF_STOP, |
|
- | 107 | NET_NETWORKING_DEVICE = NET_NETWORKING_FIRST, |
|
- | 108 | NET_NETWORKING_GET_CONFIGURATION, |
|
- | 109 | NET_NETWORKING_GET_DEVICE_CONFIGURATION, |
|
- | 110 | NET_NETWORKING_STARTUP, |
|
- | 111 | NET_LL_DEVICE = NET_LL_FIRST, |
|
- | 112 | NET_LL_DEVICE_STATUS_CHANGED, |
|
- | 113 | NET_LL_MTU_CHANGED, |
|
- | 114 | NET_LL_RECEIVED, |
|
- | 115 | NET_LL_REGISTER, |
|
58 | NET_IP_ECHO = NET_IP_FIRST |
116 | NET_IL_DEVICE = NET_IL_FIRST, |
- | 117 | NET_IL_DEVICE_STATUS_CHANGED, |
|
- | 118 | NET_IP_CONFIGURATION_DHCP = NET_IP_FIRST, |
|
- | 119 | NET_IP_CONFIGURATION_STATIC, |
|
- | 120 | NET_IP_ECHO, |
|
- | 121 | NET_IP_TCP_REGISTER |
|
59 | } net_message; |
122 | } net_message; |
60 | 123 | ||
61 | /** @} |
124 | /** @} |
62 | */ |
125 | */ |
63 | 126 |