summaryrefslogtreecommitdiffstats
path: root/src/include/gpxe/interface.h
diff options
context:
space:
mode:
authorMichael Brown2007-04-27 00:44:52 +0200
committerMichael Brown2007-04-27 00:44:52 +0200
commit2575ddc8894e04dd333d3e7e7ed038d9c6d5c711 (patch)
tree53d17b1822466ee011fe649d783f08b7d23b5498 /src/include/gpxe/interface.h
parentTrivial ASN.1 decoding functions. (diff)
downloadipxe-2575ddc8894e04dd333d3e7e7ed038d9c6d5c711.tar.gz
ipxe-2575ddc8894e04dd333d3e7e7ed038d9c6d5c711.tar.xz
ipxe-2575ddc8894e04dd333d3e7e7ed038d9c6d5c711.zip
Initial sketch for the generic data-transfer interface.
Diffstat (limited to 'src/include/gpxe/interface.h')
-rw-r--r--src/include/gpxe/interface.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/include/gpxe/interface.h b/src/include/gpxe/interface.h
new file mode 100644
index 000000000..38e627211
--- /dev/null
+++ b/src/include/gpxe/interface.h
@@ -0,0 +1,36 @@
+#ifndef _GPXE_INTERFACE_H
+#define _GPXE_INTERFACE_H
+
+/** @file
+ *
+ * Object communication interfaces
+ *
+ */
+
+/** An object communication interface */
+struct interface {
+ /** Destination interface
+ *
+ * When messages are sent via this interface, they will be
+ * delivered to the destination interface.
+ *
+ * This pointer may never be NULL. When the interface is
+ * unplugged, it should point to a null interface.
+ */
+ struct interface *dest;
+ /** Update reference count
+ *
+ * @v intf Interface
+ * @v delta Change to apply to reference count
+ *
+ * This method updates the reference count for the object
+ * containing the interface.
+ */
+ void ( * refcnt ) ( struct interface *intf, int delta );
+};
+
+extern void plug ( struct interface *intf, struct interface *dest );
+
+extern void null_refcnt ( struct interface *intf, int delta );
+
+#endif /* _GPXE_INTERFACE_H */