Age | Commit message (Collapse) | Author | Files | Lines |
|
Change-Id: I779d522155e2bcf9cffd8cd57d2a1859017e3087
|
|
|
|
Change-Id: I5704e7f54c2162b644eaa12aa508d4bf127145eb
|
|
Change-Id: I516232587f196eebabebe44af12d777f960429d4
|
|
Change-Id: I7bf650500d907d3cdfbb2df1d8aa5fa5ae77bb26
|
|
Spaces create unsupported introspection XML files.
|
|
|
|
Change-Id: I21a341b2482556458e381b4a3033ef3e9313194c
|
|
|
|
Instead of hard coding it to EINVAL.
|
|
|
|
Empty handover select frames are received when the peer notifies us
about not supporting any of the carrier sent in the handover request
frame.
In that case there is nothing to do but disconnecting from the handover
service.
|
|
When running as a 802.11 STA, the Hr should contain an empty WiFi
carrier as we're just asking for WiFi availability from the peer.
Also when running in AP mode, an Hr is not a valid frame to send as
an AP will not be able to initiate the association.
|
|
static handover is going through a different D-Bus path as it would not
make sense to handle both static and dynamic handover from the same code
path.
Static handover means an application explicitely requires to send a
handover select without having previously received a handover request.
This could typically be used for handling WiFi handover through
configuration token from the registrar perspective. The registrar
(a.k.a. the Access Point) would send a configuration token via Handover
and expects the Enrolle (a.k.a. the WiFi STA) to initiate the WiFi
association.
|
|
near_ndef_prepare_hr_message can be used for building Hr frames but also
Hs ones for static handover. So generalize and factorize it and also
rename it to near_ndef_prepare_ho_message().
|
|
Check that there at least is one argument and dump a usage example
otherwise.
|
|
|
|
near_ndef_prepare_hs_message() does not prepare a generic handover
select message but rather a reply to a handover request.
Those 2 have to be differentiated in order to implement static handover
where a handover select frame is sent without having first seen a
handover request.
|
|
build_ho_record is used for initiating negotiated handover, so it will
only send handover requests.
As such, rename build_ho_record to build_hr_record.
|
|
Don't drop them silently.
|
|
Remove proxies and generate proxy_removed callbacks even when there are
no corresponding InterfaceRemoved signals.
This patch fixes having zombie gdbus proxy object when a server
disconnects without sending InterfaceRemoved signals. These objects
may interact with new server instances, for example, making
InterfaceAdded signals of new objects with the same name be filtered
out as duplicated, or staying allocated, but unused, if the new server
doesn't reuse the object paths. Note that as a side-effect, the
lifetime of a gdbus proxy becomes stricter: it lives at most for the
duration of a single connection to a single instance of a server
process.
|
|
|
|
Only wifi_wsc is supported for now, i.e. one can only push WSC
configuration tokens over SNEP.
|
|
When the D-Bus message does not contain an SSID (and optionalyy a
passphrase) then we fallback to the WiFi WSC agent. If it's running
in tethering mode then it will reply with an already built WSC TLV
array.
This is needed to push WiFi WSC configuration token over SNEP. Android
is going to support that as a simplified WiFi Handover.
|
|
If length is < 0, further access to the resp buffer will cause neard to
seg fault.
|
|
Warned-by: cppcheck
|
|
The pointer to a realloc() function does not get touched on error, so
we need to check if the function failed and either free or update the
pointer.
Warned-by: cppcheck
|
|
|
|
If there already is a driver handling this service name, -EALREADY is
returned.
|
|
Handover information frames are actually pure NDEFs, so decode them as
such since it is now possible to detect Handover specific traffic.
|
|
In order to map an SAP with the righ service name, CONNECT and CC frames
need to be tracked along with their dsap/ssap.
When finding an SN, it means a CONNECT frame has been monitored. The SN
string is then associated with the SSAP. Upon CC sniffing, the DSAP is
fetched and if a pending SN for this DSAP is found, the service name
lookup is done.
With this mechanism it is now possible to know the e.g. the Handover SAP
and decode its I frames as pure NDEF ones.
This tracking will only work with connection by name (Which is what the
vast majority of platforms do). An enhancement would be to track SNL
packets as well.
|
|
If the MIME string is "application/vnd.bluetooth.ep.oob" then the
Bluetooth OOB data is parsed and output appropriately.
AC and CR records are not parsed yet.
|
|
This is needed for handover sniffing.
|
|
A record TNF (Type Name Format) is on 3 bits and thus should not be the
result of a boolean comparison.
|
|
Two offsets are needed to track the record current pointer and the NDEF
one.
|
|
The Release method should only be called when neard leaves. neard
doesn't need to notify an agent that's explicitly leaving.
|
|
The Text NDEF representation could be non ASCII strings (UTF-8 or
UTF-16) and the dumping scripts need to know about that.
Fixes #NFC-48
|
|
NDEFs with MIME type records that are not WSC or Bluetooth ones are not
wrong. Their payload won't be processed but the record is kept and
linked to the discovered tag.
NDEF agents will get the binary payload.
Fixes #NFC-45
|
|
When calling __near_netlink_adapter_enable(), adapter->idx is not yet
set. The right adapter index to pass is the __near_adapter_create()
argument.
|
|
The MIUX value is now read from the socket options, allowing for a dynamic
SDU buffer allocation.
|
|
When receiving a CONTINUE while nfc_data_length is set to 0, it must
be a CONTINUE for a fragmented GET. The headers are thus read in order
to modify snep_data->request and then process the right request.
This fixes the GET fragmented unit test.
|
|
The intial request is kept through the snep_data and
snep_core_process_request no longer relies on the last read frame to
build an answer but only on the snep_data pointer.
Without this fix, each fragment from a fragmented PUT was handled as
a complete SNEP frame (header included) which caused process_request
to get completely confused about how to handle fragments.
Now that snep_core_read is fixed, the fragmentation SNEP unit test can
be fixed as well.
|
|
When send or sendto fails the SDU still needs to be freed.
|
|
GetNDEF does not return any dictionary, it takes one as a parameter.
|
|
4a and 4b tags follow the same specs: the type 4 one from the NFC
Forum.
|
|
When receiving a 14443-B protocol mask, we should set the tag type to
NFC-B.
|
|
Display the right string depending ont the direction.
|
|
Due to a kernel bug, trying to connect through a non blocking socket
may fail and return POLLHUP. In that case the connection procedure falls
back to using blocking sockets and this needs to be delayed until the
kernel sends a DM to the peer.
This is slightly hackish but this code path should get obsolete once
neard runs on top of 3.10 or later kernels.
|
|
The p2p client connection used to be a blocking one, which can be quite
harmful when for some reason the peer does not reply to a connection
request.
The client socket is non blocking now and the actual push is handled
by a GLib watch callback.
|
|
The connect() call should not block forever. The 8 seconds timeout makes
it for approximately 3 times the maximum LTO and that seems to be plenty
of time for a peer to reply to an LLCP connection.
|