-
Notifications
You must be signed in to change notification settings - Fork 39
/
ACProtocol.h
201 lines (175 loc) · 9.8 KB
/
ACProtocol.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
/*******************************************************************************************
* Copyright (c) 2006-7 Laboratorio di Sistemi di Elaborazione e Bioingegneria Informatica *
* Universita' Campus BioMedico - Italy *
* *
* This program is free software; you can redistribute it and/or modify it under the terms *
* of the GNU General Public License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, but WITHOUT ANY *
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A *
* PARTICULAR PURPOSE. See the GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License along with this *
* program; if not, write to the: *
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, *
* MA 02111-1307, USA. *
* *
* --------------------------------------------------------------------------------------- *
* Project: Capwap *
* *
* Author : Ludovico Rossi ([email protected]) *
* Del Moro Andrea ([email protected]) *
* Giovannini Federica ([email protected]) *
* Massimo Vellucci ([email protected]) *
* Mauro Bisson ([email protected]) *
*******************************************************************************************/
#ifndef __CAPWAP_ACProtocol_HEADER__
#define __CAPWAP_ACProtocol_HEADER__
//#define UNUSED_RADIO_ID 1000
typedef struct {
char *locationData;
char *name;
unsigned char *sessionID;
CWWTPDescriptor descriptor;
struct sockaddr_in ipv4Address;
CWWTPRadiosInfo radiosInfo;
char *ACName;
CWACNamesWithIndex ACNameIndex;
CWRadiosAdminInfo radioAdminInfo;
int StatisticsTimer;
CWWTPVendorInfos WTPBoardData;
//CWRadiosInformation WTPRadioInfo;
WTPRebootStatisticsInfo *WTPRebootStatistics;
void *bindingValuesPtr;
} CWWTPProtocolManager;
typedef struct {
char *location;
char *name;
CWWTPVendorInfos WTPBoardData;
unsigned char *sessionID;
CWWTPDescriptor WTPDescriptor;
struct sockaddr_in addr;
CWframeTunnelMode frameTunnelMode;
CWMACType MACType;
} CWProtocolJoinRequestValues;
typedef struct {
char *ACName;
CWACNamesWithIndex ACinWTP;
int radioAdminInfoCount;
CWRadioAdminInfoValues *radioAdminInfo;
int StatisticsTimer;
WTPRebootStatisticsInfo *WTPRebootStatistics;
} CWProtocolConfigureRequestValues;
typedef struct {
CWRadiosOperationalInfo radioOperationalInfo;
CWProtocolResultCode resultCode;
} CWProtocolChangeStateEventRequestValues;
typedef struct {
unsigned int radioID;
unsigned int TxQueueLevel;
unsigned int wirelessLinkFramesPerSec;
} WTPOperationalStatisticsValues;
typedef struct {
unsigned int radioID;
WTPRadioStatisticsInfo WTPRadioStatistics;
} WTPRadioStatisticsValues;
typedef struct {
int ipv4Address;
unsigned int length;
unsigned char *MACoffendingDevice_forIpv4;
int status;
} WTPDuplicateIPv4;
typedef struct {
struct in6_addr ipv6Address;
unsigned int length;
unsigned char *MACoffendingDevice_forIpv6;
int status;
} WTPDuplicateIPv6;
typedef struct {
int errorReportCount;
CWDecryptErrorReportValues *errorReport;
WTPDuplicateIPv4 *duplicateIPv4;
WTPDuplicateIPv6 *duplicateIPv6;
int WTPOperationalStatisticsCount;
WTPOperationalStatisticsValues *WTPOperationalStatistics;
int WTPRadioStatisticsCount;
WTPRadioStatisticsValues *WTPRadioStatistics;
WTPRebootStatisticsInfo *WTPRebootStatistics;
} CWProtocolWTPEventRequestValues;
typedef struct {
int data;
int length;
char *debug_info;
} CWProtocolWTPDataTransferRequestValues;
/*__________________________________________________________*/
/* *******************___PROTOTYPES___******************* */
CWBool CWParseChangeStateEventRequestMessage(unsigned char *msg, int len, int *seqNumPtr,
CWProtocolChangeStateEventRequestValues * valuesPtr);
CWBool CWAssembleChangeStateEventResponse(CWProtocolMessage ** messagesPtr, int *fragmentsNumPtr, int PMTU, int seqNum);
CWBool CWAssembleMsgElemACDescriptor(CWProtocolMessage * msgPtr); // 1
CWBool CWAssembleMsgElemACIPv4List(CWProtocolMessage * msgPtr); // 2
CWBool CWAssembleMsgElemACIPv6List(CWProtocolMessage * msgPtr); // 3
CWBool CWAssembleMsgElemACName(CWProtocolMessage * msgPtr); // 4
CWBool CWAssembleMsgElemAddStation(int radioID, CWProtocolMessage * msgPtr, unsigned char *StationMacAddr); // 8
CWBool CWAssembleMsgElemDeleteStation(int radioID, CWProtocolMessage * msgPtr, unsigned char *StationMacAddr); // 8
CWBool CWAssembleMsgElemCWControlIPv4Addresses(CWProtocolMessage * msgPtr); //10
CWBool CWAssembleMsgElemCWControlIPv6Addresses(CWProtocolMessage * msgPtr); //11
CWBool CWAssembleMsgElemCWTimer(CWProtocolMessage * msgPtr); //12
CWBool CWAssembleMsgElemDecryptErrorReportPeriod(CWProtocolMessage * msgPtr); //16
CWBool CWAssembleMsgElemIdleTimeout(CWProtocolMessage * msgPtr); //23
CWBool CWAssembleMsgElemWTPFallback(CWProtocolMessage * msgPtr); //37
CWBool CWAssembleWLANConfigurationRequest(CWProtocolMessage ** messagesPtr, int *fragmentsNumPtr, int PMTU, int seqNum,
unsigned char *recv_packet, int Operation, int len_packet);
CWBool CWAssembleMsgElemACWTPRadioInformation(CWProtocolMessage * msgPtr);
CWBool CWAssembleMsgElemAddWLAN(int radioID, CWProtocolMessage * msgPtr, unsigned char *recv_packet, int len_packet);
CWBool CWAssembleMsgElemDeleteWLAN(int radioID, CWProtocolMessage * msgPtr, unsigned char *recv_packet, int len_packet);
//---------------------------------------------------------/
//CWBool CWParseACName(CWProtocolMessage *msgPtr, int len, char **valPtr);
CWBool CWParseACNameWithIndex(CWProtocolMessage * msgPtr, int len, CWACNameWithIndexValues * valPtr); // 5
CWBool CWParseMsgElemDataTransferData(CWProtocolMessage * msgPtr, int len, CWProtocolWTPDataTransferRequestValues * valPtr); //13
CWBool CWParseDiscoveryType(CWProtocolMessage * msgPtr, int len, CWDiscoveryRequestValues * valPtr); //20
CWBool CWParseMsgElemDuplicateIPv4Address(CWProtocolMessage * msgPtr, int len, WTPDuplicateIPv4 * valPtr); //21
CWBool CWParseLocationData(CWProtocolMessage * msgPtr, int len, char **valPtr); //27
CWBool CWParseWTPRadioAdminState(CWProtocolMessage * msgPtr, int len, CWRadioAdminInfoValues * valPtr); //29
CWBool CWParseWTPStatisticsTimer(CWProtocolMessage * msgPtr, int len, int *valPtr); //33
CWBool CWParseWTPBoardData(CWProtocolMessage * msgPtr, int len, CWWTPVendorInfos * valPtr); //35
CWBool CWParseWTPDescriptor(CWProtocolMessage * msgPtr, int len, CWWTPDescriptor * valPtr); //37
CWBool CWParseWTPFrameTunnelMode(CWProtocolMessage * msgPtr, int len, CWframeTunnelMode * valPtr); //38
CWBool CWParseWTPIPv4Address(CWProtocolMessage * msgPtr, int len, CWProtocolJoinRequestValues * valPtr); //39
CWBool CWParseWTPMACType(CWProtocolMessage * msgPtr, int len, CWMACType * valPtr); //40
CWBool CWParseWTPName(CWProtocolMessage * msgPtr, int len, char **valPtr); //41
CWBool CWParseWTPOperationalStatistics(CWProtocolMessage * msgPtr, int len, WTPOperationalStatisticsValues * valPtr); //42
CWBool CWParseWTPRadioStatistics(CWProtocolMessage * msgPtr, int len, WTPRadioStatisticsValues * valPtr); //43
CWBool CWParseWTPRebootStatistics(CWProtocolMessage * msgPtr, int len, WTPRebootStatisticsInfo * valPtr); //44
CWBool CWParseMsgElemDecryptErrorReport(CWProtocolMessage * msgPtr, int len, CWDecryptErrorReportValues * valPtr);
CWBool CWParseMsgElemDuplicateIPv6Address(CWProtocolMessage * msgPtr, int len, WTPDuplicateIPv6 * valPtr);
CWBool CWParseWTPRadioInformation(CWProtocolMessage * msgPtr, int len, unsigned char *valPtr); //1048
CWBool CWParseWTPSupportedRates(CWProtocolMessage * msgPtr, int len, unsigned char *valPtr); //1040
CWBool CWParseWTPMultiDomainCapability(CWProtocolMessage * msgPtr, int len, char *valPtr); //1032
//CWBool CWParseWTPRadioInfo(CWProtocolMessage *msgPtr, int len, CWRadiosInformation *valPtr, int radioIndex);
//---------------------------------------------------------/
CWBool CWACGetACIPv4List(int **listPtr, int *countPtr);
CWBool CWACGetACIPv6List(struct in6_addr **listPtr, int *countPtr);
char *CWACGetName(void);
int CWACGetHWVersion(void);
int CWACGetSWVersion(void);
int CWACGetStations(void);
int CWACGetLimit(void);
int CWACGetActiveWTPs(void);
int CWACGetMaxWTPs(void);
int CWACGetSecurity(void);
int CWACGetInterfacesCount(void);
int CWACGetInterfaceIPv4AddressAtIndex(int i);
unsigned char *CWACGetInterfaceIPv6AddressAtIndex(int i);
int CWACGetInterfaceWTPCountAtIndex(int i);
CWBool CWACGetDiscoveryTimer(int *timer);
CWBool CWACGetEchoRequestTimer(int *timer);
CWBool CWACGetIdleTimeout(int *timer);
CWBool CWGetWTPRadiosOperationalState(int radioID, CWRadiosOperationalInfo * valPtr);
//---------------------------------------------------------/
CWBool CWACSupportIPv6();
void CWDestroyDiscoveryRequestValues(CWDiscoveryRequestValues * valPtr);
CWBool CWProtocolAssembleConfigurationUpdateRequest(CWProtocolMessage ** msgElems, int *msgElemCountPtr,
int MsgElementType);
#endif