Table of Contents

Name

ULLA (Unified Link Layer API) - access link layer information

Synopsis

#include <ulla/lu.h>

ullaResultCode_t ullaResultStatus(const ullaResultId_t urId);

ullaResultCode_t ullaResultTuple(const ullaResultId_t urId, ullaTupleId_t *utId);

void ullaResultFree(const ullaResultId_t urId);

Description

In order to access the data from the ULLA result, the Link User (LU), or application using ULLA, can utilize the accessor functions. The ULLA result is structured using tuples and fields. Using a tupleId the LU can iterate over the "rows" in the ullaResult. Each tuple has as a the same number of fields, according to the uql_statement used. The order of the attribute or command names in the uqp_statement determines the order the data is stored into the ULLA result fields. Please consult ullaTuple(2) as a reference to the various accessor function to field entries.

int ullaResultStatus is used to check the status of the respective ullaResult. It may be freed already or still valid. The return code of the function is either ULLA_OK or an error code (see below).

int ullaResultTuple will return a tupleId to be used with the ullaTuple(2) accessor functions.

int ullaResultFree is required to free the ullaResult after all data has been extracted.

Parameters

The following parameters apply to all ullaResult methods:
urId
unique handle for a specific ullaResult.
utId
handle to iterate over the "rows" of the ullaResult. The LU may chose to create multiple utId handles on the same ullaResult.

Return Vallue

ULLA_OK
everything is fine.

ULLA_NO_MEMORY
everything is fine.

ULLA_NO_MEMORY
ran out of user space or kernel space RAM memory.

ULLA_INSUFICIENT_MEMORY
ran out of user space RAM memory.

ULLA_ERROR_IN_VALUE
a parameter is syntactically or semantically incorrect.

ULLA_ERROR_FAULT
general error occured.

ULLA_NOT_SUPPORTED
field status might have this error code. If the tables listed in the uql_statment do not contain the specific attribute or command this error code is set.

ULLA_ATTRIBUTE_NOT_AVAILABLE
field status might have this error code. If the LLA was not able to provide the data value of the attribute or, in the case of commands, was unable to execute the command at that point of time the field status is set to ULLA_ATTRIBUTE_NOT_AVAILABLE.

ULLA_SEGMENTATION_FAULT
ULLA Core implementation error.

ULLA_CORE_NOT_PRESENT
the ULLA Core kernel module cannot be loaded.

ULLA_BUG
ULLA Core implementation bug.

ULLA_NO_MORE_TUPLES_ERROR
if the ullaTupleNext function cannot increment to the next tuple in the ullaResult because the final tuple has been reached this error code is returned to the LU.

ULLA_FIELD_VALUE_ERROR
field value cannot be retrieved due to bad field status.

ULLA_ERROR_LOCKED
if an attribute was to be set, or a command was to be excuted, which is locked by some other LU, the field status is set to ULLA_ERROR_LOCKED.

Examples

How-to access the tuples of an ullaResult:
#include <ulla/lu.h>
ullaResultCode_t res;
ullaResultId_t urId;
ullaTupleId_t utId;

if( (res = ullaRequestAttributes("SELECT linkId FROM ullaLink", &urId, 0)) < 0) {
/* failed to perform query */

}

if( (res = ullaResultTuple(urId, &utId)) < 0) {
/* failed to access tuples from ullaResult */

/* verify status of the ullaResult if shared among threads */

}

ullaResultFree(urId);

How-to check ullaResult status:
status = ullaResultStatus(&urId);
switch(status)
{

case ULLA_ERROR_IN_VALUE:

/* result data freed */

break;

case ULLA_ERROR_OK:

/* result data still valid */

break;

}

See Also

ullaReflection(1) , ullaAttribute(1) , ullaCommand(1) , ullaSample(1) , ullaNotification(1) , ullaTools(1)

ulla(2) , uql(2) , ullaResult(2) , ullaTuple(2) , ullaRequestReflection(2) , ullaRequestAttribute(2) , ullaRequestCommand(2) , ullaRequestNotification(2) , ullaRequestSample(2) , ullaRequestLock(2) , ullaGetCoreDescriptor(2)

Conforming to

RWTH contribution to the GOLLUM project (http://www.ist-gollum.org). Compliant with ULLA C-API Version 1.0 (http://ulla.sourceforge.net).

Author

This man page was written by Marten Bandholz (mba@mobnets.rwth-aachen.de).


Table of Contents