.\" Title: nvme-security-recv
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\" Date: 06/08/2015
+.\" Date: 03/03/2016
.\" Manual: NVMe Manual
.\" Source: NVMe
.\" Language: English
.\"
-.TH "NVME\-SECURITY\-RECV" "1" "06/08/2015" "NVMe" "NVMe Manual"
+.TH "NVME\-SECURITY\-RECV" "1" "03/03/2016" "NVMe" "NVMe Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
[\-\-secp=<security\-protocol> | \-p <security\-protocol>]
[\-\-spsp=<protocol\-specific> | \-s <protocol\-specific>]
[\-\-tl=<transfer\-length> | \-t <transfer\-length>]
+ [\-\-namespace\-id=<nsid> | \-n <nsid>]
[\-b | \-\-raw\-binary]
.fi
.SH "DESCRIPTION"
Each Security Receive command returns the appropriate data corresponding to a Security Send command as defined by the rules of the Security Protocol\&. The Security Receive command data may not be retained if there is a loss of communication between the controller and host, or if a controller reset occurs\&.
.SH "OPTIONS"
.PP
+\-n <nsid>, \-\-namespace\-id=<nsid>
+.RS 4
+Target a specific namespace for this security command\&.
+.RE
+.PP
\-x <size>, \-\-size=<size>
.RS 4
Size of buffer to allocate\&. One success it will be printed to STDOUT\&.
const char *secp = "security protocol (cf. SPC-4)";
const char *spsp = "security-protocol-specific (cf. SPC-4)";
const char *tl = "transfer length (cf. SPC-4)";
+ const char *namespace_id = "desired namespace";
int err, sec_fd = -1;
void *sec_buf;
unsigned int sec_size;
__u32 result;
struct config {
+ __u32 namespace_id;
char *file;
__u8 secp;
__u16 spsp;
};
const struct argconfig_commandline_options command_line_options[] = {
- {"file", 'f', "FILE", CFG_STRING, &cfg.file, required_argument, file},
- {"secp", 'p', "NUM", CFG_BYTE, &cfg.secp, required_argument, secp},
- {"spsp", 's', "NUM", CFG_SHORT, &cfg.spsp, required_argument, spsp},
- {"tl", 't', "NUM", CFG_POSITIVE, &cfg.tl, required_argument, tl},
+ {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.namespace_id, required_argument, namespace_id},
+ {"file", 'f', "FILE", CFG_STRING, &cfg.file, required_argument, file},
+ {"secp", 'p', "NUM", CFG_BYTE, &cfg.secp, required_argument, secp},
+ {"spsp", 's', "NUM", CFG_SHORT, &cfg.spsp, required_argument, spsp},
+ {"tl", 't', "NUM", CFG_POSITIVE, &cfg.tl, required_argument, tl},
{0}
};
argconfig_parse(argc, argv, desc, command_line_options,
&cfg, sizeof(cfg));
-
get_dev(1, argc, argv);
sec_fd = open(cfg.file, O_RDONLY);
}
err = nvme_sec_send(fd,
- 0 /* FIXME: add nsid param */,
+ cfg.namespace_id,
0 /* FIXME: add nssf */,
cfg.spsp, cfg.secp, cfg.tl, sec_size, sec_buf, &result);
if (err < 0)
const char *spsp = "security-protocol-specific (cf. SPC-4)";
const char *al = "allocation length (cf. SPC-4)";
const char *raw_binary = "dump output in binary format";
+ const char *namespace_id = "desired namespace";
int err;
void *sec_buf = NULL;
__u32 result;
struct config {
+ __u32 namespace_id;
__u32 size;
__u8 secp;
__u16 spsp;
};
const struct argconfig_commandline_options command_line_options[] = {
- {"size", 'x', "NUM", CFG_POSITIVE, &cfg.size, required_argument, size},
- {"secp", 'p', "NUM", CFG_BYTE, &cfg.secp, required_argument, secp},
- {"spsp", 's', "NUM", CFG_SHORT, &cfg.spsp, required_argument, spsp},
- {"al", 't', "NUM", CFG_POSITIVE, &cfg.al, required_argument, al},
- {"raw-binary", 'b', "", CFG_NONE, &cfg.raw_binary, no_argument, raw_binary},
+ {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.namespace_id, required_argument, namespace_id},
+ {"size", 'x', "NUM", CFG_POSITIVE, &cfg.size, required_argument, size},
+ {"secp", 'p', "NUM", CFG_BYTE, &cfg.secp, required_argument, secp},
+ {"spsp", 's', "NUM", CFG_SHORT, &cfg.spsp, required_argument, spsp},
+ {"al", 't', "NUM", CFG_POSITIVE, &cfg.al, required_argument, al},
+ {"raw-binary", 'b', "", CFG_NONE, &cfg.raw_binary, no_argument, raw_binary},
{0}
};
}
err = nvme_sec_recv(fd,
- 0 /* FIXME: namespace_id */,
+ cfg.namespace_id,
0 /* FIXME: nssf */,
cfg.spsp, cfg.secp, cfg.al, cfg.size, sec_buf, &result);
if (err < 0)