Commit Graph

142 Commits

Author SHA1 Message Date
Andreas Schultz
dd6f6fcfe2 add format string atrribute to logging and fix all error found by it 2016-03-30 14:30:27 +02:00
Andreas Schultz
cadbfa3d7e switch to more a syslog like logging style 2016-03-30 14:29:53 +02:00
Andreas Schultz
9572de350a switch timeout processing to libev
Rework the timeout and network code to use libev.
2016-03-30 14:06:43 +02:00
Andreas Schultz
84859e20c4 also clear the local control port when resetting the WTP state
Without reseting the port, the new control socket will be
bound to the same port as the old one.
2016-03-30 09:22:02 +02:00
Andreas Schultz
32e9567f7b rework bssid handling and stop all used bssids when leaving RUN
Instead of haing a pool of unsused BSS Id's and a list of active
BSS's (wlans), use a single array and only mark the BSS Id as used
or unused.

When leaving RUN state, release (stop) all used BSS.
2016-03-29 15:28:40 +02:00
Andreas Schultz
40a98c9075 move packet processing from main receive loop into function 2016-03-29 11:51:39 +02:00
Andreas Schultz
a3c2e52d3c reset WTP state when going into DTLS TD 2016-03-29 11:51:39 +02:00
Andreas Schultz
7eddb74767 rework overly deep if statement in wtp_dfa_run 2016-03-29 11:51:39 +02:00
Andreas Schultz
73afba9a6d rework overly deep if statement in wtp_dfa_state_join 2016-03-29 11:51:39 +02:00
Andreas Schultz
0842a2c6f5 rework error path in dfa dtls 2016-03-29 11:51:39 +02:00
Andreas Schultz
43dde134b7 simplify if statement in wtp_dfa_state_discovery 2016-03-29 11:51:39 +02:00
Andreas Schultz
4117ab1f71 move discovery request generation into function 2016-03-29 11:51:39 +02:00
Andreas Schultz
e6d1472824 simplify if statement in wtp_dfa_state_datacheck 2016-03-29 11:48:28 +02:00
Andreas Schultz
1091aa0830 simplify if statement in wtp_dfa_state_configure 2016-03-29 11:48:28 +02:00
Andreas Schultz
f85928e0b0 rework error exits path to simplify if statement 2016-03-29 11:48:28 +02:00
Andreas Schultz
e92c257ac4 move deep if statement in wtp_send_configure into function 2016-03-29 11:48:28 +02:00
Andreas Schultz
13ef6c0d62 rework deep indented if statement in wtp_dfa_retransmition_timeout 2016-03-29 11:48:28 +02:00
Andreas Schultz
258c8ff750 rework overly deep if statement in wtp_dfa_running 2016-03-29 11:48:28 +02:00
Andreas Schultz
de9b54e8b1 reindent wtp_dfa_execute 2016-03-29 11:48:28 +02:00
Andreas Schultz
26415cae34 [wtp] remove curly brackets from single line if statements 2016-03-29 11:48:28 +02:00
Andreas Schultz
067f920d81 reformat some overly long code lines 2016-03-29 11:48:28 +02:00
Tobias Hintze
ad27e80521 Merge pull request #2 from nm-mrt/dns-support
Handle no DNS at system start
2016-03-25 13:16:20 +01:00
Moritz Rosenthal
f9bb716dac Changed name of addr_capwap.socket to addr_capwap.sockaddr
Changed FQDN size from 128 to 256 according to RFC1035
2016-03-25 12:41:43 +01:00
Andreas Schultz
ea87da11ba [wtp] use goto error exit instead of deep nested if conditions
Convert WTP main() function to linux kernel style goto error exits.
2016-03-24 17:15:12 +01:00
Andreas Schultz
3b7c0adda7 [wtp] move overly deep indented wtp descriptor config parser into function 2016-03-24 17:15:12 +01:00
Andreas Schultz
aa5af8056b [wtp] move overly deep indented config parser into function 2016-03-24 17:15:12 +01:00
Andreas Schultz
fbe31bda21 rename variable to avoid potential type clash 2016-03-24 17:15:12 +01:00
Andreas Schultz
2109c62b80 implement basic 802.11n support
Add suport to enable 80211n support on the BSS and set
station parameters through the "Add Station" procedure.

Setting 802.11n radio parameters is rudementary and does
not work yet.
2016-03-24 17:15:11 +01:00
Andreas Schultz
e3a977e40a [wtp] rework wtp_radio_setconfiguration
no functional changes, only code shuffeling:
* move 802.11 IE handling into function
* rework deep if conditions to be simple
* reformat
2016-03-24 17:15:11 +01:00
Moritz Rosenthal
7b9f515bd7 If there is no DNS available on system start the capwap-wtp will stop while evaluating the configuration. I fixed that by checking if the address was yet translated on every address access. If not a DNS request is started before continuing. 2016-03-24 07:09:29 +01:00
Andreas Schultz
471d1058c4 [wtp] prepare message elements for vendor element handling
convert message element type into a struct{ vendor, type }.
Vendor will be 0 for all RFC types.
2016-03-08 10:21:51 +01:00
Andreas Schultz
d366a98717 add support for new NL80211_ATTR_IFACE_SOCKET_OWNER netlink attribute 2016-03-07 14:45:43 +01:00
Andreas Schultz
973bf5eab7 disable IPv6 on WTP AP interface 2016-03-04 18:39:08 +01:00
Andreas Schultz
0175052cf1 set transport header when injecting 802.3 frames
Resetting the headers is not enoug, we have to make sure
the transport header points the right position and the
skb->protocol is initialized to the payload protocol.
2016-03-04 17:05:56 +01:00
Andreas Schultz
5f98005414 handle WTP QoS IE 2016-03-04 17:04:21 +01:00
Andreas Schultz
d93cd1044d reformat WTP config file reader 2016-03-03 16:44:56 +01:00
Andreas Schultz
2b489947c2 add support for setting the STA WME fields from WMM 2016-03-03 16:44:15 +01:00
Andreas Schultz
d68bc01d00 change supportedrates config setting to the actual MBit value
supportedrates is now a list instead on an array and float values
(e.g. 5.5) are permited.
2016-03-03 08:59:49 +01:00
Andreas Schultz
8dc30ae3c4 rework socket and discovery handling
Swtich sockets to connected when talking to a specific AC. Use
unconnected UDP sockets only during DISCOVERY.

In JOIN, we need send our local address. The old, routing table
based local address discovery is broken for many reasons (VRF,
policy routing, ...). With a connected socket, we can the same
information with a simple getsockname.

During DISCOVERY we are talking to all potential AC's at once.
So using an unconnected socket makes still sense.
2016-03-02 15:13:56 +01:00
Andreas Schultz
067eb8d11a remove socket.o reference from kernel build 2016-02-29 15:45:23 +01:00
Andreas Schultz
484002b3e6 add support for CAPWAP IEEE 802.11 Information Element to AssocResponse 2016-02-29 15:30:54 +01:00
Andreas Schultz
e4a5abba65 add support for CAPWAP IEEE 802.11 Information Element 2016-02-29 14:32:02 +01:00
Andreas Schultz
9fee37a994 rework wifi type and rate logic
Hard coding basic rates is wrong. Each Wifi types does expect
some default basic rates. However those rates are not set in
stone and the AC is permited to set then to whatever it deems
ok. This might prevent client from connecting, but it still is
the AC decission to do so.

This is first step towards a more flexible basic rate handling.
2016-02-29 14:26:13 +01:00
Andreas Schultz
b80073b756 inject 802.11 frames through the normal device queue 2016-02-25 12:39:19 +01:00
Andreas Schultz
0c19932b58 send 802.3 frames through the normal device TX path
Injecting 802.11 frames underneath the device logic bypasses
the queue logik and leads to delay. Pass 802.3 frames through
the normal device TX chain.

This has the added benefit that AF_PACKET sockets (e.g. tcpdump)
see the send frames.
2016-02-22 16:56:03 +01:00
Andreas Schultz
f3119eec8d rework kernel socket handling to use udp tunnel infrastructure
Reimplmenting what is already there doesn't make sense. Switch
to the existing and UDP tunnel support code and handle the data
channel as a connected UDP socket
2016-02-22 16:54:54 +01:00
Andreas Schultz
cc5b38f322 impelment station binding to wlanid
* add a kernel bash hash list to track station to
  radio and wlan id binding
* enforce binding on recv
* configure binding through netlink interface from
  WTP process
2016-02-18 19:36:22 +01:00
Andreas Schultz
a6d0efe91a wtp: rework kernel socket handling
Switch to a connected UDP kernel socket. Comparing the
local and remote IPs is no longer required and handling
different IP versions and UDP types is automatic.

The WTP logic needs to reopen the socket on demand now.
2016-02-18 15:06:39 +01:00
Andreas Schultz
cae859e42f [debug] add debug trace logging for some procedures 2016-02-17 11:56:03 +01:00
Andreas Schultz
3a9a673d71 register pernet support befor anything else 2016-02-08 17:33:31 +01:00