Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating SMBios data types. #24

Merged
merged 3 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions arch/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

pkgname=dmiget

pkgver=1.1
pkgver=1.0
pkgrel=0
pkgdesc="Get DMI information using URL format"
url="https://github.com/PerryWerneck/dmiget"
arch=(i686 x86_64)
license=(GPL)
depends=(openssl)
depends=()
makedepends=(autoconf automake make python)
checkdepends=()

Expand Down
4 changes: 3 additions & 1 deletion rpm/dmiget.spec
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

%{?!python_module:%define python_module() python3-%{**}}

Summary: Get DMI information using URL format
Name: dmiget
Version: 1.0
Expand All @@ -34,11 +36,11 @@ BuildRequires: libtool
BuildRequires: binutils
BuildRequires: coreutils
BuildRequires: gcc-c++ >= 5

BuildRequires: pkgconfig(python3)
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}


%description
Tool to get information from DMI table using an url-like format.

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
package_version = line.split('[')[2].split(']')[0].strip()
break;

package_version += '.2'
package_version += '.3'

extra_compile_args.append('-DPACKAGE_VERSION=\"' + package_version + '\"')

Expand Down
2 changes: 1 addition & 1 deletion src/dmiget/dmiget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@

case Complete:
// Show standard output.
for(SMBios::Node node = Node::factory(node_name);node;node.next(node_name)) {
for(SMBios::Node node = Node::factory(filename, node_name);node;node.next(node_name)) {
if(show_node) {

writer->write(node);
Expand Down
10 changes: 6 additions & 4 deletions src/include/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H

/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H

/* Do we have python3? */
#undef HAVE_PYTHON3

/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H

/* Define to 1 if you have the <stdio.h> header file. */
#undef HAVE_STDIO_H

/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H

Expand Down Expand Up @@ -81,7 +81,9 @@
/* The python version */
#undef PYTHON_VERSION

/* Define to 1 if you have the ANSI C header files. */
/* Define to 1 if all of the C89 standard headers exist (not just the ones
required in a freestanding environment). This macro is provided for
backward compatibility; new code need not use it. */
#undef STDC_HEADERS

/* Version number of package */
Expand Down
32 changes: 32 additions & 0 deletions src/libdmiget/decoders/table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@
{}
};

static const Decoder::Item ProcessorAditional[] = {
{ "handle", Decoder::Hex16{}, 0x04, "Referenced Handle" },
{}
};

static const Decoder::Item Cache[] = {
{ "socket", Decoder::String{}, 0x04, "Socket Designation" },
{}
Expand Down Expand Up @@ -531,6 +536,22 @@
"TPMDevice",
"TPM Device",
EmptyTable
},
{
44,
false,
"ProcessorAditional",
"Processor Additional Information",
ProcessorAditional
},
{
// VMWare type 126 'Inactive' ?!?!?!?!
// https://github.com/vmware/esx-boot/blob/master/uefi/edk2/MdePkg/Include/IndustryStandard/SmBios.h
126,
false,
"Inactive",
"Inactive",
EmptyTable
}

};
Expand All @@ -554,13 +575,24 @@
}
}

static const Decoder::Type invtype {
0,
true,
"inv",
"Invalid SMBios type",
EmptyTable
};
return &invtype;

/*
#ifdef _MSC_VER
char str[20];
snprintf(str,19,"%u",(unsigned int) type);
throw std::system_error(ENOENT,std::system_category(),string{"Invalid SMBIos structure type: "}+str);
#else
throw std::system_error(ENOENT,std::system_category(),string{"Invalid SMBIos structure type: "}+std::to_string((int) type));
#endif // _MSC_VER
*/
Comment on lines +587 to +595

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.

}

Expand Down
1 change: 1 addition & 0 deletions src/libdmiget/node/next.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
}

Node & Node::next(const char *name,size_t count) {

if(name && *name) {
return next(Decoder::get(name)->type, count);
}
Expand Down
1 change: 1 addition & 0 deletions src/libdmiget/node/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
}

decoder = Decoder::get(header.type);

return *this;
}

Expand Down
Loading