Liapp Frame Definition and Implementation
History
Date Version Author / Revisor Note
2004-7-31
1.0 Mitch Add the Sid and Did, And Change Version to 0xF600
2004-8-18
1.1 Mitch Extent User Defined Request / Response To Get The Data That Exceeds 1500 Bytes
Macro Definition
/ / -------------------------------------------------------------------------------------------- -------------
// Common Type Definition for Liapp
/ / -------------------------------------------------------------------------------------------- -------------
#define u8 unsigned char // 1 Byte
#define u16 unsigned short // 2 bytes
#define u32 unsigned long // 4 Bytes
#define in
#define out
#define inout
2. Frame Description
2.1. Frame Structure
/ / -------------------------------------------------------------------------------------------- -------------
// Frame structure of protocol liapp // ----------------------------------------- --------------------
Protocol ID
(0xF557) 0xF600
2 bytes
CONTROL
XX000000
1 byte
Destination
Id
4 bytes
Source
Id
4 bytes
Length
2 bytes
Sequence
2 bytes
Frame ID
2 bytes
Frame body
N Bytes
FCS
2 bytes
0 - 1
2
3 - 6
7 - 10
11 - 12
13 - 14
15 - 16
Frame_Header
Frame_body
2.2. Frame head definition
2.2.1. Frame Head Structure
/ / -------------------------------------------------------------------------------------------- -------------------------------------------------- -
// Frame Header Structure of Liapp, Not Include Frame Body and FCS.
/ / -------------------------------------------------------------------------------------------- -------------------------------------------------- -
Typedef struct {
U16 PID;
U8 Ctrl;
U32 DID;
U32 SID;
U16 LEN;
U16 SEQ;
U16 FID;
} Liupp_header;
/ / -------------------------------------------------------------------------------------------- -------------
// macro definition for liappheader // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------
#define liapp_maxframesize 1500 // MaxSize for Whole Frame
#define liapp_protocolid (u16) 0xF557
#define liapp_protocolversion (u16) 0 // Initial version is 0, not formal.
2.2.2. Frame ID FIELD
/ / -------------------------------------------------------------------------------------------- -------------
// Definition of Frame IDS of Liapp Frames
/ / -------------------------------------------------------------------------------------------- -------------
#define liapp_fid_browsereq 0x0000
#define liapp_fid_browsersp 0x0001
#define liapp_fid_inquysreq 0x0002
#define liapp_fid_inquysp 0x0003
#define liapp_fid_connection 0x0004
#define liapp_fid_disconnection 0x0005
#define liapp_fid_configreq 0x0006
#define liapp_fid_configrsp 0x0007
#define liapp_fid_fopenreq 0x0008
#define liapp_fid_fopenrsp 0x0009
#define liapp_fid_fcloseq 0x
000A 000A
#define liapp_fid_fclosessp 0x000b
#define liapp_fid_freadreq 0x
000c 000c
#define Liupp_fid_freadRSP 0x000D
#define liapp_fid_fwritereq 0x000E
#define liapp_fid_fwritersp 0x
000f
#define liapp_fid_dirreq 0x0010
#define liapp_fid_dirrsp 0x0011
#define liapp_fid_fseekreq 0x0012
#define liapp_fid_fseekrsp 0x0013
#define liapp_fid_udefreq 0x0014
#define liapp_fid_udefrsp 0x0015
/ / -------------------------------------------------------------------------------------------- -------------
// for testing the protocol
/ / -------------------------------------------------------------------------------------------- -------------
#ifdef testcommq
#define liapp_fid_getcqreq 0x
001A
#define liapp_fid_getcqrsp 0x001b
#ENDIF
2.3. Frame Body Description
2.3.1. Precondition
2.3.1.1. Status Code
/ / -------------------------------------------------------------------------------------------- -------------
// definition of liapp_status
/ / -------------------------------------------------------------------------------------------- -------------
TYPEDEF INT LIAPP_STATUS;
ENUM _LIAPP_STATUS {
LIAPP_STATUS_SUCCESS, // 0
LIAPP_STATUS_FAILURURE, // 1
LIAPP_STATUS_TIMEOUT, // 2
LIAPP_STATUS_BUSY, // 3
LIAPP_STATUS_INVALID_USER, // 4
LIAPP_STATUS_REJECT, / / 5
LIAPP_STATUS_DISCONNECTION, / / 6
LIAPP_STATUS_INVALID, // 7
LIAPP_STATUS_OVERFLOW, // 8
LIAPP_STATUS_NOTFOUND / / 9
}
2.3.1.2. Prompt & Error Messages
/ / -------------------------------------------------------------------------------------------- -------------
// in the lib.h
// Prompt & Error Messages
/ / -------------------------------------------------------------------------------------------- -------------
Note: if you want to know the latstest macros of pess, please refer your question to the lib.h of nobrand smart utility for all models
#define meg "message ..."
#define meg_nu "You Must Input A Password!"
#define meg_XPAS "Invalid Password!"
#define meg_cpas "The New Configuration Has Applied successfully./n" /
"RESET AP in Process ..."
#define meg_cxpas "Fail to Apply New Configuration!" # define meg_rpas "reset ap in process ..."
#define meg_rxpas "fail to reset!"
#define meg_upas "The firmware Has Upgraded SucessFully./N" /
"RESET AP in Process ..."
#define meg_uxpas "fail to upgrade!"
#define meg_dump "ap name"
#define meg_outrts "RTS Threshold Is Out of Range!"
#define meg_outfrag "Frag Threshold is out of ing!"
#define meg_difpas "Password Mismatch!"
#define meg_openfail "Fail to Open the file!"
#define meg_overflow "File Size Overflow!"
#define meg_noimport "Invalid Import File!"
#define meg_outimport "Import File Too Large!"
#define meg_accessapy "The New Configuration Has Applied successfully./n" /
"RESET AP in Process ..."
#define meg_accessapy2 "The New Configuration Has Applied Success,"
#define meg_xaccessapy "fail to Apply!"
#define meg_xaccess "Invalid Mac Address!"
#define meg_xdaccess "duplicate address!"
#define meg_dcheck "The AP Will Be Reset. Are you have to proceed ??"
#define meg_dcheck2 "Are you sute to update access control Table ??"
#define meg_xip "Invaild IP Address."
#define meg_xgateway "Invalid Gateway Address."
#define meg_xnetmask "Invalid Netmask Address."
#define meg_wep1 "key% d: invalid key format."
#define meg_wep2 "Key% D: key size surplend be% d bytes."
#define meg_string1 "browse result" #define meg_string2 "Inquiry Result"
#define meg_string3 "Connect Result"
#define meg_string4 "Disconnect Result"
#define meg_string5 "configuration result"
#define meg_string6 "open file result"
#define meg_string7 "close file result"
#define meg_string8 "Read file Result"
#define meg_string9 "Write File Result"
#define meg_string10 "List file result"
#define meg_string11 "seek file result"
#define meg_result1 "Success!"
#define meg_Result2 "failure!"
#define meg_result3 "Timeout!"
#define meg_result4 "busy!"
#define meg_result5 "invalid user!"
#define meg_result6 "reject!"
#define meg_Result7 "Disconnection!"
// # Define meg_result8 "Invalid Request Parameter"
#define meg_Result8 "Settings Cannot Be Changed with this version of utility"
#define meg_Result9 "overflow"
#define meg_Result10 "Not found"
2.3.1.3. Device ID
/ / -------------------------------------------------------------------------------------------- -------------
// Definition of Device ID Information
/ / -------------------------------------------------------------------------------------------- -------------
Note: in the liapp, length = 6; and ID [0..5] = BSSID
Typedef struct {
CHAR Length;
Char ID [16]; // Last Char Implies Network Interface
} DEVID;
2.3.1.4. Device Description
/ / -------------------------------------------------------------------------------------------- -------------
// Definition of Format of Device Description
/ / -------------------------------------------------------------------------------------------- ------------- Note: Need Modification for the xg582
Typedef struct {
DEVID DeviceID;
Char manufacturer [80];
Char product [80];
Char model [80];
Char name [80]; // device (ap) Name
Char Detail [256]; // Device (ap) Description
DEVDESC;
2.3.1.5. Element Format
NOTE: IN The Utility and Firmware, We Don't Accord With Following Element Class
Element ID Element Length Element Value
2 Bytes 1 byte n bytes
ELEMENT CLASS
ELEMENT NUMBER
Bit 15 - Bit 12 Bit 11 - bit 0
ELEMENT ID FIELD Description
ELEMENT CLASS
Description
0 general information 1 Wireless Lan1 Information
Element Class Description
/ / -------------------------------------------------------------------------------------------- ---------------------------------------------
Typedef u16 EID; // Eid is Nothing But a shot
/ / -------------------------------------------------------------------------------------------- ---------------------------------------------
Typedef struct {
Eid EID;
U8 Len;
U8 Value [255];
Element;
#define EID_END (U16) 0xfffff // Impossible Eid for Normal Element
2.3.1.6. AP Configuration Definition
Note: do not use in the utility.
/ / -------------------------------------------------------------------------------------------- ---------------------------
// Appear in the file apcfg.h
/ / -------------------------------------------------------------------------------------------- ---------------------------
Typedef struct _ap_config
{
U_CHAR WLA_IF_NO;
APCFG_WLAIF WLA_IFP [MAX_NO_WIFACE];
#ifNDEF MAP
APCFG_IP IP;
#ifdef static_route
APCFG_ROUTE ROUTE;
#ENDIF
APCFG_DHCPD DHCPD;
APCFG_SNMP SNMP;
APCFG_MGMT mgmt; APCFG_VARIOS VAR;
APCFG_AccessCtrl Access;
APCFG_PPPOE PPPOE;
// userager Related
APCFG_Radiusctrl Radius;
// uererauth related end
APCFG_THROUGHPUTCTL THROUGHPUTCTL;
#ENDIF
} AP_CONFIG;
2.3.1.7. MIB Structure
NOTE: See Xi1500, Not in XG580Series
/ / -------------------------------------------------------------------------------------------- ---------------------------
// Appear in the file mib.h
/ / -------------------------------------------------------------------------------------------- ---------------------------
// define mib attribute for mibatt
// Amdin User Ignore Mibatt, Can Full Access
/ / -------------------------------------------------------------------------------------------- ---------------------------
#define Eatt_na 0 // Not Used
#define Eatt_ro 1 // Read Only
#define Eatt_WO 2 // Write ONLY
#define Eatt_rw 3 // Full Access
/ / -------------------------------------------------------------------------------------------- ---------------------------
// define general mib
// f (ENAME, EATT, ELEN, Elen, Evalue
// Note 1: You Cannot Delete Any Eid from Here,
// Because The Eid IS Unique for Each Element
// for a unused EID, please set Eatt = Eatt_na
// Note 2: Total Items <0x1000, EID = 0x0000-0x0FFF
/ / -------------------------------------------------------------------------------------------- ---------------------------
#define defgenmib (f) /
f (Mibversion_major, Eatt_RO, 1, 1, Unsigned Char, {1}) /
f (Mibversion_Middle, Eatt_RO, 1, 1, Unsigned Char, {0}) /
f (Mibversion_MINOR, EATT_RO, 1, 1, Unsigned Char, {0}) /
f (fwversion_major, elett_ro, 1, 1, unsigned char, {1}) /
f (fwversion_middle, Eatt_ro, 1, 1, unsigned char, {0} /
f (fwversion_minor, elett_ro, 1, 1, unsigned char, {0}) /
f (fw_build_date, elett_ro, 32, 1, char, {0}) /
f (fw_upload_date, elett_ro, 32, 1, char, {0}) /
f (Manufacturer, Eatt_ro, Sizeof ("Z-COM"), SizeOf ("Z-COM") - 1, CHAR, "Z-COM") / F (Product, Eatt_ro, Sizeof ("LaneScape"), Sizeof "Lanescape") - 1, Char, "Lanescape") /
f (Model, Eatt_ro, SizeOf ("Xi-1000"), SizeOf ("Xi-1000") - 1, CHAR, "XI-1000") /
f (Name, Eatt_RW, 16, SIZEOF ("AP0001") - 1, CHAR, "AP0001") /
f (Detail, Eatt_RW, 80, 0, CHAR, "") /
f (Username, Eatt_ro, Sizeof ("Guest"), Sizeof ("Guest") - 1, CHAR, "Guest") /
f (Password, Eatt_RW, 16, SIZEOF ("1234") - 1, CHAR, "1234")
/ / -------------------------------------------------------------------------------------------- ---------------------------
// define 802.11 mib (Wireless Lan 1)
// f (ENAME, EATT, ELEN, Elen, Evalue
// Note 1: You Cannot Delete Any Eid from Here,
// Because The Eid IS Unique for Each Element
// for a unused EID, please set Eatt = Eatt_na
// Note 2: Total Items <0x1000, EID = 0x1000-0x1FFF
/ / -------------------------------------------------------------------------------------------- ---------------------------
#define dchannelList {1,2,3,4,5,6,7,8,9,10,11,12,13,14,0}
#define dsupportrate {2,4,11,22,0}
#define defwla1mib (f) /
f (WLA1_MACADDR, Eatt_RO, 6, 6, CHAR, "") /
f (WLA1_FREQDOMAIN, EATT_RO, 1, 1, CHAR, {FD_FC}) /
f (WLA1_CHANNELLIST, EATT_RO, 15, 15, CHAR, DCHANNELLIST) /
f (WLA1_CHANNELNUMBER, EATT_RW, 1, 1, CHAR, {1}) /
f (Wla1_supportrates, Eatt_RO, 5, 5, Char, DSupportrate) /
f (WLA1_BASICRATES, EATT_RW, 5, 5, CHAR, "/ 4") /
f (WLA1_TXRATE, EATT_RW, 1, 1, CHAR, {TXRATE_FULLATO} /
f (WLA1_ESSID, Eatt_RW, 30, 30, Char, "My Network") /
f (WLA1_RTSTHRESHOLD, EATT_RW, 1, 1, SHORT, {2300}) /
/ *
f (WLA1_TRANSMITTEDFRAGMENTCOUNT, EATT_RO, 1, 1, LONG, {0}) /
f (WLA1_MULTICASTRANSMITTEDFRAMECUNT, EATT_RO, 1, 1, LONG, {0}) /
f (WLA1_RETRYCOUNT, EATT_RO, 1, 1, LONG, {0}) / f (WLA1_FAILEDCOUNT, EATT_RO, 1, 1, LONG, {0}) /
f (WLA1_MULTIPLERETRYCOUNT, EATT_RO, 1, 1, LONG, {0}) /
f (Wla1_frameduplicatecount, Eatt_RO, 1, 1, LONG, {0}) /
f (WLA1_RTSSUCCESSCOUNT, EATT_RO, 1, 1, LONG, {0}) /
f (WLA1_RTSFAILURECOUNT, EATT_RO, 1, 1, LONG, {0}) /
f (WLA1_ACKFAILURECOUNT, EATT_RO, 1, 1, LONG, {0}) /
f (WLA1_RECEIVEFRAGMENT, EATT_RO, 1, 1, LONG, {0}) /
f (WLA1_MULTICASTRECEIVEDCOUNT, Eatt_RO, 1, 1, LONG, {0}) /
f (WLA1_FCSERRORCOUNT, EATT_RO, 1, 1, LONG, {0})
* /
/ / -------------------------------------------------------------------------------------------- ---------------------------
// define element IDS
/ / -------------------------------------------------------------------------------------------- ---------------------------
#define f_enum (ename, Eatt, EMAX, Elen, ETYPE, EVALUE) EID _ ## ENAME,
ENUM _EID_GEN_ {
GenfirstID = 0x0000-1,
Defgenmib (f_enum)
Genlasteid
}
ENUM _EID_WLA1_ {
WLA1FIRSTEID = 0x1000-1,
DEFWLA1MIB (F_enum)
WLA1LASTEID
}
/ / -------------------------------------------------------------------------------------------- ---------------------------
// define attributes of mibs
/ / -------------------------------------------------------------------------------------------- ---------------------------
#define f_att (ENAME, EATT, EMAX, Elen, ETYPE, EVALUE) EATT,
Unsigned char mib_genattr [TOTAL_GEN] = {Defgenmib (f_att)};
Unsigned char mib_wla1attr [Total_WLA1] = {DEFWLA1MIB (f_att)};
/ / -------------------------------------------------------------------------------------------- ---------------------------
// define elements's max length
/ / -------------------------------------------------------------------------------------------- ---------------------------
#define f_maxlen (ENAME, EATT, EMAX, Elen, ETYPE, EVALUE) /
EMAX * SIZEOF (ETYPE),
Unsigned char mib_genmaxlen [Total_gen] = {Defgenmib (f_maxlen)};
Unsigned char mib_wla1maxlen [Total_WLA1] = {DEFWLA1MIB (f_maxlen)};
/ / -------------------------------------------------------------------------------------------- --------------------------- // Define Elements's Length
/ / -------------------------------------------------------------------------------------------- ---------------------------
#define f_len (ENAME, EATT, EMAX, Elen, ETYPE, EVALUE) /
Elen * Sizeof (ETYPE),
Unsigned char mib_genlen [Total_gen] = {Defgenmib (f_len)};
Unsigned char mib_wla1len [Total_WLA1] = {DEFWLA1MIB (F_LEN)}
/ / -------------------------------------------------------------------------------------------- ---------------------------
// define values of mibs
/ / -------------------------------------------------------------------------------------------- ---------------------------
#define f_values (ENAME, EATT, EMAX, Elen, ETYPE, EVALUE) /
Static ETYPE EVA _ ## ENAME [EMAX] = EVALUE
Defgenmib (f_values)
DEFWLA1MIB (f_values)
/ / -------------------------------------------------------------------------------------------- ---------------------------
// define element map
/ / -------------------------------------------------------------------------------------------- ---------------------------
#define f_map (ENAME, EATT, EMAX, Elen, ETYPE, EVALUE) /
(void *) EVA _ ## eName,
Void * mib_genmap [total_gen] = {defgenmib (f_map)};
Void * mib_wla1map [Total_wla1] = {DEFWLA1MIB (f_map)};
2.3.2. Frame format definition
Note: The following frame formats are based on
2.3.2.1. Browse Request Frame Format
Typedef struct {
Element browse_manufactter; // Len = 0
Element Browse_Product; // Len = 0
Element browse_ model; // len = 0} liapp_fb_browsereq;
2.3.2.2. Browse Response Frame Format
Note: Need Modification for XG582
Typedef struct {
Element browse_manufactter;
ELEMENT BROWSE_PRODUCT;
ELEMENT BROWSE_ model;
ELEMENT BROWSE_APNAME;
ELEMENT BROWSE_DETAIL;
} Liupp_fb_browsersp;
2.3.2.3. Inquiry Request Frame Format
Typedef struct {
U16 INQ_USERID; // User ID
DEVID INQ_DEVICEID; // Device ID
} Liapp_fb_inqreq;
2.3.2.4. Inquiry Response Frame Format
Typedef struct {
U16 INQ_USERID; // User ID
U16 INQ_STATE; // Status Code
DEVID INQ_DEVICEID; // Device ID
} Liapp_fb_inqrsp;
2.3.2.5. Configuration Request Frame Format
Typedef struct {
U16 conf_userid; // user ID
DEVID conf_deviceid; // device id
} Liupp_fb_confreq;
2.3.2.6. Configuration Response Frame Format
Typedef struct {
U16 conf_userid; // user ID
U16 conf_State; // status code
} Liapp_fb_confrsp;
2.3.2.7. Connection Frame Format
Typedef struct {
U16 conn_seq; // connection transaction sequence number
U16 conn_state; // status code
U16 conn_userid; // user ID
U8 * conn_name [20]; // user name
U8 * conn_password [20]; // Password
} Liupp_fb_connection;
/ / -------------------------------------------------------------------------------------------- ------------------------------------------
// in The Implement of the Liapp, Red Field (user name) is omiite.
/ / -------------------------------------------------------------------------------------------- ------------------------------------------ CONNECTION TRANSACTION SEQUENCE NUMBER
Status Code
User ID
User name
Password
1 Reserved 0 Reserved 0 Present Present 2 Status Present Not Present Not Present 3 Reserved 0 present present
Not Present 4 Status Present Not Present Not Present NOT PRESENT
2.3.2.8. Disconnection Frame Format
Typedef struct {
U16 disc_userid; // user ID
} Liapp_fb_disconnection;
2.3.2.9. File Open Request Frame Format
Typedef struct {
U16 FOPEN_USERID; // User ID
U16 fopen_attr // attribute r / w
U8 FOPEN_FILENAME [20] // File Name, MAX 16
} Liapp_fb_fopenreq;
2.3.2.10. File Open Response Frame Format
Typedef struct {
U16 FOPEN_USERID; // User ID
U16 fopen_state // status code
U16 fopen_fileid; // file ID
U32 FOPEN_SIZE / / FILE SIZE
} Liapp_fb_fopenrsp
2.3.2.11. File Close Request Frame Format
Typedef struct {
U16 fclose_userid; // user ID
U16 fclose_fileid; // file ID
} Liapp_fb_fcloseq;
2.3.2.12. File Close Response Frame Format
Typedef struct {
U16 fclose_userid; // user ID
U16 fclose_fileid; // file ID
U16 fclose_state; // status code
} Liapp_fb_fclosersp;
2.3.2.13. File Write Request Frame Format
Typedef struct {
U16 fwrite_userid; // user ID
U16 fwrite_fileid; // file id
U16 fwrite_bytes2write; // bytes to write, only 2 bytesu32 fwrite_byteoffset; // Byte Offset
U8 * fwrite_data2write; // Data to Write
} LiApp_fb_fwritereq;
2.3.2.14. File Write Response Frame Format
Typedef struct {
U16 fwrite_userid; // user ID
U16 fwrite_fileid; // file id
U16 fWrite_State; // status code
U16 fwrite_bytes2write; // Bytes to write, only 2 bytes
U32 fwrite_byteoffset; // Byte Offset
} Liapp_fb_fwritersp;
2.3.2.15. File Read Request Frame Format
Typedef struct {
U16 FREAD_USERID; // User ID
U16 FREAD_FILEID; / / FILE ID
U16 FREAD_BYTES2READ; // Bytes to Read
U32 FREAD_BYTEOFFSET; // Byte Offset
} LiApp_fb_freadreq;
2.3.2.16. File Read Response Frame Format
Typedef struct {
U16 FREAD_USERID; // User ID
U16 FREAD_FILEID; / / FILE ID
U16 FREAD_STATE; // Status Code
U16 FREAD_BYTES2READ; // Bytes to Read
U32 FREAD_BYTEOFFSET; // Byte Offset
U8 * FREAD_DATA2READ; // Data to Read
} LiApp_fb_freadrsp;
2.3.2.17. User Defined Request Frame Format
Typedef struct {
U16 udef_userid; // user ID
U16 udef_len; // body length
U8 * udef_buff; // body
} Liapp_fb_udefreq;
2.3.2.18. User Defined Response Frame Format
Typedef struct {
U16 udef_userid; // user ID
U16 udef_state; // status code
U16 udef_len // Return Lengthu8 * udef_buff; // Return Buffer
} Liupp_fb_udefrsp;
Below Frame Format Is Not De De De DEfined and Implement In The Liapp.
2.3.2.19. Dir Request Frame Format
2.3.2.20. Dir Response Frame Format
2.3.2.21. File Seek Request Frame Format
2.3.2.22. File Seek Response Frame Format
3. Variables and routines
3.1. Definition
3.1.1. Liapp Status
/ / -------------------------------------------------------------------------------------------- -------------
// definition of liapp_state
/ / -------------------------------------------------------------------------------------------- -------------
TYPEDEF INT LiApp_State;
ENUM _LIAPP_STATE {LIAPP_STATE_NOCONNECTION, LIAPP_STATE_CONNECTION}
ENUM _CONNECT_STATE {conn_idle, conn_wait_seq2, conn_wait_seq4};
ENUM _BROWSE_STATE {Browse_Idle, Browse_Wait_RSP};
ENUM _INQ_STATE {INQ_IDLE, INQ_WAIT_RSP};
ENUM _CONF_STATE {conf_idle, conf_wait_rsp};
ENUM _FOPEN_STATE {FOPEN_IDLE, FOPEN_WAIT_RSP};
ENUM _FCLOSE_STATE {fclose_idle, fclose_wait_rsp};
ENUM _FWRITE_STATE {fwrite_idle, fwrite_wait_rsp};
ENUM _FREAD_STATE {fread_idle, fread_wait_rsp};
ENUM _UDEF_STATE {udef_idle, udef_wait_rsp};
#ifdef testcommq
ENUM _CQREQ_STATE {CQREQ_IDLE, CQREQ_WAIT_RSP};
#ENDIF
3.1.2. Liapp Station
/ / -------------------------------------------------------------------------------------------- -------------
// definition of liapp_station
/ / -------------------------------------------------------------------------------------------- -------------
TYPEDEF U16 LIAPP_STATION;
ENUM _LIAPP_STATION {
LIAPP_STATION_CLIENT,
LIAPP_STATION_SERVER
}
3.1.3. Liapp Device Node
/ / -------------------------------------------------------------------------------------------- -------------
// definition of liapp_devnode
/ / -------------------------------------------------------------------------------------------- -------------
Note: this structure is buy in firmware to manage the uid.typedef struct {
U8 inuse; // y / n
DEVID DeviceID;
LIAPP_STATE;
U8 admin; // used in server mode only, Validate User
DEVNODE;
3.2. Variables
3.2.1. LiApp General Variables
#define access_limit 1000
#define MaxDevice 250 // 32
#define maxbrowse 250 // 100
#define maxnodes 8 // maxsize of users for one device
#define lanescapetype 0xaaaa
3.2.2. Liapp variables provided by the liapp
/ / -------------------------------------------------------------------------------------------- ------------------------------
// the Below Varibles Are Defined in The Document of the Liapp,
// But some area not mailmented in the liapp.c
/ / -------------------------------------------------------------------------------------------- ------------------------------
Char liapp_mydeviceid [16]; // not defined
Char liapp_state; // changed
CHAR LIAPP_PRESTATE; / / CHANGED
Char liapp_retrylimit;
Char liapp_username; // not defined
Char liapp_deviceidofconnection; // not defined
/ / -------------------------------------------------------------------------------------------- ------------------------------
// The Below Varibles Are Found in the liapp.c
/ / -------------------------------------------------------------------------------------------- ------------------------------
LIAPP_STATE LIAPP_STATE;
LIAPP_STATE LIAPP_PRESTATE
U8 LIAPP_MYSEQUENCE;
U16 LIAPP_MAXFRAMESIZE = 1500;
U8 LIAPP_RETRYLIMIT = 0;
U16 LIAPP_TIMEOUT = 100;
3.2.3. Liapp Variables Provided by Utility Interface
Macro Liupp_Waitevent (Event, Timeout) // Not Defined
Event liapp_inquirycompleteevent // not defined
EVENT LIAPP_CONFIGURATIONCOMPLETEEVENT / / NOT DefinedEvent Liapp_StartuploadCompleteEvent // Not Defined
EVENT LIAPP_STARTDOWNLOADCOMPLETEEVENT / / NOT Defined
EVENT LIAPP_UPLOADCOMPLETEEVENT / / NOT Defined
EVENT LIAPP_DOWNLOADCOMPLETEEVENT / / NOT Defined
EVENT LIAPP_ENDUPLOADCOMPLETEEVENT / / NOT Defined
EVENT LIAPP_ENDDOWNLOADCOMPLETEEVENT / / NOT Defined
3.3. Routines
3.3.1. Support routines provided by the liapp
/ / -------------------------------------------------------------------------------------------- ------------------------------
// utility calls routines defined in the document of the liapp,
// But some routines area not been implemented in the liapp.c
/ / -------------------------------------------------------------------------------------------- ------------------------------
STATUS LIAPP_INITIALIZE (CHAR * DeviceID,);
STATUS LIAPP_Indication (Char * DeviceID, Char * Frame, INT Length);
Status liapp_browse (char * manufacturer, char * produter, char * model, int todayout);
Status Liapp_inquiry (Char * ElementIdlist, Int Timeout);
Status Liapp_Configuration (Char * ElementList, Int Timeout);
// Programmer Says That Utility Calls LIAPP_CONFIG TO UPDATE INFORMATION IN The Liapp.c, but liapp_update is defined to completion the Same Function INSTET OF LIAPP_CONFIG.
STATUS LIAPP_STARTUPLOAD (VOID); // Not defined
Status Liapp_upload (Char Buffer2UPload, Long Timeout); // Not Defeed
STATUS LIAPP_SENDENDUPLOAD (VOID); // Not defined
STATUS LIAPP_STARTDOWNLOAD (VOID); // Not defined
Status Liapp_download (Char Buffer2download, Long Bytes2download, Short Timeout); // Not Defeed
STATUS LIAPP_SENDENDDDOWNLOAD (VOID); // not defined
STATUS LIAPP_ACTION (Int ActionID, Short Timeout); // Not Defeed
/ / -------------------------------------------------------------------------------------------- ---------------------------------
// supporting inter t in in ------------------------------------------------------------------------------------------------ -----------------------------------------------
Int mkframe (Char * frame, short frameid, int sequence, ...);
INT ValidLiappFrame (Char * frame, int Len, liapp_header *);
Void LiApp_indframes (devid *, liapp_header *, char * body, int body);
/ / -------------------------------------------------------------------------------------------- ---------------------------------
// supporting inter × the company provike by the liapp in the frams.c
/ / -------------------------------------------------------------------------------------------- ---------------------------------
// general routines for all tales
/ / -------------------------------------------------------------------------------------------- ---------------------------------
Static void ind_connection (devid *, liapp_header *, char * body, int body);
Static void Ind_disconnection (devid *, liapp_header *, char * body, int body);
#ifDef _Liapp_client_
/ / -------------------------------------------------------------------------------------------- --------------------------------
// Support as a Utility Which Gets and DEALS with Responses
/ / -------------------------------------------------------------------------------------------- --------------------------------
Static void Ind_fopenRSP (devid *, liapp_header *, char * body, int body);
Static void ind_configrsp (devid *, liapp_header *, char * body, int body);
Static void Ind_inquiryRSP (devid *, liapp_header *, char * body, int body);
Static void ind_fclosessp (devid *, liapp_header *, char * body, int body);
Static void ind_browsersp (devid *, liapp_header *, char * body, int body);
Static void Ind_freadRSP (devid *, liapp_header *, char * body, int body);
Static void Ind_fwritersp (devid *, liapp_header *, char * body, int body);
Static void Ind_udefrsp (devid *, liapp_header *, char * body, int body);
#ifdef testcommq
Static void ind_getcqrsp (devid *, liapp_header *, char * body, int body); # e d
#ELSE
/ / -------------------------------------------------------------------------------------------- -----------------------------------
// Support as a server Which Gets and DEALS with Requests.
/ / -------------------------------------------------------------------------------------------- -----------------------------------
Static void Ind_browsereq (devid *, liapp_header *, char * body, int body);
Static void Ind_inquiryReq (devid *, liapp_header *, char * body, int body);
Static void Ind_configreq (devid *, liapp_header *, char * body, int body);
Static void Ind_fopenreq (devid *, liapp_header *, char * body, int body);
Static void Ind_fcloseq (devid *, liapp_header *, char * body, int body);
Static void Ind_fwritereq (devid *, liapp_header *, char * body, int body);
Static void Ind_freadReq (devid *, liapp_header *, char * body, int body);
Static void Ind_udefreq (devid *, liapp_header *, char * body, int body;
#ifdef testcommq
Static void Ind_getcqreq (devid *, liapp_header *, char * body, int body);
#ENDIF
#ENDIF
/ / -------------------------------------------------------------------------------------------- ---------------------------------
// supporting inter × the liapp.h and the liapp.c
/ / -------------------------------------------------------------------------------------------- ---------------------------------
Char * Findeid (Char * Body, Int Bodylen, Eid EID);
Int FindElement (Char * Body, Int Bodylen, Eid Eid, Char * BUF, INT BUFLLEN)
LIAPP_STATE UserState (Unsigned Short Userid, Devid * DeviceID);
Unsigned short adduser (devid *, liapp_state, unsigned char);
INT DELUSER (UNSIGNED SHORT UserID);
Int isadmin (unsigned short userid);
UNSIGNED SHORT NEXTCONNECTION (VOID);
INT EXISTCONNECTION (UNSIGNED SHORT UserID);
/ / -------------------------------------------------------------------------------------------- ----------------------------------- // Utility Can Call Following Routines provided by the liapp in the liappin LiApp.h
/ / -------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Void LIAPP_CONNECTIONTIMER (VOID);
LIAPP_STATUS LIAPP_INITIALIZE (INT, INT, INT);
LIAPP_STATUS LIAPP_SETTIMEOUT (INT TIMEOUT);
INT LiApp_gettimeout (void);
LIAPP_STATUS LIAPP_IPP_Indication (devid *, char *, int);
LIAPP_STATUS LIAPP_BROWSE (Element *, Element *, Element * R, DEVDESC *, INT *);
LIAPP_STATUS LIAPP_BROWSEMANY (int modelcount, element * manu [], element * prod [], element * model [], devdesc *, int *);
LIAPP_STATUS LIAPP_INQUIRY (Unsigned Short, Eid *, Char *, INT);
LIAPP_STATUS LIAPP_UPDATE (unsigned short, element *, int);
LIAPP_STATUS LIAPP_CONNECT (devid *, char *, char *, unsigned rain *);
LIAPP_STATUS LIAPP_DISCONNECT (UNSIGNED SHORT);
LIAPP_STATUS LIAPP_FOPEN (unsigned short, char *, unsigned char, short *, unsigned long *);
LIAPP_STATUS LIAPP_FWRITE (UNSIGNED SHORT FILEID, UNSIGNED Long Byteoffset, Char * BUF, UNSIGNED Long Buff Buff BUFLEN)
LIAPP_STATUS LIAPP_FREAD (UNSIGNED SHORT FILEID, UNSIGNED SHORT FILEID, UNSIGNED Long Byteoffset, Char * BUF, UNSIGNED Long * Bufflen);
LIAPP_STATUS LIAPP_FCLOSE (Unsigned Short fileID);
LIAPP_STATUS LIAPP_USERDEFINE (unsigned short userid, char * buf, int buflen, char ** RetBUF, INT * RETLEN)
#ifdef testcommq
LIAPP_STATUS LIAPP_GETCQREQ (Unsigned Short Userid, Char * BUF, INT BUFLEN);
#ENDIF
3.3.2. Support routines provided by Utility Interface
/ / -------------------------------------------------------------------------------------------- -------------------------------------------------- ----
// Utility Calls Routines As Utility Interfaces Defined In The Document of the Liapp
/ / -------------------------------------------------------------------------------------------- -------------------------------------------------- ---- Timerid SetTimer (Void * TimeoutCall, Int Timeout); // Not Defined
Boolean StopTimer (Timerid Timerid); // Not Defeed
Boolean LiApp_validuser (Char * Username, Char * Password); // Not Defined
Boolean Liapp_send (Char * DeviceID, Char * Frame, INT Length); // Not defined
Boolean Liapp_write (Char * Username, Char * Destination, Char * Source, Int Length); // Not defined
Boolean Liupp_read (Char * Username, Char * Destination, Char * Source, Int Length); // Not defined
Boolean LiApp_selection (int ElementID, INT ElementLength); // not defined
Boolaen Liapp_getlement (int ElementID, int MaxelementLength); // not defined
Void LiApp_notifyndupload (void); // not defined
Void Liupp_notifyEnddownload (Void); // Not defined
3.3.3. Routines Call RelationShip
/ / -------------------------------------------------------------------------------------------- -------------------------------------------------- ----
// Routines Call Relationship from top to Down
/ / -------------------------------------------------------------------------------------------- -------------------------------------------------- ----
l Application Calls protocol // Apis area to be enriched
APIS Supported by LiApp: LiApp_ *
l protocol calls uif and mib // steady
UIF is relative to network: uif _ * ()
MIB IS Relative to Configuration: querymib () and updateMIB ()
l uif calls adapter // steady
UIF_send () sends: write_packet ()
Receivepkt () receives: read_packet ()
l Adapter Calls WINDIS // Steady
Write_packet (): w32n_packetsend ()
Read_packet (): W32N_PacketRead ()
4. Implementation notes4.1. Make frame
/ / -------------------------------------------------------------------------------------------- -------------------------------------------------- ----
// pay attention to the variables of frame and dest
/ / -------------------------------------------------------------------------------------------- -------------------------------------------------- ----
INT mkframe (char * frame, // the address of the whole frame of the liapp
Short sequence,
Int frameID,
...
);
Static int CPYSHORT (Char * frame, // The address of the whole frame of the liapp
Char * DEST, // The Other Field of Liapp, Usually Use Offset Plus Frame
Short value
)
Static int mkchar (char ** DEST, CHAR VALUE); // the Same
Static Int Mksh (Char * frame, char ** DEST, Short Value);
Static int mklong (char **, char ** DEST, Long Value);
Static int MKSTR (Char * frame, char ** DEST, CHAR * STR);
Static int CPPYCHAR (Char * Frame, Char * Dest, Char value);
Static int CPyspace (Char * frame, char * DEST, Short value);
/ / -------------------------------------------------------------------------------------------- -------------------------------------------------- ----
// FOLLOWING VARIABLES OF VA_ * Given in The Apdialog.h Are Very Important That
// all the frame bodys are Directed by va_list, and frame body fields are gotten by
// Function VA_ARG ().
/ / -------------------------------------------------------------------------------------------- -------------------------------------------------- ----
VA_LIST AP; // AP is The Array Point;
VA_Start (AP, FrameID); // AP Points To The Address of The Frame Body
VA_ARG (AP, Element *) // It's a key,
VA_END (AP); // AP Points To (Char *) - 256)
/ / -------------------------------------------------------------------------------------------- -------------------------------------------------- ---- // In THR Frame of Connection, User Name and Password IS Packed As Elements.
// Why? I Think That Maybe the length of name and password is not measured., So
// Programer do it as elements.
// why not useful function mkenergy ()? Because User name is not an elemnet type.
/ / -------------------------------------------------------------------------------------------- -------------------------------------------------- ----
MKELEMENT2 (Frame, & P, EID_ADM_NAME, STRLEN (User), User)
MKELEMENT2 (Frame, & P, EID_ADM_PASSWD, STRLEN (PWD), PWD))
/ / -------------------------------------------------------------------------------------------- -------------------------------------------------- ---
// line
1418 in
.
// in the code, i can not find the operation with fcs, but at alling the length
// of the frame, we shop plus 2. Otherwhere we would do the same.
/ / -------------------------------------------------------------------------------------------- -------------------------------------------------- ----
IF ((int) LEN 2)> LIAPP_MAXFRAMESize) Return 0; // 2 is The Length of FCS
/ / -------------------------------------------------------------------------------------------- -------------------------------------------------- ---
// from line1498 to line
1502 in
.
// We Find That Variable Length Dose NOT INCLUDE The Length of FCS, But It Does Not Suit
// for the liapp.
/ / -------------------------------------------------------------------------------------------- -------------------------------------------------- ----
NOTE: The Length of Variables Is Not Right Now. For Detail, See Liapp
Length = (int) (P-Frame-5);
CPYSHORT (frame, (char *) Frame 3, Length);
FCS = CRC16 (UNSIGNED Char *) Frame 5, Length, 0);
CPYSHORT (Frame, (Char *) (FRME LENGTH 5), FCS); Return (Length 5 2); // Return Frame Size, 0 for Failure
4.2. INDICATE Connection
/ / -------------------------------------------------------------------------------------------- -------------------------------------------------- ---
// line
954 in
The frames.c
// Why Does Connnseq Have 4 statuses?
/ / CONN_WAIT_SEQ2 and conn_wait_seq4?
// I Think That Server and Utility CAN Launch The Call of Connection Independently, But
// Allways utility does it.
/ / -------------------------------------------------------------------------------------------- -------------------------------------------------- ----
Switch (connseq)
{
Switch (connseq)
#ifndef _liapp_client_
Case 1: ... // connect
Case 4: ... // EXISTCONNECTION
#ENDIF
Case 2: ....
Case 3: ...
DEFAULT: ...
}
4.3. Devid
/ / -------------------------------------------------------------------------------------------- -------------------------------------------------- ---
// line
709 in
The liapp.c
// devid.id [i] is a char, but find this xi1000_wla_netno is change from
// int to char
/ / -------------------------------------------------------------------------------------------- -------------------------------------------------- ----
Typedef struct {
CHAR Length;
Char ID [16]; // Last Char Implies Network Interface
} DEVID;
... ...
Extern INT XI1000_WLA_NETNO;
... ...
DEVID.ID [15] = xi1000_wla_netno; // xi1000_wla_netno, WLA SIDE TO SEND
4.4. How to build the MIB MAP
4.5. Element Value
/ / -------------------------------------------------------------------------------------------- -------------------------------------------------- ------------
// from the importation of apu, we can find it if element value is define as an id, then // The APU CAN NOT EXPLAIN IT.
/ / -------------------------------------------------------------------------------------------- -------------------------------------------------- ------------
For example:
Change Linestrcpy (Temp, (char *) & xi1500_data [i] .bdevdesc.name); (line 807, main.cpp) INTO LINESTRCPY (TEMP, (Char *) & xi1500_data [i] .bdevdesc .manufacture) ;,1 You Will Find this if you click The Browse button, The Caption of Bitmap Will Disappear. And Also Change Into Strcpy (Temp, (Char *) "CCC"); The Caption Will Appear TOO.
.
5. liapp enhanced
5.1. Apis
5.1.1. Dir Request and Response
API:
LIAPP_STATUS LIAPP_DIR (...)
Functions related:
Static void Ind_dirreq (devid *, liapp_header *, char * body, int body);
Static void ind_dirrsp (devid *, liapp_header *, char * body, int body);
5.1.2. File Seek Request and Response
API:
LIAPP_STATUS LIAPP_FSEEK (...)
Functions related:
Static void Ind_fseekreq (devid *, liapp_header *, char * body, int body);
Static void Ind_fseekrsp (devid *, liapp_header *, char * body, int body);
5.2. MIB Structure
NOTE: NOT FIT The Application Now.see MibTLV.H
AP_CONFIG
{
0 WLA_IF_NO
1 WLA_IFP [MAX_NO_WIFACE]
CFG_UTYPE (0x1001, U_CHAR, CHANEL, ATT_RW)
Cfg_ATYPE (0x1002, U_CHAR, 32 1, ESSID, ATT_RW)
CFG_ATYPE (0x1016, u_char, 60, txpwr_status, att_rw)
CFG_UTYPE (0x1003, u_char, min_basic_rate, att_rw)
CFG_UTYPE (0x1004, u_char, max_basic_rate, att_rw)
CFG_UTYPE (0x1005, u_char, type, att_rw)
CFG_UTYPE (0x1006, u_char, llc_type, att_rw)
CFG_UTYPE (0x1007, u_short, rts_threshold, att_rw) cfg_@rw (0x1008, u_char, us_wep, att_rw)
CFG_UTYPE (0x1009, u_char, WEP_KEY_NO, ATT_RW)
CFG_ATYPE (0x
100A
, u_char, 6, peer_addr, att_rw)
CFG_UTYPE (0x100b, u_short, frag_threshold, att_rw)
CFG_ATYPE (0x
100C
U_CHAR, 32 1, WEP_KEY1, ATT_RW)
CFG_ATYPE (0x100D, U_CHAR, 32 1, WEP_KEY2, ATT_RW)
CFG_ATYPE (0x100e, u_char, 32 1, WEP_KEY3, ATT_RW)
CFG_ATYPE (0x
100F
U_CHAR, 32 1, WEP_KEY4, ATT_RW)
CFG_UTYPE (0x1010, u_char, sta_tx_rate, att_rw)
CFG_UTYPE (0x1011, u_short, retry_limit, att_rw)
CFG_UTYPE (0x1012, u_short, preamble, att_rw)
CFG_UTYPE (0x1013, u_short, body, att_rw)
CFG_UTYPE (0x1014, u_char, basic_rates, att_rw)
CFG_UTYPE (0x1015, u_char, supported_rates, att_rw)
CFG_UTYPE (0x1017, u_short, mdccontrol, att_rw)
CFG_ATYPE (0x1018, u_char, 2 1, countrycode, att_rw)
CFG_ATYPE (0x1019, u_char, 1, environment, att_rw)
CFG_UTYPE (0x1020, u_short, txpowermax, att_rw)
CFG_ATYPE (0x1021, u_char, 6 1, pxpdestaddr, att_rw)
2 IP
CFG_UTYPE (0x1101, u_char, boot_type, att_rw)
CFG_UTYPE (0x1102, Struct in_addr, ipaddr, att_rw)
CFG_UTYPE (0x1103, Struct In_Addr, Gateway, ATT_RW)
CFG_UTYPE (0x1104, Struct in_addr, mask, att_rw)
CFG_UTYPE (0x1105, u_char, boot_mode, att_rw)
CFG_UTYPE (0x1106, Struct in_addr, ipaddr2, att_rw)
CFG_UTYPE (0x1107, Struct in_addr, gateway2, att_rw)
CFG_UTYPE (0x1108, Struct in_addr, mask2, att_rw)
CFG_UTYPE (0x1109, u_char, boot_mode2, att_rw)
CFG_UTYPE (0x
110A
U_CHAR, ROUTER_MODE, ATT_RW)
CFG_UTYPE (0x110b, u_char, nat_port, att_rw)
CFG_ATYPE (0x110D, U_CHAR, NFPISZ * SNFPSZ, SNAT, ATT_RW)
CFG_UTYPE (0x110e, u_char, network_mode, att_rw)
CFG_UTYPE (0x
110F
U_CHAR, DGWOI, ATT_RW)
3 Route
CFG_ATYPE (0x1801, u_char, max_rt_num * sizeof (struct in_addr), smask, att_rw) cfg_atype (0x1802, u_char, max_rt_num * sizeof (struct in_addr), gaddr, att_rw)
CFG_ATYPE (0x1800, u_char, max_rt_num * sizeof (struct in_addr), saddr, att_rw)
4 DHCPD
CFG_UTYPE (0x1500, u_char, dhcpd_port, att_rw)
CFG_UTYPE (0x1501, Struct in_addr, ipstart, att_rw)
CFG_UTYPE (0x1502, Struct in_addr, ipend, att_rw)
CFG_UTYPE (0x1503, u_char, dhcp_mask_auto, att_rw)
CFG_UTYPE (0x1504, Struct in_addr, dhcp_mask, att_rw)
CFG_UTYPE (0x1505, u_char, dhcp_gateway_auto, att_rw)
CFG_UTYPE (0x1506, Struct in_addr, dhcp_gateway, att_rw)
CFG_UTYPE (0x1507, u_char, dhcp_dns1_auto, att_rw)
CFG_UTYPE (0x1508, Struct in_addr, dhcp_dns1, att_rw)
CFG_UTYPE (0x1509, u_char, dhcp_dns2_auto, att_rw)
CFG_UTYPE (0x
150A
Struct in_addr, dhcp_dns2, att_rw)
CFG_UTYPE (0x150b, u_char, dhcp_wins1_auto, att_rw)
CFG_UTYPE (0x
150C
Struct in_addr, dhcp_wins1, att_rw)
CFG_UTYPE (0x150D, u_char, dhcp_wins2_auto, att_rw)
CFG_UTYPE (0x150E, Struct in_addr, dhcp_wins2, att_rw)
// kevin 010702: Add persistent DNS / WINS SETTINGS in DHCP Wizard
CFG_UTYPE (0x
150F
Struct in_addr, dhcp_dns1_save, att_rw)
CFG_UTYPE (0x1510, struct in_addr, dhcp_dns2_save, att_rw)
CFG_UTYPE (0x1511, Struct in_addr, dhcp_wins1_save, att_rw)
CFG_UTYPE (0x1512, Struct in_addr, dhcp_wins2_save, att_rw)
5 SNMP
CFG_ATYPE (0x1401, u_char, 127 1, sys_contact, att_rw)
CFG_ATYPE (0x1402, u_char, 127 1, sys_descr, att_rw)
CFG_ATYPE (0x1403, u_char, 127 1, sys_location, att_rw)
CFG_UTYPE (0x1404, struct in_addr, manager1_ipaddr, att_rw)
CFG_ATYPE (0x1405, u_char, 32 1, communication, att_rw)
CFG_UTYPE (0x1406, Struct in_addr, manager2_ipaddr, att_rw)
6 mgmt
CFG_ATYPE (0x1201, U_CHAR, 32 1, ADM_PASSWD, ATT_RW) CFG_ATYPE (0x1202, U_CHAR, 32 1, APNAME, ATT_RW)
CFG_ATYPE (0x1203, U_CHAR, 32 1, ADM_NAME, ATT_RO)
CFG_UTYPE (0x1204, u_short, http_port, att_rw)
CFG_UTYPE (0x1205, u_short, telnet_port, att_rw)
CFG_ATYPE (0x1206, u_char, 12 1, root_passwd, att_rw)
7 var
CFG_UTYPE (0x1301, u_short, Acktime, ATT_RW)
// cfg_utype (0x1302, u_short, xi1000mode, att_rw)
CFG_UTYPE (0x1303, u_short, echosvr, att_rw)
CFG_UTYPE (0x1304, u_short, always_dhcps, att_rw)
CFG_UTYPE (0x1305, u_char, lan_speed, att_rw)
CFG_UTYPE (0x1306, u_char, wla_reset, att_rw)
CFG_UTYPE (0x1307, u_short, time_wlareset, att_rw)
CFG_UTYPE (0x1308, u_short, time_wakeup, att_rw)
CFG_UTYPE (0x1309, u_short, wla_cardtype, att_rw)
CFG_UTYPE (0x1309, u_char, wla_cardtype, att_rw)
CFG_UTYPE (0x1310, u_short, time_stadisasso, att_rw)
CFG_UTYPE (0x1311, u_short, wla_typechange, att_rw)
CFG_UTYPE (0x1312, u_short, telnet_timeout, att_rw)
CFG_UTYPE (0x1313, u_char, wla_stacommblock, att_rw)
CFG_UTYPE (0x1314, u_char, hidden_ap, att_rw)
8 Access
CFG_UTYPE (0x1600, u_char, enable_access_ctrl, att_rw)
9 PPPoe
CFG_UTYPE (0x1700, u_char, enable_pppoe, att_rw)
CFG_ATYPE (0x1701, u_char, 32 1, pppoe_user, att_rw)
CFG_ATYPE (0x1702, u_char, 32 1, pppoe_passwd, att_rw)
CFG_UTYPE (0x1703, u_char, pppoe_cm, att_rw)
CFG_UTYPE (0x1704, u_short, pppoe_cm_idle, att_rw)
CFG_ATYPE (0x1705, u_char, 127 1, pppoe_user_long, att_rw)
10 Radius
CFG_UTYPE (0x2100, u_char, enable_user_auth_ctrl, att_rw)
CFG_UTYPE (0x2101, u_char, enable_account_ctrl, att_rw)
CFG_UTYPE (0x2102, struct in_addr, auth_ipaddr, att_rw)
CFG_UTYPE (0x2103, u_short, auth_port, att_rw)
CFG_ATYPE (0x2104, u_char, 16 1, auth_secret, att_rw) cfg_utype (0x2105, u_short, reauth_period, att_rw)
CFG_UTYPE (0x2106, struct in_addr, account_ipaddr, att_rw)
CFG_UTYPE (0x2107, u_short, account_port, att_rw)
CFG_ATYPE (0x2108, u_char, 16 1, account_secret, att_rw)
CFG_UTYPE (0x2109, u_long, sessionid_h, att_rw)
11 THROUGHPUTCTL
CFG_UTYPE (0x2301, u_long, allclient_up, att_rw)
CFG_UTYPE (0x2302, u_long, allclient_down, att_rw)
CFG_UTYPE (0x2303, u_long, allclient_total, att_rw)
}
5.3. Eid Display
/ / -------------------------------------------------------------------------------------------- -------------------------------------------------- ----------------
// AP System Configuration Object? // AP SYSTEM Configuration Object
/ / -------------------------------------------------------------------------------------------- -------------------------------------------------- ----------------
#define u8 unsigned char // 1 Byte
#define u16 unsigned short // 2 bytes
#define u32 unsigned long // 4 Bytes
#define att_na 0 // not used
#define att_ro 1 // d t on
#define att_wo 2 // Write ONLY
#define att_rw 3 // Full Access
#define TLV_CTRL (ID, VNAME, SCALE, ATT) {ID, SIZEOF (Mibap ##. ## vname), (uint8 *) & (mibap ##. ## vname), scale, att}
#define end_tag 0xffff
#define end_tlv {end_tag, 0, 0, false, att_na}
// TLV Struct Define
Typedef struct _MIB_TLV_CTRL
{
UINT16 TAG; // Global Unique ID for this Variable
Uint8 size; // size (in byte) of this variable
Uint8 * ptr; // offset in the Struct Which Contains this variable
Boolean scale; // scale type or byte stream
Uint8 Attr;
} mib_tlv_ctrl;
// mib TLV Array Define
// mib_ap_t * pmibap =
Static mib_tlv_ctrl mib_tlv [] =
{
/ / -------------------------------------------------------------------------------------------- -------------------------------------------------- --------- // Following is defined to fit the xg580plus by mitch
// main structure is Similar as The Web UI
//
// #define u8 unsigned char // 1 Byte
// #define u16 unsigned short // 2 bytes
// #define u32 unsigned long // 4 Bytes
//
// Format: TLV_CTRL (ID, VNAME, Scale, ATT)
//
// TLV_CTRL (ID, VNAME, SCALE, ATT) // Type Length Description
/ / -------------------------------------------------------------------------------------------- -------------------------------------------------- ---------
// Browse
TLV_CTRL (EID_MANUFACTURER_ID, Manufacturer_ID, False, Att_RO), // U8 40
TLV_CTRL (EID_PRODUCT_ID, PRODUCT_ID, FALSE, ATT_RO), // U8 20
TLV_CTRL (EID_MODEL_ID, MODEL_ID, FALSE, ATT_RO), // U8 20
TLV_CTRL (EID_DEVNAME, DEVNAME, FALSE, ATT_RW), // U8 20
TLV_CTRL (EID_DETAIL_ID, DETAIL_ID, FALSE, ATT_RO), // U8 100
// Common
TLV_CTRL (EID_USERNAME, Username, false, att_ro), // u8 20
TLV_CTRL (EID_Password, Password, True, ATT_RW), // U8 20
// information
// information -> general
TLV_CTRL (ETHMACADDR, FALSE, ATT_RO), // U8 6
/ *
TLV_CTRL (EID_FWMAJOR, FWMAJOR, TRUE, ATT_RO), // U16 1 FW: FireWare
TLV_CTRL (EID_FWMIDDLE, FWMIDDLE, TRUE, ATT_RO), // U16 1
TLV_CTRL (EID_FWMINOR, FWMINOR, TRUE, ATT_RO), // U16 1
* /
TLV_CTRL (EID_VERSION, VERSION, FALSE, ATT_RO), // U8 40 // for the future / *
TLV_CTRL (EID_Webmajor, Webmajor, True, ATT_RO), // U16 1
TLV_CTRL (EID_WEBMIDDLE, Webmiddle, True, ATT_RO), // U16 1
TLV_CTRL (EID_WEBMINOR, Webminor, True, ATT_RO), // U16 1
* /
TLV_CTRL (EID_WEBVERSION, Webversion, False, ATT_RO), // U8 40 // for the FUTURE
// configuration
// configure -> general
TLV_CTRL (EID_DEVNAME, DEVNAME, FALSE, ATT_RW), // U8 20
TLV_CTRL (EID_WirelessMode, WirelessMode, True, ATT_RW), // U16 1
TLV_CTRL (EID_NETWORKTYPE, NETWORKTYPE, TRUE, ATT_RW), // U16 1
TLV_CTRL (EID_DESIREDSSID, DESIREDSSID, FALSE, ATT_RW), // U8 20
TLV_CTRL (EID_CURRRFCHAN, CURRFCHAN, FALSE, ATT_RW), // U16 1 Current RF Channel
TLV_CTRL (EID_APMODE, APMODE, FALSE, ATT_RW), // U16 1 1.B Only Mode 2.g Only Mode 3.b / g Mixed Mode
TLV_CTRL (EID_TXRATE, TXRATE, TRUE, ATT_RW), // U16 1 1.AUTO 2.1 2 5.5 ....54
TLV_CTRL (EID_COUNTRYCODE, Countrycode, True, ATT_RW), // U16 1
// Configuration -> Security
TLV_CTRL (EID_WEPMODE, WEPMODE, TRUE, ATT_RW), // U16 1
TLV_CTRL (EID_AUTHTYPE, AUTHTYPE, TRUE, ATT_RW), // U16 1 Auth: Authentication
TLV_CTRL (EID_WPAPSK, WPAPSK, FALSE, ATT_RW), // U8 20
TLV_CTRL (EID_ASKEY, Askey, True, att_rw), // u16 1 Key Format: 1.ascii 2.Hex // TLV_CTRL (EID_Passphrase, Passphrase, false, att_rw), // u8 20
TLV_CTRL (EID_WEPDEFAULTKEYVALUE1, /
WEPDEFAULTKEYVALUE1, FALSE, ATT_RW), // U8 20
TLV_CTRL (EID_WEPDEFAULTKEYVALUE2, /
WEPDEFAULTKEYVALUE2, FALSE, ATT_RW), // U8 20
TLV_CTRL (EID_WEPDEFAULTKEYVALUE3, /
WEPDEFAULTKEYVALUE3, FALSE, ATT_RW), // U8 20
TLV_CTRL (EID_WEPDEFAULTKEYVALUE4, /
WEPDEFAULTKEYVALUE4, FALSE, ATT_RW), // U8 20
// Configuration -> Access Control
TLV_CTRL (EID_MACCLONEENABLE, MACCLONEENABLE, TRUE, ATT_RW), // U16 1
TLV_CTRL (EID_WLANFILTERMODE, WLANFILTERMODE, FALSE, ATT_RW), // U16
1
A
C: Access Control
// Configuration -> Parameter log
// TCP / IP
// TCP / IP -> General
TLV_CTRL (EID_ENABLEDHCP, EnabledHCP, True, ATT_RW), // U16 1
TLV_CTRL (EID_IPADDR, IPADDR, FALSE, ATT_RW), // U8 4
TLV_CTRL (EID_SUBNETMASK, SUBNETMASK, FALSE, ATT_RW), // U8 4
TLV_CTRL (EID_GWYADDR, GWYADDR, FALSE, ATT_RW), // U8 4 GWY: GATEWAY
// statistics
// statistics -> status
// statistics -> statistics
TLV_CTRL (EID_ETHINPKT, Ethinpkt, True, ATT_RW), // U32 1 Ethernet in Packet
TLV_CTRL (EID_ETHOUTPKT, ETHOUTPKT, TRUE, ATT_RW), // U32 1 Ethernet Out Packet
// statistics -> AP Browser
End_tlv
}