Dummy network interface layer Service
[Network interface layer]

Collaboration diagram for Dummy network interface layer Service:

Data Structures

struct  nildummy_device
 Dummy nil device map. More...
struct  nildummy_proto
 Dummy nil protocol specific data. More...
struct  nildummy_globals
 Dummy nil global data. More...

Files

file  nildummy.c
 

Dummy network interface layer module implementation.


file  nildummy.h
 

Dummy network interface layer module.


file  nildummy_module.c
 

Dummy network interface layer module stub.


Defines

#define NET_DEFAULT_MTU   1500
 Default maximum transmission unit.
#define NAME   "Dummy nil protocol"
 The module name.

Typedefs

typedef struct nildummy_globals nildummy_globals_t
 Type definition of the dummy nil global data.
typedef struct nildummy_device nildummy_device_t
 Type definition of the dummy nil device specific data.
typedef nildummy_device_tnildummy_device_ref
 Type definition of the dummy nil device specific data pointer.
typedef struct nildummy_proto nildummy_proto_t
 Type definition of the dummy nil protocol specific data.
typedef nildummy_proto_tnildummy_proto_ref
 Type definition of the dummy nil protocol specific data pointer.

Functions

int nil_device_state_msg (int nil_phone, device_id_t device_id, int state)
int nil_initialize (int net_phone)
 Module initialization.
int nil_received_msg (int nil_phone, device_id_t device_id, packet_t packet, services_t target)
int nil_message (ipc_callid_t callid, ipc_call_t *call, ipc_call_t *answer, int *answer_count)
 Message processing function.
void module_print_name (void)
 Prints the module name.
int module_start (async_client_conn_t client_connection)
 Starts the dummy nil module.
int module_message (ipc_callid_t callid, ipc_call_t *call, ipc_call_t *answer, int *answer_count)
 Passes the parameters to the module specific nil_message() function.

Variables

nildummy_globals_t nildummy_globals
 Network interface layer module global data.

Message processing functions



void nildummy_receiver (ipc_callid_t iid, ipc_call_t *icall)
 Processes IPC messages from the registered device driver modules in an infinite loop.
int nildummy_device_message (device_id_t device_id, services_t service, size_t mtu)
 Registers new device or updates the MTU of an existing one.
int nildummy_packet_space_message (device_id_t device_id, size_t *addr_len, size_t *prefix, size_t *content, size_t *suffix)
 Returns the device packet dimensions for sending.
int nildummy_register_message (services_t service, int phone)
 Registers receiving module service.
int nildummy_send_message (device_id_t device_id, packet_t packet, services_t sender)
 Sends the packet queue.
int nildummy_addr_message (device_id_t device_id, measured_string_ref *address)
 Returns the device hardware address.

Define Documentation

#define NAME   "Dummy nil protocol"

The module name.

#define NET_DEFAULT_MTU   1500

Default maximum transmission unit.

Referenced by nildummy_device_message().


Typedef Documentation

Type definition of the dummy nil device specific data pointer.

See also:
nildummy_device

Type definition of the dummy nil device specific data.

See also:
nildummy_device

Type definition of the dummy nil global data.

See also:
nildummy_globals

Type definition of the dummy nil protocol specific data pointer.

See also:
nildummy_proto

Type definition of the dummy nil protocol specific data.

See also:
nildummy_proto

Function Documentation

int module_message ( ipc_callid_t  callid,
ipc_call_t *  call,
ipc_call_t *  answer,
int *  answer_count 
)

Passes the parameters to the module specific nil_message() function.

Parameters:
[in] callid The message identifier.
[in] call The message parameters.
[out] answer The message answer parameters.
[out] answer_count The last parameter for the actual answer in the answer parameter.
Returns:
EOK on success.
ENOTSUP if the message is not known.
Other error codes as defined for each specific module message function.

References nil_message().

Here is the call graph for this function:

void module_print_name ( void   ) 

Prints the module name.

References NAME.

int module_start ( async_client_conn_t  client_connection  ) 

Starts the dummy nil module.

Initializes the client connection serving function, initializes the module, registers the module service and starts the async manager, processing IPC messages in an infinite loop.

Parameters:
[in] client_connection The client connection processing function. The module skeleton propagates its own one.
Returns:
EOK on success.
Other error codes as defined for the pm_init() function.
Other error codes as defined for the nil_initialize() function.
Other error codes as defined for the REGISTER_ME() macro function.

References ERROR_CODE, ERROR_DECLARE, ERROR_OCCURRED, ERROR_PROPAGATE, net_connect_module(), nil_initialize(), pm_destroy(), pm_init(), and REGISTER_ME.

Here is the call graph for this function:

int nil_device_state_msg ( int  nil_phone,
device_id_t  device_id,
int  state 
)
int nil_initialize ( int  net_phone  ) 

Module initialization.

Is called by the module_start() function.

Parameters:
[in] net_phone The networking moduel phone.
Returns:
EOK on success.
Other error codes as defined for each specific module initialize function.

References eth_globals::broadcast_addr, CONVERT_SIZE, nildummy_globals::devices, eth_globals::devices, nildummy_globals::devices_lock, eth_globals::devices_lock, ERROR_CODE, ERROR_DECLARE, ERROR_OCCURRED, ERROR_PROPAGATE, ETH_ADDR, measured_string_create_bulk(), nildummy_globals::net_phone, eth_globals::net_phone, nildummy_proto::phone, nildummy_globals::proto, eth_globals::protos, nildummy_globals::protos_lock, and eth_globals::protos_lock.

Here is the call graph for this function:

int nil_message ( ipc_callid_t  callid,
ipc_call_t *  call,
ipc_call_t *  answer,
int *  answer_count 
)

Message processing function.

Parameters:
[in] callid The message identifier.
[in] call The message parameters.
[out] answer The message answer parameters.
[out] answer_count The last parameter for the actual answer in the answer parameter.
Returns:
EOK on success.
ENOTSUP if the message is not known.
Other error codes as defined for each specific module message function.
See also:
nil_interface.h
IS_NET_NIL_MESSAGE()

References ERROR_DECLARE, ERROR_PROPAGATE, eth_addr_message(), ETH_BROADCAST_ADDR, eth_device_message(), ETH_LOCAL_ADDR, eth_packet_space_message(), eth_register_message(), eth_send_message(), IPC_GET_DEVICE, IPC_GET_MTU, IPC_GET_PACKET, IPC_GET_PHONE, IPC_GET_SERVICE, IPC_SET_ADDR, IPC_SET_CONTENT, IPC_SET_PREFIX, IPC_SET_SUFFIX, measured_strings_reply(), NET_NIL_ADDR, NET_NIL_BROADCAST_ADDR, NET_NIL_DEVICE, NET_NIL_PACKET_SPACE, NET_NIL_SEND, nildummy_globals::net_phone, eth_globals::net_phone, NIL_GET_PROTO, nildummy_addr_message(), nildummy_device_message(), nildummy_packet_space_message(), nildummy_register_message(), nildummy_send_message(), and packet_translate().

Here is the call graph for this function:

int nil_received_msg ( int  nil_phone,
device_id_t  device_id,
packet_t  packet,
services_t  target 
)
int nildummy_addr_message ( device_id_t  device_id,
measured_string_ref address 
)

Returns the device hardware address.

Parameters:
[in] device_id The device identifier.
[out] address The device hardware address.
Returns:
EOK on success.
EBADMEM if the address parameter is NULL.
ENOENT if there no such device.

References nildummy_device::addr, nildummy_globals::devices, and nildummy_globals::devices_lock.

Referenced by nil_message().

Here is the caller graph for this function:

int nildummy_device_message ( device_id_t  device_id,
services_t  service,
size_t  mtu 
)

Registers new device or updates the MTU of an existing one.

Determines the device local hardware address.

Parameters:
[in] device_id The new device identifier.
[in] service The device driver service.
[in] mtu The device maximum transmission unit.
Returns:
EOK on success.
EEXIST if the device with the different service exists.
ENOMEM if there is not enough memory left.
Other error codes as defined for the netif_bind_service() function.
Other error codes as defined for the netif_get_addr_req() function.

References nildummy_device::addr, nildummy_device::addr_data, nildummy_device::device_id, nildummy_globals::devices, nildummy_globals::devices_lock, ERROR_CODE, ERROR_DECLARE, ERROR_OCCURRED, free, il_mtu_changed_msg(), nildummy_device::mtu, NET_DEFAULT_MTU, netif_bind_service(), netif_get_addr_req(), nildummy_receiver(), nildummy_device::phone, nildummy_proto::phone, nildummy_globals::proto, nildummy_globals::protos_lock, nildummy_proto::service, and nildummy_device::service.

Referenced by nil_message().

Here is the call graph for this function:

Here is the caller graph for this function:

int nildummy_packet_space_message ( device_id_t  device_id,
size_t *  addr_len,
size_t *  prefix,
size_t *  content,
size_t *  suffix 
)

Returns the device packet dimensions for sending.

Parameters:
[in] device_id The device identifier.
[out] addr_len The minimum reserved address length.
[out] prefix The minimum reserved prefix size.
[out] content The maximum content size.
[out] suffix The minimum reserved suffix size.
Returns:
EOK on success.
EBADMEM if either one of the parameters is NULL.
ENOENT if there is no such device.

References nildummy_globals::devices, nildummy_globals::devices_lock, and nildummy_device::mtu.

Referenced by nil_message().

Here is the caller graph for this function:

void nildummy_receiver ( ipc_callid_t  iid,
ipc_call_t *  icall 
)

Processes IPC messages from the registered device driver modules in an infinite loop.

Parameters:
[in] iid The message identifier.
[in,out] icall The message parameters.

References ERROR_CODE, ERROR_DECLARE, ERROR_OCCURRED, IPC_GET_DEVICE, IPC_GET_PACKET, IPC_GET_STATE, NET_NIL_DEVICE_STATE, NET_NIL_RECEIVED, nildummy_globals::net_phone, nil_device_state_msg(), nil_received_msg(), and packet_translate().

Referenced by nildummy_device_message().

Here is the call graph for this function:

Here is the caller graph for this function:

int nildummy_register_message ( services_t  service,
int  phone 
)

Registers receiving module service.

Passes received packets for this service.

Parameters:
[in] service The module service.
[in] phone The service phone.
Returns:
EOK on success.
ENOENT if the service is not known.
ENOMEM if there is not enough memory left.

References nildummy_proto::phone, nildummy_globals::proto, nildummy_globals::protos_lock, and nildummy_proto::service.

Referenced by nil_message().

Here is the caller graph for this function:

int nildummy_send_message ( device_id_t  device_id,
packet_t  packet,
services_t  sender 
)

Sends the packet queue.

Parameters:
[in] device_id The device identifier.
[in] packet The packet queue.
[in] sender The sending module service.
Returns:
EOK on success.
ENOENT if there no such device.
EINVAL if the service parameter is not known.

References nildummy_globals::devices, nildummy_globals::devices_lock, netif_send_msg(), and nildummy_device::phone.

Referenced by nil_message().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Network interface layer module global data.


Generated on Thu Mar 11 20:46:43 2010 for Networking and TCP/IP stack for HelenOS system by  doxygen 1.6.1