-
Notifications
You must be signed in to change notification settings - Fork 84
/
WTPFrameReceive.h
114 lines (104 loc) · 5.21 KB
/
WTPFrameReceive.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
/*******************************************************************************************
* 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. *
* *
* In addition, as a special exception, the copyright holders give permission to link the *
* code of portions of this program with the OpenSSL library under certain conditions as *
* described in each individual source file, and distribute linked combinations including *
* the two. You must obey the GNU General Public License in all respects for all of the *
* code used other than OpenSSL. If you modify file(s) with this exception, you may *
* extend this exception to your version of the file(s), but you are not obligated to do *
* so. If you do not wish to do so, delete this exception statement from your version. *
* If you delete this exception statement from all source files in the program, then also *
* delete it here. *
*
* --------------------------------------------------------------------------------------- *
* 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_WTPFrameReceive_HEADER__
#define __CAPWAP_WTPFrameReceive_HEADER__
#include <sys/socket.h>
#include <sys/types.h>
#include <linux/if_ether.h>
#include <net/if.h>
#include <sys/ioctl.h>
#include <netpacket/packet.h>
#include "CWWTP.h"
#ifndef B_ENDIAN
#define CHECK_PRISM_HEADER (buffer[0]==MESSAGE_CODE_1) && \
(buffer[1]==MESSAGE_CODE_2) && \
(buffer[2]==MESSAGE_CODE_3) && \
(buffer[3]==MESSAGE_CODE_4)
#else
#define CHECK_PRISM_HEADER (buffer[3]==MESSAGE_CODE_1) && \
(buffer[2]==MESSAGE_CODE_2) && \
(buffer[1]==MESSAGE_CODE_3) && \
(buffer[0]==MESSAGE_CODE_4)
#endif
//#define PROMODE_ON
//#define FILTER_ON
#define PRISMH_LEN 144
#define RSSI_BYTE 68
#define SIGNAL_BYTE 92
#define NOISE_BYTE 104
#define DATARATE_BYTE 116
#define DEST_ADDR_START 4
#define SOURCE_ADDR_START 10
#define MESSAGE_CODE_1 68
#define MESSAGE_CODE_2 0
#define MESSAGE_CODE_3 0
#define MESSAGE_CODE_4 0
#define MAC_ADDR_LEN 6
#define ATHEROS_CONV_VALUE 95
#define ASSOCIATION_REQUEST_SUBTYPE 0
#define ASSOCIATION_RESPONSE_SUBTYPE 1
#define REASSOCIATION_REQUEST_SUBTYPE 2
#define REASSOCIATION_RESPONSE_SUBTYPE 3
#define PROBE_REQUEST_SUBTYPE 4
#define PROBE_RESPONSE_SUBTYPE 5
#define RESERVED6_SUBTYPE 6
#define RESERVED7_SUBTYPE 7
#define BEACON_SUBTYPE 8
#define ATIM_SUBTYPE 9
#define DISASSOCIATION_SUBTYPE 10
#define AUTHENTICATION_SUBTYPE 11
#define DEAUTHENTICATION_SUBTYPE 12
#define RESERVED0_SUBTYPE 0
#define RESERVED9_SUBTYPE 9
#define POWER_SAVE_SUBTYPE 10
#define RTS_SUBTYPE 11
#define CTS_SUBTYPE 12
#define ACKNOLEDGEMENT_SUBTYPE 13
#define CF_END_SUBTYPE 14
#define CF_END_CF_ACK_SUBTYPE 15
#define DATA_SUBTYPE 0
#define DATA_CF_ACK_SUBTYPE 1
#define DATA_CF_POLL_SUBTYPE 2
#define DATA_CF_ACK_CF_POLL_SUBTYPE 3
#define NO_DATA_SUBTYPE 4
#define CF_ACK_SUBTYPE 5
#define CF_POLL_SUBTYPE 6
#define CF_ACK_CF_POLL_SUBTYPE 7
#define RESERVED8_SUBTYPE 8
#define RESERVED15_SUBTYPE 15
#endif
int extract802_11_Frame(CWProtocolMessage** frame, unsigned char* buffer, int len);