aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-aprs.c
AgeCommit message (Collapse)AuthorFilesLines
2022-11-30wmem: Remove wmem_strbuf_new_label()João Valverde1-1/+1
Only dissectors are using this function and there is no use case, as far as I know, that requires its use. Any limitation of length is imposed transparently by the UI backend. This function is problematic because it is not Unicode aware and will truncate a string on an arbitrary byte boundary for multibyte strings. Replace its use with a normal strbuf without a length limite and remove the function because it is not useful and the ITEM_LABEL_LENGTH parameter does not belong in wmem anyway.
2022-04-19aprs: NULL-terminate a string.Dario Lombardo1-1/+1
CID: 1495842
2022-02-15Tools: Fix fix-encoding-args.pl ASCII string validationJoão Valverde1-54/+54
Do not require a useless ENC_NA parameter for string encodings. FT_STRING and FT_STRINGZ types don't have any ndianness. Follow-up to 6ec429622c9258eefd388caf21ce92ab5b9f54b4.
2021-12-19Replace g_snprintf() with snprintf() (dissectors)João Valverde1-4/+4
Use macros from inttypes.h with format strings.
2021-09-01tvbuff: convert helper methods to pinfo->poolEvan Huus1-18/+18
A few of them just needed scratch memory, so allocate and free it manually after doing any exception-raising checks. A few others were returning memory, and needed conversion to accept a wmem scope argument.
2021-02-15Set a few more dissector vars/funs to static.Martin Mathieson1-3/+3
These are the last of the easy ones to fix/set.
2020-08-29Fix some spelling errors in dissector strings.Martin Mathieson1-1/+1
A first batch of spelling errors, detected using a script that uses pyspellcheck and a Wireshark-specific dictionary file.
2020-05-03Fix some issues seen with a fresh run of PVS StudioMartin Mathieson1-1/+1
/opt/SourceCode/wireshark/epan/dissectors/packet-aoe.c 328 warn V581 The conditional expressions of the 'if' statements situated alongside each other are identical. Check lines: 323, 328. /opt/SourceCode/wireshark/epan/dissectors/packet-aprs.c 1148 warn V1037 Two or more case-branches perform the same actions. Check lines: 1148, 1161 /opt/SourceCode/wireshark/epan/dissectors/packet-lsd.c 127 err V547 Expression 'strlen("cookie") == 0' is always false. /opt/SourceCode/wireshark/epan/dissectors/packet-rpc.c 3385 warn V547 Expression 'conversation == NULL' is always true. /opt/SourceCode/wireshark/epan/dissectors/packet-snort-config.c 465 note V576 Incorrect format. Consider checking the fourth actual argument of the 'g_snprintf' function. Under certain conditions the pointer can be null. /opt/SourceCode/wireshark/epan/dissectors/packet-snort.c 630 warn V768 The variable 'condition' is of enum type. It is odd that it is used as a variable of a Boolean-type. /opt/SourceCode/wireshark/epan/dissectors/packet-snort.c 969 warn V547 Expression '!attempt_match' is always false. Bug: 16335 Change-Id: I93bbc40f0467ebaab74335f6edc7d60e1c600a94 Reviewed-on: https://code.wireshark.org/review/37044 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <gharris@sonic.net>
2019-07-26HTTPS (almost) everywhere.Guy Harris1-1/+1
Change all wireshark.org URLs to use https. Fix some broken links while we're at it. Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c Reviewed-on: https://code.wireshark.org/review/34089 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-12dissectors: use SPDX identifiers.Dario Lombardo1-13/+1
Change-Id: I92c94448e6641716d03158a5f332c8b53709423a Reviewed-on: https://code.wireshark.org/review/25756 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-07-08APRS: more cleanup.Jeff Morriss1-245/+75
There's no need to create global structures with pointers to the (global) hf's to pass into the dissection functions. Just reference the global variables directly. Remove other global variables passed as arguments while we're at it. Remove boilerplate comments. Change-Id: I7ce6b356172aa25983f4cc6a007a0158cb7f26c9 Reviewed-on: https://code.wireshark.org/review/16331 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-08APRS: clean up some header fields.Jeff Morriss1-22/+22
Try to make the names self-explanatory (without relying on blurbs). Change-Id: Icfb4797282987b42ac68709b431d8b7248a0a633 Reviewed-on: https://code.wireshark.org/review/16330 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-07APRS: register the storm fields.Jeff Morriss1-39/+57
There's been a comment here since 2012 about them being unregistered. Put in some registrations based on a feeble understanding of the specification (these are all strings, add them as such); that should be close enough and is much better than the (dissector) assertion we'd get otherwise. Don't bother putting those hf's in a global structure and passing around the structure: the hf's are global anyway--just reference them directly. Add a link to the specification while we're here. Change-Id: Ia7b17e92a996a1a8eb4a4489eff9fca042190a32 Reviewed-on: https://code.wireshark.org/review/16318 Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09new_register_dissector -> register_dissector for dissector directory.Michael Mann1-1/+1
Change-Id: Ie39ef054a4a942687bd079f3a4d8c2cc55d5f22c Reviewed-on: https://code.wireshark.org/review/12485 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-04-15Replcae deprecated API tvb_length with tvb_reported_length or tvb_capturedAndersBroman1-3/+3
length. Change-Id: Ia1235c49b28320b5651e284115639820f81cb747 Reviewed-on: https://code.wireshark.org/review/8074 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-12-22Include <math.h> or <stdlib.h> as necessary to declare functions.Guy Harris1-0/+1
Various floating-point math functions require <math.h>, and abs() requires <stdlib.h>. Change-Id: Iadba9e0d7168bba6e67d9221e757a85960507742 Reviewed-on: https://code.wireshark.org/review/5999 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-22First batch of unincludes. Last attempt...Martin Mathieson1-3/+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-21Replace ax25_to_str and get_ax25_name with address_to_str.Michael Mann1-1/+3
Change-Id: I74ddb6fc629ef32b217dede7a3ba652cbbf5ab12 Reviewed-on: https://code.wireshark.org/review/5932 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-4/+0
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-10-20Get rid of calls to ctype.h functions.Guy Harris1-5/+4
They don't handle values outside the range -1 to 127, and their behavior is locale-dependent. Use g_ascii_isXXX() and g_ascii_toXXX() instead of isXXX() and toXXX(). If you're checking for printable ASCII, don't use isascii() and don't use iscntrl(), use g_ascii_isprint(). If you're checking for graphical ASCII, i.e. printable ASCII except for a space, use g_ascii_isgraph(). Use ws_xton() to convert a hex digit character to the corresponding numeric value. Change-Id: Id3039bc586fbf66d8736c2df248c790c0d7a2330 Reviewed-on: https://code.wireshark.org/review/4851 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-09-30Add editor modelines; Adjust whitespace; Remove boilerplate commentsBill Meier1-5/+17
Change-Id: I1f5f83ed441f6009125cf2cbe5023af04986898a Reviewed-on: https://code.wireshark.org/review/4392 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-06-22convert to proto_tree_add_subtree[_format]Michael Mann1-9/+4
Change-Id: Ib60ca75b7da8cfa21cfe2999c9b9448a02c332df Reviewed-on: https://code.wireshark.org/review/2560 Tested-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19Revert "Fixup: tvb_* -> tvb_captured"Michael Mann1-3/+3
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html This reverts commit 246fe2ca4c67d8c98caa84e2f57694f6322e2f96. Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f Reviewed-on: https://code.wireshark.org/review/2430 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-18Fixup: tvb_* -> tvb_capturedDario Lombardo1-3/+3
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f Reviewed-on: https://code.wireshark.org/review/2377 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-15Get rid of some uses of tvb_get_ptr().Guy Harris1-44/+35
Change-Id: Ib49575e5d92419e0860bf92810a7ac69f30e9699 Reviewed-on: https://code.wireshark.org/review/1646 Reviewed-by: Guy Harris <guy@alum.mit.edu>
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>
2014-01-23Use tvb_get_string_enc() rather than tvb_get_string(). The specs sayGuy Harris1-2/+10
ASCII, but there's a proposal to use UTF-8. svn path=/trunk/; revision=54921
2014-01-14Clean up references to an address and squelch some warnings.Guy Harris1-7/+10
svn path=/trunk/; revision=54754
2013-12-14Remove not needed ';'Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=54088
2013-10-29From didier gautheron: remove redundant or use faster col_xxx functionsBill Meier1-1/+1
- 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-09-22emem -> wmem conversion:Pascal Quantin1-2/+2
- 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-12Convert a few dissectors from emem to wmem APIPascal Quantin1-20/+20
svn path=/trunk/; revision=51983
2013-03-12- [-Wmissing-prototypes]Anders Broman1-11/+13
- explicit casts. svn path=/trunk/; revision=48274
2013-02-03#if 0 unused hf[] entries & etc.Bill Meier1-1/+3
Note: All (or almost all) unused hf[] entries in non-generated Wireshark dissectors have been #if 0'd (or commented) out. (This applies only to 'static hf_...' vars). A number of (non-generated) dissector files with *missing* hf[] entries still need to be fixed. svn path=/trunk/; revision=47459
2012-12-21Constify some character pointer variables to avoid warnings aboutGuy Harris1-5/+5
strings being assigned to them. svn path=/trunk/; revision=46653
2012-12-04Fix 2 [-Wshadow] warningsBill Meier1-16/+16
svn path=/trunk/; revision=46377
2012-10-26Fix [-Wunused-but-set-variable] warnings.Bill Meier1-9/+3
svn path=/trunk/; revision=45803
2012-10-26General cleanup (No changes in dissection):Bill Meier1-503/+548
- rename variables to fix all "shadowed variable" warnings; - remove certain 'if(tree)' statements; (A new-style dissector) should return the same 'bytes processed' whether or not 'tree == NULL'); - simplify code in numerous places (including removing redundant/repeated code); - fix remaining uses of FALSE as 'encoding' arg; - use consistent indentation and formatting. ToDo: Changes to fix apparent cases of incorrect dissection. svn path=/trunk/; revision=45802
2012-10-22Fix some encoding args; (still more to do).Bill Meier1-59/+63
svn path=/trunk/; revision=45730
2012-10-22Cleanup:Bill Meier1-36/+12
- Ethereal --> Wireshark; - gerald@ethereal.com --> gerald@wireshark.org; - update FSF address; - remove unneeded #includes; - Fix ENC args for proto_tree_add_item() & etc; - simplify/remove proto_reg_handoff...() as appropriate; - remove some boilerplate comments; - move proto_register...() and proto_reg_handoff...() to the end of the file as per convention; - remove some unneeded initializers. - simplify some code; - replace "" in hf[] blurb by NULL. svn path=/trunk/; revision=45728
2012-10-08Fix some Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-99/+88
svn path=/trunk/; revision=45397
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-03Replace blurbs which duplicate the field name with NULL.Jeff Morriss1-92/+92
svn path=/trunk/; revision=44244
2012-08-03Squelch narrowing warnings.Guy Harris1-2/+2
svn path=/trunk/; revision=44233
2012-08-02Oops, forgot to add packet-aprs.c to dissector source lists.Guy Harris1-4/+4
Fix warnings in packet-aprs.c. svn path=/trunk/; revision=44231
2012-08-02From Richard Stearn: APRS support.Guy Harris1-0/+1976
Fix field names for AX.25 "No layer 3" to match the protocol name. svn path=/trunk/; revision=44230