summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/net.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/net.h b/include/net.h
index 8013f79c2e..b50b6e76c8 100644
--- a/include/net.h
+++ b/include/net.h
@@ -46,6 +46,8 @@ struct eth_device {
int (*set_ethaddr) (struct eth_device*, const unsigned char *adr);
int (*rx_preprocessor) (struct eth_device*, unsigned char **packet,
int *length);
+ void (*rx_monitor) (struct eth_device*, void *packet, int length);
+ void (*tx_monitor) (struct eth_device*, void *packet, int length);
struct eth_device *next;
void *priv;
@@ -90,6 +92,15 @@ static inline const char *eth_name(struct eth_device *edev)
return edev->devname;
}
+static inline int eth_send_raw(struct eth_device *edev, void *packet,
+ int length)
+{
+ if (edev->tx_monitor)
+ edev->tx_monitor(edev, packet, length);
+
+ return edev->send(edev, packet, length);
+}
+
int eth_register(struct eth_device* dev); /* Register network device */
void eth_unregister(struct eth_device* dev); /* Unregister network device */
int eth_set_ethaddr(struct eth_device *edev, const char *ethaddr);