<menu id="guoca"></menu>
<nav id="guoca"></nav><xmp id="guoca">
  • <xmp id="guoca">
  • <nav id="guoca"><code id="guoca"></code></nav>
  • <nav id="guoca"><code id="guoca"></code></nav>

    B.1.8 可信軟件基上下文數據結構

    B.1.8.1 數據結構

    typedef struct tsb_context

    {

    int (*get_int_value)(TSBContext *context,const char *var_name,long *pvalue);

    int (get_pointer_value)(TSBContext *context,const char *var_name,const void *pvalue);

    int (*set_measure_result)(TSBContext *context,const char *value,int length);

    TSBMeasureResult (get_measure_result_by_name)(TSBContext *context,const char *measure_name);

    TSBMeasureResult (get_measure_result_by_index)(TSBContext *context,int index);

    int (*get_estimate_result_by_name)(TSBContext *context,const char *estimate_name);

    int (*get_estimate_result_by_index)(TSBContext *context,int index);

    }TSBContext;

    成員函數:

    get_int_value 讀取環境變量,從環境上下文讀取長整數變量

    get_pointer_value 讀取環境變量,從環境上下文讀取指針變量

    set_measure_result 設置度量結果

    get_measure_result_by_name 讀取度量結果

    get_measure_result_by_index 讀取度量結果

    get_estimate_result_by_name 讀取判定結果

    get_estimate_result_by_index 讀取判定結果

    B.1.8.2 函數操作

    結構體中的操作函數

    B.1.8.2.1 get_int_value

    定義:

    int get_int_value

    (

    TSBContext *context,

    const char *var_name,

    long *pvalue

    )

    輸入參數:

    context 環境上下文

    var_name 指定變量名稱

    pvalue 值保存到pvalue指向的區域

    返回值:

    0 成功

    非0(錯誤碼) 失敗

    B.1.8.2.2 get_pointer_value

    *定義: *

    int get_pointer_value

    (

    TSBContext *context,

    const char *var_name,

    const void **pvalue

    )

    輸入參數:

    context 環境上下文

    var_name 指定變量名稱

    pvalue 值保存到pvalue指向的區域

    返回值:

    0 成功

    非0(錯誤碼) 失敗

    B.1.8.2.3 set_measure_result

    定義:

    int set_measure_result

    (

    TSBContext *context,

    const char *value,

    int length

    )

    輸入參數:

    context 環境上下文

    *value 指向度量結果

    length 度量結果的長度

    返回值:

    0 成功

    非0(錯誤碼) 失敗

    B.1.8.2.4 get_measure_result_by_name

    定義:

    TSBMeasureResult (get_measure_result_by_name)

    (

    TSBContext *context,

    const char *measure_name

    )

    輸入參數:

    *context 環境上下文

    *measure_name 度量名稱

    返回值:

    度量結果

    如果度量結果不存在,則返回空值

    B.1.8.2.5 get_measure_result_by_index

    定義:

    TSBMeasureResult (get_measure_result_by_index)

    (

    TSBContext *context,

    int index

    )

    輸入參數:

    *context 環境上下文

    index 度量名稱

    返回值:

    度量結果

    如果判定結果不存在,則返回-1

    B.1.8.2.6 get_estimate_result_by_name

    定義:

    int (*get_estimate_result_by_name)

    (

    TSBContext *context,

    const char *estimate_name

    )

    輸入參數:

    *context 環境上下文

    *estimate_name 判定名稱

    返回值:

    判定結果

    如果判定結果不存在,則返回-1

    B.1.8.2.7 get_estimate_result_by_index

    定義:

    int (*get_estimate_result_by_index)

    (

    TSBContext *context,

    int index

    )

    輸入參數:

    *context 環境上下文

    index 序號

    返回值:

    判定結果

    如果判定結果不存在,則返回-1

    本文章首發在 網安wangan.com 網站上。

    上一篇 下一篇
    討論數量: 0
    只看當前版本


    暫無話題~
    亚洲 欧美 自拍 唯美 另类