summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-06-25Release 0.12upstream/0.120.12Samuel Ortiz2-1/+14
2013-06-21device: Pass the NDEF push cb status back to the callerSamuel Ortiz1-1/+1
Instead of hard coding it to EINVAL.
2013-06-21error: Add I/O error routineSamuel Ortiz2-0/+9
2013-06-21ndef: Support receiving empty Handover select framesSamuel Ortiz2-0/+12
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.
2013-06-20ndef: Send empty WiFi carrier in Hr message when running as a STARavi kumar Veeramally1-3/+43
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.
2013-06-20ndef: Implement static handoverSamuel Ortiz3-0/+11
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.
2013-06-20ndef: Generalize near_ndef_prepare_hr_message()Samuel Ortiz1-34/+68
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().
2013-06-20test: Check for dump-* scripts argumentSamuel Ortiz3-0/+12
Check that there at least is one argument and dump a usage example otherwise.
2013-06-20test: Explicitely unregister the NDEF agent when being interruptedSamuel Ortiz1-1/+5
2013-06-19ndef: Rename near_ndef_prepare_hs_messageSamuel Ortiz1-2/+2
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.
2013-06-19ndef: Rename build_ho_recordSamuel Ortiz1-5/+5
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.
2013-06-19nfctool: sniffer: Dump unknown WSC data elementsSamuel Ortiz1-0/+5
Don't drop them silently.
2013-06-19gdbus: Remove proxies when client disconnectsHenrique Dante de Almeida1-0/+4
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.
2013-06-18nfctool: sniffer: Decode application/vnd.wfa.wsc MIME recordsSamuel Ortiz1-0/+55
2013-06-18test: Add MIME type to the Device pushing optionsSamuel Ortiz2-0/+10
Only wifi_wsc is supported for now, i.e. one can only push WSC configuration tokens over SNEP.
2013-06-18ndef: Fallback to the WiFi agent when missing an SSIDSamuel Ortiz1-2/+34
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.
2013-06-18nfctype4: Fix segmentation fault on invalid access keyOlivier Guiter1-1/+1
If length is < 0, further access to the resp buffer will cause neard to seg fault.
2013-06-14bluetooth: Fix memory leaks on error or when not pairingGuillem Jover1-1/+4
Warned-by: cppcheck
2013-06-14npp: Fix memory leak on allocation errorGuillem Jover1-3/+4
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
2013-06-14p2p: Coding style violation fixesOlivier Guiter1-6/+6
2013-06-14p2p: Check for an already existing p2p driver from near_p2p_registerOlivier Guiter1-1/+11
If there already is a driver handling this service name, -EALREADY is returned.
2013-06-14nfctool: sniffer: Print Handover I frames as NDEFSamuel Ortiz1-0/+9
Handover information frames are actually pure NDEFs, so decode them as such since it is now possible to detect Handover specific traffic.
2013-06-14nfctool: sniffer: CONNECT and CC frames trackingSamuel Ortiz2-0/+62
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.
2013-06-14nfctool: sniffer: Handle Bluetooth Handover recordsSamuel Ortiz1-4/+105
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.
2013-06-13nfctool: sniffer: Output the MIME type valueSamuel Ortiz1-5/+30
This is needed for handover sniffing.
2013-06-13nfctool: sniffer: A record's TNF is not a booleanSamuel Ortiz1-1/+1
A record TNF (Type Name Format) is on 3 bits and thus should not be the result of a boolean comparison.
2013-06-13nfctool: sniffer: Support multiple records per NDEFSamuel Ortiz1-18/+21
Two offsets are needed to track the record current pointer and the NDEF one.
2013-06-12agent: Do not call NDEF agent Release when agent leavesSamuel Ortiz1-7/+16
The Release method should only be called when neard leaves. neard doesn't need to notify an agent that's explicitly leaving.
2013-06-12test: Fix Text NDEF representationSamuel Ortiz2-3/+9
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
2013-06-12ndef: Do not fail if NDEF record MIME type is not a handover oneSamuel Ortiz1-5/+6
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
2013-06-10adapter: Pass the right adapter index when auto powering adaptersSamuel Ortiz1-1/+1
When calling __near_netlink_adapter_enable(), adapter->idx is not yet set. The right adapter index to pass is the __near_adapter_create() argument.
2013-06-10validation: Add MIUX supportOlivier Guiter2-13/+36
The MIUX value is now read from the socket options, allowing for a dynamic SDU buffer allocation.
2013-06-08snep: Fix fragmented GETSamuel Ortiz1-0/+12
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.
2013-06-08snep: Fix SNEP fragmentationSamuel Ortiz4-20/+41
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.
2013-06-03validation: Fix memory leak from llcp_send_dataOlivier Guiter1-7/+4
When send or sendto fails the SDU still needs to be freed.
2013-05-31doc: Fix NDEF agent GetNDEF prototypeSamuel Ortiz1-1/+1
GetNDEF does not return any dictionary, it takes one as a parameter.
2013-05-30nfctype4: Add support for type4 B tagsSamuel Ortiz1-3/+19
4a and 4b tags follow the same specs: the type 4 one from the NFC Forum.
2013-05-30tag: Set type B tag type properlySamuel Ortiz1-0/+4
When receiving a 14443-B protocol mask, we should set the tag type to NFC-B.
2013-05-30nfctool: sniffer: Fix fragmented SNEP outputSamuel Ortiz1-5/+8
Display the right string depending ont the direction.
2013-05-22p2p: Fall back to blocking sockets if the async connection failsSamuel Ortiz1-0/+85
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.
2013-05-22p2p: Non blocking client socketSamuel Ortiz2-15/+103
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.
2013-05-21p2p: Set connection timeoutSamuel Ortiz1-0/+12
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.
2013-05-21nfctool: sniffer: Set the time string first character to 0Samuel Ortiz1-0/+2
If the show_timestamp option is disabled, the string needs to be properly terminated.
2013-05-21nfctool: Power up the device when start pollThierry Escande1-0/+3
with --poll, --enable is now implicit
2013-05-21nfctool: Add command line options to power up or down a deviceThierry Escande4-1/+78
--enable (-1 for short) turns the specified device on --disable (-0) turns it off If both are specified, only --enable is applied
2013-05-08gdbus: Fix using NULL DBusPendingCall when disconnected from D-BusAnderson Lizardo1-0/+5
From D-Bus documentation for dbus_connection_send_with_reply(): "Warning: if the connection is disconnected or you try to send Unix file descriptors on a connection that does not support them, the DBusPendingCall will be set to NULL, so be careful with this." Fix these errors when killing D-Bus daemon with the client still running: process 5712: arguments to dbus_pending_call_set_notify() were incorrect, assertion "pending != NULL" failed in file ../../dbus/dbus-pending-call.c line 596. This is normally a bug in some application using the D-Bus library. process 5712: arguments to dbus_pending_call_unref() were incorrect, assertion "pending != NULL" failed in file ../../dbus/dbus-pending-call.c line 572. This is normally a bug in some application using the D-Bus library.
2013-05-08gdbus: Fix segfault when D-Bus daemon exitsAnderson Lizardo1-0/+2
Fix this crash if D-Bus exits while the client is still connected to it: ==5570== Invalid read of size 1 ==5570== at 0x402D28E: strcmp (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so) ==5570== by 0x4070E22: g_str_equal (ghash.c:1704) ==5570== by 0x8055F61: message_filter (client.c:1123) ==5570== by 0x4141500: dbus_connection_dispatch (in /lib/i386-linux-gnu/libdbus-1.so.3.5.8) ==5570== by 0x80506F7: message_dispatch (mainloop.c:76) ==5570== by 0x4081A7E: g_timeout_dispatch (gmain.c:3882) ==5570== by 0x4080D85: g_main_context_dispatch (gmain.c:2539) ==5570== by 0x4081124: g_main_context_iterate.isra.21 (gmain.c:3146) ==5570== by 0x408156A: g_main_loop_run (gmain.c:3340) ==5570== by 0x41BF4D2: (below main) (libc-start.c:226) ==5570== Address 0x0 is not stack'd, malloc'd or (recently) free'd ==5570== ==5570==
2013-05-03gdbus: Fix calling GetManagedObjects twice in a rowLuiz Augusto von Dentz1-7/+18
Calling g_dbus_client_new followed by g_dbus_client_set_proxy_handlers cause two calls to GetManagedObjects in a row as GetNameOwner reply is asyncronously it triggers the second call because the handlers have been set by g_dbus_client_set_proxy_handlers.
2013-05-03nfctool: sniffer: Add NDEF decoding supportThierry Escande5-6/+232
This adds support for decoding NDEF records embedded in SNEP packets
2013-05-03nfctool: sniffer: Reduce hexa dump line widthThierry Escande1-5/+19
If we display less than 0xFFFF bytes (which will be the case 99.999% of the time) the offset value is truncated and the 2 first zero bytes are not displayed.