From 0898b0b3b1a63a3e95a1c73ebee02d5cf0532607 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 30 Apr 2007 01:23:01 +0000 Subject: [PATCH] Added plug_plug() --- src/core/interface.c | 15 +++++++++++++++ src/include/gpxe/interface.h | 1 + 2 files changed, 16 insertions(+) diff --git a/src/core/interface.c b/src/core/interface.c index 8498425cd..0f4cd55f8 100644 --- a/src/core/interface.c +++ b/src/core/interface.c @@ -42,3 +42,18 @@ void plug ( struct interface *intf, struct interface *dest ) { ref_get ( dest->refcnt ); intf->dest = dest; } + +/** + * Plug two interfaces together + * + * @v a Interface A + * @v b Interface B + * + * Plugs interface A into interface B, and interface B into interface + * A. (The basic plug() function is unidirectional; this function is + * merely a shorthand for two calls to plug(), hence the name.) + */ +void plug_plug ( struct interface *a, struct interface *b ) { + plug ( a, b ); + plug ( b, a ); +} diff --git a/src/include/gpxe/interface.h b/src/include/gpxe/interface.h index 6ec9b1463..59bb42692 100644 --- a/src/include/gpxe/interface.h +++ b/src/include/gpxe/interface.h @@ -29,5 +29,6 @@ struct interface { }; extern void plug ( struct interface *intf, struct interface *dest ); +extern void plug_plug ( struct interface *a, struct interface *b ); #endif /* _GPXE_INTERFACE_H */