summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--RedirectionConstants.h5
-rw-r--r--amtider.c12
2 files changed, 15 insertions, 2 deletions
diff --git a/RedirectionConstants.h b/RedirectionConstants.h
index f677922..92fd95f 100644
--- a/RedirectionConstants.h
+++ b/RedirectionConstants.h
@@ -97,6 +97,11 @@
#define IDER_INTERRUPT_IO 0x02
#define IDER_INTERRUPT_CD 0x01
+/* IDER start modes */
+#define IDER_START_ONREBOOT 0x08
+#define IDER_START_GRACEFUL 0x10
+#define IDER_START_NOW 0x18
+
#define START_IDER_REDIRECTION_LENGTH 18
#define START_IDER_REDIRECTION_REPLY_LENGTH 30 //TODO: There is a OEM Defined data field that we are assuming to be 0 bytes..
#define END_IDER_REDIRECTION_LENGTH 8
diff --git a/amtider.c b/amtider.c
index 884f9f5..d266f31 100644
--- a/amtider.c
+++ b/amtider.c
@@ -171,6 +171,8 @@ static void usage(FILE *fp)
" -h print this text\n"
" -v verbose (default)\n"
" -q quiet\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)
@@ -202,14 +204,14 @@ int main(int argc, char *argv[])
r.cb_data = &r;
r.cb_recv = recv_ider;
r.cb_state = state_ider;
- r.enable_options = 0x18;
+ r.enable_options = IDER_START_NOW;
r.lba_size = (unsigned int)1 << 11;
if (NULL != (h = getenv("AMT_PASSWORD")))
snprintf(r.pass, sizeof(r.pass), "%s", h);
for (;;) {
- if (-1 == (c = getopt(argc, argv, "f:hvqu:p:LC:")))
+ if (-1 == (c = getopt(argc, argv, "f:ghvqu:p:LC:")))
break;
switch (c) {
case 'v':
@@ -224,6 +226,12 @@ int main(int argc, char *argv[])
case 'u':
snprintf(r.user, sizeof(r.user), "%s", optarg);
break;
+ case 'g':
+ r.enable_options = IDER_START_GRACEFUL;
+ break;
+ case 'r':
+ r.enable_options = IDER_START_ONREBOOT;
+ break;
case 'p':
snprintf(r.pass, sizeof(r.pass), "%s", optarg);
memset(optarg,'*',strlen(optarg)); /* rm passwd from ps list */