|
@@ -0,0 +1,52 @@
|
|
1
|
+#ifndef BACKGROUND_H
|
|
2
|
+#define BACKGROUND_H
|
|
3
|
+
|
|
4
|
+/** @file
|
|
5
|
+ *
|
|
6
|
+ * Background protocols
|
|
7
|
+ *
|
|
8
|
+ * Some protocols (e.g. ARP, IGMP) operate in the background; the
|
|
9
|
+ * upper layers are not aware of their operation. When an ARP query
|
|
10
|
+ * for the local station's IP address arrives, Etherboot must reply to
|
|
11
|
+ * it regardless of what other operations are currently in progress.
|
|
12
|
+ *
|
|
13
|
+ * Background protocols are called in two circumstances: when
|
|
14
|
+ * Etherboot is about to poll for a packet, and when Etherboot has
|
|
15
|
+ * received a packet that the upper layer (whatever that may currently
|
|
16
|
+ * be) isn't interested in.
|
|
17
|
+ *
|
|
18
|
+ */
|
|
19
|
+
|
|
20
|
+#include "tables.h"
|
|
21
|
+#include "ip.h"
|
|
22
|
+
|
|
23
|
+/** A background protocol */
|
|
24
|
+struct background {
|
|
25
|
+ /** Send method
|
|
26
|
+ *
|
|
27
|
+ * This method will be called whenever Etherboot is about to
|
|
28
|
+ * poll for a packet. The background protocol should use this
|
|
29
|
+ * method to send out any periodic transmissions that it may
|
|
30
|
+ * require.
|
|
31
|
+ */
|
|
32
|
+ void ( *send ) ( unsigned long timestamp );
|
|
33
|
+ /** Process method
|
|
34
|
+ *
|
|
35
|
+ * This method will be called whenever Etherboot has received
|
|
36
|
+ * a packet and doesn't know what to do with it.
|
|
37
|
+ */
|
|
38
|
+ void ( *process ) ( unsigned long timestamp, unsigned short ptype,
|
|
39
|
+ struct iphdr *ip );
|
|
40
|
+};
|
|
41
|
+
|
|
42
|
+/** A member of the background protocols table */
|
|
43
|
+#define __background __table ( background, 01 )
|
|
44
|
+
|
|
45
|
+/* Functions in background.c */
|
|
46
|
+
|
|
47
|
+extern void background_send ( unsigned long timestamp );
|
|
48
|
+
|
|
49
|
+extern void background_process ( unsigned long timestamp, unsigned short ptype,
|
|
50
|
+ struct iphdr *ip );
|
|
51
|
+
|
|
52
|
+#endif /* BACKGROUND_H */
|