Commit graph

1345 commits

Author SHA1 Message Date
Guy Harris
8d234a0d8c More tvbuff API deprecation, comment expansion, and documentation updates.
Do with tvb_get_stringz() what was done with tvb_get_string().

Redo the comments for the string get routines to try to give more detail
in a fashion that's a bit less hard to read.

Warn, in comments, of the problems with using
tvb_get_string()/tvb_get_stringz() (i.e., if your strings are non-ASCII,
all bytes with the 8th bit set are going be replaced by the Unicode
REPLACEMENT CHARACTER, and displayed as such).

Warn, in a comment, of the problems with tvb_get_const_stringz() (i.e.,
it gives you raw bytes, rather than guaranteed-to-be-valid UTF-8).

Update documentation and release notes appropriately.

Change-Id: Ibd3efb92a203861f507ce71bc8d04d19d9d38a93
Reviewed-on: https://code.wireshark.org/review/327
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-02-26 22:04:08 +00:00
Bill Meier
b4850149dd Remove a trailing space from a line of generated code.
Change-Id: Ib95c0db932c54f5664905bde9286aad7a195570f
Reviewed-on: https://code.wireshark.org/review/411
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-02-26 19:37:20 +00:00
Jeff Morriss
5478483eef Install git-review too.
Change-Id: I65c98fe8e120ac3b416ca6749eb2b44c47664fb5
Reviewed-on: https://code.wireshark.org/review/386
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-25 20:47:33 +00:00
Jeff Morriss
5a1aa01af2 Get rid of a few more Subversion remnants.
Change-Id: I35ff651017e355f92b4f9e6388e90d446f245d0a
Reviewed-on: https://code.wireshark.org/review/361
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-25 18:05:08 +00:00
Jeff Morriss
605d9bb8e2 Delete tools/svnadd: it seems git doesn't need all this fancy properties stuff.
Change-Id: Ibb1c713ba9e9b09f062753c232d006b3afd682f0
Reviewed-on: https://code.wireshark.org/review/366
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-25 17:20:53 +00:00
Jeff Morriss
692e7a25b9 Install git instead of subversion.
Change-Id: I5da2c129fa120e461d4bb3199c1ec0e0b52c28a4
Reviewed-on: https://code.wireshark.org/review/337
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-02-25 14:22:59 +00:00
Gerald Combs
57048843e9 "tools" updates.
Remove backport-change. It didn't work as well as I had hoped. Remove
backport-rev since we don't use Subversion any more. Remove DocBook
code from gen-bugnote.

Change-Id: I70f39444c6cdd380301691f64d27147ac09e5cae
Reviewed-on: https://code.wireshark.org/review/348
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-02-25 00:00:54 +00:00
Evan Huus
22149c5523 TVB API deprecations and cleanup
- rename tvb_length and similar to tvb_captured_length and similar; leave
  #defines in place for backwards-compat, but mark them clearly as deprecated in
  code comments and in checkAPI
- remove tvb_get_string as C code and just leave a #define in place for
  backwards-compat; mark it clearly as deprecated in code comment and checkAPI
- update READMEs and sample dissector for all of the above
- while in the neighbourhood, make checkAPI skip (and warn) for missing files
  instead of bailing on the whole check, so subsequent files still get checked

Change-Id: I32fc437896ca86ca73e9b49d5f50400adf8ec5ad
Reviewed-on: https://code.wireshark.org/review/311
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-02-22 15:02:01 +00:00
Alexis La Goutte
2e1f11289b Enhance pre-commit tools to avoid false positive
Limit check to file with extension *.c or *.h

Change-Id: I6e237e6fd053083d271924120973a6b07e2d4e53
Reviewed-on: https://code.wireshark.org/review/247
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-20 18:24:05 +00:00
Alexis La Goutte
9fd19ddc09 Fix indent (use tabs)
Change-Id: I45f5e2ed64090947f1605db10eb6cee0e33782bf
Reviewed-on: https://code.wireshark.org/review/248
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-18 13:51:37 +00:00
Jeff Morriss
82e2865739 Remove $Id$ and other Subversion leftovers from the tools.
There are a few things in here which could still use attention.

Don't regenerate anything now.

Change-Id: I283c224d3523212144707fca3d6265916cb11792
Reviewed-on: https://code.wireshark.org/review/205
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-02-14 01:35:57 +00:00
Jeff Morriss
d219887b44 Don't complain if files don't have $Id$ in them.
$Id$ is pretty useless in git so don't enforce it in our source code.

Change-Id: Ie8b1b9627aabbca72c9c1dd93a9a76901e6967eb
Reviewed-on: https://code.wireshark.org/review/203
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-02-13 23:23:02 +00:00
Alexis La Goutte
0e120c16df Fix warnings in packet-parlay.c
packet-parlay.c:53643:9: warning: passing argument 2 of 'get_CDR_wchar' from incompatible pointer type [enabled by default]

packet-parlay.c:53667:9: warning: passing argument 2 of 'get_CDR_wstring' from incompatible pointer type [enabled by default]

Change-Id: I027809139e74b563e759f28e2e141951166e53d0
Reviewed-on: https://code.wireshark.org/review/170
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Tested-by: Anders Broman <a.broman58@gmail.com>
2014-02-10 22:54:02 +00:00
Evan Huus
3fd9a5e613 Licensecheck improvements, just two errors left.
Spawned from https://www.wireshark.org/lists/wireshark-dev/201402/msg00024.html

Add some ignore rules for files that can't/shouldn't include a license header.

Reorganize some ignore rules to group rules with similar motivations.

Add a header to autogen.sh and attribute it to just "The Wireshark Authors"
since while Gilbert wrote the original version it's gone through so many changes
over the years that sorting out proper authorship is unnecessarily complex.

Add headers to Graeme Hewson's two files as verified by private email, and
update his address in the AUTHORS file per his request.

Add header to one of Ulf Lamping's files, as verified by private email.

Only remaining problem is the reedsolomon code.

Change-Id: Ifb7de8c4b4d79012553e29d459a0145d39f51df5
Reviewed-on: https://code.wireshark.org/review/145
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-02-08 16:51:42 +00:00
Gerald Combs
f966980937 Replace "svn" with "git" all over the place.
Rename "SVNPATH" to "GITBRANCH" since that seems more appropriate.
Rename "svnversion.h" to "version.h" as Evan suggested. Update some
URLs. In make-version.pl, make sure we don't set an improper upstream
branch name. Use the number of commits + short hash from `git describe`
for package names by default.

Change-Id: I922bba8d83eabdf49284a119f55b4076bc469b96
Reviewed-on: https://code.wireshark.org/review/139
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-02-07 23:03:03 +00:00
Stig Bjørlykke
4e7e5a63c3 asn2wrs: Rewrite relative paths in header.
Change both absolute paths and relative paths generated outside
source directory to paths relative to asn1/<proto> subdir.

Change-Id: I867d3a31c687b08347b11336ce69fc70db2d7c7b
Reviewed-on: https://code.wireshark.org/review/88
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Stig Bjørlykke <stig@bjorlykke.org>
2014-02-04 08:17:54 +00:00
Guy Harris
caed2818c9 Don't use newer shell features, as we now just use /bin/sh.
/bin/sh in Solaris 10, for example, doesn't understand "${OS#Windows}",
so using /bin/sh broke the Solaris build on the buildbot.  Use a case
statement instead.

Change-Id: Icdec74599c339e19ef6ffc7728f4ae2d5cf98999
Reviewed-on: https://code.wireshark.org/review/96
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Tested-by: Guy Harris <guy@alum.mit.edu>
2014-02-03 23:44:48 +00:00
Edwin Groothuis
05f54f7d6a Fix build on FreeBSD 10.0
Change-Id: I6be0d2dfe3b44f166233b1dd20ef02c10a024f97
Reviewed-on: https://code.wireshark.org/review/74
Reviewed-by: Evan Huus <eapache@gmail.com>
Tested-by: Evan Huus <eapache@gmail.com>
2014-02-02 00:18:59 +00:00
Evan Huus
3cbe97de5f Give valgrind fuzzing a bit more time. Otherwise we have some large (~80MB)
captures in the menagerie which time out even under normal circumstances.

svn path=/trunk/; revision=54941
2014-01-24 15:52:28 +00:00
Jörg Mayer
a8002aa0b7 Fix two coverity messages:
*** CID 718534:  Dereference before null check  (REVERSE_INULL)
/tools/lemon/lemon.c: 3425 in translate_code()
3419                rp->rhs[i]->index,i-rp->nrhs+1);
3420           }else{
3421             /* No destructor defined for this term */
3422           }
3423         }
3424       }
>>>     CID 718534:  Dereference before null check  (REVERSE_INULL)
>>>     Null-checking "rp->code" suggests that it may be null, but it has already been
+dereferenced on all paths leading to the check.
3425       if( rp->code ){
3426         cp = append_str(0,0,0,0);
3427         rp->code = Strsafe(cp?cp:"");
3428       }
3429     }
3430

*** CID 1156989:  Out-of-bounds read  (OVERRUN)
/tools/lemon/lemon.c: 3139 in tplt_xfer()
3133       int i, iStart;
3134       char line[LINESIZE];
3135       while( fgets(line,LINESIZE,in) && (line[0]!='%' || line[1]!='%') ){
3136         (*lineno)++;
3137         iStart = 0;
3138         if( name ){
>>>     CID 1156989:  Out-of-bounds read  (OVERRUN)
>>>     Overrunning array "line" of 1000 bytes at byte offset 1000 using index "i"
+(which evaluates to 1000).
3139           for(i=0; line[i] && i<LINESIZE; i++){
3140             if( line[i]=='P' && i<(LINESIZE-5) && strncmp(&line[i],"Parse",5)==0
3141               && (i==0 || !safe_isalpha(line[i-1]))
3142             ){
3143               if( i>iStart ) fprintf(out,"%.*s",i-iStart,&line[iStart]);
3144               fprintf(out,"%s",name);

svn path=/trunk/; revision=54849
2014-01-19 17:59:20 +00:00
Gerald Combs
8424cf3f8c Add environment checks. Add a topic to our refspec.
Check for a 'gerrit' remote and for a commit-msg hook. The hook script
doesn't work on my system. This might be due to
http://code.google.com/p/gerrit/issues/detail?id=843

svn path=/trunk/; revision=54838
2014-01-18 00:03:02 +00:00
Gerald Combs
705083d279 If you use bashisms it means you're a bash script.
svn path=/trunk/; revision=54829
2014-01-16 19:42:13 +00:00
Gerald Combs
8db4bc2499 More Chocolatey lex/yacc updates.
Add Windows-style path handling to runlex.sh. Update the example
Chocolatey LEX path accordingly. This lets us use path information in
LEX and have it work in both nmake and runlex.sh

Add a FindChocolatey.cmake module. Update FindLEX and FindYACC to use it.
The code is currently untested and commented out.

svn path=/trunk/; revision=54828
2014-01-16 18:57:29 +00:00
Gerald Combs
d5b706be51 Allow the use of Win flex-bison and document how to do that.
svn path=/trunk/; revision=54824
2014-01-16 01:28:02 +00:00
Guy Harris
833d315c02 Document {CODE,HEADER} {START,END}.
Clean up indentation.

svn path=/trunk/; revision=54721
2014-01-13 21:18:29 +00:00
Guy Harris
a2979508d0 Add HEADER START and HEADER END, similar to CODE START and CODE END, to
allow stuff to be put into the .h file; that way, if you put helper
functions into the .c file, for use by dissectors other than the one
being generated, you can put declarations for them into the .h file.

Do some checks for mis-nesting of CODE and HEADER blocks.

Clean up the "this is generated code" header.

svn path=/trunk/; revision=54720
2014-01-13 21:05:44 +00:00
Guy Harris
61d5c458a0 Squelch some warnings.
svn path=/trunk/; revision=54711
2014-01-13 19:07:48 +00:00
Gerald Combs
1a279aca25 Update the enterprise-numbers URL.
svn path=/trunk/; revision=54694
2014-01-10 22:57:28 +00:00
Gerald Combs
870635c248 The IEEE OUI, IAB, and OUI-36 lists currently redirect to
http://standards.ieee.org/regauthmaint.html, which says

IEEE Registration Authority Services will be unavailable from Friday, December 27th through Monday, December 30th

As a result the manuf file got clobbered. Revert the manuf file to
its non-clobbered state and add sanity checks to make-manuf. Add a
note about the impending addition of OUI-28.

svn path=/trunk/; revision=54485
2013-12-29 17:28:12 +00:00
Jakub Zawadzki
6bb97fa327 Generate prototype for plugin_reg_handoff()
This should fix warnings:
 plugin.c:XX:1: warning: no previous prototype for 'plugin_reg_handoff' [-Wmissing-prototypes]

svn path=/trunk/; revision=54475
2013-12-27 15:46:50 +00:00
Anders Broman
d0915cabb3 Fix [-Wmissing-prototypes]
svn path=/trunk/; revision=54473
2013-12-27 10:49:35 +00:00
Jakub Zawadzki
3778699fb5 Commit sample program to generate charsets.c tables using iconv()
For now only single-byte, and it must be possible to encode whole charset as UCS-2

svn path=/trunk/; revision=54324
2013-12-21 11:44:31 +00:00
Jakub Zawadzki
064082e68a Change G_GINT64_CONSTANT(xxxxU) to G_GUINT64_CONSTANT(xxxx)
svn path=/trunk/; revision=54314
2013-12-20 22:39:32 +00:00
Michael Mann
959a290961 proto_tree_add_text -> proto_tree_add_xxx conversion.
svn path=/trunk/; revision=54274
2013-12-19 21:51:09 +00:00
Jeff Morriss
6762f7e0c8 Some patches from Peter Harris:
[PATCH 1/5] X11 dissector: Sort declarations
This prevents pointless changes showing up in the diff when evaluating
unrelated changes to the generator.

See http://search.cpan.org/dist/perl-5.18.0/pod/perldelta.pod#Hash_randomization

[PATCH 2/5] X11 dissector: Silence warnings on perl 5.18, prevent 5.20
Perl 5.18 retroactively marked "given/when" experimental, with a
promise to remove or dramatically change it in 5.20.

Since there is no perl 5.20 yet, there is no way to make this script
compatible with it.

[PATCH 3/5] X11 dissector: Support variable_param (at least for glCallLists)
(This patch makes the change in r54232 unnecessary by using the previously-
unused variable.)

[PATCH 4/5] X11 dissector: Remove obsolete TODO item
This item was done in r53531 PATCH 09/11

svn path=/trunk/; revision=54242
2013-12-19 02:32:21 +00:00
Michael Mann
f882b63d97 Some proto_tree_add_xxx functions have a '_' in the function name so make sure they get counted in the proto_tree_add_text percentage.
Makes a few dissectors look a little better.

svn path=/trunk/; revision=54236
2013-12-18 22:10:59 +00:00
Gerald Combs
5385c2d5f8 Instead of assigning a variable to itself, avoid unused warnings similar
to the Q_UNUSED macro.

svn path=/trunk/; revision=54232
2013-12-18 20:53:01 +00:00
Anders Broman
e8b935ad6e Fix [-Wmissing-prototypes]
svn path=/trunk/; revision=54209
2013-12-18 06:51:09 +00:00
Evan Huus
4cb6a92d93 Change the exit status of a fuzz failure to 255 so that if you use it with xargs
the failures don't get suppressed.

svn path=/trunk/; revision=54071
2013-12-13 22:15:29 +00:00
Gerald Combs
10d8530102 Switch the cherry-pick merge strategy to "recursive + theirs", which
seems to pull in fewer changes and be less prone to conflitcs. This was
the case for r53086, at least.  Add "-x" which adds a "cherry picked
from..." line to the commit message.

Show a diff before pushing.

svn path=/trunk/; revision=54007
2013-12-13 01:40:36 +00:00
Gerald Combs
a43efdb873 Fix redirection.
svn path=/trunk/; revision=54003
2013-12-13 00:05:32 +00:00
Gerald Combs
07b56cf62f Don't cherry-pick if we have changes.
svn path=/trunk/; revision=54001
2013-12-13 00:03:19 +00:00
Gerald Combs
9b0b75703f Add a "backport-change" script which cherry-picks a proposed backport
and pushes it to Gerrit.

svn path=/trunk/; revision=53999
2013-12-12 23:38:54 +00:00
Tomas Kukosa
0a626c33c8 Ply parser updated to 3.5 (from GitHub github.com/dabeaz/ply)
svn path=/trunk/; revision=53782
2013-12-04 14:45:32 +00:00
Alexis La Goutte
6b10f16ca8 From Anders request Add prototype for corba/idl dissector
svn path=/trunk/; revision=53778
2013-12-04 09:53:21 +00:00
Jakub Zawadzki
cedb73c7f7 Dissectors should not use dfilter.h, don't include it.
XXX ncp2222 dissector is using dfilter_compile(), why?

svn path=/trunk/; revision=53766
2013-12-03 21:31:04 +00:00
Alexis La Goutte
3fc5a3e845 Add modelines info to idl generate file
svn path=/trunk/; revision=53754
2013-12-03 13:38:38 +00:00
Alexis La Goutte
de65892796 Fix indent for generated file (Use 4 space)
svn path=/trunk/; revision=53753
2013-12-03 13:38:30 +00:00
Alexis La Goutte
a637d81706 Fix generator don't generate trailing whitespace
svn path=/trunk/; revision=53752
2013-12-03 13:38:23 +00:00
Alexis La Goutte
225161b1be Remove trailing whitespace and add modelines info
svn path=/trunk/; revision=53751
2013-12-03 13:38:15 +00:00