X-Git-Url: https://git.decadent.org.uk/gitweb/?p=ap-utils.git;a=blobdiff_plain;f=lib%2Fap-utils.h;h=4436cf86cf3930f93dbe192469f1e6de1ba24ce4;hp=0936d4012cd125caf68c99b4eeb04f2799e54e3f;hb=16204dfc7715783c2ebdfb55fc44fb9344613a76;hpb=17638f5bff2fddb825562f9242a364674aa5fb94 diff --git a/lib/ap-utils.h b/lib/ap-utils.h index 0936d40..4436cf8 100644 --- a/lib/ap-utils.h +++ b/lib/ap-utils.h @@ -107,10 +107,13 @@ typedef unsigned int uint32_t; #define WAIT_RET _("Trying to retrieve data from AP. Please wait...") #define WAIT_SET _("Writing data to AP. Please wait...") #define DONE_SET _("Configuration written to the AP. Press any key to continue.") -#define SELECT _("select() function error. Press any key.") +#define ERR_SELECT _("select() function error. Press any key.") -#define CREATE_SOCKET_ERROR _("Create socket error. Press any key.") -#define BIND_SOCKET_ERROR _("Bind socket error. Press any key.") +#define ERR_CREATING_SOCKET _("Create socket error. Press any key.") +#define ERR_BINDING_SOCKET _("Bind socket error. Press any key.") + +#define ERR_WRITING_APCONF _("Unable to write AP list file ~/.ap-config. Press any key.") +#define DONE_WRITING_APCONF _("AP list file ~/.ap-config successfully written. Press any key.") #define MAIN_MENU _("Back to main menu") #define MENU_EXIT _("Exit program") @@ -119,15 +122,17 @@ typedef unsigned int uint32_t; #define MENU_SEARCH _("Find connected Access Points") #define MENU_CONNECT _("Set connection options: ip and community") #define MENU_ENCRYPT _("Set encryption; edit WEP keys") -#define MENU_MAC _("Set MAC authorization; edit MAC authorization table") +#define MENU_AUTH _("Set authorization; edit MAC authorization table") #define MENU_COMMUNITY _("Set SNMP community/password for access to the AP") #define MENU_SYSINFO _("Get info about AP hardware and firmware") #define MENU_WIRELESS _("Get wireless port statistics") #define MENU_STAS _("Get list of currently associated stations (Access Point clients)") +#define MENU_APLINK _("Get link status in APclient mode") #define MENU_INFO _("Get info and statistics from AP") #define MENU_CONFIG _("Set various configuration options") -#define TITLE_STAS _("Associated stations") +#define ST_TITLE _("Associated stations") +#define AP_TITLE _("AP Client link state") #define POLL_ON _("Polling: on") #define POLL_OFF _("Polling: off") @@ -169,8 +174,8 @@ typedef unsigned int uint32_t; /* Numbering with respect to order in ap_vendorexts */ #define NONE 0 #define SBRIDGES 1 -#define TELLUS 1 -#define VERNET 2 +#define GEMTEK 1 +#define EZYNET 2 typedef struct { unsigned char *oid; @@ -194,7 +199,7 @@ struct umitems { int is_menu; }; -struct EthernetRxStatistics { +struct EthRxStatistics_s { uint32_t TotalBytesRx; uint32_t TotalPacketsRx; uint32_t PacketCRCErrorRx; @@ -213,7 +218,7 @@ struct EthernetRxStatistics { uint32_t TotalJabberRx; }; -struct EthernetTxStatistics { +struct EthTxStatistics_s { uint32_t TotalBytesTx; uint32_t TotalPacketsTx; uint32_t PacketCRCErrorTx; @@ -230,7 +235,7 @@ struct EthernetTxStatistics { uint32_t TotalCollisionsTx; }; -struct WirelessStatistics { +struct wirelessStatistics_s { uint32_t UnicastTransmittedPackets; uint32_t BroadcastTransmittedPackets; uint32_t MulticastTransmittedPackets; @@ -253,15 +258,15 @@ struct WirelessStatistics { uint32_t AgedPackets; uint32_t FCSError; uint32_t InvalidPLCP; - /* following 4 are specific for ATMEL 12350 MIB enhanced by VERNET */ + /* following 4 are specific for ATMEL 12350 MIB enhanced by EZYNET */ uint32_t TransmittedPackets_11Mbps; uint32_t TransmittedPackets_55Mbps; uint32_t TransmittedPackets_2Mbps; uint32_t TransmittedPackets_1Mbps; }; -struct sysDeviceInfo_ATMEL410 { - /* sysDeviceInfo OID struct for ATMEL 410 */ +struct sysDeviceInfo_128 { + /* sysDeviceInfo OID struct - version 128 bytes long */ uint32_t StructVersion; unsigned char MacAddress[6]; unsigned short Reserved; @@ -271,10 +276,17 @@ struct sysDeviceInfo_ATMEL410 { uint32_t OEMID; unsigned char ProductName[32]; uint32_t HardwareRevision; + /* + * NOTE: Although MIBs claim 92 bytes length, it is not true. + * 92 bytes seems to be just the 'official' part; the unofficial + * (and undocumented) remnant just padds it to the total length of + * 128 bytes. + * TODO: find out the structure. + */ }; -struct sysDeviceInfo_ATMEL12350 { - /* sysDeviceInfo OID struct for ATMEL 12350 */ +struct sysDeviceInfo_160 { + /* sysDeviceInfo OID struct - version 160 bytes long */ uint32_t StructVersion; unsigned char MacAddress[6]; unsigned char Channel; @@ -296,6 +308,34 @@ struct sysDeviceInfo_ATMEL12350 { unsigned char Reserved3[10]; }; +/* AP mode: Associated stations diagnostics */ + +struct AssociatedSTAsInfo_ATMEL410 { + unsigned short Index; + unsigned char MacAddress[6]; + /* The rest is only supported by ATMEL410 SBRIDGES MIB */ + unsigned char Status; + unsigned char Port; + unsigned char ParentMacAddress[6]; + unsigned char RSSI; + unsigned char LinkQuality; + unsigned char IP[4]; + unsigned char Reserved1[2]; +}; + +struct AssociatedSTAsInfo_ATMEL12350 { + unsigned short Index; + unsigned char MacAddress[6]; + /* The rest is only supported by ATMEL12350 EZYNET MIB */ + unsigned char Status; + unsigned char Port; + unsigned char ParentMacAddress[6]; + unsigned char RSSI; + unsigned char IP[4]; + unsigned char Reserved1[3]; +}; + +/* This structure unifies all the unique members of the 2 structs above */ struct MacListStat { unsigned char addr[6]; struct MacListStat *next; @@ -308,6 +348,36 @@ struct MacListStat { struct in_addr IP; }; +/* APClient mode: AP link diagnostics */ + +/* size: 53 bytes */ +struct NetworkSettings_ATMEL410_SBRIDGES { + unsigned short reserved1; + unsigned char BSSID[6]; + unsigned short InfoCapability; + unsigned char Rssi; + unsigned char Channel; + unsigned char reserved2[2]; + unsigned char LinkQuality; + unsigned char reserved3[5]; + unsigned char ESSID[32]; + unsigned char ESSLEN; +}; + +/* size: 56 bytes */ +struct NetworkSettings_ATMEL12350_EZYNET { + unsigned short reserved1; + unsigned char BSSID[6]; + unsigned short InfoCapability; + unsigned char Rssi; + unsigned char Channel; + unsigned char reserved2[2]; + unsigned char CurrentRate; + unsigned char reserved3[5]; + unsigned char ESSID[32]; + unsigned long ESSLEN; +}; + /* function prototypes specific/common for both utilites */ /* service */ @@ -353,6 +423,7 @@ extern void bridging(void); extern void wep(void); extern void WirelessStat(void); extern void atmel_stations(void); +extern void atmel_aplink(void); extern void atmel_sysinfo(void); extern void atmel_set_oeminfo(void); extern void ap_search(void); @@ -373,7 +444,7 @@ extern void APs(void); extern void power(void); extern void test(void); extern void atmel_wireless(void); -extern void atmel_auth_mac(void); +extern void atmel_auth(void); /* function prototypes specific for NWN utility */ extern void latest(void);