#include <include.h>
#include <src/manuf.h>
#include <src/manuf_table.h>
Go to the source code of this file.
Functions | |
char * | AddMacToManufName (char AddMac[WLAN_ADDR_LEN]) |
char * | AddMacToManufModel (char *AddMac) |
char* AddMacToManufName | ( | char | AddMac[WLAN_ADDR_LEN] | ) |
Definition at line 35 of file manuf.c.
References manuf_mac_table, manuf_name_table, and SIZE_OF_MANUF_TABLE.
Referenced by LogDetectedClient(), and LogWriteReport().
00036 { 00037 // TODO : Optimize ME ! 00038 UINT16 i; 00039 UINT32 MAC; 00040 00041 #ifdef WORDS_BIGENDIAN 00042 // Not Intel code 00043 MAC = (UINT32) AddMac; 00044 #else 00045 // Intel code dependant 00046 MAC = 00047 (UINT32) (((AddMac[3])) + ((AddMac[2]) << 8) + 00048 ((AddMac[1]) << 16) + ((AddMac[0]) << 24)); 00049 #endif 00050 for (i = 0; i < SIZE_OF_MANUF_TABLE; i++) { 00051 if (MAC == manuf_mac_table[i]) { 00052 break; 00053 } 00054 } 00055 // If we didn't find manuf, we search with a little mask 00056 if (i == SIZE_OF_MANUF_TABLE) { 00057 #ifdef WORDS_BIGENDIAN 00058 // Not Intel code 00059 MAC = (UINT32) (AddMac && 0xFFFFFF00); 00060 #else 00061 // Intel code dependant 00062 MAC = 00063 (UINT32) (((AddMac[2]) << 8) + ((AddMac[1]) << 16) + 00064 ((AddMac[0]) << 24)); 00065 #endif 00066 for (i = 0; i < SIZE_OF_MANUF_TABLE; i++) { 00067 if (MAC == manuf_mac_table[i]) { 00068 break; 00069 } 00070 } 00071 00072 } 00073 return ((char *) manuf_name_table[i]); 00074 }
char* AddMacToManufModel | ( | char * | AddMac | ) |
Definition at line 76 of file manuf.c.
References manuf_mac_table, manuf_model_table, and SIZE_OF_MANUF_TABLE.
Referenced by LogDetectedClient(), and LogWriteReport().
00077 { 00078 // TODO : Optimize ME ! 00079 UINT16 i; 00080 UINT32 MAC; 00081 00082 #ifdef WORDS_BIGENDIAN 00083 // Not Intel code 00084 MAC = (UINT32) AddMac; 00085 #else 00086 // Intel code dependant 00087 MAC = 00088 (UINT32) (((AddMac[3])) + ((AddMac[2]) << 8) + 00089 ((AddMac[1]) << 16) + ((AddMac[0]) << 24)); 00090 #endif 00091 for (i = 0; i < SIZE_OF_MANUF_TABLE; i++) { 00092 if (MAC == manuf_mac_table[i]) { 00093 break; 00094 } 00095 } 00096 // If we didn't find manuf, we search with a more little mask 00097 if (i == SIZE_OF_MANUF_TABLE) { 00098 #ifdef WORDS_BIGENDIAN 00099 // Not Intel code 00100 MAC = (UINT32) (AddMac && 0xFFFFFF00); 00101 #else 00102 // Intel code dependant 00103 MAC = 00104 (UINT32) (((AddMac[2]) << 8) + ((AddMac[1]) << 16) + 00105 ((AddMac[0]) << 24)); 00106 #endif 00107 for (i = 0; i < SIZE_OF_MANUF_TABLE; i++) { 00108 if (MAC == manuf_mac_table[i]) { 00109 break; 00110 } 00111 } 00112 00113 } 00114 return ((char *) manuf_model_table[i]); 00115 }