mcsysinfoc — MagniComp™ SysInfo™ C API to obtain detailed system information in a platform neutral manner
cc -I/opt/sysinfo/include [ options ]file
[ ... ] `/opt/sysinfo/libexec/bin/libs` #include <mcsysinfo.h> MCSIquery_t Query; McsiOpt_t Opt; /* Set configuration options */ Opt->ConfigDir = "/opt/sysinfo/config"; /* Config Dir - REQUIRED */ Opt->ProgramName = "name
"; /* Name of program - REQUIRED */ Opt->Flags =Flags
; /* Flags like SIM_DEBUG */ Query.Op = MCSIOP_SETOPTS; Query.In = Opt; Query.InSize = sizeof(McsiOpt_t); if (mcSysInfo(&Query) == 0) /* Success */ else /* Error */ /* RetrieveMCCMD
data */ Query.Op = MCSIOP_CREATE; Query.Cmd =MCCMD
; /* Command to run */ if (mcSysInfo(&Query) == 0) /* Success */ else /* Error */ /* Destroy (free) memory */ Query.Op = MCSIOP_DESTROY; if (mcSysInfo(&Query) == 0) /* Success */ else /* Error */
The mcSysInfo() C API is part of SysInfo from MagniComp. It allows the caller to obtain system information about the local or remote system's configuration via a platform neutral interface. Data is returned in platform nuetral data structures. This allows applications to be built using mcSysInfo() which are platform neutral. Available detailed system data includes general configuration, installed hardware, software, disk partitioning, system configuration, and kernel parameters. See mcsysinfo(1) for an overview of SysInfo.
The mcsysinfoperl(3) perl(1) object API may also be used if a perl(1) interface is required.
The MagniComp mcsysinfo(1) command uses the mcsysinfoc(3) API to obtain system configuration data and present it in human and machine readable formats.
The Query.Op parameter controls the basic operation performed by mcSysInfo(). The following values are supported:
When Query.Op is set to MCSIOP_PROGRAM then Query.In should point at a string naming the calling program and Query.InSize should be set to the size of Query.In in bytes. This name is used by mcSysInfo() when displaying error and debug messages. This interface is deprecated by McsiOpt_t->ProgramName.
When Query.Op is set to MCSIOP_SETOPTS then Query.In should be a pointer to a McsiOpt_t buffer and Query.InSize should be the size of Query.In in bytes. This command is used to pass options to mcSysInfo() for future calls.
When Query.Op is set to MCSIOP_CREATE, data is retrieved from the local system in platform specific manner and placed in allocated structures in the location indicated by Query.Out.
When Query.Op is set to MCSIOP_DESTROY, the data located at the address indicated by Query.Out is destroyed (unallocated).
The McsiOpt_t type is used to specify configuration options when Query.Op is set to MCSIOP_SETOPTS. It's defined as follows:
#define MCSIOPT_NOSERIAL 0x000001 /* Don't check serial #'s */ #define MCSIOPT_DEBUG 0x000002 /* Enable debugging output */ /* * Set mcSysInfo() options. * * This type is based to mcSysInfo() to allow the caller to specify * API options. * * Passed to mcSysInfo() when MCSIquery_t.Op = MCSIOP_SETOPTS */ typedef struct { int Flags; /* General flags */ char *ProgramPath; /* Path to this program */ char *ProgramName; /* Name of this program */ char *ConfigDir; /* SysInfo config dir */ char *ConfigFile; /* Caller specified config file */ } McsiOpt_t;
The ConfigDir and ProgramName members are required to be set prior to any MCSIOP_CREATE operation. Failure to set ConfigDir may result in incomplete data being returned.
The Query is defined as follows:
/* * Query type for mcSysInfo() calls */ typedef struct { /* Caller's Input */ int Op; /* MCSIOP_* operator */ int Cmd; /* MCSI_* command to perform */ uint_t Flags; /* Option Flags */ char **SearchExp; /* Search Expression */ Opaque_t In; /* Ptr to Input */ size_t InSize; /* Size of In */ /* Results */ Opaque_t Out; /* Ptr to Output */ size_t OutSize; /* Size of Out */ } MCSIquery_t;
The members of MCSIquery_t are defined as follows:
Specifies what operation to perform on Cmd. Valid values are as follows:
(Default) Obtain the data requested by Cmd and return the result in the Out and OutSize parameters. The data located at Out is allocated when this function is called and should be destroyed (unallocated) by calling mcSysInfo() with Op set to MCSIOP_DESTROY (see below).
Destroy (unallocate) the data located at address Out.
Specifies which command to perform. See below for the valid list of commands.
Flags is a set of bit flags which enable different options as specified by the following values:
(Default) This option causes data to be returned to the Out buffer in the form requiring the least amount of additional parsing by the calling function as possible. The actual form varies according to the Cmd that was specified.
This option causes data to be returned in string form readying for human display whenever possible. This option is only available for specific Cmd values as specified below.
An array of strings to use to limit the data returned in Out. Only the following commands support this option:
Used to specify a list of names which are checked against the device's Name, Aliases, and AltName values.
Used to provide input to certain operations such as MCSIOP_PROGRAM.
Size of In in bytes.
All data is returned in an allocated buffer at the location specified by the Out parameter The contents of the buffer vary according to the Cmd specified. See below for more details.
The size (length) of data located in the Out location is specified by OutSize where appropriate. The OutSize data is not guarenteed to by the full size of the allocated buffer, but is guaranteed to always be greater than zero when the call succeeds and Out points to a valid buffer. See below for more details.
The valid values for Cmd are as follows:
Obtain the application architecture of the system (e.g. SPARC, x86, etc.).
Points at a char * buffer. e.g. "sparc".
Indicates the length of the Out buffer.
Obtain the time that the system was last booted.
Points at a char * buffer. e.g "Sat Jun 19 11:55:41 1999".
Indicates the length of the Out buffer.
Obtain detailed information about the primary CPU in the system.
Points at a CpuInfo_t buffer.
Indicates the length of the Out buffer.
Obtain the type of CPU used in the system (e.g. SPARCv9, Pentium, etc.).
Points at a char * buffer. e.g. "UltraSPARC-III".
Indicates the length of the Out buffer.
Obtain the clock speed of the primary CPU in the system.
Points at a char * buffer. e.g. "1.6 GHz"
Indicates the length of the Out buffer.
Obtain the current (local) system time.
Points at a char * buffer. e.g "Sat Jun 19 11:55:41 1999".
Indicates the length of the Out buffer.
Obtain a list, possible in a hierarchical tree, of physical (hardware) devices present on the system.
Pointer to a DevInfo_t buffer. See DevInfo_t below for details.
Is 1 or more if Out contains valid data.
Obtain a list of the local hosts IP addresses.
When MCSIF_DATA is set in Flags (the default) Out is a pointer to a char ** array of IP addresses. The last entry in this array will always be NULL. When MCSIF_STRING is set in Flags Out is a pointer to a char * string which contains a space seperated list of IP addresses. e.g. "129.152.1.1 129.152.20.1 192.5.5.44".
When MCSIF_DATA is set in Flags (the default) OutSize indicates the number of entries in the array located at the Out location. When MCSIF_STRING is set in Flags OutSize indicates the length of the buffer.
Obtain a list of host aliases for the local host. These are obtained via the gethostbyname(3) call from the h_aliases parameter of struct hostent.
When MCSIF_DATA is set in Flags (the default) Out is a pointer to a char ** array of aliases. The last entry in this array will always be NULL. When MCSIF_STRING is set in Flags Out is a pointer to a char * string which contains a space seperated list of aliases. e.g. "fred fred2 fred3".
When MCSIF_DATA is set in Flags (the default) OutSize indicates the number of entries in the array located at the Out location. When MCSIF_STRING is set in Flags OutSize indicates the length of the buffer.
Obtain the host identifier.
Points at a char * buffer. e.g. "8025asf3".
Indicates the length of the Out buffer.
Obtain the system's canonical hostname.
Points at a char * buffer. e.g. "sunworld".
Indicates the length of the Out buffer.
Obtain the kernel architecture of the system (e.g. sun4u, sun4m, etc.).
Points at a char * buffer. e.g. "sun4u".
Indicates the length of the Out buffer.
Obtain the kernel bit size of the system (e.g. 32, 64)
Points at a char * buffer. e.g. "32".
Indicates the length of the Out buffer.
Obtain a list of kernel variables, their description, and their values as presently configured.
Points at a linked list of type Define_t which contains data as follows:
The name of the kernel variable.
The type of variable this is (boolean, int, long, string).
Descriptive text of what this variable is for.
The value obtained from the kernel. The value is NULL if the information was not available from the kernel.
The number of valid entries in the linked list at location Out.
Obtain the version of the kernel which is installed (e.g. SunOS Release 5.6 Version Generic_105182-05 [UNIX(R) System V Release 4.0])
Points at a char * buffer.
Indicates the length of the Out buffer.
Obtain the name of libc used on the system. Normally returns "libc" or "glibc".
Points at a char * buffer. e.g. "libc"
Indicates the length of the Out buffer.
Obtain the version of libc used on the system.
Points at a char * buffer. e.g. "2.2.4"
Indicates the length of the Out buffer.
Obtain a list of all licenses from locally running license servers.
Pointer to a License_t buffer. See License_t below for details.
Is 1 or more if Out contains valid data.
Obtain the combined short and long name of the host's manufacturer.
Points at a char * buffer. e.g. "Sun (Sun Microsystems, Inc.)".
Indicates the length of the Out buffer.
Obtain the long name of the host's manufacturer.
Points at a char * buffer. e.g. "Sun Microsystems, Inc."
Indicates the length of the Out buffer.
Obtain the short name of the host's manufacturer.
Points at a char * buffer. e.g. "Sun".
Indicates the length of the Out buffer.
Obtain the host's model name.
Points at a char * buffer. e.g. "Ultra 10 Model 300".
Indicates the length of the Out buffer.
Obtain the number of physical CPUs which are installed and enabled.
Points at a char * buffer. e.g. "2".
Indicates the length of the Out buffer.
Obtain the number of virtual CPUs which are installed and enabled.
Points at a char * buffer. e.g. "2".
Indicates the length of the Out buffer.
Obtain the full distribution description of the operating system (e.g. Solaris 2.6 5/98, S.u.S.e. 6.1, etc.).
Points at a char * buffer.
Indicates the length of the Out buffer.
Obtain the distribution name of the operating system (e.g. Solaris, Red hat, etc.).
Points at a char * buffer.
Indicates the length of the Out buffer.
Obtain the short distribution name of the operating system (e.g. solaris, redhat, etc.).
Points at a char * buffer.
Indicates the length of the Out buffer.
Obtain the distribution version of the operating system (e.g. 8, 7.2, etc.)
Points at a char * buffer.
Indicates the length of the Out buffer.
Obtain the name of the operating system.
Points at a char * buffer. e.g. "SunOS".
Indicates the length of the Out buffer.
Obtain the version of the operating system (e.g. 5.6, 4.2.1, etc.).
Points at a char * buffer.
Indicates the length of the Out buffer.
Obtain a list, possible in a hierarchical tree, of disk partitions defined on this system.
Pointer to a PartInfo_t buffer. See PartInfo_t below for details.
Is 1 or more if Out contains valid data.
Obtain a list of all printer queues know to the system.
Pointer to a Printer_t buffer. See Printer_t below for details.
Is 1 or more if Out contains valid data.
Obtain the host's serial number.
Points at a char * buffer. e.g. "FF5443139".
Indicates the length of the Out buffer.
Obtain a list, possible in a hierarchical tree, of software and software packages which are installed on the system.
Pointer to a SoftInfo_t buffer. See SoftInfo_t below for details.
Is 1 or more if Out contains valid data.
Obtain a list of system configuration values via the sysconf(3) interface.
Points at a linked list of type Define_t which contains data as follows:
The name of the variable.
The type of variable this is (boolean, int, long, string).
Descriptive text of what this variable is for.
The value obtained from the kernel converted to a string. The value is NULL if the information was not available from the kernel.
The value obtained from the kernel in integer form. The value is less than 0 if the data was not retrieved successfully.
The primary device information data type is DevInfo_t which is defined as:
struct _DevInfo { char *Name; /* Name (e.g. cgtwo0) */ char *Driver; /* Driver Name (e.g. cgtwo) */ char **Aliases; /* Alias Names */ char *AltName; /* Alt name */ char **Files; /* Device files */ int Type; /* Device type (eg DT_TAPE) */ int ClassType; /* Class type (eg SCSI,IPI) */ char *Vendor; /* Hardware Vendor */ char *Model; /* Model */ char *ModelDesc; /* eg SCSI, 4.0GB, etc. */ char *Serial; /* Serial Number */ char *Capacity; /* Capacity of device */ char *Speed; /* Speed of device */ char *Revision; /* Revision Info */ DevDesc_t *DescList; /* Device Description */ int Unit; /* Unit number */ int NodeID; /* ID of this node */ char *MasterName; /* Name of master */ void *DevSpec; /* Device specific info */ struct _DevInfo *Master; /* Device controller */ struct _DevInfo *Slaves; /* Devices on this device */ struct _DevInfo *Next; /* Pointer to next device */ /* Internal use only */ void *OSdata; /* Data from OS */ /* Obsolete */ int Addr; /* Address */ int Prio; /* Priority */ int Vec; /* Vector */ }; typedef struct _DevInfo DevInfo_t;
The members of DevInfo_t are defined as follows:
The devices name, inclusive of it's unit number. e.g. sd0. If the device name ends in a digit, then the slash ('/') character followed by the unit number is appended to clarify the name. e.g. pgx32/0
The name of the device driver for this device. This is typically, but not always, the value of Name without the unit. e.g. For a device with a Name of sd0 the value of Driver would be sd
An array of alternate values for Names by which this device may be addressed. e.g. A device with Name of dwis0 might have an alias such as pci1001,2003 .
This member is depreciated by the Aliases member. When set, it contains a single alternate name by which this device is known.
An array (list) of device (block, special) files by which this device might be addressed.
A numeric value which classes the type of device. Valid numeric values are defined by the DT_* entries in <mcsysinfo.h>.
This value defines a classification of this device within it's Type. The valid values for ClassType are specified by the CT_* entries in <mcsysinfo.h>. e.g. A SCSI disk device would have a Type of DT_DISK and a ClassType value of CT_SCSI .
The name of the vendor who sold or manufactured this device.
The model name of the device.
A further description of the model which varies by device and operating system.
The devices serial number.
A string containing the capacity (size) of a device in device specific units. For a DT_DISKDRIVE this will typically be a something like 32 GB
A string containing the speed of a device in device specific units. For a DT_DISKDRIVE this might be 33 MB/s For a DT_PROCESSOR the speed would indicate the clock speed such as 850 MHz
The revision of the device.
A list of descriptive information that is not otherwise specified in DevInfo_t. This list varies greatly by operating system and specific hardware platforms and models. There is no guarentee that the DescList information will remain constant from model to model, even on the same version of an operating system.
The device's unit number. This is usually, but not always, the physically assigned unit number of the device.
Some operating systems and hardware platforms (e.g. Solaris+SPARC+OpenBootProm) assign devices soft, unique identifiers for tracking purposes inside the kernel.
The name of our master (parent) device. This is used if no Master link is available. The Master data should always be used whenever available.
A pointer to the master (parent) for this device.
A pointer to a list of any slave (child) devices which belong to this device.
A pointer to any sibling devices which all belong to the same Master.
The address to a buffer containing information specific to the device Type . The following device Type values normally provide data via DevSpec :
Pointer to a CpuInfo_t entry (see below).
Pointer to a DiskDrive_t entry.
Pointer to a FrameBuffer_t entry.
Pointer to a NetIF_t entry.
Pointer to a Monitor_t entry.
This value is obsolete.
This value is obsolete.
This value is obsolete.
The CpuInfo_t type specifies CPU information. It is usually available via DevInfo_t.DevSpec when DevInfo_t.Type is set to DT_CPU. The definetion of CpuInfo_t is:
struct _CpuInfo { char *Man; /* Manufacturer */ char *Model; /* Model of CPU */ char *Arch; /* Architecture Name */ char *ArchVer; /* Architecture Version */ char *Serial; /* Serial# */ int BitSize; /* Bits 32/64/... */ Large_t Speed; /* Clock Speed in Mhz */ CacheInfo_t *L1iCache; /* L1 Instruction Cache */ CacheInfo_t *L1dCache; /* L1 Data Cache */ CacheInfo_t *L2Cache; /* L2 Cache */ /* General features */ Bool_t HasFPU; /* Has FPU */ int Stepping; /* Stepping */ Desc_t *Features; /* List of features */ }; typedef struct _CpuInfo CpuInfo_t;
The members of CpuInfo_t are defined as follows:
The name of the manufacturer of the CPU.
The model of CPU.
The architecture of the CPU.
The architecture version of the CPU.
The serial number of the CPU.
The addressable bitsize of the CPU.
e.g.
32
or
64
The clock speed of the CPU in mega-hertz.
A CacheInfo_t entry describing the L1 instruction cache.
A CacheInfo_t entry describing the L1 data cache.
A CacheInfo_t entry describing the L2 cache.
Boolean value indicating where the CPU has an onboard Floating Point Unit.
The CPU's stepping value.
A list of otherwise unstructured features supported by the CPU.
The CacheInfo_t type specifies CPU cache information. This type is used by CpuInfo_t to define cache information for varies types of caches associated with a CPU. The definetion of CacheInfo_t is as follows:
/* * Cache Information type */ typedef struct { int Enabled; /* Is this cache enabled? */ int Type; /* Type of Cache */ int Level; /* Level=1, 2, ... */ Large_t Size; /* Size (bytes) */ int Speed; /* Speed (ns) */ int Assoc; /* Associativity */ int Lines; /* # Lines */ int LineSize; /* Line Size (bytes)*/ int TLB; /* # TLB Entries */ int TLBAssoc; /* # TLB Associativity */ int Socketed; /* Is cache socketed? */ char *Location; /* Location relative to CPU */ char *SramType; /* SRAM Type */ char *EccType; /* ECC Type */ char *Mode; /* Mode (Write Back/Through..*/ } CacheInfo_t;
The members of CacheInfo_t are defined as follows:
A boolean indicating whether the cache is enabled (1
) or not (0
).
An integer which specifies the type of cache. The value should be one of the following:
Instruction cache
Data cache
Unified cache
An integer which specifies the level of cache.
i.e.
1
is an L1 cache,
2
is an L2 cache,
etc.
A value of
0
indicates an unknown level.
A Large_t number which specifies the size of the cache in bytes.
An integer which specifies the speed of the cache in ns.
A number which specifies the Associativity value.
The number of lines in the cache.
The size of each line in the cache in bytes.
The number of TLB entries.
The number of TLB associativity.
A value of
1
indicates the cache is socketed.
A value of
0
indicates the cache is not socketed.
A value of
-1
indicates an unknown state.
A string describing the location of the cache.
A string describing the SRAM type.
A string describing the type of error correction used.
A string describing the mode of cache. i.e. Write Back etc.
The License_t type defines a license entry as follows:
/* * Types of licenses */ #define LT_FLOAT 1 /* Floating/concurrent */ #define LT_NODELOCK 2 /* Locked to 1 node */ /* * License Types * Order/value must match LT_* values */ #define LICENSE_TYPES { "", "float", "node", NULL } #define LICENSE_DESCS { "", "Floating", "Node Locked", NULL } /* * License class data */ struct _License { char *SoftName; /* Name of software */ char *SoftVer; /* Version of software */ int Type; /* One of LT_* */ char *TypeStr; /* String version of Type */ char *TypeDescStr; /* String type description */ int Port; /* Port server runs on */ char *File; /* License file */ char *ServerSoft; /* Name of lic server sw */ char *ServerVer; /* License server sw ver */ char *VendorServerSoft;/* Vendor server soft */ char *VendorServerVer;/* Vendor server soft ver */ int Count; /* # of allowed licenses */ char *Issuer; /* Who issued license */ char *Hostid; /* Hostid lic is for */ char *IssueDate; /* Date lic was issued */ char *StartDate; /* Start date */ char *ExpireDate; /* Date of expiration */ char *Key; /* License key */ char *Serial; /* Serial Number */ struct _License *Next; /* Next member */ }; typedef struct _License License_t;
The members of License_t are defined as follows:
The name of the software.
The version of the software.
The type of entry as follows:
Floating/concurrent
Locked to one node (system)
String version of Type.
A descriptive text describing Type.
The port the license server is running on.
The license file.
Name of license server software.
Version of license server software.
The name of the vendor supplied license agent.
The version of the vendor supplied license agent.
The number of allowed licenses (aka RTUs).
Who issued the license.
The hostid the license is for.
When the license was issued.
When the license is valid from.
When the license expires.
The license key.
THe serial number of the license.
The PartInfo_t type defines a partition entry as follows:
/* * Partition Information (CN_PARTITION) */ struct _PartInfo { char *Title; /* Describes this entry */ char *DevPath; /* Dev Path e.g. /dev/dsk/c0t0s1 */ char *DevPathRaw; /* Raw Dev Path e.g. /dev/rdsk/c0t0s1 */ char *DevName; /* Dev Name e.g. c0t0 */ char *BaseName; /* c0t0s1 */ char *Name; /* Name e.g. s1 */ int Num; /* Part # for this disk e.g. 1 */ char *Type; /* Type e.g. ufs */ char *TypeDesc; /* Description of Type */ u_int TypeNum; /* Numeric value of Type if any */ char *UsageStatus; /* String value for Usage (below) */ char *MntName; /* Mount Name e.g. /usr */ char **MntOpts; /* Mount Options e.g. rw,quota */ Large_t Size; /* Size of partition (MB) */ Large_t AmtUsed; /* Amt of space currently used (MB)*/ int SecSize; /* Size of 1 sector */ Large_t StartSect; /* Starting Sector # */ Large_t EndSect; /* Ending Sector # */ Large_t NumSect; /* Number of Sectors (size) */ /* Internal use only */ int Usage; /* How used, one of PIU_* */ struct _PartInfo *Next; }; typedef struct _PartInfo PartInfo_t;
The members of PartInfo_t are defined as follows:
A string which helps identify this entry.
A string which names the pathname of the
(block) device which represents this
partition.
e.g.
/dev/dsk/c0t0d0s3
A string which names the pathname of the raw (character)
device which represents this
partition.
e.g.
/dev/rdsk/c0t0d0s3
A string containing the kernel's name for this device. e.g. sd0
The base name of DevPath. e.g. c0t0d0s3
Name of the parititon e.g. s3
The numeric number of this partition which corresponds to
Name.
e.g.
3
A short string, usually a single word, describing the type of partition this is. e.g. ufs
A more verbose description of the parititoin type. e.g. Unix File System
The numeric type identifier of this partition as described by Type and TypeDesc.
A string containing information on how this partition is used.
e.g.
For a UFS filesystem this would contain a mount point such as
/usr
The name of the mount point.
e.g.
/usr
An array of strings containing the options used by the OS to mount this partition. e.g. rw quota logging
The total size, in MB, of this partition.
The amount of space, in MB, this partition currently consumes.
The number of bytes in 1 sector (usually 512).
The location of the first, starting sector of this partition relative to the entire disk.
The location of the last sector of this partition relative to the entire disk.
The number of sectors (EndSect - StartSect
) this partition uses.
The Printer_t type defines a printer entry as follows:
/* * Printer Protocol types */ #define PP_LOCAL 1 /* Local device */ #define PP_LPD 2 /* Unix LPR/LPD */ #define PP_SYSV 3 /* Unix System V */ #define PP_SMB 4 /* Windows SMB */ /* * Printer Protocol names - must match PP_* */ #define PRINTER_PROTO_LIST \ { \ NULL, "Local", "LPD", "SYSV", "SMB" \ } /* * Printer Languages */ #define PL_PS "PostScript" /* PostScript */ #define PL_PS1 "PostScript-1" /* PostScript Level 1 */ #define PL_PS2 "PostScript-2" /* PostScript Level 2 */ #define PL_PS3 "PostScript-3" /* PostScript Level 3 */ #define PL_PCL "PCL" /* PCL */ /* * Printer class data */ struct _Printer { char *Queue; /* Name of queue */ char **Aliases; /* Queue aliases */ char *Desc; /* Queue Description */ char *Vendor; /* Printer vendor */ char *Model; /* Printer model */ int Proto; /* Protocol - One of PP_* */ char *Device; /* File name of device */ char *Server; /* Name of server */ char *RemoteQueue; /* Queue name on Server */ char **Langs; /* Supported Languages PL_* */ char *SpoolDir; /* Spool directory */ long MaxJobSize; /* Max size of jobs (KB) */ Desc_t *DescList; /* Descriptions */ struct _Printer *Next; /* Next member */ }; typedef struct _Printer Printer_t;
The members of Printer_t are defined as follows:
The canonical name of the printer queue.
Array of aliases for printer queue.
Description of queue. This frequently includes a description of the printer type and its location. This field is site dependent.
Vendor/manufacturer of printer.
The model name of the printer.
Path name of printer's device file, if any.
Name of the server hosting this printer queue.
The name of the queue on Server for this queue.
An array of languages which the printer speaks. i.e. PostScript, etc.
The directory on the system where jobs for this printer are spooled temporarily.
The max size of an individual job in KB.
Misc descriptive info.
The software information data type is SoftInfo_t which is defined as:
struct _SoftInfo { char *EntryType; /* Entry Type MC_SET_*_S */ int EntryTypeNum; /* Numeric EntryType */ char *Name; /* Name */ char *Version; /* Version */ char *Revision; /* Revision for this Version */ char *Desc; /* Description of software */ char *DescVerbose; /* Verbose Description */ char *URL; /* Product URL */ char *License; /* Product License */ char *Copyright; /* Product Copyright */ char *Category; /* Category pkg belongs to */ char *SubCategory; /* Sub Category */ char *OSname; /* OS name runs on */ char *OSversion; /* OS version runs on */ char *Arch; /* Architecture runs on */ char *ISArch; /* Instruct. Set Arch. */ char *InstDate; /* Installation Date */ char *BuildDate; /* Build Date */ char *ProdStamp; /* Production Stamp */ char *BaseDir; /* Base Dir for files */ Large_t DiskUsage; /* Space used by FileList */ SoftFileList_t *FileList; /* List of Files */ Desc_t *DescList; /* Misc Descriptions */ /* Vendor's info */ char *VendorName; /* Name of vendor */ char *VendorEmail; /* Email of vendor */ char *VendorPhone; /* Phone of vendor */ char *VendorStock; /* Vendor's Stock # for Pkg */ /* Tree Links */ struct _SoftInfo *Master; /* (Up) Our parent */ struct _SoftInfo *Slaves; /* (Down) Children */ struct _SoftInfo *Next; /* (Side) Siblings */ }; typedef struct _SoftInfo SoftInfo_t;
The members of SoftInfo_t are defined below and except where noted, the string formats vary from OS to OS and package to package:
A string which indicates the type of entry this SoftInfo_t node represents. Valid values are defined by the following constants:
Package - this entry represents a collection of installed files/directories. This is the lowest level EntryType.
Product - this entry represents a collection of packages (MC_SET_PKG_S). It normally acts as a parent node in a hierarchical tree of software packages and usually does not include any attributes other than Slaves and Next .
The corresponding numeric value for EntryType. The following constants are valid values:
Numeric value for MC_SET_PKG_S.
Numeric value for MC_SET_PROD_S.
A string which describes the package (if EntryType == MC_SET_PKG ) or the product (if EntryType == MC_SET_PROD ). e.g. SUNWcsr
A string which indicates the version of this package or product.
e.g.
5.1
A string indicatating the revision of this package. e.g. 2000-02-03
A short string without any newline (\n) characters which provides a description of this package. e.g. Core Required Files
A verbose string, usually containing multiple lines (\n), The core files in this package are required by all other packages.
A Universal Resource Locatator (URL) for locating more information about this package or product. e.g. http://www.sun.com/solaris
A string naming or describing the licensing terms of this package or product. e.g. GPL or Free to everyone with no restrictions
A string naming or describing the copyright terms of this package or product. The string may include embedded newline characters. e.g. (c)Copyright 1901-2101 Big Software Company
A string describing the primary category this package or product belongs to. e.g. system
A string describing the secondary category, often within Category, that this package or product belongs to. e.g. openwindows
A string containing the name of the operating system this package runs on. e.g. Linux
A string containing the version of the operating system this package runs on.
e.g.
2.2.1
A string naming the CPU architecture which this package runs on. e.g. x86
A string naming the Instruction Set Architecture which this package runs on. The ISA usually represents a more specific value than Arch. e.g. Pentium-III
A string containing the date this package was installed. e.g. Feb 02 1999 20:43
A string containing the date this package was built. e.g. 1/15/98
A string generated whent he package was built to identify the production of the package. e.g. buttercup19980904173114
A string naming the base directory under which package files are installed.
e.g.
/usr
The number of bytes of disk space the installed package consumes.
A linked list of miscellaneous descriptions for any other information which is not categorized.
The name of the vendor who created or distributes the package.
The vendor's email address.
The vendor's phone number.
The vendor's stock number for this package.
The parent (master) node for this package in the SoftInfo_t tree.
The slave (child) nodes for this package.
The peer nodes in the SoftInfo_t tree.
A list of files associated with this package. See SoftFileList_t for more information.
The SoftFileList_t type defines software file information usually in a linked list. It is defined as follows:
/* * Software File Data */ struct _SoftFileData { int Type; /* File, dir, symlink, etc */ char *Path; /* Path to file */ char *LinkTo; /* Link To what */ Large_t FileSize; /* Size of file */ char *MD5; /* MD5 checksum */ char *CheckSum; /* Platform specific checksum */ char **PkgNames; /* List of used by Pkgs */ struct _SoftFileData *Next; /* Next entry */ }; typedef struct _SoftFileData SoftFileData_t; /* * List of SoftFileData_t entries */ struct _SoftFileList { SoftFileData_t *FileData; /* Ptr to FileData entry */ struct _SoftFileList *Next; /* Next entry in our list */ }; typedef struct _SoftFileList SoftFileList_t; /* * SoftFile Types for SoftFileData.Type */ #define SFT_FILE 1 /* Plain file */ #define SFT_FILE_S "File" #define SFT_HLINK 2 /* Hard Link */ #define SFT_HLINK_S "Hard-Link" #define SFT_SLINK 3 /* Soft Link */ #define SFT_SLINK_S "Symbolic-Link" #define SFT_DIR 4 /* Directory */ #define SFT_DIR_S "Directory" #define SFT_CDEV 5 /* Device File */ #define SFT_CDEV_S "Character-Device" #define SFT_BDEV 6 /* Device File */ #define SFT_BDEV_S "Block-Device"
The list of files associated with a package is defined by the SoftFileList_t type. The actual file data is defined in SoftFileList_t->FileData.
The members of SoftFileData_t are defined as follows:
Indicates the type of file this is. The valid values are defined by the following constants:
A regular file.
A hard link.
A symbolic link.
A directory.
A character special device file.
A block special device file.
The pathname of this entry.
e.g.
/bin/cp
If Type is SFT_HLINK or SFT_SLINK then this variable names the path that Path is linked to.
The size of this file. Usually only valid if Type is SFT_FILE.
The MD5 checksum of the file.
The platform specific checksum of the file.
A list of package names this file belongs to.
Upon successful completion, mcSysInfo() returns 0 and output data is available in the buffer indicated by the Out parameter. Upon error, mcSysInfo() returns -1.
The libraries which need to be linked with your application include both mcSysInfo related libraries as well as OS libraries. The directory containing the mcSysInfo libraries is platform specific as well as what OS libraries are needed.
The libs command automatically determines the options to specify to your compiler/linker command to link in both the mcSysInfo libraries and the required OS libraries. Normally you just need to "backtic" the command at the end of your linking command. i.e.
`/opt/sysinfo/libexec/bin/libs`