The client-API for using the binary channels

These functions can be used by L4 client-application to use the binary channels. More...

Functions

L4_CV int LOG_channel_open (int channel, l4_fpage_t fpage)
 Open a binary output channel.
L4_CV int LOG_channel_write (int id, unsigned off, unsigned size)
 Send data to a binary output channel.
L4_CV int LOG_channel_flush (int id)
 Wait until data is sent by the logserver.
L4_CV int LOG_channel_close (int id)
 Close a binary output channel.

Detailed Description

These functions can be used by L4 client-application to use the binary channels.


Function Documentation

L4_CV int LOG_channel_close ( int  id  ) 

Close a binary output channel.

This function removes the mapping and decrements the reference counter to an open binary output channel at the logserver. If the reference counter becomes 0, the channel is actually closed, i.e. the resources are freed in the logserver.

Parameters:
id id of the connection as returned from LOG_channel_open()
Return values:
0 no error
<0 in the case of error
See also:
LOG_channel_open(), LOG_channel_write(), LOG_channel_flush().
Note:
This function is only available when using the logserver!
Close a binary output channel.

Parameters:
id connection identifier
Returns:
See also:
channel_close()
Marshalling:
  • d1 channel id

Definition at line 116 of file logchannel.c.

L4_CV int LOG_channel_flush ( int  id  ) 

Wait until data is sent by the logserver.

This function waits until the prior write-request is fulfilled and the according memory in the mapped fpage can be reused.

Parameters:
id id of the connection as returned from LOG_channel_open()
Return values:
0 no error
<0 in the case of error
See also:
LOG_channel_write.
Note:
This function is only available when using the logserver!
Wait until data is sent by the logserver.

Parameters:
id connection identifier
Returns:
See also:
channel_flush()
Marshalling:
  • d1 channel id

Definition at line 92 of file logchannel.c.

L4_CV int LOG_channel_open ( int  channel,
l4_fpage_t  page 
)

Open a binary output channel.

This function opens a binary output channel at the logserver. Multiple clients/programs can send data to the same output channel at the logserver, the output is merged then. To do so, the clients must specify the same channel nr when opening. A reference counter holds the number of clients that opened that channel. Channel 1 is used for sending the standard logging text on, using it for sending binary data is not recommended.

The caller of this function must specify a flexpage which is mapped to the logserver. This flexpage is used for transfering data later when using LOG_channel_write().

Parameters:
channel channel nr of the channel to open
fpage a flexpage that will later be used for writing data. The flexpage must contain pinned pages prior to calling this function. The flexpage must not exceed 2MB in its size.
Return values:
>=0 the id of the connection to use later
-L4_ENOMEM the specified fpage exceeded the maximum size
-L4_ENOMAP if the server did not have a free area to receive the fpage or is otherwise short on resources
-L4_EIPC some problem with server communication occured
-L4_EBUSY the server is configured using normal mode, not multiplexed mode for TCP-output. Sending binary data to the client requires multiplexed output. See The LOG Server on how to configure multiplexed mode.
See also:
LOG_channel_write(), LOG_channel_close().
Note:
This function is only available when using the logserver!
Open a binary output channel.

Parameters:
channel the channel to open
page an fpage containing buffer memory used with LOG_channel_write() later
Returns:
See also:
channel_open()
Marshalling:
  • d0/d1 fpage
  • d2/d3 0
  • d4 channel

Definition at line 35 of file logchannel.c.

L4_CV int LOG_channel_write ( int  id,
unsigned  off,
unsigned  size 
)

Send data to a binary output channel.

This function sends data to an open binary output channel at the logserver. This function does not wait until the data is actually sent. Therefore, you should not overwrite the data beeing sent, until a subsequently call to LOG_channel_flush() returns.

Multiple clients/programs can send to the same output channel at the logserver, the output is merged then. It is ensured, that data of different calls to LOG_channel_write() does not intercept each other. When multiple clients/programs use the same channel, it is recommended to use an additional encapsulation to demultiplex the data lateron.

Parameters:
id id of the connection as returned from LOG_channel_open()
off offset of the data in the flexpage provided on LOG_channel_open()
size number of bytes to write
Return values:
0 no error
<0 in the case of error
See also:
LOG_channel_open(), LOG_channel_flush(), LOG_channel_close().
Note:
This function is only available when using the logserver!
Send data to a binary output channel.

Parameters:
id connection identifier
off offset of data in the connection buffer
size size of data to write
Returns:
See also:
channel_write()
Marshalling:
  • d1 channel id
  • d2 off
  • d3 length

Definition at line 68 of file logchannel.c.


Generated on Wed Apr 11 06:40:52 2012 for Logging and output facility for DROPS by  doxygen 1.5.6