aboutsummaryrefslogtreecommitdiffstats
path: root/packet-udp.c
AgeCommit message (Collapse)AuthorFilesLines
2000-04-14Change dfilter_apply() to 4-argument function. 4th argument is not yet used,Gilbert Ramirez1-2/+2
but will be in the future, and it's easier for me to keep my local branch in sync with the source with the calls to dfilter_apply() already modified tothe 4-arg format. Add a CPP macro to ipv4.h to define ipv4_addr_ne(). Use it in dfilter.c svn path=/trunk/; revision=1854
2000-04-13Change the sub-dissector handoff registration routines so that theGilbert Ramirez1-2/+2
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-12Jeff Foster's SOCKS dissector, support for associating dissectorsGuy Harris1-42/+70
with conversations and having TCP and UDP check whether a packet is part of a conversation with a dissector and, if so, using that dissector on the conversation, and "ethertype()"-style support for allowing a dissector to call a sub-dissector via the same path that the TCP and UDP dissectors use, based on port numbers supplied by that dissector. svn path=/trunk/; revision=1837
2000-04-08Move calls to "dissector_add()" out of the register routines for TCP andGuy Harris1-79/+1
UDP and into the handoff registration routines for the protocols in question. Make the dissectors for those protocols static if they're not called outside the dissector's source file. Get rid of header files if all they did was declare dissectors that are now static; remove declarations of now-static dissectors from header files that do more than just declare the dissector. svn path=/trunk/; revision=1823
2000-04-04Add a test to check if there is at least one enabled plugin before searchingOlivier Abad1-2/+2
the plugin list. svn path=/trunk/; revision=1798
2000-04-04Make "make-reg-dotc" generate a "register_all_protocol_handoffs()"Guy Harris1-4/+1
routine, which calls all routines found in the dissector source files with names that match " proto_reg_handoff_[a-z_0-9A-Z]*". Call "register_all_protocol_handoffs()" after calling "register_all_protocols()" - "register_all_protocols()" needs to be called first, so that all protocols can register their fields, because registering a dissector as being called if field "proto.port" is equal to N requires that "proto.port" be a registered field. Give DNS a handoff registration routine, and register its dissector to be called if "udp.port" is UDP_PORT_DNS; remove the registration of DNS from "packet-udp.c", and make "dissect_dns()" static (as nobody else need know that it exists). svn path=/trunk/; revision=1788
2000-04-04Do all the UDP port numbers that we can, and that don't require specialGuy Harris1-44/+27
processing (as TFTP does), and don't have comments suggesting that extra checks are needed, with the port table. svn path=/trunk/; revision=1786
2000-04-04Make a routine that takes a dissector table, a port number, andGuy Harris1-23/+5
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-03Move the creation of, and registration of protocols known to UDP in, theGuy Harris1-17/+18
hash table attached to "udp.port" out of "init_dissect_udp()" into "proto_register_udp()", so that it's done the way TCP does it, and then get rid of "init_dissect_udp()". svn path=/trunk/; revision=1781
2000-04-03Jeff Foster's patch to support attaching a hash table to a protocolGuy Harris1-94/+19
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-03-12Break proto_tree_add_item_format() into multiple functions:Gilbert Ramirez1-4/+4
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-02-23New dissector for DHIS (Dynamic Host Information Services) protocol.Olivier Abad1-1/+6
This protocol is UDP based and uses ports 58800 and 58801. svn path=/trunk/; revision=1667
2000-02-15Create a header file for every packet-*.c file. Prune the packet.h file.Gilbert Ramirez1-2/+29
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-09The time protocol is a simple request-response protocol, and doesn't endGuy Harris1-2/+1
up involving two ports neither of which is the official port; remove the comment saying a dynamic call is added, as the code wasn't adding such a call. svn path=/trunk/; revision=1611
2000-02-09Dietmar Petras provided:Gilbert Ramirez1-1/+5
* fix a bug in packet-tftp.c dissecting TFTP Option Acknowledgement packets. The is no Block-Id in TFTP Option Acknowledgements, as it is in TFTP Acknowledgements. * Extension of manuf by ethernet addresses from ELSA (my company), a german vendor of ISDN routers, cable modems, etc. * New dissector for Time Protocol [RFC 0868]. That protocol works on port 37 of UDP and TCP. The implementation in this patch only dissects the more usual UDP version. It could print the time in a more fashion way, but thats for a later version. svn path=/trunk/; revision=1609
2000-02-01Dissect packets to or from port 162 as SNMP packets - that's the port toGuy Harris1-2/+3
which SNMP traps are sent. Thanks and a tip of the Hatlo Hat to Craig Rodrigues for discovering this. svn path=/trunk/; revision=1589
2000-01-15Merge in the final code to make Ethereal run on Win32, compiledGilbert Ramirez1-4/+2
with MSVC 6.0 and 'nmake', the make tool that comes with MSVC. It compiles, links, and runs. It doesn't run correctly. There's a problem when reading files. I'm getting short reads. I'm not linking in zlib or libsnmp because it first needs to be debugged. I changed the plugin code to use gmodule instead of libltdl, but the Unix build still links ethereal against libltdl. I'll fix that tonight; sorry about leaving it in such a sad state, but I wanted to check in this code before I left work on a Friday night. Ethereal still works, but the building is less than optimal. svn path=/trunk/; revision=1479
2000-01-07Add John Thomas' L2TP dissector.Guy Harris1-1/+4
svn path=/trunk/; revision=1433
1999-12-12Add the who protocol (rwho/rwhod/ruptime)Gilbert Ramirez1-1/+4
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-12WCCP 1.0 dissection, from Jerry Talkington.Guy Harris1-1/+4
svn path=/trunk/; revision=1295
1999-12-09plugins support (i.e. Dynamically loadable dissectors)Olivier Abad1-2/+24
depends on dlopen() being available on the target platform svn path=/trunk/; revision=1263
1999-12-07James Coe's patch to add SRVLOC and NCP-over-IP support.Guy Harris1-1/+7
svn path=/trunk/; revision=1234
1999-12-05As per Nathan Leulinger's suggestion, have a stub SNMP dissector ifGuy Harris1-3/+1
there are no SNMP libraries to use in a real dissector; this means that other dissectors don't have to care if there are SNMP libraries, they can just call "dissect_snmp()" - and this also simplifies "Makefile.am" and "configure.in" a bit, as they just treat "packet-snmp.c" and "packet-snmp.h" the same way they treat other dissector source files. svn path=/trunk/; revision=1214
1999-12-03added skeletal tacplus/xtacacs dissectorNathan Neulinger1-2/+3
svn path=/trunk/; revision=1191
1999-11-23Added Cisco Auto-RP dissector from Heikki Vatiainen <hessu@cs.tut.fi>Gilbert Ramirez1-1/+3
svn path=/trunk/; revision=1099
1999-11-21Added Heikki Vatiainen's <hessu@cs.tut.fi> HSRP dissector.Gilbert Ramirez1-1/+3
svn path=/trunk/; revision=1086
1999-11-17Heikki Vatiainen's SAP (Session Announcement Protocol) dissector.Guy Harris1-1/+3
Rename the dissector for the Netware SAP protocol to "dissect_ipxsap()", so as to keep its name from colliding with that of the dissector for the Session Announcement Protocol. svn path=/trunk/; revision=1046
1999-11-16Replace the ETT_ "enum" members, declared in "packet.h", withGuy Harris1-9/+14
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-14Move the test to see if something looks like an ONC RPC request or replyGuy Harris1-49/+6
into "dissect_rpc()" itself; it returns TRUE if it is, FALSE if it isn't. svn path=/trunk/; revision=1030
1999-10-29Uwe Girlich's ONC RPC and NFS dissectors.Guy Harris1-1/+50
svn path=/trunk/; revision=945
1999-10-24Kojak's ICQ dissector.Guy Harris1-2/+5
svn path=/trunk/; revision=919
1999-10-22Generalize the "ip_src" and "ip_dst" members of the "packet_info"Guy Harris1-27/+20
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-20Added Nathan's patch for AFS and RX dissection.Gilbert Ramirez1-1/+8
svn path=/trunk/; revision=894
1999-10-15Nathan Neulinger's patch to set "pi.srcport" and "pi.dstport".Guy Harris1-1/+4
svn path=/trunk/; revision=844
1999-10-14Nathan Neulinger's NTP dissector.Guy Harris1-1/+4
svn path=/trunk/; revision=828
1999-10-12Jun-ichiro itojun Hagino's changes for IPv6 extension header decodingGuy Harris1-2/+5
and RIPng decoding. svn path=/trunk/; revision=818
1999-10-12New proto_tree header_field_info stuff. Header_field_infos now containGilbert Ramirez1-6/+11
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-02Check for truncated header.Laurent Deniel1-2/+6
svn path=/trunk/; revision=752
1999-09-14Peter Torvals' Internet Cache Protocol dissector.Guy Harris1-2/+4
svn path=/trunk/; revision=677
1999-08-18Declare the "packet_info" structure "pi" in "packet.h", rather than in aGuy Harris1-7/+2
bunch of source files. Replace the "payload" field of a "packet_info" structure with "len" and "captured_len" fields, which contain the total packet length and total captured packet length (including all headers) at the current protocol layer (i.e., if a given layer has a length field, and that length field says its shorter than the length we got from the capture, reduce the "pi.len" and "pi.captured_len" values appropriately). Those fields can be used in the future if we add checks to make sure a field we're extracting from a packet doesn't go past the end of the packet, or past the captured part of the packet. Get rid of the additional payload argument to some dissection functions; use "pi.captured_len - offset" instead. Have the END_OF_FRAME macro use "pi.captured_len" rather than "fd->cap_len", so that "dissect the rest of the frame" becomes "dissect the rest of the packet", and doesn't dissect end-of-frame padding such as padding added to make an Ethernet frame 60 or more octets long. (We might want to rename it END_OF_PACKET; if we ever want to label the end-of-frame padding for the benefit of people curious what that extra gunk is, we could have a separate END_OF_FRAME macro that uses "fd->cap_len".) svn path=/trunk/; revision=506
1999-08-05"packet-udp.c" and "packet-x25.c" both have global variables namedGuy Harris1-2/+2
"hash_table", but each of them is used only in the file in question; make them static, so that they don't collide. svn path=/trunk/; revision=440
1999-07-22Converted UDP fields to new proto_tree functions.Gilbert Ramirez1-8/+46
svn path=/trunk/; revision=376
1999-07-08Added Johan's RADIUS dissector, finally. I modified it to fit in with theGilbert Ramirez1-1/+10
new proto_tree routines. I also removed the check for lex and yacc from wiretap's configure script. The IP dissector now uses proto_register_field_array(). svn path=/trunk/; revision=348
1999-07-07Created a new protocol tree implementation and a new display filterGilbert Ramirez1-8/+7
mechanism that is built into ethereal. Wiretap is now used to read all file formats. Libpcap is used only for capturing. svn path=/trunk/; revision=342
1999-06-25When checking to see if a packet is of a given type by checking theGuy Harris1-25/+14
source and destination port numbers, check both port numbers against the specified port, rather than checking the lower of the two port numbers against the specified port, just in case you happen to either have 1) the port number for that type being high enough that you can get client sockets using it or 2) client sockets using it for some other reason. svn path=/trunk/; revision=333
1999-06-11Added PPPoE, PPTP, GRE, and ISAKMP dissectors.Gilbert Ramirez1-1/+5
svn path=/trunk/; revision=303
1999-05-12Added Didier Jorand's dissect_snmp routine. This is only compiled inGilbert Ramirez1-1/+7
if you have the UCD or CMU SNMP library available. If you have the SNMP library but do not with to have SNMP support, use the ./configure --disable-snmp option. Otherwise 'configure' finds the SNMP library and uses it. svn path=/trunk/; revision=281
1999-05-10Decode SMB requests inside NetBIOS Datagram Service packets.Guy Harris1-2/+7
svn path=/trunk/; revision=269
1999-03-23Removed all references to gtk objects from packet*.[ch] files. They nowGilbert Ramirez1-19/+38
reference the protocol tree with struct proto_tree and struct proto_item objects. That way, the packet decoding source code file can be used with non-gtk packet decoders, like a curses-based ethereal, e.g. I also re-arranged some of the information in packet.h to more appropriate places (like other packet-*.[ch] files). svn path=/trunk/; revision=223
1999-03-01Small fixes for alignment, and #include for gtk+-1.1.x/glib-1.1.xGilbert Ramirez1-1/+2
svn path=/trunk/; revision=197