os-cmpi-xen

view src/Xen_NetworkPortSettingData_Resource.h @ 121:4868ace2726b

Add initial consistence checks in test suite for Xen_MemoryPool, Xen_ProcessorPool and Xen_VirtualSystemManagementService.

Signed-off-by: Luke Szymanski <Lukasz.Szymanski@Unisys.com>
author Jim Fehlig <jfehlig@novell.com>
date Fri Jun 08 10:22:05 2007 -0600 (2007-06-08)
parents 91ba4cca4e7f
children
line source
1 // Copyright (C) 2006 IBM Corporation
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 // ============================================================================
17 // Authors: Dr. Gareth S. Bestor, <bestor@us.ibm.com>
18 // Tokunbo Adeshiyan, <tokunbo@us.ibm.com>
19 // Contributors: Jim Fehlig, <jfehlig@novell.com>
20 // Description:
21 // ============================================================================
23 /* Include required libxen headers. */
24 #include <xen_common.h>
25 #include <xen_vif.h>
27 #include "xen_utils.h"
29 /* Include the required CMPI data types. */
30 #include "cmpidt.h"
33 /*** CUSTOMIZE FOR EACH PROVIDER ***/
34 /* DEFINE A HANDLE TO REPRESENT THE 'LIST' OF ALL SYSTEM RESOURCES.
35 THE MAIN PROVIDER CODE DOES NOT NEED TO KNOW THE PARTICULARS OF HOW THIS
36 LIST IS IMPLEMENTED - IT MAY BE AN ARRAY, LINKED LIST, FILE, ETC.
37 THIS HANDLE IS PASSED INTO THE APPROPRIATE RESOURCE ACCESS METHODS WHEN
38 ACCESSING/ITERATING/ADDING/REMOVING RESOURCES INSTANCES. */
39 typedef struct {
40 xen_vif_set *vifs;
41 unsigned int currentvifnum;
42 } _RESOURCES;
44 /*** CUSTOMIZE FOR EACH PROVIDER ***/
45 /* DEFINE A HANDLE TO BE USED FOR EACH INSTANCE OF A SYSTEM RESOURCE.
46 THE MAIN PROVIDER CODE DOES NOT NEED TO KNOW THE PARTICULARS OF HOW EACH
47 RESOURCE IS REPRESENTED, BUT TYPICALLY IT IS A STRUCTURE MIRRORING THE
48 PROPERTIES IN THE CIM CLASS. THIS HANDLE IS PASSED BETWEEN THE RESOURCE
49 ACCESS METHODS WHEN MANIPULATING SPECIFIC RESOURCE INSTANCES. */
50 typedef xen_vif_record _RESOURCE;
53 /* NOTHING BELOW THIS LINE SHOULD NEED TO BE CHANGED. */
55 // ----------------------------------------------------------------------------
56 // Generic resource access methods for CMPI providers.
57 // Return value:
58 // -1 = Unsupported
59 // 0 = Failed
60 // 1 = OK
61 // ----------------------------------------------------------------------------
63 /* Get a handle to the list of all system resources for this class. */
64 int Xen_NetworkPortSettingData_getResources(xen_utils_session *session,
65 _RESOURCES ** resources);
67 /* Free/deallocate/cleanup the resources list after use. */
68 int Xen_NetworkPortSettingData_freeResources(_RESOURCES * resources);
70 /* Iterator to get the next resource from the resources list. */
71 int Xen_NetworkPortSettingData_getNextResource(xen_utils_session *session,
72 _RESOURCES * resources,
73 _RESOURCE ** resource);
75 /* Get the specific resource that matches the CMPI object path. */
76 int Xen_NetworkPortSettingData_getResourceForObjectPath(xen_utils_session *session,
77 _RESOURCE ** resource,
78 const CMPIObjectPath * objectpath);
80 /* Free/deallocate/cleanup a resource after use. */
81 int Xen_NetworkPortSettingData_freeResource(_RESOURCE * resource);
83 /* Set the property values of a CMPI instance from a specific resource. */
84 int Xen_NetworkPortSettingData_setInstanceFromResource(xen_utils_session *session,
85 _RESOURCE * resource,
86 const CMPIInstance * instance,
87 const CMPIBroker * broker);
89 // THE FOLLOWING METHODS MAY/NOT BE SUPPORTED BY THE SYSTEM FOR THIS CLASS
91 /* Delete the specified resource from the system. */
92 int Xen_NetworkPortSettingData_deleteResource(xen_utils_session *session,
93 _RESOURCE * resource);
95 /* Modify the specified resource using the property values of a CMPI instance. */
96 int Xen_NetworkPortSettingData_setResourceFromInstance(_RESOURCE * resource,
97 const CMPIInstance * instance,
98 const CMPIBroker * broker);
100 /* Create a new resource using the property values of a CMPI instance. */
101 int Xen_NetworkPortSettingData_createResourceFromInstance(_RESOURCES * resources,
102 _RESOURCE ** resource,
103 const CMPIInstance * instance,
104 const CMPIBroker * broker);