aboutsummaryrefslogtreecommitdiffstats
path: root/packet.h
AgeCommit message (Collapse)AuthorFilesLines
2000-04-13Consolidate flags in struct frame_data, and add "visited" flag. UseGilbert Ramirez1-5/+8
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-13Change the sub-dissector handoff registration routines so that theGilbert Ramirez1-2/+3
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-04Turn "ethereal_proto_init()" and "ethereal_proto_cleanup()" intoGuy Harris1-1/+6
"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-04Make a routine that takes a dissector table, a port number, andGuy Harris1-1/+6
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-2/+1
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-3/+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-26First pass at per frame proto data. Keep each proto block as a GSList list.Richard Sharpe1-1/+10
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-08We already set the foreground and background color for every frame,Guy Harris1-2/+1
which means we're already doing a "do something to the last row in the packet list" operation on every frame we add to the list, so adding a call to "gtk_clist_set_row_data()" won't make matters worse. In addition, we already set one column in a row on a "change time format" operation, so finding the row for a frame by calling "gtk_clist_find_row_from_data()" doesn't turn a constant-time operation into a linear-time operation, it just cranks the proportionality constant up - it was quadratic before, alas, and it's still quadratic. Adding calls to "gtk_clist_find_row_from_data()" to the "Find Frame" and "Go To Frame" code does add an extra linear operation there, but those operations shouldn't be common - and "Go To Frame", going to the last frame on an ~100,000-frame big capture file, was quick, at least on my 450 MHz Pentium II machine, so maybe it won't be too bad. And "select_packet()" either has to search the frame table for the frame with the specified row number, or has to call "gtk_clist_get_row_data()" to do that - the first is linear in the position of the frame in the frame table, and the latter is linear in its position in the CList, and the latter is less than or equal to the former, so the only thing making it worse would be a change in the proportionality constant. So it probably won't hurt performance by much. Furthermore, if we add the ability to sort the display on an arbitrary column, or to delete frames from the display - both of which are in the wish list - storing the row number of the frame in the "frame_data" structure won't necessarily work, as the row number can change out from under us. Therefore, reinstate the old way of doing things, where we associate with each row a pointer to the "frame_data" structure for the row, using "gtk_clist_set_row_data()". svn path=/trunk/; revision=1703
2000-02-18Renamed init_dissect_x25() to reinit_x25_hashtable() and actually used it !Olivier Abad1-2/+1
This function is used to re-initialize the hash table used by the X.25 dissector to record the upper layer protocol used by each VC. The hash table should be re-initialized each time we read / start a new capture. I moved the definition of the function from packet.h to packet-x25.h, and added calls to reinit_x25_hashtable() in read_cap_file (file.c) and do_capture (capture.c). svn path=/trunk/; revision=1644
2000-02-15Create a header file for every packet-*.c file. Prune the packet.h file.Gilbert Ramirez1-166/+5
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-09Dietmar Petras provided:Gilbert Ramirez1-1/+2
* 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-05Dissector for Cisco's Virtual Trunking Protocol.Guy Harris1-1/+2
svn path=/trunk/; revision=1603
2000-02-05Cisco Group Management Protocol dissector.Guy Harris1-1/+2
svn path=/trunk/; revision=1601
2000-01-24Add support for Cisco ISL.Guy Harris1-1/+3
svn path=/trunk/; revision=1537
2000-01-23In "dissect_eth()", update "pi.len" and "pi.captured_len" regardless ofGuy Harris1-18/+17
whether we're building a protocol tree or not. Make "dissect_eth()" use "BYTES_ARE_IN_FRAME()" to see if we have a full Ethernet header - it can be called with a non-zero offset, if Ethernet frames are encapsulated inside other frames (e.g., ATM LANE). Make capture routines take an "offset" argument if the corresponding dissect routine takes one (for symmetry, and for Cisco ISL or any other protocol that encapsulates Ethernet or Token-Ring frames inside other frames). Pass the frame lengths to capture routines via the "pi" structure, rather than as an in-line argument, so that they can macros such as "BYTES_ARE_IN_FRAME()" the way the corresponding dissect routines do. Make capture routines update "pi.len" and "pi.captured_len" the same way the corresponding diseect routines do, if the capture routines then call other capture routines. Make "capture_vlan()" count as "other" frames that are too short, the way other capture routines do. svn path=/trunk/; revision=1525
2000-01-20Joerg Mayer's updates to the VINES dissector and to protocol layersGuy Harris1-1/+3
above VINES. svn path=/trunk/; revision=1514
2000-01-07Add John Thomas' L2TP dissector.Guy Harris1-1/+2
svn path=/trunk/; revision=1433
1999-12-29Move the stuff to fill in those columns not filled in by dissectors fromGuy Harris1-1/+3
"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-15Stuart Stanley's ISIS dissection support.Guy Harris1-1/+2
svn path=/trunk/; revision=1340
1999-12-12Added Bert Driehuis <driehuis@playbeing.org>'s I4B wiretap moduleGilbert Ramirez1-1/+2
and V.120 decoder. svn path=/trunk/; revision=1304
1999-12-12Add the who protocol (rwho/rwhod/ruptime)Gilbert Ramirez1-1/+2
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/+2
svn path=/trunk/; revision=1295
1999-12-09added ldap dissector placeholder, just does request/response for now, until ↵Nathan Neulinger1-1/+2
I have a chance to figure out ASN.1 svn path=/trunk/; revision=1254
1999-12-07James Coe's patch to add SRVLOC and NCP-over-IP support.Guy Harris1-1/+2
svn path=/trunk/; revision=1234
1999-12-06added simple irc dissectorNathan Neulinger1-1/+2
svn path=/trunk/; revision=1232
1999-12-05vlan updates for etype<maxlen and capture countersNathan Neulinger1-1/+2
svn path=/trunk/; revision=1219
1999-12-03added skeletal tacplus/xtacacs dissectorNathan Neulinger1-1/+3
svn path=/trunk/; revision=1191
1999-11-30Add IPX to packet stats during capture.Gilbert Ramirez1-1/+3
svn path=/trunk/; revision=1173
1999-11-29added start of tns dissectorNathan Neulinger1-1/+2
svn path=/trunk/; revision=1155
1999-11-27Pull the code to dissect an ATM NSAP address out of "packet-q2931.c" andGuy Harris1-5/+1
put it into a subroutine in "packet-arp.c", and call it from "packet-q2931.c". Add a "packet-arp.h" header to hold declarations of routines exported by "packet-atm.c" (other than the ATM dissector itself), moving them out of "packet.h". Use the aforementioned NSAP dissector to display ATM addresses in NSAP format, and display E.164 addresses as ASCII text (under the assumption that they're presented as a string of IA5, i.e. ASCII, characters, just as they are in Q.931). svn path=/trunk/; revision=1124
1999-11-23Added Cisco Auto-RP dissector from Heikki Vatiainen <hessu@cs.tut.fi>Gilbert Ramirez1-1/+2
svn path=/trunk/; revision=1099
1999-11-22A "character encoding" variable is now set per packet. The existenceGilbert Ramirez1-1/+8
of SNA in a packet changes the character encoding from the default ASCII to EBCDIC. The hex-printing routines in the GUI code and in the printing code convert to EBCDIC if appropriate. svn path=/trunk/; revision=1089
1999-11-21Added Heikki Vatiainen's <hessu@cs.tut.fi> HSRP dissector.Gilbert Ramirez1-1/+2
svn path=/trunk/; revision=1086
1999-11-21Added Heikki Vatiainen's <hessu@cs.tut.fi> VRRP dissector.Gilbert Ramirez1-1/+2
svn path=/trunk/; revision=1083
1999-11-20Enable ether name resolution for packet summary lines of IPX packetsGilbert Ramirez1-1/+2
(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-19Beginnings of Q.2931 support.Guy Harris1-1/+2
svn path=/trunk/; revision=1068
1999-11-19Add support for SSCOP protocol; dissect signalling AAL packets using it.Guy Harris1-1/+2
It's in a file of its own, as I think there may be, or may have been proposed, non-ATM uses of it as well. svn path=/trunk/; revision=1064
1999-11-17Provide a general mechanism by which dissectors can register "init"Guy Harris1-4/+9
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-17Heikki Vatiainen's SAP (Session Announcement Protocol) dissector.Guy Harris1-1/+2
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-282/+1
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-15Uwe Girlich's patches for nfs,mount,portmap and addition of nlm.Nathan Neulinger1-1/+15
svn path=/trunk/; revision=1034
1999-11-14Move the test to see if something looks like an ONC RPC request or replyGuy Harris1-2/+10
into "dissect_rpc()" itself; it returns TRUE if it is, FALSE if it isn't. svn path=/trunk/; revision=1030
1999-11-14Fixed some more small problems and added support for decodingRichard Sharpe1-1/+3
MS Windows Browser messages. Can decode host announcements now. Still need to decode more. Also need to break the new code out. I also have the Browse tree at the wrong location. Can I get at the parent of the tree somewhere, or do I have to pass it in as a variable? svn path=/trunk/; revision=1024
1999-11-13Add ETT_Q931_IEGilbert Ramirez1-1/+2
svn path=/trunk/; revision=1022
1999-11-11added minimalist MAPI dissector - only determines request/replyNathan Neulinger1-1/+3
svn path=/trunk/; revision=1017
1999-11-11Added mount dissector.Nathan Neulinger1-2/+2
Added stat dissector. Enhancements to portmap dissector. Added rpc_prog_name function to packet-rpc to retrieve the name of an rpc program. This should likely eventually be modified to use the /etc/rpc or rpc.bynumber NIS maps in addition to the programs that are registered within ethereal. svn path=/trunk/; revision=1016
1999-11-11bgp improvements.Jun-ichiro itojun Hagino1-1/+5
- a few more tree types - RFC1771 NLRI printed on advertisements - AS_PATH parsing - lots of small cleanup on printing "byte" vs "bytes" From: Greg Hankins <gregh@cc.gatech.edu> svn path=/trunk/; revision=1015
1999-11-11Add #defines for bits in the LAPD address field and for the LAPD SAPIGuy Harris1-1/+3
values. Dissect the LAPD payload, if present. Add the beginnings of a Q.931 dissector. svn path=/trunk/; revision=1007
1999-11-11Add LAPD support.Gilbert Ramirez1-1/+4
svn path=/trunk/; revision=1004
1999-11-10Added dissect_imap() prototype to get rid of compilation warningGilbert Ramirez1-1/+2
in packet-tcp.c svn path=/trunk/; revision=999