| 1 | /*
|
|---|
| 2 | * Copyright (c) 2009 Lukas Mejdrech
|
|---|
| 3 | * All rights reserved.
|
|---|
| 4 | *
|
|---|
| 5 | * Redistribution and use in source and binary forms, with or without
|
|---|
| 6 | * modification, are permitted provided that the following conditions
|
|---|
| 7 | * are met:
|
|---|
| 8 | *
|
|---|
| 9 | * - Redistributions of source code must retain the above copyright
|
|---|
| 10 | * notice, this list of conditions and the following disclaimer.
|
|---|
| 11 | * - Redistributions in binary form must reproduce the above copyright
|
|---|
| 12 | * notice, this list of conditions and the following disclaimer in the
|
|---|
| 13 | * documentation and/or other materials provided with the distribution.
|
|---|
| 14 | * - The name of the author may not be used to endorse or promote products
|
|---|
| 15 | * derived from this software without specific prior written permission.
|
|---|
| 16 | *
|
|---|
| 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|---|
| 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|---|
| 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|---|
| 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|---|
| 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|---|
| 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|---|
| 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|---|
| 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|---|
| 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|---|
| 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|---|
| 27 | */
|
|---|
| 28 |
|
|---|
| 29 | /** @addtogroup nildummy
|
|---|
| 30 | * @{
|
|---|
| 31 | */
|
|---|
| 32 |
|
|---|
| 33 | /** @file
|
|---|
| 34 | * Dummy network interface layer module implementation.
|
|---|
| 35 | * @see nildummy.h
|
|---|
| 36 | */
|
|---|
| 37 |
|
|---|
| 38 | #include <async.h>
|
|---|
| 39 | #include <malloc.h>
|
|---|
| 40 | #include <mem.h>
|
|---|
| 41 | #include <stdio.h>
|
|---|
| 42 | #include <str.h>
|
|---|
| 43 | #include <ipc/nil.h>
|
|---|
| 44 | #include <ipc/net.h>
|
|---|
| 45 | #include <ipc/services.h>
|
|---|
| 46 | #include <net/modules.h>
|
|---|
| 47 | #include <net/device.h>
|
|---|
| 48 | #include <il_remote.h>
|
|---|
| 49 | #include <adt/measured_strings.h>
|
|---|
| 50 | #include <net/packet.h>
|
|---|
| 51 | #include <packet_remote.h>
|
|---|
| 52 | #include <netif_remote.h>
|
|---|
| 53 | #include <nil_skel.h>
|
|---|
| 54 | #include "nildummy.h"
|
|---|
| 55 |
|
|---|
| 56 | /** The module name. */
|
|---|
| 57 | #define NAME "nildummy"
|
|---|
| 58 |
|
|---|
| 59 | /** Default maximum transmission unit. */
|
|---|
| 60 | #define NET_DEFAULT_MTU 1500
|
|---|
| 61 |
|
|---|
| 62 | /** Network interface layer module global data. */
|
|---|
| 63 | nildummy_globals_t nildummy_globals;
|
|---|
| 64 |
|
|---|
| 65 | DEVICE_MAP_IMPLEMENT(nildummy_devices, nildummy_device_t);
|
|---|
| 66 |
|
|---|
| 67 | int nil_device_state_msg_local(device_id_t device_id, sysarg_t state)
|
|---|
| 68 | {
|
|---|
| 69 | fibril_rwlock_read_lock(&nildummy_globals.protos_lock);
|
|---|
| 70 | if (nildummy_globals.proto.sess)
|
|---|
| 71 | il_device_state_msg(nildummy_globals.proto.sess, device_id,
|
|---|
| 72 | state, nildummy_globals.proto.service);
|
|---|
| 73 | fibril_rwlock_read_unlock(&nildummy_globals.protos_lock);
|
|---|
| 74 |
|
|---|
| 75 | return EOK;
|
|---|
| 76 | }
|
|---|
| 77 |
|
|---|
| 78 | int nil_initialize(async_sess_t *sess)
|
|---|
| 79 | {
|
|---|
| 80 | fibril_rwlock_initialize(&nildummy_globals.devices_lock);
|
|---|
| 81 | fibril_rwlock_initialize(&nildummy_globals.protos_lock);
|
|---|
| 82 | fibril_rwlock_write_lock(&nildummy_globals.devices_lock);
|
|---|
| 83 | fibril_rwlock_write_lock(&nildummy_globals.protos_lock);
|
|---|
| 84 |
|
|---|
| 85 | nildummy_globals.net_sess = sess;
|
|---|
| 86 | nildummy_globals.proto.sess = NULL;
|
|---|
| 87 | int rc = nildummy_devices_initialize(&nildummy_globals.devices);
|
|---|
| 88 |
|
|---|
| 89 | fibril_rwlock_write_unlock(&nildummy_globals.protos_lock);
|
|---|
| 90 | fibril_rwlock_write_unlock(&nildummy_globals.devices_lock);
|
|---|
| 91 |
|
|---|
| 92 | return rc;
|
|---|
| 93 | }
|
|---|
| 94 |
|
|---|
| 95 | /** Process IPC messages from the registered device driver modules
|
|---|
| 96 | *
|
|---|
| 97 | * @param[in] iid Message identifier.
|
|---|
| 98 | * @param[in,out] icall Message parameters.
|
|---|
| 99 | * @param[in] arg Local argument.
|
|---|
| 100 | *
|
|---|
| 101 | */
|
|---|
| 102 | static void nildummy_receiver(ipc_callid_t iid, ipc_call_t *icall, void *arg)
|
|---|
| 103 | {
|
|---|
| 104 | packet_t *packet;
|
|---|
| 105 | int rc;
|
|---|
| 106 |
|
|---|
| 107 | while (true) {
|
|---|
| 108 | switch (IPC_GET_IMETHOD(*icall)) {
|
|---|
| 109 | case NET_NIL_DEVICE_STATE:
|
|---|
| 110 | rc = nil_device_state_msg_local(IPC_GET_DEVICE(*icall),
|
|---|
| 111 | IPC_GET_STATE(*icall));
|
|---|
| 112 | async_answer_0(iid, (sysarg_t) rc);
|
|---|
| 113 | break;
|
|---|
| 114 |
|
|---|
| 115 | case NET_NIL_RECEIVED:
|
|---|
| 116 | rc = packet_translate_remote(nildummy_globals.net_sess,
|
|---|
| 117 | &packet, IPC_GET_PACKET(*icall));
|
|---|
| 118 | if (rc == EOK)
|
|---|
| 119 | rc = nil_received_msg_local(IPC_GET_DEVICE(*icall),
|
|---|
| 120 | packet, 0);
|
|---|
| 121 |
|
|---|
| 122 | async_answer_0(iid, (sysarg_t) rc);
|
|---|
| 123 | break;
|
|---|
| 124 |
|
|---|
| 125 | default:
|
|---|
| 126 | async_answer_0(iid, (sysarg_t) ENOTSUP);
|
|---|
| 127 | }
|
|---|
| 128 |
|
|---|
| 129 | iid = async_get_call(icall);
|
|---|
| 130 | }
|
|---|
| 131 | }
|
|---|
| 132 |
|
|---|
| 133 | /** Register new device or updates the MTU of an existing one.
|
|---|
| 134 | *
|
|---|
| 135 | * Determine the device local hardware address.
|
|---|
| 136 | *
|
|---|
| 137 | * @param[in] device_id New device identifier.
|
|---|
| 138 | * @param[in] service Device driver service.
|
|---|
| 139 | * @param[in] mtu Device maximum transmission unit.
|
|---|
| 140 | *
|
|---|
| 141 | * @return EOK on success.
|
|---|
| 142 | * @return EEXIST if the device with the different service exists.
|
|---|
| 143 | * @return ENOMEM if there is not enough memory left.
|
|---|
| 144 | * @return Other error codes as defined for the
|
|---|
| 145 | * netif_bind_service() function.
|
|---|
| 146 | * @return Other error codes as defined for the
|
|---|
| 147 | * netif_get_addr_req() function.
|
|---|
| 148 | *
|
|---|
| 149 | */
|
|---|
| 150 | static int nildummy_device_message(device_id_t device_id, services_t service,
|
|---|
| 151 | size_t mtu)
|
|---|
| 152 | {
|
|---|
| 153 | fibril_rwlock_write_lock(&nildummy_globals.devices_lock);
|
|---|
| 154 |
|
|---|
| 155 | /* An existing device? */
|
|---|
| 156 | nildummy_device_t *device =
|
|---|
| 157 | nildummy_devices_find(&nildummy_globals.devices, device_id);
|
|---|
| 158 | if (device) {
|
|---|
| 159 | if (device->service != service) {
|
|---|
| 160 | printf("Device %d already exists\n", device->device_id);
|
|---|
| 161 | fibril_rwlock_write_unlock(
|
|---|
| 162 | &nildummy_globals.devices_lock);
|
|---|
| 163 | return EEXIST;
|
|---|
| 164 | }
|
|---|
| 165 |
|
|---|
| 166 | /* Update MTU */
|
|---|
| 167 | if (mtu > 0)
|
|---|
| 168 | device->mtu = mtu;
|
|---|
| 169 | else
|
|---|
| 170 | device->mtu = NET_DEFAULT_MTU;
|
|---|
| 171 |
|
|---|
| 172 | printf("Device %d already exists:\tMTU\t= %zu\n",
|
|---|
| 173 | device->device_id, device->mtu);
|
|---|
| 174 | fibril_rwlock_write_unlock(&nildummy_globals.devices_lock);
|
|---|
| 175 |
|
|---|
| 176 | /* Notify the upper layer module */
|
|---|
| 177 | fibril_rwlock_read_lock(&nildummy_globals.protos_lock);
|
|---|
| 178 | if (nildummy_globals.proto.sess) {
|
|---|
| 179 | il_mtu_changed_msg(nildummy_globals.proto.sess,
|
|---|
| 180 | device->device_id, device->mtu,
|
|---|
| 181 | nildummy_globals.proto.service);
|
|---|
| 182 | }
|
|---|
| 183 | fibril_rwlock_read_unlock(&nildummy_globals.protos_lock);
|
|---|
| 184 |
|
|---|
| 185 | return EOK;
|
|---|
| 186 | }
|
|---|
| 187 |
|
|---|
| 188 | /* Create a new device */
|
|---|
| 189 | device = (nildummy_device_t *) malloc(sizeof(nildummy_device_t));
|
|---|
| 190 | if (!device)
|
|---|
| 191 | return ENOMEM;
|
|---|
| 192 |
|
|---|
| 193 | device->device_id = device_id;
|
|---|
| 194 | device->service = service;
|
|---|
| 195 | if (mtu > 0)
|
|---|
| 196 | device->mtu = mtu;
|
|---|
| 197 | else
|
|---|
| 198 | device->mtu = NET_DEFAULT_MTU;
|
|---|
| 199 |
|
|---|
| 200 | /* Bind the device driver */
|
|---|
| 201 | device->sess = netif_bind_service(device->service, device->device_id,
|
|---|
| 202 | SERVICE_ETHERNET, nildummy_receiver);
|
|---|
| 203 | if (device->sess == NULL) {
|
|---|
| 204 | fibril_rwlock_write_unlock(&nildummy_globals.devices_lock);
|
|---|
| 205 | free(device);
|
|---|
| 206 | return ENOENT;
|
|---|
| 207 | }
|
|---|
| 208 |
|
|---|
| 209 | /* Get hardware address */
|
|---|
| 210 | int rc = netif_get_addr_req(device->sess, device->device_id,
|
|---|
| 211 | &device->addr, &device->addr_data);
|
|---|
| 212 | if (rc != EOK) {
|
|---|
| 213 | fibril_rwlock_write_unlock(&nildummy_globals.devices_lock);
|
|---|
| 214 | free(device);
|
|---|
| 215 | return rc;
|
|---|
| 216 | }
|
|---|
| 217 |
|
|---|
| 218 | /* Add to the cache */
|
|---|
| 219 | int index = nildummy_devices_add(&nildummy_globals.devices,
|
|---|
| 220 | device->device_id, device);
|
|---|
| 221 | if (index < 0) {
|
|---|
| 222 | fibril_rwlock_write_unlock(&nildummy_globals.devices_lock);
|
|---|
| 223 | free(device->addr);
|
|---|
| 224 | free(device->addr_data);
|
|---|
| 225 | free(device);
|
|---|
| 226 | return index;
|
|---|
| 227 | }
|
|---|
| 228 |
|
|---|
| 229 | printf("%s: Device registered (id: %d, service: %d, mtu: %zu)\n",
|
|---|
| 230 | NAME, device->device_id, device->service, device->mtu);
|
|---|
| 231 | fibril_rwlock_write_unlock(&nildummy_globals.devices_lock);
|
|---|
| 232 | return EOK;
|
|---|
| 233 | }
|
|---|
| 234 |
|
|---|
| 235 | /** Return the device hardware address.
|
|---|
| 236 | *
|
|---|
| 237 | * @param[in] device_id Device identifier.
|
|---|
| 238 | * @param[out] address Device hardware address.
|
|---|
| 239 | *
|
|---|
| 240 | * @return EOK on success.
|
|---|
| 241 | * @return EBADMEM if the address parameter is NULL.
|
|---|
| 242 | * @return ENOENT if there no such device.
|
|---|
| 243 | *
|
|---|
| 244 | */
|
|---|
| 245 | static int nildummy_addr_message(device_id_t device_id,
|
|---|
| 246 | measured_string_t **address)
|
|---|
| 247 | {
|
|---|
| 248 | if (!address)
|
|---|
| 249 | return EBADMEM;
|
|---|
| 250 |
|
|---|
| 251 | fibril_rwlock_read_lock(&nildummy_globals.devices_lock);
|
|---|
| 252 |
|
|---|
| 253 | nildummy_device_t *device =
|
|---|
| 254 | nildummy_devices_find(&nildummy_globals.devices, device_id);
|
|---|
| 255 | if (!device) {
|
|---|
| 256 | fibril_rwlock_read_unlock(&nildummy_globals.devices_lock);
|
|---|
| 257 | return ENOENT;
|
|---|
| 258 | }
|
|---|
| 259 |
|
|---|
| 260 | *address = device->addr;
|
|---|
| 261 |
|
|---|
| 262 | fibril_rwlock_read_unlock(&nildummy_globals.devices_lock);
|
|---|
| 263 |
|
|---|
| 264 | return (*address) ? EOK : ENOENT;
|
|---|
| 265 | }
|
|---|
| 266 |
|
|---|
| 267 | /** Return the device packet dimensions for sending.
|
|---|
| 268 | *
|
|---|
| 269 | * @param[in] device_id Device identifier.
|
|---|
| 270 | * @param[out] addr_len Minimum reserved address length.
|
|---|
| 271 | * @param[out] prefix Minimum reserved prefix size.
|
|---|
| 272 | * @param[out] content Maximum content size.
|
|---|
| 273 | * @param[out] suffix Minimum reserved suffix size.
|
|---|
| 274 | *
|
|---|
| 275 | * @return EOK on success.
|
|---|
| 276 | * @return EBADMEM if either one of the parameters is NULL.
|
|---|
| 277 | * @return ENOENT if there is no such device.
|
|---|
| 278 | *
|
|---|
| 279 | */
|
|---|
| 280 | static int nildummy_packet_space_message(device_id_t device_id, size_t *addr_len,
|
|---|
| 281 | size_t *prefix, size_t *content, size_t *suffix)
|
|---|
| 282 | {
|
|---|
| 283 | if ((!addr_len) || (!prefix) || (!content) || (!suffix))
|
|---|
| 284 | return EBADMEM;
|
|---|
| 285 |
|
|---|
| 286 | fibril_rwlock_read_lock(&nildummy_globals.devices_lock);
|
|---|
| 287 |
|
|---|
| 288 | nildummy_device_t *device =
|
|---|
| 289 | nildummy_devices_find(&nildummy_globals.devices, device_id);
|
|---|
| 290 | if (!device) {
|
|---|
| 291 | fibril_rwlock_read_unlock(&nildummy_globals.devices_lock);
|
|---|
| 292 | return ENOENT;
|
|---|
| 293 | }
|
|---|
| 294 |
|
|---|
| 295 | *content = device->mtu;
|
|---|
| 296 |
|
|---|
| 297 | fibril_rwlock_read_unlock(&nildummy_globals.devices_lock);
|
|---|
| 298 |
|
|---|
| 299 | *addr_len = 0;
|
|---|
| 300 | *prefix = 0;
|
|---|
| 301 | *suffix = 0;
|
|---|
| 302 | return EOK;
|
|---|
| 303 | }
|
|---|
| 304 |
|
|---|
| 305 | int nil_received_msg_local(device_id_t device_id, packet_t *packet,
|
|---|
| 306 | services_t target)
|
|---|
| 307 | {
|
|---|
| 308 | fibril_rwlock_read_lock(&nildummy_globals.protos_lock);
|
|---|
| 309 |
|
|---|
| 310 | if (nildummy_globals.proto.sess) {
|
|---|
| 311 | do {
|
|---|
| 312 | packet_t *next = pq_detach(packet);
|
|---|
| 313 | il_received_msg(nildummy_globals.proto.sess, device_id,
|
|---|
| 314 | packet, nildummy_globals.proto.service);
|
|---|
| 315 | packet = next;
|
|---|
| 316 | } while (packet);
|
|---|
| 317 | }
|
|---|
| 318 |
|
|---|
| 319 | fibril_rwlock_read_unlock(&nildummy_globals.protos_lock);
|
|---|
| 320 |
|
|---|
| 321 | return EOK;
|
|---|
| 322 | }
|
|---|
| 323 |
|
|---|
| 324 | /** Register receiving module service.
|
|---|
| 325 | *
|
|---|
| 326 | * Pass received packets for this service.
|
|---|
| 327 | *
|
|---|
| 328 | * @param[in] service Module service.
|
|---|
| 329 | * @param[in] sess Service session.
|
|---|
| 330 | *
|
|---|
| 331 | * @return EOK on success.
|
|---|
| 332 | * @return ENOENT if the service is not known.
|
|---|
| 333 | * @return ENOMEM if there is not enough memory left.
|
|---|
| 334 | *
|
|---|
| 335 | */
|
|---|
| 336 | static int nildummy_register_message(services_t service, async_sess_t *sess)
|
|---|
| 337 | {
|
|---|
| 338 | fibril_rwlock_write_lock(&nildummy_globals.protos_lock);
|
|---|
| 339 | nildummy_globals.proto.service = service;
|
|---|
| 340 | nildummy_globals.proto.sess = sess;
|
|---|
| 341 |
|
|---|
| 342 | printf("%s: Protocol registered (service: %d)\n",
|
|---|
| 343 | NAME, nildummy_globals.proto.service);
|
|---|
| 344 |
|
|---|
| 345 | fibril_rwlock_write_unlock(&nildummy_globals.protos_lock);
|
|---|
| 346 | return EOK;
|
|---|
| 347 | }
|
|---|
| 348 |
|
|---|
| 349 | /** Send the packet queue.
|
|---|
| 350 | *
|
|---|
| 351 | * @param[in] device_id Device identifier.
|
|---|
| 352 | * @param[in] packet Packet queue.
|
|---|
| 353 | * @param[in] sender Sending module service.
|
|---|
| 354 | *
|
|---|
| 355 | * @return EOK on success.
|
|---|
| 356 | * @return ENOENT if there no such device.
|
|---|
| 357 | * @return EINVAL if the service parameter is not known.
|
|---|
| 358 | *
|
|---|
| 359 | */
|
|---|
| 360 | static int nildummy_send_message(device_id_t device_id, packet_t *packet,
|
|---|
| 361 | services_t sender)
|
|---|
| 362 | {
|
|---|
| 363 | fibril_rwlock_read_lock(&nildummy_globals.devices_lock);
|
|---|
| 364 |
|
|---|
| 365 | nildummy_device_t *device =
|
|---|
| 366 | nildummy_devices_find(&nildummy_globals.devices, device_id);
|
|---|
| 367 | if (!device) {
|
|---|
| 368 | fibril_rwlock_read_unlock(&nildummy_globals.devices_lock);
|
|---|
| 369 | return ENOENT;
|
|---|
| 370 | }
|
|---|
| 371 |
|
|---|
| 372 | /* Send packet queue */
|
|---|
| 373 | if (packet)
|
|---|
| 374 | netif_send_msg(device->sess, device_id, packet,
|
|---|
| 375 | SERVICE_NILDUMMY);
|
|---|
| 376 |
|
|---|
| 377 | fibril_rwlock_read_unlock(&nildummy_globals.devices_lock);
|
|---|
| 378 |
|
|---|
| 379 | return EOK;
|
|---|
| 380 | }
|
|---|
| 381 |
|
|---|
| 382 | int nil_module_message(ipc_callid_t callid, ipc_call_t *call,
|
|---|
| 383 | ipc_call_t *answer, size_t *answer_count)
|
|---|
| 384 | {
|
|---|
| 385 | measured_string_t *address;
|
|---|
| 386 | packet_t *packet;
|
|---|
| 387 | size_t addrlen;
|
|---|
| 388 | size_t prefix;
|
|---|
| 389 | size_t suffix;
|
|---|
| 390 | size_t content;
|
|---|
| 391 | int rc;
|
|---|
| 392 |
|
|---|
| 393 | *answer_count = 0;
|
|---|
| 394 |
|
|---|
| 395 | if (!IPC_GET_IMETHOD(*call))
|
|---|
| 396 | return EOK;
|
|---|
| 397 |
|
|---|
| 398 | async_sess_t *callback =
|
|---|
| 399 | async_callback_receive_start(EXCHANGE_SERIALIZE, call);
|
|---|
| 400 | if (callback)
|
|---|
| 401 | return nildummy_register_message(NIL_GET_PROTO(*call), callback);
|
|---|
| 402 |
|
|---|
| 403 | switch (IPC_GET_IMETHOD(*call)) {
|
|---|
| 404 | case NET_NIL_DEVICE:
|
|---|
| 405 | return nildummy_device_message(IPC_GET_DEVICE(*call),
|
|---|
| 406 | IPC_GET_SERVICE(*call), IPC_GET_MTU(*call));
|
|---|
| 407 |
|
|---|
| 408 | case NET_NIL_SEND:
|
|---|
| 409 | rc = packet_translate_remote(nildummy_globals.net_sess,
|
|---|
| 410 | &packet, IPC_GET_PACKET(*call));
|
|---|
| 411 | if (rc != EOK)
|
|---|
| 412 | return rc;
|
|---|
| 413 | return nildummy_send_message(IPC_GET_DEVICE(*call), packet,
|
|---|
| 414 | IPC_GET_SERVICE(*call));
|
|---|
| 415 |
|
|---|
| 416 | case NET_NIL_PACKET_SPACE:
|
|---|
| 417 | rc = nildummy_packet_space_message(IPC_GET_DEVICE(*call),
|
|---|
| 418 | &addrlen, &prefix, &content, &suffix);
|
|---|
| 419 | if (rc != EOK)
|
|---|
| 420 | return rc;
|
|---|
| 421 | IPC_SET_ADDR(*answer, addrlen);
|
|---|
| 422 | IPC_SET_PREFIX(*answer, prefix);
|
|---|
| 423 | IPC_SET_CONTENT(*answer, content);
|
|---|
| 424 | IPC_SET_SUFFIX(*answer, suffix);
|
|---|
| 425 | *answer_count = 4;
|
|---|
| 426 | return EOK;
|
|---|
| 427 |
|
|---|
| 428 | case NET_NIL_ADDR:
|
|---|
| 429 | rc = nildummy_addr_message(IPC_GET_DEVICE(*call), &address);
|
|---|
| 430 | if (rc != EOK)
|
|---|
| 431 | return rc;
|
|---|
| 432 | return measured_strings_reply(address, 1);
|
|---|
| 433 |
|
|---|
| 434 | case NET_NIL_BROADCAST_ADDR:
|
|---|
| 435 | rc = nildummy_addr_message(IPC_GET_DEVICE(*call), &address);
|
|---|
| 436 | if (rc != EOK)
|
|---|
| 437 | return rc;
|
|---|
| 438 | return measured_strings_reply(address, 1);
|
|---|
| 439 | }
|
|---|
| 440 |
|
|---|
| 441 | return ENOTSUP;
|
|---|
| 442 | }
|
|---|
| 443 |
|
|---|
| 444 | int main(int argc, char *argv[])
|
|---|
| 445 | {
|
|---|
| 446 | /* Start the module */
|
|---|
| 447 | return nil_module_start(SERVICE_NILDUMMY);
|
|---|
| 448 | }
|
|---|
| 449 |
|
|---|
| 450 | /** @}
|
|---|
| 451 | */
|
|---|