aboutsummaryrefslogtreecommitdiffstats
path: root/packet-ldp.c
AgeCommit message (Collapse)AuthorFilesLines
2002-08-28Removed trailing whitespaces from .h and .c files using theJörg Mayer1-137/+137
winapi_cleanup tool written by Patrik Stridvall for the wine project. svn path=/trunk/; revision=6117
2002-08-27From Motonori Shindo: support forGuy Harris1-3/+58
o draft-lasserre-tls-mpls-00.txt o draft-lasserre-vkompella-ppvpn-vpls-02.txt svn path=/trunk/; revision=6100
2002-08-15LDP VC FEC dissection fix, from Motonori Shindo.Guy Harris1-2/+2
svn path=/trunk/; revision=5999
2002-08-02Replace the types from sys/types.h and netinet/in.h by their glib.hJörg Mayer1-9/+1
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. svn path=/trunk/; revision=5932
2002-05-01#if out an unused argument, using the same #if as the references to theGuy Harris1-1/+9
argument. svn path=/trunk/; revision=5335
2002-04-29Removal (or, at least, #ifdeffing out) of unused variables andGuy Harris1-2/+5
functions, from David Frascone. svn path=/trunk/; revision=5288
2002-04-28Make the LDP dissectors new-style dissectors, so they can reject packetsGuy Harris1-91/+191
if the version number isn't 1; the LDP port number appears to be popular for ONC RPC protocols, and this lets them be dissected as such, at least if they don't begin with a 2-byte big-endian 1. Do a standard TCP loop, which: handles LDP headers split across TCP segments; gives each LDP PDU in a TCP stream a tvbuff of its own, so we don't run past the end of the PDU; gives each LDP PDU its own tree. svn path=/trunk/; revision=5261
2002-04-25Use "%.10g", rather than "%f", for floating-point numbers. That willGuy Harris1-6/+6
display values that would fit in a 32-bit integer as integers, leaving out all trailing zeroes after the decimal point (and leaving out the decimal point if there are no digits left after the decimal point once trailing zeroes are removed), and will use scientific notation for small fractions or large numbers. svn path=/trunk/; revision=5248
2002-04-24Show the "negotiable/non-negotiable" flags as such.Guy Harris1-8/+13
svn path=/trunk/; revision=5239
2002-04-24Use "tvb_get_ntohieee_float()" to fetch floating-point numbers from theGuy Harris1-16/+13
packet. svn path=/trunk/; revision=5238
2002-04-24CRLDP support, and assorted byg fixes, from Michael Rozhavsky.Guy Harris1-65/+627
Clean up the "Error processing TLV" error messages to 1) indicate the type of TLV and 2) indicate the type of error. Clean up white space. Make routines static if they're not used outside this file. svn path=/trunk/; revision=5237
2002-04-08More static-ization.Gilbert Ramirez1-2/+2
svn path=/trunk/; revision=5131
2002-04-02Fix a bunch of bits of code that used "tvb_get_ntohl()" to fetch IPGuy Harris1-9/+9
addresses and then tried to compensate for that error using "htonl()" (or didn't bother compensating, in some cases). svn path=/trunk/; revision=5082
2002-03-16From Aamer Akhter: LDP support for draft-martini-l2circuit-trans-mpls,Guy Harris1-7/+181
LDP status code updates, and small LDP cleanups. svn path=/trunk/; revision=4959
2002-03-16Fix a couple of incorrect calls to "proto_tree_add_boolean()" to callGuy Harris1-3/+3
"proto_tree_add_item()" instead. svn path=/trunk/; revision=4950
2002-01-22From Ricardo Barroetave�a: don't give a PDU ordinal number forGuy Harris1-2/+2
LDP-over-UDP, as there's only one LDP PDU per UDP PDU. svn path=/trunk/; revision=4598
2002-01-21From Ricardo Barroetave�a: support for all TLVs and messages in RFCGuy Harris1-526/+1327
3036. svn path=/trunk/; revision=4590
2002-01-21Include files from the "epan" directory and subdirectories thereof withGuy Harris1-3/+3
"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/"). svn path=/trunk/; revision=4586
2002-01-20Fix some problems in protocol preferences blurbs.Guy Harris1-3/+3
svn path=/trunk/; revision=4582
2002-01-20Allow a length of -1 to be specified when adding FT_NONE and FT_PROTOCOLGuy Harris1-3/+2
items to the protocol tree; it's interpreted as "the rest of the data in the tvbuff". This can be used if 1) the item covers the entire packet or the remaining payload in the packet or 2) the item's length won't be known until it's dissected, and will be then set with "proto_item_set_len()" - if an exception is thrown in the dissection, it means the item ran *past* the end of the tvbuff, so saying it runs to the end of the tvbuff is reasonable. Convert a number of "proto_tree_add_XXX()" calls using "tvb_length_remaining()", values derived from the result of "tvb_length()", or 0 (in the case of items whose length is unknown) to use -1 instead (using 0 means that if an exception is thrown, selecting the item highlights nothing; using -1 means it highlights all the data for that item that's available). In some places where "tvb_length()" or "tvb_length_remaining()" was used to determine how large a packet is, use "tvb_reported_length()" or "tvb_reported_length_remaining()", instead - the first two calls indicate how much captured data was in the packet, the latter two calls indicate how large the packet actually was (and the fact that using the latter could cause BoundsError exceptions to be thrown is a feature - if such an exception is thrown, the frame really *was* short, and it should be tagged as such). Replace some "proto_tree_add_XXX()" calls with equivalent "proto_tree_add_item()" calls. Fix some indentation. svn path=/trunk/; revision=4578
2001-12-10Move the pointer to the "column_info" structure in the "frame_data"Guy Harris1-10/+10
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. svn path=/trunk/; revision=4370
2001-12-03Make "dissector_add()", "dissector_delete()", and "dissector_change()"Guy Harris1-8/+13
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. svn path=/trunk/; revision=4308
2001-11-27Note that LDP is documented in RFC 3036.Guy Harris1-2/+2
svn path=/trunk/; revision=4277
2001-11-27Handle the case of multiple LDP PDUs per TCP segment. (Still needs toGuy Harris1-31/+87
handle the case of more than one TCP segment per LDP PDU....) Fix the handling of some of the length fields. svn path=/trunk/; revision=4276
2001-07-21There is really no need to have the BGP dissector and the LDP dissectorGuy Harris1-16/+3
have two independent "value_string" tables mapping RFC 1700 address family numbers to names, nor is there any need to have the BGP dissector and the PIM dissector have two independent sets of #defines for RFC 1700 address family numbers; put a single "value_string" table in "afn.c" and put a declaration of it, and #defines for the address family numbers, into "afn.h", and have the dissectors use that. Move the #define for PGM into "ipproto.h", and add an entry for it in the "value_string" table in "ipproto.c". Have the PGM dissector use the standard Ethereal mechanisms for resolving addresses, and have it use "value_string" tables for mapping option types, the OPX bits, and packet types to strings. Use "bytes_to_str()" to turn byte arrays into strings of hex digits. Pass the packet type string to "dissect_pgmopts()" as an argument, rather than making it a global. Don't use "proto_tree_add_XXX_format" routines if you can possibly just use "proto_tree_add_XXX"; give various fields the correct radix and type, and VALS() strings if necessary, to make that happen (and to make filtering on them more pleasant). Put the type, length, and total length of the options into the protocol tree as separate fields. Don't have separate type, length, and OPX fields for every type of option; one field will suffice. Don't format a string with "sprintf()" and then pass that string to "col_add_fstr()" with a format of "%s" and the string as an argument - "col_add_fstr()" can format strings itself (that's what the "f" stands for). Don't byte-swap and then un-byte-swap IPv4 address fields in the header, just leave them network byte order to start with. Use the correct fields for "proto_tree_add_XXX", rather than using the same field multiple times. Quit early if an address family identifier isn't AFNUM_INET, as that means the structure we use to dissect the header doesn't match the actual header. svn path=/trunk/; revision=3761
2001-07-16Convert a bunch of "proto_tree_add_bytes(tree, hf, tvb, offset, length,Guy Harris1-5/+5
tvb_get_ptr(tvb, offset, length))" calls to "proto_tree_add_item()" calls. Do the same, in "packet-iscsi.c" and "packet-mrdisc.c", for "proto_tree_add_uint()" and "proto_tree_add_boolean()" calls. svn path=/trunk/; revision=3726
2001-06-18From Joerg Mayer: explicitly fill in all members of aGuy Harris1-23/+23
"header_field_info" structure, including the ones that are later set by the routines to register fields. svn path=/trunk/; revision=3561
2001-06-05Compensate better for invalid (at least for IPv4) prefix lengths inGuy Harris1-3/+10
FECs. svn path=/trunk/; revision=3515
2001-05-21Fix to LDP prefix FEC dissection for IPv4, from Eran Mann.Guy Harris1-8/+28
svn path=/trunk/; revision=3431
2001-01-25Remove more "CHECK_DISPLAY_AS_DATA()" calls and "pinfo->current_proto ="Guy Harris1-6/+3
statements. Move the setting of the Protocol column in various dissectors before anything is fetched from the packet, and also clear the Info column at that point in those and some other dissectors, so that if an exception is thrown, the columns don't reflect the previous protocol. "Tvbuffify" the Mobile IP dissector (it took old-style arguments, and then converted them into tvbuff arguments, so there wasn't much to do, other than to fix references to "fd" to refer to "pinfo->fd"). In the SCTP dissector, refer to the port type and source and destination ports through "pinfo" rather than through the global "pi", as it's a tvbuffified dissector. In the SMTP and Time Protocol dissectors, use "pinfo->match_port" rather than "TCP_PORT_SMTP" when checking whether the packet is a request or reply, just in case somebody makes a non-standard port be dissected as SMTP or Time. (Also, remove a bogus comment from the Time dissector; it was probably cut-and-pasted from the TFTP dissector.) svn path=/trunk/; revision=2938
2001-01-09Add an additional "protocol index" argument to "{old_}dissector_add()",Guy Harris1-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....) svn path=/trunk/; revision=2849
2001-01-03Add a new "prefs_register_protocol()" routine, which is likeGuy Harris1-8/+8
"prefs_register_module()" except that it takes a protocol index as returned by "proto_register_protocol()" as its first argument, rather than taking two character strings as arguments as its first two arguments, and uses the protocol's abbreviation as the name to use for preferences in the preferences file and the "-o" flag and uses the protocol's short name as the name to use in the tabs in the "Edit->Preferences" window. svn path=/trunk/; revision=2812
2001-01-03Have "proto_register_protocol()" build a list of data structures forGuy Harris1-2/+2
protocols, in addition to adding structures to the list of filterable fields. Give it an extra argument that specifies a "short name" for the protocol, for use in such places as pinfo->current_proto; the dialog box for constructing filters; the preferences tab for the protocol; and so on (although we're not yet using it in all those places). Make the preference name that appears in the preferences file and the command line for the DIAMETER protocol "diameter", not "Diameter"; the convention is that the name in question be all-lower-case. Make some routines and variables that aren't exported static. Update a comment in the ICP dissector to make it clear that the dissector won't see fragments other than the first fragment of a fragmented datagram. svn path=/trunk/; revision=2810
2000-12-04Fix egregious error with AF_ types. I relied on a Linux header file ratherRichard Sharpe1-7/+22
than checking RFC1700. svn path=/trunk/; revision=2745
2000-12-04Don't loop infinitely if we see a Host Address or unknown ForwardingGuy Harris1-1/+16
Equivalence Class. Set "pinfo->current_proto", so that if we run past the end of the data the problem is noted as being with LDP. svn path=/trunk/; revision=2743
2000-12-03Stealing time again to compulsively code this beast.Richard Sharpe1-2/+107
Still more TLVs to code ... svn path=/trunk/; revision=2734
2000-12-02Dissect Common Hello Params TLV ...Richard Sharpe1-10/+82
Still more work to do though ... svn path=/trunk/; revision=2733
2000-12-02Some tvbuffified dissectors weren't setting "pinfo->current_proto", soGuy Harris1-1/+3
that if they threw an exception, the wrong protocol would be blamed. Add the missing assignments. Clean up the extraction of the null-encapsulation header. svn path=/trunk/; revision=2730
2000-12-01Fix one small type WRT Forwarding Equivalence Classes and handle theRichard Sharpe1-1/+1
illegal padding by trying to skip it. svn path=/trunk/; revision=2727
2000-12-01A much more complete LDP dissector.Richard Sharpe1-31/+220
Still more work to do though, as I want to dissect the various message types correctly, and to dissect TLVs much more as well. The dissector currently handles multiple messages in a PDU, as the trace file I have has some of those. I think that the equipment that generated the LDP trace I have has a bug. It seems to think that TLVs must be alligned on 4-byte boundaries, while the spec (draft) says that there are no alignment requirements :-) Don't know what generated the trace :-) svn path=/trunk/; revision=2726
2000-11-30Step-wise improvement on this thing ... next to dissect each message typeRichard Sharpe1-53/+105
more fully. Apparently, LDP allows multiple messages per PDU. Has anyone seen such an implementation? svn path=/trunk/; revision=2724
2000-11-30More work in progress on the Label Distribution Protocol dissector ...Richard Sharpe1-12/+150
Bit more work to do, and a list of TLV values, and I am away :-) svn path=/trunk/; revision=2720
2000-11-29Initial coding of the dissector for the Label Distribution Protocol.Richard Sharpe1-0/+252
It registers the same dissector for the LDP port for both TCP and UDP. Still a lot of work to do, but we can see the header now. svn path=/trunk/; revision=2714