Commit Graph

69 Commits

Author SHA1 Message Date
Guy Harris 25bead5edf Not all compilers support unnamed struct/union fields within
structs/unions (GCC supports it "for compatibility with other
compilers"; presumably that's not for compatibility with the version of
Sun C that rejected it - was that a PCCism?).

svn path=/trunk/; revision=18072
2006-05-02 18:02:08 +00:00
Ronnie Sahlberg 93471988aa rename se_tree_lookup32_less_than_or_equal()
to se_tree_lookup32_le()


svn path=/trunk/; revision=17664
2006-03-18 09:01:42 +00:00
Ronnie Sahlberg c4c2ce2606 add new se_tree_lookup32_less_than_or_equal() call
svn path=/trunk/; revision=17663
2006-03-18 06:15:39 +00:00
Ronnie Sahlberg 27de4cfd39 give se_trees names so that it is easier to debug and to log how often certain trees are accessed
svn path=/trunk/; revision=17587
2006-03-11 13:02:41 +00:00
Luis Ontanon 65f5262bb6 Rename set_string_hash... into se_tree_xxx_string as proposed by ronnie for consistency whith its real nature.
svn path=/trunk/; revision=17496
2006-03-07 14:10:30 +00:00
Luis Ontanon 8dbad83e5c Add a hash table with string keys based on the red/black tree.
svn path=/trunk/; revision=17485
2006-03-07 01:15:29 +00:00
Ronnie Sahlberg 745994c364 add helper to build (red/black) trees from a key that is a vector of guin32 arrays.
test this functionality by calling these vector insert/lookup tree functions from the nfs dissector for when filehandles are used as a key.

these vector functions could also be used to efficiently store conversations :
se_tree_key_t[6] = {
	{ addr_len/4,   &src_addr },
	{ addr_len/4,	&dst_addr },
	{ 1,		&src_port32 },
	{ 1,		&dst_port32 },
	{ 1,		&protocol32 },
	{ 0, NULL }
}


(the nfs dissector needs a LOT of work. It is very painful to work with 
very large nfs traces with all the memory it wastes (and eats) as well as how slow all the tables make it)



svn path=/trunk/; revision=17477
2006-03-06 10:25:19 +00:00
Ronnie Sahlberg 0881211a12 initial implementation of binary tree support with se allocation scope
this is to test out a basic implementation of binary trees and the api required for the helpers


svn path=/trunk/; revision=17467
2006-03-05 04:01:34 +00:00
Guy Harris 58ed459c33 Have the emem.c memdup routines accept and return "void *", as
"memcpy()" does; that eliminates some compiler warnings ("void *" is the
type usually used for "generic pointer").

svn path=/trunk/; revision=17297
2006-02-14 08:34:20 +00:00
Guy Harris 67b91b5163 Add "ep_strdup_vprintf()" and "se_strdup_vprintf()", for completeness.
Make them not reuse a va_list; there's no guarantee that it can be
used more than once and, in fact, on some platforms, you *can't* use it
more than once.  Based on a patch by Pekka Pietikainen.

Clean up indentation a bit.

svn path=/trunk/; revision=16174
2005-10-10 08:24:56 +00:00
Luis Ontanon 9860d26c68 emem.[ch]:
Add a simple stack implememtation that uses ep_alloc
Add ep_new() ep_new0() macros

tpg.[ch]:
use the stack in tpg helpers


svn path=/trunk/; revision=16061
2005-10-01 10:36:57 +00:00
Guy Harris 3d2efed254 Tag ep_strdup_printf() and se_strdup_printf() as printf-like functions,
so we get compile-time checking of arguments when possible.

svn path=/trunk/; revision=15813
2005-09-15 08:54:56 +00:00
Luis Ontanon 158ada58b3 se_alloc not ep_alloc!
svn path=/trunk/; revision=15365
2005-08-16 01:01:17 +00:00
Luis Ontanon 0de8a67599 more allocators se_alloc0() se_memdups() se_strdup() se_strndup() se_strdup_printf()
svn path=/trunk/; revision=15364
2005-08-16 00:55:08 +00:00
Ronnie Sahlberg 055e2596d9 Add beginning of seasonal allocation in addition to the existing ephemeral ones.
svn path=/trunk/; revision=15301
2005-08-12 08:51:08 +00:00
Luis Ontanon c5688891a1 new functions:
ep_tvb_memdup()
ep_alloc0()
ep_strsplit()

add all of the ep_ allocators to libethereal.def

svn path=/trunk/; revision=15100
2005-07-26 18:32:12 +00:00
Luis Ontanon d9c2273262 add some utility functions that use ep_alloc instead of g_malloc.
ep_memdup
ep_strdup
ep_strndup
ep_strdup_printf


svn path=/trunk/; revision=15018
2005-07-24 00:29:57 +00:00
Jörg Mayer 5731769818 Set svn:keywords and svn:eol-style
svn path=/trunk/; revision=14996
2005-07-22 17:55:47 +00:00
Ronnie Sahlberg c841beb71b EMEM : a simple and FAST api to allocate memory that will be automatically freed() when the next packet is dissected.
This offesr memory allocation with a packet  scope making memory leaks less likely and memory management faster.


Add initialization calls for both tethereal and ethereal.

Convert the ip_to_str() function to use this and avoid doing the silly rotating buffers thing it previously did.


We also need an equivalent set of functions for allocation with capture file scope (free when next capture is loaded) but i dont know where to put the free_all call.



svn path=/trunk/; revision=14984
2005-07-22 07:46:58 +00:00