├── .gitignore ├── .travis.yml ├── COPYING ├── COPYING-GPL ├── COPYING-OSL ├── Makefile-std ├── Makefile.am ├── README.md ├── autogen.sh ├── configure.ac ├── doc ├── DellToken.txt ├── coding │ ├── Header-Rules.txt │ ├── api_abi_status.txt │ ├── coding-style.txt │ ├── compilation-linux.txt │ ├── compilation-windows.txt │ ├── compilation.txt │ ├── index.txt │ ├── patching.txt │ └── unit_test.txt ├── dell_drivers.txt ├── design │ ├── cmos.txt │ ├── factory.txt │ ├── index.txt │ ├── item.txt │ ├── memory.txt │ ├── overview.txt │ ├── presentation_slides.txt │ ├── security.txt │ ├── smbios.txt │ ├── unit_test.txt │ └── workaround.txt ├── example-py-cliprog ├── exe-assetTag.txt ├── exe-getSystemId.txt ├── exe-propertyTag.txt ├── exe-serviceTag.txt ├── external-specs │ ├── smbios.xml │ └── smbios.xsd ├── getopt │ ├── LICENSE │ └── README ├── installation.txt ├── mainpage.txt ├── media-direct │ ├── m1330-mediadirect.txt │ └── mdbootsector.bin ├── mkbiospkg.sh ├── smbios-sys-info.4 ├── smbios23.xml ├── token_blacklist.csv ├── token_list.csv ├── visio │ ├── InterfaceLogicalModel.jpg │ ├── LogicalModel.vsd │ ├── Notes_on_CMOS_Access.doc │ ├── SMBIOS_CMOS_State_Byte_Guidelines.doc │ ├── UnitTestLogicalModel.jpg │ └── libsmbios-manager.ppt └── yum.txt ├── etc └── logging.conf ├── pkg ├── Prototype ├── VC.2005 │ ├── getSystemId │ │ └── getSystemId.vcproj │ ├── libsmbios-minimal.sln │ └── libsmbios-mt │ │ └── libsmbios-mt.vcproj ├── build-dockerfile.sh ├── debian │ ├── changelog.in │ ├── compat │ ├── control │ ├── copyright │ ├── gbp.conf │ ├── libsmbios-c2.install │ ├── libsmbios-dev.install │ ├── libsmbios-doc.install │ ├── python3-libsmbios.examples │ ├── python3-libsmbios.install │ ├── python3-libsmbios.postinst │ ├── python3-libsmbios.prerm │ ├── rules │ ├── smbios-utils.install │ ├── smbios-utils.links │ ├── smbios-utils.postinst │ ├── smbios-utils.postrm │ ├── smbios-utils.preinst │ ├── source │ │ └── format │ └── watch ├── dlopen.h.in ├── dockerfiles │ ├── Dockerfile.centos8 │ ├── Dockerfile.debian │ └── centos8-entrypoint.sh ├── full-documentation.dox.in ├── libsmbios.spec.in ├── libsmbios_c-uninstalled.pc.in ├── libsmbios_c.dox ├── libsmbios_c.pc.in ├── mk-rel-deb.sh ├── mk-rel-rpm.sh ├── oscrc-development ├── pkginfo.in ├── scripts │ ├── HelperXml.py │ ├── compile-test.sh │ ├── genSmbiosDefs.py │ ├── indent.sh │ ├── makeXmlHeader.py │ └── tr-report.py ├── update-docs.sh └── upload-obs.sh ├── po ├── LINGUAS ├── Makevars ├── POTFILES.in ├── de.po ├── en.po ├── en@boldquot.po ├── en@quot.po ├── en_US.po ├── es.po ├── fr.po ├── it.po ├── ja.po ├── ko.po ├── libsmbios.pot ├── nl.po ├── zh_CN.po └── zh_TW.po └── src ├── bin ├── Makefile.am ├── args.txt ├── getopts.c ├── getopts.h ├── getopts_LICENSE.txt ├── smbios-battery-ctl ├── smbios-get-ut-data.c ├── smbios-keyboard-ctl ├── smbios-lcd-brightness ├── smbios-passwd ├── smbios-state-byte-ctl.c ├── smbios-sys-info ├── smbios-sys-info-lite.c ├── smbios-thermal-ctl ├── smbios-token-ctl ├── smbios-upflag-ctl.c ├── smbios-wakeup-ctl └── smbios-wireless-ctl ├── cppunit ├── Makefile.am ├── XmlUtils.cpp ├── XmlUtils.h ├── main.cpp ├── main.h ├── outputctl.h ├── runtests.sh ├── system_dumps ├── testC_smi.cpp ├── testC_smi.h ├── testC_token.cpp ├── testC_token.h ├── testPlatform.cpp ├── testPlatform.h ├── testStandalone.cpp ├── testStandalone.h └── test_data ├── include ├── Makefile.am └── smbios_c │ ├── cmos.h │ ├── compat.h │ ├── config │ ├── README │ ├── abi │ │ ├── msvc_prefix.h │ │ └── msvc_suffix.h │ ├── abi_prefix.h │ ├── abi_suffix.h │ ├── auto_link.h │ ├── boost_LICENSE_1_0_txt │ ├── compiler │ │ ├── gcc.h │ │ ├── sunpro_cc.h │ │ └── visualc.h │ ├── get_config.h │ ├── platform │ │ ├── linux.h │ │ ├── win32.h │ │ └── win64.h │ ├── select_compiler_config.h │ ├── select_platform_config.h │ ├── suffix.h │ └── user.h │ ├── memory.h │ ├── obj │ ├── cmos.h │ ├── memory.h │ ├── smbios.h │ ├── smi.h │ └── token.h │ ├── smbios.h │ ├── smi.h │ ├── system_info.h │ ├── token.h │ └── types.h ├── libsmbios_c ├── Makefile.am ├── TODO.txt ├── cmos │ ├── cmos.c │ ├── cmos_impl.h │ ├── cmos_linux.c │ ├── cmos_obj.c │ ├── cmos_ut.c │ └── cmos_windows.c ├── common │ ├── common.c │ ├── common_internal.h │ ├── common_windows.c │ ├── common_windows.h │ ├── compiler │ │ ├── gcc.h │ │ ├── sunpro_cc.h │ │ └── visualc.h │ ├── internal_strl.h │ ├── libsmbios_c_intlize.h │ ├── libsmbios_c_source.h │ ├── miniddk.h │ ├── platform │ │ ├── linux.h │ │ ├── win32.h │ │ └── win64.h │ ├── select_compiler_config.h │ ├── select_platform_config.h │ ├── strlcat.c │ └── strlcpy.c ├── memory │ ├── memory.c │ ├── memory_impl.h │ ├── memory_linux.c │ ├── memory_obj.c │ ├── memory_ut.c │ └── memory_windows.c ├── smbios │ ├── smbios.c │ ├── smbios_fixups.c │ ├── smbios_impl.h │ ├── smbios_linux.c │ ├── smbios_obj.c │ └── smbios_windows.c ├── smi │ ├── smi.c │ ├── smi_impl.h │ ├── smi_linux.c │ ├── smi_obj.c │ ├── smi_password.c │ ├── smi_windows.c │ └── wmi.h ├── system_info │ ├── asset_tag.c │ ├── dell_magic.h │ ├── id_byte.c │ ├── property_tag.c │ ├── service_tag.c │ ├── state_byte.c │ ├── sysinfo_impl.h │ ├── system_info.c │ └── up_flag.c └── token │ ├── checksum.c │ ├── token.c │ ├── token_d4.c │ ├── token_da.c │ ├── token_impl.h │ └── token_obj.c ├── py-cli ├── Makefile.am └── cli.py ├── python ├── Makefile.am └── libsmbios_c │ ├── __init__.py │ ├── _common.py │ ├── _vars.py │ ├── cmos.py │ ├── memory.py │ ├── smbios.py │ ├── smbios_token.py │ ├── smi.py │ ├── system_info.py │ └── trace_decorator.py ├── pyunit ├── HelperXml.py ├── Makefile.am ├── TestLib.py ├── runtests.sh ├── system_dumps │ ├── ES3020 │ │ ├── cmos.dat │ │ ├── idbyte.dat │ │ ├── readme.txt │ │ ├── smbios.dat │ │ ├── sysstr.dat │ │ └── testInput.xml │ ├── ES3040 │ │ ├── cmos.dat │ │ ├── idbyte.dat │ │ ├── smbios.dat │ │ ├── sysstr.dat │ │ └── testInput.xml │ ├── IDS4235 │ │ ├── cmos.dat │ │ ├── idbyte.dat │ │ ├── smbios.dat │ │ ├── sysstr.dat │ │ └── testInput.xml │ ├── PAweb110 │ │ ├── cmos.dat │ │ ├── idbyte.dat │ │ ├── smbios.dat │ │ ├── sysstr.dat │ │ └── testInput.xml │ ├── PE0400 │ │ ├── cmos.dat │ │ ├── idbyte.dat │ │ ├── smbios.dat │ │ ├── sysstr.dat │ │ └── testInput.xml │ ├── PE0420 │ │ ├── cmos.dat │ │ ├── idbyte.dat │ │ ├── smbios.dat │ │ ├── sysstr.dat │ │ └── testInput.xml │ ├── PE0500 │ │ ├── cmos.dat │ │ ├── idbyte.dat │ │ ├── smbios.dat │ │ ├── sysstr.dat │ │ └── testInput.xml │ ├── PE0600 │ │ ├── cmos.dat │ │ ├── idbyte.dat │ │ ├── smbios.dat │ │ ├── sysstr.dat │ │ └── testInput.xml │ ├── PE0650 │ │ ├── cmos.dat │ │ ├── idbyte.dat │ │ ├── smbios.dat │ │ ├── sysstr.dat │ │ └── testInput.xml │ ├── PE1300 │ │ ├── cmos.dat │ │ ├── idbyte.dat │ │ ├── smbios.dat │ │ ├── sysstr.dat │ │ └── testInput.xml │ ├── PE1650 │ │ ├── cmos.dat │ │ ├── idbyte.dat │ │ ├── smbios.dat │ │ ├── sysstr.dat │ │ └── testInput.xml │ ├── PE1655_blade1 │ │ ├── cmos.dat │ │ ├── idbyte.dat │ │ ├── smbios.dat │ │ ├── sysstr.dat │ │ └── testInput.xml │ ├── PE1655_blade2 │ │ ├── cmos.dat │ │ ├── idbyte.dat │ │ ├── smbios.dat │ │ ├── sysstr.dat │ │ └── testInput.xml │ ├── PE1750_A00 │ │ ├── cmos.dat │ │ ├── idbyte.dat │ │ ├── smbios.dat │ │ ├── sysstr.dat │ │ └── testInput.xml │ ├── PE1750_A07 │ │ ├── cmos.dat │ │ ├── idbyte.dat │ │ ├── smbios.dat │ │ ├── sysstr.dat │ │ └── testInput.xml │ ├── PE2450 │ │ ├── cmos.dat │ │ ├── idbyte.dat │ │ ├── smbios.dat │ │ ├── sysstr.dat │ │ └── testInput.xml │ ├── PE2500 │ │ ├── cmos.dat │ │ ├── idbyte.dat │ │ ├── smbios.dat │ │ ├── sysstr.dat │ │ └── testInput.xml │ ├── PE2600 │ │ ├── cmos.dat │ │ ├── idbyte.dat │ │ ├── smbios.dat │ │ ├── sysstr.dat │ │ └── testInput.xml │ ├── PE2650 │ │ ├── cmos.dat │ │ ├── idbyte.dat │ │ ├── smbios.dat │ │ ├── sysstr.dat │ │ └── testInput.xml │ ├── PE4400 │ │ ├── cmos.dat │ │ ├── idbyte.dat │ │ ├── smbios.dat │ │ ├── sysstr.dat │ │ └── testInput.xml │ ├── PE4600 │ │ ├── cmos.dat │ │ ├── idbyte.dat │ │ ├── smbios.dat │ │ ├── sysstr.dat │ │ └── testInput.xml │ ├── PE6450 │ │ ├── cmos.dat │ │ ├── idbyte.dat │ │ ├── smbios.dat │ │ ├── sysstr.dat │ │ └── testInput.xml │ ├── PE6600 │ │ ├── cmos.dat │ │ ├── idbyte.dat │ │ ├── smbios.dat │ │ ├── sysstr.dat │ │ └── testInput.xml │ ├── PE8450 │ │ ├── cmos.dat │ │ ├── idbyte.dat │ │ ├── offset-0xD8040.dat │ │ ├── offset-0xDC040.dat │ │ ├── smbios.dat │ │ ├── sysstr.dat │ │ └── testInput.xml │ ├── PV755N │ │ ├── cmos.dat │ │ ├── idbyte.dat │ │ ├── smbios.dat │ │ ├── sysstr.dat │ │ └── testInput.xml │ ├── Precision_390 │ │ ├── cmos.dat │ │ ├── idbyte.dat │ │ ├── smbios.dat │ │ ├── sysstr.dat │ │ └── testInput.xml │ ├── dimension_4400 │ │ ├── cmos.dat │ │ ├── idbyte.dat │ │ ├── smbios.dat │ │ ├── sysstr.dat │ │ └── testInput.xml │ ├── latitude_D500 │ │ ├── cmos.dat │ │ ├── idbyte.dat │ │ ├── smbios.dat │ │ ├── sysstr.dat │ │ └── testInput.xml │ ├── latitude_D610 │ │ ├── cmos.dat │ │ ├── idbyte.dat │ │ ├── smbios.dat │ │ ├── sysstr.dat │ │ └── testInput.xml │ ├── opti │ │ ├── cmos.dat │ │ ├── idbyte.dat │ │ ├── smbios.dat │ │ ├── sysstr.dat │ │ └── testInput.xml │ ├── precisiont7600 │ │ ├── DMI │ │ ├── idbyte.dat │ │ ├── smbios_entry_point │ │ ├── sysstr.dat │ │ └── testInput.xml │ └── xps9365 │ │ ├── DMI │ │ ├── idbyte.dat │ │ ├── smbios_entry_point │ │ ├── sysstr.dat │ │ └── testInput.xml ├── testAll.py ├── testMemory.py ├── testSmbios.py └── test_data │ └── opti │ ├── cmos.dat │ ├── idbyte.dat │ ├── smbios.dat │ ├── sysstr.dat │ └── testInput.xml └── smbios.dat /.gitignore: -------------------------------------------------------------------------------- 1 | # BUILD OUTPUT 2 | *.o 3 | *.lo 4 | .dirstamp 5 | *.la 6 | .libs 7 | .deps 8 | 9 | # python compiled 10 | *.pyc 11 | 12 | # compiled po 13 | *.gmo 14 | 15 | # autogen files 16 | configure 17 | aclocal.m4 18 | Makefile.in 19 | ABOUT-NLS 20 | INSTALL 21 | autom4te.cache/ 22 | m4/ 23 | pkg/compile 24 | pkg/py-compile 25 | pkg/config.guess 26 | pkg/config.h.in 27 | pkg/config.h.in~ 28 | pkg/config.rpath 29 | pkg/config.sub 30 | pkg/depcomp 31 | pkg/install-sh 32 | pkg/ltmain.sh 33 | pkg/missing 34 | pkg/mkinstalldirs 35 | pkg/mkinstalldirs~ 36 | po/Makefile.in.in 37 | po/Makevars.template 38 | po/Rules-quot 39 | po/boldquot.sed 40 | po/en@boldquot.header 41 | po/en@quot.header 42 | po/insert-header.sin 43 | po/quot.sed 44 | po/remove-potcdate.sin 45 | 46 | # docker build process 47 | /Dockerfile 48 | /*-entrypoint.sh 49 | 50 | AUTHORS 51 | ChangeLog 52 | Makefile 53 | config.log 54 | config.status 55 | libsmbios-*.tar.* 56 | *.spec 57 | *.pc 58 | libtool 59 | out/ 60 | pkg/pkginfo 61 | pkg/test-driver 62 | po/POTFILES 63 | po/en@boldquot.insert-header 64 | po/en@quot.insert-header 65 | po/remove-potcdate.sed 66 | po/stamp-po 67 | src/python/_vars.py 68 | src/pyunit/runtests.sh.log 69 | src/pyunit/runtests.sh.trs 70 | test-suite.log 71 | dist/ 72 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: c 2 | sudo: required 3 | dist: trusty 4 | 5 | services: 6 | - docker 7 | 8 | env: 9 | - OS=debian 10 | - OS=centos8 11 | 12 | install: 13 | - ./pkg/build-dockerfile.sh $OS 14 | 15 | script: 16 | - docker run -e CI=true -t -v `pwd`/dist:/build/dist libsmbios-$OS 17 | 18 | deploy: 19 | provider: releases 20 | api_key: 21 | secure: DyhNsN9qkYM1YPhixEAEE5SfILFKP9WA840rW+F9IQSVlry91or+LsR3Dr15GoMbPRVCkLlrFNdW/CKhqnxyB9pFZKnr/yNzoWP6zlZp8dKzWzmtt/Thr280+XJzHz8XMdofQnPaBXLVpuN+s4tMo9Xy4FhsTPZwUJ7WTYfoWxgvM7A+mMc/kugi2Z9tCPaRX54pHL6OsBNtRD/CR2SMHlC+X3uNIprjaLPZ+cQ8uYUYX8UzV0hBY0nDND/sjkXA9qvnakDikXcagAiV434L2ZM8TAqt6ptgpi65wASitc+BnVzsRD+MJcnkINiOItI4wKUpFmz3EZWuKLCA81atg4C7gjHxQTNYjMv56U7f3AOiIrcRmDeQx2UoShIyKFfEqH+/UEJhHc4NdxuAGYnv7hrGs4Qkl6GCH1LRJ17Y04Su/QpEsjLkreHSRRZZqh2GlT7lV32eNMx0Ua010gh7q26K6GBPL7F4vjtbLDKOLqz6pzsK4Ptd7upOY16GEwGWC6el/kf6fHz4d3hv58OWohbgOspTmzV+DEDAeA/nNqxq8Grk0Jsqyp7OYg9vEbjBIGyQqwv4eGzDlUir8LbEjIOrSDEIyIKZacGlVRITLdJ0SuwK5IPqtFQNDKmAYC9L7BnochgOnsM71Ns3CKx2ugxrTGXv4312N5x4VERkp8s= 22 | file_glob: true 23 | file: dist/* 24 | skip_cleanup: true 25 | on: 26 | tags: true 27 | repo: dell/libsmbios 28 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c: 2 | /* 3 | * Copyright (C) 2005 Dell Inc. 4 | * by Michael Brown 5 | * Licensed under the Open Software License version 2.1 6 | * 7 | * Alternatively, you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation; either version 2 of the License, 10 | * or (at your option) any later version. 11 | 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 15 | * See the GNU General Public License for more details. 16 | * 17 | * See COPYING-GPL for the GPL license text. 18 | * See COPYING-OLS for the OLS license text 19 | */ 20 | 21 | 22 | /* 23 | bin-{un,}supported/getopt.[ch] are licenced under 3 clause BSD license are are 24 | originally: 25 | * Copyright (c) 2001, 2002 Steve Mertz 26 | See those files for the exact license text. 27 | 28 | Portions of the configuration system, under include/smbios/config/ are 29 | taken and modified from the boost c++ library. 30 | * (C) Copyright John Maddock 2001 - 2003. 31 | See include/smbios/config/boost_LICENSE_1_0_txt for details on the 32 | boost license. 33 | 34 | */ 35 | 36 | -------------------------------------------------------------------------------- /COPYING-GPL: -------------------------------------------------------------------------------- 1 | // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c: 2 | /* 3 | * Copyright (C) 2005 Dell Inc. 4 | * by Michael Brown 5 | * Licensed under the Open Software License version 2.1 6 | * 7 | * Alternatively, you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation; either version 2 of the License, 10 | * or (at your option) any later version. 11 | 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 15 | * See the GNU General Public License for more details. 16 | * 17 | * See COPYING-GPL for the GPL license text. 18 | * See COPYING-OLS for the OLS license text 19 | */ 20 | 21 | 22 | /* 23 | bin-{un,}supported/getopt.[ch] are licenced under 3 clause BSD license are are 24 | originally: 25 | * Copyright (c) 2001, 2002 Steve Mertz 26 | See those files for the exact license text. 27 | 28 | Portions of the configuration system, under include/smbios/config/ are 29 | taken and modified from the boost c++ library. 30 | * (C) Copyright John Maddock 2001 - 2003. 31 | See include/smbios/config/boost_LICENSE_1_0_txt for details on the 32 | boost license. 33 | 34 | */ 35 | 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # libsmbios 2 | [![Build Status](https://travis-ci.org/dell/libsmbios.png)](https://travis-ci.org/dell/libsmbios) 3 | [![Coverity Scan Build Status](https://scan.coverity.com/projects/dell-libsmbios/badge.svg)](https://scan.coverity.com/projects/dell-libsmbios) 4 | libsmbios provides a library to interface with the SMBIOS tables. 5 | It also provides extensions for proprietary methods of interfacing with Dell specific 6 | SMBIOS tables. 7 | 8 | Dependencies 9 | -- 10 | To build a libsmbios tarball, you will need the following dependencies, in whichever -devel package convention in use by your distribution: 11 | 1. libxml 12 | 1. autoconf 13 | 2. automake 14 | 3. gettext 15 | 4. libtool 16 | 17 | Building 18 | -- 19 | To build from a git checkout: 20 | ``` 21 | $ ./autogen.sh # autogen.sh internally runs configure automatically 22 | $ make 23 | ``` 24 | 25 | To Install 26 | 27 | Standard autotools package: 28 | ``` 29 | $ make install 30 | ``` 31 | 32 | Documentation is in doxygen format. To view the docs, run `make doxygen`, then 33 | look in the `out/libsmbios_c/html/index.html`. Docs are also built as part of 34 | `make all`. 35 | 36 | Distribution packages 37 | -- 38 | Packages can be generated for RPM based distributions by using the helper script 39 | ``` 40 | # pkg/mk-rel-rpm.sh 41 | ``` 42 | 43 | Packages can be generated for DEB based distributions by using the helper script 44 | ``` 45 | # pkg/mk-rel-deb.sh 46 | ``` 47 | 48 | License 49 | -- 50 | This software is dual-licensed under GPL/OSL. 51 | 52 | See 53 | [GPL License](https://github.com/dell/libsmbios/blob/master/COPYING-GPL) 54 | and 55 | [OSL License](https://github.com/dell/libsmbios/blob/master/COPYING-OSL) 56 | for more details. 57 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # run this script to create all the autotools fluff. It will also run configure 4 | # unless told not to 5 | 6 | set -e 7 | 8 | CURDIR=$(pwd) 9 | SCRIPT_DIR=$(cd $(dirname $0); pwd) 10 | 11 | cd $SCRIPT_DIR 12 | 13 | autoreconf -v -i -f 14 | 15 | run_configure=true 16 | for arg in $*; do 17 | case $arg in 18 | --no-configure) 19 | run_configure=false 20 | ;; 21 | *) 22 | ;; 23 | esac 24 | done 25 | 26 | if test $run_configure = true; then 27 | cd $CURDIR 28 | $SCRIPT_DIR/configure "$@" 29 | fi 30 | 31 | -------------------------------------------------------------------------------- /doc/coding/Header-Rules.txt: -------------------------------------------------------------------------------- 1 | // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=txt: 2 | 3 | /** \page header_rules Rules for header file inclusion 4 | 5 | - Header files should always successfully compile standalone. Use the "make 6 | header_file_check" makefile target to test this. 7 | 8 | - Header files in include/smbios should only include other headers in include/ 9 | or system headers. 10 | 11 | - Header files should _never_ include a "using namespace" directive. 12 | 13 | - if "file.h" is in our source tree use "file.h" like this: 14 | \verbatim #include "file.h" \endverbatim 15 | - all other header files use , like this: 16 | \verbatim #include \endverbatim 17 | 18 | - Always use 'C'-style comments in header files: \/* ... *\/ 19 | 20 | - header file order in HEADER files 21 | - Always include "smbios/compat.h" first. 22 | - Include system includes next 23 | - Include "smbios/types.h" next, if necessary 24 | - include any "I*.h" interface headers next 25 | - include any other includes 26 | 27 | - header file order in C++ code 28 | - If you have _any_ system includes, include "smbios/compat.h" first 29 | - Include system includes next, if necessary 30 | - Should _rarely_ have to include "types.h", should be in a header already. 31 | - Include any "I*.h" interface headers next 32 | - all others 33 | 34 | 35 | Here is an example header file: 36 | 37 | \verbatim 38 | // standard include guard... prevent multiple inclusion 39 | #ifndef SMBIOSINTERFACE_H 40 | #define SMBIOSINTERFACE_H 41 | 42 | // compat header should always be first header 43 | #include "smbios/compat.h" 44 | 45 | // next include system header files 46 | #include // Provides size_t and NULL 47 | #include 48 | #include 49 | #include 50 | #include // Provides auto_ptr<> 51 | 52 | // types.h should be first user-defined header. 53 | #include "smbios/types.h" 54 | 55 | // include other smbios/I*.h headers next 56 | #include "smbios/IFactory.h" 57 | 58 | //.... declarations here .... 59 | 60 | #endif /* SMBIOSINTERFACE_H */ 61 | \endverbatim 62 | 63 | */ 64 | -------------------------------------------------------------------------------- /doc/coding/api_abi_status.txt: -------------------------------------------------------------------------------- 1 | // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c: 2 | // 3 | //Do not use "\section", "\subsection", or other page-related commands here as 4 | //this file is inlined in the ISmbios.h file. 5 | // 6 | /** \page api_abi Status of API and ABI stability and compatibility 7 | * 8 | 9 | \todo finish api and abi page 10 | 11 | */ 12 | -------------------------------------------------------------------------------- /doc/coding/coding-style.txt: -------------------------------------------------------------------------------- 1 | /** \page coding_style Page on Coding Style for libsmbios 2 | 3 | This page is not yet complete :-) 4 | 5 | Indentation and tabbing policy: 6 | - Indentation is 4 spaces, no tab characters are allowed 7 | - the reference indentation policy is in build/scripts/indent.sh. The 8 | "Artistic Style" (astyle) program is an automated indentation engine 9 | that will re-tab and re-indent C++ code. The appropriate settings to 10 | use are contained in the indent.sh script. This script should be run on 11 | new code to assure that it follows the project policy. The script will 12 | occasionally be re-run against old code to ensure that it stays within 13 | guidelines. 14 | 15 | references: 16 | New C++ casting style: 17 | - http://www.cs.rpi.edu/~wiseb/xrds/ovp3-1b.html 18 | 19 | Portability: 20 | - http://www.mozilla.org/hacking/portable-cpp.html 21 | 22 | Localization: 23 | - http://www.mozilla.org/projects/l10n/customizable-code.html#write_l12y 24 | - http://www.i18nguy.com/unicode/c-unicode.html 25 | 26 | Configuration: 27 | - http://www.boost.org/libs/config/config.htm 28 | 29 | 30 | Use modelines: Ensure that every file has a complete set of modelines for 31 | common editors. VIM modelines should appear in every file. When we get 32 | a significant set of developers using EMACS, then appropriate modelines for 33 | EMACS should be added to each file 34 | 35 | Modelines should be in the first or last 5 lines of the program text. Modelines 36 | in other locations are generally ignored by editors. 37 | 38 | example emacs modeline: 39 | \verbatim 40 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 41 | \endverbatim 42 | 43 | example vim modeline: 44 | \verbatim 45 | // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=txt: 46 | \endverbatim 47 | 48 | Copyright: Each file should contain copyright attribution information. 49 | 50 | 51 | */ 52 | -------------------------------------------------------------------------------- /doc/coding/compilation-windows.txt: -------------------------------------------------------------------------------- 1 | // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=txt: 2 | 3 | /** \page compilation_win Compiling Libsmbios on Windows 4 | \section req_comp_win Compilation requirements 5 | 6 | In order to compile libsmbios from source, you need to have the following 7 | available on your system: 8 | - cppunit 1.8.0 or higher (tested with 1.8.0 and 1.10.2) 9 | http://cppunit.sourceforge.net/ 10 | - xerces 2.3 or higher (tested with 2.3, 2.4, 2.5, and 2.6) 11 | http://xml.apache.org/xerces-c/index.html 12 | 13 | The following items are not strictly necessary to do a build, but are highly 14 | recommended: 15 | - GraphViz: http://www.research.att.com/sw/tools/graphviz/ 16 | - Doxygen: http://www.doxygen.org/ 17 | 18 | 19 | \section win_comp Windows 20 | Libsmbios has been tested with the following compilers on Windows: 21 | - Microsoft Visual C++ 6.0 22 | - Microsoft Visual C++ .NET 2003 23 | 24 | A workspace is available under build/VC6/ to assist in compiling on Visual 25 | C++. 26 | 27 | A workspace is available under build/VC.NET_2003/ to compile on VC.NET 28 | 2003. 29 | 30 | Several environment variables need to be set for the VC .NET 2003 build. 31 | There is a sample batch file to set these variables and start the IDE here: 32 | http://linux.dell.com/libsmbios/download/windows/dev_environment. 33 | Also included are pre-compiled versions (with source) of xerces and 34 | cppunit, so everything that you need to compile all of the tools is there. 35 | 36 | */ 37 | 38 | -------------------------------------------------------------------------------- /doc/coding/compilation.txt: -------------------------------------------------------------------------------- 1 | // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=txt: 2 | 3 | /** \page compilation Compiling Libsmbios 4 | \section compiling Compilation requirements 5 | \subsection all All Platforms 6 | 7 | In order to compile libsmbios from source, you need to have the following 8 | available on your system: 9 | - cppunit 1.8.0 or higher (tested with 1.8.0 and 1.10.2) 10 | http://cppunit.sourceforge.net/ 11 | - xerces 2.3 or higher (tested with 2.3, 2.4, 2.5, 2.6, and 2.7) 12 | http://xml.apache.org/xerces-c/index.html 13 | 14 | The following items are not strictly necessary to do a build, but are highly 15 | recommended: 16 | - GraphViz: http://www.research.att.com/sw/tools/graphviz/ 17 | - Doxygen: http://www.doxygen.org/ 18 | 19 | See the following pages for specific directions for each platform: 20 | - \ref compilation_linux 21 | - \ref compilation_win 22 | - \ref unit_test_run 23 | 24 | */ 25 | 26 | -------------------------------------------------------------------------------- /doc/coding/index.txt: -------------------------------------------------------------------------------- 1 | 2 | /** \page coding Documentation, Coding Standards, Style and Automated Reports 3 | 4 | \section docs Design Overview 5 | \li \ref overview_overview 6 | \li \ref presentation 7 | \li \ref unit_test_theory 8 | \li \ref smbios_theory 9 | \li \ref item_theory 10 | \li \ref workaround_theory 11 | \li \ref factory_theory * 12 | \li \ref memory_theory * 13 | \li \ref cmos_theory * 14 | \li \ref security 15 | 16 | \section style Coding Standards, Style, and Patch Submission 17 | \li \ref compilation 18 | \li \ref api_abi * 19 | \li \ref header_rules 20 | \li \ref coding_style 21 | \li \ref patches 22 | 23 | \section auto Automated Reports 24 | \li \ref code_coverage 25 | \li \ref leak_detect 26 | 27 | \note --*-- These pages are still in progress. 28 | 29 | \section start Where to start 30 | 31 | For developers wishing to start out using the libsmbios library, please start 32 | at the following doxygen pages: 33 | - C-API information: SystemInfo.h 34 | - SMBIOS C++ API information: smbios::SmbiosFactory, smbios::ISmbiosTable, 35 | smbios::ISmbiosItem 36 | - CMOSTOKEN C++ API information: smbios::CmosTokenTableFactory, 37 | smbios::ICmosTokenTable, smbios::ICmosToken 38 | 39 | \section add Adding new documentation 40 | 41 | The libsmbios project uses Doxygen for all project documentation. The text for 42 | this page is in doc/mainpage.txt in the source tree. All additional 43 | documentation linked by this page is available in doc/*.txt files. Be aware 44 | that some of these text files are automatically generated, such as the code 45 | coverage report. 46 | 47 | All class diagram and stuff behind the links at the top of this page are 48 | automatically generated by Doxygen from the source code. Each page says which 49 | source files were used. Look for text like this at the bottom of each page: 50 | 51 | \verbatim 52 | The documentation for this class was generated from the following files: 53 | - SomeFile.h 54 | - AnotherFile.h 55 | - SomeFile.cpp 56 | ... 57 | \endverbatim 58 | 59 | 60 | */ 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /doc/coding/patching.txt: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | \page patches How to submit a patch 4 | 5 | \section what_patch What is a patch? 6 | 7 | A patch is a way that you can make changes to the libsmbios code and send just 8 | your changes to the libsmbios development team. The team can see the lines 9 | of code that you changed, so they don't need to hunt through the code to see 10 | what changed. You can also use the patch to apply the changes to the official 11 | code base. 12 | 13 | You create a patch by downloading the source code for libsmbios and working on 14 | coding up your changes. 15 | 16 | \subsection patch_tarball Creating a patch from tarball 17 | need to finish this section. :-) 18 | 19 | \section verify_patch How do I verify my changes. 20 | 21 | There are several requirements for any proposed change to libsmbios. The 22 | requirements are very easy to fulfill. The list of requirements are below. Any 23 | patch not including all of these items will be rejected. 24 | 25 | - Update TODO file 26 | - Update doxygen 27 | - Add unit tests for new code 28 | - Verify code coverage for new code
make coverage
29 | - Run all unit tests before submission
make unit_test
30 | - Run memory leak detection before submission
make valgrind
31 | 32 | */ 33 | -------------------------------------------------------------------------------- /doc/dell_drivers.txt: -------------------------------------------------------------------------------- 1 | // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=txt: 2 | 3 | /*! \page dell_drivers Dell 'dcdbas' and 'dell_rbu' Linux kernel drivers. 4 | 5 | \section ins_dcdbas_dell_rbu Installing the Dell 'dcdbas' and 'dell_rbu' drivers. 6 | The dcdbas and dell_rbu drivers are Linux kernel drivers that are required to perform certain operations in libsmbios. For example, BIOS updates require the dell_rbu driver. These kernel drivers are included in the standard linux kernel starting with Linux 2.6.14. If you have this kernel and these drivers are not present, please talk to your vendor about enabling these drivers. For others on earlier kernels, there is a DKMS-based RPM containing these drivers that you can install. Here are the instructions: 7 | 8 | - The current DKMS drivers should work for all 2.6 and 2.4 kernels. Tested on 9 | RHEL3, RHEL4, FC4, FC3. Should work on others. 10 | 11 | - Set up your system to pull from the Dell yum RPM repository. See \ref yum 12 | 13 | - Install the dcdbas and dell_rbu RPMS via yum: 14 | \verbatim 15 | # yum install dcdbas dell_rbu 16 | \endverbatim 17 | 18 | - The drivers are automatically compiled and loaded into your kernel at install time. If you install newer kernels, DKMS will automatically recompile for that kernel on boot. 19 | 20 | */ 21 | -------------------------------------------------------------------------------- /doc/design/cmos.txt: -------------------------------------------------------------------------------- 1 | // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c: 2 | // 3 | //Do not use "\section", "\subsection", or other page-related commands here as 4 | //this file is inlined in the ISmbios.h file. 5 | // 6 | /** \page cmos_theory Direct CMOS Access Overview 7 | * 8 | Theory of Operation 9 | 10 | \todo finish cmos access theory and overview 11 | 12 | */ 13 | -------------------------------------------------------------------------------- /doc/design/factory.txt: -------------------------------------------------------------------------------- 1 | // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c: 2 | // 3 | //Do not use "\section", "\subsection", or other page-related commands here as 4 | //this file is inlined in the ISmbios.h file. 5 | // 6 | /** \page factory_theory Abstract Factory Design Overview 7 | * 8 | Theory of Operation 9 | 10 | \todo finish Abstract Factory theory and overview 11 | 12 | */ 13 | -------------------------------------------------------------------------------- /doc/design/index.txt: -------------------------------------------------------------------------------- 1 | // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=txt: 2 | 3 | /** \page design Design Documentation 4 | \section foobar Design/Concept Review Presentation 5 | \li \ref presentation 6 | \section docs Design Overview 7 | \li *\ref unit_test_theory 8 | \li \ref smbios_theory 9 | \li \ref item_theory 10 | \li \ref workaround_theory 11 | \li *\ref factory_theory 12 | \li *\ref memory_theory 13 | \li *\ref cmos_theory 14 | \li \ref security 15 | 16 | */ 17 | 18 | 19 | -------------------------------------------------------------------------------- /doc/design/memory.txt: -------------------------------------------------------------------------------- 1 | // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c: 2 | // 3 | //Do not use "\section", "\subsection", or other page-related commands here as 4 | //this file is inlined in the ISmbios.h file. 5 | // 6 | /** \page memory_theory Direct Memory Access Overview 7 | * 8 | Theory of Operation 9 | 10 | \todo finish memory access theory and overview 11 | 12 | */ 13 | -------------------------------------------------------------------------------- /doc/exe-assetTag.txt: -------------------------------------------------------------------------------- 1 | // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=txt: 2 | 3 | /*! \page assetTag Documentation for assetTag executable 4 | 5 | \section NAME NAME 6 | assetTag 7 | 8 | \section SYNOPSIS SYNOPSIS 9 | 10 | The assetTag executable is used to read or write Dell system asset tags. Asset 11 | tags are generally 10 characters and can be set to any value by the system 12 | owner. It is generally used for asset tracking purposes. 13 | 14 |
15 |     $ ./assetTag
16 |     Existing Asset Tag:
17 | 
18 |     $ ./assetTagS -s foobar
19 |     Existing Asset Tag:
20 |     Changing Asset Tag: foobar
21 |     Change Successful. The changes may not take effect until reboot, depending on
22 |     system type.
23 | 
24 | 
25 | 26 | \section DESCRIPTION 27 | 28 | \section RETURN VALUE 29 | 30 | \section ERRORS 31 | 32 | \section RESTRICTIONS 33 | 34 | \section SEE ALSO 35 | 36 | */ 37 | -------------------------------------------------------------------------------- /doc/exe-getSystemId.txt: -------------------------------------------------------------------------------- 1 | // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=txt: 2 | 3 | /*! \page getSystemId Documentation for getSystemId executable 4 | 5 | \section NAME NAME 6 | getSystemId 7 | 8 | \section SYNOPSIS SYNOPSIS 9 | The getSystemId executable is used to pull commonly-used system information 10 | from a system and display it in an easily-readable and parseable format. it 11 | displays Dell system ID, service tag, product name, BIOS version, and system 12 | vendor. 13 |
14 |     $ ./getSystemId
15 |     cppunit/platform/PE1850/memdump.dat
16 |     Libsmbios:    0.10.4_beta2
17 |     System ID:    0x016C
18 |     Error getting the Service Tag : String does not exist.
19 |     Product Name: PowerEdge 1850
20 |     BIOS Version: P19
21 |     Vendor:       Dell Computer Corporation
22 |     Is Dell:      1
23 | 
24 | 25 | \section DESCRIPTION 26 | 27 | \section RETURN VALUE 28 | 29 | \section ERRORS 30 | 31 | \section RESTRICTIONS 32 | 33 | \section SEE ALSO 34 | 35 | */ 36 | -------------------------------------------------------------------------------- /doc/exe-propertyTag.txt: -------------------------------------------------------------------------------- 1 | // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=txt: 2 | 3 | /*! \page propertyTag Documentation for propertyTag executable 4 | 5 | \section NAME NAME 6 | propertyTag 7 | 8 | \section SYNOPSIS SYNOPSIS 9 | 10 | The propertyTag executable is used to read or write the Dell property 11 | ownership tags. Property ownership tags are generally 80-characters and can be 12 | set to any value by the system owner. This tag is displayed across the screen 13 | during BIOS POST through system bootup. It is also displayed if the system has 14 | an admin/user password set that must be entered to continue bootup. 15 | 16 | The propertyTag executable relies on the "dcdbas" kernel-mode driver. This 17 | driver is included in Linux kernels starting at 2.6.14. A dkms package is 18 | provided in the libsmbios package for earlier 2.6.x kernels. 19 | 20 |
21 |     $ ./propertyTag
22 |     Existing Property Tag:
23 | 
24 |     $ ./propertyTagS -s "New property ownership tag."
25 |     Existing Property Ownership Tag:
26 |     Changing Property Ownership Tag: New property ownership tag.
27 |     Change Successful. The changes may not take effect until reboot, depending on
28 |     system type.
29 | 
30 | 
31 | 32 | \section DESCRIPTION 33 | 34 | \section RETURN VALUE 35 | 36 | \section ERRORS 37 | 38 | \section RESTRICTIONS 39 | 40 | \section SEE ALSO 41 | 42 | */ 43 | -------------------------------------------------------------------------------- /doc/exe-serviceTag.txt: -------------------------------------------------------------------------------- 1 | // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=txt: 2 | 3 | /*! \page serviceTag Documentation for serviceTag executable 4 | 5 | \section NAME NAME 6 | serviceTag 7 | 8 | \section SYNOPSIS SYNOPSIS 9 | 10 | The serviceTag executable is used to read or write Dell system service tags. 11 | Service tags are generally either 5 or 7 characters and are set at the Dell 12 | factory to the Dell-managed service tag number. This tag should not be set by 13 | end-users, as it is used for service and support purposes. 14 | 15 | Note that some systems do not allow setting of service tag outside of the Dell 16 | factory. 17 | 18 |
19 |     $ ./serviceTag
20 |     Existing Service Tag:
21 | 
22 |     $ ./serviceTagS -s foobar1
23 |     Existing Service Tag:
24 |     Changing Service Tag: foobar1
25 |     Change Successful. The changes may not take effect until reboot, depending on
26 |     system type.
27 | 
28 | 29 | \section DESCRIPTION 30 | 31 | \section RETURN VALUE 32 | 33 | \section ERRORS 34 | 35 | \section RESTRICTIONS 36 | 37 | \section SEE ALSO 38 | 39 | */ 40 | -------------------------------------------------------------------------------- /doc/getopt/LICENSE: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, 2002, Steve Mertz 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * Redistributions of source code must retain the above copyright notice, this 9 | * list of conditions and the following disclaimer. 10 | * 11 | * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * Neither the name of Dragon Ware nor the names of its contributors may be 16 | * used to endorse or promote products derived from this software without 17 | * specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS 23 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | */ 32 | -------------------------------------------------------------------------------- /doc/installation.txt: -------------------------------------------------------------------------------- 1 | // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=txt: 2 | 3 | /** \page installation Installation of Libsmbios 4 | * 5 | * \section install Installation Requirements 6 | * 7 | * The libsmbios project is split into two libraries. The first library is the 8 | * base smbios lib. This library has no external dependencies when installing. 9 | * 10 | * The next lib is the smbiosxml library. This library simply has the dependency 11 | * on the Xerces XML parser and the base smbios library. 12 | * 13 | * \subsection linux_inst Linux Installation 14 | * 15 | * An RPM is provided for Linux Installation. 16 | * 17 | * \subsection win_ins Windows Installation 18 | * 19 | * need some text here. 20 | * 21 | */ 22 | -------------------------------------------------------------------------------- /doc/media-direct/m1330-mediadirect.txt: -------------------------------------------------------------------------------- 1 | Media Direct Info: 2 | BIOS MD Version: 1.0 3 | Media Direct Capable : yes 4 | System Start via MD Button : no 5 | BIOS Support for Vista HotStart: yes 6 | Pretty Boot Active : no 7 | BIOS Supports extended xloader : yes 8 | BIOS Configuration Changed : yes 9 | Xloader Configured : yes 10 | Xloader Revision : 100 11 | Xloader Low 32-bit LBA : 1709a489 12 | Xloader High 32-bit LBA : 0 13 | DONE. 14 | -------------------------------------------------------------------------------- /doc/media-direct/mdbootsector.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/doc/media-direct/mdbootsector.bin -------------------------------------------------------------------------------- /doc/mkbiospkg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | binary=/usr/sbin/dellBiosUpdate 6 | pkgHeader=pkgheader.sh 7 | biosHdr=$1 8 | output=pkg.bin 9 | 10 | usage() 11 | { 12 | echo "mkbiospkg -o OUTPUT_FILE -b BIOS.HDR -p PACKAGE_HEADER" 13 | echo 14 | } 15 | 16 | while getopts "o:b:p:h" Option 17 | do 18 | case $Option in 19 | o) 20 | output=$OPTARG 21 | ;; 22 | b) 23 | biosHdr=$OPTARG 24 | ;; 25 | p) 26 | pkgHeader=$OPTARG 27 | ;; 28 | *) 29 | usage 30 | ;; 31 | esac 32 | done 33 | shift $(($OPTIND - 1)) 34 | # Move argument pointer to next. 35 | 36 | if [ ! -e "$biosHdr" ]; then 37 | echo "Require BIOS.HDR to create package." 38 | exit 1 39 | fi 40 | 41 | if [ ! -e "$pkgHeader" ]; then 42 | echo "Require package header to create package." 43 | exit 1 44 | fi 45 | 46 | libs=$( ldd $binary | grep '=>' | cut -d'>' -f2 | perl -p -i -e 's/\(.*\)//;' ) 47 | tmpdir=$(mktemp -d /tmp/mkpkg-XXXXXX) 48 | tempTgz=$(mktemp /tmp/mkpkg-tgz-XXXXXX) 49 | trap 'rm -rf $tmpdir' HUP EXIT QUIT TERM 50 | 51 | for file in $libs $binary; 52 | do 53 | rpm=$(rpm -qf --qf '%{name}-%{version}-%{release}.%{arch}' $file) 54 | srpm=$(rpm -qi $rpm | grep "Source RPM" | cut -d: -f3 ) 55 | echo "$file ==> $srpm" >> $tmpdir/file-srpm-sources.txt 56 | echo $srpm >> $tmpdir/srpms.txt 57 | done 58 | 59 | echo "======================" 60 | echo "SRPM List:" 61 | cat $tmpdir/srpms.txt | sort | uniq > $tmpdir/srpms.txt2 62 | mv $tmpdir/srpms.txt2 $tmpdir/srpms.txt 63 | cat $tmpdir/srpms.txt 64 | echo "======================" 65 | echo 66 | 67 | cp $binary $libs $tmpdir/ 68 | cp $biosHdr $tmpdir/bios.hdr 69 | 70 | tar czf $tempTgz -C $tmpdir . 71 | 72 | cp $pkgHeader $output 73 | cat $tempTgz >> $output 74 | 75 | echo "Successfully Created $output" 76 | echo 77 | 78 | -------------------------------------------------------------------------------- /doc/smbios-sys-info.4: -------------------------------------------------------------------------------- 1 | '\" te 2 | .\" Copyright 2010 Dell 3 | .\"|[amp ] 4 | .\"|T Copyright (c) 1983 Regents of the University of California\&. All rights reserved\&. The Berkeley software License Agreement specifies the terms and conditions for redistribution\&. Copyright (c) 2003, Sun Microsystems, Inc\&. All Rights Reserved Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved 5 | .TH smbios-sys-info 4 "01 Aug 2010" "SunOS 5.10" "User Commands" 6 | .SH "NAME" 7 | smbios-sys-info \- Display System Info 8 | .SH "SYNOPSIS" 9 | .PP 10 | \fBsmbios-sys-info\fR 11 | .SH "DESCRIPTION" 12 | .PP 13 | The \fBsmbios-sys-info\fR utility will display the System Hardware ID, Service Tag, Asset Tag, Product Name and BIOS Version 14 | -------------------------------------------------------------------------------- /doc/token_blacklist.csv: -------------------------------------------------------------------------------- 1 | "Token Value","Reason" 2 | # blacklist: 3 | # - raid shadow copy (0x00CD, 0x00CE, 0x00CF, 0x00D0) 4 | 0x00CD,"Manufacturing use." 5 | 0x00CE,"Manufacturing use." 6 | 0x00CF,"Manufacturing use." 7 | 0x00D0,"Manufacturing use." 8 | 9 | # - sata controller shadow copy ( 0x013a 0x013b 0x013c 0x013d 0x01FF) 10 | 0x013A,"Manufacturing use." 11 | 0x013B,"Manufacturing use." 12 | 0x013C,"Manufacturing use." 13 | 0x013D,"Manufacturing use." 14 | 0x01FF,"Manufacturing use." 15 | 16 | # - management driver (0x0058, 0x0059) 17 | 0x0058,"Management driver use." 18 | 0x0059,"Management driver use." 19 | 0x8004,"dangerous - hard system power down." 20 | 21 | # - absolute security rom (0x0175, 0x0176) 22 | 0x0175,"dangerous - permanent write once" 23 | 0x0176,"dangerous - permanent write once" 24 | 25 | # - manufacturing mode (0x4026, 0x4027) 26 | 0x4026,"Manufacturing mode." 27 | 0x4027,"Manufacturing mode." 28 | 29 | # - cmos location for post (0x9000, 0x9001) 30 | 0x9000,"Manufacturing use." 31 | 0x9001,"Manufacturing use." 32 | 33 | # - TPM os enable/disable (0xa0002, 0xa003) 34 | 0xa002,"Manufacturing use." 35 | 0xa003,"Manufacturing use." 36 | 0xA004,"Manufacturing use." 37 | 38 | # Factory Stuff 39 | 0x01DC,"Factory Use." 40 | 0x01DD,"Factory Use." 41 | 42 | # Reserved 43 | 0x0100,"Reserved." 44 | 0xC001,"Reserved." 45 | 0xC002,"Reserved." 46 | 0xC004,"Reserved." 47 | 0xC005,"Reserved." 48 | 0xC007,"Reserved." 49 | 0xC008,"Reserved." 50 | 0xC009,"Reserved." 51 | 0xC00A,"Reserved." 52 | 0xC00B,"Reserved." 53 | 0xC00C,"Reserved." 54 | 0xC00D,"Reserved." 55 | 0xC00F,"Reserved." 56 | 0xC010,"Reserved." 57 | 0xC011,"Reserved." 58 | 0xC012,"Reserved." 59 | 0xC013,"Reserved." 60 | 0xC014,"Reserved." 61 | 0xC015,"Reserved." 62 | 0xF000,"Reserved." 63 | 0xF001,"Reserved." 64 | 0xF002,"Reserved." 65 | 0xF003,"Reserved." 66 | 0xF004,"Reserved." 67 | 0xF005,"Reserved." 68 | 0xF006,"Reserved." 69 | 0xF007,"Reserved." 70 | 0xF008,"Reserved." 71 | 0xF009,"Reserved." 72 | 0xF00A,"Reserved." 73 | 74 | # Inventory Check 75 | 0x02FF,"Manufacturing Use." 76 | 0x0300,"Manufacturing Use." 77 | 0x0301,"Manufacturing Use." 78 | 0x0302,"Manufacturing Use." 79 | 80 | # Factory use 81 | 0x0326,"TPM Use" 82 | 83 | # Manageability Engine 84 | 0x02E3,"Manufacturing Use." 85 | 86 | 87 | #LCD touchscreen, Enable only mode 88 | 0x0363,"Manufacturing Use." 89 | 90 | # TPM 91 | 0x03F6,"Manufacturing use." 92 | 0x03F7,"Manufacturing use." 93 | 94 | -------------------------------------------------------------------------------- /doc/visio/InterfaceLogicalModel.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/doc/visio/InterfaceLogicalModel.jpg -------------------------------------------------------------------------------- /doc/visio/LogicalModel.vsd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/doc/visio/LogicalModel.vsd -------------------------------------------------------------------------------- /doc/visio/Notes_on_CMOS_Access.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/doc/visio/Notes_on_CMOS_Access.doc -------------------------------------------------------------------------------- /doc/visio/SMBIOS_CMOS_State_Byte_Guidelines.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/doc/visio/SMBIOS_CMOS_State_Byte_Guidelines.doc -------------------------------------------------------------------------------- /doc/visio/UnitTestLogicalModel.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/doc/visio/UnitTestLogicalModel.jpg -------------------------------------------------------------------------------- /doc/visio/libsmbios-manager.ppt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/doc/visio/libsmbios-manager.ppt -------------------------------------------------------------------------------- /doc/yum.txt: -------------------------------------------------------------------------------- 1 | // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=txt: 2 | 3 | /*! \page yum Libsmbios package repository (yum) 4 | \section overview Package repository overview 5 | 6 | Please visit the unofficial repo 7 | site for instructions on how to setup the repository. 8 | 9 | After you have set up libsmbios based on the instructions in the repository, 10 | above, you can install libsmbios by running this command: 11 | 12 | \verbatim 13 | yum install libsmbios-bin 14 | \endverbatim 15 | 16 | Yum will automatically upgrade libsmbios with the rest of your system when you 17 | run yum updates. 18 | 19 | \section non_beta_warn Note on software repositories 20 | These software repositories are provided as a convenience to our customers. 21 | Note that all software released in these repositories is open-source software. 22 | Some of the software in these repositories is not Dell-developed and comes 23 | from outside parties (including, but not limited to: Xerces, cppunit, 24 | doxygen). Please examine the licenses of all software that you install to 25 | ensure that you know the different terms and conditions. 26 | 27 | Please be aware that all software is provided with no warranty, express or 28 | implied. Use the software on this site at your own risk. There is no Dell 29 | Technical Support available for any software offered for download on this 30 | site. The only support available is through the public mailing lists for each 31 | software component. 32 | 33 | \section beta_warn Note on BETA software 34 | Beta software repositories are provided to facilitate testing by people 35 | willing to accept the risks associated with beta quality software. All 36 | software is provided as-is, with no warranties, express or implied. While we 37 | make every effort to ensure that all software that we release contains no 38 | defects, they do sometimes happen. If it breaks, rest assured that you can 39 | keep all the pieces. 40 | 41 | */ 42 | -------------------------------------------------------------------------------- /etc/logging.conf: -------------------------------------------------------------------------------- 1 | # vim:et:ts=4:sw=4:tw=80 2 | # INI file. 3 | # This file is read by python ConfigParser module. You can do 4 | # variable interpolation using python-style string interpolation rules. 5 | 6 | # loggers 7 | [logger_root] 8 | level: NOTSET 9 | handlers: unadorned_console 10 | 11 | [logger_verbose] 12 | level: NOTSET 13 | handlers: 14 | qualname: verbose 15 | 16 | [logger_trace] 17 | level: NOTSET 18 | handlers: 19 | qualname: trace 20 | 21 | # logging configuration 22 | [formatters] 23 | keys: detailed,simple,unadorned 24 | 25 | [handlers] 26 | keys: unadorned_console 27 | 28 | [loggers] 29 | keys: root,verbose,trace 30 | 31 | [formatter_unadorned] 32 | format: %(message)s 33 | 34 | [formatter_simple] 35 | format: %(levelname)s: %(message)s 36 | 37 | ;useful for debugging: 38 | [formatter_detailed] 39 | format: %(levelname)s %(filename)s, Line: %(lineno)d: %(message)s 40 | 41 | [handler_unadorned_console] 42 | class: StreamHandler 43 | args: [] 44 | formatter: unadorned 45 | level: INFO 46 | 47 | -------------------------------------------------------------------------------- /pkg/Prototype: -------------------------------------------------------------------------------- 1 | i pkginfo 2 | d none /usr/bin 0755 root bin 3 | d none /usr/local/lib 0755 bin bin 4 | f none /usr/bin/smbios-sys-info=out/smbios-sys-info-lite 0755 root bin 5 | f none /usr/bin/dellBiosUpdate=out/.libs/dellBiosUpdate-compat 0755 root bin 6 | f none /usr/local/lib/libsmbios.so.2.1.0=out/.libs/libsmbios.so 0555 root bin 7 | f none /usr/share/man/man4/smbios-sys-info.4=smbios-sys-info.4 0644 root root 8 | f none /usr/share/man/man4/dellBiosUpdate.4=dellBiosUpdate.4 0644 root root 9 | s none /usr/local/lib/libsmbios.so.2=libsmbios.so.2.1.0 10 | s none /usr/local/lib/libsmbios.so=libsmbios.so.2.1.0 11 | 12 | 13 | -------------------------------------------------------------------------------- /pkg/VC.2005/libsmbios-minimal.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 9.00 3 | # Visual Studio 2005 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsmbios-mt", "libsmbios-mt\libsmbios-mt.vcproj", "{F3D3A9F9-2E32-4FE8-A8D8-120E464464CB}" 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "getSystemId", "getSystemId\getSystemId.vcproj", "{4BE10EA0-AA14-4FA4-8CFA-12EB5A1DD35A}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | {F3D3A9F9-2E32-4FE8-A8D8-120E464464CB} = {F3D3A9F9-2E32-4FE8-A8D8-120E464464CB} 9 | EndProjectSection 10 | EndProject 11 | Global 12 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 13 | Debug|Win32 = Debug|Win32 14 | Release|Win32 = Release|Win32 15 | EndGlobalSection 16 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 17 | {F3D3A9F9-2E32-4FE8-A8D8-120E464464CB}.Debug|Win32.ActiveCfg = Debug|Win32 18 | {F3D3A9F9-2E32-4FE8-A8D8-120E464464CB}.Debug|Win32.Build.0 = Debug|Win32 19 | {F3D3A9F9-2E32-4FE8-A8D8-120E464464CB}.Release|Win32.ActiveCfg = Release|Win32 20 | {F3D3A9F9-2E32-4FE8-A8D8-120E464464CB}.Release|Win32.Build.0 = Release|Win32 21 | {4BE10EA0-AA14-4FA4-8CFA-12EB5A1DD35A}.Debug|Win32.ActiveCfg = Debug|Win32 22 | {4BE10EA0-AA14-4FA4-8CFA-12EB5A1DD35A}.Debug|Win32.Build.0 = Debug|Win32 23 | {4BE10EA0-AA14-4FA4-8CFA-12EB5A1DD35A}.Release|Win32.ActiveCfg = Release|Win32 24 | {4BE10EA0-AA14-4FA4-8CFA-12EB5A1DD35A}.Release|Win32.Build.0 = Release|Win32 25 | EndGlobalSection 26 | GlobalSection(SolutionProperties) = preSolution 27 | HideSolutionNode = FALSE 28 | EndGlobalSection 29 | EndGlobal 30 | -------------------------------------------------------------------------------- /pkg/build-dockerfile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cur_dir=$(cd $(dirname $0); pwd) 4 | docker build -f $cur_dir/dockerfiles/Dockerfile.${1} -t libsmbios-${1} -- . 5 | -------------------------------------------------------------------------------- /pkg/debian/compat: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /pkg/debian/gbp.conf: -------------------------------------------------------------------------------- 1 | [DEFAULT] 2 | debian-branch = debian 3 | upstream-tag = v%(version)s 4 | 5 | [buildpackage] 6 | sign-tags = True 7 | dist = unstable 8 | -------------------------------------------------------------------------------- /pkg/debian/libsmbios-c2.install: -------------------------------------------------------------------------------- 1 | debian/tmp/usr/lib/*/libsmbios*.so.* 2 | -------------------------------------------------------------------------------- /pkg/debian/libsmbios-dev.install: -------------------------------------------------------------------------------- 1 | debian/tmp/usr/lib/*/libsmbios_c.so 2 | debian/tmp/usr/lib/*/libsmbios_c.a 3 | debian/tmp/usr/include/* usr/include/ 4 | debian/tmp/usr/lib/*/pkgconfig/ 5 | -------------------------------------------------------------------------------- /pkg/debian/libsmbios-doc.install: -------------------------------------------------------------------------------- 1 | doc/* usr/share/doc/libsmbios-doc 2 | out/libsmbios_c/html/* usr/share/doc/libsmbios-doc/doxygen/libsmbios_c 3 | -------------------------------------------------------------------------------- /pkg/debian/python3-libsmbios.examples: -------------------------------------------------------------------------------- 1 | #./src/py-cli/cli.py 2 | -------------------------------------------------------------------------------- /pkg/debian/python3-libsmbios.install: -------------------------------------------------------------------------------- 1 | debian/tmp/usr/lib/python* usr/lib 2 | -------------------------------------------------------------------------------- /pkg/debian/python3-libsmbios.postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | #DEBHELPER# 4 | -------------------------------------------------------------------------------- /pkg/debian/python3-libsmbios.prerm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | #DEBHELPER# 4 | -------------------------------------------------------------------------------- /pkg/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | export DEB_BUILD_MAINT_OPTIONS = hardening=+all 3 | 4 | %: 5 | dh $@ --with autoreconf,python3 6 | 7 | override_dh_auto_install: 8 | # manpage currently disabled, see #394898 9 | # cd $(CURDIR)/debian/libsmbios-bin; for f in usr/sbin/*; do \ 10 | # ln -s smbios-bin.1 usr/share/man/man1/$$(basename $$f).1; \ 11 | 12 | #autotools doesn't let you override this properly 13 | # https://bugs.launchpad.net/ubuntu/+source/automake/+bug/1250877 14 | sed -i 's,^pythondir = .*,pythondir = $${prefix}/lib/python3/dist-packages,' Makefile 15 | 16 | dh_auto_install 17 | 18 | override_dh_install: 19 | #use libjs-jquery instead 20 | rm -f out/libsmbios_c/html/jquery.js 21 | ln -s /usr/share/javascript/jquery/jquery.js out/libsmbios_c/html/jquery.js 22 | #we don't want to install pre-compiled byte code 23 | rm -rf debian/tmp/usr/lib/python3/dist-packages/libsmbios_c/__pycache__ \ 24 | debian/tmp/usr/share/smbios-utils/__pycache__/ 25 | dh_install -XLICENSE 26 | -------------------------------------------------------------------------------- /pkg/debian/smbios-utils.install: -------------------------------------------------------------------------------- 1 | debian/tmp/usr/sbin/* usr/sbin 2 | debian/tmp/usr/share/smbios* usr/share 3 | debian/tmp/etc/* etc 4 | debian/tmp/usr/share/man* usr/share 5 | -------------------------------------------------------------------------------- /pkg/debian/smbios-utils.links: -------------------------------------------------------------------------------- 1 | usr/sbin/smbios-wireless-ctl usr/sbin/dellWirelessCtl 2 | usr/sbin/smbios-sys-info usr/sbin/getSystemId 3 | usr/sbin/smbios-lcd-brightness usr/sbin/dellLcdBrightness 4 | usr/share/man/man1/smbios-wireless-ctl.1 usr/share/man/man1/dellWirelessCtl.1 5 | usr/share/man/man1/smbios-sys-info.1 usr/share/man/man1/getSystemId.1 6 | usr/share/man/man1/smbios-lcd-brightness.1 usr/share/man/man1/dellLcdBrightness.1 7 | -------------------------------------------------------------------------------- /pkg/debian/smbios-utils.postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | #DEBHELPER# 4 | dpkg-maintscript-helper rm_conffile \ 5 | /etc/yum/pluginconf.d/dellsysid.conf 2.4.0-2~ smbios-utils -- "$@" 6 | 7 | -------------------------------------------------------------------------------- /pkg/debian/smbios-utils.postrm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | #DEBHELPER# 4 | dpkg-maintscript-helper rm_conffile \ 5 | /etc/yum/pluginconf.d/dellsysid.conf 2.4.0-2~ smbios-utils -- "$@" 6 | 7 | -------------------------------------------------------------------------------- /pkg/debian/smbios-utils.preinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | #DEBHELPER# 4 | dpkg-maintscript-helper rm_conffile \ 5 | /etc/yum/pluginconf.d/dellsysid.conf 2.4.0-2~ smbios-utils -- "$@" 6 | 7 | -------------------------------------------------------------------------------- /pkg/debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /pkg/debian/watch: -------------------------------------------------------------------------------- 1 | version=3 2 | opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/libsmbios-$1\.tar\.gz/ \ 3 | https://github.com/dell/libsmbios/tags .*/v?(\d\S*)\.tar\.gz 4 | -------------------------------------------------------------------------------- /pkg/dlopen.h.in: -------------------------------------------------------------------------------- 1 | // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c: 2 | /* 3 | * Copyright (C) 2005 Dell Inc. 4 | * by Michael Brown 5 | * Licensed under the Open Software License version 2.1 6 | * 7 | * Alternatively, you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation; either version 2 of the License, 10 | * or (at your option) any later version. 11 | 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 15 | * See the GNU General Public License for more details. 16 | */ 17 | 18 | 19 | // Use this header if you are using dlopen to ensure that you get the same ABI 20 | // version as what you are compiling against 21 | 22 | #ifndef DLOPEN_H 23 | #define DLOPEN_H 24 | 25 | #define LIBSMBIOS_LIBNAME "@LIBSMBIOS_CPLUSPLUS_SONAME@" 26 | #define LIBSMBIOS_C_LIBNAME "@LIBSMBIOS_C_SONAME@" 27 | 28 | #endif /* DLOPEN_H */ 29 | -------------------------------------------------------------------------------- /pkg/dockerfiles/Dockerfile.centos8: -------------------------------------------------------------------------------- 1 | FROM centos:8 2 | 3 | VOLUME /output 4 | 5 | ENV OUTPUT_DIR /build/dist 6 | ENV BUILD_DIR /build 7 | 8 | RUN yum install dnf-plugins-core -y 9 | RUN yum config-manager --set-enabled PowerTools -y 10 | RUN yum install -y \ 11 | rpm-build gettext-devel libxml2-devel xz libtool git gcc-c++ doxygen make help2man python36-devel \ 12 | && yum clean all 13 | 14 | WORKDIR $BUILD_DIR 15 | COPY . . 16 | 17 | CMD ["./pkg/dockerfiles/centos8-entrypoint.sh"] 18 | -------------------------------------------------------------------------------- /pkg/dockerfiles/Dockerfile.debian: -------------------------------------------------------------------------------- 1 | FROM debian:testing 2 | 3 | RUN echo "deb-src http://deb.debian.org/debian/ testing main" >> /etc/apt/sources.list 4 | RUN apt-get update -qq && apt-get install -yq --no-install-recommends \ 5 | build-essential \ 6 | debhelper \ 7 | devscripts \ 8 | doxygen \ 9 | fakeroot \ 10 | git \ 11 | graphviz \ 12 | help2man \ 13 | python \ 14 | libxml2-dev \ 15 | lsb-release \ 16 | pkg-config \ 17 | autoconf \ 18 | automake \ 19 | libtool \ 20 | gettext \ 21 | autopoint 22 | RUN mkdir /build 23 | WORKDIR /build 24 | COPY . . 25 | CMD ["./pkg/mk-rel-deb.sh"] 26 | -------------------------------------------------------------------------------- /pkg/dockerfiles/centos8-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ./pkg/mk-rel-rpm.sh 4 | cp $BUILD_DIR/_builddir/*.rpm $OUTPUT_DIR 5 | cp $BUILD_DIR/_builddir/x86_64/*.rpm $OUTPUT_DIR 6 | -------------------------------------------------------------------------------- /pkg/libsmbios_c-uninstalled.pc.in: -------------------------------------------------------------------------------- 1 | prefix= 2 | exec_prefix= 3 | abs_top_srcdir=@abs_top_srcdir@ 4 | abs_top_builddir=@abs_top_builddir@ 5 | 6 | python_path_add=@abs_top_srcdir@/src/python/ 7 | 8 | Name: libsmbios_c (uninstalled copy) 9 | Description: C lib for accessing system dmi information 10 | Version: @VERSION@ 11 | Requires: pkg-config >= 0.21 12 | Requires.private: 13 | Libs: ${abs_top_builddir}/out/libsmbios_c.la 14 | Cflags: -I${abs_top_srcdir}/src/include -I${abs_top_builddir}/out/public-include/ 15 | -------------------------------------------------------------------------------- /pkg/libsmbios_c.pc.in: -------------------------------------------------------------------------------- 1 | # This is a comment 2 | prefix=@prefix@ 3 | exec_prefix=@exec_prefix@ 4 | libdir=@libdir@ 5 | includedir=@includedir@ 6 | 7 | Name: libsmbios_c 8 | Description: C libraries for accessing dmi data 9 | Version: @VERSION@ 10 | URL: http://linux.dell.com/libsmbios/main/ 11 | Requires: 12 | Conflicts: 13 | Libs: -L${libdir} -lsmbios_c 14 | Libs.private: 15 | Cflags: 16 | -------------------------------------------------------------------------------- /pkg/mk-rel-deb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | test_package () { 5 | if ! which $1 >/dev/null; then 6 | echo "Missing dpkg-checkbuilddeps, installing" 7 | apt install --no-install-recommends -y $2 8 | fi 9 | } 10 | 11 | test_package dpkg-checkbuilddeps dpkg-dev 12 | test_package lsb_release lsb-release 13 | test_package dch devscripts 14 | 15 | DEPS=$(dpkg-checkbuilddeps pkg/debian/control 2>&1 || true) 16 | if [ -n "$DEPS" ]; then 17 | echo "$DEPS, installing" 18 | apt install -y `echo $DEPS | sed 's,.*dependencies:,,; s,([^)]*),,'` 19 | fi 20 | 21 | ./autogen.sh 22 | make debs 23 | -------------------------------------------------------------------------------- /pkg/mk-rel-rpm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # vim:et:ai:ts=4:sw=4:filetype=sh:tw=0: 3 | 4 | set -x 5 | 6 | cur_dir=$(cd $(dirname $0); pwd) 7 | cd $cur_dir/../ 8 | 9 | umask 002 10 | 11 | set -e 12 | 13 | chmod -R +w _builddir ||: 14 | rm -rf _builddir 15 | 16 | mkdir _builddir 17 | pushd _builddir 18 | ../autogen.sh 19 | if [ -n "$CI" ]; then 20 | CI="CI=--define '_with_unit_tests 1'" 21 | fi 22 | make rpm "$CI" 23 | -------------------------------------------------------------------------------- /pkg/oscrc-development: -------------------------------------------------------------------------------- 1 | [general] 2 | 3 | # Downloaded packages are cached here. Must be writable by you. 4 | #packagecachedir = /var/tmp/osbuild-packagecache 5 | 6 | # Wrapper to call build as root (sudo, su -, ...) 7 | #su-wrapper = su -c 8 | 9 | # rootdir to setup the chroot environment 10 | # can contain %(repo)s and/or %(arch)s for replacement 11 | #build-root = /var/tmp/build-root 12 | 13 | # use this API server 14 | # (it needs a section [api.opensuse.org] with the credentials) 15 | #apisrv = https://api.opensuse.org 16 | 17 | # our local build service api: 18 | apisrv = http://10.35.11.46:8082 19 | 20 | # local default admin account 21 | [http://10.35.11.46:8082] 22 | user = Admin 23 | pass = opensuse 24 | 25 | 26 | -------------------------------------------------------------------------------- /pkg/pkginfo.in: -------------------------------------------------------------------------------- 1 | PKG="DELLbios" 2 | NAME="Dell BIOS update utility" 3 | VERSION="@VERSION@-sunlib" 4 | ARCH="x86" 5 | CLASSES="none" 6 | CATEGORY="utility" 7 | VENDOR="Dell" 8 | PSTAMP="01Aug10" 9 | EMAIL="jordan_hargrave@dell.com" 10 | BASEDIR="/" 11 | -------------------------------------------------------------------------------- /pkg/scripts/HelperXml.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # VIM declarations 3 | # vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=python: 4 | 5 | ############################################################################# 6 | # 7 | # Copyright (c) 2003 Dell Computer Corporation 8 | # All Rights Reserved. 9 | # 10 | ############################################################################# 11 | """ 12 | $Id: HelperXml.py,v 1.1 2004/03/14 06:09:08 michael_e_brown Exp $ 13 | """ 14 | 15 | __version__ = "$Revision: 1.1 $" 16 | # $Source: /home/cvsroot-hb/cvsroot/libsmbios/build/scripts/HelperXml.py,v $ 17 | 18 | import types 19 | 20 | def getText(nodelist): 21 | rc = "" 22 | if nodelist is not None: 23 | for node in nodelist: 24 | if node.nodeType == node.TEXT_NODE: 25 | rc = rc + node.data 26 | return rc 27 | 28 | def getNodeText( node, *args ): 29 | rc = "" 30 | node = getNodeElement(node, *args) 31 | if node is not None: 32 | rc = getText( node.childNodes ) 33 | return rc 34 | 35 | def getNodeElement( node, *args ): 36 | if len(args) == 0: 37 | return node 38 | 39 | #print "DEBUG: args(%s)" % repr(args) 40 | if node is not None: 41 | for search in node.childNodes: 42 | if isinstance(args[0], str): 43 | if search.nodeName == args[0]: 44 | candidate = getNodeElement( search, *args[1:] ) 45 | if candidate is not None: 46 | return candidate 47 | else: 48 | if search.nodeName == args[0][0]: 49 | attrHash = args[0][1] 50 | found = 1 51 | for (key, value) in list(attrHash.items()): 52 | if search.getAttribute( key ) != value: 53 | found = 0 54 | if found: 55 | candidate = getNodeElement( search, *args[1:] ) 56 | if candidate is not None: 57 | return candidate 58 | 59 | return None 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /pkg/scripts/compile-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # the purpose of this program is to test that each header (include/*.h) will 5 | # properly compile stand-alone. 6 | # 7 | # a .cpp file is created for each header, and include for that specific header 8 | # is added to the .cpp file. The #include line is the only line in the header. 9 | # This is then compiled. There should be no errors or warnings. 10 | # 11 | 12 | outDir=cctest-$$-$RANDOM/ 13 | mkdir $outDir 14 | RETCODE=0 15 | 16 | for i in include/smbios/*.h ; 17 | do 18 | echo "Test standalone compilation of $i" 19 | echo "#include \"smbios/$(basename $i)\"" > $outDir/$(basename $i .h).cpp 20 | gcc -Wall -c -Iinclude -o $outDir/$(basename $i .h).o $outDir/$(basename $i .h).cpp 21 | if [ $? -ne 0 ]; then RETCODE=$?; fi 22 | done 23 | 24 | rm -rf $outDir 25 | 26 | exit $RETCODE 27 | -------------------------------------------------------------------------------- /pkg/scripts/genSmbiosDefs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=python: 3 | 4 | 5 | import sys 6 | import xml.dom.minidom 7 | 8 | import HelperXml 9 | 10 | def main(): 11 | try: 12 | doc = xml.dom.minidom.parse( sys.argv[1] ) 13 | elem = HelperXml.getNodeElement( doc, "STRUCTUREDEFS" ) 14 | for node in elem.childNodes: 15 | if node.nodeName == "STRUCTURE": 16 | print(node.getAttribute("description").replace(" ", "_"), " = ", end=' ') 17 | print(node.getAttribute( "type" ), ",") 18 | except (IOError, KeyError): 19 | pass 20 | 21 | 22 | if __name__ == "__main__": 23 | main() 24 | -------------------------------------------------------------------------------- /pkg/scripts/indent.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | astyle --style=ansi -c --indent-namespaces "$@" 4 | 5 | #indent -kr -i8 -ts8 -sob -l80 -ss -bs -psl "$@" 6 | 7 | -------------------------------------------------------------------------------- /pkg/scripts/makeXmlHeader.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # vim: et:ai:sw=4:ts=4:filetype=python:nocindent: 3 | 4 | import sys 5 | 6 | 7 | def writeStdHeaders( out ): 8 | out.write (""" 9 | #ifndef __STD_SMBIOS_XML_H 10 | #define __STD_SMBIOS_XML_H 11 | 12 | // 13 | // This is an *AUTOMATICALLY* *GENERATED* file. Do not edit this file 14 | // as your changes will be lost the next time the file is generated 15 | // 16 | 17 | """) 18 | 19 | def writeStdFooters( out ): 20 | out.write (""" 21 | 22 | #endif /* __STD_SMBIOS_XML_H */ 23 | 24 | """) 25 | 26 | def processFile( input, output ): 27 | charsPerLine = 16 28 | output.write( """ 29 | const char stdXml[] = { """) 30 | 31 | charsWrittenThisLine = charsPerLine 32 | while 1: 33 | c = input.read(1) 34 | if c == "": # end of file 35 | break 36 | if charsWrittenThisLine == charsPerLine/2: 37 | output.write(" ") 38 | if charsWrittenThisLine >= charsPerLine: 39 | output.write( "\n" ) 40 | output.write( "\t" ) 41 | charsWrittenThisLine = 1 42 | output.write( "0x%02x, " % ord(c) ) 43 | charsWrittenThisLine = charsWrittenThisLine + 1 44 | 45 | output.write( """0x00 46 | }; 47 | """) 48 | 49 | def main(): 50 | inputXml = None 51 | outputHeader = None 52 | inputXml = sys.argv[1] 53 | if len(sys.argv) > 2: 54 | outputHeader = sys.argv[2] 55 | 56 | inputFh = open( inputXml, "r" ) 57 | if outputHeader is not None: 58 | outputFh = open( outputHeader, "w+" ) 59 | else: 60 | outputFh = sys.stdout 61 | 62 | writeStdHeaders( outputFh ) 63 | processFile( inputFh, outputFh ) 64 | writeStdFooters( outputFh ) 65 | 66 | 67 | if __name__ == "__main__": 68 | main() 69 | -------------------------------------------------------------------------------- /pkg/scripts/tr-report.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python3 2 | # VIM declarations 3 | # vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=python: 4 | 5 | #must be first 6 | 7 | 8 | import re 9 | import sys 10 | import glob 11 | import os 12 | 13 | def processFile( filename ): 14 | pct = 0 15 | lineCount = 0 16 | linesOfCode = 0 17 | statementsExecuted = 0 18 | 19 | fd = file( filename, "r" ) 20 | while 1: 21 | line = fd.readline() 22 | if line == "": 23 | break 24 | 25 | lineCount = lineCount + 1 26 | 27 | p = re.match( "^\s*-:", line ) 28 | if p is not None: 29 | continue 30 | 31 | p = re.match( "^\s{0,9}\d+:", line ) 32 | if p is not None: 33 | linesOfCode = linesOfCode + 1 34 | statementsExecuted = statementsExecuted + 1 35 | continue 36 | 37 | p = re.match( "^ #####:", line ) 38 | if p is not None: 39 | linesOfCode = linesOfCode + 1 40 | 41 | if linesOfCode == 0: 42 | pct = 1 43 | else: 44 | pct = statementsExecuted / linesOfCode 45 | 46 | return ( pct, lineCount, linesOfCode, statementsExecuted ) 47 | 48 | 49 | def main(): 50 | totalLines = 0 51 | totalLoc = 0 52 | totalExc = 0 53 | path = os.path.join(sys.argv[1], "*.gcov") 54 | 55 | fileList = glob.glob( path ) 56 | fileList.sort() 57 | 58 | print(" PCT\tLINES\tCODE\tEXEC\tFILENAME") 59 | for file in fileList: 60 | (pct, lines, loc, exc) = processFile( file ) 61 | totalLines = totalLines + lines 62 | totalLoc = totalLoc + loc 63 | totalExc = totalExc + exc 64 | file = os.path.basename(file) 65 | file = file[:-5] 66 | print(("%3.0f%%\t%d\t%d\t%d\t%s" % ( (pct*100), lines, loc, exc, file ))) 67 | 68 | if totalLoc == 0: 69 | pct = 1 70 | else: 71 | pct = totalExc / totalLoc 72 | print() 73 | print(("%3.0f%%\t%d\t%d\t%d\t%s" % ( (pct*100), totalLines, totalLoc, totalExc, "TOTAL" ))) 74 | 75 | if __name__ == "__main__": 76 | main() 77 | -------------------------------------------------------------------------------- /pkg/update-docs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | DIR=$(cd $(dirname $0); pwd) 6 | cd $DIR/.. 7 | 8 | [ -e Makefile ] || ./configure 9 | make doxygen || : 10 | rsync -e ssh -vrltH --delete doc/full/html/. /var/ftp/pub/Applications/libsmbios/main/. 11 | 12 | -------------------------------------------------------------------------------- /pkg/upload-obs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | PROJ_TOPDIR=$(cd $(dirname $0); pwd)/../ 5 | 6 | cleanup () { 7 | make distclean ||: 8 | $PROJ_TOPDIR/autogen.sh 9 | make dist 10 | } 11 | 12 | # sets: 13 | # OBS_DEFAULT_PACKAGE 14 | # OBS_DEFAULT_PROJECT 15 | set_version_vars () { 16 | local PACKAGE 17 | local PACKAGE_VERSION 18 | local PACKAGE_STRING 19 | eval "$(make get-version)" 20 | OBS_DEFAULT_PACKAGE=$PACKAGE 21 | OBS_DEFAULT_PROJECT=home:$USER 22 | } 23 | 24 | function usage () 25 | { 26 | echo "usage: $0 [options]" 27 | echo " -p package to use" 28 | echo " -r project to use" 29 | echo " -c osc config to use" 30 | echo " -n do not do cleanup" 31 | exit 1 32 | } 33 | 34 | CLEANUP=1 35 | while getopts "dnp:r:c:" Option 36 | do 37 | case $Option in 38 | d) 39 | set -x 40 | ;; 41 | p) 42 | OBS_PACKAGE=$OPTARG 43 | ;; 44 | r) 45 | OBS_PROJECT=$OPTARG 46 | ;; 47 | c) 48 | readlink -e $OPTARG || echo "Cannot find specified OSC Config: $OPTARG" 49 | OSC_CONFIG=$(readlink -e $OPTARG) 50 | ;; 51 | n) 52 | CLEANUP=0 53 | ;; 54 | *) 55 | usage 56 | ;; 57 | esac 58 | done 59 | shift $(($OPTIND - 1)) 60 | # Move argument pointer to next. 61 | 62 | [ $CLEANUP -eq 0 ] || cleanup 63 | 64 | set_version_vars 65 | 66 | [ -n "$OBS_PACKAGE" ] || OBS_PACKAGE=$OBS_DEFAULT_PACKAGE 67 | [ -n "$OBS_PROJECT" ] || OBS_PROJECT=$OBS_DEFAULT_PROJECT 68 | [ -z "$OSC_CONFIG" ] || OSC_CONFIG="-c $OSC_CONFIG" 69 | 70 | osc $OSC_CONFIG co ${OBS_PROJECT} ${OBS_PACKAGE} 71 | 72 | rm -f ${OBS_PROJECT}/${OBS_PACKAGE}/*.tar.bz2 73 | rm -f ${OBS_PROJECT}/${OBS_PACKAGE}/*.spec 74 | 75 | cp ${OBS_PACKAGE}*.tar.bz2 ${OBS_PROJECT}/${OBS_PACKAGE} 76 | cp */${OBS_PACKAGE}.spec ${OBS_PROJECT}/${OBS_PACKAGE} 77 | 78 | cd ${OBS_PROJECT}/${OBS_PACKAGE} 79 | osc $OSC_CONFIG addremove 80 | yes | osc $OSC_CONFIG updatepacmetafromspec 81 | osc $OSC_CONFIG ci -m "scripted source update" 82 | 83 | 84 | -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- 1 | en 2 | en@quot 3 | en@boldquot 4 | de 5 | es 6 | fr 7 | it 8 | ja 9 | ko 10 | nl 11 | zh_CN 12 | zh_TW 13 | 14 | -------------------------------------------------------------------------------- /po/Makevars: -------------------------------------------------------------------------------- 1 | # Makefile variables for PO directory in any package using GNU gettext. 2 | 3 | # Usually the message domain is the same as the package name. 4 | DOMAIN = $(PACKAGE) 5 | 6 | # These two variables depend on the location of this directory. 7 | subdir = po 8 | top_builddir = .. 9 | 10 | # These options get passed to xgettext. 11 | XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ 12 | 13 | # This is the copyright holder that gets inserted into the header of the 14 | # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding 15 | # package. (Note that the msgstr strings, extracted from the package's 16 | # sources, belong to the copyright holder of the package.) Translators are 17 | # expected to transfer the copyright for their translations to this person 18 | # or entity, or to disclaim their copyright. The empty string stands for 19 | # the public domain; in this case the translators are expected to disclaim 20 | # their copyright. 21 | COPYRIGHT_HOLDER = Dell, Inc 22 | 23 | # This is the email address or URL to which the translators shall report 24 | # bugs in the untranslated strings: 25 | # - Strings which are not entire sentences, see the maintainer guidelines 26 | # in the GNU gettext documentation, section 'Preparing Strings'. 27 | # - Strings which use unclear terms or require additional context to be 28 | # understood. 29 | # - Strings which make invalid assumptions about notation of date, time or 30 | # money. 31 | # - Pluralisation problems. 32 | # - Incorrect English spelling. 33 | # - Incorrect formatting. 34 | # It can be your email address, or a mailing list address where translators 35 | # can write to without being subscribed, or the URL of a web page through 36 | # which the translators can contact you. 37 | MSGID_BUGS_ADDRESS = libsmbios-devel@lists.us.dell.com 38 | 39 | # This is the list of locale categories, beyond LC_MESSAGES, for which the 40 | # message catalogs shall be used. It is usually empty. 41 | EXTRA_LOCALE_CATEGORIES = 42 | -------------------------------------------------------------------------------- /po/POTFILES.in: -------------------------------------------------------------------------------- 1 | src/bin/smbios-passwd 2 | src/bin/smbios-sys-info 3 | src/bin/smbios-token-ctl 4 | src/bin/smbios-wakeup-ctl 5 | src/bin/smbios-wireless-ctl 6 | src/bin/smbios-lcd-brightness 7 | src/bin/smbios-keyboard-ctl 8 | src/bin/smbios-thermal-ctl 9 | 10 | src/bin/smbios-upflag-ctl.c 11 | src/bin/smbios-get-ut-data.c 12 | src/bin/smbios-sys-info-lite.c 13 | src/bin/smbios-state-byte-ctl.c 14 | 15 | src/libsmbios_c/cmos/cmos_obj.c 16 | src/libsmbios_c/cmos/cmos_linux.c 17 | src/libsmbios_c/common/common.c 18 | src/libsmbios_c/memory/memory_obj.c 19 | src/libsmbios_c/memory/memory_linux.c 20 | src/libsmbios_c/smbios/smbios_obj.c 21 | src/libsmbios_c/smi/smi_obj.c 22 | src/libsmbios_c/smi/smi_linux.c 23 | src/libsmbios_c/token/token_d4.c 24 | src/libsmbios_c/token/token_obj.c 25 | 26 | src/python/libsmbios_c/cmos.py 27 | src/python/libsmbios_c/_common.py 28 | src/python/libsmbios_c/__init__.py 29 | src/python/libsmbios_c/memory.py 30 | src/python/libsmbios_c/smbios.py 31 | src/python/libsmbios_c/smi.py 32 | src/python/libsmbios_c/system_info.py 33 | src/python/libsmbios_c/smbios_token.py 34 | -------------------------------------------------------------------------------- /po/zh_CN.po: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/po/zh_CN.po -------------------------------------------------------------------------------- /src/bin/args.txt: -------------------------------------------------------------------------------- 1 | 2 | Things that all executables need to have in order to be moved into 3 | supported-bins/. 4 | - must use getopt, and follow standard argument conventions, listed below. 5 | - must have good error messages for failures 6 | - must follow include file guidelines 7 | - must be properly licensed 8 | - must have proper makefile and static/dynamic executable 9 | - must follow coding style (indentation, spacing, etc) 10 | - should work cross platform (must have _very_ good excuse if not.) 11 | - should allow use against debug memory/cmos dumps (not possible for 12 | things like SMI, though.) 13 | 14 | 15 | STANDARD ARGUMENT CONVENTIONS 16 | 17 | We need to standardize the arguments across the binaries in this dir such that 18 | the following list is always a common list of cmdline options. default help 19 | text is also listed. 20 | 21 | If a program does not use these args, it should never re-use these letters or 22 | long option names for another value. (For example, if an executable doesnt use 23 | --set, it shouldn't use -s for something else.) 24 | 25 | |---------------------> Std getopt seq number 26 | | |----------------> Short option 27 | | | |-----------> Long option 28 | | | | std help text 29 | ============================================================================== 30 | 249 --rawpassword password is in raw format, do not convert to scancode 31 | 250 -s --set ##set a value## -- specific to binary 32 | 251 -g --get ##get a value## -- specific to binary 33 | 252 -p --password BIOS setup password 34 | 253 -c --cmos_file Debug: CMOS dump file to use instead of physical cmos 35 | 254 -m --memory_file Debug: Memory dump file to use instead of physical memory 36 | 255 -v --version display libsmbios/program version 37 | (builtin) -h --help display help text 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/bin/getopts.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, 2002 Steve Mertz 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * Redistributions of source code must retain the above copyright notice, this 9 | * list of conditions and the following disclaimer. 10 | * 11 | * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * Neither the name of Dragon Ware nor the names of its contributors may be 16 | * used to endorse or promote products derived from this software without 17 | * specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS 23 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | */ 32 | #ifndef __GET_OPT_H__ 33 | #define __GET_OPT_H__ 34 | 35 | #ifdef __cplusplus 36 | extern "C" 37 | { 38 | #endif 39 | 40 | extern int option_index; 41 | 42 | struct options 43 | { 44 | int number; /* Number, which is returned from getopt() */ 45 | const char *name; /* Long name */ 46 | const char *description; /* Description */ 47 | const char *shortName; /* Short name */ 48 | int args; /* Does the option take an argument? */ 49 | }; 50 | 51 | int getopts(int argc, char **argv, struct options opts[], char **args); 52 | int getopts_usage(char *progName, struct options opts[]); 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif /* __GET_OPT_H__ */ 59 | -------------------------------------------------------------------------------- /src/bin/getopts_LICENSE.txt: -------------------------------------------------------------------------------- 1 | /* getopts.c - Command line argument parser 2 | * 3 | * Whom: Steve Mertz 4 | * Date: 20010111 5 | * Why: Because I couldn't find one that I liked. So I wrote this one. 6 | * 7 | */ 8 | /* 9 | * Copyright (c) 2001, 2002, Steve Mertz 10 | * All rights reserved. 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * Redistributions of source code must retain the above copyright notice, this 16 | * list of conditions and the following disclaimer. 17 | * 18 | * Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distribution. 21 | * 22 | * Neither the name of Dragon Ware nor the names of its contributors may be 23 | * used to endorse or promote products derived from this software without 24 | * specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 27 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 28 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 29 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS 30 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 31 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 32 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 33 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 34 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 36 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | * 38 | */ 39 | -------------------------------------------------------------------------------- /src/cppunit/Makefile.am: -------------------------------------------------------------------------------- 1 | # vim:noexpandtab:autoindent:tabstop=8:shiftwidth=8:filetype=make:nocindent:tw=0: 2 | CLEANFILES+= testResults.xml src/cppunit/.libs 3 | 4 | EXTRA_DIST += \ 5 | src/cppunit/runtests.sh \ 6 | src/cppunit/test_data \ 7 | src/cppunit/system_dumps 8 | 9 | if BUILD_LIBSMBIOS_CXX 10 | TESTS += src/cppunit/runtests.sh 11 | 12 | UT_CFLAGS= 13 | if BUILD_LINUX 14 | UT_CFLAGS += -DBUILD_LINUX 15 | endif 16 | if BUILD_WINDOWS 17 | UT_CFLAGS += -DBUILD_WINDOWS 18 | endif 19 | 20 | TEST_CPPFLAGS = $(AM_CPPFLAGS) $(CPPUNIT_CFLAGS) $(UT_CFLAGS) $(LIBXML2_CFLAGS) -I$(top_srcdir)/src/libsmbios_c++/common 21 | 22 | # convenience library for test stuff 23 | check_LTLIBRARIES = out/libtestmain.la 24 | out_libtestmain_la_SOURCES = src/cppunit/outputctl.h src/cppunit/main.cpp src/cppunit/main.h 25 | out_libtestmain_la_LIBADD = $(CPPUNIT_LIBS) out/libsmbios_c.la out/libsmbios.la 26 | out_libtestmain_la_LDFLAGS = $(AM_LDFLAGS) -static 27 | 28 | # convenience library for XML stuff 29 | check_LTLIBRARIES += out/libxmlutil.la 30 | out_libxmlutil_la_SOURCES = src/cppunit/XmlUtils.cpp src/cppunit/XmlUtils.h 31 | out_libxmlutil_la_LIBADD = $(LIBXML2_LIBS) 32 | out_libxmlutil_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBXML2_CFLAGS) -I$(top_srcdir)/src/libsmbios_c++/common 33 | out_libxmlutil_la_LDFLAGS = $(AM_LDFLAGS) -static 34 | 35 | check_PROGRAMS += out/testPlatform 36 | out_testPlatform_SOURCES = src/cppunit/testPlatform.h src/cppunit/testPlatform.cpp 37 | out_testPlatform_LDADD = out/libxmlutil.la out/libtestmain.la $(AM_LDADD) 38 | out_testPlatform_LDFLAGS = $(AM_LDFLAGS) -static 39 | out_testPlatform_CPPFLAGS = $(TEST_CPPFLAGS) 40 | 41 | check_PROGRAMS += out/testStandalone 42 | out_testStandalone_SOURCES = src/cppunit/testStandalone.h src/cppunit/testStandalone.cpp 43 | out_testStandalone_LDADD = out/libxmlutil.la out/libtestmain.la $(AM_LDADD) 44 | out_testStandalone_LDFLAGS = $(AM_LDFLAGS) -static 45 | out_testStandalone_CPPFLAGS = $(TEST_CPPFLAGS) 46 | 47 | check_PROGRAMS += out/testC_token 48 | out_testC_token_SOURCES = src/cppunit/testC_token.h src/cppunit/testC_token.cpp 49 | out_testC_token_LDADD = out/libxmlutil.la out/libtestmain.la $(AM_LDADD) 50 | out_testC_token_LDFLAGS = $(AM_LDFLAGS) -static 51 | out_testC_token_CPPFLAGS = $(TEST_CPPFLAGS) 52 | 53 | check_PROGRAMS += out/testC_smi 54 | out_testC_smi_SOURCES = src/cppunit/testC_smi.h src/cppunit/testC_smi.cpp 55 | out_testC_smi_LDADD = out/libtestmain.la $(AM_LDADD) 56 | out_testC_smi_LDFLAGS = $(AM_LDFLAGS) -static 57 | out_testC_smi_CPPFLAGS = $(CPPUNIT_CFLAGS) $(AM_CPPFLAGS) $(UT_CFLAGS) 58 | endif 59 | -------------------------------------------------------------------------------- /src/cppunit/main.h: -------------------------------------------------------------------------------- 1 | // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c: 2 | /* 3 | * Copyright (C) 2005 Dell Inc. 4 | * by Michael Brown 5 | * Licensed under the Open Software License version 2.1 6 | * 7 | * Alternatively, you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation; either version 2 of the License, 10 | * or (at your option) any later version. 11 | 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 15 | * See the GNU General Public License for more details. 16 | */ 17 | 18 | 19 | #ifndef _STDFUNCS_H 20 | #define _STDFUNCS_H 21 | 22 | void setupForUnitTesting(std::string testdir, std::string writedir); 23 | void reset(); 24 | 25 | std::string &strip_trailing_whitespace(std::string &s); 26 | void copyFile( std::string dstFile, std::string srcFile ); 27 | bool fileExists(std::string fileName); 28 | size_t FWRITE(const void *ptr, size_t size, size_t nmemb, FILE *stream); 29 | 30 | #endif /* ! defined _STDFUNCS_H */ 31 | -------------------------------------------------------------------------------- /src/cppunit/runtests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #set -x 4 | set -e 5 | 6 | DIR=$(cd $(dirname $0); pwd) 7 | 8 | TMPDIR=$PWD/out/test 9 | mkdir -p $TMPDIR 10 | 11 | [ -n "$TST" ] || TST=out 12 | 13 | export MALLOC_PERTURB_=0xBABADABA 14 | 15 | reconstruct_memdump() { 16 | source_dir=$1 17 | target_dir=$2 18 | 19 | [ ! -e $target_dir/memdump.dat ] || return 0 20 | 21 | dd if=/dev/zero of=$target_dir/memdump.dat bs=1 count=1 conv=notrunc seek=$(( 0x100000 - 1 )) > /dev/null 2>&1 22 | 23 | # start with smbios, since it should be 0xE0000 24 | if [ -e $source_dir/smbios.dat ]; then 25 | #echo "laying down smbios table." 26 | dd if=$source_dir/smbios.dat of=$target_dir/memdump.dat bs=1 conv=notrunc seek=$(( 0xE0000 )) > /dev/null 2>&1 27 | fi 28 | 29 | if [ -e $source_dir/sysstr.dat ]; then 30 | #echo "laying down system string" 31 | dd if=$source_dir/sysstr.dat of=$target_dir/memdump.dat bs=1 conv=notrunc seek=$(( 0xFE076 )) > /dev/null 2>&1 32 | fi 33 | 34 | if [ -e $source_dir/idbyte.dat ]; then 35 | #echo "laying down id byte" 36 | dd if=$source_dir/idbyte.dat of=$target_dir/memdump.dat bs=1 conv=notrunc seek=$(( 0xFE840 )) > /dev/null 2>&1 37 | fi 38 | 39 | for offsetfn in $source_dir/offset-*.dat; 40 | do 41 | [ -e $offsetfn ] || continue 42 | fn=$(basename $offsetfn) 43 | basefn=$(basename $fn .dat) 44 | offset=${basefn##offset-} 45 | echo "lay down offsets $offset" 46 | dd if=$offsetfn of=$target_dir/memdump.dat bs=1 conv=notrunc seek=$(( $offset )) > /dev/null 2>&1 47 | done 48 | } 49 | 50 | run_test() { 51 | target_dir=$TMPDIR 52 | test_binary=$1 53 | source_dir=$2 54 | echo -e $3 55 | if [ ! -e $TST/${test_binary} -a -e $TST/${test_binary}.exe ]; then 56 | test_binary=${test_binary}.exe 57 | fi 58 | rm -rf $TMPDIR/* 59 | if [ -n "$source_dir" ]; then 60 | cp $source_dir/* $target_dir/ ||: 61 | reconstruct_memdump $target_dir $target_dir 62 | fi 63 | $VALGRIND $TST/$test_binary $TMPDIR $(basename "$source_dir") 64 | } 65 | 66 | 67 | [ ${RUN_CPP_TEST} -ne 1 ] || run_test testStandalone $DIR/test_data/opti "\n\nRunning Standalone tests." 68 | [ ${RUN_C_TEST} -ne 1 ] || run_test testC_smi $DIR/test_data/opti "\n\nRunning SMI tests." 69 | 70 | if [ "$TEST_STANDALONE_ONLY" = "1" ]; then exit 0; fi 71 | 72 | for i in $DIR/test_data/opti $DIR/system_dumps/* ${UNIT_TEST_DATA_DIR}/platform/*; do 73 | [ -e $i ] || continue 74 | [ ${RUN_C_TEST} -ne 1 ] || run_test testC_token $i "\n\nRunning TOKEN test for $i" 75 | [ ${RUN_CPP_TEST:=1} -ne 1 ] || run_test testPlatform $i "\n\nRunning PLATFORM test for $i" 76 | done 77 | -------------------------------------------------------------------------------- /src/cppunit/system_dumps: -------------------------------------------------------------------------------- 1 | ../pyunit/system_dumps/ -------------------------------------------------------------------------------- /src/cppunit/testC_smi.h: -------------------------------------------------------------------------------- 1 | // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c: 2 | /* 3 | * Copyright (C) 2005 Dell Inc. 4 | * by Michael Brown 5 | * Licensed under the Open Software License version 2.1 6 | * 7 | * Alternatively, you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation; either version 2 of the License, 10 | * or (at your option) any later version. 11 | 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 15 | * See the GNU General Public License for more details. 16 | */ 17 | 18 | 19 | #ifndef _TESTCSMI_H 20 | #define _TESTCSMI_H 21 | 22 | #include "smbios_c/compat.h" 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | extern int global_argc; 29 | extern char ** global_argv; 30 | 31 | class testCsmi : public CppUnit::TestFixture 32 | { 33 | protected: 34 | virtual std::string getWritableDirectory() 35 | { 36 | //return DEFAULT_TEST_DIR; 37 | return global_argv[1]; 38 | }; 39 | 40 | 41 | virtual std::string getTestName() 42 | { 43 | //return TEST_DIR; 44 | return global_argv[2]; 45 | } 46 | 47 | virtual std::string getTestDirectory() 48 | { 49 | //return DEFAULT_TEST_DIR; 50 | return global_argv[1]; 51 | }; 52 | 53 | public: 54 | virtual void setUp(); 55 | virtual void tearDown(); 56 | 57 | // base smbios test 58 | void testSmiConstruct(); 59 | void testSmiBuffer(); 60 | void testLinuxSmi(); 61 | 62 | // make sure to put this at the end... 63 | CPPUNIT_TEST_SUITE (testCsmi); 64 | 65 | CPPUNIT_TEST (testSmiConstruct); 66 | CPPUNIT_TEST (testSmiBuffer); 67 | CPPUNIT_TEST (testLinuxSmi); 68 | 69 | CPPUNIT_TEST_SUITE_END (); 70 | }; 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /src/cppunit/testC_token.h: -------------------------------------------------------------------------------- 1 | // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c: 2 | /* 3 | * Copyright (C) 2005 Dell Inc. 4 | * by Michael Brown 5 | * Licensed under the Open Software License version 2.1 6 | * 7 | * Alternatively, you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation; either version 2 of the License, 10 | * or (at your option) any later version. 11 | 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 15 | * See the GNU General Public License for more details. 16 | */ 17 | 18 | 19 | #ifndef _TESTCTOKEN_H 20 | #define _TESTCTOKEN_H 21 | 22 | #include "smbios_c/compat.h" 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #include "XmlUtils.h" 29 | 30 | extern int global_argc; 31 | extern char ** global_argv; 32 | 33 | class testCtoken : public CppUnit::TestFixture 34 | { 35 | protected: 36 | virtual std::string getWritableDirectory() 37 | { 38 | //return DEFAULT_TEST_DIR; 39 | return global_argv[1]; 40 | }; 41 | 42 | 43 | virtual std::string getTestName() 44 | { 45 | //return TEST_DIR; 46 | return global_argv[2]; 47 | } 48 | 49 | virtual std::string getTestDirectory() 50 | { 51 | //return DEFAULT_TEST_DIR; 52 | return global_argv[1]; 53 | }; 54 | 55 | std::string getTestInputString( std::string toFind, std::string section="systemInfo" ); 56 | 57 | void checkSkipTest( std::string testName); 58 | 59 | // parser owns all XML entities. When it is deleted, everything 60 | // goes with it. 61 | XML_NAMESPACE DOMBuilder *parser; 62 | 63 | // The doc is owned by the parser. We do not have to clean it up 64 | // it is deleted when the parser is released. We keep a ref 65 | // here for speed purposes 66 | XML_NAMESPACE DOMDocument *doc; 67 | 68 | 69 | public: 70 | virtual void setUp(); 71 | virtual void tearDown(); 72 | 73 | // base smbios test 74 | void testTokenConstruct(); 75 | void testTokenChecksums(); 76 | 77 | // make sure to put this at the end... 78 | CPPUNIT_TEST_SUITE (testCtoken); 79 | 80 | CPPUNIT_TEST (testTokenConstruct); 81 | CPPUNIT_TEST (testTokenChecksums); 82 | 83 | CPPUNIT_TEST_SUITE_END (); 84 | }; 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /src/cppunit/test_data: -------------------------------------------------------------------------------- 1 | ../pyunit/test_data/ -------------------------------------------------------------------------------- /src/include/Makefile.am: -------------------------------------------------------------------------------- 1 | smbios_cdir = $(includedir)/smbios_c 2 | smbios_c_HEADERS = \ 3 | src/include/smbios_c/cmos.h \ 4 | src/include/smbios_c/memory.h \ 5 | src/include/smbios_c/smbios.h \ 6 | src/include/smbios_c/token.h \ 7 | src/include/smbios_c/compat.h \ 8 | src/include/smbios_c/types.h \ 9 | src/include/smbios_c/smi.h \ 10 | src/include/smbios_c/system_info.h 11 | 12 | smbios_c_configdir = $(includedir)/smbios_c/config 13 | smbios_c_config_HEADERS = \ 14 | src/include/smbios_c/config/suffix.h \ 15 | src/include/smbios_c/config/auto_link.h \ 16 | src/include/smbios_c/config/select_platform_config.h \ 17 | src/include/smbios_c/config/abi_suffix.h \ 18 | src/include/smbios_c/config/user.h \ 19 | src/include/smbios_c/config/select_compiler_config.h \ 20 | src/include/smbios_c/config/abi_prefix.h \ 21 | src/include/smbios_c/config/get_config.h 22 | 23 | smbios_c_abidir = $(includedir)/smbios_c/config/abi 24 | smbios_c_abi_HEADERS = \ 25 | src/include/smbios_c/config/abi/msvc_prefix.h \ 26 | src/include/smbios_c/config/abi/msvc_suffix.h 27 | 28 | smbios_c_platformdir = $(includedir)/smbios_c/config/platform 29 | smbios_c_platform_HEADERS = \ 30 | src/include/smbios_c/config/platform/win64.h \ 31 | src/include/smbios_c/config/platform/win32.h \ 32 | src/include/smbios_c/config/platform/linux.h 33 | 34 | smbios_c_compilerdir = $(includedir)/smbios_c/config/compiler 35 | smbios_c_compiler_HEADERS = \ 36 | src/include/smbios_c/config/compiler/sunpro_cc.h \ 37 | src/include/smbios_c/config/compiler/visualc.h \ 38 | src/include/smbios_c/config/compiler/gcc.h 39 | 40 | smbios_c_objdir = $(includedir)/smbios_c/obj 41 | smbios_c_obj_HEADERS = \ 42 | src/include/smbios_c/obj/cmos.h \ 43 | src/include/smbios_c/obj/memory.h \ 44 | src/include/smbios_c/obj/smbios.h \ 45 | src/include/smbios_c/obj/token.h \ 46 | src/include/smbios_c/obj/smi.h 47 | -------------------------------------------------------------------------------- /src/include/smbios_c/compat.h: -------------------------------------------------------------------------------- 1 | /* vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c:cindent: 2 | */ 3 | /* 4 | * Copyright (C) 2005 Dell Inc. 5 | * by Michael Brown 6 | * Licensed under the Open Software License version 2.1 7 | * 8 | * Alternatively, you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published 10 | * by the Free Software Foundation; either version 2 of the License, 11 | * or (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | * See the GNU General Public License for more details. 17 | */ 18 | 19 | 20 | #ifndef LIBSMBIOS_C_COMPAT_H_INCLUDED 21 | #define LIBSMBIOS_C_COMPAT_H_INCLUDED 22 | 23 | #ifdef LIBSMBIOS_C_SOURCE 24 | #include "libsmbios_c_source.h" 25 | #endif 26 | 27 | #include "smbios_c/config/get_config.h" 28 | #include "smbios_c/config/auto_link.h" 29 | 30 | /* 31 | * CHANGES TO THIS FILE CAUSE A WHOLE-PROJECT REBUILD! 32 | * Keep changes here to a minimum! 33 | */ 34 | 35 | #if defined(LIBSMBIOS_C_HAS_DECLSPEC) && defined(LIBSMBIOS_C_ALL_DYN_LINK) 36 | # if defined(LIBSMBIOS_C_SOURCE) 37 | # define LIBSMBIOS_C_DLL_SPEC __declspec(dllexport) 38 | # else 39 | # define LIBSMBIOS_C_DLL_SPEC __declspec(dllimport) 40 | # endif /* SMBIOS_EXPORTS */ 41 | #endif 42 | 43 | #if defined(LIBSMBIOS_C_HAS_VISIBILITY_ATTR) && defined(LIBSMBIOS_C_ALL_DYN_LINK) 44 | # define LIBSMBIOS_C_DLL_SPEC __attribute__ ((visibility ("default"))) 45 | #endif 46 | 47 | #ifndef LIBSMBIOS_C_DLL_SPEC 48 | # define LIBSMBIOS_C_DLL_SPEC 49 | #endif 50 | 51 | #ifdef __cplusplus 52 | #define EXTERN_C_BEGIN extern "C" { 53 | #define EXTERN_C_END } 54 | #else 55 | #define EXTERN_C_BEGIN 56 | #define EXTERN_C_END 57 | #endif 58 | 59 | #ifdef LIBSMBIOS_C_PLATFORM_WIN32 60 | # define WIN32_LEAN_AND_MEAN /* Exclude rarely-used stuff from Windows headers */ 61 | # include 62 | #endif /* LIBSMBIOS_C_PLATFORM_WIN32 */ 63 | 64 | #endif /* COMPAT_H */ 65 | -------------------------------------------------------------------------------- /src/include/smbios_c/config/README: -------------------------------------------------------------------------------- 1 | 2 | We have decided to use a boost-style configuration system for libsmbios. The 3 | headers in and below this directory are mostly imported from boost with all 4 | "BOOST" prefixes changed to LIBSMBIOS. 5 | 6 | Please ensure that all copyright information from boost.org is retained. Add a 7 | message about libsmbios modifying it and importing it. Boost has a BSD-Style 8 | license, so there should be no problem using portions of their code. Please 9 | ensure that boost code is contained under this directory, though. 10 | 11 | -------------------------------------------------------------------------------- /src/include/smbios_c/config/abi/msvc_prefix.h: -------------------------------------------------------------------------------- 1 | // (C) Copyright John Maddock 2003. 2 | // Use, modification and distribution are subject to the 3 | // Boost Software License, Version 1.0. (See accompanying file 4 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | #pragma pack(push,8) 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/include/smbios_c/config/abi/msvc_suffix.h: -------------------------------------------------------------------------------- 1 | // (C) Copyright John Maddock 2003. 2 | // Use, modification and distribution are subject to the 3 | // Boost Software License, Version 1.0. (See accompanying file 4 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | #pragma pack(pop) 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/include/smbios_c/config/abi_prefix.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/include/smbios_c/config/abi_prefix.h -------------------------------------------------------------------------------- /src/include/smbios_c/config/abi_suffix.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/include/smbios_c/config/abi_suffix.h -------------------------------------------------------------------------------- /src/include/smbios_c/config/boost_LICENSE_1_0_txt: -------------------------------------------------------------------------------- 1 | Portions of the code in this subdirectory are taken from the boost project at 2 | http://www.boost.org/. The license below applies to this code. 3 | 4 | 5 | Boost Software License - Version 1.0 - August 17th, 2003 6 | 7 | Permission is hereby granted, free of charge, to any person or organization 8 | obtaining a copy of the software and accompanying documentation covered by 9 | this license (the "Software") to use, reproduce, display, distribute, 10 | execute, and transmit the Software, and to prepare derivative works of the 11 | Software, and to permit third-parties to whom the Software is furnished to 12 | do so, all subject to the following: 13 | 14 | The copyright notices in the Software and this entire statement, including 15 | the above license grant, this restriction and the following disclaimer, 16 | must be included in all copies of the Software, in whole or in part, and 17 | all derivative works of the Software, unless such copies or derivative 18 | works are solely in the form of machine-executable object code generated by 19 | a source language processor. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 24 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 25 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | DEALINGS IN THE SOFTWARE. 28 | 29 | -------------------------------------------------------------------------------- /src/include/smbios_c/config/compiler/gcc.h: -------------------------------------------------------------------------------- 1 | // (C) Copyright John Maddock 2001 - 2003. 2 | // (C) Copyright Darin Adler 2001 - 2002. 3 | // (C) Copyright Jens Maurer 2001 - 2002. 4 | // (C) Copyright Beman Dawes 2001 - 2003. 5 | // (C) Copyright Douglas Gregor 2002. 6 | // (C) Copyright David Abrahams 2002 - 2003. 7 | // (C) Copyright Synge Todo 2003. 8 | // Use, modification and distribution are subject to the 9 | // Boost Software License, Version 1.0. (See accompanying file 10 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 11 | 12 | // See http://www.boost.org for most recent version. 13 | 14 | #define LIBSMBIOS_C_HAS_PRETTY_FUNCTION 15 | #define LIBSMBIOS_C_HAS_FUNCTION 16 | #define LIBSMBIOS_C_PACKED_ATTR __attribute__ ((packed)) 17 | #define LIBSMBIOS_C_COMPILER "GNU C++ version " __VERSION__ 18 | #define LIBSMBIOS_C_HAS_LONG_LONG 19 | #define LIBSMBIOS_C_HAS_VISIBILITY_ATTR 20 | 21 | // versions check: 22 | // we don't know gcc prior to version 2.90: 23 | #if (__GNUC__ == 2) && (__GNUC_MINOR__ < 90) 24 | # error "GCC versions < 2.90 not supported" 25 | #endif 26 | // 27 | -------------------------------------------------------------------------------- /src/include/smbios_c/config/compiler/sunpro_cc.h: -------------------------------------------------------------------------------- 1 | // (C) Copyright John Maddock 2001 - 2003. 2 | // (C) Copyright Darin Adler 2001 - 2002. 3 | // (C) Copyright Jens Maurer 2001 - 2002. 4 | // (C) Copyright Beman Dawes 2001 - 2003. 5 | // (C) Copyright Douglas Gregor 2002. 6 | // (C) Copyright David Abrahams 2002 - 2003. 7 | // (C) Copyright Synge Todo 2003. 8 | // Use, modification and distribution are subject to the 9 | // Boost Software License, Version 1.0. (See accompanying file 10 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 11 | 12 | // See http://www.boost.org for most recent version. 13 | 14 | #define LIBSMBIOS_C_HAS_PRETTY_FUNCTION 15 | #define LIBSMBIOS_C_HAS_FUNCTION 16 | #define LIBSMBIOS_C_PACKED_ATTR __attribute__((packed)) 17 | #define LIBSMBIOS_C_COMPILER "Sun C++ version " __VERSION__ 18 | #define LIBSMBIOS_C_HAS_LONG_LONG 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/include/smbios_c/config/compiler/visualc.h: -------------------------------------------------------------------------------- 1 | // (C) Copyright John Maddock 2001 - 2003. 2 | // (C) Copyright Darin Adler 2001 - 2002. 3 | // (C) Copyright Peter Dimov 2001. 4 | // (C) Copyright Aleksey Gurtovoy 2002. 5 | // (C) Copyright David Abrahams 2002 - 2003. 6 | // (C) Copyright Beman Dawes 2002 - 2003. 7 | // Use, modification and distribution are subject to the 8 | // Boost Software License, Version 1.0. (See accompanying file 9 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 10 | 11 | // See http://www.boost.org for most recent version. 12 | 13 | // Microsoft Visual C++ compiler setup: 14 | 15 | #define LIBSMBIOS_C_MSVC _MSC_VER 16 | #define LIBSMBIOS_C_HAS_FUNCTION 17 | #define LIBSMBIOS_C_HAS_LONG_LONG 18 | #define LIBSMBIOS_C_HAS_DECLSPEC 19 | #define LIBSMBIOS_C_PACKED_ATTR 20 | 21 | #ifndef _NATIVE_WCHAR_T_DEFINED 22 | # define LIBSMBIOS_C_NO_INTRINSIC_WCHAR_T 23 | #endif 24 | 25 | // 26 | // prefix and suffix headers: 27 | // 28 | #ifndef LIBSMBIOS_C_ABI_PREFIX 29 | # define LIBSMBIOS_C_ABI_PREFIX "smbios_c/config/abi/msvc_prefix.h" 30 | #endif 31 | #ifndef LIBSMBIOS_C_ABI_SUFFIX 32 | # define LIBSMBIOS_C_ABI_SUFFIX "smbios_c/config/abi/msvc_suffix.h" 33 | #endif 34 | 35 | #if _MSC_VER == 1310 36 | # define LIBSMBIOS_C_COMPILER_VERSION 7.1 37 | # elif _MSC_VER == 1400 38 | # define LIBSMBIOS_C_COMPILER_VERSION 8.0 39 | # elif _MSC_VER == 1500 40 | # define LIBSMBIOS_C_COMPILER_VERSION 9.0 41 | # else 42 | # define LIBSMBIOS_C_COMPILER_VERSION _MSC_VER 43 | #endif 44 | 45 | #define LIBSMBIOS_C_COMPILER "Microsoft Visual C++ version " LIBSMBIOS_C_STRINGIZE(LIBSMBIOS_C_COMPILER_VERSION) 46 | 47 | // 48 | // versions check: 49 | // we don't support Visual C++ prior to version 8: 50 | // need variadic macros 51 | #if _MSC_VER < 1400 52 | #error "Compiler looks ancient. Sorry but we dont support it MSVC++ prior to version 8.0." 53 | #endif 54 | // 55 | // last known and checked version is 1310: 56 | #if (_MSC_VER > 1500) 57 | # if defined(LIBSMBIOS_C_ASSERT_CONFIG) 58 | # error "Unknown compiler version - please run the configure tests and report the results" 59 | # else 60 | # pragma message("Unknown compiler version - please run the configure tests and report the results") 61 | # endif 62 | #endif 63 | -------------------------------------------------------------------------------- /src/include/smbios_c/config/get_config.h: -------------------------------------------------------------------------------- 1 | // Boost config.h configuration header file ------------------------------// 2 | 3 | // (C) Copyright John Maddock 2002. 4 | // Use, modification and distribution are subject to the 5 | // Boost Software License, Version 1.0. (See accompanying file 6 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | // See http://www.boost.org/libs/config for most recent version. 9 | 10 | // Boost config.h policy and rationale documentation has been moved to 11 | // http://www.boost.org/libs/config 12 | // 13 | // CAUTION: This file is intended to be completely stable - 14 | // DO NOT MODIFY THIS FILE! 15 | // 16 | // Modified for libsmbios project: 2004-03-28 by Michael Brown 17 | 18 | #ifndef LIBSMBIOS_C_CONFIG_H 19 | #define LIBSMBIOS_C_CONFIG_H 20 | 21 | // if we don't have a user config, then use the default location: 22 | #if !defined(LIBSMBIOS_C_USER_CONFIG) && !defined(LIBSMBIOS_C_NO_USER_CONFIG) 23 | # define LIBSMBIOS_C_USER_CONFIG 24 | #endif 25 | // include it first: 26 | #ifdef LIBSMBIOS_C_USER_CONFIG 27 | # include LIBSMBIOS_C_USER_CONFIG 28 | #endif 29 | 30 | // if we don't have a compiler config set, try and find one: 31 | #if !defined(LIBSMBIOS_C_COMPILER_CONFIG) && !defined(LIBSMBIOS_C_NO_COMPILER_CONFIG) && !defined(LIBSMBIOS_C_NO_CONFIG) 32 | # include 33 | #endif 34 | // if we have a compiler config, include it now: 35 | #ifdef LIBSMBIOS_C_COMPILER_CONFIG 36 | # include LIBSMBIOS_C_COMPILER_CONFIG 37 | #endif 38 | 39 | 40 | // if we don't have a platform config set, try and find one: 41 | #if !defined(LIBSMBIOS_C_PLATFORM_CONFIG) && !defined(LIBSMBIOS_C_NO_PLATFORM_CONFIG) && !defined(LIBSMBIOS_C_NO_CONFIG) 42 | # include 43 | #endif 44 | // if we have a platform config, include it now: 45 | #ifdef LIBSMBIOS_C_PLATFORM_CONFIG 46 | # include LIBSMBIOS_C_PLATFORM_CONFIG 47 | #endif 48 | 49 | // get config suffix code: 50 | #include 51 | 52 | #endif // LIBSMBIOS_C_CONFIG_H 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /src/include/smbios_c/config/platform/linux.h: -------------------------------------------------------------------------------- 1 | // (C) Copyright John Maddock 2001 - 2003. 2 | // (C) Copyright Jens Maurer 2001 - 2003. 3 | // Use, modification and distribution are subject to the 4 | // Boost Software License, Version 1.0. (See accompanying file 5 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | 7 | // See http://www.boost.org for most recent version. 8 | 9 | // linux specific config options: 10 | 11 | #define LIBSMBIOS_C_PLATFORM "linux" 12 | #define LIBSMBIOS_C_PLATFORM_LINUX 13 | 14 | // we can assume gettext on linux 15 | #define LIBSMBIOS_C_HAS_GETTEXT 16 | #define LIBSMBIOS_C_HAS_UNISTD_H 17 | #include 18 | 19 | -------------------------------------------------------------------------------- /src/include/smbios_c/config/platform/win32.h: -------------------------------------------------------------------------------- 1 | // (C) Copyright John Maddock 2001 - 2003. 2 | // (C) Copyright Bill Kempf 2001. 3 | // (C) Copyright Aleksey Gurtovoy 2003. 4 | // Use, modification and distribution are subject to the 5 | // Boost Software License, Version 1.0. (See accompanying file 6 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | // See http://www.boost.org for most recent version. 9 | 10 | // Win32 specific config options: 11 | 12 | #define LIBSMBIOS_C_PLATFORM "Win32" 13 | #define LIBSMBIOS_C_PLATFORM_WIN32 14 | 15 | -------------------------------------------------------------------------------- /src/include/smbios_c/config/platform/win64.h: -------------------------------------------------------------------------------- 1 | // (C) Copyright John Maddock 2001 - 2003. 2 | // (C) Copyright Bill Kempf 2001. 3 | // (C) Copyright Aleksey Gurtovoy 2003. 4 | // Use, modification and distribution are subject to the 5 | // Boost Software License, Version 1.0. (See accompanying file 6 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | // See http://www.boost.org for most recent version. 9 | 10 | // Win32 specific config options: 11 | 12 | #define LIBSMBIOS_C_PLATFORM "Win32" 13 | #define LIBSMBIOS_C_PLATFORM_WIN32 14 | 15 | -------------------------------------------------------------------------------- /src/include/smbios_c/config/select_compiler_config.h: -------------------------------------------------------------------------------- 1 | // Boost compiler configuration selection header file 2 | 3 | // (C) Copyright John Maddock 2001 - 2003. 4 | // (C) Copyright Martin Wille 2003. 5 | // (C) Copyright Guillaume Melquiond 2003. 6 | // Use, modification and distribution are subject to the 7 | // Boost Software License, Version 1.0. (See accompanying file 8 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | 10 | // See http://www.boost.org for most recent version. 11 | // 12 | // Modified on 2004-03-28 for libsmbios by Michael Brown 13 | // -- libsmbios only supports limited compiler and platform configs, so we 14 | // have removed some of the compilers supported by boost. We can add a 15 | // few back in if they are needed in the future (IBM, Metroworks, etc.) 16 | // 17 | // To add new compiler back in, please copy the relevant lines from boost. 18 | 19 | 20 | // locate which compiler we are using and define 21 | // LIBSMBIOS_COMPILER_CONFIG as needed: 22 | 23 | # if defined __GNUC__ 24 | // GNU C++: 25 | # define LIBSMBIOS_C_COMPILER_CONFIG "smbios_c/config/compiler/gcc.h" 26 | 27 | #elif defined _MSC_VER 28 | // Microsoft Visual C++ 29 | // 30 | // Must remain the last #elif since some other vendors (Metrowerks, for 31 | // example) also #define _MSC_VER 32 | # define LIBSMBIOS_C_COMPILER_CONFIG "smbios_c/config/compiler/visualc.h" 33 | 34 | #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) 35 | // Sun Studio Compiler 36 | #define LIBSMBIOS_C_COMPILER_CONFIG "smbios_c/config/compiler/sunpro_cc.h" 37 | 38 | #elif defined (LIBSMBIOS_C_ASSERT_CONFIG) 39 | // this must come last - generate an error if we don't 40 | // recognise the compiler: 41 | # error "Unknown compiler - please report to libsmbios maintainer." 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/include/smbios_c/config/select_platform_config.h: -------------------------------------------------------------------------------- 1 | // Boost compiler configuration selection header file 2 | 3 | // (C) Copyright John Maddock 2001 - 2002. 4 | // (C) Copyright Jens Maurer 2001. 5 | // Use, modification and distribution are subject to the 6 | // Boost Software License, Version 1.0. (See accompanying file 7 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 8 | 9 | // See http://www.boost.org for most recent version. 10 | // 11 | // Modified on 2004-03-28 for libsmbios by Michael Brown 12 | // -- libsmbios only supports limited compiler and platform configs, so we 13 | // have removed some of the compilers supported by boost. We can add a 14 | // few back in if they are needed in the future (IBM, Metroworks, etc.) 15 | // 16 | // To add new platform back in, please copy the relevant lines from boost. 17 | 18 | 19 | // locate which platform we are on and define LIBSMBIOS_PLATFORM_CONFIG as needed. 20 | // Note that we define the headers to include using "header_name" not 21 | // in order to prevent macro expansion within the header 22 | // name (for example "linux" is a macro on linux systems). 23 | 24 | #if defined(linux) || defined(__linux) || defined(__linux__) 25 | // linux: 26 | # define LIBSMBIOS_C_PLATFORM_CONFIG "smbios_c/config/platform/linux.h" 27 | 28 | #elif defined(_WIN64) || defined(__WIN64__) || defined(WIN64) 29 | // win64: 30 | # define LIBSMBIOS_C_PLATFORM_CONFIG "smbios_c/config/platform/win64.h" 31 | 32 | #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) 33 | // win32: 34 | # define LIBSMBIOS_C_PLATFORM_CONFIG "smbios_c/config/platform/win32.h" 35 | 36 | #else 37 | 38 | # if defined (LIBSMBIOS_C_ASSERT_CONFIG) 39 | // this must come last - generate an error if we don't 40 | // recognise the platform: 41 | # error "Unknown platform - please report to libsmbios maintainer." 42 | # endif 43 | 44 | #endif 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/include/smbios_c/obj/cmos.h: -------------------------------------------------------------------------------- 1 | // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c: 2 | /* 3 | * Copyright (C) 2005 Dell Inc. 4 | * by Michael Brown 5 | * Licensed under the Open Software License version 2.1 6 | * 7 | * Alternatively, you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation; either version 2 of the License, 10 | * or (at your option) any later version. 11 | 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 15 | * See the GNU General Public License for more details. 16 | */ 17 | 18 | 19 | #ifndef C_OBJ_CMOS_H 20 | #define C_OBJ_CMOS_H 21 | 22 | // include smbios_c/compat.h first 23 | #include "smbios_c/compat.h" 24 | 25 | #include "smbios_c/types.h" 26 | 27 | EXTERN_C_BEGIN; 28 | 29 | #define CMOS_DEFAULTS 0x0000 30 | #define CMOS_GET_SINGLETON 0x0001 31 | #define CMOS_GET_NEW 0x0002 32 | #define CMOS_UNIT_TEST_MODE 0x0004 33 | #define CMOS_NO_ERR_CLEAR 0x0008 34 | 35 | // forward declaration to reduce header file deps 36 | struct cmos_access_obj; 37 | 38 | LIBSMBIOS_C_DLL_SPEC struct cmos_access_obj *cmos_obj_factory(int flags, ...); 39 | LIBSMBIOS_C_DLL_SPEC void cmos_obj_free(struct cmos_access_obj *); 40 | 41 | LIBSMBIOS_C_DLL_SPEC int cmos_obj_read_byte(const struct cmos_access_obj *, u8 *byte, u32 indexPort, u32 dataPort, u32 offset); 42 | LIBSMBIOS_C_DLL_SPEC int cmos_obj_write_byte(const struct cmos_access_obj *, u8 byte, u32 indexPort, u32 dataPort, u32 offset); 43 | 44 | // format error string 45 | LIBSMBIOS_C_DLL_SPEC const char *cmos_obj_strerror(const struct cmos_access_obj *m); 46 | 47 | // useful for checksums, etc 48 | typedef int (*cmos_write_callback)(const struct cmos_access_obj *, bool, void *); 49 | LIBSMBIOS_C_DLL_SPEC void cmos_obj_register_write_callback(struct cmos_access_obj *, cmos_write_callback, void *, void (*destruct)(void *)); 50 | LIBSMBIOS_C_DLL_SPEC int cmos_obj_run_callbacks(const struct cmos_access_obj *m, bool do_update); 51 | 52 | EXTERN_C_END; 53 | 54 | #endif /* CMOS_H */ 55 | -------------------------------------------------------------------------------- /src/include/smbios_c/obj/memory.h: -------------------------------------------------------------------------------- 1 | // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c: 2 | /* 3 | * Copyright (C) 2005 Dell Inc. 4 | * by Michael Brown 5 | * Licensed under the Open Software License version 2.1 6 | * 7 | * Alternatively, you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation; either version 2 of the License, 10 | * or (at your option) any later version. 11 | 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 15 | * See the GNU General Public License for more details. 16 | */ 17 | 18 | #ifndef C_OBJ_MEMORY_H 19 | #define C_OBJ_MEMORY_H 20 | 21 | // include smbios_c/compat.h first 22 | #include "smbios_c/compat.h" 23 | #include "smbios_c/types.h" 24 | 25 | EXTERN_C_BEGIN; 26 | 27 | #define MEMORY_DEFAULTS 0x0000 28 | #define MEMORY_GET_SINGLETON 0x0001 29 | #define MEMORY_GET_NEW 0x0002 30 | #define MEMORY_UNIT_TEST_MODE 0x0004 31 | #define MEMORY_NO_ERR_CLEAR 0x0008 32 | 33 | struct memory_access_obj; 34 | 35 | // construct 36 | LIBSMBIOS_C_DLL_SPEC struct memory_access_obj *memory_obj_factory(int flags, ...); 37 | 38 | // destruct 39 | LIBSMBIOS_C_DLL_SPEC void memory_obj_free(struct memory_access_obj *); 40 | 41 | LIBSMBIOS_C_DLL_SPEC int memory_obj_read(const struct memory_access_obj *, void *buffer, u64 offset, size_t length); 42 | LIBSMBIOS_C_DLL_SPEC int memory_obj_write(const struct memory_access_obj *, void *buffer, u64 offset, size_t length); 43 | 44 | // format error string 45 | LIBSMBIOS_C_DLL_SPEC const char *memory_obj_strerror(const struct memory_access_obj *m); 46 | 47 | // helper 48 | LIBSMBIOS_C_DLL_SPEC s64 memory_obj_search(const struct memory_access_obj *, const char *pat, size_t patlen, u64 start, u64 end, u64 stride); 49 | 50 | // Following calls must be properly nested in equal pairs 51 | LIBSMBIOS_C_DLL_SPEC void memory_obj_suggest_leave_open(struct memory_access_obj *); 52 | LIBSMBIOS_C_DLL_SPEC void memory_obj_suggest_close(struct memory_access_obj *); 53 | 54 | // ask if close flag is set 55 | LIBSMBIOS_C_DLL_SPEC bool memory_obj_should_close(const struct memory_access_obj *); 56 | 57 | EXTERN_C_END; 58 | 59 | #endif /* MEMORY_H */ 60 | -------------------------------------------------------------------------------- /src/include/smbios_c/obj/smi.h: -------------------------------------------------------------------------------- 1 | // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c: 2 | /* 3 | * Copyright (C) 2005 Dell Inc. 4 | * by Michael Brown 5 | * Licensed under the Open Software License version 2.1 6 | * 7 | * Alternatively, you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation; either version 2 of the License, 10 | * or (at your option) any later version. 11 | 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 15 | * See the GNU General Public License for more details. 16 | */ 17 | 18 | #ifndef C_OBJ_SMI_H 19 | #define C_OBJ_SMI_H 20 | 21 | // include smbios_c/compat.h first 22 | #include "smbios_c/compat.h" 23 | #include "smbios_c/types.h" 24 | 25 | EXTERN_C_BEGIN; 26 | 27 | #define DELL_SMI_DEFAULTS 0x0000 28 | #define DELL_SMI_GET_SINGLETON 0x0001 29 | #define DELL_SMI_GET_NEW 0x0002 30 | #define DELL_SMI_UNIT_TEST_MODE 0x0004 31 | #define DELL_SMI_NO_ERR_CLEAR 0x0008 32 | 33 | struct dell_smi_obj; 34 | 35 | // construct 36 | LIBSMBIOS_C_DLL_SPEC struct dell_smi_obj *dell_smi_factory(int flags, ...); 37 | 38 | // destruct 39 | LIBSMBIOS_C_DLL_SPEC void dell_smi_obj_free(struct dell_smi_obj *); 40 | 41 | LIBSMBIOS_C_DLL_SPEC const char *dell_smi_obj_strerror(struct dell_smi_obj *); 42 | 43 | LIBSMBIOS_C_DLL_SPEC void dell_smi_obj_set_class(struct dell_smi_obj *, u16 ); 44 | LIBSMBIOS_C_DLL_SPEC void dell_smi_obj_set_select(struct dell_smi_obj *, u16 ); 45 | LIBSMBIOS_C_DLL_SPEC void dell_smi_obj_set_arg(struct dell_smi_obj *, u8 argno, u32 value); 46 | LIBSMBIOS_C_DLL_SPEC u32 dell_smi_obj_get_res(struct dell_smi_obj *, u8 argno); 47 | LIBSMBIOS_C_DLL_SPEC u8 *dell_smi_obj_make_buffer_frombios_auto(struct dell_smi_obj *, u8 argno, size_t size); 48 | LIBSMBIOS_C_DLL_SPEC u8 *dell_smi_obj_make_buffer_frombios_withheader(struct dell_smi_obj *, u8 argno, size_t size); 49 | LIBSMBIOS_C_DLL_SPEC u8 *dell_smi_obj_make_buffer_frombios_withoutheader(struct dell_smi_obj *, u8 argno, size_t size); 50 | LIBSMBIOS_C_DLL_SPEC u8 *dell_smi_obj_make_buffer_tobios(struct dell_smi_obj *, u8 argno, size_t size); 51 | LIBSMBIOS_C_DLL_SPEC int dell_smi_obj_execute(struct dell_smi_obj *); 52 | 53 | EXTERN_C_END; 54 | 55 | #endif /* C_SMI_H */ 56 | -------------------------------------------------------------------------------- /src/include/smbios_c/types.h: -------------------------------------------------------------------------------- 1 | // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c: 2 | /* 3 | * Copyright (C) 2005 Dell Inc. 4 | * by Michael Brown 5 | * Licensed under the Open Software License version 2.1 6 | * 7 | * Alternatively, you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation; either version 2 of the License, 10 | * or (at your option) any later version. 11 | 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 15 | * See the GNU General Public License for more details. 16 | */ 17 | 18 | 19 | #ifndef TYPES_H 20 | #define TYPES_H 21 | 22 | // compat header should always be first header 23 | #include "smbios_c/compat.h" 24 | 25 | #include 26 | 27 | #ifndef TYPE_DEFINED_U8 28 | #define TYPE_DEFINED_U8 29 | typedef unsigned char u8; 30 | #endif 31 | #ifndef TYPE_DEFINED_U16 32 | #define TYPE_DEFINED_U16 33 | typedef unsigned short u16; 34 | #endif 35 | #ifndef TYPE_DEFINED_U32 36 | #define TYPE_DEFINED_U32 37 | typedef unsigned int u32; 38 | #endif 39 | 40 | 41 | #ifndef TYPE_DEFINED_S8 42 | #define TYPE_DEFINED_S8 43 | typedef signed char s8; 44 | #endif 45 | #ifndef TYPE_DEFINED_S16 46 | #define TYPE_DEFINED_S16 47 | typedef signed short s16; 48 | #endif 49 | #ifndef TYPE_DEFINED_S32 50 | #define TYPE_DEFINED_S32 51 | typedef signed int s32; 52 | #endif 53 | 54 | #ifndef TYPE_DEFINED_U64 55 | #define TYPE_DEFINED_U64 56 | #if defined(LIBSMBIOS_C_HAS_LONG_LONG) 57 | typedef unsigned long long u64; 58 | #elif defined(LIBSMBIOS_C_HAS_MS_INT64) 59 | typedef unsigned __int64 u64; 60 | #else 61 | #error "No LONG LONG or __INT64 support. Current compiler config is not supported." 62 | #endif 63 | #endif 64 | 65 | #ifndef TYPE_DEFINED_S64 66 | #define TYPE_DEFINED_S64 67 | #if defined(LIBSMBIOS_C_HAS_LONG_LONG) 68 | typedef signed long long s64; 69 | #elif defined(LIBSMBIOS_C_HAS_MS_INT64) 70 | typedef signed __int64 s64; 71 | #else 72 | #error "No LONG LONG or __INT64 support. Current compiler config is not supported." 73 | #endif 74 | #endif 75 | 76 | #endif /* TYPES_H */ 77 | -------------------------------------------------------------------------------- /src/libsmbios_c/TODO.txt: -------------------------------------------------------------------------------- 1 | 2 | - Error handling, message propagation upwards 3 | - implement 0xD5, 0xD6 tokens 4 | - implement SMI 5 | - L10N 6 | - EFI support 7 | - sysinfo functions - asset/service tags 8 | 9 | - Windows support? 10 | 11 | 12 | DONE: 13 | - make libsmbios_c/common with internal includes. move internal-use #defines 14 | out of include/smbios_c/config/... into common. (FSEEK, dbg_print, etc) 15 | -------------------------------------------------------------------------------- /src/libsmbios_c/cmos/cmos.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c:cindent:textwidth=0: 3 | * 4 | * Copyright (C) 2005 Dell Inc. 5 | * by Michael Brown 6 | * Licensed under the Open Software License version 2.1 7 | * 8 | * Alternatively, you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published 10 | * by the Free Software Foundation; either version 2 of the License, 11 | * or (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | * See the GNU General Public License for more details. 17 | */ 18 | 19 | #define LIBSMBIOS_C_SOURCE 20 | 21 | // Include compat.h first, then system headers, then public, then private 22 | #include "smbios_c/compat.h" 23 | 24 | #include "smbios_c/cmos.h" 25 | #include "smbios_c/obj/cmos.h" 26 | #include "smbios_c/types.h" 27 | 28 | // private 29 | #include "cmos_impl.h" 30 | 31 | 32 | int cmos_read_byte(u8 *byte, u32 indexPort, u32 dataPort, u32 offset) 33 | { 34 | struct cmos_access_obj *c = cmos_obj_factory(CMOS_GET_SINGLETON); 35 | int retval = cmos_obj_read_byte(c, byte, indexPort, dataPort, offset); 36 | cmos_obj_free(c); 37 | return retval; 38 | } 39 | 40 | int cmos_write_byte(u8 byte, u32 indexPort, u32 dataPort, u32 offset) 41 | { 42 | struct cmos_access_obj *c = cmos_obj_factory(CMOS_GET_SINGLETON); 43 | int retval = cmos_obj_write_byte(c, byte, indexPort, dataPort, offset); 44 | cmos_obj_free(c); 45 | return retval; 46 | } 47 | 48 | int cmos_run_callbacks(bool do_update) 49 | { 50 | struct cmos_access_obj *c = cmos_obj_factory(CMOS_GET_SINGLETON); 51 | int retval = cmos_obj_run_callbacks(c, do_update); 52 | cmos_obj_free(c); 53 | return retval; 54 | } 55 | 56 | const char * cmos_strerror() 57 | { 58 | struct cmos_access_obj *m = cmos_obj_factory(CMOS_GET_SINGLETON | CMOS_NO_ERR_CLEAR); 59 | const char * retval = cmos_obj_strerror(m); 60 | cmos_obj_free(m); 61 | return retval; 62 | } 63 | 64 | -------------------------------------------------------------------------------- /src/libsmbios_c/cmos/cmos_impl.h: -------------------------------------------------------------------------------- 1 | // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c: 2 | /* 3 | * Copyright (C) 2005 Dell Inc. 4 | * by Michael Brown 5 | * Licensed under the Open Software License version 2.1 6 | * 7 | * Alternatively, you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation; either version 2 of the License, 10 | * or (at your option) any later version. 11 | 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 15 | * See the GNU General Public License for more details. 16 | */ 17 | 18 | #ifndef CMOS_IMPL_H 19 | #define CMOS_IMPL_H 20 | 21 | #include "smbios_c/compat.h" 22 | #include "smbios_c/obj/cmos.h" 23 | #include "smbios_c/types.h" 24 | 25 | EXTERN_C_BEGIN; 26 | 27 | #undef DEBUG_MODULE_NAME 28 | #define DEBUG_MODULE_NAME "DEBUG_CMOS_C" 29 | 30 | #define ERROR_BUFSIZE 1024 31 | 32 | struct callback 33 | { 34 | cmos_write_callback cb_fn; 35 | void *userdata; 36 | void (*destructor)(void *); 37 | struct callback *next; 38 | }; 39 | 40 | struct cmos_access_obj 41 | { 42 | int initialized; 43 | int (*read_fn)(const struct cmos_access_obj *m, u8 *byte, u32 indexPort, u32 dataPort, u32 offset); 44 | int (*write_fn)(const struct cmos_access_obj *m, u8 byte, u32 indexPort, u32 dataPort, u32 offset); 45 | void (*free)(struct cmos_access_obj *this); 46 | void (*cleanup)(struct cmos_access_obj *this); // called instead of ->free for singleton 47 | char *errstring; 48 | struct callback *cb_list_head; 49 | void *private_data; 50 | int write_lock; 51 | }; 52 | 53 | // regular one 54 | __hidden int init_cmos_struct(struct cmos_access_obj *m); 55 | __hidden int _init_cmos_std_stuff(struct cmos_access_obj *m); // base class constructor 56 | 57 | // unit test one 58 | __hidden int init_cmos_struct_filename(struct cmos_access_obj *m, const char *fn); 59 | 60 | // other funcs 61 | __hidden char *cmos_get_module_error_buf(); 62 | 63 | EXTERN_C_END; 64 | 65 | #endif /* CMOS_IMPL_H */ 66 | -------------------------------------------------------------------------------- /src/libsmbios_c/cmos/cmos_windows.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c:cindent:textwidth=0: 3 | * 4 | * Copyright (C) 2005 Dell Inc. 5 | * by Michael Brown 6 | * Licensed under the Open Software License version 2.1 7 | * 8 | * Alternatively, you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published 10 | * by the Free Software Foundation; either version 2 of the License, 11 | * or (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | * See the GNU General Public License for more details. 17 | */ 18 | 19 | #define LIBSMBIOS_C_SOURCE 20 | 21 | // Include compat.h first, then system headers, then public, then private 22 | #include "smbios_c/compat.h" 23 | 24 | #include 25 | 26 | // public 27 | #include "smbios_c/cmos.h" 28 | #include "smbios_c/types.h" 29 | #include "common_internal.h" 30 | #include "libsmbios_c_intlize.h" 31 | 32 | // private 33 | #include "cmos_impl.h" 34 | #include "common_windows.h" 35 | 36 | static int windows_read_fn(const struct cmos_access_obj *this, u8 *byte, u32 indexPort, u32 dataPort, u32 offset) 37 | { 38 | NTSTATUS status; 39 | IO_STRUCT io; 40 | int retval = -1; 41 | 42 | memset(&io, 0, sizeof(io)); 43 | io.Addr = indexPort; 44 | io.pBuf = &offset; 45 | io.NumBytes = 1; 46 | io.Reserved4 = 1; 47 | io.Reserved6 = 1; 48 | 49 | status = ZwSystemDebugControl(DebugSysWriteIoSpace, &io, sizeof(io), NULL, 0, NULL); 50 | if (!NT_SUCCESS(status)) 51 | goto out; 52 | 53 | memset(&io, 0, sizeof(io)); 54 | io.Addr = dataPort; 55 | io.pBuf = byte; 56 | io.NumBytes = 1; 57 | io.Reserved4 = 1; 58 | io.Reserved6 = 1; 59 | 60 | status = ZwSystemDebugControl(DebugSysReadIoSpace, &io, sizeof(io), NULL, 0, NULL); 61 | if (!NT_SUCCESS(status)) 62 | goto out; 63 | 64 | retval = 0; 65 | 66 | out: 67 | return retval; 68 | } 69 | 70 | 71 | int __hidden init_cmos_struct(struct cmos_access_obj *m) 72 | { 73 | printf("Loaded Windows CMOS STUFF. not yet ready.\n"); 74 | 75 | if (!LoadNtdllFuncs()) 76 | goto out_err; 77 | 78 | if (!EnableDebug()) 79 | goto out_err; 80 | 81 | m->read_fn = windows_read_fn; 82 | 83 | return -1; /// NOT YET IMPLEMENTED 84 | goto out; 85 | 86 | out_err: 87 | return -1; 88 | 89 | out: 90 | return 0; 91 | } 92 | 93 | -------------------------------------------------------------------------------- /src/libsmbios_c/common/common.c: -------------------------------------------------------------------------------- 1 | #define LIBSMBIOS_C_SOURCE 2 | #define DEBUG_MODULE_NAME "DEBUG_CONSTRUCTOR_C" 3 | 4 | #include "smbios_c/compat.h" 5 | 6 | #include 7 | 8 | #include "common_internal.h" 9 | #include "libsmbios_c_intlize.h" 10 | 11 | // constructor to set up locale stuff 12 | __attribute__((constructor)) static void lib_initialize (void) 13 | { 14 | fnprintf("CONSTRUCTOR: pkg: %s, dir: %s\n", GETTEXT_PACKAGE,LIBSMBIOS_LOCALEDIR); 15 | bindtextdomain (GETTEXT_PACKAGE, LIBSMBIOS_LOCALEDIR); 16 | fnprintf( LIBSMBIOS_C_GETTEXT_DEBUG_STRING "\n"); 17 | fnprintf( _("This message should be localized if setlocale() has been called and gettext compiled in.\n") ); 18 | } 19 | 20 | 21 | #ifdef LIBSMBIOS_C_PLATFORM_LINUX 22 | void fixed_strerror(int errval, char *errbuf, size_t bufsize) 23 | { 24 | fnprintf("\n"); 25 | size_t curstrsize = strlen(errbuf); 26 | 27 | if ((size_t)(bufsize - curstrsize - 1) < bufsize) 28 | { 29 | char *buf = strerror_r(errval, errbuf + curstrsize, bufsize - curstrsize - 1); 30 | // GNU breakage... :( 31 | if (buf != (errbuf + curstrsize)) 32 | strlcat(errbuf, buf, bufsize); 33 | } 34 | } 35 | #endif 36 | -------------------------------------------------------------------------------- /src/libsmbios_c/common/common_internal.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _LIBSMBIOS_C_INTERNAL_COMMON_H 3 | #define _LIBSMBIOS_C_INTERNAL_COMMON_H 4 | 5 | #include "internal_strl.h" 6 | 7 | // avoid GNU braindamage... :( 8 | void fixed_strerror(int errval, char *errbuf, size_t bufsize); 9 | 10 | #endif 11 | 12 | -------------------------------------------------------------------------------- /src/libsmbios_c/common/common_windows.h: -------------------------------------------------------------------------------- 1 | #ifndef _LIBSMBIOS_C_COMMON_WINDOWS_H 2 | #define _LIBSMBIOS_C_COMMON_WINDOWS_H 3 | 4 | #include "miniddk.h" 5 | 6 | int LoadNtdllFuncs(void); 7 | int EnableDebug(void); 8 | NtClosePtr NtClose; 9 | NtOpenSectionPtr NtOpenSection; 10 | NtMapViewOfSectionPtr NtMapViewOfSection; 11 | NtUnmapViewOfSectionPtr NtUnmapViewOfSection; 12 | RtlInitUnicodeStringPtr RtlInitUnicodeString; 13 | ZwSystemDebugControlPtr ZwSystemDebugControl; 14 | GetSystemFirmwareTablePtr GetSystemFirmwareTable; 15 | EnumSystemFirmwareTablesPtr EnumSystemFirmwareTables; 16 | 17 | #endif // _LIBSMBIOS_C_COMMON_WINDOWS_H 18 | 19 | -------------------------------------------------------------------------------- /src/libsmbios_c/common/compiler/gcc.h: -------------------------------------------------------------------------------- 1 | #define UNREFERENCED_PARAMETER(P) (void)(P) 2 | 3 | #if defined(__MINGW32__) 4 | #define __internal 5 | #define __hidden 6 | #else 7 | #define __internal __attribute__((visibility("internal"))) 8 | #define __hidden __attribute__((visibility("hidden"))) 9 | #endif 10 | 11 | #ifndef DEBUG_MODULE_NAME 12 | # define DEBUG_MODULE_NAME "DEBUG_OUTPUT_ALL" 13 | #endif 14 | 15 | #define _env_dbg_printf(env, format, args...) \ 16 | do { \ 17 | char w[256] = "LIBSMBIOS_C_"; \ 18 | strncat(w, env, 256 - 1 - strlen(w)); \ 19 | const char *v = 0; \ 20 | const char *u = getenv("LIBSMBIOS_C_DEBUG_OUTPUT_ALL"); \ 21 | if (env) v = getenv(w); \ 22 | if ( (u && atoi(u) > 0) || (v && atoi(v) > 0) ) { \ 23 | fprintf(stderr , format , ## args); \ 24 | fflush(NULL); \ 25 | }\ 26 | } while(0) 27 | 28 | #define _stderr_dbg_printf(format, args...) do { fprintf(stderr , format , ## args); fflush(NULL); } while(0) 29 | 30 | #define _null_call( args...) do {} while(0) 31 | 32 | // default to env-controlled 33 | #if !defined(DEBUG_OUTPUT_ALL) && !defined(SUPRESS_DEBUGGING_OUTPUT) 34 | #include 35 | #include 36 | #include 37 | # define dbg_printf(args...) _env_dbg_printf( DEBUG_MODULE_NAME, ## args ) 38 | 39 | #elif defined(DEBUG_OUTPUT_ALL) 40 | # include 41 | # define dbg_printf _stderr_dbg_printf 42 | 43 | #elif defined(SUPRESS_DEBUGGING_OUTPUT) 44 | #define dbg_printf _null_call 45 | #endif 46 | 47 | #define fnprintf(fmt, args...) do { dbg_printf("%s: ", __PRETTY_FUNCTION__); dbg_printf( fmt, ## args); } while(0) 48 | -------------------------------------------------------------------------------- /src/libsmbios_c/common/compiler/sunpro_cc.h: -------------------------------------------------------------------------------- 1 | #define UNREFERENCED_PARAMETER(P) (void)(P) 2 | 3 | #define __internal 4 | #define __hidden 5 | 6 | #ifndef DEBUG_MODULE_NAME 7 | # define DEBUG_MODULE_NAME "DEBUG_OUTPUT_ALL" 8 | #endif 9 | 10 | #define _env_dbg_printf(env, format, args...) \ 11 | do { \ 12 | char w[256] = "LIBSMBIOS_C_"; \ 13 | strncat(w, env, 256 - 1 - strlen(w)); \ 14 | const char *v = 0; \ 15 | const char *u = getenv("LIBSMBIOS_C_DEBUG_OUTPUT_ALL"); \ 16 | if (env) v = getenv(w); \ 17 | if ( (u && atoi(u) > 0) || (v && atoi(v) > 0) ) { \ 18 | fprintf(stderr , format , ## args); \ 19 | fflush(NULL); \ 20 | }\ 21 | } while(0) 22 | 23 | #define _stderr_dbg_printf(format, args...) do { fprintf(stderr , format , ## args); fflush(NULL); } while(0) 24 | 25 | #define _null_call( args...) do {} while(0) 26 | 27 | // default to env-controlled 28 | #if !defined(DEBUG_OUTPUT_ALL) && !defined(SUPRESS_DEBUGGING_OUTPUT) 29 | #include 30 | #include 31 | #include 32 | # define dbg_printf(args...) _env_dbg_printf( DEBUG_MODULE_NAME, ## args ) 33 | 34 | #elif defined(DEBUG_OUTPUT_ALL) 35 | # include 36 | # define dbg_printf _stderr_dbg_printf 37 | 38 | #elif defined(SUPRESS_DEBUGGING_OUTPUT) 39 | #define dbg_printf _null_call 40 | #endif 41 | 42 | #define fnprintf(fmt, args...) do { dbg_printf("%s: ", __PRETTY_FUNCTION__); dbg_printf( fmt, ## args); } while(0) 43 | 44 | -------------------------------------------------------------------------------- /src/libsmbios_c/common/compiler/visualc.h: -------------------------------------------------------------------------------- 1 | #define UNREFERENCED_PARAMETER(P) (P) 2 | 3 | #define strtoll(p, e, b) _strtoi64(p, e, b) 4 | 5 | #define __internal 6 | #define __hidden 7 | 8 | // variadic macros added in vc 8.0: http://msdn.microsoft.com/en-us/library/ms177415(VS.80).aspx 9 | 10 | 11 | #define _env_dbg_printf(env, format, ...) \ 12 | do { \ 13 | char w[256] = "LIBSMBIOS_C_"; \ 14 | strncat(w, env, 256 - 1 - strlen(w)); \ 15 | const char *v = 0; \ 16 | const char *u = getenv("LIBSMBIOS_C_DEBUG_OUTPUT_ALL"); \ 17 | if (env) v = getenv(w); \ 18 | if ( (u && atoi(u) > 0) || (v && atoi(v) > 0) ) { \ 19 | fprintf(stderr , format , __VA_ARGS__); \ 20 | fflush(NULL); \ 21 | }\ 22 | } while(0) 23 | 24 | #define _stderr_dbg_printf(format, ...) do { fprintf(stderr , format , __VA_ARGS__); } while(0) 25 | 26 | #define _null_call(...) do {} while(0) 27 | 28 | // default to env-controlled 29 | #if !defined(DEBUG_OUTPUT_ALL) && !defined(SUPRESS_DEBUGGING_OUTPUT) 30 | #include 31 | #include 32 | #include 33 | # define dbg_printf(args...) _env_dbg_printf( DEBUG_MODULE_NAME, ## args ) 34 | 35 | #elif defined(DEBUG_OUTPUT_ALL) 36 | # include 37 | # define dbg_printf _stderr_dbg_printf 38 | 39 | #elif defined(SUPRESS_DEBUGGING_OUTPUT) 40 | #define dbg_printf _null_call 41 | #endif 42 | 43 | #define fnprintf(fmt, ...) do { dbg_printf("%s: ", __FUNCTION__); dbg_printf( fmt, __VA_ARGS__ ); } while(0) 44 | 45 | // turn off the warnings before we #include anything 46 | // 4503: warning: decorated name length exceeded 47 | // 4250: 'class1' : inherits 'class2::member' via dominance 48 | // 4201: nonstandard extension used : nameless struct/union 49 | // 4127: warning: conditional expression is constant 50 | #pragma warning( disable : 4201 4250 4503 4127 ) 51 | 52 | #ifndef DEBUG 53 | // 4702: unreachable code 54 | #pragma warning( disable : 4702 ) // disable in release because MS headers have tons of unreachable code 55 | #endif 56 | 57 | -------------------------------------------------------------------------------- /src/libsmbios_c/common/internal_strl.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _LIBSMBIOS_C_INTERNAL_STRL_H 3 | #define _LIBSMBIOS_C_INTERNAL_STRL_H 4 | 5 | // define strlcpy and strlcat IFF platform doesnt have them 6 | 7 | #if HAVE_CONFIG_H 8 | #include "config.h" 9 | #endif 10 | 11 | #include 12 | #include 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | #ifndef HAVE_STRLCAT 19 | size_t strlcat(char *dst, const char *src, size_t siz); 20 | #endif 21 | 22 | #ifndef HAVE_STRLCPY 23 | size_t strlcpy(char *dst, const char *src, size_t siz); 24 | #endif 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /src/libsmbios_c/common/libsmbios_c_intlize.h: -------------------------------------------------------------------------------- 1 | /* vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c:cindent: 2 | * 3 | * Copyright (C) 2005 Dell Inc. 4 | * by Michael Brown 5 | * Licensed under the Open Software License version 2.1 6 | * 7 | * Alternatively, you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation; either version 2 of the License, 10 | * or (at your option) any later version. 11 | 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 15 | * See the GNU General Public License for more details. 16 | */ 17 | 18 | 19 | #ifndef LIBSMBIOS_C_MESSAGE_H 20 | #define LIBSMBIOS_C_MESSAGE_H 21 | 22 | /* This header file should only ever be included in .cpp files. It should never 23 | * be included in header files, due to the fact that it will sometimes mess up 24 | * portions of the standard library because of the redefinitions. 25 | * 26 | * Always include this file as the last include in the .cpp file, if it is 27 | * needed. 28 | */ 29 | 30 | 31 | #include "smbios_c/compat.h" 32 | 33 | #if defined(LIBSMBIOS_C_HAS_GETTEXT) 34 | # include 35 | # define _(String) dgettext (GETTEXT_PACKAGE, String) 36 | # define gettext_noop(String) String 37 | # define N_(String) gettext_noop (String) 38 | # define LIBSMBIOS_C_GETTEXT_DEBUG_STRING "HAS GETTEXT" 39 | #else 40 | # define _(string) string 41 | # define N_(string) string 42 | # define textdomain(Domain) 43 | # define bindtextdomain(Package, Directory) 44 | # define LIBSMBIOS_C_GETTEXT_DEBUG_STRING "gettext compiled with stubs and no translation" 45 | #endif 46 | 47 | 48 | #endif /* LIBSMBIOS_C_MESSAGE_H */ 49 | -------------------------------------------------------------------------------- /src/libsmbios_c/common/libsmbios_c_source.h: -------------------------------------------------------------------------------- 1 | // Boost config.h configuration header file ------------------------------// 2 | 3 | // (C) Copyright John Maddock 2002. 4 | // Use, modification and distribution are subject to the 5 | // Boost Software License, Version 1.0. (See accompanying file 6 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | // See http://www.boost.org/libs/config for most recent version. 9 | 10 | // Boost config.h policy and rationale documentation has been moved to 11 | // http://www.boost.org/libs/config 12 | // 13 | // CAUTION: This file is intended to be completely stable - 14 | // DO NOT MODIFY THIS FILE! 15 | // 16 | // Modified for libsmbios project: 2004-03-28 by Michael Brown 17 | 18 | #ifndef LIBSMBIOS_C_INTERNAL_CONFIG_H 19 | #define LIBSMBIOS_C_INTERNAL_CONFIG_H 20 | 21 | #ifdef HAVE_CONFIG_H 22 | #include "config.h" 23 | #endif 24 | 25 | // if we don't have a compiler config set, try and find one: 26 | #if !defined(LIBSMBIOS_C_INTERNAL_COMPILER_CONFIG) && !defined(LIBSMBIOS_C_INTERNAL_NO_COMPILER_CONFIG) && !defined(LIBSMBIOS_C_INTERNAL_NO_CONFIG) 27 | # include 28 | #endif 29 | // if we have a compiler config, include it now: 30 | #ifdef LIBSMBIOS_C_INTERNAL_COMPILER_CONFIG 31 | # include LIBSMBIOS_C_INTERNAL_COMPILER_CONFIG 32 | #endif 33 | 34 | 35 | // if we don't have a platform config set, try and find one: 36 | #if !defined(LIBSMBIOS_C_INTERNAL_PLATFORM_CONFIG) && !defined(LIBSMBIOS_C_INTERNAL_NO_PLATFORM_CONFIG) && !defined(LIBSMBIOS_C_INTERNAL_NO_CONFIG) 37 | # include 38 | #endif 39 | // if we have a platform config, include it now: 40 | #ifdef LIBSMBIOS_C_INTERNAL_PLATFORM_CONFIG 41 | # include LIBSMBIOS_C_INTERNAL_PLATFORM_CONFIG 42 | #endif 43 | 44 | #endif // LIBSMBIOS_C_INTERNAL_CONFIG_H 45 | -------------------------------------------------------------------------------- /src/libsmbios_c/common/platform/linux.h: -------------------------------------------------------------------------------- 1 | // If we are on IA64 we will need to macro define inb_p and outb_p 2 | #if defined(__ia64__) 3 | # define outb_p outb 4 | # define inb_p inb 5 | #endif 6 | 7 | // required for compile on RHEL4. fseeko not defined unless we use this 8 | #ifndef _LARGEFILE_SOURCE 9 | #define _LARGEFILE_SOURCE 10 | #endif 11 | 12 | // Enable 64-bit file access 13 | #ifndef FSEEK 14 | #define FSEEK(fh, pos, whence) fseeko(fh, (off_t)(pos), whence) 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /src/libsmbios_c/common/platform/win32.h: -------------------------------------------------------------------------------- 1 | // Enable 64-bit file access (changes off_t to 64-bit) 2 | #ifndef FSEEK 3 | #define FSEEK(fh, pos, whence) fseek(fh, (long)(pos), whence) 4 | #endif 5 | 6 | /* Windows is lame. */ 7 | # define _snprintf snprintf 8 | 9 | -------------------------------------------------------------------------------- /src/libsmbios_c/common/platform/win64.h: -------------------------------------------------------------------------------- 1 | // Enable 64-bit file access (changes off_t to 64-bit) 2 | #ifndef FSEEK 3 | #define FSEEK(fh, pos, whence) fseek(fh, (long)(pos), whence) 4 | #endif 5 | 6 | /* Windows is lame. */ 7 | # define _snprintf snprintf 8 | 9 | -------------------------------------------------------------------------------- /src/libsmbios_c/common/select_compiler_config.h: -------------------------------------------------------------------------------- 1 | # if defined __GNUC__ 2 | // GNU C++: 3 | # define LIBSMBIOS_C_INTERNAL_COMPILER_CONFIG "compiler/gcc.h" 4 | 5 | #elif defined _MSC_VER 6 | // Microsoft Visual C++ 7 | // 8 | // Must remain the last #elif since some other vendors also #define _MSC_VER 9 | # define LIBSMBIOS_C_INTERNAL_COMPILER_CONFIG "compiler/visualc.h" 10 | 11 | #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) 12 | // Sun Studio Compiler 13 | #define LIBSMBIOS_C_INTERNAL_COMPILER_CONFIG "compiler/sunpro_cc.h" 14 | 15 | #else 16 | // this must come last - generate an error if we don't 17 | // recognise the compiler: 18 | # error "Unknown compiler - please report to libsmbios maintainer." 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/libsmbios_c/common/select_platform_config.h: -------------------------------------------------------------------------------- 1 | #if defined(linux) || defined(__linux) || defined(__linux__) 2 | // linux: 3 | # define LIBSMBIOS_C_INTERNAL_PLATFORM_CONFIG "platform/linux.h" 4 | 5 | #elif defined(_WIN64) || defined(__WIN64__) || defined(WIN64) 6 | // win64: 7 | # define LIBSMBIOS_C_INTERNAL_PLATFORM_CONFIG "platform/win64.h" 8 | 9 | #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) 10 | // win32: 11 | # define LIBSMBIOS_C_INTERNAL_PLATFORM_CONFIG "platform/win32.h" 12 | #else 13 | 14 | // this must come last - generate an error if we don't 15 | // recognise the platform: 16 | # error "Unknown platform - please report to libsmbios maintainer." 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/libsmbios_c/common/strlcat.c: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: strlcat.c,v 1.13 2005/08/08 08:05:37 espie Exp $ */ 2 | 3 | #include "internal_strl.h" 4 | 5 | #ifndef HAVE_STRLCAT 6 | 7 | /* 8 | * Copyright (c) 1998 Todd C. Miller 9 | * 10 | * Permission to use, copy, modify, and distribute this software for any 11 | * purpose with or without fee is hereby granted, provided that the above 12 | * copyright notice and this permission notice appear in all copies. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 15 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 16 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 17 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 18 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 19 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 20 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 21 | */ 22 | 23 | /* 24 | * Appends src to string dst of size siz (unlike strncat, siz is the 25 | * full size of dst, not space left). At most siz-1 characters 26 | * will be copied. Always NUL terminates (unless siz <= strlen(dst)). 27 | * Returns strlen(src) + MIN(siz, strlen(initial dst)). 28 | * If retval >= siz, truncation occurred. 29 | */ 30 | size_t 31 | strlcat(char *dst, const char *src, size_t siz) 32 | { 33 | char *d = dst; 34 | const char *s = src; 35 | size_t n = siz; 36 | size_t dlen; 37 | 38 | /* Find the end of dst and adjust bytes left but don't go past end */ 39 | while (n-- != 0 && *d != '\0') 40 | d++; 41 | dlen = d - dst; 42 | n = siz - dlen; 43 | 44 | if (n == 0) 45 | return(dlen + strlen(s)); 46 | while (*s != '\0') { 47 | if (n != 1) { 48 | *d++ = *s; 49 | n--; 50 | } 51 | s++; 52 | } 53 | *d = '\0'; 54 | 55 | return(dlen + (s - src)); /* count does not include NUL */ 56 | } 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /src/libsmbios_c/common/strlcpy.c: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: strlcpy.c,v 1.11 2006/05/05 15:27:38 millert Exp $ */ 2 | 3 | #include "internal_strl.h" 4 | 5 | #ifndef HAVE_STRLCPY 6 | 7 | /* 8 | * Copyright (c) 1998 Todd C. Miller 9 | * 10 | * Permission to use, copy, modify, and distribute this software for any 11 | * purpose with or without fee is hereby granted, provided that the above 12 | * copyright notice and this permission notice appear in all copies. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 15 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 16 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 17 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 18 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 19 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 20 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 21 | */ 22 | 23 | /* 24 | * Copy src to string dst of size siz. At most siz-1 characters 25 | * will be copied. Always NUL terminates (unless siz == 0). 26 | * Returns strlen(src); if retval >= siz, truncation occurred. 27 | */ 28 | size_t 29 | strlcpy(char *dst, const char *src, size_t siz) 30 | { 31 | char *d = dst; 32 | const char *s = src; 33 | size_t n = siz; 34 | 35 | /* Copy as many bytes as will fit */ 36 | if (n != 0) { 37 | while (--n != 0) { 38 | if ((*d++ = *s++) == '\0') 39 | break; 40 | } 41 | } 42 | 43 | /* Not enough room in dst, add NUL and traverse rest of src */ 44 | if (n == 0) { 45 | if (siz != 0) 46 | *d = '\0'; /* NUL-terminate dst */ 47 | while (*s++) 48 | ; 49 | } 50 | 51 | return(s - src - 1); /* count does not include NUL */ 52 | } 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /src/libsmbios_c/memory/memory_impl.h: -------------------------------------------------------------------------------- 1 | // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c: 2 | /* 3 | * Copyright (C) 2005 Dell Inc. 4 | * by Michael Brown 5 | * Licensed under the Open Software License version 2.1 6 | * 7 | * Alternatively, you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation; either version 2 of the License, 10 | * or (at your option) any later version. 11 | 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 15 | * See the GNU General Public License for more details. 16 | */ 17 | 18 | #ifndef MEMORY_IMPL_H 19 | #define MEMORY_IMPL_H 20 | 21 | #include "smbios_c/compat.h" 22 | #include "smbios_c/types.h" 23 | 24 | EXTERN_C_BEGIN; 25 | 26 | #undef DEBUG_MODULE_NAME 27 | #define DEBUG_MODULE_NAME "DEBUG_MEMORY_C" 28 | 29 | #define ERROR_BUFSIZE 1024 30 | 31 | struct memory_access_obj 32 | { 33 | int initialized; 34 | int (*read_fn)(const struct memory_access_obj *this, u8 *buffer, u64 offset, size_t length); 35 | int (*write_fn)(const struct memory_access_obj *this, u8 *buffer, u64 offset, size_t length); 36 | void (*free)(struct memory_access_obj *this); 37 | void (*cleanup)(struct memory_access_obj *this); // called instead of ->free for singleton 38 | void *private_data; 39 | char *errstring; 40 | int close; 41 | }; 42 | 43 | __hidden int init_mem_struct(struct memory_access_obj *m); 44 | __hidden int init_mem_struct_filename(struct memory_access_obj *m, const char *fn); 45 | __hidden char * memory_get_module_error_buf(); 46 | 47 | EXTERN_C_END; 48 | 49 | #endif /* MEMORY_IMPL_H */ 50 | -------------------------------------------------------------------------------- /src/libsmbios_c/smbios/smbios_windows.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c:cindent:textwidth=0: 3 | * 4 | * Copyright (C) 2018 Dell Inc. 5 | * Licensed under the Open Software License version 2.1 6 | * 7 | * Alternatively, you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation; either version 2 of the License, 10 | * or (at your option) any later version. 11 | 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 15 | * See the GNU General Public License for more details. 16 | */ 17 | 18 | #define LIBSMBIOS_C_SOURCE 19 | 20 | // Include compat.h first, then system headers, then public, then private 21 | #include "smbios_c/compat.h" 22 | 23 | #include 24 | 25 | // public 26 | #include "smbios_c/obj/smi.h" 27 | #include "smbios_c/types.h" 28 | #include "libsmbios_c_intlize.h" 29 | #include "internal_strl.h" 30 | 31 | // private 32 | #include "smi_impl.h" 33 | 34 | int __hidden smbios_get_table_firm_tables(struct smbios_table *m) 35 | { 36 | printf("WINDOWS SMBIOS NOT IMPLEMENTED YET!!!! \n"); 37 | return -1; 38 | } 39 | 40 | int __hidden smbios_get_table_memory(struct smbios_table *m) 41 | { 42 | printf("WINDOWS SMBIOS NOT IMPLEMENTED YET!!!! \n"); 43 | return -1; 44 | } -------------------------------------------------------------------------------- /src/libsmbios_c/smi/smi_windows.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c:cindent:textwidth=0: 3 | * 4 | * Copyright (C) 2005 Dell Inc. 5 | * by Michael Brown 6 | * Licensed under the Open Software License version 2.1 7 | * 8 | * Alternatively, you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published 10 | * by the Free Software Foundation; either version 2 of the License, 11 | * or (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | * See the GNU General Public License for more details. 17 | */ 18 | 19 | #define LIBSMBIOS_C_SOURCE 20 | 21 | // Include compat.h first, then system headers, then public, then private 22 | #include "smbios_c/compat.h" 23 | 24 | #include 25 | 26 | // public 27 | #include "smbios_c/obj/smi.h" 28 | #include "smbios_c/types.h" 29 | #include "libsmbios_c_intlize.h" 30 | #include "internal_strl.h" 31 | 32 | // private 33 | #include "smi_impl.h" 34 | 35 | int __hidden init_dell_smi_obj(struct dell_smi_obj *this) 36 | { 37 | printf("WINDOWS SMI NOT IMPLEMENTED YET!!!! \n"); 38 | return -1; 39 | } 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/libsmbios_c/smi/wmi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * User API methods for ACPI-WMI mapping driver 3 | * 4 | * Copyright (C) 2017 Dell, Inc. 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License version 2 as 8 | * published by the Free Software Foundation. 9 | */ 10 | #ifndef _LINUX_WMI_H 11 | #define _LINUX_WMI_H 12 | 13 | #include 14 | #include 15 | 16 | /* WMI bus will filter all WMI vendor driver requests through this IOC */ 17 | #define WMI_IOC 'W' 18 | 19 | /* All ioctl requests through WMI should declare their size followed by 20 | * relevant data objects 21 | */ 22 | struct wmi_ioctl_buffer { 23 | __u64 length; 24 | __u8 data[]; 25 | }; 26 | 27 | /* This structure may be modified by the firmware when we enter 28 | * system management mode through SMM, hence the volatiles 29 | */ 30 | struct calling_interface_buffer { 31 | __u16 cmd_class; 32 | __u16 cmd_select; 33 | __volatile__ __u32 input[4]; 34 | __volatile__ __u32 output[4]; 35 | } __attribute__((packed)); 36 | 37 | struct dell_wmi_extensions { 38 | __u32 argattrib; 39 | __u32 blength; 40 | __u8 data[]; 41 | } __attribute__((packed)); 42 | 43 | struct dell_wmi_smbios_buffer { 44 | __u64 length; 45 | struct calling_interface_buffer std; 46 | struct dell_wmi_extensions ext; 47 | } __attribute__((packed)); 48 | 49 | /* Whitelisted smbios class/select commands */ 50 | #define CLASS_TOKEN_READ 0 51 | #define CLASS_TOKEN_WRITE 1 52 | #define SELECT_TOKEN_STD 0 53 | #define SELECT_TOKEN_BAT 1 54 | #define SELECT_TOKEN_AC 2 55 | #define CLASS_FLASH_INTERFACE 7 56 | #define SELECT_FLASH_INTERFACE 3 57 | #define CLASS_ADMIN_PROP 10 58 | #define SELECT_ADMIN_PROP 3 59 | #define CLASS_INFO 17 60 | #define SELECT_RFKILL 11 61 | #define SELECT_APP_REGISTRATION 3 62 | #define SELECT_DOCK 22 63 | 64 | /* whitelisted tokens */ 65 | #define CAPSULE_EN_TOKEN 0x0461 66 | #define CAPSULE_DIS_TOKEN 0x0462 67 | #define WSMT_EN_TOKEN 0x04EC 68 | #define WSMT_DIS_TOKEN 0x04ED 69 | 70 | /* Dell SMBIOS calling IOCTL command used by dell-smbios-wmi */ 71 | #define DELL_WMI_SMBIOS_CMD _IOWR(WMI_IOC, 0, struct dell_wmi_smbios_buffer) 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /src/libsmbios_c/system_info/sysinfo_impl.h: -------------------------------------------------------------------------------- 1 | // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c: 2 | /* 3 | * Copyright (C) 2005 Dell Inc. 4 | * by Michael Brown 5 | * Licensed under the Open Software License version 2.1 6 | * 7 | * Alternatively, you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation; either version 2 of the License, 10 | * or (at your option) any later version. 11 | 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 15 | * See the GNU General Public License for more details. 16 | */ 17 | 18 | #ifndef C_SYSINFO_H 19 | #define C_SYSINFO_H 20 | 21 | #undef DEBUG_MODULE_NAME 22 | #define DEBUG_MODULE_NAME "DEBUG_SYSINFO_C" 23 | 24 | #define MAX_SMI_TAG_SIZE 12 25 | #define ERROR_BUFSIZE 1024 26 | 27 | __hidden void sysinfo_clearerr(); 28 | __hidden char *sysinfo_get_module_error_buf(); 29 | __hidden char * smbios_struct_get_string_from_table(u8 type, u8 offset); 30 | __hidden void strip_trailing_whitespace( char *str ); 31 | __hidden char *getTagFromSMI(u16 select); 32 | __hidden u32 setTagUsingSMI(u16 select, const char *, u16); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/py-cli/Makefile.am: -------------------------------------------------------------------------------- 1 | clidir = $(datadir)/smbios-utils 2 | 3 | if HAVE_PYTHON 4 | cli_PYTHON = src/py-cli/cli.py 5 | endif 6 | 7 | REPLACE_VARS += clidir 8 | export clidir 9 | -------------------------------------------------------------------------------- /src/python/Makefile.am: -------------------------------------------------------------------------------- 1 | # vim:noexpandtab:autoindent:tabstop=8:shiftwidth=8:filetype=make:nocindent:tw=0: 2 | 3 | pkgpythondir=$(pyexecdir)/libsmbios_c 4 | 5 | if HAVE_PYTHON 6 | pkgpython_PYTHON = \ 7 | src/python/libsmbios_c/cmos.py \ 8 | src/python/libsmbios_c/smbios_token.py \ 9 | src/python/libsmbios_c/_common.py \ 10 | src/python/libsmbios_c/trace_decorator.py \ 11 | src/python/libsmbios_c/__init__.py \ 12 | src/python/libsmbios_c/smbios.py \ 13 | src/python/libsmbios_c/memory.py \ 14 | src/python/libsmbios_c/smi.py \ 15 | src/python/libsmbios_c/system_info.py 16 | 17 | pkgpython_PYTHON += src/python/_vars.py 18 | endif 19 | 20 | # src/python/libsmbios_c/_vars.py is only for in-tree use 21 | # it is used to generate src/python/_vars.py which is installed 22 | EXTRA_DIST += src/python/libsmbios_c/_vars.py 23 | DISTCLEANFILES += src/python/_vars.py 24 | REPLACE_VARS += LIBSMBIOS_C_SONAME 25 | 26 | all: src/python/_vars.py 27 | src/python/_vars.py: src/python/libsmbios_c/_vars.py configure Makefile config.status 28 | mkdir -p $$(dirname $@) ||: 29 | cp $< $@ 30 | for var in $(REPLACE_VARS) ;\ 31 | do \ 32 | var="$$var" perl -p -i -e 's|^\Q$$ENV{var}\E\s*=.*|$$ENV{var}="$$ENV{$$ENV{var}}"|' $@;\ 33 | done 34 | -------------------------------------------------------------------------------- /src/python/libsmbios_c/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # purpose of the following is so we can easily run from built source tree if 3 | # topdir == builddir. (ie. doesnt support out of tree builds, set 4 | # LD_LIBRARY_PATH manually for that) 5 | import os 6 | from ._vars import * 7 | 8 | # import the .so one time rather than in each submodule 9 | import ctypes 10 | try: 11 | # try explicit path first 12 | # this lets us run cleanly from build tree 13 | # or if user uses wierd --prefix for configure 14 | # doesnt work from build tree if top_builddir != top_srcdir 15 | libsmbios_c_DLL = ctypes.cdll.LoadLibrary(os.path.join(libdir, LIBSMBIOS_C_SONAME)) 16 | except OSError as e: 17 | # then let it search 18 | libsmbios_c_DLL = ctypes.cdll.LoadLibrary(LIBSMBIOS_C_SONAME) 19 | 20 | # import all our packages. 21 | from . import cmos 22 | from . import memory 23 | from . import smbios 24 | from . import smi 25 | from . import system_info 26 | from . import smbios_token 27 | from . import _common 28 | 29 | import gettext 30 | gettext.install(GETTEXT_PACKAGE, localedir) 31 | 32 | __VERSION__ = "uninstalled-version" 33 | 34 | _all_ = [ 35 | "cmos", "memory", "smbios", "smi", "system_info", "smbios_token", 36 | "GETTEXT_PACKAGE", 37 | "localedir", "pkgdatadir", "pythondir", "pkgconfdir" 38 | ] 39 | -------------------------------------------------------------------------------- /src/python/libsmbios_c/_vars.py: -------------------------------------------------------------------------------- 1 | # the purpose of this file is so we can run from the build tree. 2 | # for installation, this is replaced with a better version. 3 | import os 4 | 5 | __all__ = ["__VERSION__", "GETTEXT_PACKAGE", 6 | "localedir", "pkgdatadir", "pythondir", "pkgconfdir", "libdir", 7 | "LIBSMBIOS_C_SONAME" 8 | ] 9 | 10 | LIBSMBIOS_C_SONAME = "libsmbios_c.so.2" # replaced at install time 11 | 12 | import libsmbios_c 13 | _modpath = os.path.realpath(libsmbios_c.__path__[0]) 14 | 15 | # the following vars are all substituted on install 16 | __VERSION__="uninstalled-version" 17 | GETTEXT_PACKAGE="libsmbios" 18 | libdir =os.path.join(_modpath, "..", "..", "..", "out", ".libs") 19 | pythondir =os.path.join(_modpath, "..") 20 | localedir =os.path.join(_modpath, "..", "..", "..", "po") 21 | pkgdatadir=os.path.join(_modpath, "..", "..", "..", "doc") 22 | pkgconfdir=os.path.join(_modpath, "..", "..", "..", "etc") 23 | 24 | # end vars 25 | 26 | -------------------------------------------------------------------------------- /src/pyunit/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | EXTRA_DIST += \ 3 | src/pyunit/runtests.sh \ 4 | src/pyunit/test_data \ 5 | src/pyunit/system_dumps 6 | 7 | 8 | 9 | TESTS += src/pyunit/runtests.sh 10 | 11 | dist_check_SCRIPTS = src/pyunit/runtests.sh \ 12 | src/pyunit/testAll.py \ 13 | src/pyunit/TestLib.py \ 14 | src/pyunit/testMemory.py \ 15 | src/pyunit/testSmbios.py \ 16 | src/pyunit/HelperXml.py 17 | -------------------------------------------------------------------------------- /src/pyunit/TestLib.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python3 2 | # VIM declarations 3 | # vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=python: 4 | 5 | #alphabetical order 6 | import os 7 | import unittest 8 | 9 | # backwards compat TestCase class that works on RHEL5 10 | # sets _testMethodName to be compat with newer unittest 11 | class TestCase(unittest.TestCase): 12 | def __init__(self, *args, **kargs): 13 | super(TestCase, self).__init__(*args, **kargs) 14 | if not hasattr(self, "_testMethodName"): 15 | self._testMethodName = getattr(self, "_TestCase__testMethodName", "") 16 | 17 | def usage(): 18 | print("wrong command line options.") #need better help eventually 19 | 20 | def parseOptions(*args): 21 | pass 22 | 23 | def runTests( testCase ): 24 | testToRun = 'test' 25 | 26 | myTestSuite = unittest.TestSuite() 27 | for i in testCase: 28 | try: 29 | temp = unittest.makeSuite( i, testToRun ) 30 | myTestSuite.addTest(temp) 31 | except ValueError: 32 | pass 33 | 34 | runner = unittest.TextTestRunner( verbosity=3 ) 35 | retval = runner.run(myTestSuite) 36 | 37 | return retval.wasSuccessful() 38 | 39 | #END main( testCase ): 40 | 41 | main = runTests 42 | 43 | def areFilesDifferent( orig, copy ): 44 | ret = os.system( "diff -q %s %s >/dev/null 2>&1" % (orig, copy) ) >> 8 45 | if ret == 0: 46 | return 0 47 | if ret == 1: 48 | return 1 49 | raise OSError(ret) 50 | 51 | def copyFile( source, dest ): 52 | fileOrig = open( source, "r" ) 53 | fileCopy = open( dest, "w" ) 54 | 55 | line = fileOrig.read( 512 ) 56 | while line != "": 57 | fileCopy.write(line) 58 | line = fileOrig.read( 512 ) 59 | 60 | fileOrig.close() 61 | fileCopy.close() 62 | 63 | if __name__ == "__main__": 64 | print("This file is not executable.") 65 | -------------------------------------------------------------------------------- /src/pyunit/runtests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #set -x 4 | set -e 5 | 6 | DIR=$(cd $(dirname $0); pwd) 7 | 8 | TMPDIR=$PWD/out/test 9 | mkdir -p $TMPDIR ||: 10 | 11 | [ -n "$TST" ] || TST=out 12 | 13 | export MALLOC_PERTURB_=0xBABADABA 14 | 15 | export LD_LIBRARY_PATH=$PWD/out/.libs 16 | export PYTHONPATH=$PYTHONPATH:$top_srcdir/src/python 17 | 18 | reconstruct_memdump() { 19 | source_dir=$1 20 | target_dir=$2 21 | 22 | [ ! -e $target_dir/memdump.dat ] || return 0 23 | 24 | dd if=/dev/zero of=$target_dir/memdump.dat bs=1 count=1 conv=notrunc seek=$(( 0x100000 - 1 )) > /dev/null 2>&1 25 | 26 | # start with smbios, since it should be 0xE0000 27 | if [ -e $source_dir/smbios.dat ]; then 28 | #echo "laying down smbios table." 29 | dd if=$source_dir/smbios.dat of=$target_dir/memdump.dat bs=1 conv=notrunc seek=$(( 0xE0000 )) > /dev/null 2>&1 30 | fi 31 | 32 | if [ -e $source_dir/sysstr.dat ]; then 33 | #echo "laying down system string" 34 | dd if=$source_dir/sysstr.dat of=$target_dir/memdump.dat bs=1 conv=notrunc seek=$(( 0xFE076 )) > /dev/null 2>&1 35 | fi 36 | 37 | if [ -e $source_dir/idbyte.dat ]; then 38 | #echo "laying down id byte" 39 | dd if=$source_dir/idbyte.dat of=$target_dir/memdump.dat bs=1 conv=notrunc seek=$(( 0xFE840 )) > /dev/null 2>&1 40 | fi 41 | 42 | for offsetfn in $source_dir/offset-*.dat; 43 | do 44 | [ -e $offsetfn ] || continue 45 | fn=$(basename $offsetfn) 46 | basefn=$(basename $fn .dat) 47 | offset=${basefn##offset-} 48 | echo "lay down offsets $offset" 49 | dd if=$offsetfn of=$target_dir/memdump.dat bs=1 conv=notrunc seek=$(( $offset )) > /dev/null 2>&1 50 | done 51 | } 52 | 53 | run_test() { 54 | target_dir=$TMPDIR 55 | test_binary=$1 56 | source_dir=$2 57 | echo -e $3 58 | if [ ! -e $DIR/${test_binary} -a -e $DIR/${test_binary}.exe ]; then 59 | test_binary=${test_binary}.exe 60 | fi 61 | rm -rf $TMPDIR/* 62 | if [ -n "$source_dir" ]; then 63 | cp $source_dir/* $target_dir/ ||: 64 | reconstruct_memdump $target_dir $target_dir 65 | fi 66 | $VALGRIND $DIR/$test_binary $TMPDIR $(basename "$source_dir") 67 | } 68 | 69 | run_test testAll.py $DIR/test_data/opti "\n\nRunning ALL PYTHON tests." 70 | 71 | if [ "$TEST_STANDALONE_ONLY" = "1" ]; then exit 0; fi 72 | 73 | for i in $DIR/test_data/opti $DIR/system_dumps/* ${UNIT_TEST_DATA_DIR}/platform/*; do 74 | [ -e $i ] || continue 75 | run_test testSmbios.py $i "\n\nRunning PYTHON SMBIOS tests for $i." 76 | done 77 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/ES3020/cmos.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/ES3020/cmos.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/ES3020/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/ES3020/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/ES3020/readme.txt: -------------------------------------------------------------------------------- 1 | this is a PE2600 in disguise. 2 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/ES3020/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/ES3020/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/ES3020/sysstr.dat: -------------------------------------------------------------------------------- 1 | Dell System -------------------------------------------------------------------------------- /src/pyunit/system_dumps/ES3020/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0x123 5 | ES3020 6 | 8T64121 7 | ` 8 | A10 9 | UNISYS Corp. 10 | 1 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/ES3040/cmos.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/ES3040/cmos.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/ES3040/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/ES3040/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/ES3040/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/ES3040/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/ES3040/sysstr.dat: -------------------------------------------------------------------------------- 1 | Dell System -------------------------------------------------------------------------------- /src/pyunit/system_dumps/ES3040/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0x0109 5 | ES3040 6 | DJJYN11 7 | ` 8 | A14 9 | UNISYS Corp. 10 | 1 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/IDS4235/cmos.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/IDS4235/cmos.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/IDS4235/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/IDS4235/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/IDS4235/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/IDS4235/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/IDS4235/sysstr.dat: -------------------------------------------------------------------------------- 1 | Dell System -------------------------------------------------------------------------------- /src/pyunit/system_dumps/IDS4235/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0x011B 5 | IDS-4235/4250 6 | 970LB41 7 | 8 | A04 9 | Cisco Systems 10 | 1 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PAweb110/cmos.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PAweb110/cmos.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PAweb110/idbyte.dat: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PAweb110/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PAweb110/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PAweb110/sysstr.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PAweb110/sysstr.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PAweb110/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0xE0 5 | PowerApp.web 110 L 6 | BEN03 7 | 8 | TR440BXA.86B.0026.P08.0008311605 9 | Dell Computer Corp. 10 | 1 11 | 12 | 13 | 14 | Intel Corp. 15 | TR440BXA.86B.0026.P08.0008311605 16 | 08/31/2000 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE0400/cmos.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE0400/cmos.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE0400/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE0400/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE0400/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE0400/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE0400/sysstr.dat: -------------------------------------------------------------------------------- 1 | Dell System -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE0400/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0x162 5 | PowerEdge 400SC 6 | FWXPH31 7 | 8 | A02 9 | Dell Computer Corporation 10 | 1 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE0420/cmos.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE0420/cmos.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE0420/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE0420/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE0420/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE0420/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE0420/sysstr.dat: -------------------------------------------------------------------------------- 1 | Dell System -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE0420/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0x180 5 | PowerEdge SC420 6 | 4C98G61 7 | 8 | A00 9 | Dell Inc. 10 | 1 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE0500/cmos.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE0500/cmos.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE0500/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE0500/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE0500/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE0500/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE0500/sysstr.dat: -------------------------------------------------------------------------------- 1 | Dell System -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE0500/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0x010B 5 | PowerEdge 500SC 6 | 28SXY01 7 | 8 | X21 9 | Dell Computer Corporation 10 | 1 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE0600/cmos.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE0600/cmos.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE0600/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE0600/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE0600/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE0600/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE0600/sysstr.dat: -------------------------------------------------------------------------------- 1 | Dell System -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE0600/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0x134 5 | PowerEdge 600SC 6 | C8B0331 7 | 8 | A06 9 | Dell Computer Corporation 10 | 1 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE0650/cmos.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE0650/cmos.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE0650/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE0650/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE0650/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE0650/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE0650/sysstr.dat: -------------------------------------------------------------------------------- 1 | Dell System -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE0650/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0x141 5 | PowerEdge 650 6 | DRF8B31 7 | 8 | A03 9 | Dell Computer Corporation 10 | 1 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE1300/cmos.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE1300/cmos.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE1300/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE1300/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE1300/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE1300/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE1300/sysstr.dat: -------------------------------------------------------------------------------- 1 | Dell System -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE1300/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0x8E 5 | PowerEdge 1300/600 6 | BYYE0 7 | 8 | A05 9 | Dell Computer Corporation 10 | 1 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE1650/cmos.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE1650/cmos.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE1650/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE1650/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE1650/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE1650/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE1650/sysstr.dat: -------------------------------------------------------------------------------- 1 | Dell System -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE1650/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0x011B 5 | PowerEdge 1650 6 | D75PD11 7 | 8 | A08 9 | Dell Computer Corporation 10 | 1 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE1655_blade1/cmos.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE1655_blade1/cmos.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE1655_blade1/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE1655_blade1/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE1655_blade1/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE1655_blade1/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE1655_blade1/sysstr.dat: -------------------------------------------------------------------------------- 1 | Dell System -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE1655_blade1/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0x124 5 | PowerEdge 1655MC 6 | CZTBM21 7 | 8 | A01 9 | Dell Computer Corporation 10 | 1 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE1655_blade2/cmos.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE1655_blade2/cmos.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE1655_blade2/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE1655_blade2/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE1655_blade2/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE1655_blade2/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE1655_blade2/sysstr.dat: -------------------------------------------------------------------------------- 1 | Dell System -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE1655_blade2/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0x124 5 | PowerEdge 1655MC 6 | J0VBM21 7 | 8 | A00 9 | Dell Computer Corporation 10 | 1 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE1750_A00/cmos.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE1750_A00/cmos.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE1750_A00/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE1750_A00/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE1750_A00/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE1750_A00/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE1750_A00/sysstr.dat: -------------------------------------------------------------------------------- 1 | Dell System -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE1750_A00/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0x014A 5 | PowerEdge 1750 6 | 144S931 7 | 8 | A00 9 | Dell Computer Corporation 10 | 1 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE1750_A07/cmos.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE1750_A07/cmos.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE1750_A07/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE1750_A07/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE1750_A07/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE1750_A07/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE1750_A07/sysstr.dat: -------------------------------------------------------------------------------- 1 | Dell System -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE1750_A07/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0x014A 5 | PowerEdge 1750 6 | 144S931 7 | 8 | A07 9 | Dell Computer Corporation 10 | 1 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE2450/cmos.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE2450/cmos.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE2450/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE2450/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE2450/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE2450/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE2450/sysstr.dat: -------------------------------------------------------------------------------- 1 | Dell System -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE2450/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0xA6 5 | PowerEdge 2450 6 | 165IK 7 | 8 | A09 9 | Dell Computer Corporation 10 | 1 11 | 12 | 13 | 14 | 15 | BIOS Bug in this version of BIOS that we have not yet worked around. They put a checksum in the middle of a checked-range. 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE2500/cmos.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE2500/cmos.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE2500/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE2500/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE2500/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE2500/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE2500/sysstr.dat: -------------------------------------------------------------------------------- 1 | Dell System -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE2500/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0xd9 5 | PowerEdge 2500 6 | J5RP211 7 | 8 | A04 9 | Dell Computer Corporation 10 | 1 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE2600/cmos.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE2600/cmos.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE2600/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE2600/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE2600/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE2600/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE2600/sysstr.dat: -------------------------------------------------------------------------------- 1 | Dell System -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE2600/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0x123 5 | PowerEdge 2600 6 | 8T64121 7 | 8 | A10 9 | Dell Computer Corporation 10 | 1 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE2650/cmos.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE2650/cmos.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE2650/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE2650/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE2650/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE2650/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE2650/sysstr.dat: -------------------------------------------------------------------------------- 1 | Dell System -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE2650/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0x121 5 | PowerEdge 2650 6 | 1LWBP21 7 | 8 | A10 9 | Dell Computer Corporation 10 | 1 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE4400/cmos.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE4400/cmos.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE4400/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE4400/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE4400/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE4400/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE4400/sysstr.dat: -------------------------------------------------------------------------------- 1 | Dell System -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE4400/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0x09A 5 | PowerEdge 4400 6 | FG8Y6 7 | 8 | A11 9 | Dell Computer Corporation 10 | 1 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE4600/cmos.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE4600/cmos.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE4600/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE4600/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE4600/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE4600/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE4600/sysstr.dat: -------------------------------------------------------------------------------- 1 | Dell System -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE4600/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0x0106 5 | PowerEdge 4600 6 | BR61G11 7 | 8 | A10 9 | Dell Computer Corporation 10 | 1 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE6450/cmos.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE6450/cmos.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE6450/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE6450/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE6450/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE6450/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE6450/sysstr.dat: -------------------------------------------------------------------------------- 1 | Dell System -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE6450/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0x0A2 5 | PowerEdge 6450/550 6 | CQPF30B 7 | 8 | A12 9 | Dell Computer Corporation 10 | 1 11 | 12 | 13 | 14 | Dell Computer Corporation 15 | A12 16 | 09/15/2002 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE6600/cmos.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE6600/cmos.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE6600/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE6600/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE6600/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE6600/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE6600/sysstr.dat: -------------------------------------------------------------------------------- 1 | Dell System -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE6600/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0x109 5 | PowerEdge 6600 6 | 5QBKP11 7 | 8 | A05 9 | Dell Computer Corporation 10 | 1 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE8450/cmos.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE8450/cmos.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE8450/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE8450/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE8450/offset-0xD8040.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE8450/offset-0xD8040.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE8450/offset-0xDC040.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE8450/offset-0xDC040.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE8450/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PE8450/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE8450/sysstr.dat: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PE8450/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0x8C 5 | Dell PowerEdge 8450 6 | 7 | 87654321 8 | No Asset Tag 9 | A06 10 | Dell Computer Corporation 11 | 1 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PV755N/cmos.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PV755N/cmos.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PV755N/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PV755N/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PV755N/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/PV755N/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PV755N/sysstr.dat: -------------------------------------------------------------------------------- 1 | Dell System -------------------------------------------------------------------------------- /src/pyunit/system_dumps/PV755N/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0xEF 5 | PowerVault 755N 6 | 35X1B11 7 | PASS:QT/ 8 | A05 9 | Dell Computer Corporation 10 | 1 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/Precision_390/cmos.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/Precision_390/cmos.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/Precision_390/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/Precision_390/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/Precision_390/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/Precision_390/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/Precision_390/sysstr.dat: -------------------------------------------------------------------------------- 1 | Dell System -------------------------------------------------------------------------------- /src/pyunit/system_dumps/Precision_390/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0x01DE 5 | Precision WorkStation 390 6 | 25DVYB1 7 | 8 | 2.5.0 9 | Dell Inc. 10 | 1 11 | 12 | 13 | 14 | Dell Inc. 15 | 2.5.0 16 | 11/14/2007 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/dimension_4400/cmos.dat: -------------------------------------------------------------------------------- 1 | no cmos data 2 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/dimension_4400/idbyte.dat: -------------------------------------------------------------------------------- 1 | Dell Compute -------------------------------------------------------------------------------- /src/pyunit/system_dumps/dimension_4400/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/dimension_4400/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/dimension_4400/sysstr.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/dimension_4400/sysstr.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/dimension_4400/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0x0115 5 | DIM4400 6 | 53PSG11 7 | 8 | A05 9 | Dell Computer Corporation 10 | 1 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/latitude_D500/cmos.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/latitude_D500/cmos.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/latitude_D500/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/latitude_D500/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/latitude_D500/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/latitude_D500/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/latitude_D500/sysstr.dat: -------------------------------------------------------------------------------- 1 | Dell System -------------------------------------------------------------------------------- /src/pyunit/system_dumps/latitude_D500/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0x0152 5 | Latitude D500 6 | 5QK2X31 7 | 8 | A06 9 | Dell Computer Corporation 10 | 1 11 | 12 | 13 | 14 | 15 | BIOS Bug in this version of BIOS that we have not yet worked around. They put a checksum in the middle of a checked-range. 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/latitude_D610/cmos.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/latitude_D610/cmos.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/latitude_D610/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/latitude_D610/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/latitude_D610/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/latitude_D610/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/latitude_D610/sysstr.dat: -------------------------------------------------------------------------------- 1 | Dell System -------------------------------------------------------------------------------- /src/pyunit/system_dumps/latitude_D610/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0x0182 5 | Latitude D610 6 | HNJTC81 7 | 8 | A06 9 | Dell Inc. 10 | 1 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/opti/cmos.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/opti/cmos.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/opti/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/opti/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/opti/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/opti/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/opti/sysstr.dat: -------------------------------------------------------------------------------- 1 | Dell System -------------------------------------------------------------------------------- /src/pyunit/system_dumps/opti/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0x00B4 5 | OptiPlex GX110 6 | 6EGWH 7 | 8 | A05 9 | Dell Computer Corporation 10 | 1 11 | 12 | 13 | 14 | Dell Computer Corporation 15 | A05 16 | 09/18/2000 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/precisiont7600/DMI: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/precisiont7600/DMI -------------------------------------------------------------------------------- /src/pyunit/system_dumps/precisiont7600/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/precisiont7600/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/precisiont7600/smbios_entry_point: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/precisiont7600/smbios_entry_point -------------------------------------------------------------------------------- /src/pyunit/system_dumps/precisiont7600/sysstr.dat: -------------------------------------------------------------------------------- 1 | Dell System -------------------------------------------------------------------------------- /src/pyunit/system_dumps/precisiont7600/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0x0495 5 | Precision T7600 6 | 7 | 8 | T51 9 | Dell Inc. 10 | 1 11 | 12 | 13 | 14 | Dell Inc. 15 | T51 16 | 04/06/2012 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/pyunit/system_dumps/xps9365/DMI: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/xps9365/DMI -------------------------------------------------------------------------------- /src/pyunit/system_dumps/xps9365/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/xps9365/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/xps9365/smbios_entry_point: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/xps9365/smbios_entry_point -------------------------------------------------------------------------------- /src/pyunit/system_dumps/xps9365/sysstr.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/system_dumps/xps9365/sysstr.dat -------------------------------------------------------------------------------- /src/pyunit/system_dumps/xps9365/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0x077A 5 | XPS 13 9365 6 | 2R0Q2G2 7 | 8 | 1.0.21 9 | Dell Inc. 10 | 1 11 | 12 | 13 | 14 | Dell Inc. 15 | 1.0.21 16 | 12/05/2017 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/pyunit/testAll.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python3 2 | # VIM declarations 3 | # vim:tw=0:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=python: 4 | 5 | #alphabetical 6 | import os 7 | import sys 8 | import glob 9 | 10 | # all of the variables below are substituted by the build system 11 | __VERSION__="1.0.0" 12 | 13 | import TestLib 14 | 15 | exeName = os.path.realpath(sys.argv[0]) 16 | top_srcdir = os.path.join(os.path.dirname(exeName), "..") 17 | top_builddir = os.getcwd() 18 | 19 | sys.path.insert(0,top_srcdir) 20 | 21 | # runs all modules TestCase() classes in files that match test*.py 22 | if __name__ == "__main__": 23 | testModulePath="%s/pyunit/" % top_srcdir 24 | 25 | moduleNames = glob.glob( "%s/test*.py" % testModulePath ) 26 | moduleNames = [ m[len(testModulePath):-3] for m in moduleNames ] 27 | 28 | tests = [] 29 | for moduleName in moduleNames: 30 | if "testAll" in moduleName: 31 | continue 32 | module = __import__(moduleName, globals(), locals(), []) 33 | module.TestCase.top_srcdir=top_srcdir 34 | module.TestCase.top_builddir=top_builddir 35 | tests.append(module.TestCase) 36 | 37 | retval = 1 38 | if tests: 39 | retval = TestLib.runTests( tests ) 40 | 41 | sys.exit( not retval ) 42 | -------------------------------------------------------------------------------- /src/pyunit/test_data/opti/cmos.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/test_data/opti/cmos.dat -------------------------------------------------------------------------------- /src/pyunit/test_data/opti/idbyte.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/test_data/opti/idbyte.dat -------------------------------------------------------------------------------- /src/pyunit/test_data/opti/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/pyunit/test_data/opti/smbios.dat -------------------------------------------------------------------------------- /src/pyunit/test_data/opti/sysstr.dat: -------------------------------------------------------------------------------- 1 | Dell System -------------------------------------------------------------------------------- /src/pyunit/test_data/opti/testInput.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0x00B4 5 | OptiPlex GX110 6 | 6EGWH 7 | 8 | A05 9 | Dell Computer Corporation 10 | 1 11 | 12 | 13 | 14 | Dell Computer Corporation 15 | A05 16 | 09/18/2000 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/smbios.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/libsmbios/f01a21763180c9c11d70326ad36b9761cde9131c/src/smbios.dat --------------------------------------------------------------------------------