Sample Script - HP StorageWorks MSA 2/8 - SAN Switch User Manual

Hp storageworks fabric watch v3.1.x/4.1.x user guide (aa-rtsgc-te, june 2003)
Hide thumbs Also See for StorageWorks MSA 2/8 - SAN Switch:
Table of Contents

Advertisement

Sample Script

/* FabricWatchExample.c*/
/* C Library Headers */
#include <stdio.h> /* standard io function library */
#include <string.h> /* string functions */
#include <stdlib.h> /* for malloc() and exit()*/
/* HP API Library Headers */
#include "hapi.h"
#include "hapiattr.h"
int main(int argc, char **argv) {
int fwArea,fwClass,fwIndex,i,ch,str_len;
char buf[32];
OID_t switchOID,classAreaOID,threshEntryOID,FabOID;
char *addr_string=NULL;
AddrType *ipaddress=NULL;
FabricIdentitiesType *fab_id_p=(FabricIdentitiesType *)NULL;
ObjTypeFWClassArea *obj_fw_ca=(ObjTypeFWClassArea *)NULL;
ObjTypeFWThresholdEntry *obj_fw_te=(ObjTypeFWThresholdEntry *)NULL;
ObjTypeFabric *fab_obj_p=(ObjTypeFabric *)NULL;
ipaddress = (AddrType *)malloc(sizeof(AddrType)*(1+1));
printf("IP Address: ");
fflush(stdin);
for( i = 0; (i < 32) && ((ch = getchar()) != EOF) && (ch != '\n'); i++ )
buf[i] = (char)ch;
buf[i] = '\0';
str_len = strlen(buf) + 1;
Fabric Watch Version 3.1.x/4.1.x User Guide
Sample API Script
231

Advertisement

Table of Contents
loading

Table of Contents