diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-12-11 14:23:16 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-12-11 14:23:16 +0000 |
commit | 9c81bf82b87643248822226421882002051d2efb (patch) | |
tree | 4a9c1ded22b582792ecbae8e9eb0975e0b52eb2b /nuttx/include | |
parent | 86d2021346c52dcacae3da1c2a974d5ea99c2032 (diff) | |
download | px4-nuttx-9c81bf82b87643248822226421882002051d2efb.tar.gz px4-nuttx-9c81bf82b87643248822226421882002051d2efb.tar.bz2 px4-nuttx-9c81bf82b87643248822226421882002051d2efb.zip |
Add netdev_foreach()
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@439 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include')
-rw-r--r-- | nuttx/include/nuttx/net.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/nuttx/include/nuttx/net.h b/nuttx/include/nuttx/net.h index 51f21d835..d4d7ec754 100644 --- a/nuttx/include/nuttx/net.h +++ b/nuttx/include/nuttx/net.h @@ -112,6 +112,11 @@ struct socketlist typedef uint16 sockopt_t; +/* Callback from netdev_foreach() */ + +struct uip_driver_s; /* Forward reference. See net/uip/uip-arch.h */ +typedef int (*netdev_callback_t)(FAR struct uip_driver_s *dev, void *arg); + /**************************************************************************** * Public Function Prototypes ****************************************************************************/ @@ -148,16 +153,20 @@ EXTERN int net_close(int sockfd); struct ifreq; /* Forward reference -- see net/ioctls.h */ EXTERN int netdev_ioctl(int sockfd, int cmd, struct ifreq *req); -/* net-register.c ************************************************************/ +/* netdev-register.c *********************************************************/ /* This function is called by network interface device drivers to inform the * socket layer of their existence. This registration is necesary to support * ioctl() operations on network devices to, for example, set MAC and IP * addresses */ -struct uip_driver_s; /* Forward reference. See net/uip/uip-arch.h */ EXTERN int netdev_register(FAR struct uip_driver_s *dev); +/* net-foreach.c ************************************************************/ +/* Enumerates all registered network devices */ + +EXTERN int netdev_foreach(netdev_callback_t callback, void *arg); + #undef EXTERN #ifdef __cplusplus } |