├── doc
├── LIESMICH.build_on_linux.txt
└── test-traces
│ ├── S7-1200-Uploading-OB1-TIAV12.pcap
│ ├── S7-1511-opc-request-all-types.pcap
│ ├── S7-1511-opc-request-all-types.xml
│ ├── S7-1511_db2_var1_HMI.pcap
│ ├── S7-1511_db3_var1_HMI.pcap
│ ├── S7-1511_db6w0_HMI.pcap
│ ├── V13_1200_TP1200sim_MW100_Int_SPS_5s_MW102_Int_SPS_10s_MW102_ab_1000_Timer_sync.pcapng
│ ├── V13_1200_TP1200sim_MW100_Int_SPS_5s_MW102_Int_SPS_10s_MW102_ab_1000_Timer_sync_FehlerbeiMW100.pcapng
│ └── s7-1200-hmi.pcap
└── src
├── Custom.m4
├── Custom.make
├── Custom.nmake
├── s7comm
├── AUTHORS
├── CMakeLists.txt
├── COPYING
├── ChangeLog
├── Makefile.am
├── Makefile.common
├── Makefile.nmake
├── moduleinfo.h
├── moduleinfo.nmake
├── packet-s7comm.c
├── packet-s7comm.h
├── packet-s7comm_szl_ids.c
├── packet-s7comm_szl_ids.h
└── plugin.rc.in
└── s7comm_plus
├── AUTHORS
├── CMakeLists.txt
├── COPYING
├── ChangeLog
├── Makefile.am
├── Makefile.common
├── Makefile.nmake
├── moduleinfo.h
├── moduleinfo.nmake
├── packet-s7comm_plus.c
├── packet-s7comm_plus.h
└── plugin.rc.in
/doc/LIESMICH.build_on_linux.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moki-ics/s7commwireshark/073cbc71a6c8da990bbbd14a8d61cde859cc8207/doc/LIESMICH.build_on_linux.txt
--------------------------------------------------------------------------------
/doc/test-traces/S7-1200-Uploading-OB1-TIAV12.pcap:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moki-ics/s7commwireshark/073cbc71a6c8da990bbbd14a8d61cde859cc8207/doc/test-traces/S7-1200-Uploading-OB1-TIAV12.pcap
--------------------------------------------------------------------------------
/doc/test-traces/S7-1511-opc-request-all-types.pcap:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moki-ics/s7commwireshark/073cbc71a6c8da990bbbd14a8d61cde859cc8207/doc/test-traces/S7-1511-opc-request-all-types.pcap
--------------------------------------------------------------------------------
/doc/test-traces/S7-1511-opc-request-all-types.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
--------------------------------------------------------------------------------
/doc/test-traces/S7-1511_db2_var1_HMI.pcap:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moki-ics/s7commwireshark/073cbc71a6c8da990bbbd14a8d61cde859cc8207/doc/test-traces/S7-1511_db2_var1_HMI.pcap
--------------------------------------------------------------------------------
/doc/test-traces/S7-1511_db3_var1_HMI.pcap:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moki-ics/s7commwireshark/073cbc71a6c8da990bbbd14a8d61cde859cc8207/doc/test-traces/S7-1511_db3_var1_HMI.pcap
--------------------------------------------------------------------------------
/doc/test-traces/S7-1511_db6w0_HMI.pcap:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moki-ics/s7commwireshark/073cbc71a6c8da990bbbd14a8d61cde859cc8207/doc/test-traces/S7-1511_db6w0_HMI.pcap
--------------------------------------------------------------------------------
/doc/test-traces/V13_1200_TP1200sim_MW100_Int_SPS_5s_MW102_Int_SPS_10s_MW102_ab_1000_Timer_sync.pcapng:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moki-ics/s7commwireshark/073cbc71a6c8da990bbbd14a8d61cde859cc8207/doc/test-traces/V13_1200_TP1200sim_MW100_Int_SPS_5s_MW102_Int_SPS_10s_MW102_ab_1000_Timer_sync.pcapng
--------------------------------------------------------------------------------
/doc/test-traces/V13_1200_TP1200sim_MW100_Int_SPS_5s_MW102_Int_SPS_10s_MW102_ab_1000_Timer_sync_FehlerbeiMW100.pcapng:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moki-ics/s7commwireshark/073cbc71a6c8da990bbbd14a8d61cde859cc8207/doc/test-traces/V13_1200_TP1200sim_MW100_Int_SPS_5s_MW102_Int_SPS_10s_MW102_ab_1000_Timer_sync_FehlerbeiMW100.pcapng
--------------------------------------------------------------------------------
/doc/test-traces/s7-1200-hmi.pcap:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moki-ics/s7commwireshark/073cbc71a6c8da990bbbd14a8d61cde859cc8207/doc/test-traces/s7-1200-hmi.pcap
--------------------------------------------------------------------------------
/src/Custom.m4:
--------------------------------------------------------------------------------
1 | #
2 | # /* $Id$ */
3 | #
4 |
5 | m4_define([_CUSTOM_AC_OUTPUT_], [plugins/s7comm/Makefile] [plugins/s7comm_plus/Makefile])
6 |
--------------------------------------------------------------------------------
/src/Custom.make:
--------------------------------------------------------------------------------
1 | #
2 | # /* $Id$ */
3 | #
4 |
5 | _CUSTOM_SUBDIRS_ = \
6 | s7comm \
7 | s7comm_plus
8 |
9 | _CUSTOM_EXTRA_DIST_ = \
10 | Custom.m4 \
11 | Custom.make
12 |
13 | _CUSTOM_plugin_ldadd_ = \
14 | -dlopen plugins/s7comm/s7comm.la \
15 | -dlopen plugins/s7comm_plus/s7comm_plus.la
16 |
--------------------------------------------------------------------------------
/src/Custom.nmake:
--------------------------------------------------------------------------------
1 | #
2 | # /* $Id$ */
3 | #
4 |
5 | include ..\config.nmake
6 |
7 | all: s7comm s7comm_plus
8 |
9 | s7comm::
10 | cd s7comm
11 | $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
12 | cd ..
13 |
14 | s7comm_plus::
15 | cd s7comm_plus
16 | $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
17 | cd ..
18 |
19 | clean:
20 | cd s7comm
21 | $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
22 | cd ..
23 | cd s7comm_plus
24 | $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
25 | cd ..
26 |
27 | distclean: clean
28 | cd s7comm
29 | $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
30 | cd ..
31 | cd s7comm_plus
32 | $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
33 | cd ..
34 |
35 | maintainer-clean: distclean
36 | cd s7comm
37 | $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
38 | cd ..
39 | cd s7comm_plus
40 | $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
41 | cd ..
42 |
43 | install-plugins:
44 | !IFDEF ENABLE_LIBWIRESHARK
45 | xcopy s7comm\*.dll ..\$(INSTALL_DIR)\plugins\$(VERSION) /d
46 | xcopy s7comm_plus\*.dll ..\$(INSTALL_DIR)\plugins\$(VERSION) /d
47 | !ENDIF
48 |
--------------------------------------------------------------------------------
/src/s7comm/AUTHORS:
--------------------------------------------------------------------------------
1 | Author :
2 | Thomas Wiens
3 |
--------------------------------------------------------------------------------
/src/s7comm/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # CMakeLists.txt
2 | #
3 | # $Id: CMakeLists.txt 43536 2012-06-28 22:56:06Z darkjames $
4 | #
5 | # Wireshark - Network traffic analyzer
6 | # By Gerald Combs
7 | # Copyright 1998 Gerald Combs
8 | #
9 | # This program is free software; you can redistribute it and/or
10 | # modify it under the terms of the GNU General Public License
11 | # as published by the Free Software Foundation; either version 2
12 | # of the License, or (at your option) any later version.
13 | #
14 | # This program is distributed in the hope that it will be useful,
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | # GNU General Public License for more details.
18 | #
19 | # You should have received a copy of the GNU General Public License
20 | # along with this program; if not, write to the Free Software
21 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 | #
23 |
24 | set(DISSECTOR_SRC
25 | packet-s7comm.c
26 | )
27 |
28 | set(PLUGIN_FILES
29 | plugin.c
30 | ${DISSECTOR_SRC}
31 | )
32 |
33 | set(CLEAN_FILES
34 | ${PLUGIN_FILES}
35 | )
36 |
37 | if (WERROR)
38 | set_source_files_properties(
39 | ${CLEAN_FILES}
40 | PROPERTIES
41 | COMPILE_FLAGS -Werror
42 | )
43 | endif()
44 |
45 | include_directories(${CMAKE_CURRENT_SOURCE_DIR})
46 |
47 | register_dissector_files(plugin.c
48 | plugin
49 | ${DISSECTOR_SRC}
50 | )
51 |
52 | add_library(s7comm ${LINK_MODE_MODULE}
53 | ${PLUGIN_FILES}
54 | )
55 | set_target_properties(s7comm PROPERTIES PREFIX "")
56 | set_target_properties(s7comm PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
57 |
58 | target_link_libraries(s7comm epan)
59 |
60 | install(TARGETS s7comm
61 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} NAMELINK_SKIP
62 | RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION}
63 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION}
64 | )
65 |
66 |
--------------------------------------------------------------------------------
/src/s7comm/COPYING:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 2, June 1991
3 |
4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | Preamble
10 |
11 | The licenses for most software are designed to take away your
12 | freedom to share and change it. By contrast, the GNU General Public
13 | License is intended to guarantee your freedom to share and change free
14 | software--to make sure the software is free for all its users. This
15 | General Public License applies to most of the Free Software
16 | Foundation's software and to any other program whose authors commit to
17 | using it. (Some other Free Software Foundation software is covered by
18 | the GNU Library General Public License instead.) You can apply it to
19 | your programs, too.
20 |
21 | When we speak of free software, we are referring to freedom, not
22 | price. Our General Public Licenses are designed to make sure that you
23 | have the freedom to distribute copies of free software (and charge for
24 | this service if you wish), that you receive source code or can get it
25 | if you want it, that you can change the software or use pieces of it
26 | in new free programs; and that you know you can do these things.
27 |
28 | To protect your rights, we need to make restrictions that forbid
29 | anyone to deny you these rights or to ask you to surrender the rights.
30 | These restrictions translate to certain responsibilities for you if you
31 | distribute copies of the software, or if you modify it.
32 |
33 | For example, if you distribute copies of such a program, whether
34 | gratis or for a fee, you must give the recipients all the rights that
35 | you have. You must make sure that they, too, receive or can get the
36 | source code. And you must show them these terms so they know their
37 | rights.
38 |
39 | We protect your rights with two steps: (1) copyright the software, and
40 | (2) offer you this license which gives you legal permission to copy,
41 | distribute and/or modify the software.
42 |
43 | Also, for each author's protection and ours, we want to make certain
44 | that everyone understands that there is no warranty for this free
45 | software. If the software is modified by someone else and passed on, we
46 | want its recipients to know that what they have is not the original, so
47 | that any problems introduced by others will not reflect on the original
48 | authors' reputations.
49 |
50 | Finally, any free program is threatened constantly by software
51 | patents. We wish to avoid the danger that redistributors of a free
52 | program will individually obtain patent licenses, in effect making the
53 | program proprietary. To prevent this, we have made it clear that any
54 | patent must be licensed for everyone's free use or not licensed at all.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | GNU GENERAL PUBLIC LICENSE
60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61 |
62 | 0. This License applies to any program or other work which contains
63 | a notice placed by the copyright holder saying it may be distributed
64 | under the terms of this General Public License. The "Program", below,
65 | refers to any such program or work, and a "work based on the Program"
66 | means either the Program or any derivative work under copyright law:
67 | that is to say, a work containing the Program or a portion of it,
68 | either verbatim or with modifications and/or translated into another
69 | language. (Hereinafter, translation is included without limitation in
70 | the term "modification".) Each licensee is addressed as "you".
71 |
72 | Activities other than copying, distribution and modification are not
73 | covered by this License; they are outside its scope. The act of
74 | running the Program is not restricted, and the output from the Program
75 | is covered only if its contents constitute a work based on the
76 | Program (independent of having been made by running the Program).
77 | Whether that is true depends on what the Program does.
78 |
79 | 1. You may copy and distribute verbatim copies of the Program's
80 | source code as you receive it, in any medium, provided that you
81 | conspicuously and appropriately publish on each copy an appropriate
82 | copyright notice and disclaimer of warranty; keep intact all the
83 | notices that refer to this License and to the absence of any warranty;
84 | and give any other recipients of the Program a copy of this License
85 | along with the Program.
86 |
87 | You may charge a fee for the physical act of transferring a copy, and
88 | you may at your option offer warranty protection in exchange for a fee.
89 |
90 | 2. You may modify your copy or copies of the Program or any portion
91 | of it, thus forming a work based on the Program, and copy and
92 | distribute such modifications or work under the terms of Section 1
93 | above, provided that you also meet all of these conditions:
94 |
95 | a) You must cause the modified files to carry prominent notices
96 | stating that you changed the files and the date of any change.
97 |
98 | b) You must cause any work that you distribute or publish, that in
99 | whole or in part contains or is derived from the Program or any
100 | part thereof, to be licensed as a whole at no charge to all third
101 | parties under the terms of this License.
102 |
103 | c) If the modified program normally reads commands interactively
104 | when run, you must cause it, when started running for such
105 | interactive use in the most ordinary way, to print or display an
106 | announcement including an appropriate copyright notice and a
107 | notice that there is no warranty (or else, saying that you provide
108 | a warranty) and that users may redistribute the program under
109 | these conditions, and telling the user how to view a copy of this
110 | License. (Exception: if the Program itself is interactive but
111 | does not normally print such an announcement, your work based on
112 | the Program is not required to print an announcement.)
113 |
114 | These requirements apply to the modified work as a whole. If
115 | identifiable sections of that work are not derived from the Program,
116 | and can be reasonably considered independent and separate works in
117 | themselves, then this License, and its terms, do not apply to those
118 | sections when you distribute them as separate works. But when you
119 | distribute the same sections as part of a whole which is a work based
120 | on the Program, the distribution of the whole must be on the terms of
121 | this License, whose permissions for other licensees extend to the
122 | entire whole, and thus to each and every part regardless of who wrote it.
123 |
124 | Thus, it is not the intent of this section to claim rights or contest
125 | your rights to work written entirely by you; rather, the intent is to
126 | exercise the right to control the distribution of derivative or
127 | collective works based on the Program.
128 |
129 | In addition, mere aggregation of another work not based on the Program
130 | with the Program (or with a work based on the Program) on a volume of
131 | a storage or distribution medium does not bring the other work under
132 | the scope of this License.
133 |
134 | 3. You may copy and distribute the Program (or a work based on it,
135 | under Section 2) in object code or executable form under the terms of
136 | Sections 1 and 2 above provided that you also do one of the following:
137 |
138 | a) Accompany it with the complete corresponding machine-readable
139 | source code, which must be distributed under the terms of Sections
140 | 1 and 2 above on a medium customarily used for software interchange; or,
141 |
142 | b) Accompany it with a written offer, valid for at least three
143 | years, to give any third party, for a charge no more than your
144 | cost of physically performing source distribution, a complete
145 | machine-readable copy of the corresponding source code, to be
146 | distributed under the terms of Sections 1 and 2 above on a medium
147 | customarily used for software interchange; or,
148 |
149 | c) Accompany it with the information you received as to the offer
150 | to distribute corresponding source code. (This alternative is
151 | allowed only for noncommercial distribution and only if you
152 | received the program in object code or executable form with such
153 | an offer, in accord with Subsection b above.)
154 |
155 | The source code for a work means the preferred form of the work for
156 | making modifications to it. For an executable work, complete source
157 | code means all the source code for all modules it contains, plus any
158 | associated interface definition files, plus the scripts used to
159 | control compilation and installation of the executable. However, as a
160 | special exception, the source code distributed need not include
161 | anything that is normally distributed (in either source or binary
162 | form) with the major components (compiler, kernel, and so on) of the
163 | operating system on which the executable runs, unless that component
164 | itself accompanies the executable.
165 |
166 | If distribution of executable or object code is made by offering
167 | access to copy from a designated place, then offering equivalent
168 | access to copy the source code from the same place counts as
169 | distribution of the source code, even though third parties are not
170 | compelled to copy the source along with the object code.
171 |
172 | 4. You may not copy, modify, sublicense, or distribute the Program
173 | except as expressly provided under this License. Any attempt
174 | otherwise to copy, modify, sublicense or distribute the Program is
175 | void, and will automatically terminate your rights under this License.
176 | However, parties who have received copies, or rights, from you under
177 | this License will not have their licenses terminated so long as such
178 | parties remain in full compliance.
179 |
180 | 5. You are not required to accept this License, since you have not
181 | signed it. However, nothing else grants you permission to modify or
182 | distribute the Program or its derivative works. These actions are
183 | prohibited by law if you do not accept this License. Therefore, by
184 | modifying or distributing the Program (or any work based on the
185 | Program), you indicate your acceptance of this License to do so, and
186 | all its terms and conditions for copying, distributing or modifying
187 | the Program or works based on it.
188 |
189 | 6. Each time you redistribute the Program (or any work based on the
190 | Program), the recipient automatically receives a license from the
191 | original licensor to copy, distribute or modify the Program subject to
192 | these terms and conditions. You may not impose any further
193 | restrictions on the recipients' exercise of the rights granted herein.
194 | You are not responsible for enforcing compliance by third parties to
195 | this License.
196 |
197 | 7. If, as a consequence of a court judgment or allegation of patent
198 | infringement or for any other reason (not limited to patent issues),
199 | conditions are imposed on you (whether by court order, agreement or
200 | otherwise) that contradict the conditions of this License, they do not
201 | excuse you from the conditions of this License. If you cannot
202 | distribute so as to satisfy simultaneously your obligations under this
203 | License and any other pertinent obligations, then as a consequence you
204 | may not distribute the Program at all. For example, if a patent
205 | license would not permit royalty-free redistribution of the Program by
206 | all those who receive copies directly or indirectly through you, then
207 | the only way you could satisfy both it and this License would be to
208 | refrain entirely from distribution of the Program.
209 |
210 | If any portion of this section is held invalid or unenforceable under
211 | any particular circumstance, the balance of the section is intended to
212 | apply and the section as a whole is intended to apply in other
213 | circumstances.
214 |
215 | It is not the purpose of this section to induce you to infringe any
216 | patents or other property right claims or to contest validity of any
217 | such claims; this section has the sole purpose of protecting the
218 | integrity of the free software distribution system, which is
219 | implemented by public license practices. Many people have made
220 | generous contributions to the wide range of software distributed
221 | through that system in reliance on consistent application of that
222 | system; it is up to the author/donor to decide if he or she is willing
223 | to distribute software through any other system and a licensee cannot
224 | impose that choice.
225 |
226 | This section is intended to make thoroughly clear what is believed to
227 | be a consequence of the rest of this License.
228 |
229 | 8. If the distribution and/or use of the Program is restricted in
230 | certain countries either by patents or by copyrighted interfaces, the
231 | original copyright holder who places the Program under this License
232 | may add an explicit geographical distribution limitation excluding
233 | those countries, so that distribution is permitted only in or among
234 | countries not thus excluded. In such case, this License incorporates
235 | the limitation as if written in the body of this License.
236 |
237 | 9. The Free Software Foundation may publish revised and/or new versions
238 | of the General Public License from time to time. Such new versions will
239 | be similar in spirit to the present version, but may differ in detail to
240 | address new problems or concerns.
241 |
242 | Each version is given a distinguishing version number. If the Program
243 | specifies a version number of this License which applies to it and "any
244 | later version", you have the option of following the terms and conditions
245 | either of that version or of any later version published by the Free
246 | Software Foundation. If the Program does not specify a version number of
247 | this License, you may choose any version ever published by the Free Software
248 | Foundation.
249 |
250 | 10. If you wish to incorporate parts of the Program into other free
251 | programs whose distribution conditions are different, write to the author
252 | to ask for permission. For software which is copyrighted by the Free
253 | Software Foundation, write to the Free Software Foundation; we sometimes
254 | make exceptions for this. Our decision will be guided by the two goals
255 | of preserving the free status of all derivatives of our free software and
256 | of promoting the sharing and reuse of software generally.
257 |
258 | NO WARRANTY
259 |
260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268 | REPAIR OR CORRECTION.
269 |
270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278 | POSSIBILITY OF SUCH DAMAGES.
279 |
280 | END OF TERMS AND CONDITIONS
281 |
282 | How to Apply These Terms to Your New Programs
283 |
284 | If you develop a new program, and you want it to be of the greatest
285 | possible use to the public, the best way to achieve this is to make it
286 | free software which everyone can redistribute and change under these terms.
287 |
288 | To do so, attach the following notices to the program. It is safest
289 | to attach them to the start of each source file to most effectively
290 | convey the exclusion of warranty; and each file should have at least
291 | the "copyright" line and a pointer to where the full notice is found.
292 |
293 |
294 | Copyright (C)
295 |
296 | This program is free software; you can redistribute it and/or modify
297 | it under the terms of the GNU General Public License as published by
298 | the Free Software Foundation; either version 2 of the License, or
299 | (at your option) any later version.
300 |
301 | This program is distributed in the hope that it will be useful,
302 | but WITHOUT ANY WARRANTY; without even the implied warranty of
303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 | GNU General Public License for more details.
305 |
306 | You should have received a copy of the GNU General Public License
307 | along with this program; if not, write to the Free Software
308 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
309 |
310 |
311 | Also add information on how to contact you by electronic and paper mail.
312 |
313 | If the program is interactive, make it output a short notice like this
314 | when it starts in an interactive mode:
315 |
316 | Gnomovision version 69, Copyright (C) year name of author
317 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
318 | This is free software, and you are welcome to redistribute it
319 | under certain conditions; type `show c' for details.
320 |
321 | The hypothetical commands `show w' and `show c' should show the appropriate
322 | parts of the General Public License. Of course, the commands you use may
323 | be called something other than `show w' and `show c'; they could even be
324 | mouse-clicks or menu items--whatever suits your program.
325 |
326 | You should also get your employer (if you work as a programmer) or your
327 | school, if any, to sign a "copyright disclaimer" for the program, if
328 | necessary. Here is a sample; alter the names:
329 |
330 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program
331 | `Gnomovision' (which makes passes at compilers) written by James Hacker.
332 |
333 | , 1 April 1989
334 | Ty Coon, President of Vice
335 |
336 | This General Public License does not permit incorporating your program into
337 | proprietary programs. If your program is a subroutine library, you may
338 | consider it more useful to permit linking proprietary applications with the
339 | library. If this is what you want to do, use the GNU Library General
340 | Public License instead of this License.
341 |
--------------------------------------------------------------------------------
/src/s7comm/ChangeLog:
--------------------------------------------------------------------------------
1 | Overview of changes in Wireshark s7comm Plugin 0.0.3
2 | * changed labels/descriptions in header part
3 | * changed labels/descriptions of block-services
4 | * added diagnostic telegrams (type 1) on online block view
5 | * added basic support for 1200 symbolic variable access
6 | * added several SZL IDs
7 |
8 | Overview of changes in Wireshark s7comm Plugin 0.0.4
9 | * extended 1200 symbolic variable access
10 | * added SZL ID 0x0131 index 0x0010
11 | * added SZL partial list extract desciption
12 | * optimized display of fragmented SZL data when divided into several PDUs
13 | * show SZL ID 0x0111 in the same way as ID 0x0011
14 | * extended filter of variable services
15 | * added SZL ID 0xxy74
16 |
17 | Overview of changes in Wireshark s7comm Plugin 0.0.5
18 | * compatibility with Wireshark 1.12
19 | Since they changed the wireshark-api, this plugin
20 | won't work with older versions of Wireshark.
--------------------------------------------------------------------------------
/src/s7comm/Makefile.am:
--------------------------------------------------------------------------------
1 | # Makefile.am
2 | # Automake file for s7comm plugin
3 | #
4 | # $Id$
5 | #
6 | # Wireshark - Network traffic analyzer
7 | # By Gerald Combs
8 | # Copyright 1998 Gerald Combs
9 | #
10 | # This program is free software; you can redistribute it and/or
11 | # modify it under the terms of the GNU General Public License
12 | # as published by the Free Software Foundation; either version 2
13 | # of the License, or (at your option) any later version.
14 | #
15 | # This program is distributed in the hope that it will be useful,
16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | # GNU General Public License for more details.
19 | #
20 | # You should have received a copy of the GNU General Public License
21 | # along with this program; if not, write to the Free Software
22 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 | #
24 |
25 | INCLUDES = -I$(top_srcdir) -I$(includedir)
26 |
27 | include Makefile.common
28 |
29 | if HAVE_WARNINGS_AS_ERRORS
30 | AM_CFLAGS = -Werror
31 | endif
32 |
33 | plugindir = @plugindir@
34 |
35 | plugin_LTLIBRARIES = s7comm.la
36 | s7comm_la_SOURCES = \
37 | plugin.c \
38 | moduleinfo.h \
39 | $(DISSECTOR_SRC) \
40 | $(DISSECTOR_SUPPORT_SRC) \
41 | $(DISSECTOR_INCLUDES)
42 | s7comm_la_LDFLAGS = -module -avoid-version
43 | s7comm_la_LIBADD = @PLUGIN_LIBS@
44 |
45 | # Libs must be cleared, or else libtool won't create a shared module.
46 | # If your module needs to be linked against any particular libraries,
47 | # add them here.
48 | LIBS =
49 |
50 | #
51 | # Build plugin.c, which contains the plugin version[] string, a
52 | # function plugin_register() that calls the register routines for all
53 | # protocols, and a function plugin_reg_handoff() that calls the handoff
54 | # registration routines for all protocols.
55 | #
56 | # We do this by scanning sources. If that turns out to be too slow,
57 | # maybe we could just require every .o file to have an register routine
58 | # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
59 | #
60 | # Formatting conventions: The name of the proto_register_* routines an
61 | # proto_reg_handoff_* routines must start in column zero, or must be
62 | # preceded only by "void " starting in column zero, and must not be
63 | # inside #if.
64 | #
65 | # DISSECTOR_SRC is assumed to have all the files that need to be scanned.
66 | #
67 | # For some unknown reason, having a big "for" loop in the Makefile
68 | # to scan all the files doesn't work with some "make"s; they seem to
69 | # pass only the first few names in the list to the shell, for some
70 | # reason.
71 | #
72 | # Therefore, we have a script to generate the plugin.c file.
73 | # The shell script runs slowly, as multiple greps and seds are run
74 | # for each input file; this is especially slow on Windows. Therefore,
75 | # if Python is present (as indicated by PYTHON being defined), we run
76 | # a faster Python script to do that work instead.
77 | #
78 | # The first argument is the directory in which the source files live.
79 | # The second argument is "plugin", to indicate that we should build
80 | # a plugin.c file for a plugin.
81 | # All subsequent arguments are the files to scan.
82 | #
83 | plugin.c: $(DISSECTOR_SRC) Makefile.common $(top_srcdir)/tools/make-dissector-reg \
84 | $(top_srcdir)/tools/make-dissector-reg.py
85 | @if test -n "$(PYTHON)"; then \
86 | echo Making plugin.c with python ; \
87 | $(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
88 | plugin $(DISSECTOR_SRC) ; \
89 | else \
90 | echo Making plugin.c with shell script ; \
91 | $(top_srcdir)/tools/make-dissector-reg $(srcdir) \
92 | $(plugin_src) plugin $(DISSECTOR_SRC) ; \
93 | fi
94 |
95 | #
96 | # Currently plugin.c can be included in the distribution because
97 | # we always build all protocol dissectors. We used to have to check
98 | # whether or not to build the snmp dissector. If we again need to
99 | # variably build something, making plugin.c non-portable, uncomment
100 | # the dist-hook line below.
101 | #
102 | # Oh, yuk. We don't want to include "plugin.c" in the distribution, as
103 | # its contents depend on the configuration, and therefore we want it
104 | # to be built when the first "make" is done; however, Automake insists
105 | # on putting *all* source into the distribution.
106 | #
107 | # We work around this by having a "dist-hook" rule that deletes
108 | # "plugin.c", so that "dist" won't pick it up.
109 | #
110 | #dist-hook:
111 | # @rm -f $(distdir)/plugin.c
112 |
113 | CLEANFILES = \
114 | s7comm \
115 | *~
116 |
117 | MAINTAINERCLEANFILES = \
118 | Makefile.in \
119 | plugin.c
120 |
121 | EXTRA_DIST = \
122 | Makefile.common \
123 | Makefile.nmake \
124 | moduleinfo.nmake \
125 | plugin.rc.in \
126 | CMakeLists.txt
127 |
128 | checkapi:
129 | $(PERL) $(top_srcdir)/tools/checkAPIs.pl -g abort -g termoutput -build $(DISSECTOR_SRC) $(DISSECTOR_INCLUDES)
130 |
--------------------------------------------------------------------------------
/src/s7comm/Makefile.common:
--------------------------------------------------------------------------------
1 | # Makefile.common for s7comm plugin
2 | # Contains the stuff from Makefile.am and Makefile.nmake that is
3 | # a) common to both files and
4 | # b) portable between both files
5 | #
6 | # $Id$
7 | #
8 | # Wireshark - Network traffic analyzer
9 | # By Gerald Combs
10 | # Copyright 1998 Gerald Combs
11 | #
12 | # This program is free software; you can redistribute it and/or
13 | # modify it under the terms of the GNU General Public License
14 | # as published by the Free Software Foundation; either version 2
15 | # of the License, or (at your option) any later version.
16 | #
17 | # This program is distributed in the hope that it will be useful,
18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 | # GNU General Public License for more details.
21 | #
22 | # You should have received a copy of the GNU General Public License
23 | # along with this program; if not, write to the Free Software
24 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 |
26 | # the name of the plugin
27 | PLUGIN_NAME = s7comm
28 |
29 | # the dissector sources (without any helpers)
30 | DISSECTOR_SRC = \
31 | packet-s7comm.c
32 |
33 |
34 | # corresponding headers
35 | DISSECTOR_INCLUDES = \
36 | packet-s7comm_szl_ids.h
37 |
38 |
39 | # Dissector helpers. They're included in the source files in this
40 | # directory, but they're not dissectors themselves, i.e. they're not
41 | # used to generate "register.c").
42 | DISSECTOR_SUPPORT_SRC = \
43 | packet-s7comm_szl_ids.c
44 |
--------------------------------------------------------------------------------
/src/s7comm/Makefile.nmake:
--------------------------------------------------------------------------------
1 | # Makefile.nmake
2 | # nmake file for Wireshark plugin
3 | #
4 | # $Id$
5 | #
6 |
7 | include ..\..\config.nmake
8 | include moduleinfo.nmake
9 |
10 | include Makefile.common
11 |
12 | CFLAGS=/WX /DHAVE_CONFIG_H /I../.. /I../../wiretap $(GLIB_CFLAGS) \
13 | /I$(PCAP_DIR)\include -D_U_="" $(LOCAL_CFLAGS)
14 |
15 | LDFLAGS = $(PLUGIN_LDFLAGS)
16 |
17 | !IFDEF ENABLE_LIBWIRESHARK
18 | LINK_PLUGIN_WITH=..\..\epan\libwireshark.lib
19 | CFLAGS=/DHAVE_WIN32_LIBWIRESHARK_LIB /D_NEED_VAR_IMPORT_ $(CFLAGS)
20 |
21 | DISSECTOR_OBJECTS = $(DISSECTOR_SRC:.c=.obj)
22 |
23 | DISSECTOR_SUPPORT_OBJECTS = $(DISSECTOR_SUPPORT_SRC:.c=.obj)
24 |
25 | OBJECTS = $(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS) plugin.obj
26 |
27 | RESOURCE=$(PLUGIN_NAME).res
28 |
29 | all: $(PLUGIN_NAME).dll
30 |
31 | $(PLUGIN_NAME).rc : moduleinfo.nmake
32 | sed -e s/@PLUGIN_NAME@/$(PLUGIN_NAME)/ \
33 | -e s/@RC_MODULE_VERSION@/$(RC_MODULE_VERSION)/ \
34 | -e s/@RC_VERSION@/$(RC_VERSION)/ \
35 | -e s/@MODULE_VERSION@/$(MODULE_VERSION)/ \
36 | -e s/@PACKAGE@/$(PACKAGE)/ \
37 | -e s/@VERSION@/$(VERSION)/ \
38 | -e s/@MSVC_VARIANT@/$(MSVC_VARIANT)/ \
39 | < plugin.rc.in > $@
40 |
41 | $(PLUGIN_NAME).dll $(PLUGIN_NAME).exp $(PLUGIN_NAME).lib : $(OBJECTS) $(LINK_PLUGIN_WITH) $(RESOURCE)
42 | link -dll /out:$(PLUGIN_NAME).dll $(LDFLAGS) $(OBJECTS) $(LINK_PLUGIN_WITH) \
43 | $(GLIB_LIBS) $(RESOURCE)
44 |
45 |
46 |
47 | #
48 | # Build plugin.c, which contains the plugin version[] string, a
49 | # function plugin_register() that calls the register routines for all
50 | # protocols, and a function plugin_reg_handoff() that calls the handoff
51 | # registration routines for all protocols.
52 | #
53 | # We do this by scanning sources. If that turns out to be too slow,
54 | # maybe we could just require every .o file to have an register routine
55 | # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
56 | #
57 | # Formatting conventions: The name of the proto_register_* routines an
58 | # proto_reg_handoff_* routines must start in column zero, or must be
59 | # preceded only by "void " starting in column zero, and must not be
60 | # inside #if.
61 | #
62 | # DISSECTOR_SRC is assumed to have all the files that need to be scanned.
63 | #
64 | # For some unknown reason, having a big "for" loop in the Makefile
65 | # to scan all the files doesn't work with some "make"s; they seem to
66 | # pass only the first few names in the list to the shell, for some
67 | # reason.
68 | #
69 | # Therefore, we have a script to generate the plugin.c file.
70 | # The shell script runs slowly, as multiple greps and seds are run
71 | # for each input file; this is especially slow on Windows. Therefore,
72 | # if Python is present (as indicated by PYTHON being defined), we run
73 | # a faster Python script to do that work instead.
74 | #
75 | # The first argument is the directory in which the source files live.
76 | # The second argument is "plugin", to indicate that we should build
77 | # a plugin.c file for a plugin.
78 | # All subsequent arguments are the files to scan.
79 | #
80 | plugin.c: $(DISSECTOR_SRC) ../../tools/make-dissector-reg.py ../../tools/make-dissector-reg
81 | !IFDEF PYTHON
82 | @echo Making plugin.c (using python)
83 | @$(PYTHON) "../../tools/make-dissector-reg.py" . plugin $(DISSECTOR_SRC)
84 | !ELSE
85 | @echo Making plugin.c (using sh)
86 | @$(SH) ../../tools/make-dissector-reg . plugin $(DISSECTOR_SRC)
87 | !ENDIF
88 |
89 | !ENDIF
90 |
91 | clean:
92 | rm -f $(OBJECTS) $(RESOURCE) plugin.c *.pdb \
93 | $(PLUGIN_NAME).dll $(PLUGIN_NAME).dll.manifest $(PLUGIN_NAME).lib \
94 | $(PLUGIN_NAME).exp $(PLUGIN_NAME).rc
95 |
96 | distclean: clean
97 |
98 | maintainer-clean: distclean
99 |
--------------------------------------------------------------------------------
/src/s7comm/moduleinfo.h:
--------------------------------------------------------------------------------
1 | /* Included *after* config.h, in order to re-define these macros */
2 |
3 | #ifdef PACKAGE
4 | #undef PACKAGE
5 | #endif
6 |
7 | /* Name of package */
8 | #define PACKAGE "s7comm"
9 |
10 |
11 | #ifdef VERSION
12 | #undef VERSION
13 | #endif
14 |
15 | /* Version number of package */
16 | #define VERSION "0.0.4"
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/s7comm/moduleinfo.nmake:
--------------------------------------------------------------------------------
1 | #
2 | # $Id$
3 | #
4 |
5 | # The name
6 | PACKAGE=s7comm
7 |
8 | # The version
9 | MODULE_VERSION_MAJOR=0
10 | MODULE_VERSION_MINOR=0
11 | MODULE_VERSION_MICRO=6
12 | MODULE_VERSION_EXTRA=0
13 |
14 | #
15 | # The RC_VERSION should be comma-separated, not dot-separated,
16 | # as per Graham Bloice's message in
17 | #
18 | # http://www.ethereal.com/lists/ethereal-dev/200303/msg00283.html
19 | #
20 | # "The RC_VERSION variable in config.nmake should be comma separated.
21 | # This allows the resources to be built correctly and the version
22 | # number to be correctly displayed in the explorer properties dialog
23 | # for the executables, and XP's tooltip, rather than 0.0.0.0."
24 | #
25 |
26 | MODULE_VERSION=$(MODULE_VERSION_MAJOR).$(MODULE_VERSION_MINOR).$(MODULE_VERSION_MICRO).$(MODULE_VERSION_EXTRA)
27 | RC_MODULE_VERSION=$(MODULE_VERSION_MAJOR),$(MODULE_VERSION_MINOR),$(MODULE_VERSION_MICRO),$(MODULE_VERSION_EXTRA)
28 |
29 |
--------------------------------------------------------------------------------
/src/s7comm/packet-s7comm.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moki-ics/s7commwireshark/073cbc71a6c8da990bbbd14a8d61cde859cc8207/src/s7comm/packet-s7comm.c
--------------------------------------------------------------------------------
/src/s7comm/packet-s7comm.h:
--------------------------------------------------------------------------------
1 | /* packet-s7comm.h
2 | *
3 | * Author: Thomas Wiens, 2014 (th.wiens@gmx.de)
4 | * Description: Wireshark dissector for S7-Communication
5 | *
6 | * Wireshark - Network traffic analyzer
7 | * By Gerald Combs
8 | * Copyright 1998 Gerald Combs
9 | *
10 | * This program is free software; you can redistribute it and/or
11 | * modify it under the terms of the GNU General Public License
12 | * as published by the Free Software Foundation; either version 2
13 | * of the License, or (at your option) any later version.
14 | *
15 | * This program is distributed in the hope that it will be useful,
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | * GNU General Public License for more details.
19 | *
20 | * You should have received a copy of the GNU General Public License
21 | * along with this program; if not, write to the Free Software
22 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 | */
24 | #ifndef __PACKET_S7COMM_H__
25 | #define __PACKET_S7COMM_H__
26 |
27 | /**************************************************************************
28 | * Returnvalues of an item response
29 | */
30 | #define S7COMM_ITEM_RETVAL_RESERVED 0x00
31 | #define S7COMM_ITEM_RETVAL_DATA_HW_FAULT 0x01
32 | #define S7COMM_ITEM_RETVAL_DATA_ACCESS_FAULT 0x03
33 | #define S7COMM_ITEM_RETVAL_DATA_OUTOFRANGE 0x05 /* the desired address is beyond limit for this PLC */
34 | #define S7COMM_ITEM_RETVAL_DATA_NOT_SUP 0x06 /* Type is not supported */
35 | #define S7COMM_ITEM_RETVAL_DATA_SIZEMISMATCH 0x07 /* Data type inconsistent */
36 | #define S7COMM_ITEM_RETVAL_DATA_ERR 0x0a /* the desired item is not available in the PLC, e.g. when trying to read a non existing DB*/
37 | #define S7COMM_ITEM_RETVAL_DATA_OK 0xff
38 |
39 | /**************************************************************************
40 | * Names of userdata subfunctions in group 4 (CPU functions)
41 | */
42 | #define S7COMM_UD_SUBF_CPU_READSZL 0x01
43 | #define S7COMM_UD_SUBF_CPU_MSGS 0x02
44 | #define S7COMM_UD_SUBF_CPU_TRANSSTOP 0x03
45 | #define S7COMM_UD_SUBF_CPU_ALARM8_IND 0x05
46 | #define S7COMM_UD_SUBF_CPU_NOTIFY_IND 0x06
47 | #define S7COMM_UD_SUBF_CPU_ALARMSQ_IND 0x11
48 | #define S7COMM_UD_SUBF_CPU_ALARMS_IND 0x12
49 | #define S7COMM_UD_SUBF_CPU_ALARMQUERY 0x13
50 | #define S7COMM_UD_SUBF_CPU_ALARMACK 0x0b
51 | #define S7COMM_UD_SUBF_CPU_ALARMACK_IND 0x0c
52 |
53 | /**************************************************************************
54 | * Names of types in userdata parameter part
55 | */
56 | #define S7COMM_UD_TYPE_PUSH 0x0
57 | #define S7COMM_UD_TYPE_REQ 0x4
58 | #define S7COMM_UD_TYPE_RES 0x8
59 |
60 | extern const value_string s7comm_item_return_valuenames[];
61 |
62 | #endif
63 |
64 | /*
65 | * Editor modelines - http://www.wireshark.org/tools/modelines.html
66 | *
67 | * Local variables:
68 | * c-basic-offset: 4
69 | * tab-width: 8
70 | * indent-tabs-mode: nil
71 | * End:
72 | *
73 | * vi: set shiftwidth=4 tabstop=8 expandtab:
74 | * :indentSize=4:tabSize=8:noTabs=true:
75 | */
76 |
--------------------------------------------------------------------------------
/src/s7comm/packet-s7comm_szl_ids.h:
--------------------------------------------------------------------------------
1 | /* packet-s7comm_szl_ids.h
2 | *
3 | * Author: Thomas Wiens, 2014 (th.wiens@gmx.de)
4 | * Description: Wireshark dissector for S7-Communication
5 | *
6 | * Wireshark - Network traffic analyzer
7 | * By Gerald Combs
8 | * Copyright 1998 Gerald Combs
9 | *
10 | * This program is free software; you can redistribute it and/or
11 | * modify it under the terms of the GNU General Public License
12 | * as published by the Free Software Foundation; either version 2
13 | * of the License, or (at your option) any later version.
14 | *
15 | * This program is distributed in the hope that it will be useful,
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | * GNU General Public License for more details.
19 | *
20 | * You should have received a copy of the GNU General Public License
21 | * along with this program; if not, write to the Free Software
22 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 | */
24 |
25 | #ifndef __PACKET_S7COMM_SZL_IDS_H__
26 | #define __PACKET_S7COMM_SZL_IDS_H__
27 |
28 | guint32 s7comm_decode_ud_cpu_szl_subfunc (tvbuff_t *tvb, packet_info *pinfo, proto_tree *data_tree, guint8 type, guint8 ret_val, guint16 len, guint16 dlength, guint8 data_unit_ref, guint8 last_data_unit, guint32 offset);
29 | void s7comm_register_szl_types(int proto);
30 |
31 | #endif
32 |
33 | /*
34 | * Editor modelines - http://www.wireshark.org/tools/modelines.html
35 | *
36 | * Local variables:
37 | * c-basic-offset: 4
38 | * tab-width: 8
39 | * indent-tabs-mode: nil
40 | * End:
41 | *
42 | * vi: set shiftwidth=4 tabstop=8 expandtab:
43 | * :indentSize=4:tabSize=8:noTabs=true:
44 | */
45 |
--------------------------------------------------------------------------------
/src/s7comm/plugin.rc.in:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moki-ics/s7commwireshark/073cbc71a6c8da990bbbd14a8d61cde859cc8207/src/s7comm/plugin.rc.in
--------------------------------------------------------------------------------
/src/s7comm_plus/AUTHORS:
--------------------------------------------------------------------------------
1 | Author :
2 | Thomas Wiens
3 |
--------------------------------------------------------------------------------
/src/s7comm_plus/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # CMakeLists.txt
2 | #
3 | # $Id$
4 | #
5 | # Wireshark - Network traffic analyzer
6 | # By Gerald Combs
7 | # Copyright 1998 Gerald Combs
8 | #
9 | # This program is free software; you can redistribute it and/or
10 | # modify it under the terms of the GNU General Public License
11 | # as published by the Free Software Foundation; either version 2
12 | # of the License, or (at your option) any later version.
13 | #
14 | # This program is distributed in the hope that it will be useful,
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | # GNU General Public License for more details.
18 | #
19 | # You should have received a copy of the GNU General Public License
20 | # along with this program; if not, write to the Free Software
21 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 | #
23 |
24 | set(DISSECTOR_SRC
25 | packet-s7comm_plus.c
26 | )
27 |
28 | set(PLUGIN_FILES
29 | plugin.c
30 | ${DISSECTOR_SRC}
31 | )
32 |
33 | set(CLEAN_FILES
34 | ${PLUGIN_FILES}
35 | )
36 |
37 | if (WERROR)
38 | set_source_files_properties(
39 | ${CLEAN_FILES}
40 | PROPERTIES
41 | COMPILE_FLAGS -Werror
42 | )
43 | endif()
44 |
45 | include_directories(${CMAKE_CURRENT_SOURCE_DIR})
46 |
47 | register_dissector_files(plugin.c
48 | plugin
49 | ${DISSECTOR_SRC}
50 | )
51 |
52 | add_library(s7comm_plus ${LINK_MODE_MODULE}
53 | ${PLUGIN_FILES}
54 | )
55 | set_target_properties(s7comm_plus PROPERTIES PREFIX "")
56 | set_target_properties(s7comm_plus PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
57 |
58 | target_link_libraries(s7comm_plus epan)
59 |
60 | install(TARGETS s7comm_plus
61 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} NAMELINK_SKIP
62 | RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION}
63 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION}
64 | )
65 |
66 |
--------------------------------------------------------------------------------
/src/s7comm_plus/COPYING:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 2, June 1991
3 |
4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | Preamble
10 |
11 | The licenses for most software are designed to take away your
12 | freedom to share and change it. By contrast, the GNU General Public
13 | License is intended to guarantee your freedom to share and change free
14 | software--to make sure the software is free for all its users. This
15 | General Public License applies to most of the Free Software
16 | Foundation's software and to any other program whose authors commit to
17 | using it. (Some other Free Software Foundation software is covered by
18 | the GNU Library General Public License instead.) You can apply it to
19 | your programs, too.
20 |
21 | When we speak of free software, we are referring to freedom, not
22 | price. Our General Public Licenses are designed to make sure that you
23 | have the freedom to distribute copies of free software (and charge for
24 | this service if you wish), that you receive source code or can get it
25 | if you want it, that you can change the software or use pieces of it
26 | in new free programs; and that you know you can do these things.
27 |
28 | To protect your rights, we need to make restrictions that forbid
29 | anyone to deny you these rights or to ask you to surrender the rights.
30 | These restrictions translate to certain responsibilities for you if you
31 | distribute copies of the software, or if you modify it.
32 |
33 | For example, if you distribute copies of such a program, whether
34 | gratis or for a fee, you must give the recipients all the rights that
35 | you have. You must make sure that they, too, receive or can get the
36 | source code. And you must show them these terms so they know their
37 | rights.
38 |
39 | We protect your rights with two steps: (1) copyright the software, and
40 | (2) offer you this license which gives you legal permission to copy,
41 | distribute and/or modify the software.
42 |
43 | Also, for each author's protection and ours, we want to make certain
44 | that everyone understands that there is no warranty for this free
45 | software. If the software is modified by someone else and passed on, we
46 | want its recipients to know that what they have is not the original, so
47 | that any problems introduced by others will not reflect on the original
48 | authors' reputations.
49 |
50 | Finally, any free program is threatened constantly by software
51 | patents. We wish to avoid the danger that redistributors of a free
52 | program will individually obtain patent licenses, in effect making the
53 | program proprietary. To prevent this, we have made it clear that any
54 | patent must be licensed for everyone's free use or not licensed at all.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | GNU GENERAL PUBLIC LICENSE
60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61 |
62 | 0. This License applies to any program or other work which contains
63 | a notice placed by the copyright holder saying it may be distributed
64 | under the terms of this General Public License. The "Program", below,
65 | refers to any such program or work, and a "work based on the Program"
66 | means either the Program or any derivative work under copyright law:
67 | that is to say, a work containing the Program or a portion of it,
68 | either verbatim or with modifications and/or translated into another
69 | language. (Hereinafter, translation is included without limitation in
70 | the term "modification".) Each licensee is addressed as "you".
71 |
72 | Activities other than copying, distribution and modification are not
73 | covered by this License; they are outside its scope. The act of
74 | running the Program is not restricted, and the output from the Program
75 | is covered only if its contents constitute a work based on the
76 | Program (independent of having been made by running the Program).
77 | Whether that is true depends on what the Program does.
78 |
79 | 1. You may copy and distribute verbatim copies of the Program's
80 | source code as you receive it, in any medium, provided that you
81 | conspicuously and appropriately publish on each copy an appropriate
82 | copyright notice and disclaimer of warranty; keep intact all the
83 | notices that refer to this License and to the absence of any warranty;
84 | and give any other recipients of the Program a copy of this License
85 | along with the Program.
86 |
87 | You may charge a fee for the physical act of transferring a copy, and
88 | you may at your option offer warranty protection in exchange for a fee.
89 |
90 | 2. You may modify your copy or copies of the Program or any portion
91 | of it, thus forming a work based on the Program, and copy and
92 | distribute such modifications or work under the terms of Section 1
93 | above, provided that you also meet all of these conditions:
94 |
95 | a) You must cause the modified files to carry prominent notices
96 | stating that you changed the files and the date of any change.
97 |
98 | b) You must cause any work that you distribute or publish, that in
99 | whole or in part contains or is derived from the Program or any
100 | part thereof, to be licensed as a whole at no charge to all third
101 | parties under the terms of this License.
102 |
103 | c) If the modified program normally reads commands interactively
104 | when run, you must cause it, when started running for such
105 | interactive use in the most ordinary way, to print or display an
106 | announcement including an appropriate copyright notice and a
107 | notice that there is no warranty (or else, saying that you provide
108 | a warranty) and that users may redistribute the program under
109 | these conditions, and telling the user how to view a copy of this
110 | License. (Exception: if the Program itself is interactive but
111 | does not normally print such an announcement, your work based on
112 | the Program is not required to print an announcement.)
113 |
114 | These requirements apply to the modified work as a whole. If
115 | identifiable sections of that work are not derived from the Program,
116 | and can be reasonably considered independent and separate works in
117 | themselves, then this License, and its terms, do not apply to those
118 | sections when you distribute them as separate works. But when you
119 | distribute the same sections as part of a whole which is a work based
120 | on the Program, the distribution of the whole must be on the terms of
121 | this License, whose permissions for other licensees extend to the
122 | entire whole, and thus to each and every part regardless of who wrote it.
123 |
124 | Thus, it is not the intent of this section to claim rights or contest
125 | your rights to work written entirely by you; rather, the intent is to
126 | exercise the right to control the distribution of derivative or
127 | collective works based on the Program.
128 |
129 | In addition, mere aggregation of another work not based on the Program
130 | with the Program (or with a work based on the Program) on a volume of
131 | a storage or distribution medium does not bring the other work under
132 | the scope of this License.
133 |
134 | 3. You may copy and distribute the Program (or a work based on it,
135 | under Section 2) in object code or executable form under the terms of
136 | Sections 1 and 2 above provided that you also do one of the following:
137 |
138 | a) Accompany it with the complete corresponding machine-readable
139 | source code, which must be distributed under the terms of Sections
140 | 1 and 2 above on a medium customarily used for software interchange; or,
141 |
142 | b) Accompany it with a written offer, valid for at least three
143 | years, to give any third party, for a charge no more than your
144 | cost of physically performing source distribution, a complete
145 | machine-readable copy of the corresponding source code, to be
146 | distributed under the terms of Sections 1 and 2 above on a medium
147 | customarily used for software interchange; or,
148 |
149 | c) Accompany it with the information you received as to the offer
150 | to distribute corresponding source code. (This alternative is
151 | allowed only for noncommercial distribution and only if you
152 | received the program in object code or executable form with such
153 | an offer, in accord with Subsection b above.)
154 |
155 | The source code for a work means the preferred form of the work for
156 | making modifications to it. For an executable work, complete source
157 | code means all the source code for all modules it contains, plus any
158 | associated interface definition files, plus the scripts used to
159 | control compilation and installation of the executable. However, as a
160 | special exception, the source code distributed need not include
161 | anything that is normally distributed (in either source or binary
162 | form) with the major components (compiler, kernel, and so on) of the
163 | operating system on which the executable runs, unless that component
164 | itself accompanies the executable.
165 |
166 | If distribution of executable or object code is made by offering
167 | access to copy from a designated place, then offering equivalent
168 | access to copy the source code from the same place counts as
169 | distribution of the source code, even though third parties are not
170 | compelled to copy the source along with the object code.
171 |
172 | 4. You may not copy, modify, sublicense, or distribute the Program
173 | except as expressly provided under this License. Any attempt
174 | otherwise to copy, modify, sublicense or distribute the Program is
175 | void, and will automatically terminate your rights under this License.
176 | However, parties who have received copies, or rights, from you under
177 | this License will not have their licenses terminated so long as such
178 | parties remain in full compliance.
179 |
180 | 5. You are not required to accept this License, since you have not
181 | signed it. However, nothing else grants you permission to modify or
182 | distribute the Program or its derivative works. These actions are
183 | prohibited by law if you do not accept this License. Therefore, by
184 | modifying or distributing the Program (or any work based on the
185 | Program), you indicate your acceptance of this License to do so, and
186 | all its terms and conditions for copying, distributing or modifying
187 | the Program or works based on it.
188 |
189 | 6. Each time you redistribute the Program (or any work based on the
190 | Program), the recipient automatically receives a license from the
191 | original licensor to copy, distribute or modify the Program subject to
192 | these terms and conditions. You may not impose any further
193 | restrictions on the recipients' exercise of the rights granted herein.
194 | You are not responsible for enforcing compliance by third parties to
195 | this License.
196 |
197 | 7. If, as a consequence of a court judgment or allegation of patent
198 | infringement or for any other reason (not limited to patent issues),
199 | conditions are imposed on you (whether by court order, agreement or
200 | otherwise) that contradict the conditions of this License, they do not
201 | excuse you from the conditions of this License. If you cannot
202 | distribute so as to satisfy simultaneously your obligations under this
203 | License and any other pertinent obligations, then as a consequence you
204 | may not distribute the Program at all. For example, if a patent
205 | license would not permit royalty-free redistribution of the Program by
206 | all those who receive copies directly or indirectly through you, then
207 | the only way you could satisfy both it and this License would be to
208 | refrain entirely from distribution of the Program.
209 |
210 | If any portion of this section is held invalid or unenforceable under
211 | any particular circumstance, the balance of the section is intended to
212 | apply and the section as a whole is intended to apply in other
213 | circumstances.
214 |
215 | It is not the purpose of this section to induce you to infringe any
216 | patents or other property right claims or to contest validity of any
217 | such claims; this section has the sole purpose of protecting the
218 | integrity of the free software distribution system, which is
219 | implemented by public license practices. Many people have made
220 | generous contributions to the wide range of software distributed
221 | through that system in reliance on consistent application of that
222 | system; it is up to the author/donor to decide if he or she is willing
223 | to distribute software through any other system and a licensee cannot
224 | impose that choice.
225 |
226 | This section is intended to make thoroughly clear what is believed to
227 | be a consequence of the rest of this License.
228 |
229 | 8. If the distribution and/or use of the Program is restricted in
230 | certain countries either by patents or by copyrighted interfaces, the
231 | original copyright holder who places the Program under this License
232 | may add an explicit geographical distribution limitation excluding
233 | those countries, so that distribution is permitted only in or among
234 | countries not thus excluded. In such case, this License incorporates
235 | the limitation as if written in the body of this License.
236 |
237 | 9. The Free Software Foundation may publish revised and/or new versions
238 | of the General Public License from time to time. Such new versions will
239 | be similar in spirit to the present version, but may differ in detail to
240 | address new problems or concerns.
241 |
242 | Each version is given a distinguishing version number. If the Program
243 | specifies a version number of this License which applies to it and "any
244 | later version", you have the option of following the terms and conditions
245 | either of that version or of any later version published by the Free
246 | Software Foundation. If the Program does not specify a version number of
247 | this License, you may choose any version ever published by the Free Software
248 | Foundation.
249 |
250 | 10. If you wish to incorporate parts of the Program into other free
251 | programs whose distribution conditions are different, write to the author
252 | to ask for permission. For software which is copyrighted by the Free
253 | Software Foundation, write to the Free Software Foundation; we sometimes
254 | make exceptions for this. Our decision will be guided by the two goals
255 | of preserving the free status of all derivatives of our free software and
256 | of promoting the sharing and reuse of software generally.
257 |
258 | NO WARRANTY
259 |
260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268 | REPAIR OR CORRECTION.
269 |
270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278 | POSSIBILITY OF SUCH DAMAGES.
279 |
280 | END OF TERMS AND CONDITIONS
281 |
282 | How to Apply These Terms to Your New Programs
283 |
284 | If you develop a new program, and you want it to be of the greatest
285 | possible use to the public, the best way to achieve this is to make it
286 | free software which everyone can redistribute and change under these terms.
287 |
288 | To do so, attach the following notices to the program. It is safest
289 | to attach them to the start of each source file to most effectively
290 | convey the exclusion of warranty; and each file should have at least
291 | the "copyright" line and a pointer to where the full notice is found.
292 |
293 |
294 | Copyright (C)
295 |
296 | This program is free software; you can redistribute it and/or modify
297 | it under the terms of the GNU General Public License as published by
298 | the Free Software Foundation; either version 2 of the License, or
299 | (at your option) any later version.
300 |
301 | This program is distributed in the hope that it will be useful,
302 | but WITHOUT ANY WARRANTY; without even the implied warranty of
303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 | GNU General Public License for more details.
305 |
306 | You should have received a copy of the GNU General Public License
307 | along with this program; if not, write to the Free Software
308 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
309 |
310 |
311 | Also add information on how to contact you by electronic and paper mail.
312 |
313 | If the program is interactive, make it output a short notice like this
314 | when it starts in an interactive mode:
315 |
316 | Gnomovision version 69, Copyright (C) year name of author
317 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
318 | This is free software, and you are welcome to redistribute it
319 | under certain conditions; type `show c' for details.
320 |
321 | The hypothetical commands `show w' and `show c' should show the appropriate
322 | parts of the General Public License. Of course, the commands you use may
323 | be called something other than `show w' and `show c'; they could even be
324 | mouse-clicks or menu items--whatever suits your program.
325 |
326 | You should also get your employer (if you work as a programmer) or your
327 | school, if any, to sign a "copyright disclaimer" for the program, if
328 | necessary. Here is a sample; alter the names:
329 |
330 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program
331 | `Gnomovision' (which makes passes at compilers) written by James Hacker.
332 |
333 | , 1 April 1989
334 | Ty Coon, President of Vice
335 |
336 | This General Public License does not permit incorporating your program into
337 | proprietary programs. If your program is a subroutine library, you may
338 | consider it more useful to permit linking proprietary applications with the
339 | library. If this is what you want to do, use the GNU Library General
340 | Public License instead of this License.
341 |
--------------------------------------------------------------------------------
/src/s7comm_plus/ChangeLog:
--------------------------------------------------------------------------------
1 | Overview of changes in Wireshark s7comm-plus Plugin
2 |
3 |
--------------------------------------------------------------------------------
/src/s7comm_plus/Makefile.am:
--------------------------------------------------------------------------------
1 | # Makefile.am
2 | # Automake file for s7comm-plus plugin
3 | #
4 | # $Id$
5 | #
6 | # Wireshark - Network traffic analyzer
7 | # By Gerald Combs
8 | # Copyright 1998 Gerald Combs
9 | #
10 | # This program is free software; you can redistribute it and/or
11 | # modify it under the terms of the GNU General Public License
12 | # as published by the Free Software Foundation; either version 2
13 | # of the License, or (at your option) any later version.
14 | #
15 | # This program is distributed in the hope that it will be useful,
16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | # GNU General Public License for more details.
19 | #
20 | # You should have received a copy of the GNU General Public License
21 | # along with this program; if not, write to the Free Software
22 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 | #
24 |
25 | INCLUDES = -I$(top_srcdir) -I$(includedir)
26 |
27 | include Makefile.common
28 |
29 | if HAVE_WARNINGS_AS_ERRORS
30 | AM_CFLAGS = -Werror
31 | endif
32 |
33 | plugindir = @plugindir@
34 |
35 | plugin_LTLIBRARIES = s7comm_plus.la
36 | s7comm_plus_la_SOURCES = \
37 | plugin.c \
38 | moduleinfo.h \
39 | $(DISSECTOR_SRC) \
40 | $(DISSECTOR_SUPPORT_SRC) \
41 | $(DISSECTOR_INCLUDES)
42 | s7comm_plus_la_LDFLAGS = -module -avoid-version
43 | s7comm_plus_la_LIBADD = @PLUGIN_LIBS@
44 |
45 | # Libs must be cleared, or else libtool won't create a shared module.
46 | # If your module needs to be linked against any particular libraries,
47 | # add them here.
48 | LIBS =
49 |
50 | #
51 | # Build plugin.c, which contains the plugin version[] string, a
52 | # function plugin_register() that calls the register routines for all
53 | # protocols, and a function plugin_reg_handoff() that calls the handoff
54 | # registration routines for all protocols.
55 | #
56 | # We do this by scanning sources. If that turns out to be too slow,
57 | # maybe we could just require every .o file to have an register routine
58 | # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
59 | #
60 | # Formatting conventions: The name of the proto_register_* routines an
61 | # proto_reg_handoff_* routines must start in column zero, or must be
62 | # preceded only by "void " starting in column zero, and must not be
63 | # inside #if.
64 | #
65 | # DISSECTOR_SRC is assumed to have all the files that need to be scanned.
66 | #
67 | # For some unknown reason, having a big "for" loop in the Makefile
68 | # to scan all the files doesn't work with some "make"s; they seem to
69 | # pass only the first few names in the list to the shell, for some
70 | # reason.
71 | #
72 | # Therefore, we have a script to generate the plugin.c file.
73 | # The shell script runs slowly, as multiple greps and seds are run
74 | # for each input file; this is especially slow on Windows. Therefore,
75 | # if Python is present (as indicated by PYTHON being defined), we run
76 | # a faster Python script to do that work instead.
77 | #
78 | # The first argument is the directory in which the source files live.
79 | # The second argument is "plugin", to indicate that we should build
80 | # a plugin.c file for a plugin.
81 | # All subsequent arguments are the files to scan.
82 | #
83 | plugin.c: $(DISSECTOR_SRC) Makefile.common $(top_srcdir)/tools/make-dissector-reg \
84 | $(top_srcdir)/tools/make-dissector-reg.py
85 | @if test -n "$(PYTHON)"; then \
86 | echo Making plugin.c with python ; \
87 | $(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
88 | plugin $(DISSECTOR_SRC) ; \
89 | else \
90 | echo Making plugin.c with shell script ; \
91 | $(top_srcdir)/tools/make-dissector-reg $(srcdir) \
92 | $(plugin_src) plugin $(DISSECTOR_SRC) ; \
93 | fi
94 |
95 | #
96 | # Currently plugin.c can be included in the distribution because
97 | # we always build all protocol dissectors. We used to have to check
98 | # whether or not to build the snmp dissector. If we again need to
99 | # variably build something, making plugin.c non-portable, uncomment
100 | # the dist-hook line below.
101 | #
102 | # Oh, yuk. We don't want to include "plugin.c" in the distribution, as
103 | # its contents depend on the configuration, and therefore we want it
104 | # to be built when the first "make" is done; however, Automake insists
105 | # on putting *all* source into the distribution.
106 | #
107 | # We work around this by having a "dist-hook" rule that deletes
108 | # "plugin.c", so that "dist" won't pick it up.
109 | #
110 | #dist-hook:
111 | # @rm -f $(distdir)/plugin.c
112 |
113 | CLEANFILES = \
114 | s7comm_plus \
115 | *~
116 |
117 | MAINTAINERCLEANFILES = \
118 | Makefile.in \
119 | plugin.c
120 |
121 | EXTRA_DIST = \
122 | Makefile.common \
123 | Makefile.nmake \
124 | moduleinfo.nmake \
125 | plugin.rc.in \
126 | CMakeLists.txt
127 |
128 | checkapi:
129 | $(PERL) $(top_srcdir)/tools/checkAPIs.pl -g abort -g termoutput -build $(DISSECTOR_SRC) $(DISSECTOR_INCLUDES)
130 |
--------------------------------------------------------------------------------
/src/s7comm_plus/Makefile.common:
--------------------------------------------------------------------------------
1 | # Makefile.common for s7comm-plus plugin
2 | # Contains the stuff from Makefile.am and Makefile.nmake that is
3 | # a) common to both files and
4 | # b) portable between both files
5 | #
6 | # $Id$
7 | #
8 | # Wireshark - Network traffic analyzer
9 | # By Gerald Combs
10 | # Copyright 1998 Gerald Combs
11 | #
12 | # This program is free software; you can redistribute it and/or
13 | # modify it under the terms of the GNU General Public License
14 | # as published by the Free Software Foundation; either version 2
15 | # of the License, or (at your option) any later version.
16 | #
17 | # This program is distributed in the hope that it will be useful,
18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 | # GNU General Public License for more details.
21 | #
22 | # You should have received a copy of the GNU General Public License
23 | # along with this program; if not, write to the Free Software
24 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 |
26 | # the name of the plugin
27 | PLUGIN_NAME = s7comm_plus
28 |
29 | # the dissector sources (without any helpers)
30 | DISSECTOR_SRC = \
31 | packet-s7comm_plus.c
32 |
33 |
34 | # corresponding headers
35 | DISSECTOR_INCLUDES =
36 |
37 |
38 | # Dissector helpers. They're included in the source files in this
39 | # directory, but they're not dissectors themselves, i.e. they're not
40 | # used to generate "register.c").
41 | DISSECTOR_SUPPORT_SRC =
42 |
43 |
--------------------------------------------------------------------------------
/src/s7comm_plus/Makefile.nmake:
--------------------------------------------------------------------------------
1 | # Makefile.nmake
2 | # nmake file for Wireshark s7comm-plus plugin
3 | #
4 | # $Id$
5 | #
6 |
7 | include ..\..\config.nmake
8 | include moduleinfo.nmake
9 |
10 | include Makefile.common
11 |
12 | CFLAGS=/WX /DHAVE_CONFIG_H /I../.. /I../../wiretap $(GLIB_CFLAGS) \
13 | /I$(PCAP_DIR)\include -D_U_="" $(LOCAL_CFLAGS)
14 |
15 | LDFLAGS = $(PLUGIN_LDFLAGS)
16 |
17 | !IFDEF ENABLE_LIBWIRESHARK
18 | LINK_PLUGIN_WITH=..\..\epan\libwireshark.lib
19 | CFLAGS=/DHAVE_WIN32_LIBWIRESHARK_LIB /D_NEED_VAR_IMPORT_ $(CFLAGS)
20 |
21 | DISSECTOR_OBJECTS = $(DISSECTOR_SRC:.c=.obj)
22 |
23 | DISSECTOR_SUPPORT_OBJECTS = $(DISSECTOR_SUPPORT_SRC:.c=.obj)
24 |
25 | OBJECTS = $(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS) plugin.obj
26 |
27 | RESOURCE=$(PLUGIN_NAME).res
28 |
29 | all: $(PLUGIN_NAME).dll
30 |
31 | $(PLUGIN_NAME).rc : moduleinfo.nmake
32 | sed -e s/@PLUGIN_NAME@/$(PLUGIN_NAME)/ \
33 | -e s/@RC_MODULE_VERSION@/$(RC_MODULE_VERSION)/ \
34 | -e s/@RC_VERSION@/$(RC_VERSION)/ \
35 | -e s/@MODULE_VERSION@/$(MODULE_VERSION)/ \
36 | -e s/@PACKAGE@/$(PACKAGE)/ \
37 | -e s/@VERSION@/$(VERSION)/ \
38 | -e s/@MSVC_VARIANT@/$(MSVC_VARIANT)/ \
39 | < plugin.rc.in > $@
40 |
41 | $(PLUGIN_NAME).dll $(PLUGIN_NAME).exp $(PLUGIN_NAME).lib : $(OBJECTS) $(LINK_PLUGIN_WITH) $(RESOURCE)
42 | link -dll /out:$(PLUGIN_NAME).dll $(LDFLAGS) $(OBJECTS) $(LINK_PLUGIN_WITH) \
43 | $(GLIB_LIBS) $(RESOURCE)
44 |
45 |
46 |
47 | #
48 | # Build plugin.c, which contains the plugin version[] string, a
49 | # function plugin_register() that calls the register routines for all
50 | # protocols, and a function plugin_reg_handoff() that calls the handoff
51 | # registration routines for all protocols.
52 | #
53 | # We do this by scanning sources. If that turns out to be too slow,
54 | # maybe we could just require every .o file to have an register routine
55 | # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
56 | #
57 | # Formatting conventions: The name of the proto_register_* routines an
58 | # proto_reg_handoff_* routines must start in column zero, or must be
59 | # preceded only by "void " starting in column zero, and must not be
60 | # inside #if.
61 | #
62 | # DISSECTOR_SRC is assumed to have all the files that need to be scanned.
63 | #
64 | # For some unknown reason, having a big "for" loop in the Makefile
65 | # to scan all the files doesn't work with some "make"s; they seem to
66 | # pass only the first few names in the list to the shell, for some
67 | # reason.
68 | #
69 | # Therefore, we have a script to generate the plugin.c file.
70 | # The shell script runs slowly, as multiple greps and seds are run
71 | # for each input file; this is especially slow on Windows. Therefore,
72 | # if Python is present (as indicated by PYTHON being defined), we run
73 | # a faster Python script to do that work instead.
74 | #
75 | # The first argument is the directory in which the source files live.
76 | # The second argument is "plugin", to indicate that we should build
77 | # a plugin.c file for a plugin.
78 | # All subsequent arguments are the files to scan.
79 | #
80 | plugin.c: $(DISSECTOR_SRC) ../../tools/make-dissector-reg.py ../../tools/make-dissector-reg
81 | !IFDEF PYTHON
82 | @echo Making plugin.c (using python)
83 | @$(PYTHON) "../../tools/make-dissector-reg.py" . plugin $(DISSECTOR_SRC)
84 | !ELSE
85 | @echo Making plugin.c (using sh)
86 | @$(SH) ../../tools/make-dissector-reg . plugin $(DISSECTOR_SRC)
87 | !ENDIF
88 |
89 | !ENDIF
90 |
91 | clean:
92 | rm -f $(OBJECTS) $(RESOURCE) plugin.c *.pdb \
93 | $(PLUGIN_NAME).dll $(PLUGIN_NAME).dll.manifest $(PLUGIN_NAME).lib \
94 | $(PLUGIN_NAME).exp $(PLUGIN_NAME).rc
95 |
96 | distclean: clean
97 |
98 | maintainer-clean: distclean
99 |
--------------------------------------------------------------------------------
/src/s7comm_plus/moduleinfo.h:
--------------------------------------------------------------------------------
1 | /* Included *after* config.h, in order to re-define these macros */
2 |
3 | #ifdef PACKAGE
4 | #undef PACKAGE
5 | #endif
6 |
7 | /* Name of package */
8 | #define PACKAGE "s7comm_plus"
9 |
10 |
11 | #ifdef VERSION
12 | #undef VERSION
13 | #endif
14 |
15 | /* Version number of package */
16 | #define VERSION "0.0.1"
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/s7comm_plus/moduleinfo.nmake:
--------------------------------------------------------------------------------
1 | #
2 | # $Id$
3 | #
4 |
5 | # The name
6 | PACKAGE=s7comm_plus
7 |
8 | # The version
9 | MODULE_VERSION_MAJOR=0
10 | MODULE_VERSION_MINOR=0
11 | MODULE_VERSION_MICRO=1
12 | MODULE_VERSION_EXTRA=0
13 |
14 | #
15 | # The RC_VERSION should be comma-separated, not dot-separated,
16 | # as per Graham Bloice's message in
17 | #
18 | # http://www.ethereal.com/lists/ethereal-dev/200303/msg00283.html
19 | #
20 | # "The RC_VERSION variable in config.nmake should be comma separated.
21 | # This allows the resources to be built correctly and the version
22 | # number to be correctly displayed in the explorer properties dialog
23 | # for the executables, and XP's tooltip, rather than 0.0.0.0."
24 | #
25 |
26 | MODULE_VERSION=$(MODULE_VERSION_MAJOR).$(MODULE_VERSION_MINOR).$(MODULE_VERSION_MICRO).$(MODULE_VERSION_EXTRA)
27 | RC_MODULE_VERSION=$(MODULE_VERSION_MAJOR),$(MODULE_VERSION_MINOR),$(MODULE_VERSION_MICRO),$(MODULE_VERSION_EXTRA)
28 |
29 |
--------------------------------------------------------------------------------
/src/s7comm_plus/packet-s7comm_plus.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moki-ics/s7commwireshark/073cbc71a6c8da990bbbd14a8d61cde859cc8207/src/s7comm_plus/packet-s7comm_plus.c
--------------------------------------------------------------------------------
/src/s7comm_plus/packet-s7comm_plus.h:
--------------------------------------------------------------------------------
1 | /* packet-s7comm_plus.h
2 | * Wireshark dissector for S7-Communication plus
3 | *
4 | * $Id$
5 | *
6 | * Wireshark - Network traffic analyzer
7 | * By Gerald Combs
8 | * Copyright 1998 Gerald Combs
9 | *
10 | * This program is free software; you can redistribute it and/or
11 | * modify it under the terms of the GNU General Public License
12 | * as published by the Free Software Foundation; either version 2
13 | * of the License, or (at your option) any later version.
14 | *
15 | * This program is distributed in the hope that it will be useful,
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | * GNU General Public License for more details.
19 | *
20 | * You should have received a copy of the GNU General Public License
21 | * along with this program; if not, write to the Free Software
22 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 | */
24 | #ifndef __PACKET_S7COMM_PLUS_H__
25 | #define __PACKET_S7COMM_PLUS_H__
26 |
27 | void proto_reg_handoff_s7commp(void);
28 | void proto_register_s7commp(void);
29 |
30 | static gboolean dissect_s7commp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_);
31 |
32 | #endif
33 |
--------------------------------------------------------------------------------
/src/s7comm_plus/plugin.rc.in:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moki-ics/s7commwireshark/073cbc71a6c8da990bbbd14a8d61cde859cc8207/src/s7comm_plus/plugin.rc.in
--------------------------------------------------------------------------------