aboutsummaryrefslogtreecommitdiffstats
path: root/epan/ftypes/ftype-integer.c
AgeCommit message (Collapse)AuthorFilesLines
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-15Eliminate fvalue_set() in favor of routines that take argumentsGuy Harris1-51/+121
appropriate for particular FT_ types. This lets us do some more type checking and lets us use const pointers when appropriate. Constify a bunch of stuff, and don't cast away constness. svn path=/trunk/; revision=54811
2013-11-10Add missing includes in order to remove exceptions.h from proto.h (next commit).Jakub Zawadzki1-0/+1
svn path=/trunk/; revision=53230
2013-11-09include <wsutil/pint.h> only when needed.Jakub Zawadzki1-0/+2
svn path=/trunk/; revision=53196
2013-09-13Two more places with now explicit emem.h includeJörg Mayer1-0/+1
svn path=/trunk/; revision=51998
2012-11-06When comparing fvalue_t we don't modify them, make arguments const.Jakub Zawadzki1-24/+24
svn path=/trunk/; revision=45948
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-2/+0
svn path=/trunk/; revision=45016
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-06-02Try to squelch warningsAnders Broman1-1/+1
svn path=/trunk/; revision=43001
2011-12-27Add a "-G ftypes" option, which dumps our supprted FT_… names andGerald Combs1-13/+13
descriptions. Captitalize and fix up the descriptions. Use its output to create the field type list in the wireshark-filter man page. svn path=/trunk/; revision=40306
2011-10-29Fixed max and min in sint24_from_unparsed() again.Stig Bjørlykke1-1/+1
Note to self: don't think hex while doing something else... svn path=/trunk/; revision=39664
2011-10-28Fixed max and min in sint24_from_unparsed().Stig Bjørlykke1-1/+1
svn path=/trunk/; revision=39662
2011-10-28Fixed a typo: strtoull() -> strtoul()Stig Bjørlykke1-1/+1
svn path=/trunk/; revision=39661
2011-10-28Simplified code for checking integer ranges.Stig Bjørlykke1-102/+32
svn path=/trunk/; revision=39660
2011-10-28Added range checking for integers and give an appropriate errorStig Bjørlykke1-26/+207
message if value is outside of range (given by field type). svn path=/trunk/; revision=39659
2011-10-26Fixed compare functions for 64 bits integers:Stig Bjørlykke1-8/+8
- Do not cast unsigned values to signed - Do cast signed values from the internal stored unsigned svn path=/trunk/; revision=39601
2011-06-14Please don't use prohibited APIs in new code:Stig Bjørlykke1-1/+1
sprintf -> g_snprintf Fixes coverity 1197 & 1198. svn path=/trunk/; revision=37664
2011-05-16Cast away some warnings about alignment; ep_alloc() guaranteesGuy Harris1-1/+1
sufficient alignment for all types of data. svn path=/trunk/; revision=37190
2011-05-08Add FT_EUI64 Field TypeAlexis La Goutte1-0/+74
* Remove proto_tree_add_eui64 function from 802.15.4 Dissector * Replace print_eui64/print_eui64 by eui64_to_str/get_eui64_name * Update Documentation (README.dev) * Add new function in libwireshark.def * Support of encoding for tvb_eui64_to_str * Use FT_EUI64 for ICMPv6, CAPWAP, Zbee ... dissector svn path=/trunk/; revision=37015
2010-04-30Pick up other check from the almost-identical routine inGuy Harris1-0/+9
epan/dfilter/scanner.l. (The common code should be in a utility routine.) svn path=/trunk/; revision=32619
2010-04-30Fix comment.Guy Harris1-1/+1
svn path=/trunk/; revision=32618
2010-04-30Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1696 :Jeff Morriss1-12/+57
The change put in with rev 11382 meant that, on 64-bit systems, we could not parse negative numbers into integers (since -1 taken as an unsigned 64-bit number is (significantly) larger than G_MAX_UINT32). To fix this, split the val_from_unparsed() routine for integers into two routines: one for signed and one for unsigned; each routine can then do the appropriate "is this bigger than what fits in a *32?" test. svn path=/trunk/; revision=32616
2010-02-23From Jakub Zawadzki:Anders Broman1-3/+12
Optimizations. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4303 svn path=/trunk/; revision=31967
2009-08-26(FWIW) One step towards including stdio.h & stdlib.h only when req'd.Bill Meier1-1/+1
svn path=/trunk/; revision=29568
2009-04-22Clean up some 64-bit issues.Guy Harris1-1/+1
svn path=/trunk/; revision=28117
2008-06-04g_ascii_strtoull() is in GLib 2.2 and later, and we require GLib 2.4 orGuy Harris1-4/+0
later, so there's no longer any need to have our own g_ascii_strtoull. svn path=/trunk/; revision=25423
2008-06-03We require GLib 2.4 or later, and they define G_MININT32, G_MAXIN32,Guy Harris1-12/+0
G_MAXUINT32, and G_MAXUINT64; don't check whether we need to define them ourselves. svn path=/trunk/; revision=25420
2008-02-08Fix typo in commentStephen Fisher1-1/+1
svn path=/trunk/; revision=24288
2007-12-05At least on some LP64 platforms (such as OpenBSD 4.2 on x86-64),Guy Harris1-2/+2
PRI[dux]64 use "ll", but gint64 and guint64 are "long" and "unsigned long", not "long long" or "unsigned long long", and the compiler warns about using "%ll[doux]" with "long" or "unsigned long". Use G_GINT64_MODIFIER instead. svn path=/trunk/; revision=23760
2007-01-18Add separate union entries to fvalue.value for signed and unsignedMartin Mathieson1-56/+96
32-bit numbers. Separate signed and unsigned accessors have been added and used where appropriate. Definitely not for 0.99.5. svn path=/trunk/; revision=20472
2006-05-21name changeRonnie Sahlberg1-2/+2
svn path=/trunk/; revision=18197
2006-05-02Add infrastructure for display filter functions.Gilbert Ramirez1-0/+13
Add upper() and lower() display filter functions for string fields. svn path=/trunk/; revision=18071
2005-11-03Fix usage of PRI[du]64 - they just replace the "letter" part of theGuy Harris1-2/+2
format, they don't include the "%". svn path=/trunk/; revision=16384
2005-10-31When printing the code for a display filter:Guy Harris1-24/+84
print register numbers as unsigned (they're guint32); when printing a PUT_FVALUE instruction, show the value as well as the type of the value. That requires that a bunch of types get to_repr methods; add them for PCRE (FTREPR_DFILTER-only - show the regular expression as text), tvbuffs (FTREPR_DFILTER_only - show the data as a hex string), integral types, string types other than FT_STRING, and FT_IPv6. That means we can use fvalue_to_string_repr() for FT_IPXNET and FT_IPv6 in proto_construct_dfilter_string(), and that we don't need to handle integer and floating types specially in MATE. Fix some problems with the PCRE execution code for tvbuff types. svn path=/trunk/; revision=16369
2004-09-03Some UN*Xes don't have any "strtou*" routine to convert a string to aGuy Harris1-3/+7
64-bit integer; use "g_ascii_strtoull()", and, in the configure script, check whether it's available in GLib (it's not in GLib 1.2[.x]) and, if not, supply the GLib 2.4.5 version of the routine. For G_MAXUINT32 and G_MAXUINT64, put a "U" at the end of the constant to explicitly flag it as unsigned. svn path=/trunk/; revision=11889
2004-08-25guint64 & guint64 is another guint64, but a gboolean is just 32 bits onGuy Harris1-2/+2
most if not all platforms; the "bitwise and" operator in display filters is Boolean and evaluates to "true" if the result is non-zero and "false" otherwise, so explicitly do the comparison with 0 to make sure we don't just throw away the upper 32 bits. Do the same for the 32-bit bitwise AND as well, although it's not strictly necessary. svn path=/trunk/; revision=11828
2004-08-22GLib 1.2[.x] doesn't define G_MAXUINT64, just as it doesn't defineGuy Harris1-2/+6
G_MAXUINT32, so we have to define it if it's not defined. svn path=/trunk/; revision=11797
2004-08-22Add "tvb_get_ntoh64()" and "tvb_get_letoh64()" routines to fetch 64-bitGuy Harris1-0/+221
integers. Make FT_INT64 and FT_UINT64 add numerical values, rather than byte-array values, to the protocol tree, and add routines to add specified 64-bit integer values to the protocol tree. Use those routines in the RSVP dissector. svn path=/trunk/; revision=11796
2004-08-06From Albert Chin: rename resolv.{ch} to addr_resolv.{ch}, so that anGuy Harris1-1/+1
include of <resolv.h> in any system header file gets the system <resolv.h> (needed for builds on Tru64 with GTK+ 1.2[.x]). svn path=/trunk/; revision=11615
2004-07-18Set the svn:eol-style property on all text files to "native", so thatGuy Harris1-1/+1
they have LF at the end of the line on UN*X and CR/LF on Windows; hopefully this means that if a CR/LF version is checked in on Windows, the CRs will be stripped so that they show up only when checked out on Windows, not on UN*X. svn path=/trunk/; revision=11400
2004-07-17G_MAXINT32, G_MININT32, and G_MAXUINT32 aren't defined by GLib 1.2[.x],Guy Harris1-0/+7
so we have to define them ourselves if they're not defined. svn path=/trunk/; revision=11384
2004-07-16I'm not sure "strtol()" and "strtoul()" are guaranteed to clear "errno"Guy Harris1-3/+19
on success, so we clear it before calling them. Assign the value of "strtol()" to a "long" and assign the value of "strtoul()" to an "unsigned long", as those are the return types for those functions - "gint32" and "guint32" might not be large enough for the return value on an LP64 platform. Check for errno being EINVAL, as that can happen if the number isn't valid. Before assigning the value returned by "strtol()" or "strtoul()" to the final destination, check whether it's in the right range for that destination. svn path=/trunk/; revision=11382
2004-02-27First attempt at "bitwise AND" display filter operator.Olivier Biot1-1/+18
Document how a display operator can be added. svn path=/trunk/; revision=10250
2003-12-06From Olivier BiotGilbert Ramirez1-1/+12
New "matches" operater in display filter language. Uses PCRE. If a "matches" operator is found in a dfilter while libpcre has not been used to build the binary, then an exception is thrown after using dfilter_fail() to set an apporporiate error message. svn path=/trunk/; revision=9182
2003-08-27Add a "contains" operator for byte-strings, strings, and tvbuffs (protocols).Gilbert Ramirez1-4/+15
The search uses a naive approach; more work is required to add a Boyer-Moore Search algorithm. svn path=/trunk/; revision=8280
2003-07-25Add to the fundamental types passed between the scanner and the parser.Gilbert Ramirez1-15/+26
Besides "STRING", there is now "UNPARSED_STRING", where the distinction is that "STRING" was a double-quoted string and "UNPARSED_STRING" is just a sequence of characters that the scanner didn't know how to scan/parse, so it's up to the Ftype to parse it. This gives us more flexibility and prepares the dfilter parsing engine for the upcoming addition of the "contains" operator. In the process of doing this, I also re-did the double-quoted string support in the scanner, so that instead of the naively-simple support we used to have, double-quoted strings now can have embedded dobule-quotes, embedded octal sequences, and embedded hexadecimal sequences: "\"" embedded double-quote "\110" embedded octal "\x48" embedded hex Enhance the dfilter unit test script to be able to run a single collection of tests instead of having to run all of them all the time. svn path=/trunk/; revision=8083
2003-06-11Expand the ability of fvalue_to_string_repr, and modify more FT_* typesGilbert Ramirez1-167/+179
to provide that method. svn path=/trunk/; revision=7849
2003-02-08Provide a way for ftype modules to provide a string representationGilbert Ramirez1-1/+23
of their value. Provide such a method for FT_BYTES, FT_UINT_BYTES, and FT_ETHER. Have proto_alloc_dfilter_string() use the new methods. This is part of a movement of ftype-related code out of proto.c and into the ftype code. The immediate effect is that generated display filters for long byte sequences don't incorrectly have trailing periods ("...") to indicate continuation. svn path=/trunk/; revision=7100
2002-12-19Add a new field type FT_FRAMENUM; an FT_FRAMENUM is a 32-bit unsignedGuy Harris1-1/+28
frame number, which is always decimal. If you select an FT_FRAMENUM field, there are menu items that let you go to the frame whose frame number appears in that field. Add FT_FRAMENUM fields for the ONC RPC "matching request is in this frame" and "matching reply is in this frame" protocol tree items. svn path=/trunk/; revision=6802
2002-08-28Removed trailing whitespaces from .h and .c files using theJörg Mayer1-4/+4
winapi_cleanup tool written by Patrik Stridvall for the wine project. svn path=/trunk/; revision=6116