summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
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.
2013-05-03nfctool: sniffer: Add a snep_printf_errorThierry Escande1-4/+7
This will print SNEP decoding errors in bold red
2013-05-02nfctool: sniffer: Fix over 80 chars macroSamuel Ortiz1-3/+4
2013-05-02nftool: sniffer: Remove new line from snep_printf_msg callsSamuel Ortiz2-10/+10
snep_printf_msg already contains one.
2013-05-02nfctool: sniffer: Color LLCP dumpsSamuel Ortiz3-47/+73
2013-05-02nfctool: sniffer: Simplify print_pdu routineSamuel Ortiz1-9/+8
And prepare for more colors...
2013-05-02nfctool: Initial color supportSamuel Ortiz5-19/+144
SNEP decoding is colored now, for a more readable output.
2013-05-02nfctool: sniffer: Change the sniffer hexdump prototypeSamuel Ortiz4-14/+14
Take an indentation length instead of a generic prefix, as this is what's only used anyway.
2013-05-02nfctool: sniffer: Fix SNEP output stringSamuel Ortiz1-1/+1
SNEP stands for Simple NDEF Exchange Protocol, not Messaging Protocol.
2013-05-02nfctool: sniffer: Add SNEP decodingThierry Escande7-3/+435
This adds support for decoding Simple NDF Message Protocol. The SNEP decoder supports aggregation of fragmented messages.
2013-05-02nfctool: sniffer: ssap and dsap were displayed switchedThierry Escande2-5/+11
In the LLCP header of a received frame, dsap is the local port and ssap is the remote port. ssap and dsap fields of the sniffer_packet structure have been renamed to local_sap and remote_sap to avoid confusion.
2013-05-02nfctool: sniffer: Group sniffed packet info into the same structThierry Escande2-86/+98
Raw socket header (direction and adapter index) and LLCP info are now stored into the same struct (sniffer_packet). This structure is then passed to PDU specific decoding functions.
2013-05-02nfctool: Fix a memory leakThierry Escande1-1/+1
The handlers hash table was not freed
2013-04-29nfctyp3: Set cookie cb to NULL when read succeedsArron Wang1-1/+1
Otherwise the callback function may be call twice and write_msg is unreferenced twice: process 1868: arguments to dbus_message_unref() were incorrect, assertion "message != NULL" failed in file dbus-message.c line 1616 0 0xb7fe1424 in __kernel_vsyscall () 1 0xb7bcfcc1 in raise () from /lib/libc.so.6 2 0xb7bd30ee in abort () from /lib/libc.so.6 3 0xb7da5045 in _dbus_abort () from /usr/lib/libdbus-1.so.3 4 0xb7d99f86 in _dbus_warn_check_failed () from /usr/lib/libdbus-1.so.3 5 0xb7d8856e in dbus_message_unref () from /usr/lib/libdbus-1.so.3 6 0x08062a63 in tag_read_cb (adapter_idx=0, target_idx=6, status=0) at src/tag.c:240 7 0x08063277 in near_tag_add_records (tag=0x8081a30, records=0x8080270, cb=0x8062a30 <tag_read_cb>, status=0) at src/tag.c:814
2013-04-29bluetooth: Get name value from right message iteratorArron Wang1-1/+1
We need to get name value from var instead of the container iter else it may also cause neard crash: process 1044: type variant 118 not a basic type 0 0xb7fe1424 in __kernel_vsyscall () 1 0xb7bcfcc1 in raise () from /lib/libc.so.6 2 0xb7bd30ee in abort () from /lib/libc.so.6 3 0xb7da5045 in _dbus_abort () from /usr/lib/libdbus-1.so.3 4 0xb7d99f86 in _dbus_warn_check_failed () from /usr/lib/libdbus-1.so.3 5 0xb7d9bc9c in _dbus_marshal_read_basic () from /usr/lib/libdbus-1.so.3 6 0xb7d84e0f in _dbus_type_reader_read_basic () from /usr/lib/libdbus-1.so.3 7 0xb7d89f0b in dbus_message_iter_get_basic () from /usr/lib/libdbus-1.so.3 8 0x0806b638 in bt_adapter_property_changed (conn=0x80814c8, message=0x8081870, user_data=0x0) at src/bluetooth.c:445
2013-04-17Release 0.110.11Samuel Ortiz2-1/+11
2013-04-15unit: Fix broken SNEP read unit testOlivier Guiter1-2/+2
In "crash-1" loop, the snep_data was added to the slist, but not removed because of a specific exit condition. This fix swaps the test condition and the action on slist, in order to add the fragment only when the length test passed.
2013-04-11nfctool: Correct unsigned int comparisonThierry Escande1-1/+1
An uint can't be less than 0...
2013-04-11nfctool: Make good use of snap_len optionThierry Escande1-2/+14
snap_len now really limits sniffer output.
2013-04-11nfctool: Set sniffer buffer large enough to handle MAX_MIU bytes framesThierry Escande1-6/+3
This fixes the size of the recv buffer for the sniffer. Frames can be up to 7ff+128+(llcp, seq, and raw headers) bytes.
2013-04-11main.conf: Add DefaultPowered configurationSamuel Ortiz4-0/+27
DefaultPowered is a boolean and will force neard into turning any detected adapter on when set to TRUE.
2013-04-08gdbus: Use gcc builtin instead of g_atomicLucas De Marchi1-6/+6
g_atomic_* end up using G_STATIC_ASSERT, causing gcc 4.8 to yell due to -Wunused-local-typedefs. gdbus/client.c: In function ‘g_dbus_client_ref’: /usr/include/glib-2.0/glib/gmacros.h:162:53: error: typedef ‘_GStaticAssertCompileTimeAssertion_2’ locally defined but not used [-Werror=unused-local-typedefs] #define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1]
2013-04-08gdbus: Fix not calling property_changed callbackLuiz Augusto von Dentz1-13/+10
In case a property did not appear by the time proxy_added was called property_changed has to be called if it appear latter otherwise the application will be unaware of it.
2013-04-05llcp: Validation test serverOlivier Guiter4-0/+340
This llcp validation server follows NFC Forum requirements and scenarios and supports the initial list of 9 test cases. Most of these tests rely on sending frames to an echo server, using connection less or connection oriented modes.
2013-04-05p2p: Add support for connection less bindingOlivier Guiter6-12/+37
Some validation tests are done in connection less mode. near_p2p_driver now handles not only stream socket but also datagram socket.
2013-04-05unit: Add WSC NDEF build test caseRavi kumar Veeramally1-0/+54
Added test cases to test WSC MIME type NDEF build.
2013-04-05ndef: Add api to prepare mime type wsc recordRavi kumar Veeramally2-13/+18
Added api to prepare MIME type WSC record for unit tests.
2013-04-05ndef: Remove unnecessary debug statementRavi kumar Veeramally1-3/+0
Removed unnecessary debug statement which is added with 56a275c8841352a9c8a60bdcb3e63ba69fe783c6 commit.
2013-04-05nfc_copy: Update with new socket optionsSamuel Ortiz1-2/+6
2013-04-04unit: Support for SNEP REJECT requestMarcin Malagowski2-7/+21
2013-04-04unit: Fixed cleaning SNEP fragmentsMarcin Malagowski1-13/+5
If sending the fragment fails, server should remove all the remaining fragments.
2013-04-04test: Add test script to write mime type on tagRavi kumar Veeramally1-0/+23
Added test script to write mime type on tag. Currently it supports application/vnd.wfa.wsc mime type.
2013-04-04ndef: Add support to build wifi_wsc mime type ndef recordRavi kumar Veeramally2-0/+171
Implemented mime type record building upon dbus request. Currently it supports application/vnd.wfa.wsc.
2013-03-28nfctool: Print length of buffer before its hexadecimal dumpThierry Escande3-4/+12