Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 3900 → Rev 3901

/branches/network/uspace/srv/net/messages.h
47,6 → 47,7
#define NET_ICMP_COUNT 0
#define NET_UDP_COUNT 0
#define NET_TCP_COUNT 0
#define NET_PACKET_COUNT 5
#define NET_SOCKET_COUNT 0
 
#define NET_FIRST 2000
81,23 → 82,27
#define NET_SOCKET_FIRST ( NET_TCP_LAST + 0 )
#define NET_SOCKET_LAST ( NET_SOCKET_FIRST + NET_SOCKET_COUNT )
 
#define NET_LAST NET_SOCKET_LAST
#define NET_PACKET_FIRST ( NET_SOCKET_LAST + 0 )
#define NET_PACKET_LAST ( NET_PACKET_FIRST + NET_PACKET_COUNT )
 
#define NET_LAST NET_PACKET_LAST
 
#define NET_COUNT ( NET_LAST - NET_FIRST )
 
#define IS_IN_INTERVAL( item, first_inclusive, last_exclusive ) ((( item ) >= ( first_inclusive )) && (( item ) < ( last_exclusive )))
 
#define IS_NET_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( call ), NET_FIRST, NET_LAST )
#define IS_NET_NET_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( call ), NET_NET_FIRST, NET_NET_LAST )
#define IS_NET_NIL_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( call ), NET_NIL_FIRST, NET_NIL_LAST )
#define IS_NET_ETH_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( call ), NET_ETH_FIRST, NET_ETH_LAST )
#define IS_NET_IL_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( call ), NET_IL_FIRST, NET_IL_LAST )
#define IS_NET_IP_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( call ), NET_IP_FIRST, NET_IP_LAST )
#define IS_NET_ARP_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( call ), NET_ARP_FIRST, NET_ARP_LAST )
#define IS_NET_RARP_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( call ), NET_RARP_FIRST, NET_RARP_LAST )
#define IS_NET_UDP_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( call ), NET_UDP_FIRST, NET_UDP_LAST )
#define IS_NET_TCP_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( call ), NET_TCP_FIRST, NET_TCP_LAST )
#define IS_NET_SOCKET_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( call ), NET_SOCKET_FIRST, NET_SOCKET_LAST )
#define IS_NET_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_FIRST, NET_LAST )
#define IS_NET_NET_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_NET_FIRST, NET_NET_LAST )
#define IS_NET_NIL_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_NIL_FIRST, NET_NIL_LAST )
#define IS_NET_ETH_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_ETH_FIRST, NET_ETH_LAST )
#define IS_NET_IL_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_IL_FIRST, NET_IL_LAST )
#define IS_NET_IP_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_IP_FIRST, NET_IP_LAST )
#define IS_NET_ARP_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_ARP_FIRST, NET_ARP_LAST )
#define IS_NET_RARP_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_RARP_FIRST, NET_RARP_LAST )
#define IS_NET_UDP_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_UDP_FIRST, NET_UDP_LAST )
#define IS_NET_TCP_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_TCP_FIRST, NET_TCP_LAST )
#define IS_NET_SOCKET_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_SOCKET_FIRST, NET_SOCKET_LAST )
#define IS_NET_PACKET_MESSAGE( call ) IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_PACKET_FIRST, NET_PACKET_LAST )
 
typedef enum {
/* ( device_id, irq, io ) */
104,7 → 109,7
NET_NETIF_PROBE = NET_NETIF_FIRST,
/* () not supported, should ask networking for a name and register device */
NET_NETIF_PROBE_AUTO,
/* ( device_id ), packet_send */
/* ( device_id, packet_id ) */
NET_NETIF_SEND,
/* ( device_id ) */
NET_NETIF_START,
114,13 → 119,13
NET_NETIF_STOP,
/* () not supported, registers new device */
NET_NET_DEVICE = NET_NET_FIRST,
/* (), measured_strings_send( names ), measured_strings_return( values ) */
/* ( NULL, count ), measured_strings_send( names ), measured_strings_return( values ) */
NET_NET_GET_CONF,
/* ( device_id ), measured_strings_send( names ), measured_strings_return( values ) */
/* ( device_id, count ), measured_strings_send( names ), measured_strings_return( values ) */
NET_NET_GET_DEVICE_CONF,
/* () not supported, measured_strings_send( names ), measured_strings_send( values ) */
NET_NET_SET_CONF,
/* ( device_id ) not supported, measured_strings_send( names ), measured_strings_send( values ) */
/* ( device_id, count ) not supported, measured_strings_send( names ), measured_strings_send( values ) */
NET_NET_SET_DEVICE_CONF,
/* () */
NET_NET_STARTUP,
157,6 → 162,7
/* ( device_id ), measured_strings_send( address ) */
// NET_IL_MY_ADDR,
NET_IP_ECHO = NET_IP_FIRST,
/* ( packet_id ) */
NET_IP_SEND,
/* ( device_id, nil_service, proto ), measured_strings_send( proto_addr ) */
NET_ARP_DEVICE = NET_ARP_FIRST,
165,8 → 171,13
/* ( device_id ) */
NET_ARP_CLEAR_DEVICE,
/* () */
NET_ARP_CLEAN_CACHE
} net_message;
NET_ARP_CLEAN_CACHE,
NET_PACKET_CREATE_1 = NET_PACKET_FIRST,
NET_PACKET_CREATE_5,
NET_PACKET_GET,
NET_PACKET_GET_SIZE,
NET_PACKET_RELEASE
} net_messages;
 
#endif