Subversion Repositories HelenOS

Rev

Rev 4722 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4722 Rev 4743
Line 46... Line 46...
46
 
46
 
47
#include "structures/measured_strings.h"
47
#include "structures/measured_strings.h"
48
#include "structures/packet/packet.h"
48
#include "structures/packet/packet.h"
49
 
49
 
50
#define NET_NETIF_COUNT     6
50
#define NET_NETIF_COUNT     6
51
#define NET_NET_COUNT       9
51
#define NET_NET_COUNT       3
52
#define NET_NIL_COUNT       7
52
#define NET_NIL_COUNT       7
53
#define NET_ETH_COUNT       0
53
#define NET_ETH_COUNT       0
54
#define NET_IL_COUNT        6
54
#define NET_IL_COUNT        6
55
#define NET_IP_COUNT        4
55
#define NET_IP_COUNT        4
56
#define NET_ARP_COUNT       5
56
#define NET_ARP_COUNT       5
57
#define NET_RARP_COUNT      0
-
 
58
#define NET_ICMP_COUNT      7
57
#define NET_ICMP_COUNT      6
59
#define NET_TL_COUNT        1
58
#define NET_TL_COUNT        1
60
#define NET_UDP_COUNT       0
59
#define NET_UDP_COUNT       0
61
#define NET_TCP_COUNT       0
60
#define NET_TCP_COUNT       0
62
#define NET_PACKET_COUNT    5
61
#define NET_PACKET_COUNT    5
63
#define NET_SOCKET_COUNT    14
62
#define NET_SOCKET_COUNT    14
Line 80... Line 79...
80
#define NET_IP_FIRST        ( NET_IL_LAST + 0 )
79
#define NET_IP_FIRST        ( NET_IL_LAST + 0 )
81
#define NET_IP_LAST         ( NET_IP_FIRST + NET_IP_COUNT )
80
#define NET_IP_LAST         ( NET_IP_FIRST + NET_IP_COUNT )
82
 
81
 
83
#define NET_ARP_FIRST       ( NET_IP_LAST + 0 )
82
#define NET_ARP_FIRST       ( NET_IP_LAST + 0 )
84
#define NET_ARP_LAST        ( NET_ARP_FIRST + NET_ARP_COUNT )
83
#define NET_ARP_LAST        ( NET_ARP_FIRST + NET_ARP_COUNT )
85
#define NET_RARP_FIRST      ( NET_ARP_LAST + 0 )
-
 
86
#define NET_RARP_LAST       ( NET_RARP_FIRST + NET_RARP_COUNT )
-
 
87
#define NET_ICMP_FIRST      ( NET_RARP_LAST + 0 )
84
#define NET_ICMP_FIRST      ( NET_ARP_LAST + 0 )
88
#define NET_ICMP_LAST       ( NET_ICMP_FIRST + NET_ICMP_COUNT )
85
#define NET_ICMP_LAST       ( NET_ICMP_FIRST + NET_ICMP_COUNT )
89
 
86
 
90
#define NET_TL_FIRST        ( NET_ICMP_LAST + 0 )
87
#define NET_TL_FIRST        ( NET_ICMP_LAST + 0 )
91
#define NET_TL_LAST         ( NET_TL_FIRST + NET_TL_COUNT )
88
#define NET_TL_LAST         ( NET_TL_FIRST + NET_TL_COUNT )
92
#define NET_UDP_FIRST       ( NET_TL_LAST + 0 )
89
#define NET_UDP_FIRST       ( NET_TL_LAST + 0 )
Line 111... Line 108...
111
#define IS_NET_NIL_MESSAGE( call )      IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_NIL_FIRST, NET_NIL_LAST )
108
#define IS_NET_NIL_MESSAGE( call )      IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_NIL_FIRST, NET_NIL_LAST )
112
#define IS_NET_ETH_MESSAGE( call )      IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_ETH_FIRST, NET_ETH_LAST )
109
#define IS_NET_ETH_MESSAGE( call )      IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_ETH_FIRST, NET_ETH_LAST )
113
#define IS_NET_IL_MESSAGE( call )       IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_IL_FIRST, NET_IL_LAST )
110
#define IS_NET_IL_MESSAGE( call )       IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_IL_FIRST, NET_IL_LAST )
114
#define IS_NET_IP_MESSAGE( call )       IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_IP_FIRST, NET_IP_LAST )
111
#define IS_NET_IP_MESSAGE( call )       IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_IP_FIRST, NET_IP_LAST )
115
#define IS_NET_ARP_MESSAGE( call )      IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_ARP_FIRST, NET_ARP_LAST )
112
#define IS_NET_ARP_MESSAGE( call )      IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_ARP_FIRST, NET_ARP_LAST )
116
#define IS_NET_RARP_MESSAGE( call )     IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_RARP_FIRST, NET_RARP_LAST )
-
 
117
#define IS_NET_ICMP_MESSAGE( call )     IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_ICMP_FIRST, NET_ICMP_LAST )
113
#define IS_NET_ICMP_MESSAGE( call )     IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_ICMP_FIRST, NET_ICMP_LAST )
118
#define IS_NET_TL_MESSAGE( call )       IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_TL_FIRST, NET_TL_LAST )
114
#define IS_NET_TL_MESSAGE( call )       IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_TL_FIRST, NET_TL_LAST )
119
#define IS_NET_UDP_MESSAGE( call )      IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_UDP_FIRST, NET_UDP_LAST )
115
#define IS_NET_UDP_MESSAGE( call )      IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_UDP_FIRST, NET_UDP_LAST )
120
#define IS_NET_TCP_MESSAGE( call )      IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_TCP_FIRST, NET_TCP_LAST )
116
#define IS_NET_TCP_MESSAGE( call )      IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_TCP_FIRST, NET_TCP_LAST )
121
#define IS_NET_SOCKET_MESSAGE( call )   IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_SOCKET_FIRST, NET_SOCKET_LAST )
117
#define IS_NET_SOCKET_MESSAGE( call )   IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_SOCKET_FIRST, NET_SOCKET_LAST )
Line 150... Line 146...
150
#define IPC_SET_ADDR( answer )      (( size_t * ) & IPC_GET_ARG1( * answer ))
146
#define IPC_SET_ADDR( answer )      (( size_t * ) & IPC_GET_ARG1( * answer ))
151
#define IPC_SET_PREFIX( answer )    (( size_t * ) & IPC_GET_ARG2( * answer ))
147
#define IPC_SET_PREFIX( answer )    (( size_t * ) & IPC_GET_ARG2( * answer ))
152
#define IPC_SET_CONTENT( answer )   (( size_t * ) & IPC_GET_ARG3( * answer ))
148
#define IPC_SET_CONTENT( answer )   (( size_t * ) & IPC_GET_ARG3( * answer ))
153
#define IPC_SET_SUFFIX( answer )    (( size_t * ) & IPC_GET_ARG4( * answer ))
149
#define IPC_SET_SUFFIX( answer )    (( size_t * ) & IPC_GET_ARG4( * answer ))
154
 
150
 
155
typedef enum {
-
 
156
    /* () not supported, registers new device */
-
 
157
    NET_NET_DEVICE = NET_NET_FIRST,
-
 
158
    /* ( NULL, count ), measured_strings_send( names ), measured_strings_return( values ) */
-
 
159
    NET_NET_GET_CONF,
-
 
160
    /* ( device_id, count ), measured_strings_send( names ), measured_strings_return( values ) */
-
 
161
    NET_NET_GET_DEVICE_CONF,
-
 
162
    /* () not supported, measured_strings_send( names ), measured_strings_send( values ) */
-
 
163
    NET_NET_SET_CONF,
-
 
164
    /* ( device_id, count ) not supported, measured_strings_send( names ), measured_strings_send( values ) */
-
 
165
    NET_NET_SET_DEVICE_CONF,
-
 
166
    /* () */
-
 
167
    NET_NET_STARTUP,
-
 
168
    /* ( device_id ) */
-
 
169
    NET_NET_START,
-
 
170
    /* ( device_id ) */
-
 
171
    NET_NET_STOP,
-
 
172
    /* ( device_id ) ipc_data_read( stats ) */
-
 
173
    NET_NET_STATS,
-
 
174
} net_messages;
-
 
175
 
-
 
176
static inline int generic_get_addr( int phone, int message, device_id_t device_id, measured_string_ref * address, char ** data ){
151
static inline int generic_get_addr_req( int phone, int message, device_id_t device_id, measured_string_ref * address, char ** data ){
177
    aid_t           message_id;
152
    aid_t           message_id;
178
    ipcarg_t        result;
153
    ipcarg_t        result;
179
    int             string;
154
    int             string;
180
 
155
 
181
    if( !( address && data )) return EBADMEM;
156
    if( !( address && data )) return EBADMEM;