summaryrefslogtreecommitdiff
path: root/include/net.h
diff options
context:
space:
mode:
authorLuca Ceresoli <luca.ceresoli@comelit.it>2011-04-18 06:19:50 +0000
committerWolfgang Denk <wd@denx.de>2011-05-12 19:38:19 +0200
commit03eb129f8a37f7d7d222e02330cd806d3a0aef1d (patch)
treee1b22352233ecf254859bcc7f1abc2de8a70cdde /include/net.h
parent8eccee7ae77140cd9780f643d2388adb29ed1a83 (diff)
NET: pass source IP address to packet handlers
This is needed for the upcoming TFTP server implementation. This also simplifies PingHandler() and fixes rxhand_f documentation. Signed-off-by: Luca Ceresoli <luca.ceresoli@comelit.it> Cc: Wolfgang Denk <wd@denx.de> Acked-by: Detlev Zundel <dzu@denx.de>
Diffstat (limited to 'include/net.h')
-rw-r--r--include/net.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/include/net.h b/include/net.h
index 95ef8ab83c3..01f7159a078 100644
--- a/include/net.h
+++ b/include/net.h
@@ -72,12 +72,17 @@
typedef ulong IPaddr_t;
-/*
- * The current receive packet handler. Called with a pointer to the
- * application packet, and a protocol type (PORT_BOOTPC or PORT_TFTP).
- * All other packets are dealt with without calling the handler.
+/**
+ * An incoming packet handler.
+ * @param pkt pointer to the application packet
+ * @param dport destination UDP port
+ * @param sip source IP address
+ * @param sport source UDP port
+ * @param len packet length
*/
-typedef void rxhand_f(uchar *, unsigned, unsigned, unsigned);
+typedef void rxhand_f(uchar *pkt, unsigned dport,
+ IPaddr_t sip, unsigned sport,
+ unsigned len);
/*
* A timeout handler. Called after time interval has expired.