File: tool_rc.h

package info (click to toggle)
tpm2-tools 5.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,988 kB
  • sloc: ansic: 45,737; sh: 14,915; xml: 8,342; makefile: 610; python: 51
file content (31 lines) | stat: -rw-r--r-- 728 bytes parent folder | download | duplicates (3)
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
/* SPDX-License-Identifier: BSD-3-Clause */

#ifndef LIB_TOOL_RC_H_
#define LIB_TOOL_RC_H_

/* do not port to TSS below here */
typedef enum tool_rc tool_rc;
enum tool_rc {
    /* do not reorder or change, part of returned codes to exit */
    /* maps to common/returns.md */
    tool_rc_success = 0,
    tool_rc_general_error,
    tool_rc_option_error,
    tool_rc_auth_error,
    tool_rc_tcti_error,
    tool_rc_unsupported
};

/**
 * Flattens a TSS generated RC into it's error component and converts it to a tool_rc suitable for tool return
 * use.
 * @note
 *  Do not port me to TSS.
 * @param rc
 *  The rc to convert.
 * @return
 *  A valid tool_rc.
 */
tool_rc tool_rc_from_tpm(TSS2_RC rc);

#endif /* LIB_TOOL_RC_H_ */