summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)AuthorFilesLines
2013-06-19nfctool: sniffer: Dump unknown WSC data elementsSamuel Ortiz1-0/+5
Don't drop them silently.
2013-06-18nfctool: sniffer: Decode application/vnd.wfa.wsc MIME recordsSamuel Ortiz1-0/+55
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-05-30nfctool: sniffer: Fix fragmented SNEP outputSamuel Ortiz1-5/+8
Display the right string depending ont the direction.
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-03nfctool: sniffer: Add NDEF decoding supportThierry Escande4-6/+230
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 Ortiz4-18/+141
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 Escande6-2/+432
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-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-03-28nfctool: Print length of buffer before its hexadecimal dumpThierry Escande3-4/+12
2013-03-28nfctool: Fix some integer sizes and signednessThierry Escande3-12/+12
Also, use glib types to be coherent.
2013-03-28nfctool: Fix aggregated frame supportThierry Escande1-13/+48
This adds the llcp sniffer pseudo header to PDUs extracted from the aggregated frames before re-entering llcp_print_pdu.
2013-03-25nfctool: Fix pointer casting errors on ARMWaldemar Rymarkiewicz1-3/+6
On GLib 2.28, Macro GINT_TO_POINTER on ARM will fail as it won't cast implicitly to int before casting to gpointer. It results in casting uint8 directly to void *, which will not do the job on some ARM processors. Error message: tools/nfctool/netlink.c: In function ‘nl_nfc_event_cb’: tools/nfctool/netlink.c:686:39: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] tools/nfctool/netlink.c: In function ‘nl_add_event_handler’: tools/nfctool/netlink.c:731:35: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
2013-03-19nfctool: Add --version optionThierry Escande2-0/+18
The nfctool version number is based on neard's one.
2013-03-04nfctool: Add Service Name Lookup supportThierry Escande4-22/+321
This adds a --snl option to get the sap number for the passed service name (i.e. urn:nfc:sn:snep). nfctool will wait until it receives a result for all the requested services before exiting.
2013-03-04nfctool: Add a handler mechanism for netlink eventsThierry Escande3-28/+45
Instead of one callback function in main.c for all netlink events, these changes allow to register per event callback functions. this will be used more intensively for service name lookup support.
2013-02-28nfctool: Use nfc_copy.h instead of the system NFC headerSamuel Ortiz1-1/+2
2013-02-27nfctool: Move adapter related functions in one placeThierry Escande5-188/+285
This moves adapter management functions in adapter.c
2013-02-21nfctool: Close sniffer socket when getting IO errorsSamuel Ortiz1-2/+13
2013-01-31include: Add a copy of the NFC kernel headerSamuel Ortiz5-5/+9
With the netlink kernel API changes, including a copy of the NFC header and not relying on the system one will allow clean builds. The drawback could be missing runtime features but that's better than not being able to run the daemon at all.
2013-01-08nfctool: Fix build failure with libnl v1Samuel Ortiz1-0/+30
With libnl v1 neard fails to build with: tools/nfctool/netlink.c: In function ‘nl_send_msg’: tools/nfctool/netlink.c:135:2: error: passing argument 1 of ‘nl_send_auto_complete’ from incompatible pointer type [-Werror] /usr/include/netlink/netlink.h:48:14: note: expected ‘struct nl_handle *’ but argument is of type ‘struct nl_sock *’ tools/nfctool/netlink.c:153:3: error: passing argument 1 of ‘nl_recvmsgs’ from incompatible pointer type [-Werror] /usr/include/netlink/netlink.h:58:14: note: expected ‘struct nl_handle *’ but argument is of type ‘struct nl_sock *’ tools/nfctool/netlink.c: In function ‘nl_get_multicast_id’: tools/nfctool/netlink.c:212:2: error: passing argument 1 of ‘genl_ctrl_resolve’ from incompatible pointer type [-Werror] /usr/include/netlink/genl/ctrl.h:29:14: note: expected ‘struct nl_handle *’ but argument is of type ‘struct nl_sock *’ [...] Adding the regular compatibility layer fixes it.
2013-01-06neard: nfctool: Add LLCP frame decoding supportThierry Escande6-3/+558
nfctool now dumps LLCP frames in a human readable manner
2013-01-06neard: nfctool: Add LLCP traffic sniffing featureThierry Escande4-19/+421
nfctool -d nfcX --sniffer This dumps LLCP frames to stdout (Hex+ASCII display) nfctool -d nfcX --sniffer --pcap-file FILENAME This saves LLCP frames in pcap format to file FILENAME. This pcap file can be opened in wireshark (v>=1.8.2) with the wireshark-nfc plugin available at http://code.google.com/p/wireshark-nfc/
2013-01-06neard: nfctool: Add an option to set LTO, RW, and MIUX parametersThierry Escande4-3/+247
nfctool --device nfcX --set-param lto=x,rw=y,miux=z This sets one or more of the LTO, RW, or MIUX parameters for device nfcX
2013-01-06neard: nfctool: Add start_poll commandThierry Escande4-5/+401
nfctool --device nfcX --poll [Initiator|Target|Both] This starts polling on device nfcX as initiator, target, or both.
2013-01-06neard: Add nfctool native applicationThierry Escande4-0/+748
nfctool is a native application used as a tool box for various nfc related operations. First goal is to be able to do such operations on embedded platforms that don't have a python interpretor (since all neard test tools are pyhton scripts) This initial release can list nfc adapters, targets, etc.
2012-05-17tools: Fix snep-send compilation with glibc 2.15Vinicius Costa Gomes1-0/+3
From glibc 2.15 on, AF_NFC is already defined, so we need to protect all local redefinitions.
2012-05-02snep-send: Fix Usage stringSamuel Ortiz1-1/+1
2012-04-27tools: More verbose snep-send error pathsSamuel Ortiz1-0/+2
2012-04-25tools: Add an SNEP sending testing programSamuel Ortiz1-0/+115
It simply sends a Text NDEF over a polled LLCP peer.