aboutsummaryrefslogtreecommitdiffstats
path: root/packet-q931.c
Commit message (Collapse)AuthorAgeFilesLines
* For each column, have both a buffer into which strings for that columnGuy Harris2000-11-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. svn path=/trunk/; revision=2670
* Move "bytes_to_str()" to "strutil.c" from "packet.c" - it's just aGuy Harris2000-11-131-11/+12
| | | | | | | | | | | | | | | | | | | string formatter, like "format_text()", and, as "tvbuff.c" now calls it (*vide infra*), we don't want to have to make "tvbuff.c" drag "packet.h" in just to declare "bytes_to_str()". It's now declared in "strutil.h", so include it in modules that use "bytes_to_str()" and weren't already including it. Add a "tvb_bytes_to_str()" wrapper that calls "tvb_get_ptr()" to get a pointer to a chunk of N bytes at a given offset in a tvbuff and then hands that chunk to "bytes_to_str()". Convert the code that was doing that to use "tvb_bytes_to_str()" instead (which caught what I suspect is a bug in the Q.2931 dissector, where it was handing an offset of 0 to "tvb_get_ptr()" - a cut-and-pasteo, I think). Tvbuffify the ARP dissector. svn path=/trunk/; revision=2634
* Note that we might not want the dissector for Q.931-inside-TPKT to beGuy Harris2000-10-191-1/+10
| | | | | | heuristic - we may just want to make port 1720 be Q.931-inside-TPKT. svn path=/trunk/; revision=2512
* Andreas Sikkema's new H.261 and TPKT dissectors, replacement RTCP andGuy Harris2000-10-191-60/+309
| | | | | | RTP dissectors, and changes to the Q.931 dissector for use with H.323. svn path=/trunk/; revision=2511
* Add the "Edit:Protocols..." feature which currently only implementsLaurent Deniel2000-08-131-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the following: It is now possible to enable/disable a particular protocol decoding (i.e. the protocol dissector is void or not). When a protocol is disabled, it is displayed as Data and of course, all linked sub-protocols are disabled as well. Disabling a protocol could be interesting: - in case of buggy dissectors - in case of wrong heuristics - for performance reasons - to decode the data as another protocol (TODO) Currently (if I am not wrong), all dissectors but NFS can be disabled (and dissectors that do not register protocols :-) I do not like the way the RPC sub-dissectors are disabled (in the sub-dissectors) since this could be done in the RPC dissector itself, knowing the sub-protocol hfinfo entry (this is why, I've not modified the NFS one yet). Two functions are added in proto.c : gboolean proto_is_protocol_enabled(int n); void proto_set_decoding(int n, gboolean enabled); and two MACROs which can be used in dissectors: OLD_CHECK_DISPLAY_AS_DATA(index, pd, offset, fd, tree) CHECK_DISPLAY_AS_DATA(index, tvb, pinfo, tree) See also the XXX in proto_dlg.c and proto.c around the new functions. svn path=/trunk/; revision=2267
* Add routines for adding items to a protocol tree that take arguments ofGuy Harris2000-05-311-6/+6
| | | | | | | | | | | | | | | | | 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
* Add "tvb_reported_length()" to get the "reported length" of a tvbuffGuy Harris2000-05-291-303/+313
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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
* Add tvbuff class.Gilbert Ramirez2000-05-111-132/+132
| | | | | | | | | | | | | | | 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
* Add the NLPID value for PPP.Guy Harris2000-01-131-8/+3
| | | | | | | In Q.931 and Q.2931, the TR 9577 values are NLPIDs, so use "nlpid_vals" to dissect them, and values from "nlpid.h" to refer to them. svn path=/trunk/; revision=1461
* Patches from Bert Driehuis to:Guy Harris1999-12-141-3/+3
| | | | | | | | | 1) fix the check for the IE identifier to check all bits, including the topmost bit; 2) print all fields in the Date IE as 2 digits. svn path=/trunk/; revision=1335
* Minor bug fix.Guy Harris1999-11-251-2/+2
| | | | svn path=/trunk/; revision=1109
* Small bug fix.Guy Harris1999-11-251-1/+3
| | | | svn path=/trunk/; revision=1105
* Fixes to Q.931 dissector, and additions from a recent copy of Q.931.Guy Harris1999-11-251-63/+174
| | | | | | | | | Export some functions from the Q.931 dissector, so the Q.2931 dissector can use them. Add a pile of information element dissection to the Q.2931 dissector. svn path=/trunk/; revision=1104
* There are no protocols under Q.931, so mark everything up to the end ofGuy Harris1999-11-191-2/+3
| | | | | | the frame as being Q.931 stuff. svn path=/trunk/; revision=1067
* Fix a typo.Guy Harris1999-11-191-3/+3
| | | | svn path=/trunk/; revision=1066
* Replace the ETT_ "enum" members, declared in "packet.h", withGuy Harris1999-11-161-8/+16
| | | | | | | | | | | | | | | | | 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
* Dissect a whole pile of Q.931 information elements.Guy Harris1999-11-131-137/+1850
| | | | svn path=/trunk/; revision=1023
* A few cause codes more (cue Ennio Morricone).Guy Harris1999-11-131-2/+6
| | | | svn path=/trunk/; revision=1021
* Add initial support for decoding information elements.Guy Harris1999-11-131-1/+355
| | | | svn path=/trunk/; revision=1020
* Support all lengths of call reference value (1 to 15 octets).Guy Harris1999-11-111-27/+10
| | | | svn path=/trunk/; revision=1009
* Add #defines for bits in the LAPD address field and for the LAPD SAPIGuy Harris1999-11-111-0/+207
values. Dissect the LAPD payload, if present. Add the beginnings of a Q.931 dissector. svn path=/trunk/; revision=1007