aboutsummaryrefslogtreecommitdiffstats
path: root/packet-osi.c
AgeCommit message (Collapse)AuthorFilesLines
2004-07-18Move dissectors to epan/dissectors directory.gram1-305/+0
Also move ncp222.py, x11-fields, process-x11-fields.pl, make-reg-dotc, and make-reg-dotc.py. Adjust #include lines in files that include packet-*.h files. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11410 f5534014-38df-0310-8fa8-9805f1628bb7
2004-07-18Set the svn:eol-style property on all text files to "native", so thatguy1-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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11400 f5534014-38df-0310-8fa8-9805f1628bb7
2003-09-20From Akira Endoh: handle the NLPID for PPP.guy1-2/+12
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8500 f5534014-38df-0310-8fa8-9805f1628bb7
2003-06-10Add support for some additional SAPs for Netware and OSI.guy1-3/+7
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7824 f5534014-38df-0310-8fa8-9805f1628bb7
2003-05-15From Laurent Rabret:guy1-2/+95
fix a bug where bad IPv4 and IPv6 prefix lengths could cause a buffer overflow; check the checksum in LSP packets. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7675 f5534014-38df-0310-8fa8-9805f1628bb7
2003-04-29Don't export "osinl_subdissector_table" or "ppp_subdissector_table" -guy1-2/+2
have other dissectors that use them fetch them with "find_dissector_table()". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7601 f5534014-38df-0310-8fa8-9805f1628bb7
2003-02-24From Laurent Meyer: NLPID for Subnetwork Dependent Convergence Function.guy1-1/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7191 f5534014-38df-0310-8fa8-9805f1628bb7
2003-01-26Update my email address in various places since my old one no longer worksdeniel1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7003 f5534014-38df-0310-8fa8-9805f1628bb7
2003-01-11Add a new "chdlctypes.h" file for Cisco HDLC type values that aren'tguy1-3/+3
just Ethernet type values. Move the type value for ISO network-layer protocols there, and put the type value for IEEE spanning tree there as well, use that value in the BPDU dissector, and add an item to the CHDLC dissector for it. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6915 f5534014-38df-0310-8fa8-9805f1628bb7
2002-09-20From Hannes Gredler: Support OSI over CHDLCsahlberg1-1/+3
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6308 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-28Removed trailing whitespaces from .h and .c files using thejmayer1-5/+5
winapi_cleanup tool written by Patrik Stridvall for the wine project. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6117 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-02Replace the types from sys/types.h and netinet/in.h by their glib.hjmayer1-8/+4
equivalents for the toplevel directory. The removal of winsock2.h will hopefully not cause any problems under MSVC++, as those files using struct timeval still include wtap.h, which still includes winsock2.h. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5932 f5534014-38df-0310-8fa8-9805f1628bb7
2002-01-21Include files from the "epan" directory and subdirectories thereof withguy1-2/+2
"epan/..." pathnames, so as to avoid collisions with header files in any of the directories in which we look (e.g., "proto.h", as some other package has its own "proto.h" file which it installs in the top-level include directory). Don't add "-I" flags to search "epan", as that's no longer necessary (and we want includes of "epan" headers to fail if the "epan/" is left out, so that we don't re-introduce includes lacking "epan/"). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4586 f5534014-38df-0310-8fa8-9805f1628bb7
2001-12-10Move the pointer to the "column_info" structure in the "frame_data"guy1-9/+9
structure to the "packet_info" structure; only stuff that's permanently stored with each frame should be in the "frame_data" structure, and the "column_info" structure is not guaranteed to hold the column values for that frame at all times - it was only in the "frame_data" structure so that it could be passed to dissectors, and, as all dissectors are now passed a pointer to a "packet_info" structure, it could just as well be put in the "packet_info" structure. That saves memory, by shrinking the "frame_data" structure (there's one of those per frame), and also lets us clean up the code a bit. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4370 f5534014-38df-0310-8fa8-9805f1628bb7
2001-12-08Attach a descriptive name field type and base to dissector tables; thatguy1-2/+3
specifies how the selector values used as keys in those tables are to be displayed, and the title to use when displaying the table. Use that information in the code to display the initial and current entries of various dissector tables. Have the dissector for BACnet APDUs register itself by name, and have the BACnet NPDU dissector call it iff the BAC_CONTROL_NET bit isn't set, rather than doing it with a dissector table. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4358 f5534014-38df-0310-8fa8-9805f1628bb7
2001-12-03Make "dissector_add()", "dissector_delete()", and "dissector_change()"guy1-6/+8
take a dissector handle as an argument, rather than a pointer to a dissector function and a protocol ID. Associate dissector handles with dissector table entries. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4308 f5534014-38df-0310-8fa8-9805f1628bb7
2001-12-02An NLPID of 1 means T.70 when used as an X.263/ISO 9577 initial protocolguy1-2/+10
identifier, but means X.29 when used as an X.263/ISO 9577 secondary protocol identifier. Add support for the IPv6 NLPID, and Ethernet type, in more places. Fix up the handling of the user data of a CALL REQUEST packet to more correctly distinguish between user data containing an NLPID and user data containing an X.264/ISO 11570 UN TPDU. If it's an NLPID, use "nlpid_vals" to show its value. Put that user data in a subtree. Create a new "x.25.spi" dissector table, for protocols running atop X.25, rather than having a built-in switch statement, so that other protocols can register themselves by NLPID. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4300 f5534014-38df-0310-8fa8-9805f1628bb7
2001-11-29Add support for OSI CLNP over GRE, as per mail from Mrmcsnoots@aol.com.guy1-1/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4297 f5534014-38df-0310-8fa8-9805f1628bb7
2001-11-25Moved from using dissect_data to using call_dissector()hagbard1-4/+6
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4264 f5534014-38df-0310-8fa8-9805f1628bb7
2001-09-14Make the resolution for time values be nanoseconds rather thanguy1-2/+2
microseconds. Fix some "signed vs. unsigned" comparison warnings. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3934 f5534014-38df-0310-8fa8-9805f1628bb7
2001-06-05Correctly compute the OSI checksum.guy1-15/+41
Have "calc_checksum()" just return an indication of the status of the checksum. Check the CLNP header checksum, and put display its status. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3514 f5534014-38df-0310-8fa8-9805f1628bb7
2001-04-16Assorted ISIS enhancements from Hannes Gredler.guy1-1/+2
When dissecting the ISIS NLPID CLV, use the "nlpid_vals" array to convert NLPID values to protocol names. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3308 f5534014-38df-0310-8fa8-9805f1628bb7
2001-04-08OSI network layer over PPP support, fix to P2P ISIS processing, and ISISguy1-1/+3
hostname TLV support, from Hannes Gredler. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3271 f5534014-38df-0310-8fa8-9805f1628bb7
2001-04-01Moved some definitions and functions from packet-osi.{c,h} tohagbard1-128/+1
epan/osi-utils.{c,h} to bring all of the epan dependencies into epan. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3226 f5534014-38df-0310-8fa8-9805f1628bb7
2001-03-30NLPID's of 0x08 and 0x09 should be labeled as Q.933 and LMI,guy1-5/+5
respectively, not Q.931 and Q.2931, in Frame Relay. When dissecting Q.933-style multiprotocol encapsulated Frame Relay frames, use the "osinl" dissector table to check for OSI network layer protocols, include the NLPID in the tvbuff you hand to "dissector_try_port()" with that dissector table, and put the NLPID into the protocol tree as an invisible item - the NLPID is considered part of the PDU for those protocols, so you have to include it in the tvbuff, and the dissector will put it into the protocol tree. Also, make sure the top-level entry for the Frame Relay protocol includes all the bytes preceding the payload, and none of the payload bytes. Export a routine to do Q.933-style dissection, and have the WCP dissector call it, rather than duplicating that code in the WCP dissector. Don't register OSI network layer protocols with the "fr.ietf" dissector table; it's now sufficient to register them with the "osinl" dissector table, as the Frame Relay dissector now checks that. Get rid of unnecessary checks for protocols being enabled (if the dissector is always called through handles or dissector tables, the common code for handles and dissector tables will do the checks for you). Get rid of some unnecessary #includes. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3211 f5534014-38df-0310-8fa8-9805f1628bb7
2001-03-29Add WCP to the list of Ethernet types in "etype_vals[]", and addguy1-1/+2
"compressed" to the list of NLPIDs in "nlpid_vals[]". Use "nlpid_vals" for the Frame Relay NLPID field. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3206 f5534014-38df-0310-8fa8-9805f1628bb7
2001-01-09Add an additional "protocol index" argument to "{old_}dissector_add()",guy1-3/+3
"{old_}heur_dissector_add()", "{old_}conv_dissector_add()", and "register_dissector()", so that an entry in those tables has associated with it the protocol index of the protocol the dissector handles (or -1, if there is no protocol index for it). This is for future use in a number of places. (Arguably, "proto_register_protocol()" should take a dissector pointer as an argument, but 1) it'd have to handle both regular and heuristic dissectors; 2) making it take either a "dissector_t" or a union of that and a "heur_dissector_t" introduces some painful header-file interdependencies so I'm punting on that for now. As with other Ethereal internal APIs, these APIs are subject to change in the future, at least until Ethereal 1.0 comes out....) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2849 f5534014-38df-0310-8fa8-9805f1628bb7
2000-11-19For each column, have both a buffer into which strings for that columnguy1-4/+4
can be put, and a pointer to the string for the column, which might or might not point to that buffer. Add a routine "col_set_str()", which sets the string for the column to the string passed to it as an argument; it should only be handed a static string (a string constant would be ideal). It doesn't do any copying, so it's faster than "col_add_str()". Make the routines that append to columns check whether the pointer to the string for the column points to the buffer for the column and, if not, copy the string for the column to the buffer for the column so that you can append to it (so you can use "col_set_str()" and then use "col_append_str()" or "col_append_fstr()"). Convert a bunch of "col_add_str()" calls that take a string constant as an argument to "col_set_str()" calls. Convert some "col_add_fstr()" calls that take a string constant as the only argument - i.e., the format string doesn't have any "%" slots into which to put strings for subsequent arguments to "col_set_str()" calls (those calls are just like "col_add_str()" calls). Replace an END_OF_FRAME reference in a tvbuffified dissector with a "tvb_length(tvb)" call. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2670 f5534014-38df-0310-8fa8-9805f1628bb7
2000-11-19Register the OSI transport dissector by name, and make it static.guy1-2/+1
"packet-clnp.h" no longer exports anything, so remove it. Have the X.25 dissector call subdissectors through dissector handles (now that all the dissectors it uses are registered by name). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2668 f5534014-38df-0310-8fa8-9805f1628bb7
2000-11-18Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSIguy1-25/+34
ESIS dissectors. Register the IP dissector and have dissectors that call it directly (rather than through a port table) call it through a handle. Add a routine "tvb_set_reported_length()" which a dissector can use if it was handed a tvbuff that contains more data than is actually in its part of the packet - for example, handing a padded Ethernet frame to IP; the routine sets the reported length of the tvbuff (and also adjusts the actual length, as appropriate). Then use it in IP. Given that, "ethertype()" can determine how much of the Ethernet frame was actually part of an IP datagram (and can do the same for other protocols under Ethernet that use "tvb_set_reported_length()"; have it return the actual length, and have "dissect_eth()" and "dissect_vlan()" use that to mark trailer data in Ethernet II frames as well as in 802.3 frames. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2658 f5534014-38df-0310-8fa8-9805f1628bb7
2000-11-17Give the "null" link-layer header dissector a dissector table, and putguy1-1/+3
the BSD AF_ type values it uses into an "aftypes.h" header file for dissectors that register themselves in that dissector table include. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2653 f5534014-38df-0310-8fa8-9805f1628bb7
2000-08-07Allow either old-style (pre-tvbuff) or new-style (tvbuffified)guy1-6/+6
dissectors to be registered as dissectors for particular ports, registered as heuristic dissectors, and registered as dissectors for conversations, and have routines to be used both by old-style and new-style dissectors to call registered dissectors. Have the code that calls those dissectors translate the arguments as necessary. (For conversation dissectors, replace "find_conversation_dissector()", which just returns a pointer to the dissector, with "old_try_conversation_dissector()" and "try_conversation_dissector()", which actually call the dissector, so that there's a single place at which we can do that translation. Also make "dissector_lookup()" static and, instead of calling it and, if it returns a non-null pointer, calling that dissector, just use "old_dissector_try_port()" or "dissector_try_port()", for the same reason.) This allows some dissectors that took old-style arguments and immediately translated them to new-style arguments to just take new-style arguments; make them do so. It also allows some new-style dissectors not to have to translate arguments before calling routines to look up and call dissectors; make them not do so. Get rid of checks for too-short frames in new-style dissectors - the tvbuff code does those checks for you. Give the routines to register old-style dissectors, and to call dissectors from old-style dissectors, names beginning with "old_", with the routines for new-style dissectors not having the "old_". Update the dissectors that use those routines appropriately. Rename "dissect_data()" to "old_dissect_data()", and "dissect_data_tvb()" to "dissect_data()". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2218 f5534014-38df-0310-8fa8-9805f1628bb7
2000-04-17Register an "osinl" dissector table for ISO/IEC TR 9577 NLPID values,guy1-11/+16
and have dissectors for protocols that run at the OSI network layer register themselves with it using "dissector_add()". Make various dissectors static if they can be, and remove from header files declarations of those dissectors. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1873 f5534014-38df-0310-8fa8-9805f1628bb7
2000-04-17Register a "llc.dsap" dissector table for 802.2 LLC, and have dissectorsguy1-2/+8
for protocols that run inside 802.2 LLC register themselves with it using "dissector_add()". Make various dissectors static if they can be, and remove from header files declarations of those dissectors. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1872 f5534014-38df-0310-8fa8-9805f1628bb7
2000-04-16 Remove TODO comments about NSAP and ISIS decodings sincedeniel1-8/+1
this is implemented now. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1868 f5534014-38df-0310-8fa8-9805f1628bb7
2000-04-15Ralf Schneider's changes to enhance to OSI CLNP, CLTP, and ISIS supportguy1-1732/+132
and to add OSI ESIS support. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1865 f5534014-38df-0310-8fa8-9805f1628bb7
2000-04-15In the COTP dissector, don't forcibly set the protocol to COTP if weguy1-7/+10
find a COTP PDU - we might have called a subdissector, which would have set the protocol itself. Do so only if we've not seen any DT PDUs on which we've called a subdissector. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1864 f5534014-38df-0310-8fa8-9805f1628bb7
2000-04-15Alas, one can't count on CLNP packets with a destination NSEL of 0x21guy1-17/+31
being COTP packets, so we make "dissect_cotp_internal()" return FALSE if it saw no valid COTP packets, and return TRUE and set the COL_PROTOCOL field to COTP if it saw at least one valid COTP packet, and have "dissect_cotp()" dissect the packet as raw data if "dissect_cotp_internal()" returns FALSE (for the benefit of callers such as X.25). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1861 f5534014-38df-0310-8fa8-9805f1628bb7
2000-04-15If an NPDU contains multiple concatenated TPDUs, dissect all of them.guy1-102/+125
Fix up some spacing problems in the INFO field of CLNP packets. Dissect only the payload of DT and MD NPDUs as COTP; the payload of other packets isn't to be so dissected (ER NPDUs are like ICMP error packets, in that they contain the network-layer header and zero or more bytes of the payload of the offending packet, for example). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1860 f5534014-38df-0310-8fa8-9805f1628bb7
2000-04-13Set the COL_PROTOCOL column to "ISIS" in the ISIS dissector, rather thanguy1-26/+15
in its caller. Set the COL_PROTOCOL column to "COTP" in the COTP dissector, rather than in the dissectors it calls, so that it's done for all frames we hand to that dissector. Set the COL_INFO field for COTP packets we don't dissect because the length indicator is zero, or the frame is too short, or the PDU type is bogus. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1842 f5534014-38df-0310-8fa8-9805f1628bb7
2000-04-13Add CLNP PDU types other than DT and ER.guy1-30/+84
Fix the TPDU code numeric value to be "0x%x" rather than "Ox%x". Add a COL_INFO field for CLNP PDUs whose payload we don't dissect as COTP. Don't dissect segments other than the first derived PDU of a segmented CLNP PDU (just as we do with fragments other than the first fragment of a fragmented IP datagram). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1841 f5534014-38df-0310-8fa8-9805f1628bb7
2000-04-13Fix a typo.guy1-43/+56
Use "%u" rather than a hex format to print length values and segment offsets, and use "%u" rather than "%d" to print unsigned values. In the CLNP dissector, chop off the payload and captured-payload lengths based on the segment length (along the lines of what we do for IP). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1839 f5534014-38df-0310-8fa8-9805f1628bb7
2000-03-12Break proto_tree_add_item_format() into multiple functions:gram1-7/+7
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(). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1713 f5534014-38df-0310-8fa8-9805f1628bb7
2000-03-02Gerrit Gehnen's dissector for the Sinec H1 protocol (Siemens Industrialguy1-15/+56
Ethernet; used for communication with Siemens S5 PLC's over Ethernet), and his changes to display OSI COTP TSAPs that consist solely of printable characters as text rather than as hex data and to decode the version number resource in COTP. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1677 f5534014-38df-0310-8fa8-9805f1628bb7
2000-02-15Create a header file for every packet-*.c file. Prune the packet.h file.gram1-1/+2
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1637 f5534014-38df-0310-8fa8-9805f1628bb7
2000-01-30Add a bunch of additional NLPIDs from ISO 9577.guy1-1/+9
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1583 f5534014-38df-0310-8fa8-9805f1628bb7
2000-01-26In "dissect_clnp()", fill in "clnp" before looking at it.guy1-5/+5
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1567 f5534014-38df-0310-8fa8-9805f1628bb7
2000-01-24Fix a bunch of dissectors to use "pi.captured_len" rather thanguy1-5/+5
"fd->cap_len" for the frame length - or to use macros such as "BYTES_ARE_IN_FRAME()", "IS_DATA_IN_FRAME()", and "END_OF_FRAME", which use "pi.captured_len" - so that they correctly handle frames where the actual data length of the packet is less than the size of the raw frame, e.g. with encapsulations such as ISL. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1530 f5534014-38df-0310-8fa8-9805f1628bb7
2000-01-20Gerrit Gehnen's patch to add support for the "Inactive Subset" of theguy1-1/+14
ISO 8473 CLNP protocol. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1513 f5534014-38df-0310-8fa8-9805f1628bb7
2000-01-13Get the NLPID value for ISIS from "nlpid.h", and report the NLPID valueguy1-5/+3
in ISIS packets with "nlpid_vals". Report the NLPID value in CLNP packets with "nlpid_vals" as well. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1462 f5534014-38df-0310-8fa8-9805f1628bb7