Commit Graph

59 Commits

Author SHA1 Message Date
Hauke Mehrtens 37a1bb8ca4 CoAP: add media type number for application/cbor
application/cbor got the number 60 by the IANA, see
https://www.iana.org/assignments/core-parameters/core-parameters.xml#content-formats

Change-Id: I4dbfd9eff8bacb46e815140c4640359f9a951869
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Reviewed-on: https://code.wireshark.org/review/9847
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-08-02 15:20:02 +00:00
Hauke Mehrtens e8f24f319e coap: fix decoding of observe extension
The observe draft changed and now the option value does not contain the
lifetime anymore, but the value encodes if a user wants to register or
deregister.

Change-Id: I3719101c2bed87c956eb24056be40c9a79dafac8
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Reviewed-on: https://code.wireshark.org/review/9638
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-21 21:52:35 +00:00
Michael Mann 9cfe67fde6 tvb_bytes_to_ep_str_punct -> tvb_bytes_to_str_punct
Also change bytestring_to_str to match bytes_to_ep_str_punct functionality (limiting byte string size)

Change-Id: Idb958c7f0c203d103629469302b81fa922714f7e
Reviewed-on: https://code.wireshark.org/review/6369
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-07 18:05:35 +00:00
Martin Mathieson 596669f921 First batch of unincludes. Last attempt...
Change-Id: I3681462aeb98ca62ed3ec5eb226b2553317391a9
Reviewed-on: https://code.wireshark.org/review/5997
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-22 21:03:13 +00:00
Bill Meier b5d7b7ab6e Cleanup use of #includes in non-generated epan/dissector/*.c
Specifically:
- Set packet.h to be the first wireshark #include after
   config.h and "system" #includes.
   packet.h added as an #include in some cases when missing.
- Remove some #includes included (directly/indirectly) in
   packet.h. E.g., glib.h.
   (Done only for those files including packet.h).
- As needed, move "system" #includes to be after config.h and
   before wireshark #includes.
- Rework various #include file specifications for consistency.
- Misc.

Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95
Reviewed-on: https://code.wireshark.org/review/5923
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-21 05:46:22 +00:00
Bill Meier bb05124da9 coap: fix a bug; do some cleanup.
Bug fix: do initial calls to col_...() *before* the dissection code so
           that proper column info is displayed even if the dissector
           exits early because of an exception, etc.

  Cleanup:
    - Use wmem_strbuf instead of static fixed length char arrays;
    - Create/use an extended value_string;
    - Use %u (not %d) when formatting unsigned values;
    - Use strchr() to search a string for a character;
    - Misc ...

Change-Id: I57ca584f989c3ab1cf141270cc50160f9fb980ae
Reviewed-on: https://code.wireshark.org/review/5153
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-11-06 06:07:10 +00:00
chrysn 5d80686f45 CoAP dissector: Update option numbers from RFC7252
* "Accept" option: The option number was changed late in the
  specification process.
* "Proxy-Scheme" / "Size1": After including those, all option numbers
  specified in the RFC can be dissected by wireshark.

Change-Id: I1b475ac6920fd021e3217cd3b44c173d264a5298
Reviewed-on: https://code.wireshark.org/review/4123
Reviewed-by: Evan Huus <eapache@gmail.com>
Petri-Dish: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-09-17 23:37:23 +00:00
Shoichi Sakane 009bebbf09 Fix copy-paste probem in COAP dissector
Bug:8070
Change-Id: I7a86a37f7de6b3e4e12fe1c47980a9a6604488d6
Reviewed-on: https://code.wireshark.org/review/2390
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-18 18:11:49 +00:00
Dario Lombardo 971ffd683e Fixup: tvb_get_string(z) -> tvb_get_string(z)_enc
Change-Id: I63a3704effe3fcab01a193dc39b6a22e9f1cf3fe
Reviewed-on: https://code.wireshark.org/review/2376
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18 14:13:58 +00:00
Michael Mann 73217d9f3f tvb_new_subset -> tvb_new_subset_length when length parameters are equal.
tvb_new_subset -> tvb_new_subset_remaining it appears that's what the intention is.

Change-Id: I2334bbf3f10475b3c22391392fc8b6864454de2d
Reviewed-on: https://code.wireshark.org/review/1999
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-07 15:41:07 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04 14:27:33 +00:00
Evan Huus a6415ece0a Rename a couple of to_str functions to have ep_ in the name. This makes it
obvious that the returned string is ephemeral, and opens up the original names
in the API for versions that take a wmem pool (and thus can work in any scope).

svn path=/trunk/; revision=54249
2013-12-19 15:49:09 +00:00
Bill Meier 014bbf19b3 (Minor cleanup): unneeded initializers, whitespace, long-lines, typos
svn path=/trunk/; revision=53303
2013-11-13 19:29:37 +00:00
Michael Mann 02a8391535 Require dissector_try_string to pass a data parameter to its subdissectors. There weren't that many calls, so might as well modify the function than create a need for dissector_try_string_new.
svn path=/trunk/; revision=53049
2013-11-02 15:52:25 +00:00
Bill Meier 0ad98563a2 From didier gautheron: remove redundant or use faster col_xxx functions
- when the text parameter is constant col_add_str() and col_set_str() are equivalent but col_set_str() is faster.
- same for  replace col_append_fstr and col_append_str
- remove col_clear() when it's redundant:
    + before a col_set/col_add if the dissector can't throw an exception.
- replace col_append() after a col_clear() with faster col_add... or col_set

   https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9344


svn path=/trunk/; revision=52948
2013-10-29 14:09:20 +00:00
Michael Mann 8c64c5da89 Remove iplen and iphdrlen from struct _packet_info.
Dissectors should just use (reported) tvb length and taps have other ways to get the data.

svn path=/trunk/; revision=52899
2013-10-27 20:38:42 +00:00
Bill Meier 2ac134b3c5 whitespace fixes; mostly: remove trailing blanks
svn path=/trunk/; revision=52591
2013-10-13 19:56:52 +00:00
Evan Huus 5c1eafd595 From Peter A. Bigot via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9225
Fix CoAP option decoding. It's perfectly acceptable for the Payload Marker to
appear with no preceding options. Without this check such a situation produces
an invalid diagnostic: end-of-options marker found, but option length isn't 15

svn path=/trunk/; revision=52383
2013-10-05 21:00:25 +00:00
Pascal Quantin a0c53ffaa1 emem -> wmem conversion:
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits()
- tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup()
- tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode()
- tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string()
- tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string()
- tvb_get_ephemeral_string_enc() -> tvb_get_string_enc()
- update docs accordingly

svn path=/trunk/; revision=52172
2013-09-22 15:50:55 +00:00
Michael Mann 9e3f9b449f expert_add_info_format_text -> expert_add_info_format
svn path=/trunk/; revision=51852
2013-09-09 00:44:09 +00:00
Michael Mann 28bb3a5591 Batch of filterable expert infos.
svn path=/trunk/; revision=50384
2013-07-05 03:10:36 +00:00
Anders Broman a51e384818 Remove blurbs not adding any value.
svn path=/trunk/; revision=49885
2013-06-11 05:41:51 +00:00
Anders Broman cd643e745e From Hauke Mehrtens:
There were some problems which prevented wireshark from showing the
payload.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8780

svn path=/trunk/; revision=49884
2013-06-11 05:37:17 +00:00
Anders Broman ed0f343d8b From Hauke Mehrtens:
In some places String and byte were mixed up which caused problems.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8780

svn path=/trunk/; revision=49883
2013-06-11 05:34:33 +00:00
Anders Broman cda44b2966 From Hauke Mehrtens:
There were some changes in how to specify the length or give a bigger
option delta. This is now implemented how it is specified in CoAP draft
17.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8780

svn path=/trunk/; revision=49882
2013-06-11 05:31:10 +00:00
Anders Broman a9933bf603 From Hauke Mehrtens:
There is no option length attribute any more there is just the end of
options marker.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8780

svn path=/trunk/; revision=49881
2013-06-11 05:27:47 +00:00
Anders Broman ae868938aa From Hauke Mehrtens:
The field named Transaction ID is named Message ID in the RFC draft
version 17
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8780

svn path=/trunk/; revision=49880
2013-06-11 05:23:52 +00:00
Anders Broman 482221763b From Hauke Mehrtens:
The token is not an option any more, but it is now in the main header.
This was done between CoAP draft 12 and 13 and still exists in CoAP
draft 17.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8780

svn path=/trunk/; revision=49879
2013-06-11 05:20:33 +00:00
Evan Huus fc6fde93b4 From Soichi Sakane via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8070
Update CoAP dissector to the latest spec from the IETF, and make several more
fields filterable.

svn path=/trunk/; revision=48471
2013-03-22 00:12:44 +00:00
Anders Broman ef249623e6 [-Wmissing-prototypes]
Use explicit casts.

svn path=/trunk/; revision=48313
2013-03-15 06:26:47 +00:00
Jeff Morriss 2552c750e5 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45017
2012-09-20 02:03:38 +00:00
Bill Meier 638d74d43f Use val_to_str_const() where appropriate;
Also (for a few files):
- create/use some extended value strings;
- remove unneeded #include files;
- remove unneeded variable initialization;
- re-order fcns slightly so prefs_reg_handoff...() at end, etc

svn path=/trunk/; revision=44438
2012-08-10 22:55:02 +00:00
Bill Meier ac7b2df9e8 Don't call col...() and expert..() functions under 'if (tree)';
Reformat hf[] entries and various other.


svn path=/trunk/; revision=43671
2012-07-11 20:40:13 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Guy Harris 8b5748d182 Get rid of remaining Booleans-as-encoding-arguments in
proto_tree_add_item() calls.

Get rid of unnecessary include of <stdio.h>.

svn path=/trunk/; revision=42480
2012-05-07 18:59:18 +00:00
Jakub Zawadzki 9c48f9ca96 Add missing const attribute to some char *
Fix some "assignment discards qualifiers from pointer target type", etc

svn path=/trunk/; revision=41993
2012-04-09 17:53:04 +00:00
Bill Meier 20e3e0b5b5 Fix some proto_tree_add_item() encoding args;
In some files:
 Remove a few unneeded #includes;
 Do some whitespace/indentation cleanup

svn path=/trunk/; revision=39635
2011-10-27 15:59:12 +00:00
Bill Meier 794757ae8f For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.
Also: remove trailing whitespace for a number of files.

svn path=/trunk/; revision=39503
2011-10-21 02:10:19 +00:00
Bill Meier 4e57694d4a Convert 'encoding' parameter of certain proto_tree_add_item() calls in non-autogenerated epan/dissectors:
Specifically:  Replace FALSE|0 and TRUE|1 by ENC_BIG_ENDIAN|ENC_LITTLE_ENDIAN as
 the encoding parameter for proto_tree_add_item() calls which directly reference
 an item in hf[] which has a type of:
    FT_UINT8
    FT_UINT16
    FT_UINT24
    FT_UINT32
    FT_UINT64
    FT_INT8
    FT_INT16
    FT_INT24
    FT_INT32
    FT_INT64
    FT_FLOAT
    FT_DOUBLE


svn path=/trunk/; revision=39288
2011-10-06 03:35:44 +00:00
Guy Harris ddd33066bb As the man said, ports are unsigned.
svn path=/trunk/; revision=38987
2011-09-13 16:39:17 +00:00
Stephen Fisher abdd48d5e3 The "Uri-Port" option is an unsigned, not signed, integer according to
its hf definition and deraft-ietf-core-coap-04 for example.


svn path=/trunk/; revision=38986
2011-09-13 16:14:28 +00:00
Guy Harris c6eb12cc5f Do more checking of the TLV length. Yes, the length can be zero or
negative in a malformed packet.  Should fix bug 6238.

svn path=/trunk/; revision=38521
2011-08-13 22:33:14 +00:00
Jeff Morriss c832e7a28e strlen returns a size_t
svn path=/trunk/; revision=38460
2011-08-10 21:27:55 +00:00
Jeff Morriss ce701a90c6 From Shoichi Sakane via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5270 :
Update COAP dissector to the latest drafts:
- corresponded to coap-07, block-04, observe-02 and link-format-06.
- improved the option handler.

From me:
Update the comment to indicate that the port is now IANA-assigned.

There's no need to memset a string to initialize it; just set the first byte
to 0.

svn path=/trunk/; revision=38459
2011-08-10 20:54:44 +00:00
Anders Broman 2ad1c8df66 VALS(& -> VALS(
svn path=/trunk/; revision=37009
2011-05-06 12:28:11 +00:00
Stig Bjørlykke 8ce65d5dee Added some missing breaks.
Coverity 447.

svn path=/trunk/; revision=36360
2011-03-27 13:35:30 +00:00
Guy Harris a8bc4a0d13 Rename the routines that handle dissector tables with unsigned integer
keys to have _uint in their names, to match the routines that handle
dissector tables with string keys.  (Using _port can confuse people into
thinking they're intended solely for use with TCP/UDP/etc. ports when,
in fact, they work better for things such as Ethernet types, where the
binding of particular values to particular protocols are a lot
stronger.)

svn path=/trunk/; revision=35224
2010-12-20 05:35:29 +00:00
Jeff Morriss 075954f5a5 From Shoichi Sakane via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5270 :
Fix the dissection of the length of the option field.

svn path=/trunk/; revision=34965
2010-11-19 02:12:19 +00:00
Jeff Morriss b0e1f62ef8 From Shoichi Sakane via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5270 :
I improved the coap dissector.  It is resulted by the 2nd coap test event. 
This patch is diff from 34794.  The fuzzying test passed more than 62000.

Changed:
- removed "#if 0", and expanded exp2().
- added new error codes.
- improved looks of the block options
- renamed to "token" from "opaque_bytes" according to new draft.


From me: Use a use a left shift operation instead of multiplying by 2 many
times.

svn path=/trunk/; revision=34878
2010-11-15 18:01:19 +00:00
Jeff Morriss 58da72c54e Fix the randpkt assertion reported in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5348 :
Always pass a length of 1 to proto_tree_add_item() for the ctype (this fixes
the assertion).  If the length indicated in the message is not 1, add an
expert info.

svn path=/trunk/; revision=34710
2010-10-30 12:48:29 +00:00