summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2022-04-19 10:18:58 +0200
committerGerd Hoffmann <kraxel@redhat.com>2022-04-22 14:52:31 +0200
commite265609f3c6ede1ad67f307e2c38821c8f21ed6f (patch)
tree384f83b85cccf4d84ff4828f02f494db38280fb6
parentc3baaa407b0128c5fcf926ebdf96f7e731607578 (diff)
downloadamtterm-e265609f3c6ede1ad67f307e2c38821c8f21ed6f.tar.gz
amtider: switch to cd-rom emulation per default and add manpage
-rw-r--r--GNUmakefile1
-rw-r--r--amtider.c30
-rw-r--r--amtider.man61
3 files changed, 77 insertions, 15 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 1e1c3e9..03b3315 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -60,6 +60,7 @@ install: build
$(INSTALL_DATA) $(DESKTOP) $(appdir)
$(INSTALL_DATA) gamt.man $(mandir)/man1/gamt.1
$(INSTALL_DATA) amtterm.man $(mandir)/man1/amtterm.1
+ $(INSTALL_DATA) amtider.man $(mandir)/man1/amtider.1
$(INSTALL_DATA) amttool.man $(mandir)/man1/amttool.1
$(INSTALL_DATA) amt-howto.man $(mandir)/man7/amt-howto.7
diff --git a/amtider.c b/amtider.c
index 1655a92..abea4a5 100644
--- a/amtider.c
+++ b/amtider.c
@@ -39,13 +39,6 @@
/* ------------------------------------------------------------------ */
-static int recv_ider(void *cb_data, unsigned char *buf, int len)
-{
- struct redir *r = cb_data;
-
- return write(STDOUT_FILENO, buf, len);
-}
-
static void state_ider(void *cb_data, enum redir_state old,
enum redir_state new)
{
@@ -166,15 +159,15 @@ static void usage(FILE *fp)
"This is " APPNAME ", release " VERSION ", it'll establish\n"
"ide-redirection (ider) connections to your Intel AMT boxes.\n"
"\n"
- "usage: " APPNAME " [options] host [port]\n"
+ "usage: " APPNAME " [options] host file\n"
"options:\n"
" -h print this text\n"
" -v verbose (default)\n"
" -q quiet\n"
- " -c use CD-ROM emulation\n"
+ " -c use CD-ROM emulation (default)\n"
+ " -f use floppy emulation\n"
" -g start redirection gracefully\n"
" -r start redirection on reboot\n"
- " -f file file to use as device data\n"
" -L use legacy authentication\n"
#if defined(USE_OPENSSL) || defined(USE_GNUTLS)
" -C cacert enable SSL and use PEM cacert file\n"
@@ -203,16 +196,15 @@ int main(int argc, char *argv[])
strcpy(r.user, "admin");
r.cb_data = &r;
- r.cb_recv = recv_ider;
r.cb_state = state_ider;
- r.device = 0xa0;
+ r.device = 0xb0;
r.enable_options = IDER_START_NOW;
if (NULL != (h = getenv("AMT_PASSWORD")))
snprintf(r.pass, sizeof(r.pass), "%s", h);
for (;;) {
- if (-1 == (c = getopt(argc, argv, "cdf:ghvqu:p:LC:")))
+ if (-1 == (c = getopt(argc, argv, "cdfghvqu:p:LC:")))
break;
switch (c) {
case 'v':
@@ -222,7 +214,7 @@ int main(int argc, char *argv[])
r.verbose = 0;
break;
case 'f':
- snprintf(r.filename, sizeof(r.filename), "%s", optarg);
+ r.device = 0xa0;
break;
case 'u':
snprintf(r.user, sizeof(r.user), "%s", optarg);
@@ -259,11 +251,19 @@ int main(int argc, char *argv[])
}
if (optind < argc) {
+ char *port;
+
snprintf(r.host, sizeof(r.host), "%s", argv[optind]);
+ port = strrchr(r.host, ':');
+ if (port) {
+ *port = '\0';
+ port++;
+ snprintf(r.port, sizeof(r.port), "%s", port);
+ }
optind++;
}
if (optind < argc) {
- snprintf(r.port, sizeof(r.port), "%s", argv[optind]);
+ snprintf(r.filename, sizeof(r.filename), "%s", argv[optind]);
optind++;
}
if (0 == strlen(r.host)) {
diff --git a/amtider.man b/amtider.man
new file mode 100644
index 0000000..ae0ef16
--- /dev/null
+++ b/amtider.man
@@ -0,0 +1,61 @@
+.TH amtider 1 "(c) 2022 Hannes Reinecke"
+.SH NAME
+amtider - Intel AMT IDE redirection (ider) client.
+.SH SYNOPSIS
+.B amtider [ options ] host[:port] file
+.SH DESCRIPTION
+.B amtider
+provides a virtual floppy or CD-ROM for Intel AMT managed machines.
+.B host
+is the hostname or IP address of the machine amtider should connect
+to.
+.B port
+is the tcp port to use and defaults to 16994 (standard AMT redirection
+port) if unspecified.
+.B file
+is the filename of the image to be used for floppy or CD-ROM emulation.
+.P
+For more information on Intel AMT check amt-howto(7).
+.SH OPTIONS
+.TP
+.B -h
+Display help text.
+.TP
+.B -v
+Be verbose (default).
+.TP
+.B -q
+Be quiet.
+.TP
+.B -u <user>
+Specify username, defaults to "admin".
+.TP
+.B -p <pass>
+Specify password.
+.B amtterm
+will prompt on the terminal if unspecified.
+.TP
+.B -c
+Use CD-ROM emulation (this is the default).
+.TP
+.B -f
+Use Floppy emulation
+.TP
+.B -g
+Start redirection gracefully.
+.TP
+.B -r
+Start redirection on reboot.
+.SH ENVIRONMENT
+.TP
+.B AMT_PASSWORD
+Default value for the password.
+.SH NOTE
+Newer AMT machines have the SoL port disabled by default, it can be
+enabled remotely using:
+"wsman put http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RedirectionService
+-h ${AMT_HOST} -P 16992 -u admin -p ${AMT_PASSWORD} -k ListenerEnabled=true"
+.SH SEE ALSO
+gamt(1), amttool(1), amtterm(1), amt-howto(7)
+.SH AUTHOR
+(c) 2022 Hannes Reinecke <hare@suse.de>