Skip to content

Commit a65469f

Browse files
author
=
committed
added BITMASK information to additional help
1 parent 50ab732 commit a65469f

File tree

2 files changed

+49
-14
lines changed

2 files changed

+49
-14
lines changed

hcxnmealog.c

+48-14
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,46 @@ __attribute__ ((noreturn))
903903
static void version(char *eigenname)
904904
{
905905
fprintf(stdout, "%s %s (C) %s ZeroBeat\n", eigenname, VERSION_TAG, VERSION_YEAR);
906+
exit(EXIT_SUCCESS);
907+
}
908+
/*---------------------------------------------------------------------------*/
909+
__attribute__ ((noreturn))
910+
static inline void usage_additional(char *eigenname)
911+
{
912+
fprintf(stdout, "%s %s (C) %s ZeroBeat\n"
913+
"Additional information:\n"
914+
"Cipher Suites (bitmask)\n"
915+
" 1 802.1X\n"
916+
" 2 PSK\n"
917+
" 4 FT + 802.1X\n"
918+
" 8 FT + PSK\n"
919+
" 16 802.1X SHA-256\n"
920+
" 32 PSK SHA-256\n"
921+
" 64 TDLS\n"
922+
" 128 SAE SHA-256\n"
923+
" 256 FT + SAE SHA-256\n"
924+
" 512 AP Peer Key Authentication\n"
925+
" 1024 802.1X Suite B EAP SH-256\n"
926+
" 2048 802.1X Suite B EAP SH-384\n"
927+
" 4096 FT + 802.1X SHA-384\n"
928+
" 8192 unknown\n\n"
929+
"Authentication Management Suites (bitmask)\n"
930+
" 1 WEP\n"
931+
" 2 TKIP\n"
932+
" 4 RESERVED\n"
933+
" 8 CCMP-128\n"
934+
" 16 WEP-104\n"
935+
" 32 BIP-CMAC-128\n"
936+
" 64 NOT ALLOWED\n"
937+
" 128 GCMP-128\n"
938+
" 256 GCMP-256\n"
939+
" 512 CCMP-256\n"
940+
" 1024 BIP-GMAC-128\n"
941+
" 2048 BIP-GMAC256\n"
942+
" 4096 BIP-CMAC-256\n"
943+
" 8192 unknown\n"
944+
"\n", eigenname, VERSION_TAG, VERSION_YEAR);
945+
906946
exit(EXIT_SUCCESS);
907947
}
908948
/*---------------------------------------------------------------------------*/
@@ -929,21 +969,11 @@ fprintf(stdout, "%s %s (C) %s ZeroBeat\n"
929969
" COUNTRY CODE (ISO / IEC 3166 alpha2 country code)\n"
930970
" ENCRYPTION (encrypted / open)\n"
931971
" RSN INFORMATION ELEMENT\n"
932-
" bitmask:\n"
933-
" cipher suites\n"
934-
" 0000000000000001 AES (CCM)\n"
935-
" 0000000000000010 TKIP\n"
936-
" authentication key management\n"
937-
" 0000000100000000 PSK\n"
938-
" 0000001000000000 FT using PSK\n"
939-
" 0000010000000000 WPA\n"
940-
" 0000100000000000 SAE (SHA256)\n"
972+
" bitmask (--help for more information)\n"
941973
" WPA INFORMATION ELEMENT\n"
942-
" bitmask:\n"
943-
" 00000001 WPA-IE present\n"
974+
" bitmask (--help for more information)\n"
944975
" WPS INFORMATION ELEMENT\n"
945-
" bitmask:\n"
946-
" 00000001 WPS-IE present\n"
976+
" bitmask (--help for more information)\n"
947977
" FREQUENCY (interface frequency in MHz)\n"
948978
" CHANNEL\n"
949979
" RSSI (signal strength in dBm)\n"
@@ -998,7 +1028,7 @@ static const struct option long_options[] =
9981028
{
9991029
{"bpf", required_argument, NULL, HCX_BPF},
10001030
{"version", no_argument, NULL, HCX_VERSION},
1001-
{"help", no_argument, NULL, HCX_HELP},
1031+
{"help", no_argument, NULL, HCX_HELP_ADDITIONAL},
10021032
{NULL, 0, NULL, 0}
10031033
};
10041034

@@ -1049,6 +1079,10 @@ while((auswahl = getopt_long (argc, argv, short_options, long_options, &index))
10491079
usage(basename(argv[0]));
10501080
break;
10511081

1082+
case HCX_HELP_ADDITIONAL:
1083+
usage_additional(basename(argv[0]));
1084+
break;
1085+
10521086
case HCX_VERSION:
10531087
version(basename(argv[0]));
10541088
break;

include/hcxnmealog.h

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#define HCX_BPF 1
77

88
#define HCX_HELP 'h'
9+
#define HCX_HELP_ADDITIONAL 'H'
910
#define HCX_VERSION 'v'
1011

1112
#define ERROR_MAX 100

0 commit comments

Comments
 (0)