Commit Graph

95 Commits

Author SHA1 Message Date
Guy Harris 7fbf320b8a Patch from Ben Fowler to rename the global variable "cf" to "cfile", to
make it easier to use grep to find all references to it without getting
a lot of false hits and to check, after allocating the memory chunk for
"frame_data" structures, that the allocation succeeded.

svn path=/trunk/; revision=2092
2000-06-27 04:36:03 +00:00
Guy Harris 283ce59938 Add routines for adding items to a protocol tree that take arguments of
a particular type, rather than taking a varargs list, along the lines of
the "proto_tree_add_XXX_format()" routines.

Replace most calls to "proto_tree_add_item()" and
"proto_tree_add_item_hidden()" with calls to those routines.

Rename "proto_tree_add_item()" and "proto_tree_add_item_hidden()" to
"proto_tree_add_item_old()" and "proto_tree_add_item_hidden_old()", and
add new "proto_tree_add_item()" and "proto_tree_add_item_hidden()"
routines that don't take the item to be added as an argument - instead,
they fetch the argument from the packet whose tvbuff was handed to them,
from the offset handed to them.

svn path=/trunk/; revision=2031
2000-05-31 05:09:07 +00:00
Gilbert Ramirez aa553f63ec Convert LAPD and V.120 dissector to use tvbuff. Convert xdlc dissector-helper,
too.

svn path=/trunk/; revision=2030
2000-05-31 03:58:56 +00:00
Guy Harris 10ea13ed18 Add "tvb_reported_length()" to get the "reported length" of a tvbuff
(i.e., the amount of data that was in the packet, even if not all of it
was captured), for use when dissecting packets containing data that
fills the packet (we want the dissector to try to dissect all of it; if
it runs past the end of the captured data, we want it to throw an
exception so that we'll put a "Short Frame" note in the protocol tree).

This means we always want a tvbuff to have a real reported length value,
so we make it an unsigned integer, and don't bother checking it for -1,
as it should never be -1.

If the reported length passed in to "tvb_set_subset()" is -1, set the
reported length to the reported length of the tvbuff of which the new
tvbuff will be a subset minus the offset in that tvbuff of the subset,
so that "-1" means "what's left of the packet after we chop off the
header".  This is necessary in order to ensure that all tvbuffs have a
real reported length value.

Have "dissect_packet()" set the reported length of the top-level tvbuff
to the reported length of the frame, so that we start out with a tvbuff
with a real reported length value.

Have "tvb_offset_exists()" return FALSE if the offset is past the end of
the tvbuff.

If the offset passed to it is postitive, have "compute_offset_length()"
check for that it's not more than one byte past the end of the tvbuff -
if it's just past the end, we don't want the check to fail, as we don't
want attempts to create a subset tvbuff containing zero bytes to fail;
that would be done if a captured packet was all header and no payload,
and we'd want the dissector of the payload, not the dissector of the
header, to throw an exception, as the problem isn't with the protocol
for the header, it's with the protocol for the payload.

Convert the ATM dissector, the SSCOP dissector, the Q.2931 dissector,
and the Q.931 dissector to use tvbuffs.

Make the LAPD dissector set up a tvbuff for the Q.931 dissector (it's
not converted yet).

svn path=/trunk/; revision=2023
2000-05-29 08:57:42 +00:00
Gilbert Ramirez 1c2ca9c39c Convert dissect_clip() to use tvbuffs. Very trivial change.
svn path=/trunk/; revision=2003
2000-05-25 14:55:22 +00:00
Gilbert Ramirez 99efdc9fba Convert LAPB dissector to use tvbuffs, and to get pseudo_header from
packet_info struct.

svn path=/trunk/; revision=2001
2000-05-25 08:45:54 +00:00
Gilbert Ramirez 40c5ed378f Convert dissect_ppp() and friends to use tvbuffs.
(the ip_tcp_options stuff is still non-tvbuff until I convert ip and tcp).

Add preliminary fix for Linux ISDN ippp devices (similar watch was posted
to ethereal-users, but did not use tvbuffs).

Change packet-raw.c to call capture_ppp()/dissect_ppp() in the case
where the frame starts with FF:03. We had been calling
capture_ip()/dissect_ip() at byte offset 4, but I think this is for
historical reasons of packet-raw.c and packet-ip.c existing before
packet-ppp.c.

svn path=/trunk/; revision=1998
2000-05-25 07:42:26 +00:00
Gilbert Ramirez d7e6e0e384 Add wtap-int.h. Move definitions relevant to the internal workins of wiretap
to that file, leave public definitions in wtap.h.

Rename "union pseudo_header" to "union wtap_pseudo_header".
Make the wtap_pseudo_header pointer available in packet_info struct.

svn path=/trunk/; revision=1989
2000-05-19 23:07:04 +00:00
Gilbert Ramirez cd1952d2ec Convert dissect_raw() to use tvbuff's.
svn path=/trunk/; revision=1987
2000-05-19 21:47:38 +00:00
Gilbert Ramirez b263e4934b Add protection against 0-length FT_BYTES being added to proto_tree.
Convert ethertype() and dissect_null() to use tvbuff.

svn path=/trunk/; revision=1979
2000-05-19 04:54:36 +00:00
Guy Harris f3d90d30a4 Remove the "union pseudo_header" from the "frame_data" structure;
there's no need to keep it around in memory - when the frame data is
read in when handing a frame, read in the information, if any, necessary
to reconstruct the frame header, and reconstruct it.  This saves some
memory.

This requires that the seek-and-read function be implemented inside
Wiretap, and that the Wiretap handle remain open even after we've
finished reading the file sequentially.

This also points out that we can't really do X.25-over-Ethernet
correctly, as we don't know where the direction (DTE->DCE or DCE->DTE)
flag is stored; it's not clear how the Ethernet type 0x0805 for X.25
Layer 3 is supposed to be handled in any case.  We eliminate
X.25-over-Ethernet support (until we find out what we're supposed to
do).

svn path=/trunk/; revision=1975
2000-05-18 09:09:50 +00:00
Gilbert Ramirez 9f45a0b0f5 Convert Ethernet and Lucent/Ascend dissectors to use tvbuff.
Note in AUTHORS file that we use the exception module from kazlib.

svn path=/trunk/; revision=1966
2000-05-16 06:21:33 +00:00
Gilbert Ramirez 0a2817ceba Have tvbuff's keep track of cap_len and pkt_len ('length' and 'reported_length'
in tvbuff terminology). This is implemented for TVBUFF_REAL and TVBUFF_SUBSET
so far; support for TVBUFF_COMPOSITE is coming soon.

Throw either ReportedBoundsError or BoundsError.
A ReportedBoundsError is reported as "Malformed Frame" since the protocol
stated that a certain number of bytes should be available but they weren't.
A BoundsError is reported as a "Short Frame" since the snaplen was too short.

Register proto_short (BoundsError) and proto_malformed (ReportedBounds)
so searches can be made on "short" and "malformed".

svn path=/trunk/; revision=1965
2000-05-16 04:44:14 +00:00
Gilbert Ramirez ec3337ed07 Convert token-ring dissector to use tvbuffs.
Modify ethernet dissector to catch BoundsError if the attempt to
create next_tvb with the length specified in the ethernet header throws
an exception. In that case, next_tv is created with as many bytes as
are available in the frame.

Both dissect_tr() and dissect_eth() now have TRY blocks, which means
I had to fiddle with 'volatile' and 'static' storage options to get
things right (at least according to gcc).

svn path=/trunk/; revision=1962
2000-05-15 06:22:07 +00:00
Gilbert Ramirez 0c39c03bf5 Convert LLC dissector to use tvbuffs.
Non-tvbuff dissectors create a tvbuff when calling dissect_llc()
Changed name of current_proto to match string in COL_PROTO ("FDDI" instead of "fddi")
Changed short text to be: [Short Frame: %s]  where %s is current_proto.

svn path=/trunk/; revision=1943
2000-05-11 22:04:18 +00:00
Gilbert Ramirez 292e38e2c6 Add tvbuff class.
Add exceptions routines.
Convert proto_tree_add_*() routines to require tvbuff_t* argument.
Convert all dissectors to pass NULL argument ("NullTVB" macro == NULL) as
the tvbuff_t* argument to proto_tree_add_*() routines.

dissect_packet() creates a tvbuff_t, wraps the next dissect call in
a TRY block, will print "Short Frame" on the proto_tree if a BoundsError
exception is caught.

The FDDI dissector is converted to use tvbuff's.

svn path=/trunk/; revision=1939
2000-05-11 08:18:09 +00:00
Guy Harris 6bbfd97bde Add routines to:
register lists of "heuristic" dissectors, which are handed a
	frame that may or may contain a payload for the protocol they
	dissect, and that return FALSE if it's not or dissect the packet
	and return TRUE if it is;

	add a dissector to such a list;

	go through such a list, calling each dissector until either a
	dissector returns TRUE, in which case the routine returns TRUE,
	or it runs out of entries in the list, in which case the routine
	returns FALSE.

Have lists of heuristic dissectors for TCP and for COTP when used with
the Inactive Subset of CLNP, and add the GIOP and Yahoo Messenger
dissectors to the first list and the Sinec H1 dissector to the second
list.

Make the dissector name argument to "dissector_add()" and
"dissector_delete()" a "const char *" rarther than just a "char *".

Add "heur_dissector_add()", the routine to add a heuristic dissector to
a list of heuristic dissectors, to the set of routines we can export to
plugins through a table on platforms where dynamically-loaded code can't
call stuff in the main program, and initialize the element in the table
in question for "dissector_add()" (which we'd forgotten to do).

svn path=/trunk/; revision=1909
2000-05-05 09:32:36 +00:00
Gilbert Ramirez 17488eec3a Greg Kilfoyle <gregk@redback.com>'s change for detection of compressed
A/C PPP fields.

Get rid of spurious printf() in packet.c.

svn path=/trunk/; revision=1880
2000-04-19 03:28:07 +00:00
Richard Sharpe b064f1e14f Fix up the allocation stuff for the per frame data ...
svn path=/trunk/; revision=1866
2000-04-16 04:56:40 +00:00
Gilbert Ramirez b218a8f550 Consolidate flags in struct frame_data, and add "visited" flag. Use
it in SOCKS dissector.

(Okay, how many times am I going to modify packet.h today, forcing you
to re-compile everything? :-)

svn path=/trunk/; revision=1850
2000-04-13 20:39:38 +00:00
Gilbert Ramirez db187f965c Change the sub-dissector handoff registration routines so that the
sub-dissector table is not stored in the header_field_info struct, but
in a separate namespace. Dissector tables are now registered by name
and not by field ID. For example:

        udp_dissector_table = register_dissector_table("udp.port");

Because of this different namespace, dissector tables can have names
that are not field names.  This is useful for ethertype, since multiple
fields are "ethertypes".

packet-ethertype.c replaces ethertype.c (the name was changed so that it
would be named in the same fashion as all the filenames passed to make-reg-dotc)

Although it registers no protocol or field, it registers one dissector table:

	ethertype_dissector_table = register_dissector_table("ethertype");

All protocols that can be called because of an ethertype field now register
that fact with dissector_add() calls.

In this way, one dissector_table services all ethertype fields
(hf_eth_type, hf_llc_type, hf_null_etype, hf_vlan_etype)

Furthermore, the code allows for names of protocols to exist in the
etype_vals, yet a dissector for that protocol doesn't exist. The name
of the dissector is printed in COL_INFO. You're welcome, Richard. :-)

svn path=/trunk/; revision=1848
2000-04-13 18:18:56 +00:00
Gilbert Ramirez 8bbf14cfce Add #include "plugins.h" to get definition of HAVE_PLUGINS
svn path=/trunk/; revision=1793
2000-04-04 16:33:57 +00:00
Guy Harris c2b1feea05 Turn "ethereal_proto_init()" and "ethereal_proto_cleanup()" into
"dissect_init()" and "dissect_cleanup()", in "packet.c", so that we
don't duplicate those routines in Ethereal and Tethereal (and so on),
and don't have to remember to update N different versions of them if we
have to change the way we do one-time initialization and cleanup.

svn path=/trunk/; revision=1790
2000-04-04 07:03:07 +00:00
Guy Harris f540888bd4 Make a routine that takes a dissector table, a port number, and
pd/offset/fd/tree arguments, looks up the port number in the dissector
table, and:

	if it finds it, call the corresponding dissector routine with
	the pd/offset/fd/tree arguments, and return TRUE;

	if it doesn't find it, return FALSE.

Use that in the TCP and UDP dissectors.

Don't add arbitrary UDP ports for which a dissector is found in the
table as ports that should be dissected as TFTP; this should only be
done if we find a packet going from port XXX to the official TFTP port.

Don't register TFTP in UDP's dissector table, as it has to be handled
specially (i.e., we have to add the source port as a TFTP port, although
we really should register the source port *and* IP address); eventually,
we should move that registration to the TFTP dissector itself, at which
point we can register TFTP normally.

svn path=/trunk/; revision=1785
2000-04-04 05:37:36 +00:00
Gilbert Ramirez 6dd3208cfc Rename find_hfinfo_record() to proto_registrar_get_nth() since
all the other public functions in proto.c start with "proto_".

svn path=/trunk/; revision=1783
2000-04-04 02:34:40 +00:00
Guy Harris c7d11f582d Jeff Foster's patch to support attaching a hash table to a protocol
field, to allow dissectors to register their dissection routine in a
particular field's hash table with a particular "port" value, and to
make the TCP and UDP dissectors support that for their "port" field and
to look up ports in that hash table.

This replaces the hash table that the UDP dissector was using.

There's still more work needed to make this useful - right now, the hash
tables are attached to the protocol field in the register routines for
the TCP and UDP protocols, which means that the register routines for
protocols that run atop TCP and UDP can't use this unless their register
routines happen to be called after those for TCP and/or UDP, and several
other protocols need to attach hash tables to fields, and there's no
single global field for Ethernet types so we can't even attach a hash
table to such a field to allow protocols to register themselves with a
particular Ethertype - but it's a start.

svn path=/trunk/; revision=1779
2000-04-03 09:24:12 +00:00
Gilbert Ramirez 1b25952ad4 Change dissect_ppp() to accept offset.
Change GRE dissector to call dissect_ppp() instead of dissect_payload_ppp().

svn path=/trunk/; revision=1753
2000-03-27 17:53:20 +00:00
Richard Sharpe 73927243e7 Adding definitions of routines ... Will want to get rid of malloc and use
the glib equivalents ...

svn path=/trunk/; revision=1750
2000-03-26 07:59:47 +00:00
Richard Sharpe 92646c4b3c First pass at per frame proto data. Keep each proto block as a GSList list.
Use glib as far as possible. Currently have data structures and routines
defined ... Next will write the routines ...

svn path=/trunk/; revision=1748
2000-03-26 06:57:41 +00:00
Guy Harris 0b8378e622 When dissecting an NFS file handle, show the raw bytes of the file
handle data (snoop does this, and it's somewhat convenient if you're
trying to see whether, say, an ACCESS call is acting on the file whose
file handle you got back from a previous MOUNT request).

Boost the maximum number of bytes worth of hex data shown by
"bytes_to_str()" from 10 to 16, so that we can show the file handle 16
bytes per line (as snoop does).

svn path=/trunk/; revision=1744
2000-03-23 00:38:11 +00:00
Gilbert Ramirez f6e92a9e93 Break proto_tree_add_item_format() into multiple functions:
proto_tree_add_protocol_format()
	proto_tree_add_uint_format()
	proto_tree_add_ipxnet_format()
	proto_tree_add_ipv4_format()
	proto_tree_add_ipv6_format()
	proto_tree_add_bytes_format()
	proto_tree_add_string_format()
	proto_tree_add_ether_format()
	proto_tree_add_time_format()
	proto_tree_add_double_format()
	proto_tree_add_boolean_format()
If using GCC 2.x, we can check the print-format against the variable args
passed in. Regardless of compiler, we can now check at run-time that the
field type passed into the function corresponds to what that function
expects (FT_UINT, FT_BOOLEAN, etc.)

Note that proto_tree_add_protocol_format() does not require a value field,
since the value of a protocol is always NULL. It's more intuitive w/o the
vestigial argument.

Fixed a proto_tree_add_item_format-related bug in packet-isis-hello.c
Fixed a variable usage bug in packet-v120.c. (ett_* was used instead of hf_*)

Checked in Guy's fix for the function declearation for proto_tree_add_text()
and proto_tree_add_notext().

svn path=/trunk/; revision=1713
2000-03-12 04:48:32 +00:00
Gilbert Ramirez ddfa11e870 Create a header file for every packet-*.c file. Prune the packet.h file.
This change allows you to add a new packet-*.c file and not cause a
recompilation of everything that #include's packet.h

Add the plugin_api.[ch] files ot the plugins/Makefile.am packaging list.

Add #define YY_NO_UNPUT 1 to the lex source so that the yyunput symbol
is not defined, squelching a compiler complaint when compiling the generated
C file.

svn path=/trunk/; revision=1637
2000-02-15 21:06:58 +00:00
Gilbert Ramirez 1990d5fb5c Some initial changes for win32 support, but not all.
Added lots of #ifdef HAVE_*_H wrappers.
Added some #defines in config.h.win32
Check for more headers in configure.in
Added prototype for inet_aton() in inet_v6defs.h.
Changed "BYTE" token (i.e., #define) in ascend-gramamr.y because it
conflicts with a windows definition. Use HEXBYTE instead.

svn path=/trunk/; revision=1448
2000-01-10 17:33:17 +00:00
Guy Harris 03f0d99a70 Put the frame number in the text for the top-level tree entry for the
frame.

svn path=/trunk/; revision=1389
1999-12-29 07:37:12 +00:00
Guy Harris de00c78ac8 Move the stuff to fill in those columns not filled in by dissectors from
"file.c" to "packet.c"; it's not really related to file access (or to
manipulating the packet list as a whole, which much of the stuff in
"file.c" is really for), but is more related to analyzing packets, and
moving it to "packet.c" lets me build an experimental "line-mode" flavor
of Ethereal (based on Gilbert's "tethereal" experiment) - "line-mode"
means "like tcpdump or snoop" - without having to drag in "file.c" and a
pile of GUI stuff.

svn path=/trunk/; revision=1388
1999-12-29 07:25:48 +00:00
Gilbert Ramirez 4a15f6582a Added Bert Driehuis <driehuis@playbeing.org>'s I4B wiretap module
and V.120 decoder.

svn path=/trunk/; revision=1304
1999-12-12 22:40:10 +00:00
Gilbert Ramirez d85f804b4b Add the who protocol (rwho/rwhod/ruptime)
In packet_hex_print(), compute (bstart + blen) only once.

In time_secs_to_str(), return a meaningful string when time == 0, instead
of returing pointer to char buffer with old, inappropriate data in it.

svn path=/trunk/; revision=1297
1999-12-12 05:11:57 +00:00
Guy Harris 6492ea79ee Christopher McAvaney's fix to "format_text()" to make it not stomp on
the "..." added if a string is too long.

svn path=/trunk/; revision=1177
1999-12-02 01:33:55 +00:00
Guy Harris ad0cf4f6ef ARP requests with a hardware type of ARPHRD_ATM2225 are ATM ARP
requests, as described in RFC 2225; they do *not* have the same format
as regular ARP requests, so dissect them differently.

Inverse ARP is also used on ATM, so add the Inverse ARP request and
reply message types.  (It's also used with other protocols, e.g. Frame
Relay.)

Handle zero-length addresses (meaning the address is absent).

They can have up to 6 different address fields, so make "bytes_to_str()"
have six static buffers in which it can return strings.

svn path=/trunk/; revision=1123
1999-11-27 04:01:43 +00:00
Gilbert Ramirez 2da6ff3be5 Enable ether name resolution for packet summary lines of IPX packets
(in the src/dst of the CList). In order to do this, I had to:

1. Add a new function, ether_to_str_punct(const guint8*, char) which
	turns a 6-byt ether address into a string, using whatever punctuation
	is passed as the char. If a null char is passed, no separator
	is put between the hex digits. Unresolved IPX addresses look better
	with the ether portion having no punctuation (IMHO)

2. Changed ether_to_str() to call ether_to_str_punct with ':' as the char
	argument. That is, code abstraction.

3. MAXNAMELEN was moved from resolv.c to resolv.h so that packet-ipx.c
	could see it.

4. A new resolve function, get_ether_name_if_known(), returns the resolved name
	of an ether address, or NULL if there is none.  This differs
	from get_ether_name() by returning NULL rather than a text version
	of the ether address.

svn path=/trunk/; revision=1076
1999-11-20 05:35:15 +00:00
Guy Harris 4fddc1f328 Provide a general mechanism by which dissectors can register "init"
routines, which are called before a dissection pass is made over all the
packets in a capture - the "init" routine would clear out any state
information that needs to be initialized before such a dissection pass.

Make the NCP, SMB, AFS, and ONC RPC dissectors register their "init"
routines with that mechanism, have the code that reads in a capture file
call the routine that calls all registered "init" routines rather than
calling a wired-in set of "init" routines, and also have the code that
runs a filtering or colorizing pass over all the packets call that
routine, as a filtering or colorizing pass is a dissection pass.

Have the ONC RPC "init" routine zero out the table of RPC calls, so that
it completely erases any state from the previous dissection pass (so
that, for example, if you run a filtering pass, it doesn't mark any
non-duplicate packets as duplicates because it remembers them from the
previous pass).

svn path=/trunk/; revision=1050
1999-11-17 21:58:33 +00:00
Guy Harris a7aba0a288 Replace the ETT_ "enum" members, declared in "packet.h", with
dynamically-assigned "ett_" integer values, assigned by
"proto_register_subtree_array()"; this:

	obviates the need to update "packet.h" whenever you add a new
	subtree type - you only have to add a call to
	"proto_register_subtree_array()" to a "register" routine and an
	array of pointers to "ett_", if they're not already there, and
	add a pointer to the new "ett_" variable to the array, if they
	are there;

	would allow run-time-loaded dissectors to allocate subtree types
	when they're loaded.

svn path=/trunk/; revision=1043
1999-11-16 11:44:20 +00:00
Gilbert Ramirez 4ec9c54b4b Add LAPD support.
svn path=/trunk/; revision=1004
1999-11-11 05:36:16 +00:00
Guy Harris 5f6c1e26de Have the PROTOCOL field for ONC RPC just give the RPC program
name/number, and put the call/reply info, procedure, and version number
into the INFO field.

Implement "col_append_fstr()", and use it to add information to the info
field.

Make "col_add_fstr()" aware that COL_INFO fields can have more data than
other COL_XXX fields (as "col_add_str()" and "col_append_str()" already
were).

svn path=/trunk/; revision=947
1999-10-29 02:25:54 +00:00
Guy Harris 047b8751f3 Generalize the "ip_src" and "ip_dst" members of the "packet_info"
structure to "dl_src"/"dl_dst", "net_src"/"net_dst", and "src"/"dst"
addresses, where an address is an address type, an address length in
bytes, and a pointer to that many bytes.

"dl_{src,dst}" are the link-layer source/destination; "net_{src,dst}"
are the network-layer source/destination; "{src,dst}" are the
source/destination from the highest of those two layers that we have in
the packet.

Add a port type to "packet_info" as well, specifying whether it's a TCP
or UDP port.

Don't set the address and port columns in the dissector functions; just
set the address and port members of the "packet_info" structure.  Set
the columns in "fill_in_columns()"; this means that if we're showing
COL_{DEF,RES,UNRES}_SRC" or "COL_{DEF,RES,UNRES}_DST", we only generate
the string from "src" or "dst", we don't generate a string for the
link-layer address and then overwrite it with a string for the
network-layer address (generating those strings costs CPU).

Add support for "conversations", where a "conversation" is (at present)
a source and destination address and a source and destination port.  (In
the future, we may support "conversations" above the transport layer,
e.g. a TFTP conversation, where the first packet goes from the client to
the TFTP server port, but the reply comes back from a different port,
and all subsequent packets go between the client address/port and the
server address/new port, or an NFS conversation, which might include
lock manager, status monitor, and mount packets, as well as NFS
packets.)

Currently, all we support is a call that takes the source and
destination address/port pairs, looks them up in a hash table, and:

	if nothing is found, creates a new entry in the hash table, and
	assigns it a unique 32-bit conversation ID, and returns that
	conversation ID;

	if an entry is found, returns its conversation ID.

Use that in the SMB and AFS code to keep track of individual SMB or AFS
conversations.  We need to match up requests and replies, as, for
certain replies, the operation code for the request to which it's a
reply doesn't show up in the reply - you have to find the request with a
matching transaction ID.  Transaction IDs are per-conversation, so the
hash table for requests should include a conversation ID and transaction
ID as the key.

This allows SMB and AFS decoders to handle IPv4 or IPv6 addresses
transparently (and should allow the SMB decoder to handle NetBIOS atop
other protocols as well, if the source and destination address and port
values in the "packet_info" structure are set appropriately).

In the "Follow TCP Connection" code, check to make sure that the
addresses are IPv4 addressses; ultimately, that code should be changed
to use the conversation code instead, which will let it handle IPv6
transparently.

svn path=/trunk/; revision=909
1999-10-22 07:18:23 +00:00
Guy Harris 6f56cbf07e Phil Techau's patch to add "col_append_str()".
svn path=/trunk/; revision=845
1999-10-15 20:33:06 +00:00
Guy Harris 1655671f9a Include <arpa/inet.h>, so we get a declaration of "inet_ntop()" on
systems that declare it there.

svn path=/trunk/; revision=831
1999-10-14 07:39:44 +00:00
Guy Harris ae276ffe20 Make it build on systems lacking "inet_pton()", "inet_ntop()", and a
definition of "AF_INET6".  Declare those functions and, if it's not
defined, define "AF_INET6" in "inet_v6defs.h", and arrange to include
it if "inet_ntop()" is missing.  (Systems will probably have both of
them or lack both of them, and we may choose not to use the system's
"inet_pton()" because it's buggy, so base the decision on whether to
include "inet_v6defs.h" on whether we're using the system's
"inet_ntop()" or not.)  Fix some macro references in "Makefile.am" and
"configure.in".

svn path=/trunk/; revision=830
1999-10-14 06:55:11 +00:00
Jun-ichiro itojun Hagino 831497b33e use inet_pton() and inet_ntop(), which are RFC2553 standard function
for converting IPv[46] numeric notation to/from binary form.
recent BIND includes those functions so fallback is not necessary on
most of the platforms.
sorry if it raises any portability problem on other platforms.

remove partial inclusion of inet_ntop() in packet-ipv6.c.

move ip6_to_str() to packet.c, it fits better there than packet-ipv6.c.

svn path=/trunk/; revision=829
1999-10-14 05:41:33 +00:00
Gilbert Ramirez bacb9d5bae New proto_tree header_field_info stuff. Header_field_infos now contain
the base for numbers to be displayed in, bitmasks for bitfields, and blurbs
(which are one or two sentences describing the field).

proto_tree_add*() routines now automatically handle bitfields. You tell
it which header field you are adding, and just pass it the value of the
entire field, and the proto_tree routines will do the masking and shifting
for you.

This means that bitfields are more naturally filtered via dfilter now.

Added Phil Techau's support for signed integers in dfilters/proto_tree.

Added the beginning of the SNA dissector. It's not complete, but I'm
committing it now because it has example after example of how to use
bitfields with the new header_field_info struct and proto_tree routines.
It was the impetus to change how header_field_info works.

svn path=/trunk/; revision=815
1999-10-12 06:21:15 +00:00