How to use rtems_bsdnet_loopattach()

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Oct 19 15:20:01 UTC 2010


Hi,

after some network testing I encountered a division by zero exception due to
loif (the loop back interface) being zero valued.  It showed up that the loop
back interface will be always linked in but is not initialized by default.  To
initialize the loop back interface I should use rtems_bsdnet_loopattach(void
*dummy)?  Unfortunately the is no prototype in a header file.  Also the
signature does not match the usual interface attach functions of type

int (*attach)(struct rtems_bsdnet_ifconfig *conf, int attaching);

In the network demos we have:

extern void rtems_bsdnet_loopattach();
static struct rtems_bsdnet_ifconfig loopback_config = {
    "lo0",                          /* name */
    (int (*)(struct rtems_bsdnet_ifconfig *, int))rtems_bsdnet_loopattach, /*
attach function */
#ifdef NIC_NAME
    netdriver_config,               /* link to next interface */
#else
    0,                              /* link to next interface */
#endif
    "127.0.0.1",                    /* IP address */
    "255.0.0.0",                    /* IP net mask */
};

This all looks like a hack.  What is the proper way to initialize the loop back
interface?  Maybe we should initialize it in rtems_bsdnet_initialize_network().

Have a nice day!

-- 
Sebastian Huber, embedded brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax     : +49 89 18 90 80 79-9
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the users mailing list