Parse-DMIDecode-0.03/0000777000076400007640000000000010574775526014131 5ustar nicolawnicolawParse-DMIDecode-0.03/INSTALL0000444000076400007640000000007410574775526015155 0ustar nicolawnicolawperl Build.PL perl Build perl Build test perl Build install Parse-DMIDecode-0.03/LICENSE0000444000076400007640000002613610574775526015140 0ustar nicolawnicolaw Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Parse-DMIDecode-0.03/Changes0000444000076400007640000000333510574775526015422 0ustar nicolawnicolawVersion 0.03 - 11th March 2007 + Added Parse::DMIDecode::Examples POD file containing a small selection of useful code examples. + Changed Build.PL to be more paranoid defaulting to no while using $build->y_n to work around potential removal of expected method functionality. + Added complain.txt. + Removed depencancy on Scalar::Util. + Added some additional POD. Version 0.02 - 22th October 2006 + Added better support for older versions of dmidecode binary output parsing. + Improved examples/test.pl. + Added examples/synopsis2.pl from the synopsis of Parse::DMIDecode::Handle. + Allow get_handles() method to be called without any qualifying paramaters so to return *All* handle objects. + Added description() method to handle objects. + Added parsed_structures() method to handle objects. + Improved parsing inside handle objects to return multiple handle objects where appropriate to allow easier access to unique data pairs. Version 0.01 - 19th October 2006 + Pre-release. + Created Parse::DMIDecode::Handle objects for each handle structure. + Encapsulated the internal data structure which is quite fragile so that people cannot just grab items out of it. + Added accessor methods for header information. + Added selection methods to return handle objects. + Added a method to return a list of all known keyword strings. + Added unit tests. + Added a whole bunch more since the first release was mostly a placeholder. Version 0.00 - 17th September 2006 + Initial developer pre-release to save the namespace and to discuss API prior to full release. Parse-DMIDecode-0.03/META.yml0000444000076400007640000000130510574775526015373 0ustar nicolawnicolaw--- name: Parse-DMIDecode version: 0.03 author: - 'Nicola Worthington ' abstract: Interface to SMBIOS using dmidecode license: open_source requires: Carp: 0 build_requires: Test: 0 Test::More: 0 recommends: File::Which: 0.05 Test::Deep: 0.093 Test::Pod: 1.2 Test::Pod::Coverage: 1.06 provides: Parse::DMIDecode: file: lib/Parse/DMIDecode.pm version: 0.03 Parse::DMIDecode::Constants: file: lib/Parse/DMIDecode/Constants.pm version: 0.03 Parse::DMIDecode::Handle: file: lib/Parse/DMIDecode/Handle.pm version: 0.03 generated_by: Module::Build version 0.2806 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.2.html version: 1.2 Parse-DMIDecode-0.03/complain.txt0000444000076400007640000000611710574775526016473 0ustar nicolawnicolawConsider: "You're evil! Remove the phone home code from this module immediately unless you want to rot in hell for all eternity!" I get fed up having to respond to this when people come out with such unreasonable statements like this, so here is my stock response to each of the arguments to why I should not include phone home code in my distribution: 1) It's rude. No. The user is asked if they want to send any information. Their response is honored. The default value is "no" (do not phone home), and there is a timeout that also defaults to "no". 2) It's still rude. It's no more rude than the dozens of other distributions on CPAN that run unit tests that make network connections over the Internet without asking first. At least in my case the user is asked if they want to phone home first. 3) It will screw up automated stuff. No. It honors the AUTOMATED_TESTING environment variable, and also has a timeout that defaults to "no". 4) Build.PL and Makefile.PL shouldn't be scripts. What do you expect people to put in them other than a script? A pretty ASCII art picture maybe? 5) I don't want you to know my IP address. Then don't respond "yes" when asked if it's okay to send the information then. 6) I'll have to check the code to be sure it's safe. Why should you trust this code less than any other code written by other people just because it asks you if you would like to send some basic information to the author using an HTTP GET (the URL of which it clearly displays in the question/message)? 7) You can't possibly code defensively enough to make it always default to "no" and not phoning home. It is impossible to account for people overloading any or all parts modules that are used in the phone home, in the same way that it is impossible for me to know if someone has replaced the perl binary with a copy of lua or patched it to unlink random files from the file system, or overloaded ever core operator. I have however written the code to cope with all reasonable situations. 8) I bet people have only said you should remove the phone home code, and none said to keep it. You should therefore remove it. When council tax bands are reevaluated you only hear about the people who are not happy because they will have to pay more. That's because the people who benefit or don't mind usually don't feel the need to make their opinions known. Likewise in this situation. Plenty of people happily answer "yes" to allow phoning home. Do hear from them to tell me I should keep the phone home code? No, of course not. 9) I still don't agree. Phone home code is bad! Don't use this module and/or run the Build.PL script then. 10) I still don't agree. Phone home code is bad! Stop complaining. Other consenting adults make the decision to allow Build.PL to phone home, or not to phone home, and are able to do so without complaining. More over they're able to do this without trying to restrict how the author writes the software (which is free) or distributes it. Parse-DMIDecode-0.03/MANIFEST0000444000076400007640000000107610574775526015260 0ustar nicolawnicolawBuild.PL Changes complain.txt examples/physical_cpus.pl examples/probe_machines.pl examples/services.pl examples/synopsys.pl examples/synopsys2.pl examples/test.pl INSTALL lib/Parse/DMIDecode.pm lib/Parse/DMIDecode/Constants.pm lib/Parse/DMIDecode/Examples.pod lib/Parse/DMIDecode/Handle.pm LICENSE Makefile.PL MANIFEST This list of files META.yml NOTICE README t/10pod.t t/11pod_coverage.t t/20compile.t t/30synopsis.t t/40regression_test.t t/dmidecode_example1.txt t/dmidecode_example2.txt t/dmidecode_example3.txt t/dmidecode_example4.txt t/dmidecode_example5.txt TODO Parse-DMIDecode-0.03/examples/0000777000076400007640000000000010574775526015747 5ustar nicolawnicolawParse-DMIDecode-0.03/examples/services.pl0000444000076400007640000000252410574775526020124 0ustar nicolawnicolaw#!/usr/bin/perl -wT use strict; use DBI qw(); my %service; open(SER,'<','/etc/services') || die "Unable to open file '/etc/services': $!"; while (local $_ = ) { next if /^\s*#/ || /^\s*$/; my $desc; if (/#\s*(.+)\s*$/) { $desc = $1; s/#.*$//; } my ($service,$port,@aliases) = split(/\s+/,$_); $service{$port} = { name => $service, aliases => \@aliases, desc => $desc, }; } close(SER) || die "Unable to close file '/etc/services': $!"; my $dbh = DBI->connect('DBI:mysql:machinedb:localhost','machinedb_update','a8fc0ebf41ed43eb2686fcec2291c071'); my $sth = $dbh->prepare(qq{ SELECT hostname,data FROM probe NATURAL JOIN machine NATURAL JOIN host WHERE probe = ? ORDER BY hostname }); $sth->execute('netstat'); my @cols = qw(proto recvq sendq local foreign state process); while (my ($hostname,$data) = $sth->fetchrow_array) { print "$hostname\n"; for (split(/\n/,$data)) { next unless /[:\*\d]/; my %data; @data{@cols} = split(/\s+/,$_); if ($data{proto} =~ /^tcp/ && $data{state} eq 'LISTEN') { ($data{port}) = $data{local} =~ /:([\d\*]+)$/; my $desc = ''; if (exists $service{"$data{port}/tcp"}) { $desc = $service{"$data{port}/tcp"}->{desc} || $service{"$data{port}/tcp"}->{name} || ''; } printf("\t%s\t%s\n",$data{port},$desc); } } print "\n"; } $sth->finish; $dbh->disconnect; Parse-DMIDecode-0.03/examples/test.pl0000444000076400007640000000456710574775526017271 0ustar nicolawnicolaw#!/usr/bin/perl -w #BEGIN { chdir '../' if -d '../examples/'; } use strict; use lib qw(./lib ../lib); use Getopt::Std qw(getopts); use Fcntl qw(:mode); use Parse::DMIDecode; use Parse::DMIDecode::Constants qw(@TYPES); # Get some command line options my $opts = {}; Getopt::Std::getopts('f:g:Kk:hV',$opts); $opts->{g} ||= 'processor'; display_help(),exit if defined $opts->{h}; my $decoder = new Parse::DMIDecode; my $dmidecode = '/usr/sbin/dmidecode'; my @stat = stat($dmidecode); # If we've been given a dmidecode output file, parse that if ($opts->{f}) { die "File '$opts->{f}' does not exist.\n" unless -f $opts->{f}; $decoder->parse(`cat $opts->{f}`); # If we're root, or dmidecode is setuid root, then probe } elsif ($> || ($stat[4] == 0 && $stat[2] & S_ISUID)) { $decoder->probe; # Otherwise run dmidecode with sudo } else { $decoder->parse(qx(sudo $dmidecode)); } # Print all of the available keywords if (defined $opts->{K}) { if (defined $opts->{V}) { for my $keyword ($decoder->keywords) { my $value = $decoder->keyword($keyword); $value = '' unless defined $value; printf("Keyword '%s' => '%s'\n", $keyword, (ref($value) eq 'ARRAY' ? join(', ',@{$value}) : $value) ); } } else { print join("\n",$decoder->keywords)."\n"; } exit; # Print just one keyword } elsif ($opts->{k}) { printf("Keyword '%s' => '%s'\n", $opts->{k}, $decoder->keyword($opts->{k}) ); exit; } # Print some information about specific structure handles for my $handle ($decoder->get_handles( group => $opts->{g} )) { printf(">>> Found handle at %s (%s):\n >> Description: %s\n >> Keywords: %s\n%s\n", $handle->address, $TYPES[$handle->dmitype], $handle->description, join(', ',$handle->keywords), $handle->raw ); if (defined $opts->{V}) { for my $keyword ($handle->keywords) { my $value = $handle->keyword($keyword); $value = '' unless defined $value; printf(" > Keyword '%s' => '%s'\n", $keyword, (ref($value) eq 'ARRAY' ? join(', ',@{$value}) : $value) ); } } print "\n"; } sub display_help { print qq{Syntax: $0 [-h] [-V] [-K|-k |-g ] [-f ] -h Display this help -K List all valid keywords -V Print more verbose output -g Display handle information match group -f Parse dmidecode information from }; } Parse-DMIDecode-0.03/examples/synopsys2.pl0000444000076400007640000000124110574775526020265 0ustar nicolawnicolaw#!/usr/bin/perl -w use strict; use Parse::DMIDecode qw(); my $decoder = new Parse::DMIDecode; $decoder->probe; for my $handle ($decoder->get_handles) { printf("Handle %s of type %s is %s bytes long (minus strings).\n". " > Contians the following keyword data entries:\n", $handle->handle, $handle->dmitype, $handle->bytes ); for my $keyword ($handle->keywords) { my $value = $handle->keyword($keyword); printf("Keyword \"%s\" => \"%s\"\n", $keyword, (ref($value) eq 'ARRAY' ? join(', ',@{$value}) : ($value||'')) ); } } Parse-DMIDecode-0.03/examples/synopsys.pl0000444000076400007640000000033010574775526020201 0ustar nicolawnicolaw#!/usr/bin/perl -w use strict; use Parse::DMIDecode (); my $dmi = new Parse::DMIDecode; $dmi->probe; printf("System: %s, %s\n", $dmi->keyword("system-manufacturer"), $dmi->keyword("system-product-name"), ); Parse-DMIDecode-0.03/examples/physical_cpus.pl0000444000076400007640000000122410574775526021143 0ustar nicolawnicolaw#!/usr/bin/perl -w use 5.6.1; use strict; use warnings; use Parse::DMIDecode qw(); my $dmi = Parse::DMIDecode->new( nowarnings => 1 ); $dmi->probe; my $physical_cpus = 0; for my $handle ($dmi->get_handles(group => "processor")) { my $type = ($handle->keyword("processor-type") or ""); next unless $type =~ /Central Processor/i; # Check the status of the cpu my $status = ($handle->keyword("processor-status") or ""); if ($status !~ /Unpopulated/i) { $physical_cpus++; } } printf("There %s %d physical %s in this machine.\n", ($physical_cpus == 1 ? "is" : "are"), $physical_cpus, ($physical_cpus == 1 ? "CPU" : "CPUs"), ); exit; __END__ Parse-DMIDecode-0.03/examples/probe_machines.pl0000444000076400007640000003757510574775526021275 0ustar nicolawnicolaw#!/usr/bin/perl -wT ############################################################ # # $Id: probe_machines.pl 976 2007-03-04 20:47:36Z nicolaw $ # probe_machine.pl - Example script for Parse::DMIDecode # # Copyright 2006 Nicola Worthington # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ############################################################ # vim:ts=4:sw=4:tw=78 # Database credentials use constant DBI_DSN => 'DBI:mysql:database:hostname'; use constant DBI_USER => 'username'; use constant DBI_PASS => 'password'; # Where and how to generate a list of hosts to probe use constant HOSTS_REGEX => qr{([a-zA-|0-9\-\_\.]+)}; use constant HOSTS_SKIP => qw{(localhost|localhost.localdomain)}; use constant HOSTS_SRC => '/etc/hosts'; # Remote command to gather information use constant SSH_CMD => 'ssh'; use constant REMOTE_CMD => 'export PATH=/bin:/usr/bin:/sbin:/usr/sbin; echo ==dmidecode==; dmidecode; echo ==biosdecode==; biosdecode; echo ==vpddecode==; vpddecode; echo ==distribution==; grep . /etc/*debian* /etc/redhat-release /etc/mandrake-release /etc/SuSE-release; echo ==netstat==; netstat -ltnup; echo ==x86info==; x86info; echo ==lspci==; lspci; echo ==cpuinfo==; cat /proc/cpuinfo; echo ==meminfo==; cat /proc/meminfo; echo ==lsmod==; lsmod; echo ==modules==; cat /proc/modules; echo ==hostname==; hostname; echo ==route==; route -n; echo ==ifconfig==; ifconfig -a; echo ==iptables==; iptables -L -n -v; echo ==ethtool==; ethtool eth0; ethtool eth1; echo ==ipdiscover==; ipdiscover eth0; ipdiscover eth1; echo ==resolv==; cat /etc/resolv.conf; echo ==hosts==; cat /etc/hosts; echo ==uname==; uname -a; echo ==rpm==; rpm -qa --queryformat \"%{NAME} %{VERSION} %{SUMMARY}\n\"; echo ==dpkg==; dpkg -l; echo ==uptime==; uptime; echo ==who==; who; echo ==w==; w; echo ==date==; date; echo ==iostat==; iostat; echo ==vmstat==; vmstat; echo ==free==; free; echo ==pstree==; pstree; echo ==ps==; ps -ef; echo ==last==; last; echo ==issue==; cat /etc/issue; echo ==dmesg==; dmesg; echo ==ide==; grep -r . /proc/ide/; echo ==scsi==; grep -r . /proc/scsi/; echo ==fdisk==; fdisk -l /dev/hd* /dev/sd*; echo ==partitions==; cat /proc/partitions; echo ==mounts==; cat /proc/mounts; echo ==mount==; mount; echo ==df==; df -TP'; ######################################################### # # # No user servicable parts inside past this point # # ######################################################### use 5.6.1; use strict; use DBI qw(); use Getopt::Std qw(getopts); use Parse::DMIDecode 0.02 qw(); %ENV = (PATH => '/bin:/usr/bin'); $|++; my $opts = {}; Getopt::Std::getopts('hCH:',$opts); display_help(),exit if defined $opts->{h}; my $dbh = DBI->connect(DBI_DSN,DBI_USER,DBI_PASS,{AutoCommit => 0}); create_tables() if defined $opts->{C}; my $dmi = Parse::DMIDecode->new(nowarnings => 1); my $skip_regex = HOSTS_SKIP; my @hosts = defined $opts->{H} ? ($opts->{H}) : get_hostnames(); for my $machine (sort(@hosts)) { print "Processing $machine ". "." x (49-length($machine)); print_result('skipped'), next if $machine =~ /$skip_regex/; my $data = probe_server($machine); if (defined $data->{NOCONNECT}) { print_result('connect failed'); } elsif (defined $data->{'system-uuid'} && $data->{'system-uuid'} =~ /^[A-F0-9\-]{36}$/) { update_database($data); print_result('done'); } else { print_result('no uuid'); } } $dbh->disconnect(); exit; sub print_result { my $str = shift; my $width = 15; my $dots = $width - length($str) - 1; printf("%s %s\n", '.' x $dots, $str); } sub probe_server { my ($machine) = $_[0] =~ /([a-z0-9\.\-\_]+)/i; (my $cmd = sprintf('%s %s "%s" 2>/dev/null', SSH_CMD, $machine, REMOTE_CMD)) =~ s/\n//g; my %raw = (HOSTNAME => $machine, NOCONNECT => 1); my $group; if (open(PH,'-|',$cmd)) { while (local $_ = ) { if (/^==+(\S+?)==+$/) { $group = $1; delete $raw{NOCONNECT}; } elsif (defined $group && $group =~ /\S+/) { $raw{$group} .= $_; } else { print $_; } } close(PH); } return \%raw if defined $raw{NOCONNECT}; return parse_raw_data($machine,\%raw); } sub parse_raw_data { my ($machine,$raw) = @_; # ==dmidecode== if (defined $raw->{dmidecode}) { $dmi->parse($raw->{dmidecode}); for (qw(system-uuid system-serial-number system-manufacturer system-product-name system-vendor system-product baseboard-product-name baseboard-manufacturer bios-version bios-vendor chassis-type)) { $raw->{$_} = $dmi->keyword($_); $raw->{$_} = '' unless defined $raw->{$_}; } $raw->{'physical-cpu-qty'} = 0; for my $handle ($dmi->get_handles(group => 'processor')) { next unless defined $handle->keyword('processor-type') && $handle->keyword('processor-type') =~ /Central Processor/i; $raw->{'physical-cpu-qty'}++; for (qw(processor-family processor-manufacturer processor-current-speed processor-id processor-type processor-version processor-signature processor-flags)) { my $value = $handle->keyword($_); if (!defined $value || (defined $value && $value =~ /Not Specified/i)) { $raw->{$_} = ''; } else { $raw->{$_} = $value unless defined $raw->{$_} && $raw->{$_} =~ /\S/; } } } # Account for older versions of dmidecode output if ($raw->{'system-product'} =~ /\S/ && $raw->{'system-product-name'} !~ /\S/) { $raw->{'system-product-name'} = $raw->{'system-product'}; } if ($raw->{'system-vendor'} =~ /\S/ && $raw->{'system-manufacturer'} !~ /\S/) { $raw->{'system-manufacturer'} = $raw->{'system-vendor'}; } # Bodge together a pretend uuid if (!defined($raw->{'system-uuid'}) || $raw->{'system-uuid'} !~ /^[A-F0-9\-]{36}$/) { ($raw->{'system-uuid'} = uc(join('-', ($raw->{'processor-id'}||''), ($raw->{'baseboard-product-name'}||''), ($raw->{'baseboard-manufacturer'}||''), ($raw->{'bios-version'}||''), ($raw->{'bios-vendor'}||''), ($raw->{'processor-signature'}||''), ($raw->{'processor-type'}||''), ($machine x 20), ))) =~ s/[^A-F0-9]//g; $raw->{'system-uuid'} = sprintf('%s-%s-%s-%s-%s', substr($raw->{'system-uuid'},0,8), substr($raw->{'system-uuid'},7,4), substr($raw->{'system-uuid'},11,4), substr($raw->{'system-uuid'},15,4), substr($raw->{'system-uuid'},19,12), ); } } # ==ifconfig== if (defined $raw->{ifconfig}) { $raw->{hwaddr} = [()]; for (split(/\n/,$raw->{ifconfig})) { if (my ($if,$hwaddr) = $_ =~ /^(\S+)\s+.+?\s+HWaddr:?\s+(\S+)\s*$/i) { push @{$raw->{hwaddr}}, "$hwaddr $if" if $if !~ /:/; } } } # ==distribution== if (defined $raw->{distribution}) { if ($raw->{distribution} =~ /Red Hat Enterprise Linux/mi) { $raw->{distribution} = 'RHEL'; } elsif ($raw->{distribution} =~ /Slackware/mi) { $raw->{distribution} = 'Slackware'; } elsif ($raw->{distribution} =~ /Mandrake/mi) { $raw->{distribution} = 'Mandrake'; } elsif ($raw->{distribution} =~ /SuSE/mi) { $raw->{distribution} = 'SuSE'; } elsif ($raw->{distribution} =~ /Ubuntu/mi) { $raw->{distribution} = 'Ubuntu'; } elsif ($raw->{distribution} =~ /Red\s*Hat/mi) { $raw->{distribution} = 'RedHat'; } elsif ($raw->{distribution} =~ /Debian/mi) { $raw->{distribution} = 'Debian'; } else { $raw->{distribution} = 'Linux'; } } return $raw; } sub create_tables { my @statements; my $statement; while (local $_ = ) { chomp; next if /^\s*(#|\-\-|;)/ || /^\s*$/; last if /^__END__\s*$/; s/\t/ /; if (/;\s*$/) { $statement .= $_; push @statements, $statement; $statement = ''; } else { $statement .= $_; } } print "Recreating database tables ..."; for my $statement (@statements) { $statement =~ s/;\s*//; my $sth = $dbh->prepare($statement); $sth->execute; } $dbh->commit; print " done\n"; } sub get_model_id { my ($make,$model,$data) = @_; $make ||= 'Unknown'; $model ||= 'Unknown'; my $sth = $dbh->prepare('SELECT model_id FROM model WHERE make = ? AND model = ?'); $sth->execute($make,$model); my ($model_id) = $sth->rows == 1 ? $sth->fetchrow_array : undef; if (!defined $model_id && $sth->rows <= 1) { my $form = (defined $data->{'chassis-type'} ? $data->{'chassis-type'} : undef); if ($make =~ /^Dell (Inc\.|Computer Corporation)$/ && $model =~ /^PowerEdge (?:750|([12])\d\d0)$/) { $form = defined $1 ? "${1}U" : '1U'; } $sth = $dbh->prepare('INSERT INTO model (make,model,form) VALUES (?,?,?)'); $sth->execute($make,$model,$form); $model_id = $dbh->{'mysql_insertid'}; } $sth->finish; return $model_id; } sub update_record { my $ref = {@_}; die "No table defined." if !exists $ref->{table}; die "No column data defined." if !exists $ref->{cols}; die "No where clause defined." if !exists $ref->{where}; # Delete or check for existing row my @where; my @where_bind; while (my ($col,$value) = each %{$ref->{where}}) { push @where, sprintf(' %s = ? ',$col); push @where_bind, $value; } my $sql = sprintf('%s FROM %s WHERE %s', ($ref->{delete_first} ? 'DELETE' : 'SELECT *'), $ref->{table}, join(' AND ',@where), ); my $sth = $dbh->prepare($sql); $sth->execute(@where_bind); # Update an existing row if (!$ref->{delete_first} && $sth->rows >= 1) { my @set; my @set_bind; while (my ($col,$value) = each %{$ref->{cols}}) { if (defined $value && $value eq 'NOW()') { push @set, sprintf(' %s = %s ',$col,$value); } else { push @set, sprintf(' %s = ? ',$col); push @set_bind, $value; } } $sql = sprintf('UPDATE %s SET %s WHERE %s', $ref->{table}, join(', ',@set), join(' AND ',@where), ); $sth = $dbh->prepare($sql); $sth->execute(@set_bind,@where_bind); # Insert a new row } else { my @cols; my @cols_bind; my @placeholders; while (my ($col,$value) = each %{$ref->{cols}}) { if (defined $value && $value eq 'NOW()') { push @cols, $col; push @placeholders, $value; } else { push @cols, $col; push @cols_bind, $value; push @placeholders, '?'; } } $sql = sprintf('INSERT INTO %s (%s) VALUES (%s)', $ref->{table}, join(',',@cols), join(',',@placeholders), ); $sth = $dbh->prepare($sql); $sth->execute(@cols_bind); } $sth->finish; } sub update_database { my $data = shift; my $model_id = get_model_id( $data->{'system-manufacturer'}, $data->{'system-product-name'}, $data ); update_record( table => 'machine', cols => { model_id => $model_id, serial => $data->{'system-serial-number'}, uuid => $data->{'system-uuid'}, last_checked => 'NOW()', }, where => { uuid => $data->{'system-uuid'}, }, ); update_record( table => 'host', cols => { uuid => $data->{'system-uuid'}, hostname => $data->{HOSTNAME}, os => $data->{'distribution'}, last_checked => 'NOW()', }, where => { hostname => $data->{HOSTNAME}, }, ); my @probes = REMOTE_CMD =~ /==([a-z0-9\-\_]+)==/g; for my $probe (@probes) { update_record( table => 'probe', cols => { uuid => $data->{'system-uuid'}, probe => $probe, data => $data->{$probe}, }, where => { uuid => $data->{'system-uuid'}, probe => $probe, }, ); } my $sth = $dbh->prepare('DELETE FROM host WHERE uuid = ? AND hostname != ?'); $sth->execute($data->{'system-uuid'},$data->{HOSTNAME}); my %seen_hwaddr; for (@{$data->{hwaddr}}) { my ($hwaddr,$interface) = split(/\s+/,$_); $hwaddr =~ s/[^0-9a-f]+//gi; next if $interface =~ /:/ || exists $seen_hwaddr{$hwaddr}; $seen_hwaddr{$hwaddr} = 1; update_record( table => 'nic', cols => { uuid => $data->{'system-uuid'}, hwaddr => $hwaddr, interface => $interface, }, where => { uuid => $data->{'system-uuid'}, hwaddr => $hwaddr, }, ); } my ($cpu_speed) = ($data->{'processor-current-speed'}||'') =~ /(\d+)/; my @processor_flags = (); if (ref($data->{'processor-flags'}) eq 'ARRAY') { for (@{$data->{'processor-flags'}}) { if (/^(\S+)/) { push @processor_flags, $1; } } } update_record( table => 'cpu', cols => { manufacturer => $data->{'processor-manufacturer'}, family => $data->{'processor-family'}, version => $data->{'processor-version'}, speed => $cpu_speed, signature => $data->{'processor-signature'}, flags => join(',',@processor_flags), qty => $data->{'physical-cpu-qty'}, uuid => $data->{'system-uuid'}, }, where => { uuid => $data->{'system-uuid'}, }, ); $sth->finish; $dbh->commit; } sub get_hostnames { print "Getting hostnames ..."; my @data; if (-f HOSTS_SRC && -r HOSTS_SRC) { if (open(FH,'<',HOSTS_SRC)) { @data = ; close(FH); } } else { eval { require LWP::Simple; @data = split(/\n/, LWP::Simple::get(HOSTS_SRC)); }; warn $@ if $@; } my $regex = HOSTS_REGEX; my %hosts; for (@data) { if (/$regex/) { $hosts{$1} = 1; } } my $hosts = scalar(keys %hosts) || 0; print " found $hosts host".($hosts == 1 ? '' : 's')."\n"; return sort keys %hosts; } sub display_help { print qq{Syntax: $0 [-h] [-H ] [-C] -h Display this help -H Only probe -C Recreate the database tables }; } __DATA__ DROP TABLE IF EXISTS nic; DROP TABLE IF EXISTS cpu; DROP TABLE IF EXISTS probe; DROP TABLE IF EXISTS service; DROP TABLE IF EXISTS host; DROP TABLE IF EXISTS machine; DROP TABLE IF EXISTS model; #DROP TABLE IF EXISTS contact; #DROP TABLE IF EXISTS history; CREATE TABLE model ( model_id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, make VARCHAR(32), model VARCHAR(32), form VARCHAR(16) ) ENGINE=InnoDB; CREATE TABLE machine ( uuid CHAR(36) NOT NULL PRIMARY KEY, serial VARCHAR(16), model_id INT UNSIGNED, created DATETIME NOT NULL, last_checked TIMESTAMP NOT NULL, FOREIGN KEY (model_id) REFERENCES model(model_id) ) ENGINE=InnoDB; CREATE TABLE host ( hostname VARCHAR(32) NOT NULL PRIMARY KEY, uuid CHAR(36) NOT NULL, os ENUM('Debian','Mandrake','RedHat','RHEL','Ubuntu','Gentoo','Slackware','SuSE','Windows','Linux'), created DATETIME NOT NULL, last_checked TIMESTAMP NOT NULL, FOREIGN KEY (uuid) REFERENCES machine(uuid) ON DELETE CASCADE ) ENGINE=InnoDB; CREATE TABLE service ( hostname VARCHAR(32) NOT NULL, servicename VARCHAR(32) NOT NULL, description VARCHAR(255), type ENUM('Production','Staging','Development','Infrastructure','Research','Other') NOT NULL, PRIMARY KEY (hostname,servicename), FOREIGN KEY (hostname) REFERENCES host(hostname) ON DELETE CASCADE ) ENGINE=InnoDB; CREATE TABLE nic ( hwaddr CHAR(12) NOT NULL, uuid CHAR(36) NOT NULL, interface VARCHAR(8), PRIMARY KEY (hwaddr,uuid), FOREIGN KEY (uuid) REFERENCES machine(uuid) ON DELETE CASCADE ) ENGINE=InnoDB; CREATE TABLE cpu ( uuid CHAR(36) NOT NULL PRIMARY KEY, manufacturer VARCHAR(16), family VARCHAR(16), version VARCHAR(64), speed INT(4) UNSIGNED, signature VARCHAR(64), flags VARCHAR(255), qty INT(2) UNSIGNED, FOREIGN KEY (uuid) REFERENCES machine(uuid) ON DELETE CASCADE ) ENGINE=InnoDB; CREATE TABLE probe ( uuid CHAR(36) NOT NULL, probe VARCHAR(16) NOT NULL, data TEXT, PRIMARY KEY (uuid,probe), FOREIGN KEY (uuid) REFERENCES machine(uuid) ON DELETE CASCADE ) ENGINE=InnoDB; __END__ BatchMode yes CheckHostIP no ConnectTimeout 6 StrictHostKeyChecking no PreferredAuthentications publickey IdentityFile ~/.ssh/id_dsa_root IdentityFile ~/.ssh/id_dsa NoHostAuthenticationForLocalhost yes ConnectionAttempts 1 PasswordAuthentication no ForwardAgent yes Host server1.acmecompany.com Port 1033 Host server2.acmecompany.com User admin Host * User root Port 22 Parse-DMIDecode-0.03/Makefile.PL0000444000076400007640000000211510574775526016074 0ustar nicolawnicolaw# Note: this file was auto-generated by Module::Build::Compat version 0.03 unless (eval "use Module::Build::Compat 0.02; 1" ) { print "This module requires Module::Build to install itself.\n"; require ExtUtils::MakeMaker; my $yn = ExtUtils::MakeMaker::prompt (' Install Module::Build now from CPAN?', 'y'); unless ($yn =~ /^y/i) { die " *** Cannot install without Module::Build. Exiting ...\n"; } require Cwd; require File::Spec; require CPAN; # Save this 'cause CPAN will chdir all over the place. my $cwd = Cwd::cwd(); CPAN::Shell->install('Module::Build::Compat'); CPAN::Shell->expand("Module", "Module::Build::Compat")->uptodate or die "Couldn't install Module::Build, giving up.\n"; chdir $cwd or die "Cannot chdir() back to $cwd: $!"; } eval "use Module::Build::Compat 0.02; 1" or die $@; Module::Build::Compat->run_build_pl(args => \@ARGV); require Module::Build; Module::Build::Compat->write_makefile(build_class => 'Module::Build'); Parse-DMIDecode-0.03/Build.PL0000444000076400007640000000471010574775526015421 0ustar nicolawnicolaw# vim:ts=4:sw=4:tw=78 # $Id: Build.PL 976 2007-03-04 20:47:36Z nicolaw $ use strict; use Module::Build; use vars qw($build); my $module = 'Parse::DMIDecode'; $build = Module::Build->new( module_name => $module, license => 'open_source', create_makefile_pl => 'passthrough', create_readme => 1, create_packlist => 1, sign => 0, requires => { 'Carp' => 0, # 1.04 #'Scalar::Util' => 0, #'Storable' => 0, }, build_requires => { 'Test' => 0, # 1.25 'Test::More' => 0, # 0.60 }, recommends => { 'File::Which' => 0.05, # 0.05 'Test::Pod' => 1.20, 'Test::Pod::Coverage' => 1.06, 'Test::Deep' => 0.093, }, ); $build->create_build_script; # Send perl and module version information home if we've been given # permission to do so by a human being - default to not send for automated # testing environments, of if the user does not respond within 20 seconds. my $url = $ENV{AUTOMATED_TESTING} ? undef : may_send_version_information(); if ($url) { my @resp = (); eval { local $SIG{ALRM} = sub { die; }; alarm 10; my $ua = LWP::UserAgent->new( agent => 'Build.PL $Revision: 976 $', timeout => 9, max_size => 500, ); $ua->env_proxy; my $response = $ua->get($url); if ($response->is_success()) { for (split(/\s*\n+\s*/, $response->content())) { push @resp, $_ if $_; } } alarm 0; }; print substr($resp[0],0,79) || "Thank you for sending this information."; print "\n\n"; } sub may_send_version_information { eval { require Config; require LWP::UserAgent; }; return undef if $@; my $str = sprintf('%s?%s=%s&%s=%s&%s=%s&%s=%s&%s=%s&%s=%s', 'http://perlgirl.org.uk/lib/usage.cgi', 'name', $module, 'version', $build->dist_version(), 'osname', $Config::Config{osname}, 'archname', $Config::Config{archname}, 'osver', $^O, 'perlver', $] ); print "\nThank you for downloading ".$build->dist_name()."\n\n"; print "I would like to find out how many people are using this software,\n"; print "and on what operating systems and Perl versions. If you have an\n"; print "internet connection, may I transmit the following information:\n\n"; print "$str\n\n"; my $send = 0; eval { local $SIG{ALRM} = sub { die; }; alarm 20; $send = $build->y_n('Send this anonymous information?','n'); alarm 0; }; return defined $send && !ref($send) && "$send" eq "1" ? $str : undef; } 1; Parse-DMIDecode-0.03/NOTICE0000444000076400007640000000013110574775526015022 0ustar nicolawnicolawContains software written by Nicola Worthington, nicolaw@cpan.org http://perlgirl.org.uk Parse-DMIDecode-0.03/TODO0000444000076400007640000000042310574775526014612 0ustar nicolawnicolaw- Finish POD. - Try and reduce the number of parser errors. - Try and account for older dmidecode outputs. - Implement a propper way of getting at all the data in a handle object for data that is not accessable through a keyword call. (Duplicate keywords for example). Parse-DMIDecode-0.03/README0000444000076400007640000000776410574775526015021 0ustar nicolawnicolawNAME Parse::DMIDecode - Interface to SMBIOS using dmidecode SYNOPSIS use strict; use Parse::DMIDecode (); my $decoder = new Parse::DMIDecode; $decoder->probe; # Actively probe using dmidecode # Manually supply your own dmidecode output to be parsed # $decoder->parse(qx(sudo /usr/sbin/dmidecode)); printf("System: %s, %s", $decoder->keyword("system-manufacturer"), $decoder->keyword("system-product-name"), ); DESCRIPTION This module provides an OO interface to SMBIOS information through the *dmidecode* command which is known to work under a number of Linux, BSD and BeOS variants. METHODS new my $decoder = Parse::DMIDecode->new( dmidecode => "/usr/sbin/dmidecode", nowarnings => 1, ); This is the constructor method to create a Parse::DMIDeocde object. It accepts two optional arguments; "dmidecode" and "nowarnings". The "dmidecode" argument specifies the full path and filename of the *dmodecode* command that should used by the "probe" method. The "nowarnings" argument instructs Parse::DMIDecode not to emit any parser warnings. probe $decoder->probe; This method executes an active probe to gather information using the *dmidecode* command. It does not accept any arguments. parse my $raw = qx(sudo /usr/sbin/dmidecode); $decoder->prase($raw); This method is a passive alternative to the "probe" method. It accepts a single string argument which should contain output from the *dmidecode* command, which it will parse. keyword my $serial_number = $decoder->keyword("system-serial-number"); keywords my @keywords = $decoder->keywords; my @bios_keywords = $decoder->keywords("bios"); for my $keyword (@bios_keywords) { printf("%s => %s\n", $keyword, $decoder->keyword($keyword) ); } handle_addresses my @addresses = $decoder->handle_addresses; get_handles use Parse::DMIDecode::Constants qw(@TYPES); # Available groups to query: bios, system, baseboard, # chassis, processor, memory, cache, connector, slot for my $handle ($decoder->get_handles( group => "memory" )) { printf(">> Found handle at %s (%s):\n%s\n", $handle->address, $TYPES[$handle->dmitype], $handle->raw ); } See Parse::DMIDecode::Handle for accessor method documentation for handle objects. smbios_version my $smbios_version = $decoder->smbios_version; Returns the SMBIOS version number. dmidecode_version my $dmidecode_version = $decoder->dmidecode_version; Returns the version number of the copy of *dmidecode* that was used to create the source data that was parsed. This value may not be available when using older versions of *dmidecode*. table_location my $memory_address = $decoder->table_location; structures my $total_structures = $decoder->structures; SEE ALSO Parse::DMIDecode::Handle, Parse::DMIDecode::Constants, Parse::DMIDecode::Examples, examples/*.pl, , , , , , biosdecode(8), dmidecode(8), vpddecode(8) VERSION $Id: DMIDecode.pm 1004 2007-03-11 12:43:25Z nicolaw $ AUTHOR Nicola Worthington If you like this software, why not show your appreciation by sending the author something nice from her Amazon wishlist? ( http://www.amazon.co.uk/gp/registry/1VZXC59ESWYK0?sort=priority ) COPYRIGHT Copyright 2006,2007 Nicola Worthington. This software is licensed under The Apache Software License, Version 2.0. Parse-DMIDecode-0.03/t/0000777000076400007640000000000010574775526014374 5ustar nicolawnicolawParse-DMIDecode-0.03/t/dmidecode_example3.txt0000444000076400007640000003273310574775526020652 0ustar nicolawnicolaw# dmidecode 2.7 SMBIOS 2.4 present. 67 structures occupying 2239 bytes. Table at 0x000E0010. Handle 0x0000, DMI type 0, 24 bytes. BIOS Information Vendor: LENOVO Version: 7BET46WW (1.06 ) Release Date: 05/23/2006 Address: 0xDC000 Runtime Size: 144 kB ROM Size: 2048 kB Characteristics: PCI is supported PC Card (PCMCIA) is supported PNP is supported BIOS is upgradeable BIOS shadowing is allowed ESCD support is available Boot from CD is supported Selectable boot is supported BIOS ROM is socketed EDD is supported ACPI is supported USB legacy is supported BIOS boot specification is supported Targeted content distribution is supported BIOS Revision: 1.6 Firmware Revision: 1.4 Handle 0x0001, DMI type 1, 27 bytes. System Information Manufacturer: LENOVO Product Name: 1707W95 Version: ThinkPad X60 Serial Number: L3M4102 UUID: FB474681-48F9-11CB-9C0C-EBCA68B184CF Wake-up Type: Power Switch SKU Number: Not Specified Family: ThinkPad X60 Handle 0x0002, DMI type 2, 8 bytes. Base Board Information Manufacturer: LENOVO Product Name: 1707W95 Version: Not Available Serial Number: 1ZC256551MV Handle 0x0003, DMI type 3, 13 bytes. Chassis Information Manufacturer: LENOVO Type: Notebook Lock: Not Present Version: Not Available Serial Number: Not Available Asset Tag: No Asset Information Boot-up State: Unknown Power Supply State: Unknown Thermal State: Unknown Security Status: Unknown Handle 0x0004, DMI type 126, 13 bytes. Inactive Handle 0x0005, DMI type 126, 13 bytes. Inactive Handle 0x0006, DMI type 4, 35 bytes. Processor Information Socket Designation: None Type: Central Processor Family: Pentium M Manufacturer: GenuineIntel ID: E8 06 00 00 FF FB E9 AF Signature: Type 0, Family 6, Model 14, Stepping 8 Flags: FPU (Floating-point unit on-chip) VME (Virtual mode extension) DE (Debugging extension) PSE (Page size extension) TSC (Time stamp counter) MSR (Model specific registers) PAE (Physical address extension) MCE (Machine check exception) CX8 (CMPXCHG8 instruction supported) APIC (On-chip APIC hardware supported) SEP (Fast system call) MTRR (Memory type range registers) PGE (Page global enable) MCA (Machine check architecture) CMOV (Conditional move instruction supported) PAT (Page attribute table) CLFSH (CLFLUSH instruction supported) DS (Debug store) ACPI (ACPI supported) MMX (MMX technology supported) FXSR (Fast floating-point save and restore) SSE (Streaming SIMD extensions) SSE2 (Streaming SIMD extensions 2) SS (Self-snoop) TM (Thermal monitor supported) PBE (Pending break enabled) Version: Genuine Intel(R) CPU Voltage: 1.4 V External Clock: 167 MHz Max Speed: 1667 MHz Current Speed: 1667 MHz Status: Populated, Enabled Upgrade: None L1 Cache Handle: 0x000A L2 Cache Handle: 0x000C L3 Cache Handle: Not Provided Serial Number: Not Specified Asset Tag: Not Specified Part Number: Not Specified Handle 0x0007, DMI type 5, 20 bytes. Memory Controller Information Error Detecting Method: None Error Correcting Capabilities: None Supported Interleave: One-way Interleave Current Interleave: One-way Interleave Maximum Memory Module Size: 2048 MB Maximum Total Memory Size: 4096 MB Supported Speeds: Other Supported Memory Types: DIMM SDRAM Memory Module Voltage: 2.9 V Associated Memory Slots: 2 0x0008 0x0009 Enabled Error Correcting Capabilities: Unknown Handle 0x0008, DMI type 6, 12 bytes. Memory Module Information Socket Designation: DIMM Slot 1 Bank Connections: 0 3 Current Speed: Unknown Type: DIMM SDRAM Installed Size: Not Installed Enabled Size: Not Installed Error Status: OK Handle 0x0009, DMI type 6, 12 bytes. Memory Module Information Socket Designation: DIMM Slot 2 Bank Connections: 4 7 Current Speed: Unknown Type: DIMM SDRAM Installed Size: 1024 MB (Double-bank Connection) Enabled Size: 1024 MB (Double-bank Connection) Error Status: OK Handle 0x000A, DMI type 7, 19 bytes. Cache Information Socket Designation: Internal L1 Cache Configuration: Enabled, Socketed, Level 1 Operational Mode: Write Back Location: Internal Installed Size: 32 KB Maximum Size: 32 KB Supported SRAM Types: Synchronous Installed SRAM Type: Synchronous Speed: Unknown Error Correction Type: Single-bit ECC System Type: Instruction Associativity: 8-way Set-associative Handle 0x000B, DMI type 7, 19 bytes. Cache Information Socket Designation: Internal L1 Cache Configuration: Enabled, Socketed, Level 1 Operational Mode: Write Back Location: Internal Installed Size: 32 KB Maximum Size: 32 KB Supported SRAM Types: Synchronous Installed SRAM Type: Synchronous Speed: Unknown Error Correction Type: Single-bit ECC System Type: Data Associativity: 8-way Set-associative Handle 0x000C, DMI type 7, 19 bytes. Cache Information Socket Designation: Internal L2 Cache Configuration: Enabled, Socketed, Level 2 Operational Mode: Write Back Location: Internal Installed Size: 2048 KB Maximum Size: 2048 KB Supported SRAM Types: Burst Installed SRAM Type: Burst Speed: Unknown Error Correction Type: Single-bit ECC System Type: Unified Associativity: 8-way Set-associative Handle 0x000D, DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Available Internal Connector Type: None External Reference Designator: Infrared External Connector Type: Infrared Port Type: Other Handle 0x000E, DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Available Internal Connector Type: None External Reference Designator: External Monitor External Connector Type: DB-15 female Port Type: Video Port Handle 0x000F, DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Available Internal Connector Type: None External Reference Designator: Microphone Jack External Connector Type: Mini Jack (headphones) Port Type: Audio Port Handle 0x0010, DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Available Internal Connector Type: None External Reference Designator: Headphone Jack External Connector Type: Mini Jack (headphones) Port Type: Audio Port Handle 0x0011, DMI type 126, 9 bytes. Inactive Handle 0x0012, DMI type 126, 9 bytes. Inactive Handle 0x0013, DMI type 126, 9 bytes. Inactive Handle 0x0014, DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Available Internal Connector Type: None External Reference Designator: Ethernet External Connector Type: RJ-45 Port Type: Network Port Handle 0x0015, DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Available Internal Connector Type: None External Reference Designator: USB 1 External Connector Type: Access Bus (USB) Port Type: USB Handle 0x0016, DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Available Internal Connector Type: None External Reference Designator: USB 2 External Connector Type: Access Bus (USB) Port Type: USB Handle 0x0017, DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Available Internal Connector Type: None External Reference Designator: USB 3 External Connector Type: Access Bus (USB) Port Type: USB Handle 0x0018, DMI type 126, 9 bytes. Inactive Handle 0x0019, DMI type 126, 9 bytes. Inactive Handle 0x001A, DMI type 126, 9 bytes. Inactive Handle 0x001B, DMI type 126, 9 bytes. Inactive Handle 0x001C, DMI type 126, 9 bytes. Inactive Handle 0x001D, DMI type 126, 9 bytes. Inactive Handle 0x001E, DMI type 126, 9 bytes. Inactive Handle 0x001F, DMI type 126, 9 bytes. Inactive Handle 0x0020, DMI type 9, 13 bytes. System Slot Information Designation: ExpressCard Slot 1 Type: x1 PCI Express Current Usage: Available Length: Other Characteristics: Hot-plug devices are supported Handle 0x0021, DMI type 9, 13 bytes. System Slot Information Designation: CardBus Slot 1 Type: 32-bit PC Card (PCMCIA) Current Usage: Available Length: Other ID: Adapter 1, Socket 0 Characteristics: 5.0 V is provided 3.3 V is provided PC Card-16 is supported Cardbus is supported Zoom Video is supported Modem ring resume is supported PME signal is supported Hot-plug devices are supported Handle 0x0022, DMI type 126, 13 bytes. Inactive Handle 0x0023, DMI type 126, 13 bytes. Inactive Handle 0x0024, DMI type 126, 13 bytes. Inactive Handle 0x0025, DMI type 10, 6 bytes. On Board Device Information Type: Other Status: Disabled Description: IBM Embedded Security hardware Handle 0x0026, DMI type 11, 5 bytes. OEM Strings String 1: IBM ThinkPad Embedded Controller -[7BHT31WW-1.04 ]- Handle 0x0027, DMI type 13, 22 bytes. BIOS Language Information Installable Languages: 1 enUS Currently Installed Language: enUS Handle 0x0028, DMI type 15, 25 bytes. System Event Log Area Length: 0 bytes Header Start Offset: 0x0000 Header Length: 16 bytes Data Start Offset: 0x0010 Access Method: General-purpose non-volatile data functions Access Address: 0x0000 Status: Invalid, Not Full Change Token: 0x00000000 Header Format: Type 1 Supported Log Type Descriptors: 1 Descriptor 1: POST error Data Format 1: POST results bitmap Handle 0x0029, DMI type 16, 15 bytes. Physical Memory Array Location: System Board Or Motherboard Use: System Memory Error Correction Type: None Maximum Capacity: 2 GB Error Information Handle: Not Provided Number Of Devices: 2 Handle 0x002A, DMI type 17, 27 bytes. Memory Device Array Handle: 0x0029 Error Information Handle: No Error Total Width: Unknown Data Width: Unknown Size: No Module Installed Form Factor: SODIMM Set: None Locator: DIMM 1 Bank Locator: Bank 0/1 Type: DDR2 Type Detail: Synchronous Speed: Unknown Manufacturer: Not Specified Serial Number: Not Specified Asset Tag: Not Specified Part Number: Not Specified Handle 0x002B, DMI type 17, 27 bytes. Memory Device Array Handle: 0x0029 Error Information Handle: No Error Total Width: 64 bits Data Width: 64 bits Size: 1024 MB Form Factor: SODIMM Set: None Locator: DIMM 2 Bank Locator: Bank 2/3 Type: DDR2 Type Detail: Synchronous Speed: Unknown Manufacturer: Not Specified Serial Number: Not Specified Asset Tag: Not Specified Part Number: Not Specified Handle 0x002C, DMI type 18, 23 bytes. 32-bit Memory Error Information Type: OK Granularity: Unknown Operation: Unknown Vendor Syndrome: Unknown Memory Array Address: Unknown Device Address: Unknown Resolution: Unknown Handle 0x002D, DMI type 19, 15 bytes. Memory Array Mapped Address Starting Address: 0x00000000000 Ending Address: 0x0003FFFFFFF Range Size: 1 GB Physical Array Handle: 0x0029 Partition Width: 0 Handle 0x002E, DMI type 126, 19 bytes. Inactive Handle 0x002F, DMI type 20, 19 bytes. Memory Device Mapped Address Starting Address: 0x00000000000 Ending Address: 0x0003FFFFFFF Range Size: 1 GB Physical Device Handle: 0x002B Memory Array Mapped Address Handle: 0x002D Partition Row Position: 1 Handle 0x0030, DMI type 21, 7 bytes. Built-in Pointing Device Type: Track Point Interface: PS/2 Buttons: 3 Handle 0x0031, DMI type 24, 5 bytes. Hardware Security Power-On Password Status: Disabled Keyboard Password Status: Disabled Administrator Password Status: Disabled Front Panel Reset Status: Unknown Handle 0x0032, DMI type 32, 11 bytes. System Boot Information Status: No errors detected Handle 0x0033, DMI type 131, 17 bytes. OEM-specific Type Header and Data: 83 11 33 00 01 02 03 FF FF 1F 00 00 00 00 00 02 00 Strings: BOOTINF 20h BOOTDEV 21h KEYPTRS 23h Handle 0x0034, DMI type 131, 11 bytes. OEM-specific Type Header and Data: 83 0B 34 00 00 00 E8 FF C5 01 01 Strings: IBM System Metrics Handle 0x0035, DMI type 131, 22 bytes. OEM-specific Type Header and Data: 83 16 35 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 Strings: TVT-Enablement Handle 0x0036, DMI type 132, 7 bytes. OEM-specific Type Header and Data: 84 07 36 00 02 D8 36 Handle 0x0037, DMI type 133, 5 bytes. OEM-specific Type Header and Data: 85 05 37 00 01 Strings: KHOIHGIUCCHHII Handle 0x0038, DMI type 133, 17 bytes. OEM-specific Type Header and Data: 85 11 38 00 30 30 2E 35 00 60 6F 3F 00 00 00 00 01 Strings: Audit Boot History Handle 0x0039, DMI type 134, 13 bytes. OEM-specific Type Header and Data: 86 0D 39 00 14 06 06 20 00 00 00 00 00 Handle 0x003A, DMI type 134, 16 bytes. OEM-specific Type Header and Data: 86 10 3A 00 00 41 54 4D 4C 01 01 00 00 02 01 02 Strings: TPM INFO System Reserved Handle 0x003B, DMI type 135, 13 bytes. OEM-specific Type Header and Data: 87 0D 3B 00 54 50 07 00 01 00 00 00 00 Handle 0x003C, DMI type 135, 18 bytes. OEM-specific Type Header and Data: 87 12 3C 00 54 50 07 01 01 A5 00 00 00 00 00 00 00 00 Handle 0x003D, DMI type 135, 35 bytes. OEM-specific Type Header and Data: 87 23 3D 00 54 50 07 02 42 41 59 20 49 2F 4F 20 01 00 02 00 00 0B 00 D0 18 C6 18 02 00 0E 00 F0 01 F6 03 Handle 0x003E, DMI type 136, 6 bytes. OEM-specific Type Header and Data: 88 06 3E 00 5A 5A Handle 0x003F, DMI type 137, 26 bytes. OEM-specific Type Header and Data: 89 1A 3F 00 0A 01 00 01 00 00 50 57 4D 53 20 49 6E 66 6F 72 6D 61 74 69 6F 6E Handle 0x0040, DMI type 138, 40 bytes. OEM-specific Type Header and Data: 8A 28 40 00 14 01 01 01 07 01 01 0C 01 01 0C 01 01 0C 00 00 42 49 4F 53 20 50 61 73 73 77 6F 72 64 20 46 6F 72 6D 61 74 Handle 0x0041, DMI type 139, 37 bytes. OEM-specific Type Header and Data: 8B 25 41 00 11 01 0A 00 00 00 00 00 00 00 00 00 00 50 57 4D 53 20 4B 65 79 20 49 6E 66 6F 72 6D 61 74 69 6F 6E Handle 0x0042, DMI type 127, 4 bytes. End Of Table Parse-DMIDecode-0.03/t/30synopsis.t0000444000076400007640000000250410574775526016606 0ustar nicolawnicolaw# $Id: 30synopsis.t 976 2007-03-04 20:47:36Z nicolaw $ chdir('t') if -d 't'; use strict; use Test::More tests => 12; use lib qw(./lib ../lib); use Parse::DMIDecode qw(); my $data; my $dmi; ok($dmi = Parse::DMIDecode->new(nowarnings => 0),'new'); ok($dmi->parse(slurp('dmidecode_example1.txt')),'parse dmidecode_example1.txt'); ok($dmi->keyword('bios-vendor') eq 'Dell Inc.','keyword bios-vendor'); ok($dmi->keyword('system-product-name') eq 'OptiPlex GX620','keyword system-product-name'); ok($dmi->parse(slurp('dmidecode_example2.txt')),'parse dmidecode_example2.txt'); ok($dmi->keyword('bios-version') eq 'ASUS A7N266-VM ACPI BIOS Rev 1005','keyword bios-version'); ok($dmi->keyword('processor-version') eq 'AMD Athlon(TM) XP Processor','keyword processor-version'); ok($dmi->parse(slurp('dmidecode_example3.txt')),'parse dmidecode_example3.txt'); ok($dmi->keyword('system-serial-number') eq 'L3M4102','keyword system-serial-number'); ok($dmi->keyword('system-manufacturer') eq 'LENOVO','keyword system-serial-manufacturer'); ok($dmi->parse(slurp('dmidecode_example4.txt')),'parse dmidecode_example4.txt'); ok($dmi->parse(slurp('dmidecode_example4.txt')),'parse dmidecode_example5.txt'); sub slurp { my $file = shift; my $data = ''; if (open(FH,'<',$file)) { local $/ = undef; $data = ; close(FH); } return $data; } 1; Parse-DMIDecode-0.03/t/dmidecode_example5.txt0000444000076400007640000004574110574775526020657 0ustar nicolawnicolaw# dmidecode 2.2 SMBIOS 2.4 present. 62 structures occupying 3131 bytes. Table at 0xCFFBC000. Handle 0xDA00 DMI type 218, 11 bytes. OEM-specific Type Header And Data: DA 0B 00 DA B2 00 17 00 0E 20 00 Handle 0x0000 DMI type 0, 24 bytes. BIOS Information Vendor: Dell Inc. Version: 1.1.0 Release Date: 06/21/2006 Address: 0xF0000 Runtime Size: 64 kB ROM Size: 1024 kB Characteristics: ISA is supported PCI is supported PNP is supported BIOS is upgradeable BIOS shadowing is allowed ESCD support is available Boot from CD is supported Selectable boot is supported EDD is supported Japanese floppy for Toshiba 1.2 MB is supported (int 13h) 5.25"/360 KB floppy services are supported (int 13h) 5.25"/1.2 MB floppy services are supported (int 13h) 3.5"/720 KB floppy services are supported (int 13h) Print screen service is supported (int 5h) 8042 keyboard services are supported (int 9h) Serial services are supported (int 14h) Printer services are supported (int 17h) CGA/mono video services are supported (int 10h) ACPI is supported USB legacy is supported BIOS boot specification is supported Function key-initiated network boot is supported Handle 0x0100 DMI type 1, 27 bytes. System Information Manufacturer: Dell Inc. Product Name: PowerEdge 2950 Version: Not Specified Serial Number: CXFSH2J UUID: 44454C4C-5800-1046-8053-C3C04F48324A Wake-up Type: Power Switch Handle 0x0200 DMI type 2, 9 bytes. Base Board Information Manufacturer: Dell Inc. Product Name: 0CW954 Version: A00 Serial Number: ..CN1374069C005G. Handle 0x0300 DMI type 3, 21 bytes. Chassis Information Manufacturer: Dell Inc. Type: Rack Mount Chassis Lock: Present Version: Not Specified Serial Number: CXFSH2J Asset Tag: Not Specified Boot-up State: Safe Power Supply State: Safe Thermal State: Safe Security Status: Unknown OEM Information: 0x00000000 Heigth: 2 U Number Of Power Cords: Unspecified Contained Elements: 0 Handle 0x0400 DMI type 4, 40 bytes. Processor Information Socket Designation: CPU1 Type: Central Processor Family: Xeon Manufacturer: Intel ID: 64 0F 00 00 FF FB EB BF Signature: Type 0, Family F, Model 6, Stepping 4 Flags: FPU (Floating-point unit on-chip) VME (Virtual mode extension) DE (Debugging extension) PSE (Page size extension) TSC (Time stamp counter) MSR (Model specific registers) PAE (Physical address extension) MCE (Machine check exception) CX8 (CMPXCHG8 instruction supported) APIC (On-chip APIC hardware supported) SEP (Fast system call) MTRR (Memory type range registers) PGE (Page global enable) MCA (Machine check architecture) CMOV (Conditional move instruction supported) PAT (Page attribute table) PSE-36 (36-bit page size extension) CLFSH (CLFLUSH instruction supported) DS (Debug store) ACPI (ACPI supported) MMX (MMX technology supported) FXSR (Fast floating-point save and restore) SSE (Streaming SIMD extensions) SSE2 (Streaming SIMD extensions 2) SS (Self-snoop) HTT (Hyper-threading technology) TM (Thermal monitor supported) SBF (Signal break on FERR) Version: Intel(R) Xeon(TM) CPU 3.20GHz Voltage: 1.4 V External Clock: 1066 MHz Max Speed: 3600 MHz Current Speed: 3200 MHz Status: Populated, Enabled Upgrade: L1 Cache Handle: 0x0700 L2 Cache Handle: 0x0701 L3 Cache Handle: 0x0702 Serial Number: Not Specified Asset Tag: Not Specified Part Number: Not Specified Handle 0x0401 DMI type 4, 40 bytes. Processor Information Socket Designation: CPU2 Type: Central Processor Family: Xeon Manufacturer: Intel ID: 64 0F 00 00 FF FB EB BF Signature: Type 0, Family F, Model 6, Stepping 4 Flags: FPU (Floating-point unit on-chip) VME (Virtual mode extension) DE (Debugging extension) PSE (Page size extension) TSC (Time stamp counter) MSR (Model specific registers) PAE (Physical address extension) MCE (Machine check exception) CX8 (CMPXCHG8 instruction supported) APIC (On-chip APIC hardware supported) SEP (Fast system call) MTRR (Memory type range registers) PGE (Page global enable) MCA (Machine check architecture) CMOV (Conditional move instruction supported) PAT (Page attribute table) PSE-36 (36-bit page size extension) CLFSH (CLFLUSH instruction supported) DS (Debug store) ACPI (ACPI supported) MMX (MMX technology supported) FXSR (Fast floating-point save and restore) SSE (Streaming SIMD extensions) SSE2 (Streaming SIMD extensions 2) SS (Self-snoop) HTT (Hyper-threading technology) TM (Thermal monitor supported) SBF (Signal break on FERR) Version: Intel(R) Xeon(TM) CPU 3.20GHz Voltage: 1.4 V External Clock: 1066 MHz Max Speed: 3600 MHz Current Speed: 3200 MHz Status: Populated, Idle Upgrade: L1 Cache Handle: 0x0703 L2 Cache Handle: 0x0704 L3 Cache Handle: 0x0705 Serial Number: Not Specified Asset Tag: Not Specified Part Number: Not Specified Handle 0x0700 DMI type 7, 19 bytes. Cache Information Socket Designation: Not Specified Configuration: Enabled, Not Socketed, Level 1 Operational Mode: Write Through Location: Internal Installed Size: 32 KB Maximum Size: 32 KB Supported SRAM Types: Unknown Installed SRAM Type: Unknown Speed: Unknown Error Correction Type: Parity System Type: Data Associativity: 8-way Set-associative Handle 0x0701 DMI type 7, 19 bytes. Cache Information Socket Designation: Not Specified Configuration: Enabled, Not Socketed, Level 2 Operational Mode: Write Back Location: Internal Installed Size: 4096 KB Maximum Size: 4096 KB Supported SRAM Types: Unknown Installed SRAM Type: Unknown Speed: Unknown Error Correction Type: Single-bit ECC System Type: Unified Associativity: 8-way Set-associative Handle 0x0702 DMI type 7, 19 bytes. Cache Information Socket Designation: Not Specified Configuration: Enabled, Not Socketed, Level 3 Operational Mode: Write Back Location: Internal Installed Size: 0 KB Maximum Size: 0 KB Supported SRAM Types: Unknown Installed SRAM Type: Unknown Speed: Unknown Error Correction Type: Single-bit ECC System Type: Unified Associativity: Unknown Handle 0x0703 DMI type 7, 19 bytes. Cache Information Socket Designation: Not Specified Configuration: Enabled, Not Socketed, Level 1 Operational Mode: Write Through Location: Internal Installed Size: 32 KB Maximum Size: 32 KB Supported SRAM Types: Unknown Installed SRAM Type: Unknown Speed: Unknown Error Correction Type: Parity System Type: Data Associativity: 8-way Set-associative Handle 0x0704 DMI type 7, 19 bytes. Cache Information Socket Designation: Not Specified Configuration: Enabled, Not Socketed, Level 2 Operational Mode: Write Back Location: Internal Installed Size: 4096 KB Maximum Size: 4096 KB Supported SRAM Types: Unknown Installed SRAM Type: Unknown Speed: Unknown Error Correction Type: Single-bit ECC System Type: Unified Associativity: 8-way Set-associative Handle 0x0705 DMI type 7, 19 bytes. Cache Information Socket Designation: Not Specified Configuration: Enabled, Not Socketed, Level 3 Operational Mode: Write Back Location: Internal Installed Size: 0 KB Maximum Size: 0 KB Supported SRAM Types: Unknown Installed SRAM Type: Unknown Speed: Unknown Error Correction Type: Single-bit ECC System Type: Unified Associativity: Unknown Handle 0x0800 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: DB-15 female Port Type: Video Port Handle 0x0801 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: DB-15 female Port Type: Video Port Handle 0x0802 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: Access Bus (USB) Port Type: USB Handle 0x0803 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: Access Bus (USB) Port Type: USB Handle 0x0804 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: Access Bus (USB) Port Type: USB Handle 0x0805 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: Access Bus (USB) Port Type: USB Handle 0x0806 DMI type 126, 9 bytes. Inactive Handle 0x0807 DMI type 126, 9 bytes. Inactive Handle 0x0808 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: RJ-45 Port Type: Network Port Handle 0x0809 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: RJ-45 Port Type: Network Port Handle 0x080A DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: DB-9 male Port Type: Serial Port 16550A Compatible Handle 0x0900 DMI type 9, 13 bytes. System Slot Information Designation: PCI1 Type: Current Usage: Available Length: Long Characteristics: 3.3 V is provided PME signal is supported Handle 0x0901 DMI type 9, 13 bytes. System Slot Information Designation: PCI2 Type: 64-bit PCI-X Current Usage: Available Length: Long ID: 2 Characteristics: 3.3 V is provided PME signal is supported Handle 0x0902 DMI type 9, 13 bytes. System Slot Information Designation: PCI3 Type: 64-bit PCI-X Current Usage: Available Length: Long ID: 3 Characteristics: 3.3 V is provided PME signal is supported Handle 0x0903 DMI type 126, 13 bytes. Inactive Handle 0x0904 DMI type 126, 13 bytes. Inactive Handle 0x0905 DMI type 126, 13 bytes. Inactive Handle 0x0A00 DMI type 10, 10 bytes. On Board Device Information Type: Video Status: Enabled Description: Embedded ATI ES1000 Video On Board Device Information Type: Ethernet Status: Enabled Description: Embedded Broadcom 5708 NIC 1 On Board Device Information Type: Ethernet Status: Enabled Description: Embedded Broadcom 5708 NIC 2 Handle 0x0B00 DMI type 11, 5 bytes. OEM Strings String 1: Dell System String 2: 5[0000] Handle 0x7E00 DMI type 126, 154 bytes. Inactive Handle 0x0C00 DMI type 12, 5 bytes. System Configuration Options Option 1: NVRAM_CLR: Clear user settable NVRAM areas and set defaults Option 2: PASSWD: Close to enable password Handle 0x0D00 DMI type 13, 22 bytes. BIOS Language Information Installable Languages: 1 en|US|iso8859-1 Currently Installed Language: en|US|iso8859-1 Handle 0x1000 DMI type 16, 15 bytes. Physical Memory Array Location: System Board Or Motherboard Use: System Memory Error Correction Type: Multi-bit ECC Maximum Capacity: 32 GB Error Information Handle: Not Provided Number Of Devices: 8 Handle 0x1100 DMI type 17, 28 bytes. Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: 1024 MB Form Factor: Set: 1 Locator: DIMM1 Bank Locator: Not Specified Type: Type Detail: Synchronous Speed: 667 MHz (1.5 ns) Manufacturer: 80AD808980AD Serial Number: 53855018 Asset Tag: 010638 Part Number: HYMP512F72BP8N2-Y5 Handle 0x1101 DMI type 17, 28 bytes. Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: 1024 MB Form Factor: Set: 1 Locator: DIMM2 Bank Locator: Not Specified Type: Type Detail: Synchronous Speed: 667 MHz (1.5 ns) Manufacturer: 80AD808980AD Serial Number: 53855019 Asset Tag: 010638 Part Number: HYMP512F72BP8N2-Y5 Handle 0x1102 DMI type 17, 28 bytes. Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: 1024 MB Form Factor: Set: 2 Locator: DIMM3 Bank Locator: Not Specified Type: Type Detail: Synchronous Speed: 667 MHz (1.5 ns) Manufacturer: 80AD808980AD Serial Number: 5385501B Asset Tag: 010638 Part Number: HYMP512F72BP8N2-Y5 Handle 0x1103 DMI type 17, 28 bytes. Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: 1024 MB Form Factor: Set: 2 Locator: DIMM4 Bank Locator: Not Specified Type: Type Detail: Synchronous Speed: 667 MHz (1.5 ns) Manufacturer: 80AD808980AD Serial Number: 5385501B Asset Tag: 010638 Part Number: HYMP512F72BP8N2-Y5 Handle 0x1104 DMI type 17, 28 bytes. Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: No Module Installed Form Factor: Set: 3 Locator: DIMM5 Bank Locator: Not Specified Type: Type Detail: Synchronous Speed: Unknown Manufacturer: Serial Number: Asset Tag: Part Number: Handle 0x1105 DMI type 17, 28 bytes. Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: No Module Installed Form Factor: Set: 3 Locator: DIMM6 Bank Locator: Not Specified Type: Type Detail: Synchronous Speed: Unknown Manufacturer: Serial Number: Asset Tag: Part Number: Handle 0x1106 DMI type 17, 28 bytes. Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: No Module Installed Form Factor: Set: 4 Locator: DIMM7 Bank Locator: Not Specified Type: Type Detail: Synchronous Speed: Unknown Manufacturer: Serial Number: Asset Tag: Part Number: Handle 0x1107 DMI type 17, 28 bytes. Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: No Module Installed Form Factor: Set: 4 Locator: DIMM8 Bank Locator: Not Specified Type: Type Detail: Synchronous Speed: Unknown Manufacturer: Serial Number: Asset Tag: Part Number: Handle 0x1108 DMI type 126, 28 bytes. Inactive Handle 0x1109 DMI type 126, 28 bytes. Inactive Handle 0x110A DMI type 126, 28 bytes. Inactive Handle 0x110B DMI type 126, 28 bytes. Inactive Handle 0x1300 DMI type 19, 15 bytes. Memory Array Mapped Address Starting Address: 0x00000000000 Ending Address: 0x000CFFFFFFF Range Size: 3328 MB Physical Array Handle: 0x1000 Partition Width: 0 Handle 0x1301 DMI type 19, 15 bytes. Memory Array Mapped Address Starting Address: 0x00100000000 Ending Address: 0x0012FFFFFFF Range Size: 768 MB Physical Array Handle: 0x1000 Partition Width: 0 Handle 0x2000 DMI type 32, 11 bytes. System Boot Information Status: No errors detected Handle 0x2600 DMI type 38, 18 bytes. IPMI Device Information Interface Type: KCS (Keyboard Control Style) Specification Version: 2.0 I2C Slave Address: 0x10 NV Storage Device: Not Present Base Address: 0x0000000000000CA8 (I/O) Register Spacing: 32-bit Boundaries Handle 0xD000 DMI type 208, 10 bytes. OEM-specific Type Header And Data: D0 0A 00 D0 02 00 FE 00 B2 01 Handle 0xD200 DMI type 210, 12 bytes. OEM-specific Type Header And Data: D2 0C 00 D2 F8 03 04 03 06 80 04 05 Handle 0xD400 DMI type 212, 117 bytes. OEM-specific Type Header And Data: D4 75 00 D4 70 00 71 00 00 10 2D 2E 03 00 11 7F 80 04 00 11 7F 00 42 00 11 FE 01 43 00 11 FE 00 00 00 11 9F 20 00 00 11 9F 00 6E 01 11 9F 20 6D 01 11 9F 00 31 40 11 FB 00 32 40 11 FB 04 9D 00 11 FD 02 9E 00 11 FD 00 9F 00 26 FE 01 A0 00 26 FE 00 51 00 26 3F 00 52 00 26 3F 40 53 00 26 3F 80 54 00 26 3F C0 28 40 26 DF 20 29 40 26 DF 00 FF FF 00 00 00 Handle 0xD401 DMI type 212, 187 bytes. OEM-specific Type Header And Data: D4 BB 01 D4 70 00 71 00 03 40 5A 6D 6B 00 78 7F 80 6C 00 78 7F 00 58 00 78 FA 05 59 00 78 FA 00 5C 00 78 BF 40 5D 00 78 BF 00 04 80 78 FD 02 01 A0 78 FD 00 00 00 55 E7 00 00 00 55 E7 08 00 00 55 E7 10 6C 01 57 FC 00 6B 01 57 FC 01 6A 01 57 FC 02 77 01 54 FC 00 78 01 54 FC 01 79 01 54 FC 02 7A 01 54 FC 03 33 40 54 CF 00 34 40 54 CF 10 35 40 54 CF 20 36 40 54 CF 30 1A 40 54 FB 04 1B 40 54 FB 00 1C 40 54 F7 08 1D 40 54 F7 00 6E 00 58 FC 01 2D 00 58 FC 02 2E 00 58 FC 00 22 40 58 EF 10 23 40 58 EF 00 BB 00 58 F3 04 BC 00 58 F3 08 BA 00 58 F3 00 FF FF 00 00 00 Handle 0xD402 DMI type 212, 47 bytes. OEM-specific Type Header And Data: D4 2F 02 D4 70 00 71 00 03 40 5A 6D D8 00 55 7F 80 D9 00 55 7F 00 00 C0 5C 00 0A 03 C0 67 00 05 83 00 76 00 00 84 00 77 00 00 FF FF 00 00 00 Handle 0xD403 DMI type 212, 247 bytes. OEM-specific Type Header And Data: D4 F7 03 D4 72 00 73 00 00 40 5D 5E 71 01 46 FB 04 72 01 46 FB 00 73 01 46 F7 08 74 01 46 F7 00 D1 00 46 FE 00 D2 00 46 FE 01 4A 01 46 BF 40 4B 01 46 BF 00 D3 00 00 00 02 D4 00 02 00 02 00 90 2C 00 00 01 90 2D 00 00 00 00 49 EB 14 DB 00 49 EB 00 00 00 49 FC 00 00 00 49 FC 01 00 00 49 FC 02 00 00 49 7F 00 00 00 49 7F 80 17 01 4A FE 00 18 01 4A FE 01 19 01 4A FD 00 1A 01 4A FD 02 00 00 4A FB 00 00 00 4A FB 04 00 00 4A F7 00 00 00 4A F7 08 35 01 4B FC 00 37 01 4B FC 01 3B 01 4B F3 04 DE 00 63 FE 01 26 40 42 FE 01 27 40 42 FE 00 00 00 47 FE 01 00 00 47 FE 00 A1 00 45 CF 20 A3 00 45 CF 10 A2 00 45 CF 00 02 40 46 DF 00 01 40 46 DF 20 95 01 7E FC 00 96 01 7E FC 01 97 01 7E FC 02 09 80 7E F3 00 0A 80 7E F3 04 0B 80 7E F3 08 FF FF 00 00 00 Handle 0xD404 DMI type 212, 27 bytes. OEM-specific Type Header And Data: D4 1B 04 D4 72 00 73 00 00 40 5D 5E 41 40 40 FE 01 40 40 40 FE 00 FF FF 00 00 00 Handle 0xD800 DMI type 216, 9 bytes. OEM-specific Type Header And Data: D8 09 00 D8 01 02 01 00 00 Strings: ATI RN50 A20 BIOS Handle 0xDE00 DMI type 222, 16 bytes. OEM-specific Type Header And Data: DE 10 00 DE 01 04 FF FF 00 00 00 00 00 00 00 01 Handle 0x7F00 DMI type 127, 4 bytes. End Of Table Parse-DMIDecode-0.03/t/dmidecode_example1.txt0000444000076400007640000004311710574775526020646 0ustar nicolawnicolaw# dmidecode 2.7 SMBIOS 2.3 present. 73 structures occupying 2570 bytes. Table at 0x000F0450. Handle 0xDA00, DMI type 218, 53 bytes. OEM-specific Type Header and Data: DA 35 00 DA B2 00 17 0B 0E 38 00 00 80 00 80 01 00 02 80 02 80 01 00 00 A0 00 A0 01 00 58 00 58 00 01 00 59 00 59 00 01 00 05 80 05 80 01 00 FF FF 00 00 00 00 Handle 0xDA01, DMI type 218, 35 bytes. OEM-specific Type Header and Data: DA 23 01 DA B2 00 17 0B 0E 38 00 10 F5 10 F5 00 00 11 F5 11 F5 00 00 12 F5 12 F5 00 00 FF FF 00 00 00 00 Handle 0x0000, DMI type 0, 20 bytes. BIOS Information Vendor: Dell Inc. Version: A06 Release Date: 02/20/2006 Address: 0xF0000 Runtime Size: 64 kB ROM Size: 512 kB Characteristics: PCI is supported PNP is supported APM is supported BIOS is upgradeable BIOS shadowing is allowed Boot from CD is supported Selectable boot is supported EDD is supported Japanese floppy for Toshiba 1.2 MB is supported (int 13h) Print screen service is supported (int 5h) 8042 keyboard services are supported (int 9h) Serial services are supported (int 14h) Printer services are supported (int 17h) ACPI is supported USB legacy is supported LS-120 boot is supported BIOS boot specification is supported Function key-initiated network boot is supported Handle 0x0100, DMI type 1, 25 bytes. System Information Manufacturer: Dell Inc. Product Name: OptiPlex GX620 Version: Not Specified Serial Number: 6BQB82J UUID: 44454C4C-4200-1051-8042-B6C04F38324A Wake-up Type: Power Switch Handle 0x0200, DMI type 2, 8 bytes. Base Board Information Manufacturer: Dell Inc. Product Name: 0KH290 Version: Serial Number: ..CN6986164512B2. Handle 0x0300, DMI type 3, 13 bytes. Chassis Information Manufacturer: Dell Inc. Type: Space-saving Lock: Not Present Version: Not Specified Serial Number: 6BQB82J Asset Tag: Boot-up State: Warning Power Supply State: Safe Thermal State: Safe Security Status: None Handle 0x0400, DMI type 4, 32 bytes. Processor Information Socket Designation: Microprocessor Type: Central Processor Family: Pentium 4 Manufacturer: Intel ID: 43 0F 00 00 FF FB EB BF Signature: Type 0, Family 15, Model 4, Stepping 3 Flags: FPU (Floating-point unit on-chip) VME (Virtual mode extension) DE (Debugging extension) PSE (Page size extension) TSC (Time stamp counter) MSR (Model specific registers) PAE (Physical address extension) MCE (Machine check exception) CX8 (CMPXCHG8 instruction supported) APIC (On-chip APIC hardware supported) SEP (Fast system call) MTRR (Memory type range registers) PGE (Page global enable) MCA (Machine check architecture) CMOV (Conditional move instruction supported) PAT (Page attribute table) PSE-36 (36-bit page size extension) CLFSH (CLFLUSH instruction supported) DS (Debug store) ACPI (ACPI supported) MMX (MMX technology supported) FXSR (Fast floating-point save and restore) SSE (Streaming SIMD extensions) SSE2 (Streaming SIMD extensions 2) SS (Self-snoop) HTT (Hyper-threading technology) TM (Thermal monitor supported) PBE (Pending break enabled) Version: Not Specified Voltage: 1.8 V External Clock: 800 MHz Max Speed: 4000 MHz Current Speed: 3000 MHz Status: Populated, Enabled Upgrade: ZIF Socket L1 Cache Handle: 0x0700 L2 Cache Handle: 0x0701 L3 Cache Handle: Not Provided Handle 0x0700, DMI type 7, 19 bytes. Cache Information Socket Designation: Not Specified Configuration: Enabled, Not Socketed, Level 1 Operational Mode: Write Back Location: Internal Installed Size: 16 KB Maximum Size: 16 KB Supported SRAM Types: Other Installed SRAM Type: Other Speed: Unknown Error Correction Type: None System Type: Data Associativity: 8-way Set-associative Handle 0x0701, DMI type 7, 19 bytes. Cache Information Socket Designation: Not Specified Configuration: Enabled, Not Socketed, Level 2 Operational Mode: Varies With Memory Address Location: Internal Installed Size: 2048 KB Maximum Size: 2048 KB Supported SRAM Types: Other Installed SRAM Type: Other Speed: Unknown Error Correction Type: Single-bit ECC System Type: Unified Associativity: 8-way Set-associative Handle 0x0800, DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: PARALLEL Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: DB-25 female Port Type: Parallel Port PS/2 Handle 0x0801, DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: SERIAL1 Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: DB-9 male Port Type: Serial Port 16550A Compatible Handle 0x0802, DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: SERIAL2 Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: DB-9 male Port Type: Serial Port 16550A Compatible Handle 0x0803, DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: KYBD Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: PS/2 Port Type: Keyboard Port Handle 0x0804, DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: MOUSE Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: PS/2 Port Type: Mouse Port Handle 0x0805, DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: USB1 Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: Access Bus (USB) Port Type: USB Handle 0x0806, DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: USB2 Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: Access Bus (USB) Port Type: USB Handle 0x0807, DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: USB3 Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: Access Bus (USB) Port Type: USB Handle 0x0808, DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: USB4 Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: Access Bus (USB) Port Type: USB Handle 0x0809, DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: USB5 Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: Access Bus (USB) Port Type: USB Handle 0x080A, DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: USB6 Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: Access Bus (USB) Port Type: USB Handle 0x080B, DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: USB7 Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: Access Bus (USB) Port Type: USB Handle 0x080C, DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: USB8 Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: Access Bus (USB) Port Type: USB Handle 0x080D, DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: ENET Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: RJ-45 Port Type: Network Port Handle 0x080E, DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: MIC Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: Mini Jack (headphones) Port Type: Audio Port Handle 0x080F, DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: LINE-OUT Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: Mini Jack (headphones) Port Type: Audio Port Handle 0x0810, DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: LINE-IN Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: Mini Jack (headphones) Port Type: Audio Port Handle 0x0811, DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: HP-OUT Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: Mini Jack (headphones) Port Type: Audio Port Handle 0x0812, DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: MONITOR Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: DB-15 female Port Type: Video Port Handle 0x090A, DMI type 9, 13 bytes. System Slot Information Designation: PEG Type: x16 PCI Express Current Usage: Available Length: Long Characteristics: 3.3 V is provided PME signal is supported Handle 0x0901, DMI type 126, 13 bytes. Inactive Handle 0x0902, DMI type 9, 13 bytes. System Slot Information Designation: SLOT2 Type: 32-bit PCI Current Usage: Available Length: Long ID: 2 Characteristics: 5.0 V is provided 3.3 V is provided PME signal is supported Handle 0x0903, DMI type 126, 13 bytes. Inactive Handle 0x0904, DMI type 126, 13 bytes. Inactive Handle 0x0905, DMI type 126, 13 bytes. Inactive Handle 0x0906, DMI type 126, 13 bytes. Inactive Handle 0x0A00, DMI type 10, 6 bytes. On Board Device Information Type: Video Status: Enabled Description: Intel Graphics Media Accelerator 950 Handle 0x0A02, DMI type 10, 6 bytes. On Board Device Information Type: Ethernet Status: Enabled Description: Broadcom 5751 NetXtreme Gigabit Controller Handle 0x0A03, DMI type 10, 6 bytes. On Board Device Information Type: Sound Status: Enabled Description: AC'97 Audio Controller Handle 0x0B00, DMI type 11, 5 bytes. OEM Strings String 1: www.dell.com Handle 0x0D00, DMI type 13, 22 bytes. BIOS Language Information Installable Languages: 1 en|US|iso8859-1 Currently Installed Language: en|US|iso8859-1 Handle 0x0F00, DMI type 15, 29 bytes. System Event Log Area Length: 2049 bytes Header Start Offset: 0x0000 Header Length: 16 bytes Data Start Offset: 0x0010 Access Method: Memory-mapped physical 32-bit address Access Address: 0xFFF81000 Status: Valid, Not Full Change Token: 0x0000000C Header Format: Type 1 Supported Log Type Descriptors: 3 Descriptor 1: POST error Data Format 1: POST results bitmap Descriptor 2: System limit exceeded Data Format 2: System management Descriptor 3: Log area reset/cleared Data Format 3: None Handle 0x1000, DMI type 16, 15 bytes. Physical Memory Array Location: System Board Or Motherboard Use: System Memory Error Correction Type: None Maximum Capacity: 4 GB Error Information Handle: Not Provided Number Of Devices: 4 Handle 0x1100, DMI type 17, 27 bytes. Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 64 bits Data Width: 64 bits Size: 512 MB Form Factor: DIMM Set: None Locator: DIMM_1 Bank Locator: Not Specified Type: DDR Type Detail: Synchronous Speed: 533 MHz (1.9 ns) Manufacturer: CE00000000000000 Serial Number: F32B0353 Asset Tag: Not Specified Part Number: M3 78T6553CZ3-CD5 Handle 0x1101, DMI type 17, 27 bytes. Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 64 bits Data Width: 64 bits Size: No Module Installed Form Factor: DIMM Set: None Locator: DIMM_3 Bank Locator: Not Specified Type: DDR Type Detail: Synchronous Speed: 533 MHz (1.9 ns) Manufacturer: FFFFFFFFFFFFFFFF Serial Number: FFFFFFFF Asset Tag: Not Specified Part Number: Handle 0x1102, DMI type 17, 27 bytes. Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 64 bits Data Width: 64 bits Size: 512 MB Form Factor: DIMM Set: None Locator: DIMM_2 Bank Locator: Not Specified Type: DDR Type Detail: Synchronous Speed: 533 MHz (1.9 ns) Manufacturer: CE00000000000000 Serial Number: F32B025A Asset Tag: Not Specified Part Number: M3 78T6553CZ3-CD5 Handle 0x1103, DMI type 17, 27 bytes. Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 64 bits Data Width: 64 bits Size: No Module Installed Form Factor: DIMM Set: None Locator: DIMM_4 Bank Locator: Not Specified Type: DDR Type Detail: Synchronous Speed: 533 MHz (1.9 ns) Manufacturer: FFFFFFFFFFFFFFFF Serial Number: FFFFFFFF Asset Tag: Not Specified Part Number: Handle 0x1301, DMI type 19, 15 bytes. Memory Array Mapped Address Starting Address: 0x00000000000 Ending Address: 0x0003FFFFFFF Range Size: 1 GB Physical Array Handle: 0x1000 Partition Width: 0 Handle 0x1402, DMI type 20, 19 bytes. Memory Device Mapped Address Starting Address: 0x00000000000 Ending Address: 0x0001FFFFFFF Range Size: 512 MB Physical Device Handle: 0x1100 Memory Array Mapped Address Handle: 0x1301 Partition Row Position: 1 Handle 0x1403, DMI type 126, 19 bytes. Inactive Handle 0x1404, DMI type 20, 19 bytes. Memory Device Mapped Address Starting Address: 0x00020000000 Ending Address: 0x0003FFFFFFF Range Size: 512 MB Physical Device Handle: 0x1102 Memory Array Mapped Address Handle: 0x1301 Partition Row Position: 1 Handle 0x1405, DMI type 126, 19 bytes. Inactive Handle 0x1800, DMI type 24, 5 bytes. Hardware Security Power-On Password Status: Enabled Keyboard Password Status: Not Implemented Administrator Password Status: Enabled Front Panel Reset Status: Not Implemented Handle 0x1900, DMI type 25, 9 bytes. System Power Controls Next Scheduled Power-on: 09-16 08:00:00 Handle 0x1B10, DMI type 27, 12 bytes. Cooling Device Type: Fan Status: OK OEM-specific Information: 0x0000DD00 Handle 0x1B11, DMI type 126, 12 bytes. Inactive Handle 0x1B12, DMI type 126, 12 bytes. Inactive Handle 0x2000, DMI type 32, 11 bytes. System Boot Information Status: No errors detected Handle 0x8100, DMI type 129, 8 bytes. OEM-specific Type Header and Data: 81 08 00 81 01 01 02 01 Strings: Intel_ASF Dell_ASF_002 Handle 0x8800, DMI type 136, 6 bytes. OEM-specific Type Header and Data: 88 06 00 88 5A 5A Handle 0xD000, DMI type 208, 10 bytes. OEM-specific Type Header and Data: D0 0A 00 D0 01 03 FE 00 AD 01 Handle 0xD100, DMI type 209, 12 bytes. OEM-specific Type Header and Data: D1 0C 00 D1 78 03 07 03 04 0F 80 05 Handle 0xD200, DMI type 210, 12 bytes. OEM-specific Type Header and Data: D2 0C 00 D2 F8 03 04 03 06 80 04 05 Handle 0xD201, DMI type 210, 12 bytes. OEM-specific Type Header and Data: D2 0C 01 D2 F8 02 03 03 06 80 04 05 Handle 0xD400, DMI type 212, 242 bytes. OEM-specific Type Header and Data: D4 F2 00 D4 70 00 71 00 00 10 2D 2E 42 00 11 FE 01 43 00 11 FE 00 0F 00 25 FC 00 10 00 25 FC 01 11 00 25 FC 02 12 00 25 FC 03 13 00 25 F3 00 14 00 25 F3 04 15 00 25 F3 08 16 00 25 F3 0C 07 00 23 8F 00 08 00 23 F3 00 09 00 23 F3 04 0A 00 23 F3 08 0B 00 23 8F 10 0C 00 23 8F 20 0E 00 23 8F 30 0D 00 23 8C 40 A6 00 23 8C 41 A7 00 23 8C 42 05 01 22 FD 02 06 01 22 FD 00 8C 00 22 FE 00 8D 00 22 FE 01 9B 00 25 3F 40 9C 00 25 3F 00 09 01 25 3F 80 A1 00 26 F3 00 A2 00 26 F3 08 A3 00 26 F3 04 9F 00 26 FD 02 A0 00 26 FD 00 9D 00 11 FB 04 9E 00 11 FB 00 54 01 23 7F 00 55 01 23 7F 80 5C 00 78 BF 40 5D 00 78 BF 00 04 80 78 F5 0A 01 A0 78 F5 00 93 00 7B 7F 80 94 00 7B 7F 00 8A 00 37 DF 20 8B 00 37 DF 00 03 C0 67 00 05 FF FF 00 00 00 Handle 0xD401, DMI type 212, 197 bytes. OEM-specific Type Header and Data: D4 C5 01 D4 70 00 71 00 03 40 59 6D 2D 00 59 FC 02 2E 00 59 FC 00 6E 00 59 FC 01 27 01 59 FC 03 28 00 59 3F 00 29 00 59 3F 40 2A 00 59 3F 80 2B 00 5A 00 00 2C 00 5B 00 00 55 00 59 F3 00 6D 00 59 F3 04 8E 00 59 F3 08 8F 00 59 F3 00 1C 00 55 FB 04 1D 00 55 FB 00 19 00 55 E7 00 1A 00 55 E7 08 1B 00 55 E7 10 23 00 55 7F 00 22 00 55 7F 80 F5 00 58 BF 40 F6 00 58 BF 00 EB 00 55 FE 00 EA 00 55 FE 01 01 01 51 3F 00 02 01 51 3F 40 03 01 51 3F 80 04 01 51 3F C0 40 01 54 EF 00 41 01 54 EF 10 42 01 54 F7 00 43 01 54 F7 08 4A 01 54 FB 00 4B 01 54 FB 04 68 01 56 BF 00 69 01 56 BF 40 FF FF 00 00 00 Handle 0xD402, DMI type 212, 117 bytes. OEM-specific Type Header and Data: D4 75 02 D4 70 00 71 00 00 10 2D 2E 2D 01 21 FE 01 2E 01 21 FE 00 2F 01 21 7F 00 30 01 21 7F 80 97 00 22 FB 00 98 00 22 FB 04 90 00 11 CF 00 91 00 11 CF 20 92 00 11 CF 10 E2 00 27 7F 00 E3 00 27 7F 80 E4 00 27 BF 00 E5 00 27 BF 40 D1 00 22 7F 80 D2 00 22 7F 00 3E 01 22 BF 40 3F 01 22 BF 00 36 01 21 F1 02 2B 01 11 7F 80 2C 01 11 7F 00 FF FF 00 00 00 Handle 0xD403, DMI type 212, 97 bytes. OEM-specific Type Header and Data: D4 61 03 D4 70 00 71 00 03 40 59 6D 17 01 52 FE 00 18 01 52 FE 01 19 01 52 FB 00 1A 01 52 FB 04 1B 01 52 FD 00 1C 01 52 FD 02 1D 01 52 F7 00 1E 01 52 F7 08 09 40 52 EF 00 08 40 52 EF 10 0B 40 52 DF 00 0A 40 52 DF 20 0D 40 52 BF 00 0C 40 52 BF 40 0F 40 52 7F 00 0E 40 52 7F 80 FF FF 00 00 00 Handle 0xD800, DMI type 216, 9 bytes. OEM-specific Type Header and Data: D8 09 00 D8 01 02 01 F0 03 Strings: Intel(r)Lakeport-G PCI Accelerated SVGA BIOS 1215 PC Dev 03/11/2005 13:36:49 Handle 0xDD00, DMI type 221, 19 bytes. OEM-specific Type Header and Data: DD 13 00 DD 00 01 00 00 00 10 F5 00 00 00 00 00 00 00 00 Handle 0xDD01, DMI type 221, 19 bytes. OEM-specific Type Header and Data: DD 13 01 DD 00 01 00 00 00 11 F5 00 00 00 00 00 00 00 00 Handle 0xDD02, DMI type 221, 19 bytes. OEM-specific Type Header and Data: DD 13 02 DD 00 01 00 00 00 12 F5 00 00 00 00 00 00 00 00 Handle 0xDE00, DMI type 222, 13 bytes. OEM-specific Type Header and Data: DE 0D 00 DE C1 01 FF FF 00 00 00 00 00 Handle 0x7F00, DMI type 127, 4 bytes. End Of Table Parse-DMIDecode-0.03/t/11pod_coverage.t0000444000076400007640000000043410574775526017353 0ustar nicolawnicolaw# $Id: 11pod_coverage.t 976 2007-03-04 20:47:36Z nicolaw $ use Test::More; eval "use Test::Pod::Coverage 1.00"; plan skip_all => "Test::Pod::Coverage 1.00 required for testing POD Coverage" if $@; all_pod_coverage_ok({ also_private => [ qr/^[A-Z_]+$/ ], }); #Ignore all caps 1; Parse-DMIDecode-0.03/t/40regression_test.t0000444000076400007640000000274710574775526020150 0ustar nicolawnicolaw# $Id: 40regression_test.t 976 2007-03-04 20:47:36Z nicolaw $ chdir('t') if -d 't'; use strict; use warnings; use Test::More; use lib qw(./lib ../lib); use Parse::DMIDecode qw(); my @files = glob('testdata/*'); plan tests => (scalar(@files)*21) + 1; my $dmi; ok($dmi = Parse::DMIDecode->new(nowarnings => 1),'new'); for my $file (@files) { ok($dmi->parse(slurp($file)),$file); ok($dmi->smbios_version >= 2.0,"$file \$dmi->smbios_version"); #ok($dmi->dmidecode_version >= 2.0,"$file \$dmi->dmidecode_version"); ok($dmi->table_location,"$file \$dmi->table_location"); my @handle_addresses = $dmi->handle_addresses; my @uniq_handle_addresses = uniq(@handle_addresses); ok(scalar(@handle_addresses) >= $dmi->structures,"$file \$dmi->handle_addresses >= \$dmi->handle_structures"); ok(scalar(@uniq_handle_addresses) == $dmi->structures,"$file unique handle address == \$dmi->handle_structures"); for my $dmitype (qw(0 1 2 3)) { my @handles; ok( @handles = $dmi->get_handles( dmitype => $dmitype ), "$file \$dmi->get_handles(dmitype => $dmitype)" ); ok($handles[0]->dmitype == $dmitype,"$file \$handle->dmitype"); ok($handles[0]->bytes =~ /^\d+$/,"$file \$handle->bytes"); ok($handles[0]->description =~ /^\S.{4,64}$/,"$file \$handle->description"); } } sub uniq { my %uniq; $uniq{$_} = undef for @_; return sort keys %uniq; } sub slurp { my $file = shift; my $data = ''; if (open(FH,'<',$file)) { local $/ = undef; $data = ; close(FH); } return $data; } 1; Parse-DMIDecode-0.03/t/dmidecode_example4.txt0000444000076400007640000005216210574775526020651 0ustar nicolawnicolaw# dmidecode 2.6 SMBIOS 2.3 present. 83 structures occupying 3076 bytes. Table at 0x000FB030. Handle 0xDA00 DMI type 218, 11 bytes. OEM-specific Type Header and Data: DA 0B 00 DA B2 00 17 03 08 28 00 Handle 0xDA01 DMI type 218, 251 bytes. OEM-specific Type Header and Data: DA FB 01 DA B2 00 17 03 08 28 00 00 80 00 80 01 00 00 A0 00 A0 01 00 05 80 05 80 01 00 2B F0 2B F0 00 00 43 F0 43 F0 00 00 4B F0 4B F0 00 00 08 FA 08 FA 00 00 2C F0 2C F0 00 00 44 F0 44 F0 00 00 4C F0 4C F0 00 00 10 FA 10 FA 00 00 2D F0 2D F0 00 00 45 F0 45 F0 00 00 4D F0 4D F0 00 00 20 FA 20 FA 00 00 2E F0 2E F0 00 00 46 F0 46 F0 00 00 4E F0 4E F0 00 00 40 FA 40 FA 00 00 30 F0 30 F0 00 00 50 F0 50 F0 00 00 58 F0 58 F0 00 00 01 FB 01 FB 00 00 31 F0 31 F0 00 00 51 F0 51 F0 00 00 59 F0 59 F0 00 00 02 FB 02 FB 00 00 32 F0 32 F0 00 00 52 F0 52 F0 00 00 5A F0 5A F0 00 00 04 FB 04 FB 00 00 33 F0 33 F0 00 00 53 F0 53 F0 00 00 5B F0 5B F0 00 00 08 FB 08 FB 00 00 34 F0 34 F0 00 00 54 F0 54 F0 00 00 5C F0 5C F0 00 00 10 FB 10 FB 00 00 FF FF 00 00 00 00 Handle 0xDA02 DMI type 218, 191 bytes. OEM-specific Type Header and Data: DA BF 02 DA B2 00 17 03 08 28 00 35 F0 35 F0 00 00 55 F0 55 F0 00 00 5D F0 5D F0 00 00 20 FB 20 FB 00 00 36 F0 36 F0 00 00 56 F0 56 F0 00 00 5E F0 5E F0 00 00 40 FB 40 FB 00 00 38 F0 38 F0 00 00 60 F0 60 F0 00 00 01 FC 01 FC 00 00 39 F0 39 F0 00 00 61 F0 61 F0 00 00 02 FC 02 FC 00 00 3A F0 3A F0 00 00 62 F0 62 F0 00 00 04 FC 04 FC 00 00 1F F0 1F F0 00 00 68 F0 68 F0 00 00 69 F0 69 F0 00 00 01 FD 01 FD 00 00 28 F0 28 F0 00 00 40 F0 40 F0 00 00 48 F0 48 F0 00 00 01 FA 01 FA 00 00 2A F0 2A F0 00 00 42 F0 42 F0 00 00 4A F0 4A F0 00 00 04 FA 04 FA 00 00 FF FF 00 00 00 00 Handle 0x0000 DMI type 0, 20 bytes. BIOS Information Vendor: Dell Computer Corporation Version: A03 Release Date: 10/22/2004 Address: 0xF0000 Runtime Size: 64 kB ROM Size: 1024 kB Characteristics: ISA is supported PCI is supported PNP is supported BIOS is upgradeable BIOS shadowing is allowed ESCD support is available Boot from CD is supported Selectable boot is supported EDD is supported Japanese floppy for Toshiba 1.2 MB is supported (int 13h) 5.25"/360 KB floppy services are supported (int 13h) 5.25"/1.2 MB floppy services are supported (int 13h) 3.5"/720 KB floppy services are supported (int 13h) 8042 keyboard services are supported (int 9h) Serial services are supported (int 14h) CGA/mono video services are supported (int 10h) ACPI is supported USB legacy is supported BIOS boot specification is supported Function key-initiated network boot is supported Handle 0x0100 DMI type 1, 25 bytes. System Information Manufacturer: Dell Computer Corporation Product Name: PowerEdge 750 Version: Not Specified Serial Number: GG4WF1J UUID: 44454C4C-4700-1034-8057-C7C04F46314A Wake-up Type: Power Switch Handle 0x0200 DMI type 2, 9 bytes. Base Board Information Manufacturer: Dell Computer Corporation Product Name: 0R1479 Version: A00 Serial Number: ..CN717034B30282. Handle 0x0300 DMI type 3, 17 bytes. Chassis Information Manufacturer: Dell Computer Corporation Type: Rack Mount Chassis Lock: Present Version: Not Specified Serial Number: GG4WF1J Asset Tag: Not Specified Boot-up State: Safe Power Supply State: Safe Thermal State: Safe Security Status: Unknown OEM Information: 0x00000000 Handle 0x0400 DMI type 4, 35 bytes. Processor Information Socket Designation: PROC1 Type: Central Processor Family: Pentium 4 Manufacturer: Intel ID: 34 0F 00 00 FF FB EB BF Signature: Type 0, Family 15, Model 3, Stepping 4 Flags: FPU (Floating-point unit on-chip) VME (Virtual mode extension) DE (Debugging extension) PSE (Page size extension) TSC (Time stamp counter) MSR (Model specific registers) PAE (Physical address extension) MCE (Machine check exception) CX8 (CMPXCHG8 instruction supported) APIC (On-chip APIC hardware supported) SEP (Fast system call) MTRR (Memory type range registers) PGE (Page global enable) MCA (Machine check architecture) CMOV (Conditional move instruction supported) PAT (Page attribute table) PSE-36 (36-bit page size extension) CLFSH (CLFLUSH instruction supported) DS (Debug store) ACPI (ACPI supported) MMX (MMX technology supported) FXSR (Fast floating-point save and restore) SSE (Streaming SIMD extensions) SSE2 (Streaming SIMD extensions 2) SS (Self-snoop) HTT (Hyper-threading technology) TM (Thermal monitor supported) PBE (Pending break enabled) Version: Not Specified Voltage: 1.5 V External Clock: 800 MHz Max Speed: 4000 MHz Current Speed: 2800 MHz Status: Populated, Enabled Upgrade: ZIF Socket L1 Cache Handle: 0x0700 L2 Cache Handle: 0x0701 L3 Cache Handle: 0x0702 Serial Number: Not Specified Asset Tag: Not Specified Part Number: Not Specified Handle 0x0700 DMI type 7, 19 bytes. Cache Information Socket Designation: Not Specified Configuration: Enabled, Not Socketed, Level 1 Operational Mode: Write Back Location: Internal Installed Size: 16 KB Maximum Size: 16 KB Supported SRAM Types: Unknown Installed SRAM Type: Unknown Speed: Unknown Error Correction Type: Single-bit ECC System Type: Data Associativity: 8-way Set-associative Handle 0x0701 DMI type 7, 19 bytes. Cache Information Socket Designation: Not Specified Configuration: Enabled, Not Socketed, Level 2 Operational Mode: Varies With Memory Address Location: Internal Installed Size: 1024 KB Maximum Size: 1024 KB Supported SRAM Types: Unknown Installed SRAM Type: Unknown Speed: Unknown Error Correction Type: Single-bit ECC System Type: Unified Associativity: 8-way Set-associative Handle 0x0702 DMI type 7, 19 bytes. Cache Information Socket Designation: Not Specified Configuration: Enabled, Not Socketed, Level 3 Operational Mode: Varies With Memory Address Location: Internal Installed Size: 0 KB Maximum Size: 4096 KB Supported SRAM Types: Unknown Installed SRAM Type: Unknown Speed: Unknown Error Correction Type: Single-bit ECC System Type: Unified Associativity: 8-way Set-associative Handle 0x0800 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: DB-9 male Port Type: Serial Port 16550A Compatible Handle 0x0801 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: PS/2 Port Type: Keyboard Port Handle 0x0802 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: Mini DIN Port Type: Mouse Port Handle 0x0803 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: Access Bus (USB) Port Type: USB Handle 0x0804 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: Access Bus (USB) Port Type: USB Handle 0x0805 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: Access Bus (USB) Port Type: USB Handle 0x0806 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: RJ-45 Port Type: Network Port Handle 0x0807 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: RJ-45 Port Type: Network Port Handle 0x0808 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: DB-15 female Port Type: Video Port Handle 0x0809 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: DB-15 female Port Type: Video Port Handle 0x0900 DMI type 9, 13 bytes. System Slot Information Designation: PCI_1 Type: 32-bit PCI Current Usage: Available Length: Short ID: 1 Characteristics: 5.0 V is provided PME signal is supported Handle 0x0901 DMI type 9, 13 bytes. System Slot Information Designation: PCI_2 Type: 64-bit PCI-X Current Usage: Available Length: Long ID: 2 Characteristics: 3.3 V is provided PME signal is supported Handle 0x0A00 DMI type 10, 10 bytes. On Board Device 1 Information Type: Video Status: Enabled Description: ATI Rage XL PCI Video On Board Device 2 Information Type: Ethernet Status: Enabled Description: Intel i82547EI Gigabit Ethernet On Board Device 3 Information Type: Ethernet Status: Enabled Description: Intel i82541EI Gigabit Ethernet Handle 0x0B00 DMI type 11, 5 bytes. OEM Strings String 1: Dell System String 2: 5[0000] Handle 0x0C00 DMI type 12, 5 bytes. System Configuration Options Option 1: NVRAM_CLR: Clear user settable NVRAM areas and set defaults Option 2: PASSWD: Close to enable password Handle 0x0D00 DMI type 13, 22 bytes. BIOS Language Information Installable Languages: 1 en|US|iso8859-1 Currently Installed Language: en|US|iso8859-1 Handle 0x1000 DMI type 16, 15 bytes. Physical Memory Array Location: System Board Or Motherboard Use: System Memory Error Correction Type: Multi-bit ECC Maximum Capacity: 4 GB Error Information Handle: Not Provided Number Of Devices: 4 Handle 0x1100 DMI type 17, 23 bytes. Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: 256 MB Form Factor: DIMM Set: 1 Locator: DIMM1_A Bank Locator: Not Specified Type: DDR Type Detail: Synchronous Speed: 400 MHz (2.5 ns) Handle 0x1102 DMI type 17, 23 bytes. Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: No Module Installed Form Factor: DIMM Set: 2 Locator: DIMM2_A Bank Locator: Not Specified Type: DDR Type Detail: Synchronous Speed: 400 MHz (2.5 ns) Handle 0x1101 DMI type 17, 23 bytes. Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: 256 MB Form Factor: DIMM Set: 1 Locator: DIMM1_B Bank Locator: Not Specified Type: DDR Type Detail: Synchronous Speed: 400 MHz (2.5 ns) Handle 0x1103 DMI type 17, 23 bytes. Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: No Module Installed Form Factor: DIMM Set: 2 Locator: DIMM2_B Bank Locator: Not Specified Type: DDR Type Detail: Synchronous Speed: 400 MHz (2.5 ns) Handle 0x1300 DMI type 19, 15 bytes. Memory Array Mapped Address Starting Address: 0x00000000000 Ending Address: 0x0001FFFFFFF Range Size: 512 MB Physical Array Handle: 0x1000 Partition Width: 0 Handle 0x1400 DMI type 20, 19 bytes. Memory Device Mapped Address Starting Address: 0x00000000000 Ending Address: 0x0001FFFFFFF Range Size: 512 MB Physical Device Handle: 0x1100 Memory Array Mapped Address Handle: 0x1300 Partition Row Position: 1 Handle 0x1401 DMI type 20, 19 bytes. Memory Device Mapped Address Starting Address: 0x00000000000 Ending Address: 0x0001FFFFFFF Range Size: 512 MB Physical Device Handle: 0x1101 Memory Array Mapped Address Handle: 0x1300 Partition Row Position: 2 Handle 0x1402 DMI type 126, 19 bytes. Inactive Handle 0x1403 DMI type 126, 19 bytes. Inactive Handle 0x1404 DMI type 126, 19 bytes. Inactive Handle 0x1405 DMI type 126, 19 bytes. Inactive Handle 0x1A00 DMI type 26, 20 bytes. Voltage Probe Description: 2.5V Voltage Location: Motherboard Status: OK Maximum Value: 3.000 V Minimum Value: 0.000 V Resolution: 11.7 mV Tolerance: Unknown Accuracy: 1.00% OEM-specific Information: 0x0000DC05 Handle 0x1A01 DMI type 26, 20 bytes. Voltage Probe Description: Core Voltage Location: Processor Module Status: OK Maximum Value: 3.000 V Minimum Value: 0.000 V Resolution: 11.7 mV Tolerance: Unknown Accuracy: 1.00% OEM-specific Information: 0x0000DC02 Handle 0x1A02 DMI type 26, 20 bytes. Voltage Probe Description: 3.3V Voltage Location: Motherboard Status: OK Maximum Value: 4.440 V Minimum Value: 0.000 V Resolution: 17.3 mV Tolerance: Unknown Accuracy: 1.00% OEM-specific Information: 0x0000DC00 Handle 0x1A03 DMI type 26, 20 bytes. Voltage Probe Description: 5V Voltage Location: Motherboard Status: OK Maximum Value: 6.660 V Minimum Value: 0.000 V Resolution: 26.0 mV Tolerance: Unknown Accuracy: 2.00% OEM-specific Information: 0x0000DC01 Handle 0x1A04 DMI type 26, 20 bytes. Voltage Probe Description: 12V Voltage Location: Motherboard Status: OK Maximum Value: 16.000 V Minimum Value: 0.000 V Resolution: 62.5 mV Tolerance: Unknown Accuracy: 2.00% OEM-specific Information: 0x0000DC03 Handle 0x1A05 DMI type 26, 20 bytes. Voltage Probe Description: 1.25V Voltage Location: Processor Module Status: OK Maximum Value: 3.000 V Minimum Value: 0.000 V Resolution: 11.7 mV Tolerance: Unknown Accuracy: 3.00% OEM-specific Information: 0x0000DC04 Handle 0x1A06 DMI type 26, 20 bytes. Voltage Probe Description: IMB Voltage Location: Motherboard Status: OK Maximum Value: 3.000 V Minimum Value: 0.000 V Resolution: 11.7 mV Tolerance: Unknown Accuracy: 1.00% OEM-specific Information: 0x0000DC07 Handle 0x1A07 DMI type 26, 20 bytes. Voltage Probe Description: VGA 2.5V Voltage Location: Motherboard Status: OK Maximum Value: 3.000 V Minimum Value: 0.000 V Resolution: 11.7 mV Tolerance: Unknown Accuracy: 3.00% OEM-specific Information: 0x0000DC08 Handle 0x1A08 DMI type 26, 20 bytes. Voltage Probe Description: 5V Standby Voltage Location: Motherboard Status: OK Maximum Value: 6.000 V Minimum Value: 0.000 V Resolution: 23.5 mV Tolerance: Unknown Accuracy: 3.00% OEM-specific Information: 0x0000DC09 Handle 0x1A09 DMI type 26, 20 bytes. Voltage Probe Description: 2.5V LAN Voltage Location: Motherboard Status: OK Maximum Value: 3.000 V Minimum Value: 0.000 V Resolution: 11.7 mV Tolerance: Unknown Accuracy: 3.00% OEM-specific Information: 0x0000DC0A Handle 0x1A0A DMI type 26, 20 bytes. Voltage Probe Description: 1.2V LAN Voltage Location: Motherboard Status: OK Maximum Value: 2.500 V Minimum Value: 0.000 V Resolution: 9.8 mV Tolerance: Unknown Accuracy: 3.00% OEM-specific Information: 0x0000DC0C Handle 0x1A0B DMI type 26, 20 bytes. Voltage Probe Description: 3.3V Standby Voltage Location: Motherboard Status: OK Maximum Value: 4.440 V Minimum Value: 0.000 V Resolution: 17.3 mV Tolerance: Unknown Accuracy: 1.00% OEM-specific Information: 0x0000DC0D Handle 0x1B00 DMI type 27, 12 bytes. Cooling Device Type: Fan Status: OK OEM-specific Information: 0x0000DD00 Handle 0x1B01 DMI type 27, 12 bytes. Cooling Device Type: Fan Status: OK OEM-specific Information: 0x0000DD01 Handle 0x1B02 DMI type 27, 12 bytes. Cooling Device Type: Fan Status: OK OEM-specific Information: 0x0000DD02 Handle 0x1C00 DMI type 28, 20 bytes. Temperature Probe Description: Internal Ambient Temperature Location: Motherboard Status: OK Maximum Value: 65.0 deg C Minimum Value 5.0 deg C Resolution: 1.000 deg C Tolerance: Unknown Accuracy: Unknown OEM-specific Information: 0x0000DC06 Handle 0x1C01 DMI type 28, 20 bytes. Temperature Probe Description: CPU1 Internal Temperature Location: Processor Module Status: OK Maximum Value: 80.0 deg C Minimum Value 5.0 deg C Resolution: 1.000 deg C Tolerance: Unknown Accuracy: Unknown OEM-specific Information: 0x0000DC0B Handle 0x2000 DMI type 32, 11 bytes. System Boot Information Status: No errors detected Handle 0x2600 DMI type 126, 18 bytes. Inactive Handle 0xD000 DMI type 208, 10 bytes. OEM-specific Type Header and Data: D0 0A 00 D0 01 04 FE 00 65 01 Handle 0xD200 DMI type 210, 12 bytes. OEM-specific Type Header and Data: D2 0C 00 D2 F8 03 04 03 06 80 04 05 Handle 0xD400 DMI type 212, 107 bytes. OEM-specific Type Header and Data: D4 6B 00 D4 70 00 71 00 00 10 2D 2E 03 00 11 7F 80 04 00 11 7F 00 0F 00 25 FC 00 10 00 25 FC 01 11 00 25 FC 02 12 00 25 FC 03 42 00 11 FE 01 43 00 11 FE 00 9F 00 26 FE 01 A0 00 26 FE 00 9D 00 11 FD 02 9E 00 11 FD 00 51 00 26 3F 00 52 00 26 3F 40 53 00 26 3F 80 54 00 26 3F C0 28 40 26 DF 20 29 40 26 DF 00 FF FF 00 00 00 Handle 0xD401 DMI type 212, 242 bytes. OEM-specific Type Header and Data: D4 F2 01 D4 70 00 71 00 03 40 5B 6D 5C 00 78 BF 40 5D 00 78 BF 00 19 00 55 E7 00 1A 00 55 E7 08 1B 00 55 E7 10 FF 00 55 9F 40 FE 00 55 9F 20 FD 00 55 9F 00 1E 00 55 FD 00 50 00 55 FD 02 8A 00 55 FE 01 8B 00 55 FE 00 08 40 51 FE 01 09 40 51 FE 00 00 00 51 FD 02 00 00 51 FD 00 0C 40 51 FB 04 0D 40 51 FB 00 0E 40 51 F7 08 0F 40 51 F7 00 00 00 55 FB 04 00 00 55 FB 00 BF 00 5B FC 00 C0 00 5B FC 01 00 00 5B FC 02 1A 40 5B FB 04 1B 40 5B FB 00 1C 40 5B F7 08 1D 40 5B F7 00 6E 00 58 FC 01 2D 00 58 FC 02 2E 00 58 FC 00 22 40 58 EF 10 23 40 58 EF 00 BB 00 58 F3 04 BC 00 58 F3 08 BA 00 58 F3 00 D8 00 55 7F 80 D9 00 55 7F 00 00 C0 5C 00 0A 03 C0 67 00 05 83 00 76 00 00 84 00 77 00 00 90 00 7F 3F 00 92 00 7F 3F 40 FF FF 00 00 00 Handle 0xD402 DMI type 212, 92 bytes. OEM-specific Type Header and Data: D4 5C 02 D4 72 00 73 00 00 40 5D 5E C1 00 40 FE 00 C2 00 40 FE 01 C3 00 40 FD 02 C4 00 40 FD 00 28 01 49 FC 00 29 01 49 FC 01 2A 01 49 FC 02 D1 00 7E FE 00 D2 00 7E FE 01 D3 00 00 00 02 DE 00 76 FE 01 A3 00 48 FC 01 A2 00 48 FC 00 26 40 77 FE 01 27 40 77 FE 00 FF FF 00 00 00 Handle 0xD800 DMI type 216, 9 bytes. OEM-specific Type Header and Data: D8 09 00 D8 01 02 01 00 00 Strings: ATI Rage XL V4.333 Handle 0xDC00 DMI type 220, 22 bytes. OEM-specific Type Header and Data: DC 16 00 DC 2B F0 00 00 08 FA 00 00 00 00 43 F0 4B F0 00 00 00 00 Handle 0xDC01 DMI type 220, 22 bytes. OEM-specific Type Header and Data: DC 16 01 DC 2C F0 00 00 10 FA 00 00 00 00 44 F0 4C F0 00 00 00 00 Handle 0xDC02 DMI type 220, 22 bytes. OEM-specific Type Header and Data: DC 16 02 DC 2D F0 00 00 20 FA 00 00 00 00 45 F0 4D F0 00 00 00 00 Handle 0xDC03 DMI type 220, 22 bytes. OEM-specific Type Header and Data: DC 16 03 DC 2E F0 00 00 40 FA 00 00 00 00 46 F0 4E F0 00 00 00 00 Handle 0xDC04 DMI type 220, 22 bytes. OEM-specific Type Header and Data: DC 16 04 DC 30 F0 00 00 01 FB 00 00 00 00 50 F0 58 F0 00 00 00 00 Handle 0xDC05 DMI type 220, 22 bytes. OEM-specific Type Header and Data: DC 16 05 DC 31 F0 00 00 02 FB 00 00 00 00 51 F0 59 F0 00 00 00 00 Handle 0xDC06 DMI type 220, 22 bytes. OEM-specific Type Header and Data: DC 16 06 DC 1F F0 00 00 01 FD 00 00 00 00 68 F0 69 F0 00 00 00 00 Handle 0xDC07 DMI type 220, 22 bytes. OEM-specific Type Header and Data: DC 16 07 DC 32 F0 00 00 04 FB 00 00 00 00 52 F0 5A F0 00 00 00 00 Handle 0xDC08 DMI type 220, 22 bytes. OEM-specific Type Header and Data: DC 16 08 DC 33 F0 00 00 08 FB 00 00 00 00 53 F0 5B F0 00 00 00 00 Handle 0xDC09 DMI type 220, 22 bytes. OEM-specific Type Header and Data: DC 16 09 DC 34 F0 00 00 10 FB 00 00 00 00 54 F0 5C F0 00 00 00 00 Handle 0xDC0A DMI type 220, 22 bytes. OEM-specific Type Header and Data: DC 16 0A DC 35 F0 00 00 20 FB 00 00 00 00 55 F0 5D F0 00 00 00 00 Handle 0xDD00 DMI type 221, 19 bytes. OEM-specific Type Header and Data: DD 13 00 DD 00 00 00 38 F0 01 FC 00 00 00 00 00 00 60 F0 Handle 0xDD01 DMI type 221, 19 bytes. OEM-specific Type Header and Data: DD 13 01 DD 00 00 00 39 F0 02 FC 00 00 00 00 00 00 61 F0 Handle 0xDD02 DMI type 221, 19 bytes. OEM-specific Type Header and Data: DD 13 02 DD 00 00 00 3A F0 03 FC 00 00 00 00 00 00 62 F0 Handle 0xDC0B DMI type 220, 22 bytes. OEM-specific Type Header and Data: DC 16 0B DC 28 F0 00 00 01 FA 00 00 00 00 40 F0 48 F0 00 00 00 00 Handle 0xDC0C DMI type 220, 22 bytes. OEM-specific Type Header and Data: DC 16 0C DC 36 F0 00 00 40 FB 00 00 00 00 56 F0 5E F0 00 00 00 00 Handle 0xDC0D DMI type 220, 22 bytes. OEM-specific Type Header and Data: DC 16 0D DC 2A F0 00 00 04 FA 00 00 00 00 42 F0 4A F0 00 00 00 00 Handle 0xDE00 DMI type 222, 13 bytes. OEM-specific Type Header and Data: DE 0D 00 DE 01 02 FF FF 00 00 00 00 00 Handle 0x7F00 DMI type 127, 4 bytes. End Of Table Parse-DMIDecode-0.03/t/dmidecode_example2.txt0000444000076400007640000002560110574775526020645 0ustar nicolawnicolaw# dmidecode 2.2 SMBIOS 2.3 present. 40 structures occupying 1195 bytes. Table at 0x000F3B10. Handle 0x0000 DMI type 0, 20 bytes. BIOS Information Vendor: Award Software, Inc. Version: ASUS A7N266-VM ACPI BIOS Rev 1005 Release Date: 11/19/2002 Address: 0xF0000 Runtime Size: 64 kB ROM Size: 256 kB Characteristics: PCI is supported PNP is supported BIOS is upgradeable BIOS shadowing is allowed ESCD support is available Boot from CD is supported Selectable boot is supported BIOS ROM is socketed EDD is supported 5.25"/360 KB floppy services are supported (int 13h) 5.25"/1.2 MB floppy services are supported (int 13h) 3.5"/720 KB floppy services are supported (int 13h) 3.5"/2.88 MB floppy services are supported (int 13h) Print screen service is supported (int 5h) 8042 keyboard services are supported (int 9h) Serial services are supported (int 14h) Printer services are supported (int 17h) CGA/mono video services are supported (int 10h) ACPI is supported USB legacy is supported AGP is supported Handle 0x0001 DMI type 1, 25 bytes. System Information Manufacturer: System Manufacturer Product Name: System Name Version: System Version Serial Number: SYS-1234567890 UUID: Not Settable Wake-up Type: Power Switch Handle 0x0002 DMI type 2, 8 bytes. Base Board Information Manufacturer: ASUSTeK Computer INC. Product Name: A7N266VM Version: REV 1.xx Serial Number: xxxxxxxxxxx Handle 0x0003 DMI type 3, 17 bytes. Chassis Information Manufacturer: Chassis Manufacture Type: Tower Lock: Not Present Version: Chassis Version Serial Number: Chassis Serial Number Asset Tag: Asset-1234567890 Boot-up State: Safe Power Supply State: Safe Thermal State: Safe Security Status: Unknown OEM Information: 0x00000000 Handle 0x0004 DMI type 4, 32 bytes. Processor Information Socket Designation: SOCKET A Type: Central Processor Family: Other Manufacturer: AuthenticAMD ID: 81 06 00 00 FF FB 83 03 Version: AMD Athlon(TM) XP Processor Voltage: 1.6 V External Clock: 133 MHz Max Speed: 2000 MHz Current Speed: 2000 MHz Status: Populated, Enabled Upgrade: Other L1 Cache Handle: 0x0008 L2 Cache Handle: 0x0009 L3 Cache Handle: Not Provided Handle 0x0005 DMI type 5, 20 bytes. Memory Controller Information Error Detecting Method: 64-bit ECC Error Correcting Capabilities: None Supported Interleave: One-way Interleave Current Interleave: One-way Interleave Maximum Memory Module Size: 512 MB Maximum Total Memory Size: 1024 MB Supported Speeds: 70 ns 60 ns 50 ns Supported Memory Types: DIMM SDRAM Memory Module Voltage: 2.9 V Associated Memory Slots: 2 0x0006 0x0007 Enabled Error Correcting Capabilities: Unknown Handle 0x0006 DMI type 6, 12 bytes. Memory Module Information Socket Designation: DIMM 1 Bank Connections: 0 1 Current Speed: Unknown Type: DIMM SDRAM Installed Size: 512 MB (Single-bank Connection) Enabled Size: 512 MB (Single-bank Connection) Error Status: OK Handle 0x0007 DMI type 6, 12 bytes. Memory Module Information Socket Designation: DIMM 2 Bank Connections: 2 3 Current Speed: Unknown Type: DIMM SDRAM Installed Size: 512 MB (Double-bank Connection) Enabled Size: 512 MB (Double-bank Connection) Error Status: OK Handle 0x0008 DMI type 7, 19 bytes. Cache Information Socket Designation: L1 Cache Configuration: Enabled, Not Socketed, Level 1 Operational Mode: Write Back Location: Internal Installed Size: 128 KB Maximum Size: 128 KB Supported SRAM Types: Synchronous Installed SRAM Type: Synchronous Speed: Unknown Error Correction Type: Unknown System Type: Data Associativity: 4-way Set-associative Handle 0x0009 DMI type 7, 19 bytes. Cache Information Socket Designation: L2 Cache Configuration: Enabled, Not Socketed, Level 2 Operational Mode: Write Back Location: Internal Installed Size: 256 KB Maximum Size: 8192 KB Supported SRAM Types: Pipeline Burst Synchronous Installed SRAM Type: Pipeline Burst Synchronous Speed: Unknown Error Correction Type: Unknown System Type: Data Associativity: 4-way Set-associative Handle 0x000A DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: PRIMARY IDE/HDD Internal Connector Type: On Board IDE External Reference Designator: Not Specified External Connector Type: None Port Type: None Handle 0x000B DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: SECONDARY IDE/HDD Internal Connector Type: On Board IDE External Reference Designator: Not Specified External Connector Type: None Port Type: None Handle 0x000C DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: FLOPPY Internal Connector Type: On Board Floppy External Reference Designator: Not Specified External Connector Type: None Port Type: None Handle 0x000D DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: LAN-000C6E184642L External Connector Type: RJ-45 Port Type: Network Port Handle 0x000E DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: USB1 External Connector Type: Access Bus (USB) Port Type: USB Handle 0x000F DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: USB2 External Connector Type: Access Bus (USB) Port Type: USB Handle 0x0010 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: PS/2 Keyboard External Connector Type: PS/2 Port Type: Keyboard Port Handle 0x0011 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: PS/2 Mouse External Connector Type: PS/2 Port Type: Mouse Port Handle 0x0012 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Parallel Port External Connector Type: DB-25 female Port Type: Parallel Port ECP/EPP Handle 0x0013 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Serial Port 1 External Connector Type: DB-9 male Port Type: Serial Port 16550 Compatible Handle 0x0014 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Serial Port 2 External Connector Type: DB-9 male Port Type: Serial Port 16550 Compatible Handle 0x0015 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Joystick Port External Connector Type: DB-15 female Port Type: Joystick Port Handle 0x0016 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: MIDI Port External Connector Type: DB-15 female Port Type: MIDI Port Handle 0x0017 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Video Port External Connector Type: Mini Jack (headphones) Port Type: Video Port Handle 0x0018 DMI type 9, 13 bytes. System Slot Information Designation: PCI 1 Type: 32-bit PCI Current Usage: In Use Length: Short ID: 1 Characteristics: 5.0 V is provided 3.3 V is provided PME signal is supported Handle 0x0019 DMI type 9, 13 bytes. System Slot Information Designation: PCI 2 Type: 32-bit PCI Current Usage: Available Length: Short ID: 2 Characteristics: 5.0 V is provided 3.3 V is provided PME signal is supported Handle 0x001A DMI type 9, 13 bytes. System Slot Information Designation: PCI 3 Type: 32-bit PCI Current Usage: Available Length: Short ID: 3 Characteristics: 5.0 V is provided 3.3 V is provided PME signal is supported Handle 0x001B DMI type 9, 13 bytes. System Slot Information Designation: AGP Type: 32-bit AGP 4x Current Usage: Available Length: Short ID: 4 Characteristics: 3.3 V is provided PME signal is supported Handle 0x001C DMI type 11, 5 bytes. OEM Strings String 1: 0 String 2: 0 Handle 0x001D DMI type 13, 22 bytes. BIOS Language Information Installable Languages: 1 en|US|iso8859-1 Currently Installed Language: en|US|iso8859-1 Handle 0x001E DMI type 14, 14 bytes. Group Associations Name: Cpu Module Items: 3 0x0004 (Processor) 0x0008 (Cache) 0x0009 (Cache) Handle 0x001F DMI type 14, 23 bytes. Group Associations Name: Memory Module Set Items: 6 0x0020 (Physical Memory Array) 0x0021 (Memory Device) 0x0024 (Memory Device Mapped Address) 0x0022 (Memory Device) 0x0025 (Memory Device Mapped Address) 0x0023 (Memory Array Mapped Address) Handle 0x0020 DMI type 16, 15 bytes. Physical Memory Array Location: System Board Or Motherboard Use: System Memory Error Correction Type: None Maximum Capacity: 512 MB Error Information Handle: Not Provided Number Of Devices: 2 Handle 0x0021 DMI type 17, 23 bytes. Memory Device Array Handle: 0x0020 Error Information Handle: No Error Total Width: 72 bits Data Width: 64 bits Size: 512 MB Form Factor: DIMM Set: 1 Locator: DIMM 1 Bank Locator: Not Specified Type: DRAM Type Detail: Synchronous Speed: Unknown Handle 0x0022 DMI type 17, 23 bytes. Memory Device Array Handle: 0x0020 Error Information Handle: No Error Total Width: 72 bits Data Width: 64 bits Size: 512 MB Form Factor: DIMM Set: 2 Locator: DIMM 2 Bank Locator: Not Specified Type: DRAM Type Detail: Synchronous Speed: Unknown Handle 0x0023 DMI type 19, 15 bytes. Memory Array Mapped Address Starting Address: 0x00000000000 Ending Address: 0x0003FFFFFFF Range Size: 1 GB Physical Array Handle: 0x0020 Partition Width: 0 Handle 0x0024 DMI type 20, 19 bytes. Memory Device Mapped Address Starting Address: 0x00000000000 Ending Address: 0x0001FFFFFFF Range Size: 512 MB Physical Device Handle: 0x0021 Memory Array Mapped Address Handle: 0x0023 Partition Row Position: 1 Handle 0x0025 DMI type 20, 19 bytes. Memory Device Mapped Address Starting Address: 0x00020000000 Ending Address: 0x0003FFFFFFF Range Size: 512 MB Physical Device Handle: 0x0022 Memory Array Mapped Address Handle: 0x0023 Partition Row Position: 2 Handle 0x0026 DMI type 32, 11 bytes. System Boot Information Status: No errors detected Handle 0x0027 DMI type 127, 4 bytes. End Of Table Parse-DMIDecode-0.03/t/20compile.t0000444000076400007640000000030410574775526016342 0ustar nicolawnicolaw# $Id: 20compile.t 976 2007-03-04 20:47:36Z nicolaw $ chdir('t') if -d 't'; use lib qw(./lib ../lib); use Test::More tests => 2; use_ok('Parse::DMIDecode'); require_ok('Parse::DMIDecode'); 1; Parse-DMIDecode-0.03/t/10pod.t0000444000076400007640000000027110574775526015476 0ustar nicolawnicolaw# $Id: 10pod.t 976 2007-03-04 20:47:36Z nicolaw $ use Test::More; eval "use Test::Pod 1.00"; plan skip_all => "Test::Pod 1.00 required for testing POD" if $@; all_pod_files_ok(); 1; Parse-DMIDecode-0.03/lib/0000777000076400007640000000000010574775526014677 5ustar nicolawnicolawParse-DMIDecode-0.03/lib/Parse/0000777000076400007640000000000010574775526015751 5ustar nicolawnicolawParse-DMIDecode-0.03/lib/Parse/DMIDecode.pm0000444000076400007640000002747710574775526020037 0ustar nicolawnicolaw############################################################ # # $Id: DMIDecode.pm 1004 2007-03-11 12:43:25Z nicolaw $ # Parse::DMIDecode - Interface to SMBIOS using dmidecode # # Copyright 2006,2007 Nicola Worthington # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ############################################################ package Parse::DMIDecode; # vim:ts=4:sw=4:tw=78 use strict; #use Scalar::Util qw(refaddr); use Parse::DMIDecode::Handle; use Parse::DMIDecode::Constants qw(@TYPES %GROUPS); use Carp qw(croak cluck carp); use vars qw($VERSION $DEBUG); $VERSION = '0.03' || sprintf('%d', q$Revision: 1004 $ =~ /(\d+)/g); $DEBUG ||= $ENV{DEBUG} ? 1 : 0; my $objstore = {}; # # Methods # sub new { ref(my $class = shift) && croak 'Class name required'; croak 'Odd number of elements passed when even was expected' if @_ % 2; my $self = bless \(my $dummy), $class; $objstore->{_refaddr($self)} = {@_}; my $stor = $objstore->{_refaddr($self)}; $stor->{commands} = [qw(dmidecode)]; my $validkeys = join('|','nowarnings',@{$stor->{commands}}); my @invalidkeys = grep(!/^$validkeys$/,grep($_ ne 'commands',keys %{$stor})); delete $stor->{$_} for @invalidkeys; cluck('Unrecognised parameters passed: '.join(', ',@invalidkeys)) if @invalidkeys && $^W; for my $command (@{$stor->{commands}}) { croak "Command $command '$stor->{$command}'; file not found" if defined $stor->{$command} && !-f $stor->{$command}; } DUMP('$self',$self); DUMP('$stor',$stor); return $self; } sub probe { my $self = shift; croak 'Not called as a method by parent object' unless ref $self && UNIVERSAL::isa($self, __PACKAGE__); my $stor = $objstore->{_refaddr($self)}; eval { if (!defined $stor->{dmidecode}) { require File::Which; for my $command (@{$stor->{commands}}) { $stor->{$command} = File::Which::which($command) if !defined $stor->{$command}; } } }; croak $@ if $@; my ($cmd) = $stor->{dmidecode} =~ /^([\/\.\_\-a-zA-Z0-9 ]+)$/; TRACE($cmd); croak "dmidecode command '$cmd' does not exist; bum!" if !-f $cmd; my $fh; local %ENV = %ENV; delete @ENV{qw(IFS CDPATH ENV BASH_ENV PATH)}; open($fh,'-|',$cmd) || croak "Unable to open file handle for command '$cmd': $!"; while (local $_ = <$fh>) { $stor->{raw} .= $_; } close($fh) || carp "Unable to close file handle for command '$cmd': $!"; return $self->parse($stor->{raw}); } sub parse { my $self = shift; croak 'Not called as a method by parent object' unless ref $self && UNIVERSAL::isa($self, __PACKAGE__); my $stor = $objstore->{_refaddr($self)}; my %data = (handles => []); my @lines; for (@_) { push @lines, split(/\n/,$_); } my $i = 0; for (; $i < @lines; $i++) { local $_ = $lines[$i]; if (/^Handle [0-9A-Fx]+/) { last; } elsif (/^SYSID present\.\s*/) { # No-op } elsif (/^# dmidecode ([\d\.]+)\s*$/) { $data{dmidecode} = $1; } elsif (/^(\d+) structures occupying (\d+) bytes?\.\s*$/) { $data{structures} = $1; $data{bytes} = $2; } elsif (/^DMI ([\d\.]+) present\.?\s*$/) { $data{dmi} = $1; } elsif (/^SMBIOS ([\d\.]+) present\.?\s*$/) { $data{smbios} = $1; } elsif (/^(?:DMI )?[Tt]able at ([0-9A-Fx]+)\.?\s*$/) { $data{location} = $1; } } for (qw(dmidecode structures bytes dmi smbios location)) { $data{$_} = undef if !exists $data{$_}; } my $raw_handle_data = ''; for (; $i < @lines; $i++) { if ($lines[$i] =~ /^Handle [0-9A-Fx]+/) { push @{$data{handles}}, Parse::DMIDecode::Handle->new( raw => $raw_handle_data, nowarnings => $stor->{nowarnings} ) if $raw_handle_data; $raw_handle_data = "$lines[$i]\n"; } else { $raw_handle_data .= "$lines[$i]\n"; } } push @{$data{handles}}, Parse::DMIDecode::Handle->new( raw => $raw_handle_data, nowarnings => $stor->{nowarnings} ) if $raw_handle_data; carp sprintf("Only parsed %d structures when %d were expected", scalar(@{$data{handles}}), $data{structures} ) if scalar(@{$data{handles}}) < $data{structures}; $stor->{parsed} = \%data; DUMP('$stor->{parsed}',$stor->{parsed}); return $stor->{parsed}->{structures}; } sub get_handles { my $self = shift; croak 'Not called as a method by parent object' unless ref $self && UNIVERSAL::isa($self, __PACKAGE__); croak 'Odd number of elements passed when even was expected' if @_ % 2; my %param = @_; my $stor = $objstore->{_refaddr($self)}; my @handles; my $getall = !keys(%param); for my $handle (@{$stor->{parsed}->{handles}}) { if ($getall || (defined $param{address} && $handle->address eq $param{address}) || (defined $param{dmitype} && $handle->dmitype == $param{dmitype}) || (defined $param{group} && defined $GROUPS{$param{group}} && grep($_ == $handle->dmitype,@{$GROUPS{$param{group}}})) ) { push @handles, $handle; } } return @handles; } sub structures { my $self = shift; croak 'Not called as a method by parent object' unless ref $self && UNIVERSAL::isa($self, __PACKAGE__); return $objstore->{_refaddr($self)}->{parsed}->{structures}; } sub table_location { my $self = shift; croak 'Not called as a method by parent object' unless ref $self && UNIVERSAL::isa($self, __PACKAGE__); return $objstore->{_refaddr($self)}->{parsed}->{location}; } sub smbios_version { my $self = shift; croak 'Not called as a method by parent object' unless ref $self && UNIVERSAL::isa($self, __PACKAGE__); return $objstore->{_refaddr($self)}->{parsed}->{smbios}; } sub dmidecode_version { my $self = shift; croak 'Not called as a method by parent object' unless ref $self && UNIVERSAL::isa($self, __PACKAGE__); return $objstore->{_refaddr($self)}->{parsed}->{dmidecode}; } sub handle_addresses { my $self = shift; croak 'Not called as a method by parent object' unless ref $self && UNIVERSAL::isa($self, __PACKAGE__); return map { $_->handle } @{$objstore->{_refaddr($self)}->{parsed}->{handles}}; } sub keywords { my $self = shift; croak 'Not called as a method by parent object' unless ref $self && UNIVERSAL::isa($self, __PACKAGE__); my %keywords; my $stor = $objstore->{_refaddr($self)}; for my $handle (@{$stor->{parsed}->{handles}}) { for my $keyword ($handle->keywords) { $keywords{$keyword} = 1; } } return sort(keys(%keywords)); } sub keyword { my $self = shift; croak 'Not called as a method by parent object' unless ref $self && UNIVERSAL::isa($self, __PACKAGE__); croak sprintf('%s elements passed when one was expected', (@_ > 1 ? 'Multiple' : 'No')) if @_ != 1; my $stor = $objstore->{_refaddr($self)}; for my $handle (@{$stor->{parsed}->{handles}}) { if (grep($_ eq $_[0],$handle->keywords)) { return $handle->keyword($_[0]); } } } no warnings 'redefine'; sub UNIVERSAL::a_sub_not_likely_to_be_here { ref($_[0]) } use warnings 'redefine'; sub _blessed ($) { local($@, $SIG{__DIE__}, $SIG{__WARN__}); return length(ref($_[0])) ? eval { $_[0]->a_sub_not_likely_to_be_here } : undef } sub _refaddr($) { my $pkg = ref($_[0]) or return undef; if (_blessed($_[0])) { bless $_[0], 'Scalar::Util::Fake'; } else { $pkg = undef; } "$_[0]" =~ /0x(\w+)/; my $i = do { local $^W; hex $1 }; bless $_[0], $pkg if defined $pkg; return $i; } sub DESTROY { my $self = shift; delete $objstore->{_refaddr($self)}; } sub TRACE { return unless $DEBUG; carp(shift()); } sub DUMP { return unless $DEBUG; eval { require Data::Dumper; local $Data::Dumper::Indent = 2; local $Data::Dumper::Terse = 1; carp(shift().': '.Data::Dumper::Dumper(shift())); } } 1; =pod =head1 NAME Parse::DMIDecode - Interface to SMBIOS using dmidecode =head1 SYNOPSIS use strict; use Parse::DMIDecode (); my $decoder = new Parse::DMIDecode; $decoder->probe; # Actively probe using dmidecode # Manually supply your own dmidecode output to be parsed # $decoder->parse(qx(sudo /usr/sbin/dmidecode)); printf("System: %s, %s", $decoder->keyword("system-manufacturer"), $decoder->keyword("system-product-name"), ); =head1 DESCRIPTION This module provides an OO interface to SMBIOS information through the I command which is known to work under a number of Linux, BSD and BeOS variants. =head1 METHODS =head2 new my $decoder = Parse::DMIDecode->new( dmidecode => "/usr/sbin/dmidecode", nowarnings => 1, ); This is the constructor method to create a Parse::DMIDeocde object. It accepts two optional arguments; C and C. The C argument specifies the full path and filename of the I command that should used by the C method. The C argument instructs Parse::DMIDecode not to emit any parser warnings. =head2 probe $decoder->probe; This method executes an active probe to gather information using the I command. It does not accept any arguments. =head2 parse my $raw = qx(sudo /usr/sbin/dmidecode); $decoder->prase($raw); This method is a passive alternative to the C method. It accepts a single string argument which should contain output from the I command, which it will parse. =head2 keyword my $serial_number = $decoder->keyword("system-serial-number"); =head2 keywords my @keywords = $decoder->keywords; my @bios_keywords = $decoder->keywords("bios"); for my $keyword (@bios_keywords) { printf("%s => %s\n", $keyword, $decoder->keyword($keyword) ); } =head2 handle_addresses my @addresses = $decoder->handle_addresses; =head2 get_handles use Parse::DMIDecode::Constants qw(@TYPES); # Available groups to query: bios, system, baseboard, # chassis, processor, memory, cache, connector, slot for my $handle ($decoder->get_handles( group => "memory" )) { printf(">> Found handle at %s (%s):\n%s\n", $handle->address, $TYPES[$handle->dmitype], $handle->raw ); } See L for accessor method documentation for handle objects. =head2 smbios_version my $smbios_version = $decoder->smbios_version; Returns the SMBIOS version number. =head2 dmidecode_version my $dmidecode_version = $decoder->dmidecode_version; Returns the version number of the copy of I that was used to create the source data that was parsed. This value may not be available when using older versions of I. =head2 table_location my $memory_address = $decoder->table_location; =head2 structures my $total_structures = $decoder->structures; =head1 SEE ALSO L, L, L, examples/*.pl, L, L, L, L, L, L, L, L =head1 VERSION $Id: DMIDecode.pm 1004 2007-03-11 12:43:25Z nicolaw $ =head1 AUTHOR Nicola Worthington L If you like this software, why not show your appreciation by sending the author something nice from her L? ( http://www.amazon.co.uk/gp/registry/1VZXC59ESWYK0?sort=priority ) =head1 COPYRIGHT Copyright 2006,2007 Nicola Worthington. This software is licensed under The Apache Software License, Version 2.0. L =cut __END__ Parse-DMIDecode-0.03/lib/Parse/DMIDecode/0000777000076400007640000000000010574775526017466 5ustar nicolawnicolawParse-DMIDecode-0.03/lib/Parse/DMIDecode/Examples.pod0000444000076400007640000000354410574775526021750 0ustar nicolawnicolaw############################################################ # # $Id: Examples.pm 756 2006-08-24 22:30:54Z nicolaw $ # Parse::DMIDecode::Examples - Examples using Parse::DMIDecode::Examples # # Copyright 2007 Nicola Worthington # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ############################################################ # vim:ts=4:sw=4:tw=78 =pod =head1 NAME Parse::DMIDecode::Examples - Examples using Parse::DMIDecode::Examples =head1 EXAMPLES =head2 Example 1: Find the Number of Physical CPUs use strict; use Parse::DMIDecode qw(); my $dmi = Parse::DMIDecode->new( nowarnings => 1 ); $dmi->probe; my $physical_cpus = 0; for my $handle ($dmi->get_handles(group => "processor")) { my $type = ($handle->keyword("processor-type") or ""); next unless $type =~ /Central Processor/i; # Check the status of the cpu my $status = ($handle->keyword("processor-status") or ""); if ($status !~ /Unpopulated/i) { $physical_cpus++; } } printf("There %s %d physical %s in this machine.\n", ($physical_cpus == 1 ? "is" : "are"), $physical_cpus, ($physical_cpus == 1 ? "CPU" : "CPUs"), ); =head1 COPYRIGHT Copyright 2007 Nicola Worthington. This software is licensed under The Apache Software License, Version 2.0. L =cut Parse-DMIDecode-0.03/lib/Parse/DMIDecode/Handle.pm0000444000076400007640000002476010574775526021222 0ustar nicolawnicolaw############################################################ # # $Id: Handle.pm 976 2007-03-04 20:47:36Z nicolaw $ # Parse::DMIDecode::Handle - SMBIOS Structure Handle Object Class # # Copyright 2006 Nicola Worthington # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ############################################################ package Parse::DMIDecode::Handle; # vim:ts=4:sw=4:tw=78 use strict; use Parse::DMIDecode::Constants qw(@TYPES %GROUPS %TYPE2GROUP); #use Scalar::Util qw(refaddr); #use Storable qw(dclone); use Carp qw(croak cluck confess carp); use vars qw($VERSION $DEBUG); $VERSION = '0.03' || sprintf('%d', q$Revision: 976 $ =~ /(\d+)/g); $DEBUG ||= $ENV{DEBUG} ? 1 : 0; my $objstore = {}; # # Methods # sub new { ref(my $class = shift) && croak 'Class name required'; croak 'Odd number of elements passed when even was expected' if @_ % 2; my $stor = {@_}; my @validkeys = qw(raw nowarnings); my $validkeys = join('|',@validkeys); my @invalidkeys = grep(!/^$validkeys$/,keys %{$stor}); delete $stor->{$_} for @invalidkeys; cluck('Unrecognised parameters passed: '.join(', ',@invalidkeys)) if @invalidkeys && $^W; return unless defined defined $stor->{raw}; for (split(/\n/,$stor->{raw})) { if (/^Handle ([0-9A-Fx]+)(?:, DMI type (\d+), (\d+) bytes?\.?)?\s*$/) { $stor->{handle} = $1; $stor->{dmitype} = $2 if defined $2; $stor->{bytes} = $3 if defined $3; } elsif (defined $stor->{handle} && /^\s*DMI type (\d+), (\d+) bytes?\.?\s*$/) { $stor->{dmitype} = $1 if defined $1; $stor->{bytes} = $2 if defined $2; } else { $stor->{raw_entries} = [] unless defined $stor->{raw_entries}; push @{$stor->{raw_entries}}, $_; } } my ($data,$keywords) = _parse($stor) if $stor->{raw_entries}; my @objects; for my $name (keys(%{$data})) { my $self = bless \(my $dummy), $class; push @objects, $self; $objstore->{_refaddr($self)} = _deepcopy($stor); my $stor = $objstore->{_refaddr($self)}; $stor->{description} = substr($name,4); $stor->{data} = $data->{$name} || {}; $stor->{keywords} = $keywords->{$name} || {}; DUMP('$self',$self); DUMP('$stor',$stor); } DUMP('\@objects',\@objects); return @objects; } no warnings 'redefine'; sub UNIVERSAL::a_sub_not_likely_to_be_here { ref($_[0]) } use warnings 'redefine'; sub _blessed ($) { local($@, $SIG{__DIE__}, $SIG{__WARN__}); return length(ref($_[0])) ? eval { $_[0]->a_sub_not_likely_to_be_here } : undef } sub _refaddr($) { my $pkg = ref($_[0]) or return undef; if (_blessed($_[0])) { bless $_[0], 'Scalar::Util::Fake'; } else { $pkg = undef; } "$_[0]" =~ /0x(\w+)/; my $i = do { local $^W; hex $1 }; bless $_[0], $pkg if defined $pkg; return $i; } sub _deepcopy{ my $this = shift; if (!ref($this)) { $this; } elsif (ref($this) eq 'ARRAY') { [ map _deepcopy($_), @{$this} ]; } elsif (ref($this) eq 'HASH'){ scalar { map { $_ => _deepcopy($this->{$_}) } keys %{$this} }; } else { confess "What type is $_?"; } } sub parsed_structures { my $self = shift; croak 'Not called as a method by parent object' unless ref $self && UNIVERSAL::isa($self, __PACKAGE__); return _deepcopy($objstore->{_refaddr($self)}->{data}); } sub keyword { my $self = shift; croak 'Not called as a method by parent object' unless ref $self && UNIVERSAL::isa($self, __PACKAGE__); croak sprintf('%s elements passed when one was expected', (@_ > 1 ? 'Multiple' : 'No')) if @_ != 1; return $objstore->{_refaddr($self)}->{keywords}->{$_[0]}; } sub keywords { my $self = shift; croak 'Not called as a method by parent object' unless ref $self && UNIVERSAL::isa($self, __PACKAGE__); return sort(keys(%{$objstore->{_refaddr($self)}->{keywords}})); } sub raw { my $self = shift; croak 'Not called as a method by parent object' unless ref $self && UNIVERSAL::isa($self, __PACKAGE__); return $objstore->{_refaddr($self)}->{raw}; } sub description { my $self = shift; croak 'Not called as a method by parent object' unless ref $self && UNIVERSAL::isa($self, __PACKAGE__); return $objstore->{_refaddr($self)}->{description}; } sub bytes { my $self = shift; croak 'Not called as a method by parent object' unless ref $self && UNIVERSAL::isa($self, __PACKAGE__); return $objstore->{_refaddr($self)}->{bytes}; } sub type { &dmitype; } sub dmitype { my $self = shift; croak 'Not called as a method by parent object' unless ref $self && UNIVERSAL::isa($self, __PACKAGE__); return $objstore->{_refaddr($self)}->{dmitype}; } sub address { &handle; } sub handle { my $self = shift; croak 'Not called as a method by parent object' unless ref $self && UNIVERSAL::isa($self, __PACKAGE__); return $objstore->{_refaddr($self)}->{handle}; } sub _parse { my $stor = shift; return unless defined $stor->{raw_entries}; my $name_indent = 0; my $key_indent = 0; my $name = ''; my $name_cnt = 0; my $key = ''; my $legacy_dmidecode_binary_data = 0; my @errors; my %data; my %keywords; # DUMP('$stor->{raw_entries}',$stor->{raw_entries}); for (my $l = 0; $l < @{$stor->{raw_entries}}; $l++) { local $_ = $stor->{raw_entries}->[$l]; my ($indent) = $_ =~ /^(\s+)/; $indent = '' unless defined $indent; $indent = length($indent); # Old version of dmidecode - we don't support this very well #Handle 0xD402 #| DMI type 212, 47 bytes. #70 00 71 00 03 40 59 6d d8 00 55 7f 80 d9 00 55 | p.q..@Ym..U....U #7f 00 00 c0 5c 00 0a 03 c0 67 00 05 83 00 76 00 | ....\....g....v. #00 84 00 77 00 00 ff ff 00 00 00 | ...w....... if ((!$name || $legacy_dmidecode_binary_data) && /^(([a-f0-9]{2} )+)\s*\t[[:print:]]{1,16}\s*$/) { my $data = $1; chop $data; $name ||= sprintf('%03d|%s',++$name_cnt,'OEM-specific Type'); $key = 'Header and Data'; $legacy_dmidecode_binary_data = 1; $data{$name}->{$key}->[1] = [] unless defined $data{$name}->{$key}->[1]; push @{$data{$name}->{$key}->[1]}, $data; next; } $name_indent = $indent if $l == 0; if ($l == 1) { if ($indent > $name_indent) { $key_indent = $indent; } else { push @errors, "Parser warning: key_indent ($indent) <= name_indent ($name_indent): $_"; } } # data if (/^\s{$name_indent}(\S+.*?)\s*$/) { $name = sprintf('%03d|%s',++$name_cnt,$1); $data{$name} = {}; $key = ''; } elsif ($name && /^\s{$key_indent}(\S.*?)(?::|:\s+(\S+.*?))?\s*$/) { $key = $1; $data{$name}->{$key}->[0] = $2; $data{$name}->{$key}->[1] = [] unless defined $data{$name}->{$key}->[1]; $keywords{$name}->{_keyword($stor,$key)} = $data{$name}->{$key}->[0] if defined $TYPE2GROUP{$stor->{dmitype}} } elsif ($name && $key && $indent > $key_indent && /^\s*(\S+.*?)\s*$/) { push @{$data{$name}->{$key}->[1]}, $1; $keywords{$name}->{_keyword($stor,$key)} = $data{$name}->{$key}->[1] if defined $TYPE2GROUP{$stor->{dmitype}};# && !defined $data{$name}->{$key}->[0]; # unknown } else { push @errors, "Parser warning: $_"; } } sub _keyword { my ($stor,$key) = @_; (my $keyword = $key) =~ s/[^a-z0-9]/-/gi; $keyword = lc("$TYPE2GROUP{$stor->{dmitype}}-$keyword"); return $keyword; } #if ($^W && @errors) { if (@errors && !$stor->{nowarnings}) { carp $_ for @errors; } return (\%data,\%keywords); } sub TRACE { return unless $DEBUG; carp(shift()); } sub DUMP { return unless $DEBUG; eval { require Data::Dumper; local $Data::Dumper::Indent = 2; local $Data::Dumper::Terse = 1; carp(shift().': '.Data::Dumper::Dumper(shift())); } } 1; =pod =head1 NAME Parse::DMIDecode::Handle - SMBIOS Structure Handle Object Class =head1 SYNOPSIS use Parse::DMIDecode qw(); my $decoder = new Parse::DMIDecode; $decoder->probe; for my $handle ($decoder->get_handles) { printf("Handle %s of type %s is %s bytes long (minus strings).\n". " > Contians the following keyword data entries:\n", $handle->handle, $handle->dmitype, $handle->bytes ); for my $keyword ($handle->keywords) { my $value = $handle->keyword($keyword); printf("Keyword \"%s\" => \"%s\"\n", $keyword, (ref($value) eq 'ARRAY' ? join(', ',@{$value}) : ($value||'')) ); } } =head1 DESCRIPTION =head1 METHODS =head2 new Create a new struture handle object. This is called by L's I (and indirectly by I) methods. =head2 raw my $raw_data = $handle->raw; Returns the raw data as generated by I that was parsed to create this handle object. =head2 bytes my $bytes = $handle->bytes; =head2 address my $address = $handle->address; Returns the address handle of the structure. =head2 handle Alias for address. =head2 dmitype my $dmitype = $handle->dmitype; =head2 type Alias for dmitype. =head2 description my $description = $handle->description; =head2 keywords my @keywords = $handle->keywords; Returns a list of keyword data pairs available for retreival from this handle object. =head2 keyword for my $keyword ($handle->keywords) { printf("Keyword \"%s\" => \"%s\"\n", $keyword, $handle->keyword($keyword) ); } =head2 parsed_structures use Data::Dumper; my $ref = $handle->parsed_structures; print Dumper($ref); Returns a copy of the parsed structures. This should be used with care as this is a cloned copy of the parsed data structures that the I object uses internally, and as such may change format in later releases without notice. =head1 SEE ALSO L =head1 VERSION $Id: Handle.pm 976 2007-03-04 20:47:36Z nicolaw $ =head1 AUTHOR Nicola Worthington L If you like this software, why not show your appreciation by sending the author something nice from her L? ( http://www.amazon.co.uk/gp/registry/1VZXC59ESWYK0?sort=priority ) =head1 COPYRIGHT Copyright 2006 Nicola Worthington. This software is licensed under The Apache Software License, Version 2.0. L =cut __END__ Parse-DMIDecode-0.03/lib/Parse/DMIDecode/Constants.pm0000444000076400007640000001075610574775526022003 0ustar nicolawnicolaw############################################################ # # $Id: Constants.pm 976 2007-03-04 20:47:36Z nicolaw $ # Parse::DMIDecode::Constants - SMBIOS Constants # # Copyright 2006 Nicola Worthington # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ############################################################ package Parse::DMIDecode::Constants; # vim:ts=4:sw=4:tw=78 use strict; require Exporter; use vars qw($VERSION $DEBUG @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS @TYPES %GROUPS %TYPE2GROUP); @ISA = qw(Exporter); @EXPORT = qw(); @EXPORT_OK = qw(@TYPES %GROUPS %TYPE2GROUP); %EXPORT_TAGS = (all => \@EXPORT_OK); $VERSION = '0.03' || sprintf('%d', q$Revision: 976 $ =~ /(\d+)/g); $DEBUG ||= $ENV{DEBUG} ? 1 : 0; @TYPES = ( # Description Index Group(s) 'BIOS', # 0 bios 'System', # 1 system 'Base Board', # 2 baseboard 'Chassis', # 3 chassis 'Processor', # 4 processor 'Memory Controller', # 5 memory 'Memory Module', # 6 memory 'Cache', # 7 cache 'Port Connector', # 8 connector 'System Slots', # 9 slot 'On Board Devices', # 10 baseboard 'OEM Strings', # 11 'System Configuration Options', # 12 system 'BIOS Language', # 13 bios 'Group Associations', # 14 'System Event Log', # 15 system 'Physical Memory Array', # 16 memory 'Memory Device', # 17 memory '32-bit Memory Error', # 18 'Memory Array Mapped Address', # 19 'Memory Device Mapped Address', # 20 'Built-in Pointing Device', # 21 'Portable Battery', # 22 'System Reset', # 23 system 'Hardware Security', # 24 'System Power Controls', # 25 'Voltage Probe', # 26 'Cooling Device', # 27 'Temperature Probe', # 28 'Electrical Current Probe', # 29 'Out-of-band Remote Access', # 30 'Boot Integrity Services', # 31 'System Boot', # 32 system '64-bit Memory Error', # 33 'Management Device', # 34 'Management Device Component', # 35 'Management Device Threshold Data', # 36 'Memory Channel', # 37 'IPMI Device', # 38 'Power Supply' # 39 ); %GROUPS = ( 'bios' => [ qw(0 13) ], 'system' => [ qw(1 12 15 23 32) ], 'baseboard' => [ qw(2 10) ], 'chassis' => [ qw(3) ], 'processor' => [ qw(4) ], 'memory' => [ qw(5 6 16 17) ], 'cache' => [ qw(7) ], 'connector' => [ qw(8) ], 'slot' => [ qw(9) ], ); %TYPE2GROUP = (); for my $group (keys %GROUPS) { for my $dmitype (@{$GROUPS{$group}}) { $TYPE2GROUP{$dmitype} = $group; } } 1; =pod =head1 NAME Parse::DMIDecode::Constants - SMBIOS Constants =head1 SYNOPSIS use strict; use Parse::DMIDecode::Constants qw(@TYPES %GROUPS); =head1 DESCRIPTION This module provides and can export constants relating to the SMBIOS specification and dmidecode interface command. =head1 EXPORTS =head2 @TYPES =head2 %GROUPS =head1 SEE ALSO L =head1 VERSION $Id: Constants.pm 976 2007-03-04 20:47:36Z nicolaw $ =head1 AUTHOR Nicola Worthington L If you like this software, why not show your appreciation by sending the author something nice from her L? ( http://www.amazon.co.uk/gp/registry/1VZXC59ESWYK0?sort=priority ) =head1 COPYRIGHT Copyright 2006 Nicola Worthington. This software is licensed under The Apache Software License, Version 2.0. L =cut __END__