Using the HP-UX IPQoS API

Using Lists

Attaching Objects to Lists

When an object exists in a list it is said to be attached. When an object is created or copied it is (initially) considered unattached, until it is explicitly attached. To attach a policy or filter to a list, use the following functions: IpqosAttachPolicy(), IpqosAttachFilter().

Restrictions

There are two restrictions for attaching a filter object to a list:

The filter must have its name attribute set. The name must be unique.

If the filter’s destination physical address attribute is set, the length of the address must be compatible with the adapter object to which the associated policy object is attached.

There are two restrictions for attaching a policy object to a list:

The policy must have its name attribute set. The name must be unique.

If the policy’s reservation bandwidth attribute is set, it must be a value such that the aggregate reservation of all policy objects attached to an adapter object does not exceed the line speed of the adapter, less 80 Kbps. The 80 Kbps is set aside for classes of traffic that do not match any specified filters.

In the case of VLANs, the aggregate of the reservations of policies of VLANs that are based on the same physical adapter, and the policies of the base adapter itself, cannot exceed the speed of the physical adapter minus the 80Kbps reserved by the implicit default flow.

There are two functions that remove objects from lists. An object can be detached from the list by calling one of the delete functions. The object becomes detached when the session is committed. The object’s memory and resources can be freed by calling one of the destroy functions.

To delete an object its status must not be IPQOS_STATUS_INACTIVE, otherwise the function will return IPQOS_E_NOT_ATTACHED.

To destroy an object its status must be IPQOS_STATUS_INACTIVE, otherwise the function will return the error code IPQOS_E_ALREADY_ATTACHED.

Traversing Lists

As shown in Figure 2-1, the lists are singly-linked and can only be traversed one way.

To obtain the object at the head of an object list, use the following functions: IpqosGetAdapterListHead(), IpqosGetPolicyListHead(), IpqosGetFilterListHead().

Chapter 2

27