LQLCon

LQLCon — LQLCon represents a connection to the kernel via a netlink socket.

Synopsis




struct      LQLCon;
int         lql_con_inc_sequence            (LQLCon *self);
double      lql_con_get_tickInUsec          (LQLCon *self);
double      lql_con_get_hz                  (LQLCon *self);
NLCon*      lql_con_get_nlcon               (LQLCon *self);
LQLCon*     lql_con_new                     (void);
LQLInterface* lql_con_find_interface_by_index
                                            (LQLCon *self,
                                             int index);
LQLInterface* lql_con_find_interface_by_name
                                            (LQLCon *self,
                                             const gchar *name);
GList*      lql_con_list_interfaces         (LQLCon *self);
GList*      lql_con_list_qdiscs             (LQLCon *self,
                                             LQLInterface *interface);
GList*      lql_con_list_classes            (LQLCon *self,
                                             LQLInterface *interface);
GList*      lql_con_list_classifiers        (LQLCon *self,
                                             LQLInterface *interface);
int         lql_con_calc_cell_log           (LQLCon *self,
                                             int size);
unsigned    lql_con_calc_xmit_time          (LQLCon *self,
                                             guint32 bps,
                                             guint32 size);
gboolean    lql_con_calc_rate_table         (LQLCon *self,
                                             guint32 bps,
                                             guint32 *rtab,
                                             guint32 mtu,
                                             guint32 mpu);

Object Hierarchy


  GObject
   +----LQLCon

Properties


  "hz"                   gdouble              : Read
  "sequence"             gint                 : Read
  "tick-in-usec"         gdouble              : Read

Description

LQLCon is the object used to communicate with the kernel. It can be used to get a list of the network QoS elements currently in use and is also used by the other objects to add/remove and modify themselves.

Details

struct LQLCon

struct LQLCon;

This should not be accessed directly.


lql_con_inc_sequence ()

int         lql_con_inc_sequence            (LQLCon *self);

Get the next sequence to use when communicating with the kernel.

self : The LQLCon object to work with.
Returns : The next sequence number, -1 on error.

lql_con_get_tickInUsec ()

double      lql_con_get_tickInUsec          (LQLCon *self);

Fetch the number of ticks in a usec on this system.

self : The LQLCon instance.
Returns : The number of ticks in a usec, -1 on error.

lql_con_get_hz ()

double      lql_con_get_hz                  (LQLCon *self);

Get the HZ for this system.

self : The LQLCon instance.
Returns : The HZ, -1 on error.

lql_con_get_nlcon ()

NLCon*      lql_con_get_nlcon               (LQLCon *self);

Fetch a pointer to the NLCon that this LQLCon is using to communicate with the kernel.

self : The LQLCon instance.
Returns : A pointer to a NLCon* instance, -1 on error.

lql_con_new ()

LQLCon*     lql_con_new                     (void);

Build a new instance of LQLCon.

Returns : A new LQLCon instance.

lql_con_find_interface_by_index ()

LQLInterface* lql_con_find_interface_by_index
                                            (LQLCon *self,
                                             int index);

This function returns a LQLInterface object with represents the interface at the specified index.

self : The LQLCon to query.
index : The index of the interface you want.
Returns : A LQLInterface object.

lql_con_find_interface_by_name ()

LQLInterface* lql_con_find_interface_by_name
                                            (LQLCon *self,
                                             const gchar *name);

Find the network interface by name.

self : LQLCon instance.
name : The name to search for.
Returns : LQLInterface instance or NULL on error.

lql_con_list_interfaces ()

GList*      lql_con_list_interfaces         (LQLCon *self);

This function returns a GList containing LQLInterface objects representing each interface in the system.

self : The LQLCon object to use.
Returns : A GList containing LQLInterface objects.

lql_con_list_qdiscs ()

GList*      lql_con_list_qdiscs             (LQLCon *self,
                                             LQLInterface *interface);

This function returns a GList containing LQLQDisc objects representing each queueing discipiline in the system.

self : The LQLCon object to use.
interface : The interface to look at.
Returns : A GList containing LQLQDisc objects.

lql_con_list_classes ()

GList*      lql_con_list_classes            (LQLCon *self,
                                             LQLInterface *interface);

This function returns a GList containing LQLClass objects representing each class in the system.

self : The LQLCon object to use.
interface : The LQLInterface for which to get classes.
Returns : A GList containing LQLClass objects.

lql_con_list_classifiers ()

GList*      lql_con_list_classifiers        (LQLCon *self,
                                             LQLInterface *interface);

This function returns a GList containing LQLClassifier objects representing each classifier in the system.

self : The LQLCon object to use.
interface : The LQLInterface representing the interface to get classifiers for.
Returns : A GList containing LQLClassifier objects.

lql_con_calc_cell_log ()

int         lql_con_calc_cell_log           (LQLCon *self,
                                             int size);

This function figures out how many right shifts are needed to get the packet size below 256. Classes need this value when setting up rate tables.

self : The LQLCon object to use.
size : The size of the packet.
Returns : The number of right shifts to get the size below 256.

lql_con_calc_xmit_time ()

unsigned    lql_con_calc_xmit_time          (LQLCon *self,
                                             guint32 bps,
                                             guint32 size);

This function figures out how long it would take to send size bytes at (bps) bytes per second.

self : The LQLCon object to use.
bps : The speed to use in the calculation.
size : The size of the packet to send.
Returns : The the number of ticks it would take to send the data.

lql_con_calc_rate_table ()

gboolean    lql_con_calc_rate_table         (LQLCon *self,
                                             guint32 bps,
                                             guint32 *rtab,
                                             guint32 mtu,
                                             guint32 mpu);

This function fills out the rate tables. This is needed by some classes.

self : The LQLCon object to use.
bps : The speed in bytes per second.
rtab : A pointer to the table to fill out.
mtu : The MTU size of the interface.
mpu : The MPU size of the interface.
Returns : TRUE on success, FALSE on failure.

Properties

"hz" (gdouble : Read)

Get the system HZ setting.

"sequence" (gint : Read)

Get the next sequence number for communicating with the kernel.

"tick-in-usec" (gdouble : Read)

Set/Get the number of ticks in a usec.