diff options
| author | David M. Syzdek <syzdek@bindlebinaries.com> | 2018-05-16 12:14:48 -0800 |
|---|---|---|
| committer | David M. Syzdek <syzdek@bindlebinaries.com> | 2018-05-16 12:14:48 -0800 |
| commit | c3271e0570f44a49679b68d8d094a108317ebc56 (patch) | |
| tree | e271a56e5a62c5bd879e9295b8e98e1fd6826c1b /src | |
| parent | 37fdd93372ae4305dc199b5e60c24b85e5c26c95 (diff) | |
| download | dmstools-c3271e0570f44a49679b68d8d094a108317ebc56.tar.gz dmstools-c3271e0570f44a49679b68d8d094a108317ebc56.tar.bz2 dmstools-c3271e0570f44a49679b68d8d094a108317ebc56.tar.xz dmstools-c3271e0570f44a49679b68d8d094a108317ebc56.zip | |
Adding supported OUI to macaddrinfo
Diffstat (limited to 'src')
| -rw-r--r-- | src/macaddrinfo.c | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/src/macaddrinfo.c b/src/macaddrinfo.c index 18d96a1..ca01d59 100644 --- a/src/macaddrinfo.c +++ b/src/macaddrinfo.c | |||
| @@ -315,11 +315,14 @@ const mau_command mau_cmdmap[] = | |||
| 315 | { | 315 | { |
| 316 | "generate", // command name | 316 | "generate", // command name |
| 317 | mau_cmd_generate, // entry function | 317 | mau_cmd_generate, // entry function |
| 318 | "cDdlRr:uxXW" MAU_GETOPT_SHORT, // getopt short options | 318 | "cDdlRr:uxMQXW" MAU_GETOPT_SHORT, // getopt short options |
| 319 | (struct option []) | 319 | (struct option []) |
| 320 | { | 320 | { |
| 321 | {"vmware", no_argument, NULL, 'W' }, | 321 | {"microsoft", no_argument, NULL, 'M' }, |
| 322 | {"xen", no_argument, NULL, 'X' }, | 322 | {"nsa", no_argument, NULL, 'N' }, |
| 323 | {"qemu", no_argument, NULL, 'Q' }, | ||
| 324 | {"vmware", no_argument, NULL, 'W' }, | ||
| 325 | {"xen", no_argument, NULL, 'X' }, | ||
| 323 | MAU_GETOPT_LONG | 326 | MAU_GETOPT_LONG |
| 324 | }, // getopt long options | 327 | }, // getopt long options |
| 325 | 0, 0, // min/max arguments | 328 | 0, 0, // min/max arguments |
| @@ -905,6 +908,27 @@ int mau_getopt(mau_config * cnf, int argc, char * const * argv, | |||
| 905 | cnf->oui[1] = 0x16; | 908 | cnf->oui[1] = 0x16; |
| 906 | cnf->oui[2] = 0x3e; | 909 | cnf->oui[2] = 0x3e; |
| 907 | }; | 910 | }; |
| 911 | if (!(strcmp(long_opt[*opt_index].name, "microsoft"))) | ||
| 912 | { | ||
| 913 | cnf->use_oui = 1; | ||
| 914 | cnf->oui[0] = 0x00; | ||
| 915 | cnf->oui[1] = 0x15; | ||
| 916 | cnf->oui[2] = 0x5d; | ||
| 917 | }; | ||
| 918 | if (!(strcmp(long_opt[*opt_index].name, "qemu"))) | ||
| 919 | { | ||
| 920 | cnf->use_oui = 1; | ||
| 921 | cnf->oui[0] = 0x52; | ||
| 922 | cnf->oui[1] = 0x54; | ||
| 923 | cnf->oui[2] = 0x00; | ||
| 924 | }; | ||
| 925 | if (!(strcmp(long_opt[*opt_index].name, "nsa"))) | ||
| 926 | { | ||
| 927 | cnf->use_oui = 1; | ||
| 928 | cnf->oui[0] = 0x00; | ||
| 929 | cnf->oui[1] = 0x20; | ||
| 930 | cnf->oui[2] = 0x91; | ||
| 931 | }; | ||
| 908 | return(-2); | 932 | return(-2); |
| 909 | 933 | ||
| 910 | case 'c': | 934 | case 'c': |
| @@ -1054,6 +1078,9 @@ void mau_usage(mau_config * cnf) | |||
| 1054 | if ((strchr(shortopts, 'u'))) printf(" -u, --upper print HEX digits in upper case\n"); | 1078 | if ((strchr(shortopts, 'u'))) printf(" -u, --upper print HEX digits in upper case\n"); |
| 1055 | if ((strchr(shortopts, 'V'))) printf(" -V, --version print version number and exit\n"); | 1079 | if ((strchr(shortopts, 'V'))) printf(" -V, --version print version number and exit\n"); |
| 1056 | if ((strchr(shortopts, 'v'))) printf(" -v, --verbose print verbose messages\n"); | 1080 | if ((strchr(shortopts, 'v'))) printf(" -v, --verbose print verbose messages\n"); |
| 1081 | if ((strchr(shortopts, 'M'))) printf(" --microsoft generate MAC address for Microsoft\n"); | ||
| 1082 | if ((strchr(shortopts, 'N'))) printf(" --nsa generate MAC address for National Security Agency\n"); | ||
| 1083 | if ((strchr(shortopts, 'Q'))) printf(" --qemu generate MAC address for QEMU/KVM\n"); | ||
| 1057 | if ((strchr(shortopts, 'W'))) printf(" --vmware generate MAC address for VMWare\n"); | 1084 | if ((strchr(shortopts, 'W'))) printf(" --vmware generate MAC address for VMWare\n"); |
| 1058 | if ((strchr(shortopts, 'X'))) printf(" --xen generate MAC address for Xen\n"); | 1085 | if ((strchr(shortopts, 'X'))) printf(" --xen generate MAC address for Xen\n"); |
| 1059 | if (!(cnf->cmd)) | 1086 | if (!(cnf->cmd)) |
