aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorJörg Mayer <jmayer@loplof.de>2007-12-11 22:03:26 +0000
committerJörg Mayer <jmayer@loplof.de>2007-12-11 22:03:26 +0000
commit5998d1dbd2b815eedfdb8957bf13d3a943a921d6 (patch)
tree93f46d04be131c4b885c5caf8cbab0d80a130c5c /plugins
parent3254a8f9cb1ff5713a9f40675211176f2193e5c3 (diff)
mgcp is now in epan/dissectors/
svn path=/trunk/; revision=23843
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mgcp/AUTHORS4
-rw-r--r--plugins/mgcp/COPYING340
-rw-r--r--plugins/mgcp/ChangeLog8
-rw-r--r--plugins/mgcp/INSTALL0
-rw-r--r--plugins/mgcp/Makefile.am124
-rw-r--r--plugins/mgcp/Makefile.common35
-rw-r--r--plugins/mgcp/Makefile.nmake99
-rw-r--r--plugins/mgcp/NEWS0
-rw-r--r--plugins/mgcp/moduleinfo.h17
-rw-r--r--plugins/mgcp/moduleinfo.nmake28
-rw-r--r--plugins/mgcp/packet-mgcp.c2322
-rw-r--r--plugins/mgcp/packet-mgcp.h67
-rw-r--r--plugins/mgcp/plugin.rc.in34
13 files changed, 0 insertions, 3078 deletions
diff --git a/plugins/mgcp/AUTHORS b/plugins/mgcp/AUTHORS
deleted file mode 100644
index 36228a508c..0000000000
--- a/plugins/mgcp/AUTHORS
+++ /dev/null
@@ -1,4 +0,0 @@
-Author :
-Ed Warnicke <hagbard@physics.rutgers.edu>
-Lars Roland <lars.roland@gmx.net>
-
diff --git a/plugins/mgcp/COPYING b/plugins/mgcp/COPYING
deleted file mode 100644
index d60c31a97a..0000000000
--- a/plugins/mgcp/COPYING
+++ /dev/null
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/plugins/mgcp/ChangeLog b/plugins/mgcp/ChangeLog
deleted file mode 100644
index 56ef41f94e..0000000000
--- a/plugins/mgcp/ChangeLog
+++ /dev/null
@@ -1,8 +0,0 @@
-Overview of changes in Wireshark MGCP plugin 0.0.9:
-* Added calculation of request-to-response time delay
-* support for building detailed delay statistics by the tapping
- subsystem of ethereal
-
-Overview of changes in Wireshark MGCP plugin 0.0.2:
-* Fixed misc problems with improperly dissecting some xgcp packets as
- short or malformed.
diff --git a/plugins/mgcp/INSTALL b/plugins/mgcp/INSTALL
deleted file mode 100644
index e69de29bb2..0000000000
--- a/plugins/mgcp/INSTALL
+++ /dev/null
diff --git a/plugins/mgcp/Makefile.am b/plugins/mgcp/Makefile.am
deleted file mode 100644
index 81bacae99d..0000000000
--- a/plugins/mgcp/Makefile.am
+++ /dev/null
@@ -1,124 +0,0 @@
-# Makefile.am
-# Automake file for MGCP plugin
-#
-# $Id$
-#
-# Wireshark - Network traffic analyzer
-# By Gerald Combs <gerald@wireshark.org>
-# Copyright 1998 Gerald Combs
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-
-INCLUDES = -I$(top_srcdir) -I$(includedir)
-
-include Makefile.common
-
-if HAVE_WARNINGS_AS_ERRORS
-AM_CFLAGS = -Werror
-endif
-
-plugindir = @plugindir@
-
-plugin_LTLIBRARIES = mgcp.la
-mgcp_la_SOURCES = \
- plugin.c \
- moduleinfo.h \
- $(DISSECTOR_SRC) \
- $(DISSECTOR_INCLUDES)
-mgcp_la_LDFLAGS = -module -avoid-version
-mgcp_la_LIBADD = @PLUGIN_LIBS@
-
-# Libs must be cleared, or else libtool won't create a shared module.
-# If your module needs to be linked against any particular libraries,
-# add them here.
-LIBS =
-
-#
-# Build plugin.c, which contains the plugin version[] string, a
-# function plugin_register() that calls the register routines for all
-# protocols, and a function plugin_reg_handoff() that calls the handoff
-# registration routines for all protocols.
-#
-# We do this by scanning sources. If that turns out to be too slow,
-# maybe we could just require every .o file to have an register routine
-# of a given name (packet-aarp.o -> proto_register_aarp, etc.).
-#
-# Formatting conventions: The name of the proto_register_* routines an
-# proto_reg_handoff_* routines must start in column zero, or must be
-# preceded only by "void " starting in column zero, and must not be
-# inside #if.
-#
-# DISSECTOR_SRC is assumed to have all the files that need to be scanned.
-#
-# For some unknown reason, having a big "for" loop in the Makefile
-# to scan all the files doesn't work with some "make"s; they seem to
-# pass only the first few names in the list to the shell, for some
-# reason.
-#
-# Therefore, we have a script to generate the plugin.c file.
-# The shell script runs slowly, as multiple greps and seds are run
-# for each input file; this is especially slow on Windows. Therefore,
-# if Python is present (as indicated by PYTHON being defined), we run
-# a faster Python script to do that work instead.
-#
-# The first argument is the directory in which the source files live.
-# The second argument is "plugin", to indicate that we should build
-# a plugin.c file for a plugin.
-# All subsequent arguments are the files to scan.
-#
-plugin.c: $(DISSECTOR_SRC) $(top_srcdir)/tools/make-dissector-reg \
- $(top_srcdir)/tools/make-dissector-reg.py
- @if test -n $(PYTHON); then \
- echo Making plugin.c with python ; \
- $(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
- plugin $(DISSECTOR_SRC) ; \
- else \
- echo Making plugin.c with shell script ; \
- $(top_srcdir)/tools/make-dissector-reg $(srcdir) \
- $(plugin_src) plugin $(DISSECTOR_SRC) ; \
- fi
-
-#
-# Currently plugin.c can be included in the distribution because
-# we always build all protocol dissectors. We used to have to check
-# whether or not to build the snmp dissector. If we again need to
-# variably build something, making plugin.c non-portable, uncomment
-# the dist-hook line below.
-#
-# Oh, yuk. We don't want to include "plugin.c" in the distribution, as
-# its contents depend on the configuration, and therefore we want it
-# to be built when the first "make" is done; however, Automake insists
-# on putting *all* source into the distribution.
-#
-# We work around this by having a "dist-hook" rule that deletes
-# "plugin.c", so that "dist" won't pick it up.
-#
-#dist-hook:
-# @rm -f $(distdir)/plugin.c
-
-CLEANFILES = \
- mgcp \
- *~
-
-MAINTAINERCLEANFILES = \
- Makefile.in \
- plugin.c
-
-EXTRA_DIST = \
- Makefile.common \
- Makefile.nmake \
- moduleinfo.nmake \
- plugin.rc.in
diff --git a/plugins/mgcp/Makefile.common b/plugins/mgcp/Makefile.common
deleted file mode 100644
index 75302c2380..0000000000
--- a/plugins/mgcp/Makefile.common
+++ /dev/null
@@ -1,35 +0,0 @@
-# Makefile.common for MGCP plugin
-# Contains the stuff from Makefile.am and Makefile.nmake that is
-# a) common to both files and
-# b) portable between both files
-#
-# $Id$
-#
-# Wireshark - Network traffic analyzer
-# By Gerald Combs <gerald@wireshark.org>
-# Copyright 1998 Gerald Combs
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-# the name of the plugin
-PLUGIN_NAME = mgcp
-
-# the dissector sources (without any helpers)
-DISSECTOR_SRC = \
- packet-mgcp.c
-
-# corresponding headers
-DISSECTOR_INCLUDES = \
- packet-mgcp.h
diff --git a/plugins/mgcp/Makefile.nmake b/plugins/mgcp/Makefile.nmake
deleted file mode 100644
index 8cd480bb00..0000000000
--- a/plugins/mgcp/Makefile.nmake
+++ /dev/null
@@ -1,99 +0,0 @@
-# Makefile.nmake
-# nmake file for Wireshark plugin
-#
-# $Id$
-#
-
-include ..\..\config.nmake
-include moduleinfo.nmake
-
-include Makefile.common
-
-CFLAGS=/WX /DHAVE_CONFIG_H /I../.. /I../../wiretap $(GLIB_CFLAGS) \
- /I$(PCAP_DIR)\include -D_U_="" $(LOCAL_CFLAGS)
-
-.c.obj::
- $(CC) $(CFLAGS) -Fd.\ -c $<
-
-LDFLAGS = $(PLUGIN_LDFLAGS)
-
-!IFDEF ENABLE_LIBWIRESHARK
-LINK_PLUGIN_WITH=..\..\epan\libwireshark.lib
-CFLAGS=/DHAVE_WIN32_LIBWIRESHARK_LIB /D_NEED_VAR_IMPORT_ $(CFLAGS)
-
-DISSECTOR_OBJECTS = $(DISSECTOR_SRC:.c=.obj)
-
-DISSECTOR_SUPPORT_OBJECTS = $(DISSECTOR_SUPPORT_SRC:.c=.obj)
-
-OBJECTS = $(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS) plugin.obj
-
-RESOURCE=$(PLUGIN_NAME).res
-
-all: $(PLUGIN_NAME).dll
-
-$(PLUGIN_NAME).rc : moduleinfo.nmake
- sed -e s/@PLUGIN_NAME@/$(PLUGIN_NAME)/ \
- -e s/@RC_MODULE_VERSION@/$(RC_MODULE_VERSION)/ \
- -e s/@RC_VERSION@/$(RC_VERSION)/ \
- -e s/@MODULE_VERSION@/$(MODULE_VERSION)/ \
- -e s/@PACKAGE@/$(PACKAGE)/ \
- -e s/@VERSION@/$(VERSION)/ \
- -e s/@MSVC_VARIANT@/$(MSVC_VARIANT)/ \
- < plugin.rc.in > $@
-
-$(PLUGIN_NAME).dll $(PLUGIN_NAME).exp $(PLUGIN_NAME).lib : $(OBJECTS) $(LINK_PLUGIN_WITH) $(RESOURCE)
- link -dll /out:$(PLUGIN_NAME).dll $(LDFLAGS) $(OBJECTS) $(LINK_PLUGIN_WITH) \
- $(GLIB_LIBS) $(RESOURCE)
-
-#
-# Build plugin.c, which contains the plugin version[] string, a
-# function plugin_register() that calls the register routines for all
-# protocols, and a function plugin_reg_handoff() that calls the handoff
-# registration routines for all protocols.
-#
-# We do this by scanning sources. If that turns out to be too slow,
-# maybe we could just require every .o file to have an register routine
-# of a given name (packet-aarp.o -> proto_register_aarp, etc.).
-#
-# Formatting conventions: The name of the proto_register_* routines an
-# proto_reg_handoff_* routines must start in column zero, or must be
-# preceded only by "void " starting in column zero, and must not be
-# inside #if.
-#
-# DISSECTOR_SRC is assumed to have all the files that need to be scanned.
-#
-# For some unknown reason, having a big "for" loop in the Makefile
-# to scan all the files doesn't work with some "make"s; they seem to
-# pass only the first few names in the list to the shell, for some
-# reason.
-#
-# Therefore, we have a script to generate the plugin.c file.
-# The shell script runs slowly, as multiple greps and seds are run
-# for each input file; this is especially slow on Windows. Therefore,
-# if Python is present (as indicated by PYTHON being defined), we run
-# a faster Python script to do that work instead.
-#
-# The first argument is the directory in which the source files live.
-# The second argument is "plugin", to indicate that we should build
-# a plugin.c file for a plugin.
-# All subsequent arguments are the files to scan.
-#
-plugin.c: $(DISSECTOR_SRC) ../../tools/make-dissector-reg.py ../../tools/make-dissector-reg
-!IFDEF PYTHON
- @echo Making plugin.c (using python)
- @$(PYTHON) "../../tools/make-dissector-reg.py" . plugin $(DISSECTOR_SRC)
-!ELSE
- @echo Making plugin.c (using sh)
- @$(SH) ../../tools/make-dissector-reg . plugin $(DISSECTOR_SRC)
-!ENDIF
-
-!ENDIF
-
-clean:
- rm -f $(OBJECTS) $(RESOURCE) plugin.c *.pdb \
- $(PLUGIN_NAME).dll $(PLUGIN_NAME).dll.manifest $(PLUGIN_NAME).lib \
- $(PLUGIN_NAME).exp $(PLUGIN_NAME).rc
-
-distclean: clean
-
-maintainer-clean: distclean
diff --git a/plugins/mgcp/NEWS b/plugins/mgcp/NEWS
deleted file mode 100644
index e69de29bb2..0000000000
--- a/plugins/mgcp/NEWS
+++ /dev/null
diff --git a/plugins/mgcp/moduleinfo.h b/plugins/mgcp/moduleinfo.h
deleted file mode 100644
index b026e28341..0000000000
--- a/plugins/mgcp/moduleinfo.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Included *after* config.h, in order to re-define these macros */
-
-#ifdef PACKAGE
-#undef PACKAGE
-#endif
-
-/* Name of package */
-#define PACKAGE "mgcp"
-
-
-#ifdef VERSION
-#undef VERSION
-#endif
-
-/* Version number of package */
-#define VERSION "0.0.10"
-
diff --git a/plugins/mgcp/moduleinfo.nmake b/plugins/mgcp/moduleinfo.nmake
deleted file mode 100644
index a0e37a46fe..0000000000
--- a/plugins/mgcp/moduleinfo.nmake
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# $Id$
-#
-
-# The name
-PACKAGE=mgcp
-
-# The version
-MODULE_VERSION_MAJOR=0
-MODULE_VERSION_MINOR=0
-MODULE_VERSION_MICRO=10
-MODULE_VERSION_EXTRA=0
-
-#
-# The RC_VERSION should be comma-separated, not dot-separated,
-# as per Graham Bloice's message in
-#
-# http://www.ethereal.com/lists/ethereal-dev/200303/msg00283.html
-#
-# "The RC_VERSION variable in config.nmake should be comma separated.
-# This allows the resources to be built correctly and the version
-# number to be correctly displayed in the explorer properties dialog
-# for the executables, and XP's tooltip, rather than 0.0.0.0."
-#
-
-MODULE_VERSION=$(MODULE_VERSION_MAJOR).$(MODULE_VERSION_MINOR).$(MODULE_VERSION_MICRO).$(MODULE_VERSION_EXTRA)
-RC_MODULE_VERSION=$(MODULE_VERSION_MAJOR),$(MODULE_VERSION_MINOR),$(MODULE_VERSION_MICRO),$(MODULE_VERSION_EXTRA)
-
diff --git a/plugins/mgcp/packet-mgcp.c b/plugins/mgcp/packet-mgcp.c
deleted file mode 100644
index 85f6db015e..0000000000
--- a/plugins/mgcp/packet-mgcp.c
+++ /dev/null
@@ -1,2322 +0,0 @@
-/* packet-mgcp.c
- * Routines for mgcp packet disassembly
- * RFC 2705
- * RFC 3435 (obsoletes 2705): Media Gateway Control Protocol (MGCP) Version 1.0
- * RFC 3660: Basic MGCP Packages
- * RFC 3661: MGCP Return Code Usage
- * NCS 1.0: PacketCable Network-Based Call Signaling Protocol Specification,
- * PKT-SP-EC-MGCP-I09-040113, January 13, 2004, Cable Television
- * Laboratories, Inc., http://www.PacketCable.com/
- * www.iana.org/assignments/mgcp-localconnectionoptions
- *
- * $Id$
- *
- * Copyright (c) 2000 by Ed Warnicke <hagbard@physics.rutgers.edu>
- * Copyright (c) 2004 by Thomas Anders <thomas.anders [AT] blue-cable.de>
- *
- * Wireshark - Network traffic analyzer
- * By Gerald Combs <gerald@wireshark.org>
- * Copyright 1999 Gerald Combs
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <ctype.h>
-#include <string.h>
-#include <epan/packet.h>
-#include <epan/emem.h>
-#include <epan/proto.h>
-#include <epan/prefs.h>
-#include <epan/conversation.h>
-#include <epan/tap.h>
-#include "packet-mgcp.h"
-
-#ifdef NEED_G_ASCII_STRCASECMP_H
-#include "g_ascii_strcasecmp.h"
-#endif
-
-#define TCP_PORT_MGCP_GATEWAY 2427
-#define UDP_PORT_MGCP_GATEWAY 2427
-#define TCP_PORT_MGCP_CALLAGENT 2727
-#define UDP_PORT_MGCP_CALLAGENT 2727
-
-
-/* Define the mgcp proto */
-static int proto_mgcp = -1;
-
-/* Define many many headers for mgcp */
-static int hf_mgcp_req = -1;
-static int hf_mgcp_req_verb = -1;
-static int hf_mgcp_req_endpoint = -1;
-static int hf_mgcp_req_frame = -1;
-static int hf_mgcp_rsp = -1;
-static int hf_mgcp_rsp_frame = -1;
-static int hf_mgcp_time = -1;
-static int hf_mgcp_transid = -1;
-static int hf_mgcp_version = -1;
-static int hf_mgcp_rsp_rspcode = -1;
-static int hf_mgcp_rsp_rspstring = -1;
-static int hf_mgcp_params = -1;
-static int hf_mgcp_param_rspack = -1;
-static int hf_mgcp_param_bearerinfo = -1;
-static int hf_mgcp_param_callid = -1;
-static int hf_mgcp_param_connectionid = -1;
-static int hf_mgcp_param_secondconnectionid = -1;
-static int hf_mgcp_param_notifiedentity = -1;
-static int hf_mgcp_param_requestid = -1;
-static int hf_mgcp_param_localconnoptions = -1;
-static int hf_mgcp_param_localconnoptions_p = -1;
-static int hf_mgcp_param_localconnoptions_a = -1;
-static int hf_mgcp_param_localconnoptions_s = -1;
-static int hf_mgcp_param_localconnoptions_e = -1;
-static int hf_mgcp_param_localconnoptions_scrtp = -1;
-static int hf_mgcp_param_localconnoptions_scrtcp = -1;
-static int hf_mgcp_param_localconnoptions_b = -1;
-static int hf_mgcp_param_localconnoptions_esccd = -1;
-static int hf_mgcp_param_localconnoptions_escci = -1;
-static int hf_mgcp_param_localconnoptions_dqgi = -1;
-static int hf_mgcp_param_localconnoptions_dqrd = -1;
-static int hf_mgcp_param_localconnoptions_dqri = -1;
-static int hf_mgcp_param_localconnoptions_dqrr = -1;
-static int hf_mgcp_param_localconnoptions_k = -1;
-static int hf_mgcp_param_localconnoptions_gc = -1;
-static int hf_mgcp_param_localconnoptions_fmtp = -1;
-static int hf_mgcp_param_localconnoptions_nt = -1;
-static int hf_mgcp_param_localconnoptions_ofmtp = -1;
-static int hf_mgcp_param_localconnoptions_r = -1;
-static int hf_mgcp_param_localconnoptions_t = -1;
-static int hf_mgcp_param_localconnoptions_rcnf = -1;
-static int hf_mgcp_param_localconnoptions_rdir = -1;
-static int hf_mgcp_param_localconnoptions_rsh = -1;
-static int hf_mgcp_param_connectionmode = -1;
-static int hf_mgcp_param_reqevents = -1;
-static int hf_mgcp_param_restartmethod = -1;
-static int hf_mgcp_param_restartdelay = -1;
-static int hf_mgcp_param_signalreq = -1;
-static int hf_mgcp_param_digitmap = -1;
-static int hf_mgcp_param_observedevent = -1;
-static int hf_mgcp_param_connectionparam = -1;
-static int hf_mgcp_param_connectionparam_ps = -1;
-static int hf_mgcp_param_connectionparam_os = -1;
-static int hf_mgcp_param_connectionparam_pr = -1;
-static int hf_mgcp_param_connectionparam_or = -1;
-static int hf_mgcp_param_connectionparam_pl = -1;
-static int hf_mgcp_param_connectionparam_ji = -1;
-static int hf_mgcp_param_connectionparam_la = -1;
-static int hf_mgcp_param_connectionparam_pcrps = -1;
-static int hf_mgcp_param_connectionparam_pcros = -1;
-static int hf_mgcp_param_connectionparam_pcrpl = -1;
-static int hf_mgcp_param_connectionparam_pcrji = -1;
-static int hf_mgcp_param_connectionparam_x = -1;
-static int hf_mgcp_param_reasoncode = -1;
-static int hf_mgcp_param_eventstates = -1;
-static int hf_mgcp_param_specificendpoint = -1;
-static int hf_mgcp_param_secondendpointid = -1;
-static int hf_mgcp_param_reqinfo = -1;
-static int hf_mgcp_param_quarantinehandling = -1;
-static int hf_mgcp_param_detectedevents = -1;
-static int hf_mgcp_param_capabilities = -1;
-static int hf_mgcp_param_maxmgcpdatagram = -1;
-static int hf_mgcp_param_packagelist = -1;
-static int hf_mgcp_param_extension = -1;
-static int hf_mgcp_param_extension_critical = -1;
-static int hf_mgcp_param_invalid = -1;
-static int hf_mgcp_messagecount = -1;
-static int hf_mgcp_dup = -1;
-static int hf_mgcp_req_dup = -1;
-static int hf_mgcp_req_dup_frame = -1;
-static int hf_mgcp_rsp_dup = -1;
-static int hf_mgcp_rsp_dup_frame = -1;
-
-static const value_string mgcp_return_code_vals[] = {
- {000, "Response Acknowledgement"},
- {100, "The transaction is currently being executed. An actual completion message will follow on later."},
- {101, "The transaction has been queued for execution. An actual completion message will follow later."},
- {200, "The requested transaction was executed normally."},
- {250, "The connection was deleted."},
- {400, "The transaction could not be executed, due to a transient error."},
- {401, "The phone is already off hook"},
- {402, "The phone is already on hook"},
- {403, "The transaction could not be executed, because the endpoint does not have sufficient resources at this time"},
- {404, "Insufficient bandwidth at this time"},
- {405, "The transaction could not be executed, because the endpoint is \"restarting\"."},
- {406, "Transaction time-out. The transaction did not complete in a reasonable period of time and has been aborted."},
- {407, "Transaction aborted. The transaction was aborted by some external action, e.g., a ModifyConnection command aborted by a DeleteConnection command."},
- {409, "The transaction could not be executed because of internal overload."},
- {410, "No endpoint available. A valid \"any of\" wildcard was used, however there was no endpoint available to satisfy the request."},
- {500, "The transaction could not be executed, because the endpoint is unknown."},
- {501, "The transaction could not be executed, because the endpoint is not ready."},
- {502, "The transaction could not be executed, because the endpoint does not have sufficient resources"},
- {503, "\"All of\" wildcard too complicated."},
- {504, "Unknown or unsupported command."},
- {505, "Unsupported RemoteConnectionDescriptor."},
- {506, "Unable to satisfy both LocalConnectionOptions and RemoteConnectionDescriptor."},
- {507, "Unsupported functionality."},
- {508, "Unknown or unsupported quarantine handling."},
- {509, "Error in RemoteConnectionDescriptor."},
- {510, "The transaction could not be executed, because a protocol error was detected."},
- {511, "The transaction could not be executed, because the command contained an unrecognized extension."},
- {512, "The transaction could not be executed, because the gateway is not equipped to detect one of the requested events."},
- {513, "The transaction could not be executed, because the gateway is not equipped to generate one of the requested signals."},
- {514, "The transaction could not be executed, because the gateway cannot send the specified announcement."},
- {515, "The transaction refers to an incorrect connection-id (may have been already deleted)"},
- {516, "The transaction refers to an unknown call-id."},
- {517, "Unsupported or invalid mode."},
- {518, "Unsupported or unknown package."},
- {519, "Endpoint does not have a digit map."},
- {520, "The transaction could not be executed, because the endpoint is 'restarting'."},
- {521, "Endpoint redirected to another Call Agent."},
- {522, "No such event or signal."},
- {523, "Unknown action or illegal combination of actions"},
- {524, "Internal inconsistency in LocalConnectionOptions"},
- {525, "Unknown extension in LocalConnectionOptions"},
- {526, "Insufficient bandwidth"},
- {527, "Missing RemoteConnectionDescriptor"},
- {528, "Incompatible protocol version"},
- {529, "Internal hardware failure"},
- {530, "CAS signaling protocol error."},
- {531, "failure of a grouping of trunks (e.g. facility failure)."},
- {532, "Unsupported value(s) in LocalConnectionOptions."},
- {533, "Response too large."},
- {534, "Codec negotiation failure."},
- {535, "Packetization period not supported"},
- {536, "Unknown or unsupported RestartMethod"},
- {537, "Unknown or unsupported digit map extension"},
- {538, "Event/signal parameter error (e.g., missing, erroneous, unsupported, unknown, etc.)"},
- {539, "Invalid or unsupported command parameter."},
- {540, "Per endpoint connection limit exceeded."},
- {541, "Invalid or unsupported LocalConnectionOptions"},
- {0, NULL }
-};
-
-/* TODO: add/use when tested/have capture to test with */
-/*
-static const value_string mgcp_reason_code_vals[] = {
- {0, "Endpoint state is normal"},
- {900, "Endpoint malfunctioning."},
- {901, "Endpoint taken out-of-service."},
- {902, "Loss of lower layer connectivity (e.g., downstream sync)."},
- {903, "QoS resource reservation was lost."},
- {904, "Manual intervention."},
- {905, "Facility failure (e.g., DS-0 failure)."},
- {0, NULL }
-};
-*/
-
-
-/*
- * Define the trees for mgcp
- * We need one for MGCP itself, one for the MGCP paramters and one
- * for each of the dissected parameters
- */
-static int ett_mgcp = -1;
-static int ett_mgcp_param = -1;
-static int ett_mgcp_param_connectionparam = -1;
-static int ett_mgcp_param_localconnectionoptions = -1;
-
-/*
- * Define the tap for mgcp
- */
-static int mgcp_tap = -1;
-
-/*
- * Here are the global variables associated with
- * the various user definable characteristics of the dissection
- *
- * MGCP has two kinds of "agents", gateways and callagents. Callagents
- * control gateways in a master/slave sort of arrangement. Since gateways
- * and callagents have different well known ports and could both
- * operate under either udp or tcp we have rather a lot of port info to
- * specify.
- *
- * global_mgcp_raw_text determines whether we are going to display
- * the raw text of the mgcp message, much like the HTTP dissector does.
- *
- */
-static guint global_mgcp_gateway_tcp_port = TCP_PORT_MGCP_GATEWAY;
-static guint global_mgcp_gateway_udp_port = UDP_PORT_MGCP_GATEWAY;
-static guint global_mgcp_callagent_tcp_port = TCP_PORT_MGCP_CALLAGENT;
-static guint global_mgcp_callagent_udp_port = UDP_PORT_MGCP_CALLAGENT;
-static gboolean global_mgcp_raw_text = FALSE;
-static gboolean global_mgcp_message_count = FALSE;
-
-/*
- * Variables to allow for proper deletion of dissector registration when
- * the user changes port from the gui.
- */
-static int gateway_tcp_port = 0;
-static int gateway_udp_port = 0;
-static int callagent_tcp_port = 0;
-static int callagent_udp_port = 0;
-
-/* Some basic utility functions that are specific to this dissector */
-static gboolean is_mgcp_verb(tvbuff_t *tvb, gint offset, gint maxlength, const gchar **verb_name);
-static gboolean is_mgcp_rspcode(tvbuff_t *tvb, gint offset, gint maxlength);
-static gint tvb_parse_param(tvbuff_t *tvb, gint offset, gint maxlength, int** hf);
-
-/*
- * The various functions that either dissect some
- * subpart of MGCP. These aren't really proto dissectors but they
- * are written in the same style.
- */
-static void dissect_mgcp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
- proto_tree *mgcp_tree, proto_tree *ti);
-static void dissect_mgcp_firstline(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
-static void dissect_mgcp_params(tvbuff_t *tvb, proto_tree *tree);
-static void dissect_mgcp_connectionparams(proto_tree *parent_tree, tvbuff_t *tvb,
- gint offset, gint param_type_len,
- gint param_val_len);
-static void dissect_mgcp_localconnectionoptions(proto_tree *parent_tree, tvbuff_t *tvb,
- gint offset, gint param_type_len,
- gint param_val_len);
-
-static void mgcp_raw_text_add(tvbuff_t *tvb, proto_tree *tree);
-
-/*
- * Some functions which should be moved to a library
- * as I think that people may find them of general usefulness.
- */
-static gint tvb_skip_wsp(tvbuff_t* tvb, gint offset, gint maxlength);
-static gint tvb_find_null_line(tvbuff_t* tvb, gint offset, gint len, gint* next_offset);
-static gint tvb_find_dot_line(tvbuff_t* tvb, gint offset, gint len, gint* next_offset);
-static gboolean is_rfc2234_alpha(guint8 c);
-
-static dissector_handle_t sdp_handle;
-
-
-/*
- * Init Hash table stuff
- */
-
-typedef struct _mgcp_call_info_key
-{
- guint32 transid;
- conversation_t *conversation;
-} mgcp_call_info_key;
-
-static GMemChunk *mgcp_call_info_key_chunk;
-static GMemChunk *mgcp_call_info_value_chunk;
-static GHashTable *mgcp_calls;
-
-/* Compare 2 keys */
-static gint mgcp_call_equal(gconstpointer k1, gconstpointer k2)
-{
- const mgcp_call_info_key* key1 = (const mgcp_call_info_key*) k1;
- const mgcp_call_info_key* key2 = (const mgcp_call_info_key*) k2;
-
- return (key1->transid == key2->transid &&
- key1->conversation == key2->conversation);
-}
-
-/* Calculate a hash key */
-static guint mgcp_call_hash(gconstpointer k)
-{
- const mgcp_call_info_key* key = (const mgcp_call_info_key*) k;
-
- return key->transid + key->conversation->index;
-}
-
-
-
-/************************************************************************
- * dissect_mgcp - The dissector for the Media Gateway Control Protocol
- ************************************************************************/
-static void dissect_mgcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
-{
- gint sectionlen;
- guint32 num_messages;
- gint tvb_sectionend,tvb_sectionbegin, tvb_len, tvb_current_len;
- proto_tree *mgcp_tree, *ti;
- const gchar *verb_name = "";
-
- /* Initialize variables */
- tvb_sectionend = 0;
- tvb_sectionbegin = tvb_sectionend;
- sectionlen = 0;
- tvb_len = tvb_length(tvb);
- tvb_current_len = tvb_len;
- num_messages = 0;
- mgcp_tree = NULL;
- ti = NULL;
-
- /*
- * Set the columns now, so that they'll be set correctly if we throw
- * an exception. We can set them later as well....
- */
- if (check_col(pinfo->cinfo, COL_PROTOCOL))
- col_add_str(pinfo->cinfo, COL_PROTOCOL, "MGCP");
- if (check_col(pinfo->cinfo, COL_INFO))
- col_clear(pinfo->cinfo, COL_INFO);
-
- /*
- * Check to see whether we're really dealing with MGCP by looking
- * for a valid MGCP verb or response code. This isn't infallible,
- * but its cheap and its better than nothing.
- */
- if (is_mgcp_verb(tvb,0,tvb_len, &verb_name) || is_mgcp_rspcode(tvb,0,tvb_len))
- {
- /*
- * Loop through however many mgcp messages may be stuck in
- * this packet using piggybacking
- */
- do
- {
- num_messages++;
- if (tree)
- {
- /* Create our mgcp subtree */
- ti = proto_tree_add_item(tree,proto_mgcp,tvb,0,0, FALSE);
- mgcp_tree = proto_item_add_subtree(ti, ett_mgcp);
- }
-
- sectionlen = tvb_find_dot_line(tvb, tvb_sectionbegin, -1, &tvb_sectionend);
- if (sectionlen != -1)
- {
- dissect_mgcp_message(tvb_new_subset(tvb, tvb_sectionbegin,
- sectionlen, -1),
- pinfo, tree, mgcp_tree,ti);
- tvb_sectionbegin = tvb_sectionend;
- }
- else
- {
- break;
- }
- } while (tvb_sectionend < tvb_len);
-
- if (mgcp_tree)
- {
- proto_tree_add_uint_hidden(mgcp_tree, hf_mgcp_messagecount, tvb,
- 0 ,0 , num_messages);
- }
-
- /*
- * Add our column information after dissecting SDP
- * in order to prevent the column info changing to reflect the SDP
- * (when showing message count)
- */
- tvb_sectionbegin = 0;
- if (check_col(pinfo->cinfo, COL_PROTOCOL))
- {
- if (global_mgcp_message_count == TRUE )
- {
- if (num_messages > 1)
- {
- col_add_fstr(pinfo->cinfo, COL_PROTOCOL, "MGCP (%i messages)",num_messages);
- }
- else
- {
- col_add_fstr(pinfo->cinfo, COL_PROTOCOL, "MGCP (%i message)",num_messages);
- }
- }
- }
-
- if (check_col(pinfo->cinfo, COL_INFO))
- {
- sectionlen = tvb_find_line_end(tvb, tvb_sectionbegin,-1,
- &tvb_sectionend,FALSE);
- col_prepend_fstr(pinfo->cinfo, COL_INFO, "%s",
- tvb_format_text(tvb, tvb_sectionbegin, sectionlen));
- }
- }
-}
-
-#define MAX_MGCP_MESSAGES_IN_PACKET 5
-static mgcp_info_t pi_arr[MAX_MGCP_MESSAGES_IN_PACKET];
-static int pi_current = 0;
-static mgcp_info_t *mi;
-
-/* Dissect an individual MGCP message */
-static void dissect_mgcp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
- proto_tree *mgcp_tree, proto_tree *ti)
-{
- /* Declare variables */
- gint sectionlen;
- gint tvb_sectionend,tvb_sectionbegin, tvb_len, tvb_current_len;
- tvbuff_t *next_tvb;
- const gchar *verb_name = "";
-
- /* Initialise stat info for passing to tap */
- pi_current++;
- if (pi_current == MAX_MGCP_MESSAGES_IN_PACKET)
- {
- /* Overwrite info in first struct if run out of space... */
- pi_current = 0;
- }
- mi = &pi_arr[pi_current];
-
-
- mi->mgcp_type = MGCP_OTHERS;
- mi->code[0] = '\0';
- mi->transid = 0;
- mi->req_time.secs = 0;
- mi->req_time.nsecs = 0;
- mi->is_duplicate = FALSE;
- mi->request_available = FALSE;
- mi->req_num = 0;
- mi->endpointId = NULL;
- mi->observedEvents = NULL;
- mi->rspcode = 0;
- mi->signalReq = NULL;
- mi->hasDigitMap = FALSE;
-
- /* Initialize variables */
- tvb_sectionend = 0;
- tvb_sectionbegin = tvb_sectionend;
- sectionlen = 0;
- tvb_len = tvb_length(tvb);
- tvb_current_len = tvb_len;
-
- /*
- * Check to see whether we're really dealing with MGCP by looking
- * for a valid MGCP verb or response code. This isn't infallible,
- * but its cheap and its better than nothing.
- */
- if (is_mgcp_verb(tvb,0,tvb_len,&verb_name) || is_mgcp_rspcode(tvb,0,tvb_len))
- {
- /* dissect first line */
- tvb_sectionbegin = 0;
- tvb_current_len = tvb_len;
- tvb_sectionend = tvb_sectionbegin;
- sectionlen = tvb_find_line_end(tvb,0,-1,&tvb_sectionend,FALSE);
- if (sectionlen > 0)
- {
- dissect_mgcp_firstline(tvb_new_subset(tvb, tvb_sectionbegin,
- sectionlen,-1), pinfo,
- mgcp_tree);
- }
- tvb_sectionbegin = tvb_sectionend;
-
- /* Dissect params */
- if (tvb_sectionbegin < tvb_len)
- {
- sectionlen = tvb_find_null_line(tvb, tvb_sectionbegin, -1,
- &tvb_sectionend);
- if (sectionlen > 0)
- {
- dissect_mgcp_params(tvb_new_subset(tvb, tvb_sectionbegin, sectionlen, -1),
- mgcp_tree);
- tvb_sectionbegin = tvb_sectionend;
- }
- }
-
- /* Set the mgcp payload length correctly so we don't include any
- encapsulated SDP */
- sectionlen = tvb_sectionend;
- proto_item_set_len(ti,sectionlen);
-
- /* Display the raw text of the mgcp message if desired */
-
- /* Do we want to display the raw text of our MGCP packet? */
- if (global_mgcp_raw_text)
- {
- if (tree)
- mgcp_raw_text_add(tvb, mgcp_tree);
- }
-
- /* Dissect sdp payload */
- if (tvb_sectionend < tvb_len)
- {
- next_tvb = tvb_new_subset(tvb, tvb_sectionend, -1, -1);
- call_dissector(sdp_handle, next_tvb, pinfo, tree);
- }
- }
-}
-
-
-/*
- * Add the raw text of the message to the dissect tree if appropriate
- * preferences are specified.
- */
-static void mgcp_raw_text_add(tvbuff_t *tvb, proto_tree *tree)
-{
- gint tvb_linebegin,tvb_lineend,tvb_len,linelen;
-
- tvb_linebegin = 0;
- tvb_len = tvb_length(tvb);
-
- do
- {
- tvb_find_line_end(tvb,tvb_linebegin,-1,&tvb_lineend,FALSE);
- linelen = tvb_lineend - tvb_linebegin;
- proto_tree_add_text(tree, tvb, tvb_linebegin, linelen, "%s",
- tvb_format_text(tvb, tvb_linebegin, linelen));
- tvb_linebegin = tvb_lineend;
- } while (tvb_lineend < tvb_len);
-}
-
-/* Discard and init any state we've saved */
-static void mgcp_init_protocol(void)
-{
- if (mgcp_calls != NULL)
- {
- g_hash_table_destroy(mgcp_calls);
- mgcp_calls = NULL;
- }
- if (mgcp_call_info_key_chunk != NULL)
- {
- g_mem_chunk_destroy(mgcp_call_info_key_chunk);
- mgcp_call_info_key_chunk = NULL;
- }
- if (mgcp_call_info_value_chunk != NULL)
- {
- g_mem_chunk_destroy(mgcp_call_info_value_chunk);
- mgcp_call_info_value_chunk = NULL;
- }
-
- mgcp_calls = g_hash_table_new(mgcp_call_hash, mgcp_call_equal);
- mgcp_call_info_key_chunk = g_mem_chunk_new("call_info_key_chunk",
- sizeof(mgcp_call_info_key),
- 200 * sizeof(mgcp_call_info_key),
- G_ALLOC_ONLY);
- mgcp_call_info_value_chunk = g_mem_chunk_new("call_info_value_chunk",
- sizeof(mgcp_call_t),
- 200 * sizeof(mgcp_call_t),
- G_ALLOC_ONLY);
-}
-
-/* Register all the bits needed with the filtering engine */
-void proto_register_mgcp(void)
-{
- static hf_register_info hf[] =
- {
- { &hf_mgcp_req,
- { "Request", "mgcp.req", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
- "True if MGCP request", HFILL }},
- { &hf_mgcp_rsp,
- { "Response", "mgcp.rsp", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
- "TRUE if MGCP response", HFILL }},
- { &hf_mgcp_req_frame,
- { "Request Frame", "mgcp.reqframe", FT_FRAMENUM, BASE_NONE, NULL, 0,
- "Request Frame", HFILL }},
- { &hf_mgcp_rsp_frame,
- { "Response Frame", "mgcp.rspframe", FT_FRAMENUM, BASE_NONE, NULL, 0,
- "Response Frame", HFILL }},
- { &hf_mgcp_time,
- { "Time from request", "mgcp.time", FT_RELATIVE_TIME, BASE_NONE, NULL, 0,
- "Timedelta between Request and Response", HFILL }},
- { &hf_mgcp_req_verb,
- { "Verb", "mgcp.req.verb", FT_STRING, BASE_DEC, NULL, 0x0,
- "Name of the verb", HFILL }},
- { &hf_mgcp_req_endpoint,
- { "Endpoint", "mgcp.req.endpoint", FT_STRING, BASE_DEC, NULL, 0x0,
- "Endpoint referenced by the message", HFILL }},
- { &hf_mgcp_transid,
- { "Transaction ID", "mgcp.transid", FT_STRING, BASE_DEC, NULL, 0x0,
- "Transaction ID of this message", HFILL }},
- { &hf_mgcp_version,
- { "Version", "mgcp.version", FT_STRING, BASE_DEC, NULL, 0x0,
- "MGCP Version", HFILL }},
- { &hf_mgcp_rsp_rspcode,
- { "Response Code", "mgcp.rsp.rspcode", FT_UINT32, BASE_DEC, VALS(mgcp_return_code_vals), 0x0,
- "Response Code", HFILL }},
- { &hf_mgcp_rsp_rspstring,
- { "Response String", "mgcp.rsp.rspstring", FT_STRING, BASE_DEC, NULL, 0x0,
- "Response String", HFILL }},
- { &hf_mgcp_params,
- { "Parameters", "mgcp.params", FT_NONE, 0, NULL, 0x0,
- "MGCP parameters", HFILL }},
- { &hf_mgcp_param_rspack,
- { "ResponseAck (K)", "mgcp.param.rspack", FT_STRING, BASE_DEC, NULL, 0x0,
- "Response Ack", HFILL }},
- { &hf_mgcp_param_bearerinfo,
- { "BearerInformation (B)", "mgcp.param.bearerinfo", FT_STRING, BASE_DEC, NULL, 0x0,
- "Bearer Information", HFILL }},
- { &hf_mgcp_param_callid,
- { "CallId (C)", "mgcp.param.callid", FT_STRING, BASE_DEC, NULL, 0x0,
- "Call Id", HFILL }},
- { &hf_mgcp_param_connectionid,
- {"ConnectionIdentifier (I)", "mgcp.param.connectionid", FT_STRING, BASE_DEC, NULL, 0x0,
- "Connection Identifier", HFILL }},
- { &hf_mgcp_param_secondconnectionid,
- { "SecondConnectionID (I2)", "mgcp.param.secondconnectionid", FT_STRING, BASE_DEC, NULL, 0x0,
- "Second Connection Identifier", HFILL }},
- { &hf_mgcp_param_notifiedentity,
- { "NotifiedEntity (N)", "mgcp.param.notifiedentity", FT_STRING, BASE_DEC, NULL, 0x0,
- "Notified Entity", HFILL }},
- { &hf_mgcp_param_requestid,
- { "RequestIdentifier (X)", "mgcp.param.requestid", FT_STRING, BASE_DEC, NULL, 0x0,
- "Request Identifier", HFILL }},
- { &hf_mgcp_param_localconnoptions,
- { "LocalConnectionOptions (L)", "mgcp.param.localconnectionoptions", FT_STRING, BASE_DEC, NULL, 0x0,
- "Local Connection Options", HFILL }},
- { &hf_mgcp_param_localconnoptions_p,
- { "Packetization period (p)", "mgcp.param.localconnectionoptions.p", FT_UINT32, BASE_DEC, NULL, 0x0,
- "Packetization period", HFILL }},
- { &hf_mgcp_param_localconnoptions_a,
- { "Codecs (a)", "mgcp.param.localconnectionoptions.a", FT_STRING, BASE_DEC, NULL, 0x0,
- "Codecs", HFILL }},
- { &hf_mgcp_param_localconnoptions_s,
- { "Silence Suppression (s)", "mgcp.param.localconnectionoptions.s", FT_STRING, BASE_DEC, NULL, 0x0,
- "Silence Suppression", HFILL }},
- { &hf_mgcp_param_localconnoptions_e,
- { "Echo Cancellation (e)", "mgcp.param.localconnectionoptions.e", FT_STRING, BASE_DEC, NULL, 0x0,
- "Echo Cancellation", HFILL }},
- { &hf_mgcp_param_localconnoptions_scrtp,
- { "RTP ciphersuite (sc-rtp)", "mgcp.param.localconnectionoptions.scrtp", FT_STRING, BASE_DEC, NULL, 0x0,
- "RTP ciphersuite", HFILL }},
- { &hf_mgcp_param_localconnoptions_scrtcp,
- { "RTCP ciphersuite (sc-rtcp)", "mgcp.param.localconnectionoptions.scrtcp", FT_STRING, BASE_DEC, NULL, 0x0,
- "RTCP ciphersuite", HFILL }},
- { &hf_mgcp_param_localconnoptions_b,
- { "Bandwidth (b)", "mgcp.param.localconnectionoptions.b", FT_STRING, BASE_DEC, NULL, 0x0,
- "Bandwidth", HFILL }},
- { &hf_mgcp_param_localconnoptions_esccd,
- { "Content Destination (es-ccd)", "mgcp.param.localconnectionoptions.esccd", FT_STRING, BASE_DEC, NULL, 0x0,
- "Content Destination", HFILL }},
- { &hf_mgcp_param_localconnoptions_escci,
- { "Content Identifier (es-cci)", "mgcp.param.localconnectionoptions.escci", FT_STRING, BASE_DEC, NULL, 0x0,
- "Content Identifier", HFILL }},
- { &hf_mgcp_param_localconnoptions_dqgi,
- { "D-QoS GateID (dq-gi)", "mgcp.param.localconnectionoptions.dqgi", FT_STRING, BASE_DEC, NULL, 0x0,
- "D-QoS GateID", HFILL }},
- { &hf_mgcp_param_localconnoptions_dqrd,
- { "D-QoS Reserve Destination (dq-rd)", "mgcp.param.localconnectionoptions.dqrd", FT_STRING, BASE_DEC, NULL, 0x0,
- "D-QoS Reserve Destination", HFILL }},
- { &hf_mgcp_param_localconnoptions_dqri,
- { "D-QoS Resource ID (dq-ri)", "mgcp.param.localconnectionoptions.dqri", FT_STRING, BASE_DEC, NULL, 0x0,
- "D-QoS Resource ID", HFILL }},
- { &hf_mgcp_param_localconnoptions_dqrr,
- { "D-QoS Resource Reservation (dq-rr)", "mgcp.param.localconnectionoptions.dqrr", FT_STRING, BASE_DEC, NULL, 0x0,
- "D-QoS Resource Reservation", HFILL }},
- { &hf_mgcp_param_localconnoptions_k,
- { "Encryption Key (k)", "mgcp.param.localconnectionoptions.k", FT_STRING, BASE_DEC, NULL, 0x0,
- "Encryption Key", HFILL }},
- { &hf_mgcp_param_localconnoptions_gc,
- { "Gain Control (gc)", "mgcp.param.localconnectionoptions.gc", FT_UINT32, BASE_DEC, NULL, 0x0,
- "Gain Control", HFILL }},
- { &hf_mgcp_param_localconnoptions_fmtp,
- { "Media Format (fmtp)", "mgcp.param.localconnectionoptions.fmtp", FT_STRING, BASE_DEC, NULL, 0x0,
- "Media Format", HFILL }},
- { &hf_mgcp_param_localconnoptions_nt,
- { "Network Type (nt)", "mgcp.param.localconnectionoptions.nt", FT_STRING, BASE_DEC, NULL, 0x0,
- "Network Type", HFILL }},
- { &hf_mgcp_param_localconnoptions_ofmtp,
- { "Optional Media Format (o-fmtp)", "mgcp.param.localconnectionoptions.ofmtp", FT_STRING, BASE_DEC, NULL, 0x0,
- "Optional Media Format", HFILL }},
- { &hf_mgcp_param_localconnoptions_r,
- { "Resource Reservation (r)", "mgcp.param.localconnectionoptions.r", FT_STRING, BASE_DEC, NULL, 0x0,
- "Resource Reservation", HFILL }},
- { &hf_mgcp_param_localconnoptions_t,
- { "Type of Service (r)", "mgcp.param.localconnectionoptions.t", FT_STRING, BASE_DEC, NULL, 0x0,
- "Type of Service", HFILL }},
- { &hf_mgcp_param_localconnoptions_rcnf,
- { "Reservation Confirmation (r-cnf)", "mgcp.param.localconnectionoptions.rcnf", FT_STRING, BASE_DEC, NULL, 0x0,
- "Reservation Confirmation", HFILL }},
- { &hf_mgcp_param_localconnoptions_rdir,
- { "Reservation Direction (r-dir)", "mgcp.param.localconnectionoptions.rdir", FT_STRING, BASE_DEC, NULL, 0x0,
- "Reservation Direction", HFILL }},
- { &hf_mgcp_param_localconnoptions_rsh,
- { "Resource Sharing (r-sh)", "mgcp.param.localconnectionoptions.rsh", FT_STRING, BASE_DEC, NULL, 0x0,
- "Resource Sharing", HFILL }},
- { &hf_mgcp_param_connectionmode,
- { "ConnectionMode (M)", "mgcp.param.connectionmode", FT_STRING, BASE_DEC, NULL, 0x0,
- "Connection Mode", HFILL }},
- { &hf_mgcp_param_reqevents,
- { "RequestedEvents (R)", "mgcp.param.reqevents", FT_STRING, BASE_DEC, NULL, 0x0,
- "Requested Events", HFILL }},
- { &hf_mgcp_param_signalreq,
- { "SignalRequests (S)", "mgcp.param.signalreq", FT_STRING, BASE_DEC, NULL, 0x0,
- "Signal Request", HFILL }},
- { &hf_mgcp_param_restartmethod,
- { "RestartMethod (RM)", "mgcp.param.restartmethod", FT_STRING, BASE_DEC, NULL, 0x0,
- "Restart Method", HFILL }},
- { &hf_mgcp_param_restartdelay,
- { "RestartDelay (RD)", "mgcp.param.restartdelay", FT_STRING, BASE_DEC, NULL, 0x0,
- "Restart Delay", HFILL }},
- { &hf_mgcp_param_digitmap,
- { "DigitMap (D)", "mgcp.param.digitmap", FT_STRING, BASE_DEC, NULL, 0x0,
- "Digit Map", HFILL }},
- { &hf_mgcp_param_observedevent,
- { "ObservedEvents (O)", "mgcp.param.observedevents", FT_STRING, BASE_DEC, NULL, 0x0,
- "Observed Events", HFILL }},
- { &hf_mgcp_param_connectionparam,
- { "ConnectionParameters (P)", "mgcp.param.connectionparam", FT_STRING, BASE_DEC, NULL, 0x0,
- "Connection Parameters", HFILL }},
- { &hf_mgcp_param_connectionparam_ps,
- { "Packets sent (PS)", "mgcp.param.connectionparam.ps", FT_UINT32, BASE_DEC, NULL, 0x0,
- "Packets sent (P:PS)", HFILL }},
- { &hf_mgcp_param_connectionparam_os,
- { "Octets sent (OS)", "mgcp.param.connectionparam.os", FT_UINT32, BASE_DEC, NULL, 0x0,
- "Octets sent (P:OS)", HFILL }},
- { &hf_mgcp_param_connectionparam_pr,
- { "Packets received (PR)", "mgcp.param.connectionparam.pr", FT_UINT32, BASE_DEC, NULL, 0x0,
- "Packets received (P:PR)", HFILL }},
- { &hf_mgcp_param_connectionparam_or,
- { "Octets received (OR)", "mgcp.param.connectionparam.or", FT_UINT32, BASE_DEC, NULL, 0x0,
- "Octets received (P:OR)", HFILL }},
- { &hf_mgcp_param_connectionparam_pl,
- { "Packets lost (PL)", "mgcp.param.connectionparam.pl", FT_UINT32, BASE_DEC, NULL, 0x0,
- "Packets lost (P:PL)", HFILL }},
- { &hf_mgcp_param_connectionparam_ji,
- { "Jitter (JI)", "mgcp.param.connectionparam.ji", FT_UINT32, BASE_DEC, NULL, 0x0,
- "Average inter-packet arrival jitter in milliseconds (P:JI)", HFILL }},
- { &hf_mgcp_param_connectionparam_la,
- { "Latency (LA)", "mgcp.param.connectionparam.la", FT_UINT32, BASE_DEC, NULL, 0x0,
- "Average latency in milliseconds (P:LA)", HFILL }},
- { &hf_mgcp_param_connectionparam_pcrps,
- { "Remote Packets sent (PC/RPS)", "mgcp.param.connectionparam.pcrps", FT_UINT32, BASE_DEC, NULL, 0x0,
- "Remote Packets sent (P:PC/RPS)", HFILL }},
- { &hf_mgcp_param_connectionparam_pcros,
- { "Remote Octets sent (PC/ROS)", "mgcp.param.connectionparam.pcros", FT_UINT32, BASE_DEC, NULL, 0x0,
- "Remote Octets sent (P:PC/ROS)", HFILL }},
- { &hf_mgcp_param_connectionparam_pcrpl,
- { "Remote Packets lost (PC/RPL)", "mgcp.param.connectionparam.pcrpl", FT_UINT32, BASE_DEC, NULL, 0x0,
- "Remote Packets lost (P:PC/RPL)", HFILL }},
- { &hf_mgcp_param_connectionparam_pcrji,
- { "Remote Jitter (PC/RJI)", "mgcp.param.connectionparam.pcrji", FT_UINT32, BASE_DEC, NULL, 0x0,
- "Remote Jitter (P:PC/RJI)", HFILL }},
- { &hf_mgcp_param_connectionparam_x,
- { "Vendor Extension", "mgcp.param.connectionparam.x", FT_STRING, BASE_DEC, NULL, 0x0,
- "Vendor Extension (P:X-*)", HFILL }},
- { &hf_mgcp_param_reasoncode,
- { "ReasonCode (E)", "mgcp.param.reasoncode", FT_STRING, BASE_DEC, NULL, 0x0,
- "Reason Code", HFILL }},
- { &hf_mgcp_param_eventstates,
- { "EventStates (ES)", "mgcp.param.eventstates", FT_STRING, BASE_DEC, NULL, 0x0,
- "Event States", HFILL }},
- { &hf_mgcp_param_specificendpoint,
- { "SpecificEndpointID (Z)", "mgcp.param.specificendpointid", FT_STRING, BASE_DEC, NULL, 0x0,
- "Specific Endpoint ID", HFILL }},
- { &hf_mgcp_param_secondendpointid,
- { "SecondEndpointID (Z2)", "mgcp.param.secondendpointid", FT_STRING, BASE_DEC, NULL, 0x0,
- "Second Endpoing ID", HFILL }},
- { &hf_mgcp_param_reqinfo,
- { "RequestedInfo (F)", "mgcp.param.reqinfo", FT_STRING, BASE_DEC, NULL, 0x0,
- "Requested Info", HFILL }},
- { &hf_mgcp_param_quarantinehandling,
- { "QuarantineHandling (Q)", "mgcp.param.quarantinehandling", FT_STRING, BASE_DEC, NULL, 0x0,
- "Quarantine Handling", HFILL }},
- { &hf_mgcp_param_detectedevents,
- { "DetectedEvents (T)", "mgcp.param.detectedevents", FT_STRING, BASE_DEC, NULL, 0x0,
- "Detected Events", HFILL }},
- { &hf_mgcp_param_capabilities,
- { "Capabilities (A)", "mgcp.param.capabilities", FT_STRING, BASE_DEC, NULL, 0x0,
- "Capabilities", HFILL }},
- { &hf_mgcp_param_maxmgcpdatagram,
- {"MaxMGCPDatagram (MD)", "mgcp.param.maxmgcpdatagram", FT_STRING, BASE_DEC, NULL, 0x0,
- "Maximum MGCP Datagram size", HFILL }},
- { &hf_mgcp_param_packagelist,
- {"PackageList (PL)", "mgcp.param.packagelist", FT_STRING, BASE_DEC, NULL, 0x0,
- "Package List", HFILL }},
- { &hf_mgcp_param_extension,
- { "Extension Parameter (non-critical)", "mgcp.param.extension", FT_STRING, BASE_DEC, NULL, 0x0,
- "Extension Parameter", HFILL }},
- { &hf_mgcp_param_extension_critical,
- { "Extension Parameter (critical)", "mgcp.param.extensioncritical", FT_STRING, BASE_DEC, NULL, 0x0,
- "Critical Extension Parameter", HFILL }},
- { &hf_mgcp_param_invalid,
- { "Invalid Parameter", "mgcp.param.invalid", FT_STRING, BASE_DEC, NULL, 0x0,
- "Invalid Parameter", HFILL }},
- { &hf_mgcp_messagecount,
- { "MGCP Message Count", "mgcp.messagecount", FT_UINT32, BASE_DEC, NULL, 0x0,
- "Number of MGCP message in a packet", HFILL }},
- { &hf_mgcp_dup,
- { "Duplicate Message", "mgcp.dup", FT_UINT32, BASE_DEC, NULL, 0x0,
- "Duplicate Message", HFILL }},
- { &hf_mgcp_req_dup,
- { "Duplicate Request", "mgcp.req.dup", FT_UINT32, BASE_DEC, NULL, 0x0,
- "Duplicate Request", HFILL }},
- { &hf_mgcp_req_dup_frame,
- { "Original Request Frame", "mgcp.req.dup.frame", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
- "Frame containing original request", HFILL }},
- { &hf_mgcp_rsp_dup,
- { "Duplicate Response", "mgcp.rsp.dup", FT_UINT32, BASE_DEC, NULL, 0x0,
- "Duplicate Response", HFILL }},
- { &hf_mgcp_rsp_dup_frame,
- { "Original Response Frame", "mgcp.rsp.dup.frame", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
- "Frame containing original response", HFILL }},
- };
-
- static gint *ett[] =
- {
- &ett_mgcp,
- &ett_mgcp_param,
- &ett_mgcp_param_connectionparam,
- &ett_mgcp_param_localconnectionoptions
- };
-
- module_t *mgcp_module;
-
- /* Register protocol */
- proto_mgcp = proto_register_protocol("Media Gateway Control Protocol", "MGCP", "mgcp");
- proto_register_field_array(proto_mgcp, hf, array_length(hf));
- proto_register_subtree_array(ett, array_length(ett));
- register_init_routine(&mgcp_init_protocol);
-
- register_dissector("mgcp", dissect_mgcp, proto_mgcp);
-
- /* Register our configuration options */
- mgcp_module = prefs_register_protocol(proto_mgcp, proto_reg_handoff_mgcp);
-
- prefs_register_uint_preference(mgcp_module, "tcp.gateway_port",
- "MGCP Gateway TCP Port",
- "Set the UDP port for gateway messages "
- "(if other than the default of 2427)",
- 10, &global_mgcp_gateway_tcp_port);
-
- prefs_register_uint_preference(mgcp_module, "udp.gateway_port",
- "MGCP Gateway UDP Port",
- "Set the TCP port for gateway messages "
- "(if other than the default of 2427)",
- 10, &global_mgcp_gateway_udp_port);
-
- prefs_register_uint_preference(mgcp_module, "tcp.callagent_port",
- "MGCP Callagent TCP Port",
- "Set the TCP port for callagent messages "
- "(if other than the default of 2727)",
- 10, &global_mgcp_callagent_tcp_port);
-
- prefs_register_uint_preference(mgcp_module, "udp.callagent_port",
- "MGCP Callagent UDP Port",
- "Set the UDP port for callagent messages "
- "(if other than the default of 2727)",
- 10, &global_mgcp_callagent_udp_port);
-
-
- prefs_register_bool_preference(mgcp_module, "display_raw_text",
- "Display raw text for MGCP message",
- "Specifies that the raw text of the "
- "MGCP message should be displayed "
- "instead of (or in addition to) the "
- "dissection tree",
- &global_mgcp_raw_text);
-
- prefs_register_obsolete_preference(mgcp_module, "display_dissect_tree");
-
- prefs_register_bool_preference(mgcp_module, "display_mgcp_message_count",
- "Display the number of MGCP messages",
- "Display the number of MGCP messages "
- "found in a packet in the protocol column.",
- &global_mgcp_message_count);
-
- mgcp_tap = register_tap("mgcp");
-}
-
-/* The registration hand-off routine */
-void proto_reg_handoff_mgcp(void)
-{
- static int mgcp_prefs_initialized = FALSE;
- static dissector_handle_t mgcp_handle;
-
- /* Get a handle for the SDP dissector. */
- sdp_handle = find_dissector("sdp");
-
- if (!mgcp_prefs_initialized)
- {
- mgcp_handle = create_dissector_handle(dissect_mgcp, proto_mgcp);
- mgcp_prefs_initialized = TRUE;
- }
- else
- {
- dissector_delete("tcp.port", gateway_tcp_port, mgcp_handle);
- dissector_delete("udp.port", gateway_udp_port, mgcp_handle);
- dissector_delete("tcp.port", callagent_tcp_port, mgcp_handle);
- dissector_delete("udp.port", callagent_udp_port, mgcp_handle);
- }
-
- /* Set our port number for future use */
- gateway_tcp_port = global_mgcp_gateway_tcp_port;
- gateway_udp_port = global_mgcp_gateway_udp_port;
-
- callagent_tcp_port = global_mgcp_callagent_tcp_port;
- callagent_udp_port = global_mgcp_callagent_udp_port;
-
- dissector_add("tcp.port", global_mgcp_gateway_tcp_port, mgcp_handle);
- dissector_add("udp.port", global_mgcp_gateway_udp_port, mgcp_handle);
- dissector_add("tcp.port", global_mgcp_callagent_tcp_port, mgcp_handle);
- dissector_add("udp.port", global_mgcp_callagent_udp_port, mgcp_handle);
-}
-
-/*
- * is_mgcp_verb - A function for determining whether there is a
- * MGCP verb at offset in tvb
- *
- * Parameter:
- * tvb - The tvbuff in which we are looking for an MGCP verb
- * offset - The offset in tvb at which we are looking for a MGCP verb
- * maxlength - The maximum distance from offset we may look for the
- * characters that make up a MGCP verb.
- * verb_name - The name for the verb code found (output)
- *
- * Return: TRUE if there is an MGCP verb at offset in tvb, otherwise FALSE
- */
-static gboolean is_mgcp_verb(tvbuff_t *tvb, gint offset, gint maxlength, const gchar **verb_name)
-{
- int returnvalue = FALSE;
- gchar word[5];
-
- /* Read the string into 'word' and see if it looks like the start of a verb */
- if ((maxlength >= 4) && tvb_get_nstringz0(tvb, offset, sizeof(word), word))
- {
- if (((g_ascii_strncasecmp(word, "EPCF", 4) == 0) && (*verb_name = "EndpointConfiguration")) ||
- ((g_ascii_strncasecmp(word, "CRCX", 4) == 0) && (*verb_name = "CreateConnection")) ||
- ((g_ascii_strncasecmp(word, "MDCX", 4) == 0) && (*verb_name = "ModifyConnection")) ||
- ((g_ascii_strncasecmp(word, "DLCX", 4) == 0) && (*verb_name = "DeleteConnection")) ||
- ((g_ascii_strncasecmp(word, "RQNT", 4) == 0) && (*verb_name = "NotificationRequest")) ||
- ((g_ascii_strncasecmp(word, "NTFY", 4) == 0) && (*verb_name = "Notify")) ||
- ((g_ascii_strncasecmp(word, "AUEP", 4) == 0) && (*verb_name = "AuditEndpoint")) ||
- ((g_ascii_strncasecmp(word, "AUCX", 4) == 0) && (*verb_name = "AuditConnection")) ||
- ((g_ascii_strncasecmp(word, "RSIP", 4) == 0) && (*verb_name = "RestartInProgress")) ||
- ((g_ascii_strncasecmp(word, "MESG", 4) == 0) && (*verb_name = "Message")) ||
- (word[0] == 'X' && is_rfc2234_alpha(word[1]) && is_rfc2234_alpha(word[2]) &&
- is_rfc2234_alpha(word[3]) && (*verb_name = "*Experimental*")))
- {
- returnvalue = TRUE;
- }
- }
-
- /* May be whitespace after verb code - anything else is an error.. */
- if (returnvalue && maxlength >= 5)
- {
- char next = tvb_get_guint8(tvb,4);
- if ((next != ' ') && (next != '\t'))
- {
- returnvalue = FALSE;
- }
- }
-
- return returnvalue;
-}
-
-/*
- * is_mgcp_rspcode - A function for determining whether something which
- * looks roughly like a MGCP response code (3-digit number)
- * is at 'offset' in tvb
- *
- * Parameters:
- * tvb - The tvbuff in which we are looking for an MGCP response code
- * offset - The offset in tvb at which we are looking for a MGCP response code
- * maxlength - The maximum distance from offset we may look for the
- * characters that make up a MGCP response code.
- *
- * Return: TRUE if there is an MGCP response code at offset in tvb,
- * otherwise FALSE
- */
-static gboolean is_mgcp_rspcode(tvbuff_t *tvb, gint offset, gint maxlength)
-{
- int returnvalue = FALSE;
- guint8 word[4];
-
- /* Do 1st 3 characters look like digits? */
- if (maxlength >= 3)
- {
- tvb_get_nstringz0(tvb, offset, sizeof(word), word);
- if (isdigit(word[0]) && isdigit(word[1]) && isdigit(word[2]))
- {
- returnvalue = TRUE;
- }
- }
-
- /* Maybe some white space after the 3rd digit - anything else is an error */
- if (returnvalue && maxlength >= 4)
- {
- char next = tvb_get_guint8(tvb, 3);
- if ((next != ' ') && (next != '\t'))
- {
- returnvalue = FALSE;
- }
- }
-
- return returnvalue;
-}
-
-/*
- * is_rfc2234_alpha - Indicates whether the character c is an alphabetical
- * character. This function is used instead of
- * isalpha because isalpha may deviate from the rfc2234
- * definition of ALPHA in some locales.
- *
- * Parameter:
- * c - The character being checked for being an alphabetical character.
- *
- * Return: TRUE if c is an upper or lower case alphabetical character,
- * FALSE otherwise.
- */
-static gboolean is_rfc2234_alpha(guint8 c)
-{
- return ((c <= 'Z' && c >= 'A' ) || (c <= 'z' && c >= 'a'));
-}
-
-
-/*
- * tvb_parse_param - Parse the MGCP param into a type and a value.
- *
- * Parameters:
- * tvb - The tvbuff containing the MGCP param we are to parse.
- * offset - The offset in tvb at which we will begin looking for a
- * MGCP parameter to parse.
- * len - The maximum distance from offset in tvb that we can look for
- * an MGCP parameter to parse.
- * hf - The place to write a pointer to the integer representing the
- * header field associated with the MGCP parameter parsed.
- *
- * Returns: The offset in tvb where the value of the MGCP parameter
- * begins.
- */
-static gint tvb_parse_param(tvbuff_t* tvb, gint offset, gint len, int** hf)
-{
- gint returnvalue = -1, tvb_current_offset,counter;
- guint8 tempchar, plus_minus;
- gchar **buf;
-
- tvb_current_offset = offset;
- *hf = NULL;
- buf=NULL;
-
- if (len > 0)
- {
- tempchar = tvb_get_guint8(tvb,tvb_current_offset);
-
- switch (tempchar)
- {
- case 'K':
- if (tvb_get_guint8(tvb,tvb_current_offset+1) != ':')
- {
- *hf = &hf_mgcp_param_invalid;
- break;
- }
- *hf = &hf_mgcp_param_rspack;
- break;
- case 'B':
- if (tvb_get_guint8(tvb,tvb_current_offset+1) != ':')
- {
- *hf = &hf_mgcp_param_invalid;
- break;
- }
- *hf = &hf_mgcp_param_bearerinfo;
- break;
- case 'C':
- if (tvb_get_guint8(tvb,tvb_current_offset+1) != ':')
- {
- *hf = &hf_mgcp_param_invalid;
- break;
- }
- *hf = &hf_mgcp_param_callid;
- break;
- case 'I':
- tvb_current_offset++;
- if (len > (tvb_current_offset - offset) &&
- (tempchar = tvb_get_guint8(tvb,tvb_current_offset)) == ':')
- {
- *hf = &hf_mgcp_param_connectionid;
- tvb_current_offset--;
- }
- else
- if (tempchar == '2')
- {
- *hf = &hf_mgcp_param_secondconnectionid;
- }
- break;
- case 'N':
- if (tvb_get_guint8(tvb,tvb_current_offset+1) != ':')
- {
- *hf = &hf_mgcp_param_invalid;
- break;
- }
- *hf = &hf_mgcp_param_notifiedentity;
- break;
- case 'X':
- /* Move past 'X' */
- tvb_current_offset++;
-
- /* X: is RequestIdentifier */
- if (len > (tvb_current_offset - offset) &&
- (tempchar = tvb_get_guint8(tvb,tvb_current_offset)) == ':')
- {
- *hf = &hf_mgcp_param_requestid;
- tvb_current_offset--;
- }
-
- /* X+...: or X-....: are vendor extension parameters */
- else
- if (len > (tvb_current_offset - offset) &&
- ((plus_minus = tvb_get_guint8(tvb,tvb_current_offset)) == '-' ||
- (plus_minus == '+')))
- {
- /* Move past + or - */
- tvb_current_offset++;
-
- /* Keep going, through possible vendor param name */
- for (counter = 1;
- ((len > (counter + tvb_current_offset-offset)) &&
- (is_rfc2234_alpha(tempchar = tvb_get_guint8(tvb, tvb_current_offset+counter)) ||
- isdigit(tempchar))) ;
- counter++);
-
- if (tempchar == ':')
- {
- /* Looks like a valid vendor param name */
- tvb_current_offset += counter;
- switch (plus_minus)
- {
- case '+':
- *hf = &hf_mgcp_param_extension_critical;
- break;
- case '-':
- *hf = &hf_mgcp_param_extension;
- break;
- }
- }
- }
- break;
- case 'L':
- if (tvb_get_guint8(tvb,tvb_current_offset+1) != ':')
- {
- *hf = &hf_mgcp_param_invalid;
- break;
- }
- *hf = &hf_mgcp_param_localconnoptions;
- break;
- case 'M':
- tvb_current_offset++;
- if (len > (tvb_current_offset - offset) &&
- (tempchar = tvb_get_guint8(tvb,tvb_current_offset)) == ':')
- {
- *hf = &hf_mgcp_param_connectionmode;
- tvb_current_offset--;
- }
- else
- if (tempchar == 'D')
- {
- *hf = &hf_mgcp_param_maxmgcpdatagram;
- }
- break;
- case 'R':
- tvb_current_offset++;
- if (len > (tvb_current_offset - offset) &&
- (tempchar = tvb_get_guint8(tvb,tvb_current_offset)) == ':')
- {
- *hf = &hf_mgcp_param_reqevents;
- tvb_current_offset--;
- }
- else
- if ( tempchar == 'M')
- {
- *hf = &hf_mgcp_param_restartmethod;
- }
- else
- if (tempchar == 'D')
- {
- *hf = &hf_mgcp_param_restartdelay;
- }
- break;
- case 'S':
- if (tvb_get_guint8(tvb,tvb_current_offset+1) != ':')
- {
- *hf = &hf_mgcp_param_invalid;
- break;
- }
- *hf = &hf_mgcp_param_signalreq;
- buf = &(mi->signalReq);
- break;
- case 'D':
- if (tvb_get_guint8(tvb,tvb_current_offset+1) != ':')
- {
- *hf = &hf_mgcp_param_invalid;
- break;
- }
- *hf = &hf_mgcp_param_digitmap;
- mi->hasDigitMap = TRUE;
- break;
- case 'O':
- if (tvb_get_guint8(tvb,tvb_current_offset+1) != ':')
- {
- *hf = &hf_mgcp_param_invalid;
- break;
- }
- *hf = &hf_mgcp_param_observedevent;
- buf = &(mi->observedEvents);
- break;
- case 'P':
- tvb_current_offset++;
- if (len > (tvb_current_offset - offset) &&
- (tempchar = tvb_get_guint8(tvb,tvb_current_offset)) == ':')
- {
- *hf = &hf_mgcp_param_connectionparam;
- tvb_current_offset--;
- }
- else
- if ( tempchar == 'L')
- {
- *hf = &hf_mgcp_param_packagelist;
- }
- break;
- case 'E':
- tvb_current_offset++;
- if (len > (tvb_current_offset - offset) &&
- (tempchar = tvb_get_guint8(tvb,tvb_current_offset)) == ':')
- {
- *hf = &hf_mgcp_param_reasoncode;
- tvb_current_offset--;
- }
- else
- if ( tempchar == 'S')
- {
- *hf = &hf_mgcp_param_eventstates;
- }
- break;
- case 'Z':
- tvb_current_offset++;
- if (len > (tvb_current_offset - offset) &&
- (tempchar = tvb_get_guint8(tvb,tvb_current_offset)) == ':')
- {
- *hf = &hf_mgcp_param_specificendpoint;
- tvb_current_offset--;
- }
- else
- if (tempchar == '2')
- {
- *hf = &hf_mgcp_param_secondendpointid;
- }
- break;
- case 'F':
- if (tvb_get_guint8(tvb,tvb_current_offset+1) != ':')
- {
- *hf = &hf_mgcp_param_invalid;
- break;
- }
- *hf = &hf_mgcp_param_reqinfo;
- break;
- case 'Q':
- if (tvb_get_guint8(tvb,tvb_current_offset+1) != ':')
- {
- *hf = &hf_mgcp_param_invalid;
- break;
- }
- *hf = &hf_mgcp_param_quarantinehandling;
- break;
- case 'T':
- if (tvb_get_guint8(tvb,tvb_current_offset+1) != ':')
- {
- *hf = &hf_mgcp_param_invalid;
- break;
- }
- *hf = &hf_mgcp_param_detectedevents;
- break;
- case 'A':
- if (tvb_get_guint8(tvb,tvb_current_offset+1) != ':')
- {
- *hf = &hf_mgcp_param_invalid;
- break;
- }
- *hf = &hf_mgcp_param_capabilities;
- break;
-
- default:
- *hf = &hf_mgcp_param_invalid;
- break;
- }
-
- /* Move to (hopefully) the colon */
- tvb_current_offset++;
-
- /* Add a recognised parameter type if we have one */
- if (*hf != NULL && len > (tvb_current_offset - offset) &&
- (tempchar = tvb_get_guint8(tvb,tvb_current_offset)) == ':')
- {
- tvb_current_offset++;
- tvb_current_offset = tvb_skip_wsp(tvb,tvb_current_offset, (len - tvb_current_offset + offset));
- returnvalue = tvb_current_offset;
-
- /* set the observedEvents or signalReq used in Voip Calls analysis */
- if (buf != NULL) {
- *buf = tvb_get_ephemeral_string(tvb, tvb_current_offset, (len - tvb_current_offset + offset));
- }
- }
- }
- else
- {
- /* Was an empty line */
- *hf = &hf_mgcp_param_invalid;
- }
-
- /* For these types, show the whole line */
- if ((*hf == &hf_mgcp_param_invalid) ||
- (*hf == &hf_mgcp_param_extension) || (*hf == &hf_mgcp_param_extension_critical))
- {
- returnvalue = offset;
- }
-
- return returnvalue;
-}
-
-
-/*
- * dissect_mgcp_firstline - Dissects the firstline of an MGCP message.
- * Adds the appropriate headers fields to
- * tree for the dissection of the first line
- * of an MGCP message.
- *
- * Parameters:
- * tvb - The tvb containing the first line of an MGCP message. This
- * tvb is presumed to ONLY contain the first line of the MGCP
- * message.
- * pinfo - The packet info for the packet. This is not really used
- * by this function but is passed through so as to retain the
- * style of a dissector.
- * tree - The tree from which to hang the structured information parsed
- * from the first line of the MGCP message.
- */
-static void dissect_mgcp_firstline(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
-{
- gint tvb_current_offset,tvb_previous_offset,tvb_len,tvb_current_len;
- gint tokennum, tokenlen;
- char *transid = NULL;
- char *code = NULL;
- char *endpointId = NULL;
- mgcp_type_t mgcp_type = MGCP_OTHERS;
- conversation_t* conversation;
- mgcp_call_info_key mgcp_call_key;
- mgcp_call_info_key *new_mgcp_call_key = NULL;
- mgcp_call_t *mgcp_call = NULL;
- nstime_t delta;
- gint rspcode = 0;
- const gchar *verb_description = "";
- char code_with_verb[64] = ""; /* To fit "<4-letter-code> (<longest-verb>)" */
-
- static address null_address = { AT_NONE, 0, NULL };
- tvb_previous_offset = 0;
- tvb_len = tvb_length(tvb);
- tvb_current_len = tvb_len;
- tvb_current_offset = tvb_previous_offset;
- mi->is_duplicate = FALSE;
- mi->request_available = FALSE;
-
- if (tree)
- {
- tokennum = 0;
-
- do
- {
- tvb_current_len = tvb_length_remaining(tvb,tvb_previous_offset);
- tvb_current_offset = tvb_find_guint8(tvb, tvb_previous_offset, tvb_current_len, ' ');
- if (tvb_current_offset == -1)
- {
- tvb_current_offset = tvb_len;
- tokenlen = tvb_current_len;
- }
- else
- {
- tokenlen = tvb_current_offset - tvb_previous_offset;
- }
- if (tokennum == 0)
- {
- if (tokenlen > 4)
- THROW(ReportedBoundsError);
- code = tvb_format_text(tvb,tvb_previous_offset,tokenlen);
- strncpy(mi->code,code,4);
- mi->code[4] = '\0';
- if (is_mgcp_verb(tvb,tvb_previous_offset,tvb_current_len,&verb_description))
- {
- mgcp_type = MGCP_REQUEST;
- if (verb_description != NULL)
- {
- /* Can show verb along with code if known */
- sprintf(code_with_verb, "%s (%s)", code, verb_description);
- }
-
- proto_tree_add_string_format(tree, hf_mgcp_req_verb, tvb,
- tvb_previous_offset, tokenlen,
- code, "%s",
- strlen(code_with_verb) ? code_with_verb : code);
- }
- else
- if (is_mgcp_rspcode(tvb,tvb_previous_offset,tvb_current_len))
- {
- mgcp_type = MGCP_RESPONSE;
- rspcode = atoi(code);
- mi->rspcode = rspcode;
- proto_tree_add_uint(tree,hf_mgcp_rsp_rspcode, tvb,
- tvb_previous_offset, tokenlen, rspcode);
- }
- else
- {
- break;
- }
- }
- if (tokennum == 1)
- {
- transid = tvb_format_text(tvb,tvb_previous_offset,tokenlen);
- /* XXX - what if this isn't a valid text string? */
- mi->transid = atol(transid);
- proto_tree_add_string(tree, hf_mgcp_transid, tvb,
- tvb_previous_offset, tokenlen, transid);
- }
- if (tokennum == 2)
- {
- if (mgcp_type == MGCP_REQUEST)
- {
- endpointId = tvb_format_text(tvb, tvb_previous_offset,tokenlen);
- mi->endpointId = ep_strdup(endpointId);
- proto_tree_add_string(tree,hf_mgcp_req_endpoint, tvb,
- tvb_previous_offset, tokenlen, endpointId);
- }
- else
- if (mgcp_type == MGCP_RESPONSE)
- {
- if (tvb_current_offset < tvb_len)
- {
- tokenlen = tvb_find_line_end(tvb, tvb_previous_offset,
- -1, &tvb_current_offset, FALSE);
- }
- else
- {
- tokenlen = tvb_current_len;
- }
- proto_tree_add_string(tree, hf_mgcp_rsp_rspstring, tvb,
- tvb_previous_offset, tokenlen,
- tvb_format_text(tvb, tvb_previous_offset,
- tokenlen));
- break;
- }
- }
-
- if ((tokennum == 3 && mgcp_type == MGCP_REQUEST))
- {
- if (tvb_current_offset < tvb_len )
- {
- tokenlen = tvb_find_line_end(tvb, tvb_previous_offset,
- -1, &tvb_current_offset,FALSE);
- }
- else
- {
- tokenlen = tvb_current_len;
- }
- proto_tree_add_string(tree,hf_mgcp_version, tvb,
- tvb_previous_offset, tokenlen,
- tvb_format_text(tvb,tvb_previous_offset,
- tokenlen));
- break;
- }
- if (tvb_current_offset < tvb_len)
- {
- tvb_previous_offset = tvb_skip_wsp(tvb, tvb_current_offset,
- tvb_current_len);
- }
- tokennum++;
- } while (tvb_current_offset < tvb_len && tvb_previous_offset < tvb_len && tokennum <= 3);
-
- switch (mgcp_type)
- {
- case MGCP_RESPONSE:
- proto_tree_add_boolean_hidden(tree, hf_mgcp_rsp, tvb, 0, 0, TRUE);
- /* Check for MGCP response. A response must match a call that
- we've seen, and the response must be sent to the same
- port and address that the call came from, and must
- come from the port to which the call was sent.
-
- If the transport is connection-oriented (we check, for
- now, only for "pinfo->ptype" of PT_TCP), we take
- into account the address from which the call was sent
- and the address to which the call was sent, because
- the addresses of the two endpoints should be the same
- for all calls and replies.
-
- If the transport is connectionless, we don't worry
- about the address to which the call was sent and from
- which the reply was sent, because there's no
- guarantee that the reply will come from the address
- to which the call was sent. */
- if (pinfo->ptype == PT_TCP)
- {
- conversation = find_conversation(pinfo->fd->num, &pinfo->src,
- &pinfo->dst, pinfo->ptype, pinfo->srcport,
- pinfo->destport, 0);
- }
- else
- {
- /* XXX - can we just use NO_ADDR_B? Unfortunately,
- * you currently still have to pass a non-null
- * pointer for the second address argument even
- * if you do that.
- */
- conversation = find_conversation(pinfo->fd->num, &null_address,
- &pinfo->dst, pinfo->ptype, pinfo->srcport,
- pinfo->destport, 0);
- }
- if (conversation != NULL)
- {
- /* Look only for matching request, if
- matching conversation is available. */
- mgcp_call_key.transid = mi->transid;
- mgcp_call_key.conversation = conversation;
- mgcp_call = g_hash_table_lookup(mgcp_calls, &mgcp_call_key);
- if (mgcp_call)
- {
- /* Indicate the frame to which this is a reply. */
- if (mgcp_call->req_num)
- {
- proto_item* item;
- mi->request_available = TRUE;
- mgcp_call->responded = TRUE;
- mi->req_num = mgcp_call->req_num;
- strcpy(mi->code,mgcp_call->code);
- item = proto_tree_add_uint_format(tree, hf_mgcp_req_frame,
- tvb, 0, 0, mgcp_call->req_num,
- "This is a response to a request in frame %u",
- mgcp_call->req_num);
- PROTO_ITEM_SET_GENERATED(item);
- nstime_delta(&delta, &pinfo->fd->abs_ts, &mgcp_call->req_time);
- item = proto_tree_add_time(tree, hf_mgcp_time, tvb, 0, 0, &delta);
- PROTO_ITEM_SET_GENERATED(item);
- }
-
- if (mgcp_call->rsp_num == 0)
- {
- /* We have not yet seen a response to that call, so
- this must be the first response; remember its
- frame number. */
- mgcp_call->rsp_num = pinfo->fd->num;
- }
- else
- {
- /* We have seen a response to this call - but was it
- *this* response? (disregard provisional responses) */
- if ((mgcp_call->rsp_num != pinfo->fd->num) &&
- (mi->rspcode >= 200) &&
- (mi->rspcode == mgcp_call->rspcode))
- {
- /* No, so it's a duplicate response. Mark it as such. */
- mi->is_duplicate = TRUE;
- if (check_col(pinfo->cinfo, COL_INFO))
- {
- col_append_fstr(pinfo->cinfo, COL_INFO,
- ", Duplicate Response %u",
- mi->transid);
- }
- if (tree)
- {
- proto_item* item;
- proto_tree_add_uint_hidden(tree, hf_mgcp_dup, tvb, 0,0, mi->transid);
- item = proto_tree_add_uint(tree, hf_mgcp_rsp_dup,
- tvb, 0, 0, mi->transid);
- PROTO_ITEM_SET_GENERATED(item);
- item = proto_tree_add_uint(tree, hf_mgcp_rsp_dup_frame,
- tvb, 0, 0, mgcp_call->rsp_num);
- PROTO_ITEM_SET_GENERATED(item);
- }
- }
- }
- /* Now store the response code (after comparison above) */
- mgcp_call->rspcode = mi->rspcode;
- }
- }
- break;
- case MGCP_REQUEST:
- proto_tree_add_boolean_hidden(tree, hf_mgcp_req, tvb, 0, 0, TRUE);
- /* Keep track of the address and port whence the call came,
- * and the port to which the call is being sent, so that
- * we can match up calls with replies.
- *
- * If the transport is connection-oriented (we check, for
- * now, only for "pinfo->ptype" of PT_TCP), we take
- * into account the address from which the call was sent
- * and the address to which the call was sent, because
- * the addresses of the two endpoints should be the same
- * for all calls and replies.
- *
- * If the transport is connectionless, we don't worry
- * about the address to which the call was sent and from
- * which the reply was sent, because there's no
- * guarantee that the reply will come from the address
- * to which the call was sent.
- */
- if (pinfo->ptype == PT_TCP)
- {
- conversation = find_conversation(pinfo->fd->num, &pinfo->src,
- &pinfo->dst, pinfo->ptype, pinfo->srcport,
- pinfo->destport, 0);
- }
- else
- {
- /*
- * XXX - can we just use NO_ADDR_B? Unfortunately,
- * you currently still have to pass a non-null
- * pointer for the second address argument even
- * if you do that.
- */
- conversation = find_conversation(pinfo->fd->num, &pinfo->src,
- &null_address, pinfo->ptype, pinfo->srcport,
- pinfo->destport, 0);
- }
- if (conversation == NULL)
- {
- /* It's not part of any conversation - create a new one. */
- if (pinfo->ptype == PT_TCP)
- {
- conversation = conversation_new(pinfo->fd->num, &pinfo->src,
- &pinfo->dst, pinfo->ptype, pinfo->srcport,
- pinfo->destport, 0);
- }
- else
- {
- conversation = conversation_new(pinfo->fd->num, &pinfo->src,
- &null_address, pinfo->ptype, pinfo->srcport,
- pinfo->destport, 0);
- }
- }
-
- /* Prepare the key data */
- mgcp_call_key.transid = mi->transid;
- mgcp_call_key.conversation = conversation;
-
- /* Look up the request */
- mgcp_call = g_hash_table_lookup(mgcp_calls, &mgcp_call_key);
- if (mgcp_call != NULL)
- {
- /* We've seen a request with this TRANSID, with the same
- source and destination, before - but was it
- *this* request? */
- if (pinfo->fd->num != mgcp_call->req_num)
- {
- /* No, so it's a duplicate request. Mark it as such. */
- mi->is_duplicate = TRUE;
- mi->req_num = mgcp_call->req_num;
- if (check_col(pinfo->cinfo, COL_INFO))
- {
- col_append_fstr(pinfo->cinfo, COL_INFO,
- ", Duplicate Request %u",
- mi->transid);
- }
- if (tree)
- {
- proto_item* item;
- proto_tree_add_uint_hidden(tree, hf_mgcp_dup, tvb, 0,0, mi->transid);
- item = proto_tree_add_uint(tree, hf_mgcp_req_dup, tvb, 0,0, mi->transid);
- PROTO_ITEM_SET_GENERATED(item);
- item = proto_tree_add_uint(tree, hf_mgcp_req_dup_frame, tvb, 0,0, mi->req_num);
- PROTO_ITEM_SET_GENERATED(item);
- }
- }
- }
- else
- {
- /* Prepare the value data.
- "req_num" and "rsp_num" are frame numbers;
- frame numbers are 1-origin, so we use 0
- to mean "we don't yet know in which frame
- the reply for this call appears". */
- new_mgcp_call_key = g_mem_chunk_alloc(mgcp_call_info_key_chunk);
- *new_mgcp_call_key = mgcp_call_key;
- mgcp_call = g_mem_chunk_alloc(mgcp_call_info_value_chunk);
- mgcp_call->req_num = pinfo->fd->num;
- mgcp_call->rsp_num = 0;
- mgcp_call->transid = mi->transid;
- mgcp_call->responded = FALSE;
- mgcp_call->req_time=pinfo->fd->abs_ts;
- strcpy(mgcp_call->code,mi->code);
-
- /* Store it */
- g_hash_table_insert(mgcp_calls, new_mgcp_call_key, mgcp_call);
- }
- if (mgcp_call && mgcp_call->rsp_num)
- {
- proto_item* item = proto_tree_add_uint_format(tree, hf_mgcp_rsp_frame,
- tvb, 0, 0, mgcp_call->rsp_num,
- "The response to this request is in frame %u",
- mgcp_call->rsp_num);
- PROTO_ITEM_SET_GENERATED(item);
- }
- break;
- default:
- break;
- }
-
- mi->mgcp_type = mgcp_type;
- if (mgcp_call)
- {
- mi->req_time.secs=mgcp_call->req_time.secs;
- mi->req_time.nsecs=mgcp_call->req_time.nsecs;
- }
- }
-
- tap_queue_packet(mgcp_tap, pinfo, mi);
-}
-
-/*
- * dissect_mgcp_params - Dissects the parameters of an MGCP message.
- * Adds the appropriate headers fields to
- * tree for the dissection of the parameters
- * of an MGCP message.
- *
- * Parameters:
- * tvb - The tvb containing the parameters of an MGCP message. This
- * tvb is presumed to ONLY contain the part of the MGCP
- * message which contains the MGCP parameters.
- * tree - The tree from which to hang the structured information parsed
- * from the parameters of the MGCP message.
- */
-static void dissect_mgcp_params(tvbuff_t *tvb, proto_tree *tree)
-{
- int linelen, tokenlen, *my_param;
- gint tvb_lineend,tvb_current_len, tvb_linebegin,tvb_len,old_lineend;
- gint tvb_tokenbegin;
- proto_tree *mgcp_param_ti, *mgcp_param_tree;
-
- tvb_len = tvb_length(tvb);
- tvb_linebegin = 0;
- tvb_current_len = tvb_length_remaining(tvb,tvb_linebegin);
- tvb_lineend = tvb_linebegin;
-
- if (tree)
- {
- mgcp_param_ti = proto_tree_add_item(tree, hf_mgcp_params, tvb,
- tvb_linebegin, tvb_len, FALSE);
- proto_item_set_text(mgcp_param_ti, "Parameters");
- mgcp_param_tree = proto_item_add_subtree(mgcp_param_ti, ett_mgcp_param);
-
- /* Parse the parameters */
- while (tvb_lineend < tvb_len)
- {
- old_lineend = tvb_lineend;
- linelen = tvb_find_line_end(tvb, tvb_linebegin, -1,&tvb_lineend,FALSE);
- tvb_tokenbegin = tvb_parse_param(tvb, tvb_linebegin, linelen, &my_param);
-
- if (my_param)
- {
- if (*my_param == hf_mgcp_param_connectionparam)
- {
- tokenlen = tvb_find_line_end(tvb,tvb_tokenbegin,-1,&tvb_lineend,FALSE);
- dissect_mgcp_connectionparams(mgcp_param_tree, tvb, tvb_linebegin,
- tvb_tokenbegin - tvb_linebegin, tokenlen);
- }
- else
- if (*my_param == hf_mgcp_param_localconnoptions)
- {
- tokenlen = tvb_find_line_end(tvb,tvb_tokenbegin,-1,&tvb_lineend,FALSE);
- dissect_mgcp_localconnectionoptions(mgcp_param_tree, tvb, tvb_linebegin,
- tvb_tokenbegin - tvb_linebegin, tokenlen);
- }
- else
- {
- tokenlen = tvb_find_line_end(tvb,tvb_tokenbegin,-1,&tvb_lineend,FALSE);
- proto_tree_add_string(mgcp_param_tree,*my_param, tvb,
- tvb_linebegin, linelen,
- tvb_format_text(tvb,tvb_tokenbegin, tokenlen));
- }
- }
-
- tvb_linebegin = tvb_lineend;
- /* Its a infinite loop if we didn't advance (or went backwards) */
- if (old_lineend >= tvb_lineend)
- {
- THROW(ReportedBoundsError);
- }
- }
- }
-}
-
-/* Dissect the connection params */
-static void
-dissect_mgcp_connectionparams(proto_tree *parent_tree, tvbuff_t *tvb, gint offset, gint param_type_len, gint param_val_len)
-{
- proto_tree *tree = parent_tree;
- proto_item *item = NULL;
-
- gchar *tokenline = NULL;
- gchar **tokens = NULL;
- gchar **typval = NULL;
- guint i = 0;
- guint tokenlen = 0;
- int hf_uint = -1;
- int hf_string = -1;
-
- if (parent_tree)
- {
- item = proto_tree_add_item(parent_tree, hf_mgcp_param_connectionparam, tvb, offset, param_type_len+param_val_len, FALSE);
- tree = proto_item_add_subtree(item, ett_mgcp_param_connectionparam);
- }
-
- /* The P: line */
- offset += param_type_len; /* skip the P: */
- tokenline = tvb_get_ephemeral_string(tvb, offset, param_val_len);
-
- /* Split into type=value pairs separated by comma */
- tokens = ep_strsplit(tokenline, ",", -1);
-
- for (i = 0; tokens[i] != NULL; i++)
- {
- tokenlen = strlen(tokens[i]);
- typval = ep_strsplit(tokens[i], "=", 2);
- if ((typval[0] != NULL) && (typval[1] != NULL))
- {
- if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "PS"))
- {
- hf_uint = hf_mgcp_param_connectionparam_ps;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "OS"))
- {
- hf_uint = hf_mgcp_param_connectionparam_os;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "PR"))
- {
- hf_uint = hf_mgcp_param_connectionparam_pr;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "OR"))
- {
- hf_uint = hf_mgcp_param_connectionparam_or;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "PL"))
- {
- hf_uint = hf_mgcp_param_connectionparam_pl;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "JI"))
- {
- hf_uint = hf_mgcp_param_connectionparam_ji;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "LA"))
- {
- hf_uint = hf_mgcp_param_connectionparam_la;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "PC/RPS"))
- {
- hf_uint = hf_mgcp_param_connectionparam_pcrps;
- } else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "PC/ROS"))
- {
- hf_uint = hf_mgcp_param_connectionparam_pcros;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "PC/RPL"))
- {
- hf_uint = hf_mgcp_param_connectionparam_pcrpl;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "PC/RJI"))
- {
- hf_uint = hf_mgcp_param_connectionparam_pcrji;
- }
- else if (!g_ascii_strncasecmp(g_strstrip(typval[0]), "X-", 2))
- {
- hf_string = hf_mgcp_param_connectionparam_x;
- }
- else
- {
- hf_uint = -1;
- hf_string = -1;
- }
-
- if (tree)
- {
- if (hf_uint != -1)
- {
- proto_tree_add_uint(tree, hf_uint, tvb, offset, tokenlen, atol(typval[1]));
- }
- else if (hf_string != -1)
- {
- proto_tree_add_string(tree, hf_string, tvb, offset, tokenlen, g_strstrip(typval[1]));
- }
- else
- {
- proto_tree_add_text(tree, tvb, offset, tokenlen, "Unknown parameter: %s", tokens[i]);
- }
- }
- }
- else if (tree)
- {
- proto_tree_add_text(tree, tvb, offset, tokenlen, "Malformed parameter: %s", tokens[i]);
- }
- offset += tokenlen + 1; /* 1 extra for the delimiter */
- }
-
-}
-
-/* Dissect the local connection option */
-static void
-dissect_mgcp_localconnectionoptions(proto_tree *parent_tree, tvbuff_t *tvb, gint offset, gint param_type_len, gint param_val_len)
-{
- proto_tree *tree = parent_tree;
- proto_item *item = NULL;
-
- gchar *tokenline = NULL;
- gchar **tokens = NULL;
- gchar **typval = NULL;
- guint i = 0;
- guint tokenlen = 0;
- int hf_uint = -1;
- int hf_string = -1;
-
- if (parent_tree)
- {
- item = proto_tree_add_item(parent_tree, hf_mgcp_param_localconnoptions, tvb, offset, param_type_len+param_val_len, FALSE);
- tree = proto_item_add_subtree(item, ett_mgcp_param_localconnectionoptions);
- }
-
- /* The L: line */
- offset += param_type_len; /* skip the L: */
- tokenline = tvb_get_ephemeral_string(tvb, offset, param_val_len);
-
- /* Split into type=value pairs separated by comma */
- tokens = ep_strsplit(tokenline, ",", -1);
- for (i = 0; tokens[i] != NULL; i++)
- {
- hf_uint = -1;
- hf_string = -1;
-
- tokenlen = strlen(tokens[i]);
- typval = ep_strsplit(tokens[i], ":", 2);
- if ((typval[0] != NULL) && (typval[1] != NULL))
- {
- if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "p"))
- {
- hf_uint = hf_mgcp_param_localconnoptions_p;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "a"))
- {
- hf_string = hf_mgcp_param_localconnoptions_a;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "s"))
- {
- hf_string = hf_mgcp_param_localconnoptions_s;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "e"))
- {
- hf_string = hf_mgcp_param_localconnoptions_e;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "sc-rtp"))
- {
- hf_string = hf_mgcp_param_localconnoptions_scrtp;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "sc-rtcp"))
- {
- hf_string = hf_mgcp_param_localconnoptions_scrtcp;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "b"))
- {
- hf_string = hf_mgcp_param_localconnoptions_b;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "es-ccd"))
- {
- hf_string = hf_mgcp_param_localconnoptions_esccd;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "es-cci"))
- {
- hf_string = hf_mgcp_param_localconnoptions_escci;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "dq-gi"))
- {
- hf_string = hf_mgcp_param_localconnoptions_dqgi;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "dq-rd"))
- {
- hf_string = hf_mgcp_param_localconnoptions_dqrd;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "dq-ri"))
- {
- hf_string = hf_mgcp_param_localconnoptions_dqri;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "dq-rr"))
- {
- hf_string = hf_mgcp_param_localconnoptions_dqrr;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "k"))
- {
- hf_string = hf_mgcp_param_localconnoptions_k;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "gc"))
- {
- hf_uint = hf_mgcp_param_localconnoptions_gc;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "fmtp"))
- {
- hf_string = hf_mgcp_param_localconnoptions_fmtp;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "nt"))
- {
- hf_string = hf_mgcp_param_localconnoptions_nt;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "o-fmtp"))
- {
- hf_string = hf_mgcp_param_localconnoptions_ofmtp;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "r"))
- {
- hf_string = hf_mgcp_param_localconnoptions_r;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "t"))
- {
- hf_string = hf_mgcp_param_localconnoptions_t;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "r-cnf"))
- {
- hf_string = hf_mgcp_param_localconnoptions_rcnf;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "r-dir"))
- {
- hf_string = hf_mgcp_param_localconnoptions_rdir;
- }
- else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "r-sh"))
- {
- hf_string = hf_mgcp_param_localconnoptions_rsh;
- }
- else
- {
- hf_uint = -1;
- hf_string = -1;
- }
-
- /* Add item */
- if (tree)
- {
- if (hf_uint != -1)
- {
- proto_tree_add_uint(tree, hf_uint, tvb, offset, tokenlen, atol(typval[1]));
- }
- else if (hf_string != -1)
- {
- proto_tree_add_string(tree, hf_string, tvb, offset, tokenlen, g_strstrip(typval[1]));
- }
- else
- {
- proto_tree_add_text(tree, tvb, offset, tokenlen, "Unknown parameter: %s", tokens[i]);
- }
- }
- }
- else if (tree)
- {
- proto_tree_add_text(tree, tvb, offset, tokenlen, "Malformed parameter: %s", tokens[i]);
- }
- offset += tokenlen + 1; /* 1 extra for the delimiter */
- }
-}
-
-
-
-/*
- * tvb_skip_wsp - Returns the position in tvb of the first non-whitespace
- * character following offset or offset + maxlength -1 whichever
- * is smaller.
- *
- * Parameters:
- * tvb - The tvbuff in which we are skipping whitespace.
- * offset - The offset in tvb from which we begin trying to skip whitespace.
- * maxlength - The maximum distance from offset that we may try to skip
- * whitespace.
- *
- * Returns: The position in tvb of the first non-whitespace
- * character following offset or offset + maxlength -1 whichever
- * is smaller.
- */
-static gint tvb_skip_wsp(tvbuff_t* tvb, gint offset, gint maxlength)
-{
- gint counter = offset;
- gint end = offset + maxlength,tvb_len;
- guint8 tempchar;
-
- /* Get the length remaining */
- tvb_len = tvb_length(tvb);
- end = offset + maxlength;
- if (end >= tvb_len)
- {
- end = tvb_len;
- }
-
- /* Skip past spaces and tabs until run out or meet something else */
- for (counter = offset;
- counter < end &&
- ((tempchar = tvb_get_guint8(tvb,counter)) == ' ' ||
- tempchar == '\t');
- counter++);
-
- return (counter);
-}
-
-/*
- * tvb_find_null_line - Returns the length from offset to the first null
- * line found (a null line is a line that begins
- * with a CR or LF. The offset to the first character
- * after the null line is written into the gint pointed
- * to by next_offset.
- *
- * Parameters:
- * tvb - The tvbuff in which we are looking for a null line.
- * offset - The offset in tvb at which we will begin looking for
- * a null line.
- * len - The maximum distance from offset in tvb that we will look for
- * a null line. If it is -1 we will look to the end of the buffer.
- *
- * next_offset - The location to write the offset of first character
- * FOLLOWING the null line.
- *
- * Returns: The length from offset to the first character BEFORE
- * the null line..
- */
-static gint tvb_find_null_line(tvbuff_t* tvb, gint offset, gint len, gint* next_offset)
-{
- gint tvb_lineend,tvb_current_len,tvb_linebegin,maxoffset;
- guint tempchar;
-
- tvb_linebegin = offset;
- tvb_lineend = tvb_linebegin;
-
- /* Simple setup to allow for the traditional -1 search to the end of the tvbuff */
- if (len != -1)
- {
- tvb_current_len = len;
- }
- else
- {
- tvb_current_len = tvb_length_remaining(tvb,offset);
- }
-
- maxoffset = (tvb_current_len - 1) + offset;
-
- /* Loop around until we either find a line begining with a carriage return
- or newline character or until we hit the end of the tvbuff. */
- do
- {
- tvb_linebegin = tvb_lineend;
- tvb_current_len = tvb_length_remaining(tvb,tvb_linebegin);
- tvb_find_line_end(tvb, tvb_linebegin, tvb_current_len, &tvb_lineend,FALSE);
- tempchar = tvb_get_guint8(tvb,tvb_linebegin);
- } while (tempchar != '\r' && tempchar != '\n' && tvb_lineend <= maxoffset);
-
-
- *next_offset = tvb_lineend;
-
- if (tvb_lineend <= maxoffset)
- {
- tvb_current_len = tvb_linebegin - offset;
- }
- else
- {
- tvb_current_len = tvb_length_remaining(tvb,offset);
- }
-
- return tvb_current_len;
-}
-
-/*
- * tvb_find_dot_line - Returns the length from offset to the first line
- * containing only a dot (.) character. A line
- * containing only a dot is used to indicate a
- * separation between multiple MGCP messages
- * piggybacked in the same UDP packet.
- *
- * Parameters:
- * tvb - The tvbuff in which we are looking for a dot line.
- * offset - The offset in tvb at which we will begin looking for
- * a dot line.
- * len - The maximum distance from offset in tvb that we will look for
- * a dot line. If it is -1 we will look to the end of the buffer.
- *
- * next_offset - The location to write the offset of first character
- * FOLLOWING the dot line.
- *
- * Returns: The length from offset to the first character BEFORE
- * the dot line or -1 if the character at offset is a .
- * followed by a newline or a carriage return.
- */
-static gint tvb_find_dot_line(tvbuff_t* tvb, gint offset, gint len, gint* next_offset)
-{
- gint tvb_current_offset, tvb_current_len, maxoffset,tvb_len;
- guint8 tempchar;
- tvb_current_offset = offset;
- tvb_current_len = len;
- tvb_len = tvb_length(tvb);
-
- if (len == -1)
- {
- maxoffset = tvb_len - 1;
- }
- else
- {
- maxoffset = (len - 1) + offset;
- }
- tvb_current_offset = offset -1;
-
- do
- {
- tvb_current_offset = tvb_find_guint8(tvb, tvb_current_offset+1,
- tvb_current_len, '.');
- tvb_current_len = maxoffset - tvb_current_offset + 1;
-
- /* If we didn't find a . then break out of the loop */
- if (tvb_current_offset == -1)
- {
- break;
- }
-
- /* Do we have and characters following the . ? */
- if (tvb_current_offset < maxoffset)
- {
- tempchar = tvb_get_guint8(tvb,tvb_current_offset+1);
- /* Are the characters that follow the dot a newline or carriage return ? */
- if (tempchar == '\r' || tempchar == '\n')
- {
- /* Do we have any charaters that proceed the . ? */
- if (tvb_current_offset == 0)
- {
- break;
- }
- else
- {
- tempchar = tvb_get_guint8(tvb,tvb_current_offset-1);
-
- /* Are the characters that follow the dot a newline or a
- carriage return ? */
- if (tempchar == '\r' || tempchar == '\n')
- {
- break;
- }
- }
- }
- }
- else
- if (tvb_current_offset == maxoffset)
- {
- if (tvb_current_offset == 0)
- {
- break;
- }
- else
- {
- tempchar = tvb_get_guint8(tvb,tvb_current_offset-1);
- if (tempchar == '\r' || tempchar == '\n')
- {
- break;
- }
- }
- }
- } while (tvb_current_offset < maxoffset);
-
-
- /*
- * So now we either have the tvb_current_offset of a . in a dot line
- * or a tvb_current_offset of -1
- */
- if (tvb_current_offset == -1)
- {
- tvb_current_offset = maxoffset +1;
- *next_offset = maxoffset + 1;
- }
- else
- {
- tvb_find_line_end(tvb,tvb_current_offset,tvb_current_len,next_offset,FALSE);
- }
-
- if (tvb_current_offset == offset)
- {
- tvb_current_len = -1;
- }
- else
- {
- tvb_current_len = tvb_current_offset - offset;
- }
-
- return tvb_current_len;
-}
-
diff --git a/plugins/mgcp/packet-mgcp.h b/plugins/mgcp/packet-mgcp.h
deleted file mode 100644
index 65f4a72198..0000000000
--- a/plugins/mgcp/packet-mgcp.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* packet-mgcp.h
- * Routines for mgcp packet disassembly
- * RFC 2705
- *
- * $Id$
- *
- * Copyright (c) 2000 by Ed Warnicke <hagbard@physics.rutgers.edu>
- *
- * Wireshark - Network traffic analyzer
- * By Gerald Combs <gerald@wireshark.org>
- * Copyright 1999 Gerald Combs
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
- /* A simple MGCP type that is occasionally handy */
-typedef enum _mgcp_type
-{
- MGCP_REQUEST,
- MGCP_RESPONSE,
- MGCP_OTHERS
-} mgcp_type_t;
-
-/* Container for tapping relevant data */
-typedef struct _mgcp_info_t
-{
- mgcp_type_t mgcp_type;
- char code[5];
- guint32 transid;
- nstime_t req_time;
- gboolean is_duplicate;
- gboolean request_available;
- guint32 req_num; /* frame number request seen */
- gchar *endpointId;
- gchar *observedEvents;
- guint32 rspcode;
- gchar *signalReq;
- gboolean hasDigitMap;
-} mgcp_info_t;
-
-/* Item of request list */
-typedef struct _mgcp_call_t
-{
- guint32 transid;
- char code[5];
- guint32 req_num; /* frame number request seen */
- guint32 rsp_num; /* frame number response seen */
- guint32 rspcode;
- nstime_t req_time;
- gboolean responded;
-} mgcp_call_t;
-
-void proto_register_mgcp(void);
-void proto_reg_handoff_mgcp(void);
-
diff --git a/plugins/mgcp/plugin.rc.in b/plugins/mgcp/plugin.rc.in
deleted file mode 100644
index 72b4de0775..0000000000
--- a/plugins/mgcp/plugin.rc.in
+++ /dev/null
@@ -1,34 +0,0 @@
-#include "winver.h"
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION @RC_MODULE_VERSION@
- PRODUCTVERSION @RC_VERSION@,0
- FILEFLAGSMASK 0x0L
-#ifdef _DEBUG
- FILEFLAGS VS_FF_PRERELEASE+VS_FF_DEBUG
-#else
- FILEFLAGS VS_FF_PRERELEASE
-#endif
- FILEOS VOS_NT_WINDOWS32
- FILETYPE VFT_DLL
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904b0"
- BEGIN
- VALUE "CompanyName", "The Wireshark developer community, http://www.wireshark.org/\0"
- VALUE "FileDescription", "@PACKAGE@ dissector\0"
- VALUE "FileVersion", "@MODULE_VERSION@\0"
- VALUE "InternalName", "@PACKAGE@ @MODULE_VERSION@\0"
- VALUE "LegalCopyright", "Copyright © 1998 Gerald Combs <gerald@wireshark.org>, Gilbert Ramirez <gram@alumni.rice.edu> and others\0"
- VALUE "OriginalFilename", "@PLUGIN_NAME@.dll\0"
- VALUE "ProductName", "Wireshark\0"
- VALUE "ProductVersion", "@VERSION@\0"
- VALUE "Comments", "Build with @MSVC_VARIANT@\0"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1200
- END
-END