interface.h File Reference

Object communication interfaces. More...

#include <gpxe/refcnt.h>

Go to the source code of this file.

Data Structures

struct  interface
 An object communication interface. More...

Functions

 FILE_LICENCE (GPL2_OR_LATER)
static __attribute__ ((always_inline)) struct interface *intf_get(struct interface *intf)
 Increment reference count on an interface.
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.h.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER   ) 

static __attribute__ ( (always_inline)   )  [inline, static]

Increment reference count on an interface.

Decrement reference count on an interface.

Parameters:
intf Interface
Return values:
intf Interface
Parameters:
intf Interface

Definition at line 39 of file interface.h.

References ref_get().

00040                                     {
00041         ref_get ( intf->refcnt );
00042         return intf;
00043 }

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:51 2010 for gPXE by  doxygen 1.5.7.1