Files | |
file | lo.c |
Loopback network interface implementation. | |
Defines | |
#define | DEFAULT_ADDR_LEN 6 |
Default address length. | |
#define | NAME "lo" |
Loopback module name. | |
Functions | |
static void | change_state_message (netif_device_t *device, device_state_t state) |
Change the loopback state. | |
static int | lo_create (device_id_t device_id, netif_device_t **device) |
Create and return the loopback network interface structure. | |
int | main (int argc, char *argv[]) |
Main entry point. | |
int | netif_get_addr_message (device_id_t device_id, measured_string_t *address) |
Return the device local hardware address. | |
int | netif_get_device_stats (device_id_t device_id, device_stats_t *stats) |
Return the device usage statistics. | |
int | netif_initialize (void) |
Initialize the specific module. | |
int | netif_probe_message (device_id_t device_id, int irq, void *io) |
Probe the existence of the device. | |
int | netif_send_message (device_id_t device_id, packet_t *packet, services_t sender) |
Send the packet queue. | |
int | netif_specific_message (ipc_callid_t callid, ipc_call_t *call, ipc_call_t *answer, size_t *count) |
Process the netif driver specific message. | |
int | netif_start_message (netif_device_t *device) |
Start the device. | |
int | netif_stop_message (netif_device_t *device) |
Stop the device. | |
Variables | |
static uint8_t | default_addr [DEFAULT_ADDR_LEN] |
static void change_state_message | ( | netif_device_t * | device, | |
device_state_t | state | |||
) | [static] |
static int lo_create | ( | device_id_t | device_id, | |
netif_device_t ** | device | |||
) | [static] |
int main | ( | int | argc, | |
char * | argv[] | |||
) |
int netif_get_addr_message | ( | device_id_t | device_id, | |
measured_string_t * | address | |||
) |
Return the device local hardware address.
This has to be implemented in user code.
[in] | device_id | Device identifier. |
[out] | address | Device local hardware address. |
EBADMEM if the address parameter is NULL.
ENOENT if there no such device.
Other error codes as defined for the find_device() function.
Other error codes as defined for the specific module message implementation.
int netif_get_device_stats | ( | device_id_t | device_id, | |
device_stats_t * | stats | |||
) |
Return the device usage statistics.
This has to be implemented in user code.
[in] | device_id | Device identifier. |
[out] | stats | Device usage statistics. |
Other error codes as defined for the find_device() function.
Other error codes as defined for the specific module message implementation.
int netif_initialize | ( | void | ) |
int netif_probe_message | ( | device_id_t | device_id, | |
int | irq, | |||
void * | io | |||
) |
Probe the existence of the device.
This has to be implemented in user code.
[in] | device_id | Device identifier. |
[in] | irq | Device interrupt number. |
[in] | io | Device input/output address. |
Other error codes as defined for the find_device() function.
Other error codes as defined for the specific module message implementation.
int netif_send_message | ( | device_id_t | device_id, | |
packet_t * | packet, | |||
services_t | sender | |||
) |
Send the packet queue.
This has to be implemented in user code.
[in] | device_id | Device identifier. |
[in] | packet | Packet queue. |
[in] | sender | Sending module service. |
EFORWARD if the device is not active (in the NETIF_ACTIVE state).
Other error codes as defined for the find_device() function.
Other error codes as defined for the specific module message implementation.
int netif_specific_message | ( | ipc_callid_t | callid, | |
ipc_call_t * | call, | |||
ipc_call_t * | answer, | |||
size_t * | count | |||
) |
Process the netif driver specific message.
This function is called for uncommon messages received by the netif skeleton. This has to be implemented in user code.
[in] | callid | Message identifier. |
[in] | call | Message. |
[out] | answer | Answer. |
[out] | count | Number of answer arguments. |
ENOTSUP if the message is not known.
Other error codes as defined for the specific module message implementation.
int netif_start_message | ( | netif_device_t * | device | ) |
Start the device.
This has to be implemented in user code.
[in] | device | Device structure. |
Other error codes as defined for the find_device() function.
Other error codes as defined for the specific module message implementation.
int netif_stop_message | ( | netif_device_t * | device | ) |
Stop the device.
This has to be implemented in user code.
[in] | device | Device structure. |
Other error codes as defined for the find_device() function.
Other error codes as defined for the specific module message implementation.