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_t * | nildummy_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_t * | nildummy_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 NAME "Dummy nil protocol" |
The module name.
#define NET_DEFAULT_MTU 1500 |
Default maximum transmission unit.
Referenced by nildummy_device_message().
typedef nildummy_device_t* nildummy_device_ref |
Type definition of the dummy nil device specific data pointer.
typedef struct nildummy_device nildummy_device_t |
Type definition of the dummy nil device specific data.
typedef struct nildummy_globals nildummy_globals_t |
Type definition of the dummy nil global data.
typedef nildummy_proto_t* nildummy_proto_ref |
Type definition of the dummy nil protocol specific data pointer.
typedef struct nildummy_proto nildummy_proto_t |
Type definition of the dummy nil protocol specific data.
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.
[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. |
References nil_message().
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.
[in] | client_connection | The client connection processing function. The module skeleton propagates its own one. |
References ERROR_CODE, ERROR_DECLARE, ERROR_OCCURRED, ERROR_PROPAGATE, net_connect_module(), nil_initialize(), pm_destroy(), pm_init(), and REGISTER_ME.
int nil_device_state_msg | ( | int | nil_phone, | |
device_id_t | device_id, | |||
int | state | |||
) |
References il_device_state_msg(), nildummy_proto::phone, nildummy_globals::proto, nildummy_globals::protos_lock, and nildummy_proto::service.
int nil_initialize | ( | int | net_phone | ) |
Module initialization.
Is called by the module_start() function.
[in] | net_phone | The networking moduel phone. |
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.
int nil_message | ( | ipc_callid_t | callid, | |
ipc_call_t * | call, | |||
ipc_call_t * | answer, | |||
int * | answer_count | |||
) |
Message processing function.
[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. |
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().
int nil_received_msg | ( | int | nil_phone, | |
device_id_t | device_id, | |||
packet_t | packet, | |||
services_t | target | |||
) |
References il_received_msg(), nildummy_proto::phone, pq_detach(), nildummy_globals::proto, nildummy_globals::protos_lock, and nildummy_proto::service.
int nildummy_addr_message | ( | device_id_t | device_id, | |
measured_string_ref * | address | |||
) |
Returns the device hardware address.
[in] | device_id | The device identifier. |
[out] | address | The device hardware address. |
References nildummy_device::addr, nildummy_globals::devices, and nildummy_globals::devices_lock.
Referenced by nil_message().
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.
[in] | device_id | The new device identifier. |
[in] | service | The device driver service. |
[in] | mtu | The device maximum transmission unit. |
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().
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.
[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. |
References nildummy_globals::devices, nildummy_globals::devices_lock, and nildummy_device::mtu.
Referenced by nil_message().
void nildummy_receiver | ( | ipc_callid_t | iid, | |
ipc_call_t * | icall | |||
) |
Processes IPC messages from the registered device driver modules in an infinite loop.
[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().
int nildummy_register_message | ( | services_t | service, | |
int | phone | |||
) |
Registers receiving module service.
Passes received packets for this service.
[in] | service | The module service. |
[in] | phone | The service phone. |
References nildummy_proto::phone, nildummy_globals::proto, nildummy_globals::protos_lock, and nildummy_proto::service.
Referenced by nil_message().
int nildummy_send_message | ( | device_id_t | device_id, | |
packet_t | packet, | |||
services_t | sender | |||
) |
Sends the packet queue.
[in] | device_id | The device identifier. |
[in] | packet | The packet queue. |
[in] | sender | The sending module service. |
References nildummy_globals::devices, nildummy_globals::devices_lock, netif_send_msg(), and nildummy_device::phone.
Referenced by nil_message().
Network interface layer module global data.