Previous  |  Next  >  
Product: Cluster Server Guides   
Manual: Cluster Server 4.1 Agent Developer's Guide   

ArgList Attribute

The ArgList attribute is a predefined static attribute that specifies the list of attributes whose values are passed to the open, close, online, offline, action, info, and monitor entry points. The values of the ArgList attributes are passed through a parameter of type void **. For example, the signature of the online entry point is:


 unsigned int
  res_online(const char *res_name, void **attr_val);

The parameter attr_val is an array of character pointers that contains the ArgList attribute values. The last element of the array is a NULL pointer. Attribute values in attr_val are listed in the same order as attributes in ArgList.

The values of scalar attributes (integer and string) are each contained in a single element of attr_val. The values of non-scalar attributes (vector, keylist, and association) are contained in one or more elements of attr_val. If a non-scalar attribute contains N components, it will have N+1 elements in attr_val. The first element is N, and the remaining N elements correspond to the N components. SeeArgList for more information. See the chapter describing the VCS configuration language in the VERITAS Cluster Server User's Guide for attribute definitions.

For example, if Type "Foo" is defined in the file types.cf as:


 Type Foo (
   str Name
    int IntAttr
   str StringAttr
   str VectorAttr[]
   str AssocAttr{}
   static str ArgList[] = { IntAttr, StringAttr,
     VectorAttr, AssocAttr }
 )

And if a resource "Bar" is defined in the file main.cf as:


 Foo Bar (
   IntAttr = 100
   StringAttr = "Oracle"
   VectorAttr = { "vol1", "vol2", "vol3" }
   AssocAttr = { "disk1" = "1024", "disk2" = "512" }
 )

The parameter attr_val will be:


 attr_val[0] ===>   "100"     // Value of IntAttr, the first
               // ArgList attribute. 
 attr_val[1] ===>  "Oracle" // Value of StringAttr.
 attr_val[2] ===>  "3"    // Number of components in VectorAttr.
 attr_val[3] ===>  "vol1"
 attr_val[4] ===>  "vol2"
 attr_val[5] ===>  "vol3"
 attr_val[6] ===>  "4"    // Number of components in AssocAttr.
 attr_val[7] ===>  "disk1"
 attr_val[8] ===>  "1024"
 attr_val[9] ===>    "disk2"
 attr_val[10]===>   "512"
 attr_val[11]===>   NULL  // Last element.
 ^ Return to Top Previous  |  Next  >  
Product: Cluster Server Guides  
Manual: Cluster Server 4.1 Agent Developer's Guide  
VERITAS Software Corporation
www.veritas.com