Age | Commit message (Collapse) | Author | Files | Lines |
|
Don't drop them silently.
|
|
|
|
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.
|
|
Display the right string depending ont the direction.
|
|
If the show_timestamp option is disabled, the string needs to be properly
terminated.
|
|
with --poll, --enable is now implicit
|
|
--enable (-1 for short) turns the specified device on
--disable (-0) turns it off
If both are specified, only --enable is applied
|
|
This adds support for decoding NDEF records embedded in SNEP packets
|
|
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.
|
|
This will print SNEP decoding errors in bold red
|
|
|
|
snep_printf_msg already contains one.
|
|
|
|
And prepare for more colors...
|
|
SNEP decoding is colored now, for a more readable output.
|
|
Take an indentation length instead of a generic prefix, as this is
what's only used anyway.
|
|
SNEP stands for Simple NDEF Exchange Protocol, not Messaging Protocol.
|
|
This adds support for decoding Simple NDF Message Protocol. The SNEP decoder
supports aggregation of fragmented messages.
|
|
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.
|
|
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.
|
|
The handlers hash table was not freed
|
|
An uint can't be less than 0...
|
|
snap_len now really limits sniffer output.
|
|
This fixes the size of the recv buffer for the sniffer. Frames can be
up to 7ff+128+(llcp, seq, and raw headers) bytes.
|
|
|
|
Also, use glib types to be coherent.
|
|
This adds the llcp sniffer pseudo header to PDUs extracted from the
aggregated frames before re-entering llcp_print_pdu.
|
|
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]
|
|
The nfctool version number is based on neard's one.
|
|
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.
|
|
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.
|
|
|
|
This moves adapter management functions in adapter.c
|
|
|
|
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.
|
|
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.
|
|
nfctool now dumps LLCP frames in a human readable manner
|
|
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/
|
|
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
|
|
nfctool --device nfcX --poll [Initiator|Target|Both]
This starts polling on device nfcX as initiator, target, or both.
|
|
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.
|
|
From glibc 2.15 on, AF_NFC is already defined, so we need to protect
all local redefinitions.
|
|
|
|
|
|
It simply sends a Text NDEF over a polled LLCP peer.
|