summaryrefslogtreecommitdiffstats
path: root/src/include/gpxe
diff options
context:
space:
mode:
authorMichael Brown2007-01-10 02:55:07 +0100
committerMichael Brown2007-01-10 02:55:07 +0100
commitd24b80acf292266680d9b04836269734602ec054 (patch)
tree88d98a1ab29bd0dc0043e2f13ef1d17b74656084 /src/include/gpxe
parentAdd "name" field to network device, to facilitate netdev commands. (diff)
downloadipxe-d24b80acf292266680d9b04836269734602ec054.tar.gz
ipxe-d24b80acf292266680d9b04836269734602ec054.tar.xz
ipxe-d24b80acf292266680d9b04836269734602ec054.zip
Added network interface management commands
Diffstat (limited to 'src/include/gpxe')
-rw-r--r--src/include/gpxe/netdevice.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/include/gpxe/netdevice.h b/src/include/gpxe/netdevice.h
index 90d03fcf1..e1dddd63f 100644
--- a/src/include/gpxe/netdevice.h
+++ b/src/include/gpxe/netdevice.h
@@ -224,6 +224,8 @@ struct net_device {
/** Declare a network-layer protocol */
#define __net_protocol __table ( net_protocols, 01 )
+extern struct list_head net_devices;
+
/**
* Get printable network device hardware address
*
@@ -234,6 +236,18 @@ static inline const char * netdev_hwaddr ( struct net_device *netdev ) {
return netdev->ll_protocol->ntoa ( netdev->ll_addr );
}
+/** Iterate over all network devices */
+#define for_each_netdev( netdev ) \
+ list_for_each_entry ( (netdev), &net_devices, list )
+
+/** There exist some network devices
+ *
+ * @ret existence Existence of network devices
+ */
+static inline int have_netdevs ( void ) {
+ return ( ! list_empty ( &net_devices ) );
+}
+
extern int netdev_tx ( struct net_device *netdev, struct pk_buff *pkb );
void netdev_tx_complete ( struct net_device *netdev, struct pk_buff *pkb );
void netdev_tx_complete_next ( struct net_device *netdev );
@@ -247,7 +261,6 @@ extern void netdev_close ( struct net_device *netdev );
extern void unregister_netdev ( struct net_device *netdev );
extern void free_netdev ( struct net_device *netdev );
struct net_device * find_netdev ( const char *name );
-extern struct net_device * next_netdev ( void );
extern int net_tx ( struct pk_buff *pkb, struct net_device *netdev,
struct net_protocol *net_protocol, const void *ll_dest );
extern int net_rx ( struct pk_buff *pkb, struct net_device *netdev,