3 dpm driver management api – DSS Networks 5161 User Manual

Page 26

Advertising
background image

GigMAC PMC and PCI

Board and Driver Users Manual


10.3 DPM DRIVER MANAGEMENT API


The dpm network driver management API is an api extension primarily used by
the ‘dmUtil’ command line utility to enable various management functions or to
acquire driver status and statistics. The typical api usage sequence is as follows:

1. User enters ‘dmUtil’ command and parameters as shown in the following

example:

./dmUtil –s eth1

2. dmUtil parses command line and prepares an “ioctl” request block to send

to driver. A pointer to a application buffer to hold the text message results
(for example formatted statistics) is provided by dmUtil in the request
block.


3. Driver receives ioctl request block performs action and copies result data

to applications message buffer.


The following is an API description of the management ioctl commands issued to
the driver from the ‘dmUtil’ application’s viewpoint:

A. Opening a socket for management API

int

s;

s = socket (PF_INET, SOCK_STREAM, 0);


B. Create request block for driver ioctl

struct ifreq ifr;

int subCmd;

NpkUserCtl myIoc;

char myDataBuf[MAX_LINES * MAX_LINE_LEN];

/* set interface name */

strcpy (ifr.ifr_name, “eth1”);

/* set ioctl sub-type */

subCmd = DM_IOCTL_GET_STATS;

/* set command argument */

myIoc.arg1 = 0;

myIoc.dataItm = (u_int) myDataBuf;

ifr.ifr_data = (char *) &myIoc;

DSS NETWORKS, INC.

Version: 2.0

Page: 26

Advertising
This manual is related to the following products: