|
@@ -0,0 +1,33 @@
|
|
1
|
+#ifndef PROTO_H
|
|
2
|
+#define PROTO_H
|
|
3
|
+
|
|
4
|
+#include "tables.h"
|
|
5
|
+
|
|
6
|
+struct protocol {
|
|
7
|
+ char *name;
|
|
8
|
+ int ( * load ) ( const char *name,
|
|
9
|
+ int ( * process ) ( unsigned char *data,
|
|
10
|
+ unsigned int blocknum,
|
|
11
|
+ unsigned int len,
|
|
12
|
+ int eof ) );
|
|
13
|
+};
|
|
14
|
+
|
|
15
|
+/*
|
|
16
|
+ * Protocols that should be used if no explicit protocol is specified
|
|
17
|
+ * (i.e. tftp) should use __default_protocol; all other protocols
|
|
18
|
+ * should use __protocol.
|
|
19
|
+ *
|
|
20
|
+ */
|
|
21
|
+#define __protocol_start __table_start(protocol)
|
|
22
|
+#define __protocol __table(protocol,01)
|
|
23
|
+#define __default_protocol_start __table(protocol,02)
|
|
24
|
+#define __default_protocol __table(protocol,03)
|
|
25
|
+#define __protocol_end __table_end(protocol)
|
|
26
|
+
|
|
27
|
+/*
|
|
28
|
+ * Functions in proto.c
|
|
29
|
+ *
|
|
30
|
+ */
|
|
31
|
+extern struct protocol * identify_protocol ( const char *name );
|
|
32
|
+
|
|
33
|
+#endif /* PROTO_H */
|