aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-coap.c
AgeCommit message (Collapse)AuthorFilesLines
2015-08-02CoAP: add media type number for application/cborHauke Mehrtens1-0/+1
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-07-21coap: fix decoding of observe extensionHauke Mehrtens1-5/+11
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-01-07tvb_bytes_to_ep_str_punct -> tvb_bytes_to_str_punctMichael Mann1-2/+2
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>
2014-12-22First batch of unincludes. Last attempt...Martin Mathieson1-1/+0
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-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-3/+1
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-11-06coap: fix a bug; do some cleanup.Bill Meier1-72/+62
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-09-17CoAP dissector: Update option numbers from RFC7252chrysn1-1/+44
* "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-06-18Fix copy-paste probem in COAP dissectorShoichi Sakane1-3/+3
Bug:8070 Change-Id: I7a86a37f7de6b3e4e12fe1c47980a9a6604488d6 Reviewed-on: https://code.wireshark.org/review/2390 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-18Fixup: tvb_get_string(z) -> tvb_get_string(z)_encDario Lombardo1-6/+6
Change-Id: I63a3704effe3fcab01a193dc39b6a22e9f1cf3fe Reviewed-on: https://code.wireshark.org/review/2376 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-07tvb_new_subset -> tvb_new_subset_length when length parameters are equal.Michael Mann1-1/+1
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-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(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>
2013-12-19Rename a couple of to_str functions to have ep_ in the name. This makes itEvan Huus1-2/+2
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-11-13(Minor cleanup): unneeded initializers, whitespace, long-lines, typosBill Meier1-190/+207
svn path=/trunk/; revision=53303
2013-11-02Require dissector_try_string to pass a data parameter to its subdissectors. ↵Michael Mann1-1/+1
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-10-29From didier gautheron: remove redundant or use faster col_xxx functionsBill Meier1-1/+0
- 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-27Remove iplen and iphdrlen from struct _packet_info.Michael Mann1-1/+1
Dissectors should just use (reported) tvb length and taps have other ways to get the data. svn path=/trunk/; revision=52899
2013-10-13whitespace fixes; mostly: remove trailing blanksBill Meier1-4/+4
svn path=/trunk/; revision=52591
2013-10-05From Peter A. Bigot via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9225Evan Huus1-0/+2
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-09-22emem -> wmem conversion:Pascal Quantin1-6/+6
- 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-09expert_add_info_format_text -> expert_add_info_formatMichael Mann1-5/+5
svn path=/trunk/; revision=51852
2013-07-05Batch of filterable expert infos.Michael Mann1-14/+23
svn path=/trunk/; revision=50384
2013-06-11Remove blurbs not adding any value.Anders Broman1-30/+30
svn path=/trunk/; revision=49885
2013-06-11From Hauke Mehrtens:Anders Broman1-5/+23
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-11From Hauke Mehrtens:Anders Broman1-2/+2
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-11From Hauke Mehrtens:Anders Broman1-200/+174
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-11From Hauke Mehrtens:Anders Broman1-3/+14
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-11From Hauke Mehrtens:Anders Broman1-9/+9
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-11From Hauke Mehrtens:Anders Broman1-35/+22
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-03-22From Soichi Sakane via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8070Evan Huus1-251/+653
Update CoAP dissector to the latest spec from the IETF, and make several more fields filterable. svn path=/trunk/; revision=48471
2013-03-15[-Wmissing-prototypes]Anders Broman1-0/+2
Use explicit casts. svn path=/trunk/; revision=48313
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-3/+1
svn path=/trunk/; revision=45017
2012-08-10Use val_to_str_const() where appropriate;Bill Meier1-1/+1
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-07-11Don't call col...() and expert..() functions under 'if (tree)';Bill Meier1-79/+176
Reformat hf[] entries and various other. svn path=/trunk/; revision=43671
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-05-07Get rid of remaining Booleans-as-encoding-arguments inGuy Harris1-2/+1
proto_tree_add_item() calls. Get rid of unnecessary include of <stdio.h>. svn path=/trunk/; revision=42480
2012-04-09Add missing const attribute to some char *Jakub Zawadzki1-1/+1
Fix some "assignment discards qualifiers from pointer target type", etc svn path=/trunk/; revision=41993
2011-10-27Fix some proto_tree_add_item() encoding args;Bill Meier1-4/+4
In some files: Remove a few unneeded #includes; Do some whitespace/indentation cleanup svn path=/trunk/; revision=39635
2011-10-21For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.Bill Meier1-1/+1
Also: remove trailing whitespace for a number of files. svn path=/trunk/; revision=39503
2011-10-06Convert 'encoding' parameter of certain proto_tree_add_item() calls in ↵Bill Meier1-7/+7
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-09-13As the man said, ports are unsigned.Guy Harris1-2/+2
svn path=/trunk/; revision=38987
2011-09-13The "Uri-Port" option is an unsigned, not signed, integer according toStephen Fisher1-1/+1
its hf definition and deraft-ietf-core-coap-04 for example. svn path=/trunk/; revision=38986
2011-08-13Do more checking of the TLV length. Yes, the length can be zero orGuy Harris1-1/+1
negative in a malformed packet. Should fix bug 6238. svn path=/trunk/; revision=38521
2011-08-10strlen returns a size_tJeff Morriss1-1/+1
svn path=/trunk/; revision=38460
2011-08-10From Shoichi Sakane via ↵Jeff Morriss1-146/+246
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-05-06 VALS(& -> VALS(Anders Broman1-3/+3
svn path=/trunk/; revision=37009
2011-03-27Added some missing breaks.Stig Bjørlykke1-0/+2
Coverity 447. svn path=/trunk/; revision=36360
2010-12-20Rename the routines that handle dissector tables with unsigned integerGuy Harris1-4/+4
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-11-19From Shoichi Sakane via ↵Jeff Morriss1-6/+15
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-15From Shoichi Sakane via ↵Jeff Morriss1-19/+32
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-10-30Fix the randpkt assertion reported in ↵Jeff Morriss1-5/+10
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