interface.c File Reference

Object communication interfaces. More...

#include <gpxe/interface.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER)
void plug (struct interface *intf, struct interface *dest)
 Plug an interface into a new destination interface.
void plug_plug (struct interface *a, struct interface *b)
 Plug two interfaces together.


Detailed Description

Object communication interfaces.

Definition in file interface.c.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER   ) 

void plug ( struct interface intf,
struct interface dest 
)

Plug an interface into a new destination interface.

Parameters:
intf Interface
dest New destination interface
The reference to the existing destination interface is dropped, a reference to the new destination interface is obtained, and the interface is updated to point to the new destination interface.

Note that there is no "unplug" call; instead you must plug the interface into a null interface.

Definition at line 42 of file interface.c.

References DBGC, and interface::dest.

Referenced by job_plug(), job_unplug(), plug_plug(), resolv_plug(), and resolv_unplug().

00042                                                              {
00043         DBGC ( intf, "INTF %p moving from INTF %p to INTF %p\n",
00044                intf, intf->dest, dest );
00045         intf_put ( intf->dest );
00046         intf->dest = intf_get ( dest );
00047 }

void plug_plug ( struct interface a,
struct interface b 
)

Plug two interfaces together.

Parameters:
a Interface A
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.)

Definition at line 59 of file interface.c.

References plug().

Referenced by job_plug_plug(), and resolv_plug_plug().

00059                                                             {
00060         plug ( a, b );
00061         plug ( b, a );
00062 }


Generated on Tue Apr 6 20:01:14 2010 for gPXE by  doxygen 1.5.7.1