Solaris Bandwidth Manager 1.6 Developer Guide

ba_decode_ifname()

Name

ba_decode_ifname() -- extract physical interface name and direction

Synopsis

#include <netinet/ba_stat.h>

int ba_decode_ifname(
   const char *ifname; /*bandwidth manager interface name*/
   char *interface; /*physical interface*/
   uint_t direction; /*traffic direction*/
  );

Description

The function ba_decode_ifname() extracts the physical interface name interface and the direction of traffic handled by the interface from the Solaris Bandwidth Manager interface name ifname. For example, if ifname contains le0_in, the interface is le0 and the direction is BA_DIR_INCOMING.

Arguments

The function ba_decode_ifname() is passed the following arguments:

ifname

Pointer to a character string that contains the encoded interface name, for example le0_in.

interface

Pointer to the decoded physical interface name. Be sure to allocate sufficient memory. 

direction

Pointer to the decoded direction. 

Returns

The function ba_decode_ifname() returns the number of characters written on success, and -1 on error.

Errors

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