Solaris Bandwidth Manager 1.5 Developing Guide

ba_list_classes()

Name

ba_list_classes() -- retrieve child classes for a specified class

Synopsis

#include <netinet/ba_stat.h>

int ba_list_classes (
	 const char *interface_suffix /* interface name */
  const char *classname /* class name */
  ba_class_pair_t **classes /* array containing information requested */
);

Description

The function ba_list_classes() retrieves a list of the names of the parent and child classes of the class you specified. These are returned in an array of parent-child pairs and include the name of the class you specified. The parent of the root class is root.

Arguments

The function ba_list_classes() is passed the following arguments:

interface

Pointer to a character string containing the name of the managed interface, for example le0_suffix, hme0_suffix, where suffix is one of in, indicating that the interface carries incoming traffic, or out, indicating that the interface carries outgoing traffic.

classname

Pointer to a character string containing the name of the class for which information is required. 

classes

Pointer to an array of structures of type ba_class_pair_t, containing the parent and child class names. There is one structure per parent child pair.

Memory is allocated automatically. You must call ba_free() when the memory is no longer required.

Structures of type ba_class_pair_t are defined as follows:

typedef struct {
	ba_name_t       parent;   /* name of the parent */
	ba_name_t       child;    /* name of the class */
} ba_class_pair_t;

Structures of type ba_class_pair_t contain a pair of structures of type ba_name_t, which are defined as follows:

typedef struct {
	char    name[BA_NAMES_LEN + 1];
	char    padding[3];
	u_short namelen;
	char    padding2[2];
} ba_name_t;

Returns

The function ba_list_classes() returns the number of classes on success, and --1 on error.

Errors

If an error occurs during a call to ba_list_classes(), the variable ba_errno is set to one of the error codes listed in Table 4-2.