gitlab.com/apertussolutions/u-root@v7.0.0+incompatible/pkg/smbios/type126_inactive.go (about)

     1  // Copyright 2016-2019 the u-root Authors. All rights reserved
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package smbios
     6  
     7  import (
     8  	"fmt"
     9  )
    10  
    11  // Inactive table cannot be further parsed. Documentation suggests that it can be any table
    12  // that is temporarily marked inactive by tweaking the type field.
    13  
    14  // InactiveTable is Defined in DSP0134 7.46.
    15  type InactiveTable struct {
    16  	Table
    17  }
    18  
    19  // NewInactiveTable parses a generic Table into InactiveTable.
    20  func NewInactiveTable(t *Table) (*InactiveTable, error) {
    21  	if t.Type != TableTypeInactive {
    22  		return nil, fmt.Errorf("invalid table type %d", t.Type)
    23  	}
    24  	return &InactiveTable{Table: *t}, nil
    25  }
    26  
    27  func (it *InactiveTable) String() string {
    28  	return it.Header.String()
    29  }