/usr/include/smbios/DellRbu.h is in libsmbios-dev 2.3.0-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c:
/*
* Copyright (C) 2005 Dell Inc.
* by Michael Brown <Michael_E_Brown@dell.com>
* Licensed under the Open Software License version 2.1
*
* Alternatively, you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation; either version 2 of the License,
* or (at your option) any later version.
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*/
#ifndef RBU_H
#define RBU_H
// compat header should always be first header, if system headers included
#include "smbios/compat.h"
#include <string>
// types.h should be first user-defined header.
#include "smbios/types.h"
#include "smbios/IFactory.h"
#include "smbios/IException.h"
// abi_prefix should be last header included before declarations
#include "smbios/config/abi_prefix.hpp"
namespace rbu
{
DECLARE_EXCEPTION( RbuException );
DECLARE_EXCEPTION_EX( RbuNotSupported, rbu, RbuException );
DECLARE_EXCEPTION_EX( InvalidHdrFile, rbu, RbuException );
DECLARE_EXCEPTION_EX( UnsupportedSystemForHdrFile, rbu, RbuException );
DECLARE_EXCEPTION_EX( HdrFileIOError, rbu, RbuException );
DECLARE_EXCEPTION_EX( RbuDriverIOError, rbu, RbuException );
typedef enum { pt_any, pt_mono, pt_packet, pt_init } packet_type;
// rbu_linux_v0: Linux 2.4
// rbu_linux_v1: 2.6 dkms
// rbu_linux_v2: 2.6.14+
typedef enum { rbu_unsupported, rbu_linux_v0, rbu_linux_v1, rbu_linux_v2, rbu_solaris } driver_type;
const int SYSID_OVERRIDE = 1;
const int BIOSVER_OVERRIDE = 2;
// forward decls
class IRbuHdr;
//!AbstractFactory that produces IRbuHdr objects.
/** The RbuFactory class is based on the Factory design pattern.
* The RbuFactory is the recommended method to create IRbuHdr
* objects.
*
* The getSingleton() is the recommended method to call to create
* tables. You need not delete the pointer returned by this method, it
* will be delete by the factory when it is reset() or destructed.
*
* Most users of the factory need call nothing more than getFactory()
* and then getSingleton() on the returned factory object.
*
* Advanced users can call setParameter() to set up internal factory
* variables that control creation of tables.
*/
class RbuFactory : public virtual factory::IFactory
{
public:
//! Create a factory object that you can use to create IRbuHdr objects.
/** Factory entry point: This is the method to call to get a handle
* to the RbuFactory. The RbuFactory is the recommended method
* to create IRbuHdr objects.
*
* The getSingleton() is the recommended method to call to create
* tables. You need not delete the pointer returned by this method, it
* will be deleted by the factory when it is reset() or destructed.
*
* \returns Singleton RbuFactory object pointer.
*/
static RbuFactory *getFactory();
virtual ~RbuFactory() throw();
//! Create a new IRbuHdr object that the caller must delete. (NOT RECOMMENDED)
/** The makeNew() method returns a pointer to a newly allocated
* IRbuHdr object. The caller is responsible for deleting this
* reference when it is finished with it. It is recommended that the
* caller store the pointer in an std::auto_ptr<IRbuHdr>.
*
* The getSingleton() method is preferred over this method.
*
* \returns (IRbuHdr *) -- caller must delete
*/
virtual IRbuHdr *makeNew(std::string filename) = 0;
protected:
//! Use getFactory() to get a factory.
RbuFactory();
};
//!Interface definition for RBU HDR operations.
class IRbuHdr
{
public:
// CONSTRUCTORS, DESTRUCTOR, and ASSIGNMENT
IRbuHdr();
// Interface class: no default or copy constructor
virtual ~IRbuHdr ();
//! Used by operator << (std::ostream & cout, const IRbuHdr & ) to
//output table information.
/** Users normally would not need or want to call this API. The normal
* operator<<() has been overloaded to call this function internally.
*/
virtual std::ostream & streamify(std::ostream & cout ) const = 0;
virtual std::string getBiosVersion() const = 0;
virtual void getHdrVersion(unsigned int &major, unsigned int &minor) const = 0;
virtual const u32 *getSystemIdList() const = 0;
virtual void doUpdate() const = 0;
virtual FILE *getFh() const = 0;
private:
explicit IRbuHdr(const IRbuHdr &); ///< not implemented (explicitly disallowed)
void operator =( const IRbuHdr & ); ///< not implemented (explicitly disallowed)
};
std::ostream & operator << (std::ostream & cout, const IRbuHdr & item);
//! Cancel BIOS Update on Dell systems
/**
*/
void cancelDellBiosUpdate();
//! Check to see if a HDR file supports a specific System ID
/**
*/
bool checkSystemId(const IRbuHdr &hdr, u16 sysId );
//! Update BIOS on Dell systems
/**
*/
void dellBiosUpdate(const IRbuHdr &hdr, packet_type force_type);
//! Compare BIOS Versions
/**
*/
int compareBiosVersion(std::string ver1, std::string ver2);
}
// always should be last thing in header file
#include "smbios/config/abi_suffix.hpp"
#endif /* RBU_H */
|