dmidecode  3.3
About: dmidecode is a tool for dumping a computers DMI (some say SMBIOS) table contents in a human-readable format.
  Fossies Dox: dmidecode-3.3.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

dmiopt.c File Reference
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include <stdlib.h>
#include <getopt.h>
#include "config.h"
#include "types.h"
#include "util.h"
#include "dmidecode.h"
#include "dmiopt.h"
Include dependency graph for dmiopt.c:

Go to the source code of this file.

Data Structures

struct  type_keyword
 

Functions

static void print_opt_type_list (void)
 
static u8parse_opt_type (u8 *p, const char *arg)
 
static void print_opt_string_list (void)
 
static int parse_opt_string (const char *arg)
 
static int parse_opt_oem_string (const char *arg)
 
static u32 parse_opt_handle (const char *arg)
 
int parse_command_line (int argc, char *const argv[])
 
void print_help (void)
 

Variables

struct opt opt
 
static const u8 opt_type_bios [] = { 0, 13, 255 }
 
static const u8 opt_type_system [] = { 1, 12, 15, 23, 32, 255 }
 
static const u8 opt_type_baseboard [] = { 2, 10, 41, 255 }
 
static const u8 opt_type_chassis [] = { 3, 255 }
 
static const u8 opt_type_processor [] = { 4, 255 }
 
static const u8 opt_type_memory [] = { 5, 6, 16, 17, 255 }
 
static const u8 opt_type_cache [] = { 7, 255 }
 
static const u8 opt_type_connector [] = { 8, 255 }
 
static const u8 opt_type_slot [] = { 9, 255 }
 
static const struct type_keyword opt_type_keyword []
 
static const struct string_keyword opt_string_keyword []
 
static struct string_keyword opt_oem_string_keyword
 

Function Documentation

◆ parse_command_line()

int parse_command_line ( int  argc,
char *const  argv[] 
)

Definition at line 265 of file dmiopt.c.

◆ parse_opt_handle()

static u32 parse_opt_handle ( const char *  arg)
static

Definition at line 246 of file dmiopt.c.

Referenced by parse_command_line().

◆ parse_opt_oem_string()

static int parse_opt_oem_string ( const char *  arg)
static

Definition at line 218 of file dmiopt.c.

References string_keyword::offset, opt_oem_string_keyword, and opt::string.

Referenced by parse_command_line().

◆ parse_opt_string()

static int parse_opt_string ( const char *  arg)
static

◆ parse_opt_type()

static u8* parse_opt_type ( u8 p,
const char *  arg 
)
static

◆ print_help()

void print_help ( void  )

Definition at line 366 of file dmiopt.c.

◆ print_opt_string_list()

static void print_opt_string_list ( void  )
static

Definition at line 183 of file dmiopt.c.

References ARRAY_SIZE, string_keyword::keyword, and opt_string_keyword.

Referenced by parse_command_line(), and parse_opt_string().

◆ print_opt_type_list()

static void print_opt_type_list ( void  )
static

Definition at line 71 of file dmiopt.c.

References ARRAY_SIZE, type_keyword::keyword, and opt_type_keyword.

Referenced by parse_command_line(), and parse_opt_type().

Variable Documentation

◆ opt

struct opt opt

Definition at line 1 of file dmiopt.c.

◆ opt_oem_string_keyword

struct string_keyword opt_oem_string_keyword
static
Initial value:
=
{ NULL, 11, 0x00 }

Definition at line 82 of file dmiopt.c.

Referenced by parse_opt_oem_string().

◆ opt_string_keyword

const struct string_keyword opt_string_keyword[]
static
Initial value:
= {
{ "bios-vendor", 0, 0x04 },
{ "bios-version", 0, 0x05 },
{ "bios-release-date", 0, 0x08 },
{ "bios-revision", 0, 0x15 },
{ "firmware-revision", 0, 0x17 },
{ "system-manufacturer", 1, 0x04 },
{ "system-product-name", 1, 0x05 },
{ "system-version", 1, 0x06 },
{ "system-serial-number", 1, 0x07 },
{ "system-uuid", 1, 0x08 },
{ "system-sku-number", 1, 0x19 },
{ "system-family", 1, 0x1a },
{ "baseboard-manufacturer", 2, 0x04 },
{ "baseboard-product-name", 2, 0x05 },
{ "baseboard-version", 2, 0x06 },
{ "baseboard-serial-number", 2, 0x07 },
{ "baseboard-asset-tag", 2, 0x08 },
{ "chassis-manufacturer", 3, 0x04 },
{ "chassis-type", 3, 0x05 },
{ "chassis-version", 3, 0x06 },
{ "chassis-serial-number", 3, 0x07 },
{ "chassis-asset-tag", 3, 0x08 },
{ "processor-family", 4, 0x06 },
{ "processor-manufacturer", 4, 0x07 },
{ "processor-version", 4, 0x10 },
{ "processor-frequency", 4, 0x16 },
}

Definition at line 82 of file dmiopt.c.

Referenced by parse_opt_string(), and print_opt_string_list().

◆ opt_type_baseboard

const u8 opt_type_baseboard[] = { 2, 10, 41, 255 }
static

Definition at line 51 of file dmiopt.c.

◆ opt_type_bios

const u8 opt_type_bios[] = { 0, 13, 255 }
static

Definition at line 49 of file dmiopt.c.

◆ opt_type_cache

const u8 opt_type_cache[] = { 7, 255 }
static

Definition at line 55 of file dmiopt.c.

◆ opt_type_chassis

const u8 opt_type_chassis[] = { 3, 255 }
static

Definition at line 52 of file dmiopt.c.

◆ opt_type_connector

const u8 opt_type_connector[] = { 8, 255 }
static

Definition at line 56 of file dmiopt.c.

◆ opt_type_keyword

const struct type_keyword opt_type_keyword[]
static
Initial value:
= {
{ "bios", opt_type_bios },
{ "system", opt_type_system },
{ "baseboard", opt_type_baseboard },
{ "chassis", opt_type_chassis },
{ "processor", opt_type_processor },
{ "memory", opt_type_memory },
{ "cache", opt_type_cache },
{ "connector", opt_type_connector },
{ "slot", opt_type_slot },
}

Definition at line 57 of file dmiopt.c.

Referenced by parse_opt_type(), and print_opt_type_list().

◆ opt_type_memory

const u8 opt_type_memory[] = { 5, 6, 16, 17, 255 }
static

Definition at line 54 of file dmiopt.c.

◆ opt_type_processor

const u8 opt_type_processor[] = { 4, 255 }
static

Definition at line 53 of file dmiopt.c.

◆ opt_type_slot

const u8 opt_type_slot[] = { 9, 255 }
static

Definition at line 57 of file dmiopt.c.

◆ opt_type_system

const u8 opt_type_system[] = { 1, 12, 15, 23, 32, 255 }
static

Definition at line 50 of file dmiopt.c.

opt_type_baseboard
static const u8 opt_type_baseboard[]
Definition: dmiopt.c:51
opt_type_cache
static const u8 opt_type_cache[]
Definition: dmiopt.c:55
opt_type_bios
static const u8 opt_type_bios[]
Definition: dmiopt.c:49
opt_type_processor
static const u8 opt_type_processor[]
Definition: dmiopt.c:53
opt_type_chassis
static const u8 opt_type_chassis[]
Definition: dmiopt.c:52
opt_type_system
static const u8 opt_type_system[]
Definition: dmiopt.c:50
opt_type_connector
static const u8 opt_type_connector[]
Definition: dmiopt.c:56
opt_type_slot
static const u8 opt_type_slot[]
Definition: dmiopt.c:57
opt_type_memory
static const u8 opt_type_memory[]
Definition: dmiopt.c:54