Table of Contents

Name

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

Synopsis

#include <ulla/lu.h>
ullaResultCode_t ullaRequestLock(const ullaString_t uqlQuery, ullaResultId_t *urId); ullaResultCode_t ullaRequestUnLock(const ullaString_t uqlQuery, ullaResultId_t *urId);

Description

ullaRequestLock and ullaRequestUnLock can be used to lock specific attributes or command per Link User (Link User), or application using ULLA. The LU is identified by pid. Right now, there is no access policy, e.g. by user id or group id, implemented, yet. The unlock has to be performed by the same pid as the lock.

The values of locked attributes cannot be changed by any other LU than the LU holding the lock on the attribute. Locked commands cannot be executed by any other LU than the LU holding the lock on the command.

Active locks can be monitored by the ULLA Core testing interface
cat /proc/net/ulla/locks
There is no ULLA C-API method to check the status of the attribute or command, yet. However, it is possible to try to lock the attribute or command and check if the call was successful by checking the status of the corresponding fields in the ullaResult(2) .

There cannot be a command line utility for this function because the pid the same utility is different for subsequent starts.

Parameters

The following parameters have to be carefully considered:

urId 
A handle for the ullaResult returned.
uqlQuery 
For the ullaRequestLock method only the following statements are valid:
select_statement this statement is used to pick the attributes and commands to be locked by the calling LU per pid.
Please find some examples below.

Return Vallue

On success, the function call returns a handle for the ULLA result at pre-allocated urId. The return value is ULLA_OK.

On error, the return value is negative.

The list of error codes is

ULLA_OK
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.

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.

Examples

Some examples for valid UQL-statements are given below:

How-to lock an attribute, which is used as a parameter
to a command to be issued later?
The attributes, which are parameters to commands, are regular attributes. Their values can be set by the means of the ullaRequestAttribute method with the UQL update_statement. In order to prevent other applications to interfer with the current parameter setting, the LU may want to lock the attribute until the command was executed successfully. The corresponding UQL statement for the ullaRequestLock method can be for instance:
"SELECT scan_scantype FROM ullaLinkProvider;"

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