libnl 2.0
Functions

Packet Location Aliasing

Traffic Control

Packet Location Aliasing. More...

Functions

int rtnl_pktloc_lookup (const char *name, struct rtnl_pktloc **result)
 Lookup packet location alias.

Detailed Description

The packet location aliasing interface eases the use of offset definitions inside packets by allowing them to be referenced by name. Known positions of protocol fields are stored in a configuration file and associated with a name for later reference. The configuration file is distributed with the library and provides a well defined set of definitions for most common protocol fields.

Example 1.1 Looking up a packet location
 struct rtnl_pktloc *loc;

 rtnl_pktloc_lookup("ip.src", &loc);

Function Documentation

int rtnl_pktloc_lookup ( const char *  name,
struct rtnl_pktloc **  result 
)
Parameters:
nameName of packet location.

Tries to find a matching packet location alias for the supplied packet location name.

The file containing the packet location definitions is automatically re-read if its modification time has changed since the last call.

Returns:
0 on success or a negative error code.
Return values:
NLE_PKTLOC_FILEUnable to open packet location file.
NLE_OBJ_NOTFOUNDNo matching packet location alias found.

Definition at line 141 of file pktloc.c.