From Hans-Peter Bock:

Attached to this post you find a patch for integration into wireshark that adds
a dissector for SERCOS III, ethertype 0x88cd.

svn path=/trunk/; revision=25270
This commit is contained in:
Jaap Keuter 2008-05-10 14:44:32 +00:00
parent 098f95fad9
commit cacee64927
25 changed files with 2751 additions and 0 deletions

View File

@ -259,6 +259,7 @@ plugin_ldadd = \
-dlopen plugins/rtnet/rtnet.la \
-dlopen plugins/rudp/rudp.la \
-dlopen plugins/sbus/sbus.la \
-dlopen plugins/sercosiii/sercosiii.la \
-dlopen plugins/stats_tree/stats_tree.la \
-dlopen plugins/unistim/unistim.la \
-dlopen plugins/v5ua/v5ua.la \

View File

@ -922,6 +922,7 @@ install-generated-files:
xcopy ".\plugins\rtnet\rtnet.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
xcopy ".\plugins\rudp\rudp.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
xcopy ".\plugins\sbus\sbus.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
xcopy ".\plugins\sercosiii\sercosiii.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
xcopy ".\plugins\stats_tree\stats_tree.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
xcopy ".\plugins\unistim\unistim.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
xcopy ".\plugins\v5ua\v5ua.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d

View File

@ -1584,6 +1584,7 @@ AC_OUTPUT(
plugins/rtnet/Makefile
plugins/rudp/Makefile
plugins/sbus/Makefile
plugins/sercosiii/Makefile
plugins/stats_tree/Makefile
plugins/unistim/Makefile
plugins/v5ua/Makefile

View File

@ -219,6 +219,14 @@ plugin_src = \
../plugins/pcli/packet-pcli.c \
../plugins/rdm/packet-rdm.c \
../plugins/rtnet/packet-rtnet.c \
../plugins/sercosiii/packet-sercosiii_1v1_at.c \
../plugins/sercosiii/packet-sercosiii_1v1_at_devstat.c \
../plugins/sercosiii/packet-sercosiii_1v1.c \
../plugins/sercosiii/packet-sercosiii_1v1_hp.c \
../plugins/sercosiii/packet-sercosiii_1v1_mdt.c \
../plugins/sercosiii/packet-sercosiii_1v1_mdt_devctrl.c \
../plugins/sercosiii/packet-sercosiii_1v1_mst.c \
../plugins/sercosiii/packet-sercosiii_1v1_svc.c \
../plugins/v5ua/packet-v5ua.c \
../plugins/wimax/crc.c \
../plugins/wimax/crc_data.c \

View File

@ -67,6 +67,7 @@ PLUGINS= \
../../plugins/rtnet/rtnet.dll \
../../plugins/rudp/rudp.dll \
../../plugins/sbus/sbus.dll \
../../plugins/sercosiii/sercosiii.dll \
../../plugins/stats_tree/stats_tree.dll \
../../plugins/unistim/unistim.dll \
../../plugins/v5ua/v5ua.dll \

View File

@ -763,6 +763,7 @@ File "..\..\plugins\rlm\rlm.dll"
File "..\..\plugins\rtnet\rtnet.dll"
File "..\..\plugins\rudp\rudp.dll"
File "..\..\plugins\sbus\sbus.dll"
File "..\..\plugins\sercosiii\sercosiii.dll"
File "..\..\plugins\unistim\unistim.dll"
File "..\..\plugins\v5ua\v5ua.dll"
File "..\..\plugins\wimax\wimax.dll"

View File

@ -44,6 +44,7 @@ SUBDIRS = \
rtnet \
rudp \
sbus \
sercosiii \
stats_tree \
unistim \
v5ua \

View File

@ -98,6 +98,9 @@ process-plugins:
cd sbus
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake $(PLUGIN_TARGET)
cd ..
cd sercosiii
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake $(PLUGIN_TARGET)
cd ..
cd stats_tree
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake $(PLUGIN_TARGET)
cd ..
@ -146,6 +149,7 @@ install-plugins:
xcopy rtnet\*.dll $(VERSION) /d
xcopy rudp\*.dll $(VERSION) /d
xcopy sbus\*.dll $(VERSION) /d
xcopy sercosiii\*.dll $(VERSION) /d
xcopy stats_tree\*.dll $(VERSION) /d
xcopy unistim\*.dll $(VERSION) /d
xcopy v5ua\*.dll $(VERSION) /d

View File

@ -0,0 +1,8 @@
Authors:
--------
Bosch Rexroth
Hilscher
Preparation for checkin at wireshark:
-------------------------------------
Hans-Peter Bock <hpbock@avaapgh.de>

340
plugins/sercosiii/COPYING Normal file
View File

@ -0,0 +1,340 @@
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) 19yy <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) 19yy 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.

View File

@ -0,0 +1,126 @@
# Makefile.am
# Automake file for sercos iii 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 = sercosiii.la
sercosiii_la_SOURCES = \
plugin.c \
moduleinfo.h \
$(DISSECTOR_SRC) \
$(DISSECTOR_SUPPORT_SRC) \
$(DISSECTOR_INCLUDES)
sercosiii_la_LDFLAGS = -module -avoid-version
sercosiii_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 = \
sercosiii \
*~
MAINTAINERCLEANFILES = \
Makefile.in \
plugin.c
EXTRA_DIST = \
Makefile.common \
Makefile.nmake \
moduleinfo.nmake \
plugin.rc.in

View File

@ -0,0 +1,48 @@
# Makefile.common for sercos iii 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 = sercosiii
# the dissector sources (without any helpers)
DISSECTOR_SRC = \
packet-sercosiii_1v1.c
# corresponding headers
DISSECTOR_INCLUDES = \
packet-sercosiii.h
# Dissector helpers. They're included in the source files in this
# directory, but they're not dissectors themselves, i.e. they're not
# used to generate "register.c").
DISSECTOR_SUPPORT_SRC = \
packet-sercosiii_1v1_svc.c \
packet-sercosiii_1v1_mdt_devctrl.c \
packet-sercosiii_1v1_at_devstat.c \
packet-sercosiii_1v1_mdt.c \
packet-sercosiii_1v1_at.c \
packet-sercosiii_1v1_mst.c \
packet-sercosiii_1v1_hp.c

View File

@ -0,0 +1,103 @@
# 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.
#
!IFDEF PYTHON
plugin.c: $(DISSECTOR_SRC) moduleinfo.h ../../tools/make-dissector-reg.py
@echo Making plugin.c (using python)
@$(PYTHON) "../../tools/make-dissector-reg.py" . plugin $(DISSECTOR_SRC)
!ELSE
plugin.c: $(DISSECTOR_SRC) moduleinfo.h ../../tools/make-dissector-reg
@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
checkapi:
$(PERL) ../../tools/checkAPIs.pl $(DISSECTOR_SRC)

View File

@ -0,0 +1,17 @@
/* Included *after* config.h, in order to re-define these macros */
#ifdef PACKAGE
#undef PACKAGE
#endif
/* Name of package */
#define PACKAGE "sercosiii"
#ifdef VERSION
#undef VERSION
#endif
/* Version number of package */
#define VERSION "0.0.1"

View File

@ -0,0 +1,28 @@
#
# $Id$
#
# The name
PACKAGE=sercosiii
# The version
MODULE_VERSION_MAJOR=0
MODULE_VERSION_MINOR=0
MODULE_VERSION_MICRO=1
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)

View File

@ -0,0 +1,58 @@
/* packet-sercosiii.h
* Routines for SERCOS III dissection
*
* $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.
*/
#ifndef _packet_sercosiii_h
#define _packet_sercosiii_h
#define MAX_SERCOS_DEVICES (512)
#define COMMUNICATION_PHASE_0 (0x0)
#define COMMUNICATION_PHASE_1 (0x1)
#define COMMUNICATION_PHASE_2 (0x2)
#define COMMUNICATION_PHASE_3 (0x3)
#define COMMUNICATION_PHASE_4 (0x4)
void dissect_siii_mdt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
void dissect_siii_at(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
void dissect_siii_mst(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
void dissect_siii_mdt_init(gint proto_siii);
void dissect_siii_at_init(gint proto_siii);
void dissect_siii_mdt_devctrl_init(gint proto_siii);
void dissect_siii_at_devstat_init(gint proto_siii);
void dissect_siii_svc_init(gint proto_siii);
void dissect_siii_mst_init(gint proto_siii);
void dissect_siii_hp_init(gint proto_siii);
void dissect_siii_mdt_devctrl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
void dissect_siii_at_devstat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
void dissect_siii_mdt_hp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
void dissect_siii_at_hp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
void dissect_siii_mdt_svc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint devno);
void dissect_siii_at_svc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint devno);
#endif

View File

@ -0,0 +1,139 @@
/* packet-sercosiii_1v1.c
* Routines for SERCOS III dissection
*
* $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.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/etypes.h>
#include "packet-sercosiii.h"
static int global_siii_eth_type = ETHERTYPE_SERCOS;
/* Forward declaration we need below */
void proto_reg_handoff_sercosiii(void);
/* Initialize the protocol and registered fields */
static gint proto_siii = -1;
/* Initialize the subtree pointers */
static gint ett_siii = -1;
static gint ett_siii_header = -1;
/* Main dissector entry */
static void
dissect_siii(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_item* ti;
proto_tree* siii_tree;
guint type;
char* tel_ch="?";
char* tel_type="?";
guint tel_no = 0;
/* setup columns */
if(check_col(pinfo->cinfo, COL_PROTOCOL))
col_set_str(pinfo->cinfo, COL_PROTOCOL, "SERCOS III V1.1");
if(check_col(pinfo->cinfo, COL_INFO))
col_clear(pinfo->cinfo, COL_INFO);
/* check what we got on our hand */
type = tvb_get_guint8(tvb, 0);
if(type&0x80) /* primary or secondary channel */
tel_ch="S";
else
tel_ch="P";
if(type&0x40) /* master data telegram (mdt) or slave telegram (at) */
tel_type="AT ";
else
tel_type="MDT";
tel_no = type &0xF; /* even though it's reserved (the V1.1 spec states that it is reserved for additional MDT/AT) */
if(check_col(pinfo->cinfo, COL_INFO))
{
col_append_fstr(pinfo->cinfo, COL_INFO, "%s%u Channel=%s", tel_type, tel_no, tel_ch);
}
ti = proto_tree_add_item(tree, proto_siii, tvb, 0, -1, FALSE);
siii_tree = proto_item_add_subtree(ti, ett_siii);
/* enter the specific dissector for AT or MDT */
if(type & 0x40)
dissect_siii_at(tvb, pinfo, siii_tree);
else
dissect_siii_mdt(tvb, pinfo, siii_tree);
}
void
proto_register_sercosiii(void)
{
/* Setup protocol subtree array */
static gint *ett[] = {
&ett_siii,
&ett_siii_header
};
/* Register the protocol name and description */
proto_siii = proto_register_protocol("SERCOS III V1.1",
"SERCOS III V1.1", "sercosiii");
/* Required function calls to register the header fields and subtrees used */
proto_register_subtree_array(ett, array_length(ett));
dissect_siii_mdt_init(proto_siii);
dissect_siii_at_init(proto_siii);
dissect_siii_mdt_devctrl_init(proto_siii);
dissect_siii_at_devstat_init(proto_siii);
dissect_siii_svc_init(proto_siii);
dissect_siii_mst_init(proto_siii);
dissect_siii_hp_init(proto_siii);
}
void
proto_reg_handoff_sercosiii(void)
{
static gboolean inited = FALSE;
if( !inited ) {
dissector_handle_t siii_handle;
siii_handle = create_dissector_handle(dissect_siii, proto_siii);
dissector_add("ethertype", global_siii_eth_type, siii_handle);
inited = TRUE;
}
}

View File

@ -0,0 +1,223 @@
/* packet-sercosiii_1v1_at.c
* Routines for SERCOS III dissection
*
* $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.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include "packet-sercosiii.h"
static gint ett_siii_at = -1;
static gint ett_siii_at_svc = -1;
static gint ett_siii_at_devstats = -1;
static gint ett_siii_at_svc_channel[MAX_SERCOS_DEVICES] = {-1};
static gint ett_siii_at_dev_status[MAX_SERCOS_DEVICES] = {-1};
void dissect_siii_at_cp0(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
guint16 seqcnt; /* sequence counter */
guint16 tfield; /* topology field for sercos addresses */
guint16 i;
char devices[]="Recognized Devices"; /* fixme: it would be nice to have this as subtree */
static char outbuf[200];
proto_tree_add_text(tree, tvb, 0, 1024, devices);
/* check sequence count field */
seqcnt = tvb_get_letohs(tvb, 0);
g_snprintf(outbuf, sizeof(outbuf), "Number of Devices: %u", (0x1FF & seqcnt)-1);
proto_tree_add_text(tree, tvb, 0, 2, outbuf);
/* check SERCOS address of each topology field */
for(i=1;i < MAX_SERCOS_DEVICES; ++i)
{
tfield = tvb_get_letohs(tvb, i*2);
if(tfield == 0)
{
g_snprintf(outbuf, sizeof(outbuf), "Device Address %u: No SERCOS Addresss", i);
}
else if(tfield == 0xFFFF)
{
g_snprintf(outbuf, sizeof(outbuf), "Device Address %u: No Device", i);
}
else
{
g_snprintf(outbuf, sizeof(outbuf), "Device Address %u: %u", i, tfield);
}
proto_tree_add_text(tree, tvb, i*2, 2, outbuf);
}
}
void dissect_siii_at_cp1_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint telno)
{
guint devstart = telno * 128; /* AT0: slaves 0-127; AT1: slaves 128-255; ... */
tvbuff_t* tvb_n;
guint idx;
proto_item* ti; /* temporary item */
proto_tree* subtree;
proto_tree* subtree_svc;
proto_tree* subtree_devstat;
ti = proto_tree_add_text(tree, tvb, 0, 128 * 6, "Service Channel");
subtree_svc = proto_item_add_subtree(ti, ett_siii_at_svc);
ti = proto_tree_add_text(tree, tvb, 128 * 6, 512, "Device Status");
subtree_devstat = proto_item_add_subtree(ti, ett_siii_at_devstats);
for(idx = 0; idx < 128; ++idx) /* each AT of CP1/2 has data of 128 different slaves */
{
tvb_n = tvb_new_subset(tvb, 6 * idx, 6, 6); /* subset for service channel data */
ti = proto_tree_add_text(subtree_svc, tvb_n, 0, 6, "Device %u", idx + devstart);
subtree = proto_item_add_subtree(ti, ett_siii_at_svc_channel[idx]);
dissect_siii_at_svc(tvb_n, pinfo, subtree, idx + devstart);
tvb_n = tvb_new_subset(tvb, 128 * 6 + 4 * idx, 2, 2); /* subset for device status information */
ti = proto_tree_add_text(subtree_devstat, tvb_n, 0, 2, "Device %u", idx + devstart);
subtree = proto_item_add_subtree(ti, ett_siii_at_dev_status[idx]);
dissect_siii_at_devstat(tvb_n, pinfo, subtree);
}
}
void dissect_siii_at_cp3_4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint telno)
{
proto_item* ti;
proto_tree* subtree_svc;
proto_tree* subtree_devstat;
if(0 == telno) /* dissect hotplug field in AT0 only */
dissect_siii_at_hp(tvb, pinfo, tree);
/* offsets of service channel, device status and connections are unknown
* this data could be extracted from svc communication during CP2
*/
ti = proto_tree_add_text(tree, tvb, 0, 0, "Service Channels");
subtree_svc = proto_item_add_subtree(ti, ett_siii_at_svc);
ti = proto_tree_add_text(tree, tvb, 0, 0, "Device Status");
subtree_devstat = proto_item_add_subtree(ti, ett_siii_at_devstats);
}
void dissect_siii_at(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_item* ti; /* temporary item */
proto_tree* subtree;
tvbuff_t* tvb_n;
guint8 phase;
guint telno;
phase = (tvb_get_guint8(tvb, 1)&0x8F); /* read communication phase out of SERCOS III header*/
telno = (tvb_get_guint8(tvb, 0) & 0xF); /* read number of AT out of SERCOS III header */
if(check_col(pinfo->cinfo, COL_PROTOCOL))
col_set_str(pinfo->cinfo, COL_PROTOCOL, "SIII AT");
if(check_col(pinfo->cinfo, COL_INFO))
{
if(phase & 0x80) /* communication phase switching in progress */
{
col_append_fstr(pinfo->cinfo, COL_INFO, " Phase=CP?s -> CP%u",
(phase&0x0f));
}
else /* communication as usual */
{
col_append_fstr(pinfo->cinfo, COL_INFO, " Phase=CP%u",
(phase&0x0f));
}
}
ti = proto_tree_add_text(tree, tvb, 0, -1, "AT%u", telno);
subtree = proto_item_add_subtree(ti, ett_siii_at);
dissect_siii_mst(tvb, pinfo, subtree); /* dissect SERCOS III header */
switch(phase) /* call the AT dissector depending on the current communication phase */
{
case COMMUNICATION_PHASE_0: /* CP0 */
tvb_n = tvb_new_subset(tvb, 6, 1024, 1024);
dissect_siii_at_cp0(tvb_n, pinfo, subtree);
break;
case COMMUNICATION_PHASE_1: /* CP1 */
case COMMUNICATION_PHASE_2: /* CP2 */
tvb_n = tvb_new_subset(tvb, 6, 1280, 1280);
dissect_siii_at_cp1_2(tvb_n, pinfo, subtree, telno);
break;
case COMMUNICATION_PHASE_3: /* CP3 */
case COMMUNICATION_PHASE_4: /* CP4 */
tvb_n = tvb_new_subset(tvb, 6, -1, -1);
dissect_siii_at_cp3_4(tvb_n, pinfo, subtree, telno);
break;
default:
proto_tree_add_text(tree, tvb, 6, -1, "CP is unknown");
break;
}
}
void dissect_siii_at_init(gint proto_siii _U_)
{
gint idx;
/* Setup protocol subtree array */
static gint *ett[] = {
&ett_siii_at,
&ett_siii_at_svc,
&ett_siii_at_devstats
};
static gint* etts[MAX_SERCOS_DEVICES];
for(idx = 0; idx < MAX_SERCOS_DEVICES; ++idx)
{
etts[idx] = &ett_siii_at_svc_channel[idx];
}
proto_register_subtree_array(etts, array_length(etts));
for(idx = 0; idx < MAX_SERCOS_DEVICES; ++idx)
{
etts[idx] = &ett_siii_at_dev_status[idx];
}
proto_register_subtree_array(etts, array_length(etts));
/* Required function calls to register the header fields and subtrees used */
proto_register_subtree_array(ett, array_length(ett));
}

View File

@ -0,0 +1,162 @@
/* packet-sercosiii_1v1_at_devstat.c
* Routines for SERCOS III dissection
*
* $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.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include "packet-sercosiii.h"
static gint hf_siii_at_dev_status = -1;
static gint hf_siii_at_dev_status_commwarning = -1;
static gint hf_siii_at_dev_status_change_topology = -1;
static gint hf_siii_at_dev_status_top_status = -1;
static gint hf_siii_at_dev_status_inactive_port_status = -1;
static gint hf_siii_at_dev_status_errorconnection = -1;
static gint hf_siii_at_dev_status_slave_valid = -1;
static gint hf_siii_at_dev_status_proc_command_change = -1;
static gint hf_siii_at_dev_status_parameterization_level_active = -1;
static gint ett_siii_at_devstatus = -1;
static const value_string siii_at_devstatus_errorconnection_text[]=
{
{0x00, "Error-free connection"},
{0x01, "Error in the connection occurs"},
{0, NULL}
};
static const value_string siii_at_devstatus_topstatus_text[]=
{
{0x00, "Fast Forward on P/S-Channel"},
{0x01, "Loopback on P-Channel and Fast Forward"},
{0x02, "Loopback on S-Channel and Fast Forward"},
{0, NULL}
};
static const value_string siii_at_devstatus_inactiveportstatus_text[]=
{
{0x00, "No link on port"},
{0x01, "Link on port"},
{0x02, "S III P-Telegramm on port"},
{0x03, "S III S-Telegramm on port"},
{0, NULL}
};
static const value_string siii_at_dev_status_proc_command_change_text[]=
{
{0x00, "No change in procedure command acknowledgement"},
{0x01, "Changing procedure command acknowledgement"},
{0, NULL}
};
void dissect_siii_at_devstat(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
proto_tree* subtree;
proto_item* ti;
ti = proto_tree_add_item(tree, hf_siii_at_dev_status, tvb, 0, 2, TRUE);
subtree = proto_item_add_subtree(ti, ett_siii_at_devstatus);
proto_tree_add_item(subtree, hf_siii_at_dev_status_commwarning, tvb, 0, 2, TRUE);
proto_tree_add_item(subtree, hf_siii_at_dev_status_change_topology, tvb, 0, 2, TRUE);
proto_tree_add_item(subtree, hf_siii_at_dev_status_top_status, tvb, 0, 2, TRUE);
proto_tree_add_item(subtree, hf_siii_at_dev_status_inactive_port_status, tvb, 0, 2, TRUE);
proto_tree_add_item(subtree, hf_siii_at_dev_status_errorconnection, tvb, 0, 2, TRUE);
proto_tree_add_item(subtree, hf_siii_at_dev_status_slave_valid, tvb, 0, 2, TRUE);
proto_tree_add_item(subtree, hf_siii_at_dev_status_proc_command_change, tvb, 0, 2, TRUE);
proto_tree_add_item(subtree, hf_siii_at_dev_status_parameterization_level_active, tvb, 0, 2, TRUE);
}
void dissect_siii_at_devstat_init(gint proto_siii)
{
/* Setup list of header fields See Section 1.6.1 for details*/
static hf_register_info hf_siii_header[] = {
{ &hf_siii_at_dev_status,
{ "Word", "siii.at.devstatus",
FT_UINT16, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_siii_at_dev_status_commwarning,
{ "Communication Warning", "siii.at.devstatus.commwarning",
FT_UINT16, BASE_DEC, NULL, 1<<15,
NULL, HFILL }
},
{ &hf_siii_at_dev_status_change_topology,
{ "Topology Change", "siii.at.devstatus.topologychanged",
FT_UINT16, BASE_DEC, NULL, 1<<14,
NULL, HFILL }
},
{ &hf_siii_at_dev_status_top_status,
{ "Topology Status", "siii.at.devstatus.topstatus",
FT_UINT16, BASE_DEC, VALS(siii_at_devstatus_topstatus_text), 0x3<<(12),
NULL, HFILL }
},
{ &hf_siii_at_dev_status_inactive_port_status,
{ "Port 1 Status", "siii.at.devstatus.inactportstatus",
FT_UINT16, BASE_DEC, VALS(siii_at_devstatus_inactiveportstatus_text), 0x3<<(10),
NULL, HFILL }
},
{ &hf_siii_at_dev_status_errorconnection,
{ "Topology Status", "siii.at.devstatus.errorconnection",
FT_UINT16, BASE_DEC, VALS(siii_at_devstatus_errorconnection_text), 1<<9,
NULL, HFILL }
},
{ &hf_siii_at_dev_status_slave_valid,
{ "Slave data valid", "siii.at.devstatus.slavevalid",
FT_UINT16, BASE_DEC, NULL, 1<<8,
NULL, HFILL }
},
{ &hf_siii_at_dev_status_proc_command_change,
{ "Procedure Command Change", "siii.at.devstatus.proccmdchange",
FT_UINT16, BASE_DEC, VALS(siii_at_dev_status_proc_command_change_text), 1<<5,
NULL, HFILL }
},
{ &hf_siii_at_dev_status_parameterization_level_active,
{ "Parameterization level active", "siii.at.devstatus.paralevelactive",
FT_UINT16, BASE_DEC, NULL, 1<<4,
NULL, HFILL }
}
};
/* Setup protocol subtree array */
static gint *ett[] = {
&ett_siii_at_devstatus
};
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_siii, hf_siii_header, array_length(hf_siii_header));
proto_register_subtree_array(ett, array_length(ett));
}

View File

@ -0,0 +1,223 @@
/* packet-sercosiii_1v1_hp.c
* Routines for SERCOS III dissection
*
* $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.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include "packet-sercosiii.h"
static gint hf_siii_mdt_hotplug_address = -1;
static gint hf_siii_mdt_hp_ctrl = -1;
static gint hf_siii_mdt_hp_info = -1;
static gint hf_siii_at_hotplug_address = -1;
static gint hf_siii_at_hp_stat = -1;
static gint hf_siii_at_hp_info = -1;
static gint hf_siii_mdt_hotplug_control_param = -1;
static gint hf_siii_mdt_hotplug_control_svc_switch = -1;
static gint hf_siii_at_hotplug_status_param = -1;
static gint hf_siii_at_hotplug_status_hp0_finished = -1;
static gint hf_siii_at_hotplug_status_error = -1;
static gint ett_siii_mdt_hp = -1;
static gint ett_siii_at_hp = -1;
static gint ett_siii_mdt_hp_ctrl = -1;
static gint ett_siii_mdt_hp_info = -1;
static gint ett_siii_at_hp_stat = -1;
static gint ett_siii_at_hp_info = -1;
static const value_string siii_mdt_hotplug_control_functioncode_text[]=
{
{0x00, "No data"},
{0x01, "tScyc"},
{0x02, "t1"},
{0x03, "t6"},
{0x04, "t7"},
{0x05, "Communication Version"},
{0x06, "Communication timeout"},
{0x10, "MDT0 Length"},
{0x11, "MDT1 Length"},
{0x12, "MDT2 Length"},
{0x13, "MDT3 Length"},
{0x20, "AT0 Length"},
{0x21, "AT1 Length"},
{0x22, "AT2 Length"},
{0x23, "AT3 Length"},
{0x80, "MDT-SVC pointer"},
{0x81, "MDT-RTD pointer"},
{0x82, "AT-SVC pointer"},
{0x83, "AT-RTD pointer"},
{0, NULL}
};
static const value_string siii_mdt_hotplug_control_svc_switch_text[]=
{
{0, "Transmission via HP-field"},
{1, "Switch to SVC"},
{0, NULL}
};
static const value_string siii_mdt_hotplug_status_ackcode_text[]=
{
{0x80, "MDT-SVC pointer"},
{0x81, "MDT-RTD pointer"},
{0x82, "AT-SVC pointer"},
{0x83, "AT-RTD pointer"},
{255, "Next Sercos Slave has same address"},
{0, NULL}
};
static const value_string siii_at_hotplug_status_error_text[]=
{
{0, "Acknowledgement in HP-1"},
{1, "Error in HP-1"},
{0, NULL}
};
void dissect_siii_mdt_hp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
proto_tree* subtree;
proto_tree* subtree2;
proto_item* ti;
ti = proto_tree_add_text(tree, tvb, 0, 8, "Hot-Plug");
subtree = proto_item_add_subtree(ti, ett_siii_mdt_hp);
proto_tree_add_item(subtree, hf_siii_mdt_hotplug_address, tvb, 2, 2, TRUE);
ti = proto_tree_add_item(subtree, hf_siii_mdt_hp_ctrl, tvb, 2, 2, TRUE);
subtree2 = proto_item_add_subtree(ti, ett_siii_mdt_hp_ctrl);
proto_tree_add_item(subtree2, hf_siii_mdt_hotplug_control_svc_switch, tvb, 2, 2, TRUE);
proto_tree_add_item(subtree2, hf_siii_mdt_hotplug_control_param, tvb, 2, 2, TRUE);
proto_tree_add_item(subtree, hf_siii_mdt_hp_info, tvb, 4, 4, TRUE);
}
void dissect_siii_at_hp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
proto_tree* subtree;
proto_tree* subtree2;
proto_item* ti;
ti = proto_tree_add_text(tree, tvb, 0, 8, "Hot-Plug");
subtree = proto_item_add_subtree(ti, ett_siii_at_hp);
proto_tree_add_item(subtree, hf_siii_at_hotplug_address, tvb, 2, 2, TRUE);
ti = proto_tree_add_item(subtree, hf_siii_at_hp_stat, tvb, 2, 2, TRUE);
subtree2 = proto_item_add_subtree(ti, ett_siii_at_hp_stat);
proto_tree_add_item(subtree2, hf_siii_at_hotplug_status_error, tvb, 2, 2, TRUE);
proto_tree_add_item(subtree2, hf_siii_at_hotplug_status_hp0_finished, tvb, 2, 2, TRUE);
proto_tree_add_item(subtree2, hf_siii_at_hotplug_status_param, tvb, 2, 2, TRUE);
proto_tree_add_item(subtree, hf_siii_at_hp_info, tvb, 4, 4, TRUE);
}
void dissect_siii_hp_init(gint proto_siii)
{
/* Setup list of header fields See Section 1.6.1 for details*/
static hf_register_info hf_siii_header[] = {
{ &hf_siii_mdt_hotplug_address,
{"Sercos address", "siii.mdt.hp.sercosaddress",
FT_UINT16, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_siii_mdt_hp_ctrl,
{"HP control", "siii.mdt.hp.ctrl",
FT_UINT16, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_siii_mdt_hp_info,
{"HP info", "siii.mdt.hp.info",
FT_BYTES, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_siii_at_hotplug_address,
{"Sercos address", "siii.at.hp.sercosaddress",
FT_UINT16, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_siii_at_hp_stat,
{"HP status", "siii.mdt.hp.stat",
FT_UINT16, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_siii_at_hp_info,
{"HP info", "siii.at.hp.info",
FT_BYTES, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_siii_mdt_hotplug_control_param,
{"Parameter", "siii.mdt.hp.parameter",
FT_UINT16, BASE_DEC, VALS(siii_mdt_hotplug_control_functioncode_text), 0xFF,
NULL, HFILL }
},
{ &hf_siii_mdt_hotplug_control_svc_switch,
{"Switch to SVC", "siii.mdt.hp.switch",
FT_UINT16, BASE_DEC, VALS(siii_mdt_hotplug_control_svc_switch_text), 0x100,
NULL, HFILL }
},
{ &hf_siii_at_hotplug_status_param,
{"Parameter Received", "siii.at.hp.parameter",
FT_UINT16, BASE_DEC, VALS(siii_mdt_hotplug_status_ackcode_text), 0xFF,
NULL, HFILL }
},
{ &hf_siii_at_hotplug_status_hp0_finished,
{"HP/SVC", "siii.at.hp.hp0_finished",
FT_UINT16, BASE_DEC, NULL, 0x100,
NULL, HFILL }
},
{ &hf_siii_at_hotplug_status_error,
{"Error", "siii.at.hp.error",
FT_UINT16, BASE_DEC, VALS(siii_at_hotplug_status_error_text), 0x200,
NULL, HFILL }
}
};
/* Setup protocol subtree array */
static gint *ett[] = {
&ett_siii_mdt_hp,
&ett_siii_at_hp,
&ett_siii_mdt_hp_ctrl,
&ett_siii_mdt_hp_info,
&ett_siii_at_hp_stat,
&ett_siii_at_hp_info
};
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_siii, hf_siii_header, array_length(hf_siii_header));
proto_register_subtree_array(ett, array_length(ett));
}

View File

@ -0,0 +1,245 @@
/* packet-sercosiii_1v1_mdt.c
* Routines for SERCOS III dissection
*
* $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.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include "packet-sercosiii.h"
static gint hf_siii_mdt_version = -1;
static gint hf_siii_mdt_version_initprocvers = -1;
static gint hf_siii_mdt_version_num_mdt_at_cp1_2 = -1;
static gint hf_siii_mdt_version_revision = -1;
static const value_string siii_mdt_version_num_mdtat_cp1_2_text[]=
{
{0x00, "2 MDTs/ATs in CP1/2"},
{0x01, "4 MDTs/ATs in CP1/2"},
{0, NULL}
};
static const value_string siii_mdt_version_initprocvers_text[]=
{
{0x00, "No remote address allocation"},
{0x01, "Remote address allocation"},
{0, NULL}
};
static gint ett_siii_mdt = -1;
static gint ett_siii_mdt_svc = -1;
static gint ett_siii_mdt_devctrls = -1;
static gint ett_siii_mdt_version = -1;
static gint ett_siii_mdt_svc_channel[MAX_SERCOS_DEVICES] = {-1};
static gint ett_siii_mdt_dev_control[MAX_SERCOS_DEVICES] = {-1};
void dissect_siii_mdt_cp0(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
proto_item* ti;
proto_tree* subtree;
ti = proto_tree_add_item(tree, hf_siii_mdt_version, tvb, 0, 4, TRUE);
subtree = proto_item_add_subtree(ti, ett_siii_mdt_version);
proto_tree_add_item(subtree, hf_siii_mdt_version_num_mdt_at_cp1_2, tvb, 0, 4, TRUE);
proto_tree_add_item(subtree, hf_siii_mdt_version_initprocvers, tvb, 0, 4, TRUE);
proto_tree_add_item(subtree, hf_siii_mdt_version_revision, tvb, 0, 4, TRUE);
}
void dissect_siii_mdt_cp1_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint telno)
{
guint devstart = telno * 128; /* MDT0: slaves 0-127; MDT1: slaves 128-255; ... */
tvbuff_t* tvb_n;
guint idx;
proto_item* ti;
proto_tree* subtree;
proto_tree* subtree_svc;
proto_tree* subtree_devctrl;
ti = proto_tree_add_text(tree, tvb, 0, 128 * 6, "Service Channels");
subtree_svc = proto_item_add_subtree(ti, ett_siii_mdt_svc);
ti = proto_tree_add_text(tree, tvb, 128 * 6, 512, "Device Control");
subtree_devctrl = proto_item_add_subtree(ti, ett_siii_mdt_svc);
for(idx = 0; idx < 128; ++idx) /* each MDT of CP1/2 has data for 128 different slaves */
{
tvb_n = tvb_new_subset(tvb, 6 * idx, 6, 6); /* subset for service channel data */
ti = proto_tree_add_text(subtree_svc, tvb_n, 0, 6, "Device %u", idx + devstart);
subtree = proto_item_add_subtree(ti, ett_siii_mdt_svc_channel[idx]);
dissect_siii_mdt_svc(tvb_n, pinfo, subtree, idx + devstart);
tvb_n = tvb_new_subset(tvb, 128 * 6 + 4 * idx, 2, 2); /* subset for device control information */
ti = proto_tree_add_text(subtree_devctrl, tvb_n, 0, 2, "Device %u", idx + devstart);
subtree = proto_item_add_subtree(ti, ett_siii_mdt_dev_control[idx]);
dissect_siii_mdt_devctrl(tvb_n, pinfo, subtree);
}
}
void dissect_siii_mdt_cp3_4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint telno)
{
guint devstart _U_ = telno * 128;
proto_item* ti;
proto_tree* subtree_svc;
proto_tree* subtree_devctrl;
if(0 == telno) /* dissect hotplug field in MDT0 only */
dissect_siii_mdt_hp(tvb, pinfo, tree);
/* offsets of service channel, device status and connections are unknown
* this data could be extracted from svc communication during CP2
*/
ti = proto_tree_add_text(tree, tvb, 0, 0, "Service Channels");
subtree_svc = proto_item_add_subtree(ti, ett_siii_mdt_svc);
ti = proto_tree_add_text(tree, tvb, 0, 0, "Device Controls");
subtree_devctrl = proto_item_add_subtree(ti, ett_siii_mdt_svc);
}
void dissect_siii_mdt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_item* ti;
proto_tree* subtree;
tvbuff_t* tvb_n;
guint t_phase;
guint telno;
if(check_col(pinfo->cinfo, COL_PROTOCOL))
col_set_str(pinfo->cinfo, COL_PROTOCOL, "SIII MDT");
t_phase = (tvb_get_guint8(tvb, 1)&0x8F); /* read communication phase out of SERCOS III header */
telno = (tvb_get_guint8(tvb, 0) & 0xF); /* read number of MDT out of SERCOS III header */
if(check_col(pinfo->cinfo, COL_INFO))
{
if(t_phase & 0x80) /* communication phase switching in progress */
{
col_append_fstr(pinfo->cinfo, COL_INFO, " Phase=CP?s -> CP%u",
(t_phase&0x0f));
}
else /* communication as usual */
{
col_append_fstr(pinfo->cinfo, COL_INFO, " Phase=CP%u",
(t_phase&0x0f));
}
}
ti = proto_tree_add_text(tree, tvb, 0, -1, "MDT%u", telno);
subtree = proto_item_add_subtree(ti, ett_siii_mdt);
dissect_siii_mst(tvb, pinfo, subtree); /* dissect SERCOS III header */
switch(t_phase) /* call the MDT dissector depending on the current communication phase */
{
case COMMUNICATION_PHASE_0: /* CP0 */
tvb_n = tvb_new_subset(tvb, 6, 40, 40);
dissect_siii_mdt_cp0(tvb_n, pinfo, subtree);
break;
case COMMUNICATION_PHASE_1: /* CP1 */
case COMMUNICATION_PHASE_2: /* CP2 */
tvb_n = tvb_new_subset(tvb, 6, 1280, 1280);
dissect_siii_mdt_cp1_2(tvb_n, pinfo, subtree, telno);
break;
case COMMUNICATION_PHASE_3: /* CP3 */
case COMMUNICATION_PHASE_4: /* CP4 */
tvb_n = tvb_new_subset(tvb, 6, -1, -1);
dissect_siii_mdt_cp3_4(tvb_n, pinfo, subtree, telno);
break;
default:
proto_tree_add_text(tree, tvb, 6, -1, "CP is unknown");
}
}
void dissect_siii_mdt_init(gint proto_siii)
{
gint idx;
/* Setup list of header fields See Section 1.6.1 for details*/
static hf_register_info hf_siii_header[] = {
{ &hf_siii_mdt_version,
{ "Communication Version", "siii.mdt.version",
FT_UINT32, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_siii_mdt_version_revision,
{ "Revision Number", "siii.mdt.version.revision",
FT_UINT32, BASE_HEX, NULL, 0x7F,
NULL, HFILL }
},
{ &hf_siii_mdt_version_num_mdt_at_cp1_2,
{ "Number of MDTs and ATS in CP1 and CP2", "siii.mdt.version.num_mdt_at_cp1_2",
FT_UINT32, BASE_HEX, VALS(siii_mdt_version_num_mdtat_cp1_2_text), 0x30000,
NULL, HFILL }
},
{ &hf_siii_mdt_version_initprocvers,
{ "Initialization Procedure Version Number", "siii.mdt.version.initprocvers",
FT_UINT32, BASE_HEX, VALS(siii_mdt_version_initprocvers_text), 0xFF00,
NULL, HFILL }
}
};
/* Setup protocol subtree array */
static gint *ett[] = {
&ett_siii_mdt,
&ett_siii_mdt_version,
&ett_siii_mdt_svc,
&ett_siii_mdt_devctrls
};
static gint* etts[MAX_SERCOS_DEVICES];
for(idx = 0; idx < MAX_SERCOS_DEVICES; ++idx)
{
etts[idx] = &ett_siii_mdt_svc_channel[idx];
}
proto_register_subtree_array(etts, array_length(etts));
for(idx = 0; idx < MAX_SERCOS_DEVICES; ++idx)
{
etts[idx] = &ett_siii_mdt_dev_control[idx];
}
proto_register_subtree_array(etts, array_length(etts));
proto_register_field_array(proto_siii, hf_siii_header, array_length(hf_siii_header));
proto_register_subtree_array(ett, array_length(ett));
}

View File

@ -0,0 +1,102 @@
/* packet-sercosiii_1v1_mdt_devctrl.c
* Routines for SERCOS III dissection
*
* $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.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include "packet-sercosiii.h"
static gint hf_siii_mdt_dev_control_top_control = -1;
static gint hf_siii_at_dev_control_ident = -1;
static gint hf_siii_mdt_dev_control_change_topology = -1;
static gint hf_siii_mdt_dev_control = -1;
static gint ett_siii_mdt_devctrl = -1;
static const value_string siii_mdt_devcontrol_topcontrol_text[]=
{
{0x00, "Fast Forward on P/S-Channel"},
{0x01, "Loopback on P-Channel and Fast Forward"},
{0x02, "Loopback on S-Channel and Fast Forward"},
{0, NULL}
};
void dissect_siii_mdt_devctrl(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
proto_tree* subtree;
proto_item* ti;
ti = proto_tree_add_item(tree, hf_siii_mdt_dev_control, tvb, 0, 2, TRUE);
subtree = proto_item_add_subtree(ti, ett_siii_mdt_devctrl);
proto_tree_add_item(subtree, hf_siii_at_dev_control_ident, tvb, 0, 2, TRUE);
proto_tree_add_item(subtree, hf_siii_mdt_dev_control_change_topology, tvb, 0, 2, TRUE);
proto_tree_add_item(subtree, hf_siii_mdt_dev_control_top_control, tvb, 0, 2, TRUE);
}
void dissect_siii_mdt_devctrl_init(gint proto_siii)
{
/* Setup list of header fields See Section 1.6.1 for details*/
static hf_register_info hf_siii_header[] = {
{ &hf_siii_mdt_dev_control_top_control,
{ "Topology Control", "siii.mdt.devcontrol.topcontrol",
FT_UINT16, BASE_DEC, VALS(siii_mdt_devcontrol_topcontrol_text), 3<<(12),
NULL, HFILL }
},
{ &hf_siii_at_dev_control_ident,
{ "Identification", "siii.mdt.devcontrol.identrequest",
FT_UINT16, BASE_DEC, NULL, 0x8000,
NULL, HFILL }
},
{ &hf_siii_mdt_dev_control_change_topology,
{ "Changing Topology", "siii.mdt.devcontrol.topologychange",
FT_UINT16, BASE_DEC, NULL, 1<<14,
NULL, HFILL }
},
{ &hf_siii_mdt_dev_control,
{ "Word", "siii.mdt.devcontrol",
FT_UINT16, BASE_DEC, NULL, 0,
NULL, HFILL }
}
};
/* Setup protocol subtree array */
static gint *ett[] = {
&ett_siii_mdt_devctrl
};
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_siii, hf_siii_header, array_length(hf_siii_header));
proto_register_subtree_array(ett, array_length(ett));
}

View File

@ -0,0 +1,181 @@
/* packet-sercosiii_1v1_mst.c
* Routines for SERCOS III dissection
*
* $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.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include "packet-sercosiii.h"
static gint hf_siii_mst_channel = -1;
static gint hf_siii_mst_type = -1;
static gint hf_siii_mst_cyclecntvalid = -1;
static gint hf_siii_mst_telno = -1;
static gint hf_siii_mst_phase = -1;
static gint hf_siii_mst_cyclecnt = -1;
static gint hf_siii_mst_crc32 = -1;
static gint ett_siii_mst = -1;
static gint ett_siii_mst_teltype = -1;
static gint ett_siii_mst_phase = -1;
static const value_string siii_mst_phase_text[]=
{
{0x00, "CP0"},
{0x01, "CP1"},
{0x02, "CP2"},
{0x03, "CP3"},
{0x04, "CP4"},
{0x80, "CP0 (Phase Change)"},
{0x81, "CP1 (Phase Change)"},
{0x82, "CP2 (Phase Change)"},
{0x83, "CP3 (Phase Change)"},
{0x84, "CP4 (Phase Change)"},
{0, NULL}
};
static const value_string siii_mst_teltype_text[]=
{
{0x00, "CP0"},
{0x01, "CP1"},
{0x02, "CP2"},
{0x03, "CP3"},
{0x04, "CP4"},
{0x80, "CP0 (Phase Change)"},
{0x81, "CP1 (Phase Change)"},
{0x82, "CP2 (Phase Change)"},
{0x83, "CP3 (Phase Change)"},
{0x84, "CP4 (Phase Change)"},
{0, NULL}
};
static const value_string siii_mst_channel_text[]=
{
{0x00, "P-Telegram"},
{0x01, "S-Telegram"},
{0, NULL}
};
static const value_string siii_mst_type_text[]=
{
{0x00, "MDT"},
{0x01, "AT"},
{0, NULL}
};
static const value_string siii_mst_cyclecntvalid_text[]=
{
{0x00, "Invalid"},
{0x01, "Valid"},
{0, NULL}
};
void dissect_siii_mst(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
proto_item* ti;
proto_tree* subtree;
proto_tree* subtree2;
ti = proto_tree_add_text(tree, tvb, 0, 6, "MST");
subtree = proto_item_add_subtree(ti, ett_siii_mst);
ti = proto_tree_add_text(subtree, tvb, 0, 1, "Telegram Type");
subtree2 = proto_item_add_subtree(ti, ett_siii_mst_teltype);
proto_tree_add_item(subtree2, hf_siii_mst_channel, tvb, 0, 1, TRUE);
proto_tree_add_item(subtree2, hf_siii_mst_type, tvb, 0, 1, TRUE);
proto_tree_add_item(subtree2, hf_siii_mst_cyclecntvalid, tvb, 0, 1, TRUE);
proto_tree_add_item(subtree2, hf_siii_mst_telno, tvb, 0, 1, TRUE);
ti = proto_tree_add_text(subtree, tvb, 1, 1, "Phase Field");
subtree2 = proto_item_add_subtree(ti, ett_siii_mst_phase);
proto_tree_add_item(subtree2, hf_siii_mst_phase, tvb, 1, 1, TRUE);
proto_tree_add_item(subtree2, hf_siii_mst_cyclecnt, tvb, 1, 1, TRUE);
proto_tree_add_item(subtree, hf_siii_mst_crc32, tvb, 2, 4, TRUE);
}
void dissect_siii_mst_init(gint proto_siii)
{
/* Setup list of header fields See Section 1.6.1 for details*/
static hf_register_info hf_siii_header[] = {
{ &hf_siii_mst_channel,
{ "Channel", "siii.channel",
FT_UINT8, BASE_DEC, VALS(siii_mst_channel_text), 0x80,
NULL, HFILL }
},
{ &hf_siii_mst_type,
{ "Telegram Type" , "siii.type",
FT_UINT8, BASE_DEC, VALS(siii_mst_type_text), 0x40,
NULL, HFILL }
},
{ &hf_siii_mst_cyclecntvalid,
{ "Cycle Count Valid", "siii.cyclecntvalid",
FT_UINT8, BASE_DEC, VALS(siii_mst_cyclecntvalid_text), 0x20,
NULL, HFILL }
},
{ &hf_siii_mst_telno,
{ "Telegram Number", "siii.telno",
FT_UINT8, BASE_DEC, NULL, 0x0F,
NULL, HFILL }
},
{ &hf_siii_mst_phase,
{ "Phase", "siii.mst.phase",
FT_UINT8, BASE_HEX, VALS(siii_mst_phase_text), 0x8F, /* CHANGED: SB: new value is 0x8F for masking out phase */
NULL, HFILL }
},
{ &hf_siii_mst_cyclecnt,
{ "Cycle Cnt", "siii.mst.cyclecnt",
FT_UINT8, BASE_DEC, NULL, 0x70, /* CHANGED: SB: new value is 0x70 for masking out cycle cnt */
NULL, HFILL }
},
{ &hf_siii_mst_crc32,
{ "CRC32", "siii.mst.crc32",
FT_UINT32, BASE_HEX, NULL, 0,
NULL, HFILL }
}
};
/* Setup protocol subtree array */
static gint *ett[] = {
&ett_siii_mst,
&ett_siii_mst_teltype,
&ett_siii_mst_phase
};
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_siii, hf_siii_header, array_length(hf_siii_header));
proto_register_subtree_array(ett, array_length(ett));
}

View File

@ -0,0 +1,696 @@
/* packet-sercosiii_1v1_svc.c
* Routines for SERCOS III dissection
*
* $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.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include "packet-sercosiii.h"
static gint hf_siii_mdt_svch_dbe = -1;
static gint hf_siii_mdt_svch_eot = -1;
static gint hf_siii_mdt_svch_rw = -1;
static gint hf_siii_mdt_svch_mhs = -1;
static gint hf_siii_mdt_svch_info = -1;
static gint hf_siii_at_svch_valid = -1;
static gint hf_siii_at_svch_error = -1;
static gint hf_siii_at_svch_busy = -1;
static gint hf_siii_at_svch_ahs = -1;
static gint hf_siii_at_svch_info = -1;
static gint hf_siii_mdt_svch_idn = -1;
static gint hf_siii_mdt_svch_ctrl = -1;
static gint hf_siii_at_svch_stat = -1;
static gint ett_siii_mdt_svcctrl = -1;
static gint ett_siii_mdt_svcinfo = -1;
static gint ett_siii_at_svcstat = -1;
static gint ett_siii_at_svcinfo = -1;
static gint ett_siii_mdt_svch_data_error_info = -1;
static gint ett_siii_mdt_svch_data = -1;
static gint hf_siii_svch_data_telofs_telno = -1;
static gint hf_siii_svch_data_telofs_mdt_at = -1;
static gint hf_siii_svch_data_telofs_offset = -1;
static gint hf_siii_svch_data_proccmd_proccmdexec = -1;
static gint hf_siii_svch_data_proccmd_proccmd = -1;
#define IDN(SI, SE, type, paramset, datablock) ((SI<<24)|(SE<<16)|(type<<15)|(paramset<<12)|(datablock))
static const value_string siii_svch_data_proccmd_proccmdexec_text[]=
{
{0, "Interrupt procedure command execution"},
{1, "Enable procedure command execution"},
{0, NULL}
};
static const value_string siii_svch_data_proccmd_proccmd_text[]=
{
{0, "Cancel procedure command"},
{1, "Set procedure command"},
{0, NULL}
};
static const value_string siii_svch_data_mdt_at_text[]=
{
{0, "AT-telegram"},
{1, "MDT-telegram"},
{0, NULL}
};
static const value_string siii_mdt_idn_text[]=
{
{IDN(0,0,0,0, 0), "Dummy-Parameter"},
{IDN(0,0,0,0, 1), "Control unit cycle time (tNcyc)"},
{IDN(0,0,0,0, 2), "Communication cycle time (tScyc)"},
{IDN(0,0,0,0, 11), "Class 1 diagnostic"},
{IDN(0,0,0,0, 12), "Class 2 diagnostic"},
{IDN(0,0,0,0, 14), "Interface status"},
{IDN(0,0,0,0, 15), "Telegram Type"},
{IDN(0,0,0,0, 16), "Configuration list of AT"},
{IDN(0,0,0,0, 17), "IDN-list of all operation data"},
{IDN(0,0,0,0, 18), "IDN-list of operation data for CP2"},
{IDN(0,0,0,0, 19), "IDN-list of operation data for CP3"},
{IDN(0,0,0,0, 21), "IDN-list of invalid operation data for CP2"},
{IDN(0,0,0,0, 22), "IDN-list of invalid operation data for CP3"},
{IDN(0,0,0,0, 24), "Configuration list of MDT"},
{IDN(0,0,0,0, 25), "IDN-list of all procedure commands"},
{IDN(0,0,0,0, 26), "Configuration list for signal status word"},
{IDN(0,0,0,0, 27), "Configuration list for signal control word"},
{IDN(0,0,0,0, 28), "MST error counter"},
{IDN(0,0,0,0, 29), "MDT error counter"},
{IDN(0,0,0,0, 32), "Primary operation mode"},
{IDN(0,0,0,0, 36), "Velocity command value"},
{IDN(0,0,0,0, 37), "Additive velocity command value"},
{IDN(0,0,0,0, 38), "Positive velocity limit value"},
{IDN(0,0,0,0, 39), "Negative velocity limit value"},
{IDN(0,0,0,0, 40), "Velocity feedback value 1"},
{IDN(0,0,0,0, 41), "Homing velocity"},
{IDN(0,0,0,0, 42), "Homing acceleration"},
{IDN(0,0,0,0, 43), "Velocity polarity parameter"},
{IDN(0,0,0,0, 44), "Velocity data scaling type"},
{IDN(0,0,0,0, 45), "Velocity data scaling factor"},
{IDN(0,0,0,0, 46), "Velocity data scaling exponent"},
{IDN(0,0,0,0, 47), "Position command value"},
{IDN(0,0,0,0, 48), "Additive position command value"},
{IDN(0,0,0,0, 49), "Positive position limit value"},
{IDN(0,0,0,0, 50), "Negative position limit value"},
{IDN(0,0,0,0, 51), "Position feedback value 1 (motor feedback)"},
{IDN(0,0,0,0, 52), "Reference distance 1"},
{IDN(0,0,0,0, 53), "Position feedback value 2 (external feedback)"},
{IDN(0,0,0,0, 54), "Reference distance 2"},
{IDN(0,0,0,0, 55), "Position polarity parameter"},
{IDN(0,0,0,0, 57), "Position window"},
{IDN(0,0,0,0, 58), "Reversal clearance"},
{IDN(0,0,0,0, 59), "Position switch flag parameter"},
{IDN(0,0,0,0, 60), "Position switches (position switch points on 1-16)"},
{IDN(0,0,0,0, 76), "Position data scaling type"},
{IDN(0,0,0,0, 77), "Linear position data scaling factor"},
{IDN(0,0,0,0, 78), "Linear position data scaling exponent"},
{IDN(0,0,0,0, 79), "Rotational position resolution"},
{IDN(0,0,0,0, 80), "Torque command value"},
{IDN(0,0,0,0, 81), "Additive torque command value"},
{IDN(0,0,0,0, 82), "Positive torque limit value"},
{IDN(0,0,0,0, 83), "Negative torque limit value"},
{IDN(0,0,0,0, 84), "Torque feedback value"},
{IDN(0,0,0,0, 85), "Torque polarity parameter"},
{IDN(0,0,0,0, 86), "Torque/force data scaling type"},
{IDN(0,0,0,0, 91), "Bipolar velocity limit value"},
{IDN(0,0,0,0, 92), "Bipolar torque limit value"},
{IDN(0,0,0,0, 93), "Torque/force scaling data factor"},
{IDN(0,0,0,0, 94), "Torque/force scaling data exponent"},
{IDN(0,0,0,0, 95), "Diagnostic message"},
{IDN(0,0,0,0, 96), "Slave arrangement (SLKN)"},
{IDN(0,0,0,0, 97), "Mask class 2 diagnostic"},
{IDN(0,0,0,0, 98), "Mask class 3 diagnostic"},
{IDN(0,0,0,0, 99), "Reset class 1 diagnostic"},
{IDN(0,0,0,0, 100), "Velocity loop proportional gain"},
{IDN(0,0,0,0, 101), "Velocity loop integral action time"},
{IDN(0,0,0,0, 102), "Velocity loop differential time"},
{IDN(0,0,0,0, 103), "Modulo value"},
{IDN(0,0,0,0, 104), "Position loop KV-factor"},
{IDN(0,0,0,0, 105), "Position loop integral action time"},
{IDN(0,0,0,0, 106), "Current loop proportional gain 1"},
{IDN(0,0,0,0, 107), "Current loop integral action time 1"},
{IDN(0,0,0,0, 108), "Feedrate override"},
{IDN(0,0,0,0, 109), "Motor peak current"},
{IDN(0,0,0,0, 110), "Amplifier peak current"},
{IDN(0,0,0,0, 111), "Motor continuous stall current"},
{IDN(0,0,0,0, 112), "Amplifier rated current"},
{IDN(0,0,0,0, 113), "Maximum motor speed"},
{IDN(0,0,0,0, 114), "Load limit of the motor"},
{IDN(0,0,0,0, 115), "Position feedback 2 type"},
{IDN(0,0,0,0, 116), "Resolution of feedback 1"},
{IDN(0,0,0,0, 117), "Resolution of feedback 2"},
{IDN(0,0,0,0, 118), "Resolution of linear feedback"},
{IDN(0,0,0,0, 119), "Current loop proportional gain 2"},
{IDN(0,0,0,0, 120), "Current loop integral action time 2"},
{IDN(0,0,0,0, 121), "Input revolutions of load gear"},
{IDN(0,0,0,0, 122), "Output revolutions of load gear"},
{IDN(0,0,0,0, 123), "Feed constant"},
{IDN(0,0,0,0, 124), "Standstill window"},
{IDN(0,0,0,0, 125), "Velocity threshold (nx)"},
{IDN(0,0,0,0, 126), "Torque threshold (Tx)"},
{IDN(0,0,0,0, 127), "CP3 transition check"},
{IDN(0,0,0,0, 128), "CP4 transition check"},
{IDN(0,0,0,0, 129), "Manufacturer class 1 diagnostic"},
{IDN(0,0,0,0, 130), "Probe value 1 positive edge"},
{IDN(0,0,0,0, 131), "Probe value 1 negative edge"},
{IDN(0,0,0,0, 132), "Probe value 2 positive edge"},
{IDN(0,0,0,0, 133), "Probe value 2 negative edge"},
{IDN(0,0,0,0, 134), "Drive control"},
{IDN(0,0,0,0, 135), "Drive status"},
{IDN(0,0,0,0, 136), "Positive acceleration limit value"},
{IDN(0,0,0,0, 137), "Negative acceleration limit value"},
{IDN(0,0,0,0, 138), "Bipolar acceleration limit value"},
{IDN(0,0,0,0, 139), "Park axis procedure command"},
{IDN(0,0,0,0, 143), "SERCOS Interface version"},
{IDN(0,0,0,0, 144), "Signal status word"},
{IDN(0,0,0,0, 145), "Signal control word"},
{IDN(0,0,0,0, 146), "Control unit controlled homing procedure command"},
{IDN(0,0,0,0, 147), "Homing parameter"},
{IDN(0,0,0,0, 148), "Drive controlled homing procedure command"},
{IDN(0,0,0,0, 149), "Position drive stop procedure command"},
{IDN(0,0,0,0, 150), "Reference offset 1"},
{IDN(0,0,0,0, 151), "Reference offset 2"},
{IDN(0,0,0,0, 152), "Position spindle procedure command"},
{IDN(0,0,0,0, 153), "Spindle angle position"},
{IDN(0,0,0,0, 154), "Spindle positioning parameter"},
{IDN(0,0,0,0, 155), "Friction torque compensation"},
{IDN(0,0,0,0, 156), "Velocity feedback value 2"},
{IDN(0,0,0,0, 157), "Velocity window"},
{IDN(0,0,0,0, 158), "Power threshold (Px)"},
{IDN(0,0,0,0, 159), "Monitoring window"},
{IDN(0,0,0,0, 161), "Acceleration data scaling factor"},
{IDN(0,0,0,0, 162), "Acceleration data scaling exponent"},
{IDN(0,0,0,0, 163), "Weight counterbalance"},
{IDN(0,0,0,0, 164), "Acceleration feedback value 1"},
{IDN(0,0,0,0, 165), "Distance-coded reference marks A"},
{IDN(0,0,0,0, 166), "Distance-coded reference marks B"},
{IDN(0,0,0,0, 167), "Frequency limit of feedback 1"},
{IDN(0,0,0,0, 169), "Probe control"},
{IDN(0,0,0,0, 170), "Probing cycle procedure command"},
{IDN(0,0,0,0, 171), "Calculate displacement procedure command"},
{IDN(0,0,0,0, 172), "Displacement to the referenced system procedure command"},
{IDN(0,0,0,0, 173), "Marker position A"},
{IDN(0,0,0,0, 174), "Marker position B"},
{IDN(0,0,0,0, 175), "Displacement parameter 1"},
{IDN(0,0,0,0, 176), "Displacement parameter 2"},
{IDN(0,0,0,0, 177), "Absolute distance 1"},
{IDN(0,0,0,0, 178), "Absolute distance 2"},
{IDN(0,0,0,0, 179), "Probe status"},
{IDN(0,0,0,0, 180), "Spindle relative offset"},
{IDN(0,0,0,0, 181), "Manufacturer class 2 diagnostic"},
{IDN(0,0,0,0, 183), "Synchronization velocity window"},
{IDN(0,0,0,0, 184), "Synchronization velocity error limit"},
{IDN(0,0,0,0, 185), "Length of the configurable data record in the AT"},
{IDN(0,0,0,0, 186), "Length of the configurable data record in the MDT"},
{IDN(0,0,0,0, 187), "IDN list of configurable data in the AT"},
{IDN(0,0,0,0, 188), "IDN list of configurable data in the MDT"},
{IDN(0,0,0,0, 189), "Following distance"},
{IDN(0,0,0,0, 190), "Drive controlled gear engaging procedure command"},
{IDN(0,0,0,0, 191), "Cancel reference point procedure command"},
{IDN(0,0,0,0, 192), "IDN-list of all backup operation data"},
{IDN(0,0,0,0, 193), "Positioning jerk"},
{IDN(0,0,0,0, 194), "Acceleration command time"},
{IDN(0,0,0,0, 195), "Acceleration feedback value 2"},
{IDN(0,0,0,0, 196), "Motor rated current"},
{IDN(0,0,0,0, 197), "Set coordinate system procedure command"},
{IDN(0,0,0,0, 198), "Initial coordinate value"},
{IDN(0,0,0,0, 199), "Shift coordinate system procedure command"},
{IDN(0,0,0,0, 200), "Amplifier warning temperature"},
{IDN(0,0,0,0, 201), "Motor warning temperature"},
{IDN(0,0,0,0, 202), "Cooling error warning temperature"},
{IDN(0,0,0,0, 203), "Amplifier shut-down temperature"},
{IDN(0,0,0,0, 204), "Motor shut-down temperature"},
{IDN(0,0,0,0, 205), "Cooling error shut-down temperature"},
{IDN(0,0,0,0, 206), "Drive on delay time"},
{IDN(0,0,0,0, 207), "Drive off delay time"},
{IDN(0,0,0,0, 208), "Temperature data scaling type"},
{IDN(0,0,0,0, 209), "Lower adaptation limit"},
{IDN(0,0,0,0, 210), "Upper adaptation limit"},
{IDN(0,0,0,0, 211), "Adaptation proportional gain"},
{IDN(0,0,0,0, 212), "Adaptation integral action time"},
{IDN(0,0,0,0, 213), "Engaging dither amplitude"},
{IDN(0,0,0,0, 214), "Average engaging speed"},
{IDN(0,0,0,0, 215), "Engaging dither period"},
{IDN(0,0,0,0, 216), "Switch parameter set procedure command"},
{IDN(0,0,0,0, 217), "Parameter set preselection"},
{IDN(0,0,0,0, 218), "Gear-ration preselection"},
{IDN(0,0,0,0, 219), "IDN-list of parameter set"},
{IDN(0,0,0,0, 220), "Minimum spindle speed"},
{IDN(0,0,0,0, 221), "Maximum spindle speed"},
{IDN(0,0,0,0, 222), "Spindle positioning speed"},
{IDN(0,0,0,0, 223), "Drive controlled synchronous operation procedure command"},
{IDN(0,0,0,0, 224), "Lead Spindle Address"},
{IDN(0,0,0,0, 225), "Synchronous spindle revolutions"},
{IDN(0,0,0,0, 226), "Lead spindle revolutions"},
{IDN(0,0,0,0, 227), "Synchronous spindle revolutions"},
{IDN(0,0,0,0, 228), "Synchronization position window"},
{IDN(0,0,0,0, 229), "Synchronization position error limit"},
{IDN(0,0,0,0, 230), "Synchronization position offset"},
{IDN(0,0,0,0, 254), "Actual parameter set"},
{IDN(0,0,0,0, 255), "Actual gear ration"},
{IDN(0,0,0,0, 256), "Multiplication factor 1"},
{IDN(0,0,0,0, 257), "Multiplication factor 2"},
{IDN(0,0,0,0, 258), "Target position"},
{IDN(0,0,0,0, 259), "Positioning velocity"},
{IDN(0,0,0,0, 260), "Positioning acceleration"},
{IDN(0,0,0,0, 261), "Coarse position window"},
{IDN(0,0,0,0, 262), "Load defaults procedure command"},
{IDN(0,0,0,0, 263), "Load working memory procedure command"},
{IDN(0,0,0,0, 264), "Backup working memory procedure command"},
{IDN(0,0,0,0, 265), "Language selection"},
{IDN(0,0,0,0, 266), "List of available languages"},
{IDN(0,0,0,0, 267), "Password"},
{IDN(0,0,0,0, 268), "Angular setting"},
{IDN(0,0,0,0, 269), "Storage mode"},
{IDN(0,0,0,0, 270), "IDN-list of selected backup operation data"},
{IDN(0,0,0,0, 272), "Velocity window percentage"},
{IDN(0,0,0,0, 273), "Maximum drive off delay time"},
{IDN(0,0,0,0, 275), "Coordinate offset value"},
{IDN(0,0,0,0, 276), "Return to Modulo range procedure command"},
{IDN(0,0,0,0, 277), "Position feedback 1 type"},
{IDN(0,0,0,0, 278), "Maximum travel range"},
{IDN(0,0,0,0, 279), "IDN list of password protected data"},
{IDN(0,0,0,0, 280), "Underflow threshold"},
{IDN(0,0,0,0, 282), "Positioning command value"},
{IDN(0,0,0,0, 283), "Current coordinate offset"},
{IDN(0,0,0,0, 292), "List of supported operation modes"},
{IDN(0,0,0,0, 293), "Selectively backup working memory procedure command"},
{IDN(0,0,0,0, 294), "Divider modulo value"},
{IDN(0,0,0,0, 295), "Drive enable delay time"},
{IDN(0,0,0,0, 296), "Velocity feed forward gain"},
{IDN(0,0,0,0, 297), "Homing distance"},
{IDN(0,0,0,0, 298), "Suggest home switch distance"},
{IDN(0,0,0,0, 299), "Home switch offset 1"},
{IDN(0,0,0,0, 300), "Real-time control bit 1"},
{IDN(0,0,0,0, 301), "Allocation of real-time control bit 1",},
{IDN(0,0,0,0, 302), "Real-time control bit 2"},
{IDN(0,0,0,0, 303), "Allocation of real-time control bit 2"},
{IDN(0,0,0,0, 304), "Real-time status bit 1"},
{IDN(0,0,0,0, 305), "Allocation of real-time status bit 1"},
{IDN(0,0,0,0, 306), "Real-time status-bit 2"},
{IDN(0,0,0,0, 307), "Allocation of real-time status bit 2"},
{IDN(0,0,0,0, 308), "Synchronization operation status"},
{IDN(0,0,0,0, 309), "Synchronization error status"},
{IDN(0,0,0,0, 310), "Overload warning"},
{IDN(0,0,0,0, 311), "Amplifier overtemperature warning"},
{IDN(0,0,0,0, 312), "Motor overtemperature warning"},
{IDN(0,0,0,0, 313), "Cooling error warning"},
{IDN(0,0,0,0, 315), "Positioning velocity higher than n Limit"},
{IDN(0,0,0,0, 323), "Target position outside of travel range"},
{IDN(0,0,0,0, 326), "Parameter checksum"},
{IDN(0,0,0,0, 327), "IDN list of checksum parameter"},
{IDN(0,0,0,0, 328), "Bit number allocation list for signal status word"},
{IDN(0,0,0,0, 329), "Bit number allocation list for signal control word"},
{IDN(0,0,0,0, 330), "Status 'nfeedback = ncommand'"},
{IDN(0,0,0,0, 331), "Status 'nfeedback = 0'"},
{IDN(0,0,0,0, 332), "Status 'nfeedback less then nx'"},
{IDN(0,0,0,0, 333), "Status 'T higher than Tx'"},
{IDN(0,0,0,0, 334), "Status 'T greater than Tlimit '"},
{IDN(0,0,0,0, 335), "Status 'ncommand greater than nlimit'"},
{IDN(0,0,0,0, 336), "Status 'In position'"},
{IDN(0,0,0,0, 337), "Status 'P greater Px'"},
{IDN(0,0,0,0, 338), "Status 'Position feedback = active target position'"},
{IDN(0,0,0,0, 339), "Status 'nfeedback less than minimum spindle speed'"},
{IDN(0,0,0,0, 340), "Status 'nfeedback exceeds maximum spindle speed'"},
{IDN(0,0,0,0, 341), "Status 'In Coarse position'"},
{IDN(0,0,0,0, 342), "Status 'Target position attained'"},
{IDN(0,0,0,0, 343), "Status 'Interpolator halted'"},
{IDN(0,0,0,0, 346), "Positioning control"},
{IDN(0,0,0,0, 347), "Velocity error"},
{IDN(0,0,0,0, 348), "Acceleration feed forward gain"},
{IDN(0,0,0,0, 349), "Bipolar jerk limit"},
{IDN(0,0,0,0, 356), "Distance home switch - marker puls"},
{IDN(0,0,0,0, 357), "Marker pulse distance"},
{IDN(0,0,0,0, 358), "Home switch offset 2"},
{IDN(0,0,0,0, 359), "Positioning deceleration"},
{IDN(0,0,0,0, 360), "MDT data container"},
{IDN(0,0,0,0, 362), "MDT data container A list index"},
{IDN(0,0,0,0, 364), "AT data container A1"},
{IDN(0,0,0,0, 366), "AT data container A list index"},
{IDN(0,0,0,0, 368), "Data container A pointer"},
{IDN(0,0,0,0, 370), "MDT data container A/B configuration list"},
{IDN(0,0,0,0, 371), "AT data container A/B configuration list"},
{IDN(0,0,0,0, 372), "Drive Halt acceleration bipolar"},
{IDN(0,0,0,0, 377), "Velocity feedback monitoring window"},
{IDN(0,0,0,0, 378), "Absolute encoder range 1"},
{IDN(0,0,0,0, 379), "Absolute encoder range 2"},
{IDN(0,0,0,0, 380), "DC bus voltage"},
{IDN(0,0,0,0, 381), "DC bus current"},
{IDN(0,0,0,0, 382), "DC bus power"},
{IDN(0,0,0,0, 383), "Motor temperature"},
{IDN(0,0,0,0, 384), "Amplifier temperature"},
{IDN(0,0,0,0, 385), "Active power"},
{IDN(0,0,0,0, 386), "Active position feedback value"},
{IDN(0,0,0,0, 387), "Power overload"},
{IDN(0,0,0,0, 388), "Braking current limit"},
{IDN(0,0,0,0, 389), "Effective current"},
{IDN(0,0,0,0, 390), "DiagnosticNumber"},
{IDN(0,0,0,0, 391), "Position feedback monitoring window"},
{IDN(0,0,0,0, 392), "Velocity feedback filter"},
{IDN(0,0,0,0, 393), "Command value mode"},
{IDN(0,0,0,0, 398), "IDN list of configurable real-time/status bits"},
{IDN(0,0,0,0, 399), "IDN list of configurable real-time/control bits"},
{IDN(0,0,0,0, 400), "Home switch"},
{IDN(0,0,0,0, 401), "Probe 1"},
{IDN(0,0,0,0, 402), "Probe 2"},
{IDN(0,0,0,0, 403), "Position feedback value status"},
{IDN(0,0,0,0, 404), "Position command value status"},
{IDN(0,0,0,0, 405), "Probe 1 enable"},
{IDN(0,0,0,0, 406), "Probe 2 enable"},
{IDN(0,0,0,0, 407), "Homing enable"},
{IDN(0,0,0,0, 408), "Reference marker pulse registered"},
{IDN(0,0,0,0, 409), "Probe 1 positive latched"},
{IDN(0,0,0,0, 410), "Probe 1 negative latched"},
{IDN(0,0,0,0, 411), "Probe 2 positive latched"},
{IDN(0,0,0,0, 412), "Probe 2 negative latched"},
{IDN(0,0,0,0, 413), "Bit number allocation of real-time control bit 1"},
{IDN(0,0,0,0, 414), "Bit number allocation of real-time control bit 2"},
{IDN(0,0,0,0, 415), "Bit number allocation of real-time status bit 1"},
{IDN(0,0,0,0, 416), "Bit number allocation of real-time status bit 2"},
{IDN(0,0,0,0, 417), "Positioning velocity threshold in modulo mode"},
{IDN(0,0,0,0, 418), "Target position window in modulo mode"},
{IDN(0,0,0,0, 419), "Positioning acknowledge"},
{IDN(0,0,0,0, 420), "Activate parametrization level procedure command (PL)"},
{IDN(0,0,0,0, 422), "Exit parameterization level procedure command"},
{IDN(0,0,0,0, 423), "IDN-list of invalid data for parameterization level"},
{IDN(0,0,0,0, 426), "Measuring data allocation 1"},
{IDN(0,0,0,0, 427), "Measuring data allocation 2"},
{IDN(0,0,0,0, 428), "IDN list of configurable measuring data"},
{IDN(0,0,0,0, 429), "Emergency stop deceleration"},
{IDN(0,0,0,0, 430), "Active target position"},
{IDN(0,0,0,0, 431), "Spindle positioning acceleration bipolar"},
{IDN(0,0,0,0, 437), "Positioning status"},
{IDN(0,0,0,0, 446), "Ramp reference velocity"},
{IDN(0,0,0,0, 447), "Set absolute position procedure command"},
{IDN(0,0,0,0, 448), "Set absolute position control word"},
{IDN(0,0,0,0, 460), "Position switches (position switch points off 1-16)"},
{IDN(0,0,0,0, 476), "Position switch control"},
{IDN(0,0,0,0, 477), "Position switch hysteresis"},
{IDN(0,0,0,0, 478), "Limit switch status"},
{IDN(0,0,0,0, 509), "Extended probe control"},
{IDN(0,0,0,0, 510), "Difference value probe 1"},
{IDN(0,0,0,0, 511), "Difference value probe 2"},
{IDN(0,0,0,0, 512), "Start position probing window 1"},
{IDN(0,0,0,0, 513), "End position probing window 1"},
{IDN(0,0,0,0, 514), "Start position probing window 2"},
{IDN(0,0,0,0, 515), "End position probing window 2"},
{IDN(0,0,0,0, 516), "Marker losses probe 1"},
{IDN(0,0,0,0, 517), "Marker losses probe 2"},
{IDN(0,0,0,0, 518), "Maximum marker losses probe 1"},
{IDN(0,0,0,0, 519), "Maximum marker losses probe 2"},
{IDN(0,0,0,0, 520), "Axis control word"},
{IDN(0,0,0,0, 521), "Axis status word"},
{IDN(0,0,0,0, 522), "Difference value 1 latched"},
{IDN(0,0,0,0, 523), "Difference value 2 latched"},
{IDN(0,0,0,0, 524), "Probe 1 delay positive"},
{IDN(0,0,0,0, 525), "Delay Negative Edge, Probe 1"},
{IDN(0,0,0,0, 526), "Delay positive Edge, Probe 2"},
{IDN(0,0,0,0, 527), "Delay Negative Edge, Probe 2"},
{IDN(0,0,0,0, 530), "Clamping torque"},
{IDN(0,0,0,0, 531), "Checksum for backup operation data"},
{IDN(0,0,0,0, 532), "Limit switch control"},
{IDN(0,0,0,0, 533), "Motor continuous stall torque/force"},
{IDN(0,0,0,0,1000), "SCP Type & Version"},
{IDN(0,0,0,0,1001), "SERCOS III: Control unit cycle time (tNcyc)"},
{IDN(0,0,0,0,1002), "SERCOS III: Communication cycle time (tScyc)"},
{IDN(0,0,0,0,1003), "SERCOS III: Number of successive MDT errors"},
{IDN(0,0,0,0,1005), "SERCOS III: Feedback value computation time (t5)"},
{IDN(0,0,0,0,1006), "SERCOS III: AT transmission starting time (t1)"},
{IDN(0,0,0,0,1007), "SERCOS III: Synchronization time (t8)"},
{IDN(0,0,0,0,1008), "SERCOS III: Command value valid time (t3)"},
{IDN(0,0,0,0,1009), "SERCOS III: Device Control offset in MDT"},
{IDN(0,0,0,0,1010), "SERCOS III: Length of MDT"},
{IDN(0,0,0,0,1011), "SERCOS III: Device Status offset in AT"},
{IDN(0,0,0,0,1012), "SERCOS III: Length of AT"},
{IDN(0,0,0,0,1013), "SERCOS III: SVC offset in MDT"},
{IDN(0,0,0,0,1014), "SERCOS III: SVC offset in AT"},
{IDN(0,0,0,0,1015), "SERCOS III: Ring delay"},
{IDN(0,0,0,0,1016), "SERCOS III: Slave delay"},
{IDN(0,0,0,0,1017), "SERCOS III: Transmission starting time IP channel"},
{IDN(0,0,0,0,1018), "SERCOS III: SYNC delay"},
{IDN(0,0,0,0,1019), "SERCOS III: MAC address"},
{IDN(0,0,0,0,1020), "SERCOS III: IP address"},
{IDN(0,0,0,0,1021), "SERCOS III: Network mask"},
{IDN(0,0,0,0,1022), "SERCOS III: Gateway address"},
{IDN(0,0,0,0,1023), "SERCOS III: Sync jitter"},
{IDN(0,0,0,0,1024), "SERCOS III: Ring control - node control"},
{IDN(0,0,0,0,1025), "SERCOS III: Ring status - node status"},
{IDN(0,0,0,0,1026), "SERCOS III: Hardware identification"},
{IDN(1,0,0,0,1027), "Requested MTU"},
{IDN(2,0,0,0,1027), "Effective MTU"},
{IDN(0,0,0,0,1028), "SERCOS III: Error counter MDT0 MST"},
{IDN(0,0,0,0,1029), "SERCOS III: Error counter MDT0-3"},
{IDN(0,0,0,0,1030), "SERCOS III: Error counter AT0-3"},
{IDN(0,0,0,0,1031), "Signal assignment Port 1 & Port 2"},
{IDN(0,0,0,0,1035), "Error counter Port1 and Port2"},
{IDN(0,0,0,0,1040), "SERCOSAddress"},
{IDN(0,0,0,0,1041), "AT Command value valid time (t9)"},
{IDN(0,0,0,0,1044), "Device Control"},
{IDN(0,0,0,0,1045), "Device Status"},
{IDN(0,0,0,0,1046), "IDN-list of SERCOS addresses in device"},
{IDN(0,0,0,0,1134), "SERCOS III: Device control"},
{IDN(0,0,0,0,1135), "SERCOS III: Device status"},
{0, NULL}
};
static const value_string siii_mdt_svch_dbe_text[]=
{
{0x00, "Element 0: Closed SVC"},
{0x01, "Element 1: Opening IDN"},
{0x02, "Element 2: Name of operation data"},
{0x03, "Element 3: Attribute of operation data"},
{0x04, "Element 4: Unit of operation data"},
{0x05, "Element 5: Minimum value of operation data"},
{0x06, "Element 6: Maximum value of operation data"},
{0x07, "Element 7: Operation data"},
{0, NULL}
};
static const value_string siii_mdt_svch_eot_text[]=
{
{0x00, "Transmission in progress"},
{0x01, "Last transmission"},
{0, NULL}
};
static const value_string siii_mdt_svch_rw_text[]=
{
{0x00, "Read SVC INFO"},
{0x01, "Write SVC INFO"},
{0, NULL}
};
static const value_string siii_at_svch_valid_text[]=
{
{0x00, "SVC not valid"},
{0x01, "SVC valid"},
{0, NULL}
};
static const value_string siii_at_svch_error_text[]=
{
{0x00, "No error"},
{0x01, "Error in SVC"},
{0, NULL}
};
static const value_string siii_at_svch_busy_text[]=
{
{0x00, "Step finished, slave ready for new step"},
{0x01, "Step in process, new step not allowed"},
{0, NULL}
};
void dissect_siii_mdt_svc(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint devno _U_) /* devno will be needed in later versions */
{
proto_tree* subtree;
proto_item* ti;
guint16 svc_ctrl = tvb_get_letohs(tvb, 0); /* service channel header */
guint32 svc_info = tvb_get_letohl(tvb, 2); /* service channel data */
guint8 svc_dbe = (svc_ctrl>>3) & 7; /* accessed data block element */
ti = proto_tree_add_item(tree, hf_siii_mdt_svch_ctrl, tvb, 0, 2, TRUE);
subtree = proto_item_add_subtree(ti, ett_siii_mdt_svcctrl);
proto_tree_add_item(subtree, hf_siii_mdt_svch_dbe, tvb, 0, 2, TRUE); /* data block element */
proto_tree_add_item(subtree, hf_siii_mdt_svch_eot, tvb, 0, 2, TRUE); /* end of transmission */
proto_tree_add_item(subtree, hf_siii_mdt_svch_rw, tvb, 0, 2, TRUE); /* read or write */
proto_tree_add_item(subtree, hf_siii_mdt_svch_mhs, tvb, 0, 2, TRUE); /* master hand shake */
ti = proto_tree_add_item(tree, hf_siii_mdt_svch_info, tvb, 2, 4, TRUE);
if(1 == svc_dbe)
{
subtree = proto_item_add_subtree(ti, ett_siii_mdt_svcinfo);
proto_tree_add_text(subtree, tvb, 2, 4, "IDN code: %c-%u-%04d.%d.%d",
((0xFFFF & svc_info)>>15)?'P':'S', /* private or sercos IDN */
(svc_info>>12)&7, /* parameter record */
(svc_info&4095), /* IDN */
(svc_info>>24) & 0xFF, /* structure index */
(svc_info>>16) & 0xFF); /* structure element */
proto_tree_add_item(subtree, hf_siii_mdt_svch_idn, tvb, 2, 4, TRUE);
}
}
void dissect_siii_at_svc(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint devno _U_) /* devno will be used in later versions */
{
proto_tree* subtree;
proto_item* ti;
ti = proto_tree_add_item(tree, hf_siii_at_svch_stat, tvb, 0, 2, TRUE);
subtree = proto_item_add_subtree(ti, ett_siii_at_svcstat);
proto_tree_add_item(subtree, hf_siii_at_svch_valid, tvb, 0, 2, TRUE);
proto_tree_add_item(subtree, hf_siii_at_svch_error, tvb, 0, 2, TRUE);
proto_tree_add_item(subtree, hf_siii_at_svch_busy, tvb, 0, 2, TRUE);
proto_tree_add_item(subtree, hf_siii_at_svch_ahs, tvb, 0, 2, TRUE);
ti = proto_tree_add_item(tree, hf_siii_at_svch_info, tvb, 2, 4, TRUE);
}
void dissect_siii_svc_init(gint proto_siii)
{
/* Setup list of header fields See Section 1.6.1 for details*/
static hf_register_info hf_siii_header[] = {
{ &hf_siii_mdt_svch_ctrl,
{"SvcCtrl", "siii.mdt.svch.ctrl",
FT_UINT16, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_siii_at_svch_stat,
{"SvcStat", "siii.mdt.svch.stat",
FT_UINT16, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_siii_mdt_svch_info,
{"Svc Info", "siii.mdt.svch.info",
FT_BYTES, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_siii_at_svch_info,
{"Svc Info", "siii.at.svch.info",
FT_BYTES, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_siii_mdt_svch_idn,
{"IDN", "siii.mdt.svch.idn",
FT_UINT32, BASE_HEX, VALS(siii_mdt_idn_text), 0,
NULL, HFILL }
},
{ &hf_siii_mdt_svch_dbe,
{ "Data block element", "siii.mdt.svch.dbe",
FT_UINT16, BASE_DEC, VALS(siii_mdt_svch_dbe_text), 0x38,
NULL, HFILL }
},
{ &hf_siii_mdt_svch_eot,
{"End of element transmission", "siii.mdt.svch.eot",
FT_UINT16, BASE_DEC, VALS(siii_mdt_svch_eot_text), 0x04,
NULL, HFILL }
},
{ &hf_siii_mdt_svch_rw,
{"Read/Write", "siii.mdt.svch.rw",
FT_UINT16, BASE_DEC, VALS(siii_mdt_svch_rw_text), 0x02,
NULL, HFILL }
},
{ &hf_siii_mdt_svch_mhs,
{"Master Handshake", "siii.mdt.svch.mhs",
FT_UINT16, BASE_DEC, NULL, 0x01,
NULL, HFILL }
},
{ &hf_siii_at_svch_valid,
{ "SVC process", "siii.mdt.svch.proc",
FT_UINT16, BASE_DEC, VALS(siii_at_svch_valid_text), 0x08,
NULL, HFILL }
},
{ &hf_siii_at_svch_error,
{"SVC Error", "siii.mdt.svch.error",
FT_UINT16, BASE_DEC, VALS(siii_at_svch_error_text), 0x04,
NULL, HFILL }
},
{ &hf_siii_at_svch_busy,
{"Busy", "siii.mdt.svch.busy",
FT_UINT16, BASE_DEC, VALS(siii_at_svch_busy_text), 0x02,
NULL, HFILL }
},
{ &hf_siii_at_svch_ahs,
{"Handshake", "siii.at.svch.ahs",
FT_UINT16, BASE_DEC, NULL, 0x01,
NULL, HFILL }
},
{ &hf_siii_svch_data_telofs_telno,
{"Telegram Number", "siii.mdt.svch.data.telassign.telno",
FT_UINT16, BASE_DEC, NULL, 0xF000,
NULL, HFILL }
},
{ &hf_siii_svch_data_telofs_mdt_at,
{"Telegram Type", "siii.mdt.svch.data.telassign.mdt_at",
FT_UINT16, BASE_DEC, VALS(siii_svch_data_mdt_at_text), 0x0800,
NULL, HFILL }
},
{ &hf_siii_svch_data_telofs_offset,
{"Telegram Offset", "siii.mdt.svch.data.telassign.offset",
FT_UINT16, BASE_DEC, NULL, 0x07FF,
NULL, HFILL }
},
{ &hf_siii_svch_data_proccmd_proccmdexec,
{"Procedure Command Execution", "siii.mdt.svch.data.proccmd.interrupt",
FT_UINT16, BASE_DEC, VALS(siii_svch_data_proccmd_proccmdexec_text), 0x0002,
NULL, HFILL }
},
{ &hf_siii_svch_data_proccmd_proccmd,
{"Procedure Command", "siii.mdt.svch.data.proccmd.set",
FT_UINT16, BASE_DEC, VALS(siii_svch_data_proccmd_proccmd_text), 0x0001,
NULL, HFILL }
}
};
/* Setup protocol subtree array */
static gint *ett[] = {
&ett_siii_mdt_svcctrl,
&ett_siii_mdt_svcinfo,
&ett_siii_at_svcstat,
&ett_siii_at_svcinfo,
&ett_siii_mdt_svch_data_error_info,
&ett_siii_mdt_svch_data
};
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_siii, hf_siii_header, array_length(hf_siii_header));
proto_register_subtree_array(ett, array_length(ett));
}

View File

@ -0,0 +1,34 @@
#include "winver.h"
VS_VERSION_INFO VERSIONINFO
FILEVERSION @RC_MODULE_VERSION@
PRODUCTVERSION @RC_VERSION@
FILEFLAGSMASK 0x0L
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0
#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