MSWSP: fix dissect_mswsp_smb()
[wireshark-wip.git] / epan / dissectors / packet-goose.c
blob618704e868c0b70a22d498e7f39ac1244533fd76
1 /* Do not modify this file. Changes will be overwritten. */
2 /* Generated automatically by the ASN.1 to Wireshark dissector compiler */
3 /* packet-goose.c */
4 /* ../../tools/asn2wrs.py -b -p goose -c ./goose.cnf -s ./packet-goose-template -D . -O ../../epan/dissectors goose.asn */
6 /* Input file: packet-goose-template.c */
8 #line 1 "../../asn1/goose/packet-goose-template.c"
9 /* packet-goose.c
10 * Routines for IEC 61850 GOOSE packet dissection
11 * Martin Lutz 2008
13 * $Id$
15 * Wireshark - Network traffic analyzer
16 * By Gerald Combs <gerald@wireshark.org>
17 * Copyright 1998 Gerald Combs
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version 2
22 * of the License, or (at your option) any later version.
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
29 * You should have received a copy of the GNU General Public License
30 * along with this program; if not, write to the Free Software
31 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
34 #include "config.h"
36 #include <glib.h>
37 #include <epan/packet.h>
38 #include <epan/asn1.h>
39 #include <epan/etypes.h>
40 #include <epan/expert.h>
42 #include "packet-ber.h"
43 #include "packet-acse.h"
45 #define PNAME "GOOSE"
46 #define PSNAME "GOOSE"
47 #define PFNAME "goose"
49 /* Initialize the protocol and registered fields */
50 static int proto_goose = -1;
51 static int hf_goose_appid = -1;
52 static int hf_goose_length = -1;
53 static int hf_goose_reserve1 = -1;
54 static int hf_goose_reserve2 = -1;
56 static expert_field ei_goose_mal_utctime = EI_INIT;
59 /*--- Included file: packet-goose-hf.c ---*/
60 #line 1 "../../asn1/goose/packet-goose-hf.c"
61 static int hf_goose_gseMngtPdu = -1; /* GSEMngtPdu */
62 static int hf_goose_goosePdu = -1; /* IECGoosePdu */
63 static int hf_goose_stateID = -1; /* INTEGER */
64 static int hf_goose_requestResp = -1; /* RequestResponse */
65 static int hf_goose_requests = -1; /* GSEMngtRequests */
66 static int hf_goose_responses = -1; /* GSEMngtResponses */
67 static int hf_goose_getGoReference = -1; /* GetReferenceRequestPdu */
68 static int hf_goose_getGOOSEElementNumber = -1; /* GetElementRequestPdu */
69 static int hf_goose_getGsReference = -1; /* GetReferenceRequestPdu */
70 static int hf_goose_getGSSEDataOffset = -1; /* GetElementRequestPdu */
71 static int hf_goose_gseMngtNotSupported = -1; /* NULL */
72 static int hf_goose_gseMngtResponses_GetGOReference = -1; /* GSEMngtResponsePdu */
73 static int hf_goose_gseMngtResponses_GetGOOSEElementNumber = -1; /* GSEMngtResponsePdu */
74 static int hf_goose_gseMngtResponses_GetGSReference = -1; /* GSEMngtResponsePdu */
75 static int hf_goose_gseMngtResponses_GetGSSEDataOffset = -1; /* GSEMngtResponsePdu */
76 static int hf_goose_ident = -1; /* VisibleString */
77 static int hf_goose_getReferenceRequestPDU_offset = -1; /* T_getReferenceRequestPDU_offset */
78 static int hf_goose_getReferenceRequestPDU_offset_item = -1; /* INTEGER */
79 static int hf_goose_references = -1; /* T_references */
80 static int hf_goose_references_item = -1; /* VisibleString */
81 static int hf_goose_confRev = -1; /* INTEGER */
82 static int hf_goose_posNeg = -1; /* PositiveNegative */
83 static int hf_goose_responsePositive = -1; /* T_responsePositive */
84 static int hf_goose_datSet = -1; /* VisibleString */
85 static int hf_goose_result = -1; /* SEQUENCE_OF_RequestResults */
86 static int hf_goose_result_item = -1; /* RequestResults */
87 static int hf_goose_responseNegative = -1; /* GlbErrors */
88 static int hf_goose_offset = -1; /* INTEGER */
89 static int hf_goose_reference = -1; /* IA5String */
90 static int hf_goose_error = -1; /* ErrorReason */
91 static int hf_goose_gocbRef = -1; /* VisibleString */
92 static int hf_goose_timeAllowedtoLive = -1; /* INTEGER */
93 static int hf_goose_goID = -1; /* VisibleString */
94 static int hf_goose_t = -1; /* UtcTime */
95 static int hf_goose_stNum = -1; /* INTEGER */
96 static int hf_goose_sqNum = -1; /* INTEGER */
97 static int hf_goose_test = -1; /* BOOLEAN */
98 static int hf_goose_ndsCom = -1; /* BOOLEAN */
99 static int hf_goose_numDatSetEntries = -1; /* INTEGER */
100 static int hf_goose_allData = -1; /* SEQUENCE_OF_Data */
101 static int hf_goose_allData_item = -1; /* Data */
102 static int hf_goose_array = -1; /* SEQUENCE_OF_Data */
103 static int hf_goose_array_item = -1; /* Data */
104 static int hf_goose_structure = -1; /* SEQUENCE_OF_Data */
105 static int hf_goose_structure_item = -1; /* Data */
106 static int hf_goose_boolean = -1; /* BOOLEAN */
107 static int hf_goose_bit_string = -1; /* BIT_STRING */
108 static int hf_goose_integer = -1; /* INTEGER */
109 static int hf_goose_unsigned = -1; /* INTEGER */
110 static int hf_goose_floating_point = -1; /* FloatingPoint */
111 static int hf_goose_real = -1; /* REAL */
112 static int hf_goose_octet_string = -1; /* OCTET_STRING */
113 static int hf_goose_visible_string = -1; /* VisibleString */
114 static int hf_goose_binary_time = -1; /* TimeOfDay */
115 static int hf_goose_bcd = -1; /* INTEGER */
116 static int hf_goose_booleanArray = -1; /* BIT_STRING */
117 static int hf_goose_objId = -1; /* OBJECT_IDENTIFIER */
118 static int hf_goose_mMSString = -1; /* MMSString */
119 static int hf_goose_utc_time = -1; /* UtcTime */
121 /*--- End of included file: packet-goose-hf.c ---*/
122 #line 51 "../../asn1/goose/packet-goose-template.c"
124 /* Initialize the subtree pointers */
125 static int ett_goose = -1;
128 /*--- Included file: packet-goose-ett.c ---*/
129 #line 1 "../../asn1/goose/packet-goose-ett.c"
130 static gint ett_goose_GOOSEpdu = -1;
131 static gint ett_goose_GSEMngtPdu = -1;
132 static gint ett_goose_RequestResponse = -1;
133 static gint ett_goose_GSEMngtRequests = -1;
134 static gint ett_goose_GSEMngtResponses = -1;
135 static gint ett_goose_GetReferenceRequestPdu = -1;
136 static gint ett_goose_T_getReferenceRequestPDU_offset = -1;
137 static gint ett_goose_GetElementRequestPdu = -1;
138 static gint ett_goose_T_references = -1;
139 static gint ett_goose_GSEMngtResponsePdu = -1;
140 static gint ett_goose_PositiveNegative = -1;
141 static gint ett_goose_T_responsePositive = -1;
142 static gint ett_goose_SEQUENCE_OF_RequestResults = -1;
143 static gint ett_goose_RequestResults = -1;
144 static gint ett_goose_IECGoosePdu = -1;
145 static gint ett_goose_SEQUENCE_OF_Data = -1;
146 static gint ett_goose_Data = -1;
148 /*--- End of included file: packet-goose-ett.c ---*/
149 #line 56 "../../asn1/goose/packet-goose-template.c"
152 /*--- Included file: packet-goose-fn.c ---*/
153 #line 1 "../../asn1/goose/packet-goose-fn.c"
154 /*--- Cyclic dependencies ---*/
156 /* Data -> Data/array -> Data */
157 static int dissect_goose_Data(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
162 static int
163 dissect_goose_INTEGER(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
164 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
165 NULL);
167 return offset;
172 static int
173 dissect_goose_VisibleString(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
174 offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_VisibleString,
175 actx, tree, tvb, offset, hf_index,
176 NULL);
178 return offset;
182 static const ber_sequence_t T_getReferenceRequestPDU_offset_sequence_of[1] = {
183 { &hf_goose_getReferenceRequestPDU_offset_item, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_goose_INTEGER },
186 static int
187 dissect_goose_T_getReferenceRequestPDU_offset(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
188 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
189 T_getReferenceRequestPDU_offset_sequence_of, hf_index, ett_goose_T_getReferenceRequestPDU_offset);
191 return offset;
195 static const ber_sequence_t GetReferenceRequestPdu_sequence[] = {
196 { &hf_goose_ident , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_goose_VisibleString },
197 { &hf_goose_getReferenceRequestPDU_offset, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_goose_T_getReferenceRequestPDU_offset },
198 { NULL, 0, 0, 0, NULL }
201 static int
202 dissect_goose_GetReferenceRequestPdu(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
203 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
204 GetReferenceRequestPdu_sequence, hf_index, ett_goose_GetReferenceRequestPdu);
206 return offset;
210 static const ber_sequence_t T_references_sequence_of[1] = {
211 { &hf_goose_references_item, BER_CLASS_UNI, BER_UNI_TAG_VisibleString, BER_FLAGS_NOOWNTAG, dissect_goose_VisibleString },
214 static int
215 dissect_goose_T_references(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
216 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
217 T_references_sequence_of, hf_index, ett_goose_T_references);
219 return offset;
223 static const ber_sequence_t GetElementRequestPdu_sequence[] = {
224 { &hf_goose_ident , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_goose_VisibleString },
225 { &hf_goose_references , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_goose_T_references },
226 { NULL, 0, 0, 0, NULL }
229 static int
230 dissect_goose_GetElementRequestPdu(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
231 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
232 GetElementRequestPdu_sequence, hf_index, ett_goose_GetElementRequestPdu);
234 return offset;
238 static const value_string goose_GSEMngtRequests_vals[] = {
239 { 1, "getGoReference" },
240 { 2, "getGOOSEElementNumber" },
241 { 3, "getGsReference" },
242 { 4, "getGSSEDataOffset" },
243 { 0, NULL }
246 static const ber_choice_t GSEMngtRequests_choice[] = {
247 { 1, &hf_goose_getGoReference, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_goose_GetReferenceRequestPdu },
248 { 2, &hf_goose_getGOOSEElementNumber, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_goose_GetElementRequestPdu },
249 { 3, &hf_goose_getGsReference, BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_goose_GetReferenceRequestPdu },
250 { 4, &hf_goose_getGSSEDataOffset, BER_CLASS_CON, 4, BER_FLAGS_IMPLTAG, dissect_goose_GetElementRequestPdu },
251 { 0, NULL, 0, 0, 0, NULL }
254 static int
255 dissect_goose_GSEMngtRequests(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
256 offset = dissect_ber_choice(actx, tree, tvb, offset,
257 GSEMngtRequests_choice, hf_index, ett_goose_GSEMngtRequests,
258 NULL);
260 return offset;
265 static int
266 dissect_goose_NULL(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
267 offset = dissect_ber_null(implicit_tag, actx, tree, tvb, offset, hf_index);
269 return offset;
274 static int
275 dissect_goose_IA5String(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
276 offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_IA5String,
277 actx, tree, tvb, offset, hf_index,
278 NULL);
280 return offset;
284 static const value_string goose_ErrorReason_vals[] = {
285 { 0, "other" },
286 { 1, "notFound" },
287 { 0, NULL }
291 static int
292 dissect_goose_ErrorReason(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
293 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
294 NULL);
296 return offset;
300 static const value_string goose_RequestResults_vals[] = {
301 { 0, "offset" },
302 { 1, "reference" },
303 { 2, "error" },
304 { 0, NULL }
307 static const ber_choice_t RequestResults_choice[] = {
308 { 0, &hf_goose_offset , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_goose_INTEGER },
309 { 1, &hf_goose_reference , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_goose_IA5String },
310 { 2, &hf_goose_error , BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_goose_ErrorReason },
311 { 0, NULL, 0, 0, 0, NULL }
314 static int
315 dissect_goose_RequestResults(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
316 offset = dissect_ber_choice(actx, tree, tvb, offset,
317 RequestResults_choice, hf_index, ett_goose_RequestResults,
318 NULL);
320 return offset;
324 static const ber_sequence_t SEQUENCE_OF_RequestResults_sequence_of[1] = {
325 { &hf_goose_result_item , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_goose_RequestResults },
328 static int
329 dissect_goose_SEQUENCE_OF_RequestResults(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
330 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
331 SEQUENCE_OF_RequestResults_sequence_of, hf_index, ett_goose_SEQUENCE_OF_RequestResults);
333 return offset;
337 static const ber_sequence_t T_responsePositive_sequence[] = {
338 { &hf_goose_datSet , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_goose_VisibleString },
339 { &hf_goose_result , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_goose_SEQUENCE_OF_RequestResults },
340 { NULL, 0, 0, 0, NULL }
343 static int
344 dissect_goose_T_responsePositive(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
345 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
346 T_responsePositive_sequence, hf_index, ett_goose_T_responsePositive);
348 return offset;
352 static const value_string goose_GlbErrors_vals[] = {
353 { 0, "other" },
354 { 1, "unknownControlBlock" },
355 { 2, "responseTooLarge" },
356 { 3, "controlBlockConfigurationError" },
357 { 0, NULL }
361 static int
362 dissect_goose_GlbErrors(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
363 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
364 NULL);
366 return offset;
370 static const value_string goose_PositiveNegative_vals[] = {
371 { 2, "responsePositive" },
372 { 3, "responseNegative" },
373 { 0, NULL }
376 static const ber_choice_t PositiveNegative_choice[] = {
377 { 2, &hf_goose_responsePositive, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_goose_T_responsePositive },
378 { 3, &hf_goose_responseNegative, BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_goose_GlbErrors },
379 { 0, NULL, 0, 0, 0, NULL }
382 static int
383 dissect_goose_PositiveNegative(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
384 offset = dissect_ber_choice(actx, tree, tvb, offset,
385 PositiveNegative_choice, hf_index, ett_goose_PositiveNegative,
386 NULL);
388 return offset;
392 static const ber_sequence_t GSEMngtResponsePdu_sequence[] = {
393 { &hf_goose_ident , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_goose_VisibleString },
394 { &hf_goose_confRev , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_goose_INTEGER },
395 { &hf_goose_posNeg , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_goose_PositiveNegative },
396 { NULL, 0, 0, 0, NULL }
399 static int
400 dissect_goose_GSEMngtResponsePdu(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
401 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
402 GSEMngtResponsePdu_sequence, hf_index, ett_goose_GSEMngtResponsePdu);
404 return offset;
408 static const value_string goose_GSEMngtResponses_vals[] = {
409 { 0, "gseMngtNotSupported" },
410 { 1, "getGoReference" },
411 { 2, "getGOOSEElementNumber" },
412 { 3, "getGsReference" },
413 { 4, "getGSSEDataOffset" },
414 { 0, NULL }
417 static const ber_choice_t GSEMngtResponses_choice[] = {
418 { 0, &hf_goose_gseMngtNotSupported, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_goose_NULL },
419 { 1, &hf_goose_gseMngtResponses_GetGOReference, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_goose_GSEMngtResponsePdu },
420 { 2, &hf_goose_gseMngtResponses_GetGOOSEElementNumber, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_goose_GSEMngtResponsePdu },
421 { 3, &hf_goose_gseMngtResponses_GetGSReference, BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_goose_GSEMngtResponsePdu },
422 { 4, &hf_goose_gseMngtResponses_GetGSSEDataOffset, BER_CLASS_CON, 4, BER_FLAGS_IMPLTAG, dissect_goose_GSEMngtResponsePdu },
423 { 0, NULL, 0, 0, 0, NULL }
426 static int
427 dissect_goose_GSEMngtResponses(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
428 offset = dissect_ber_choice(actx, tree, tvb, offset,
429 GSEMngtResponses_choice, hf_index, ett_goose_GSEMngtResponses,
430 NULL);
432 return offset;
436 static const value_string goose_RequestResponse_vals[] = {
437 { 1, "requests" },
438 { 2, "responses" },
439 { 0, NULL }
442 static const ber_choice_t RequestResponse_choice[] = {
443 { 1, &hf_goose_requests , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_goose_GSEMngtRequests },
444 { 2, &hf_goose_responses , BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_goose_GSEMngtResponses },
445 { 0, NULL, 0, 0, 0, NULL }
448 static int
449 dissect_goose_RequestResponse(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
450 offset = dissect_ber_choice(actx, tree, tvb, offset,
451 RequestResponse_choice, hf_index, ett_goose_RequestResponse,
452 NULL);
454 return offset;
458 static const ber_sequence_t GSEMngtPdu_sequence[] = {
459 { &hf_goose_stateID , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_goose_INTEGER },
460 { &hf_goose_requestResp , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_goose_RequestResponse },
461 { NULL, 0, 0, 0, NULL }
464 static int
465 dissect_goose_GSEMngtPdu(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
466 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
467 GSEMngtPdu_sequence, hf_index, ett_goose_GSEMngtPdu);
469 return offset;
474 static int
475 dissect_goose_UtcTime(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
476 #line 18 "../../asn1/goose/goose.cnf"
478 guint32 len;
479 guint32 seconds;
480 guint32 fraction;
481 guint32 nanoseconds;
482 nstime_t ts;
483 gchar * ptime;
485 len = tvb_length_remaining(tvb, offset);
487 if(len != 8)
489 proto_tree_add_expert(tree, actx->pinfo, &ei_goose_mal_utctime, tvb, offset, len);
490 if(hf_index >= 0)
492 proto_tree_add_string(tree, hf_index, tvb, offset, len, "????");
494 return offset;
497 seconds = tvb_get_ntohl(tvb, offset);
498 fraction = tvb_get_ntoh24(tvb, offset+4) * 0x100; /* Only 3 bytes are recommended */
499 nanoseconds = (guint32)( ((guint64)fraction * G_GINT64_CONSTANT(1000000000U)) / G_GINT64_CONSTANT(0x100000000U) ) ;
501 ts.secs = seconds;
502 ts.nsecs = nanoseconds;
504 ptime = abs_time_to_str(&ts, ABSOLUTE_TIME_UTC, TRUE);
506 if(hf_index >= 0)
508 proto_tree_add_string(tree, hf_index, tvb, offset, len, ptime);
511 return offset;
517 return offset;
522 static int
523 dissect_goose_BOOLEAN(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
524 offset = dissect_ber_boolean(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
526 return offset;
530 static const ber_sequence_t SEQUENCE_OF_Data_sequence_of[1] = {
531 { &hf_goose_allData_item , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_goose_Data },
534 static int
535 dissect_goose_SEQUENCE_OF_Data(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
536 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
537 SEQUENCE_OF_Data_sequence_of, hf_index, ett_goose_SEQUENCE_OF_Data);
539 return offset;
544 static int
545 dissect_goose_BIT_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
546 offset = dissect_ber_bitstring(implicit_tag, actx, tree, tvb, offset,
547 NULL, hf_index, -1,
548 NULL);
550 return offset;
555 static int
556 dissect_goose_FloatingPoint(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
557 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
558 NULL);
560 return offset;
565 static int
566 dissect_goose_REAL(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
567 offset = dissect_ber_real(implicit_tag, actx, tree, tvb, offset, hf_index,
568 NULL);
570 return offset;
575 static int
576 dissect_goose_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
577 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
578 NULL);
580 return offset;
585 static int
586 dissect_goose_TimeOfDay(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
587 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
588 NULL);
590 return offset;
595 static int
596 dissect_goose_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
597 offset = dissect_ber_object_identifier(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
599 return offset;
604 static int
605 dissect_goose_MMSString(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
606 offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_UTF8String,
607 actx, tree, tvb, offset, hf_index,
608 NULL);
610 return offset;
614 static const value_string goose_Data_vals[] = {
615 { 1, "array" },
616 { 2, "structure" },
617 { 3, "boolean" },
618 { 4, "bit-string" },
619 { 5, "integer" },
620 { 6, "unsigned" },
621 { 7, "floating-point" },
622 { 8, "real" },
623 { 9, "octet-string" },
624 { 10, "visible-string" },
625 { 12, "binary-time" },
626 { 13, "bcd" },
627 { 14, "booleanArray" },
628 { 15, "objId" },
629 { 16, "mMSString" },
630 { 17, "utc-time" },
631 { 0, NULL }
634 static const ber_choice_t Data_choice[] = {
635 { 1, &hf_goose_array , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_goose_SEQUENCE_OF_Data },
636 { 2, &hf_goose_structure , BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_goose_SEQUENCE_OF_Data },
637 { 3, &hf_goose_boolean , BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_goose_BOOLEAN },
638 { 4, &hf_goose_bit_string , BER_CLASS_CON, 4, BER_FLAGS_IMPLTAG, dissect_goose_BIT_STRING },
639 { 5, &hf_goose_integer , BER_CLASS_CON, 5, BER_FLAGS_IMPLTAG, dissect_goose_INTEGER },
640 { 6, &hf_goose_unsigned , BER_CLASS_CON, 6, BER_FLAGS_IMPLTAG, dissect_goose_INTEGER },
641 { 7, &hf_goose_floating_point, BER_CLASS_CON, 7, BER_FLAGS_IMPLTAG, dissect_goose_FloatingPoint },
642 { 8, &hf_goose_real , BER_CLASS_CON, 8, BER_FLAGS_IMPLTAG, dissect_goose_REAL },
643 { 9, &hf_goose_octet_string , BER_CLASS_CON, 9, BER_FLAGS_IMPLTAG, dissect_goose_OCTET_STRING },
644 { 10, &hf_goose_visible_string, BER_CLASS_CON, 10, BER_FLAGS_IMPLTAG, dissect_goose_VisibleString },
645 { 12, &hf_goose_binary_time , BER_CLASS_CON, 12, BER_FLAGS_IMPLTAG, dissect_goose_TimeOfDay },
646 { 13, &hf_goose_bcd , BER_CLASS_CON, 13, BER_FLAGS_IMPLTAG, dissect_goose_INTEGER },
647 { 14, &hf_goose_booleanArray , BER_CLASS_CON, 14, BER_FLAGS_IMPLTAG, dissect_goose_BIT_STRING },
648 { 15, &hf_goose_objId , BER_CLASS_CON, 15, BER_FLAGS_IMPLTAG, dissect_goose_OBJECT_IDENTIFIER },
649 { 16, &hf_goose_mMSString , BER_CLASS_CON, 16, BER_FLAGS_IMPLTAG, dissect_goose_MMSString },
650 { 17, &hf_goose_utc_time , BER_CLASS_CON, 17, BER_FLAGS_IMPLTAG, dissect_goose_UtcTime },
651 { 0, NULL, 0, 0, 0, NULL }
654 static int
655 dissect_goose_Data(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
656 offset = dissect_ber_choice(actx, tree, tvb, offset,
657 Data_choice, hf_index, ett_goose_Data,
658 NULL);
660 return offset;
664 static const ber_sequence_t IECGoosePdu_sequence[] = {
665 { &hf_goose_gocbRef , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_goose_VisibleString },
666 { &hf_goose_timeAllowedtoLive, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_goose_INTEGER },
667 { &hf_goose_datSet , BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_goose_VisibleString },
668 { &hf_goose_goID , BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_goose_VisibleString },
669 { &hf_goose_t , BER_CLASS_CON, 4, BER_FLAGS_IMPLTAG, dissect_goose_UtcTime },
670 { &hf_goose_stNum , BER_CLASS_CON, 5, BER_FLAGS_IMPLTAG, dissect_goose_INTEGER },
671 { &hf_goose_sqNum , BER_CLASS_CON, 6, BER_FLAGS_IMPLTAG, dissect_goose_INTEGER },
672 { &hf_goose_test , BER_CLASS_CON, 7, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_goose_BOOLEAN },
673 { &hf_goose_confRev , BER_CLASS_CON, 8, BER_FLAGS_IMPLTAG, dissect_goose_INTEGER },
674 { &hf_goose_ndsCom , BER_CLASS_CON, 9, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_goose_BOOLEAN },
675 { &hf_goose_numDatSetEntries, BER_CLASS_CON, 10, BER_FLAGS_IMPLTAG, dissect_goose_INTEGER },
676 { &hf_goose_allData , BER_CLASS_CON, 11, BER_FLAGS_IMPLTAG, dissect_goose_SEQUENCE_OF_Data },
677 { NULL, 0, 0, 0, NULL }
680 static int
681 dissect_goose_IECGoosePdu(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
682 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
683 IECGoosePdu_sequence, hf_index, ett_goose_IECGoosePdu);
685 return offset;
689 static const value_string goose_GOOSEpdu_vals[] = {
690 { 0, "gseMngtPdu" },
691 { 1, "goosePdu" },
692 { 0, NULL }
695 static const ber_choice_t GOOSEpdu_choice[] = {
696 { 0, &hf_goose_gseMngtPdu , BER_CLASS_APP, 0, BER_FLAGS_IMPLTAG, dissect_goose_GSEMngtPdu },
697 { 1, &hf_goose_goosePdu , BER_CLASS_APP, 1, BER_FLAGS_IMPLTAG, dissect_goose_IECGoosePdu },
698 { 0, NULL, 0, 0, 0, NULL }
701 static int
702 dissect_goose_GOOSEpdu(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
703 offset = dissect_ber_choice(actx, tree, tvb, offset,
704 GOOSEpdu_choice, hf_index, ett_goose_GOOSEpdu,
705 NULL);
707 return offset;
711 /*--- End of included file: packet-goose-fn.c ---*/
712 #line 58 "../../asn1/goose/packet-goose-template.c"
715 * Dissect GOOSE PDUs inside a PPDU.
717 static void
718 dissect_goose(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
720 int offset = 0;
721 int old_offset;
722 guint16 length;
723 proto_item *item = NULL;
724 proto_tree *tree = NULL;
725 asn1_ctx_t asn1_ctx;
726 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
728 col_set_str(pinfo->cinfo, COL_PROTOCOL, PNAME);
729 col_clear(pinfo->cinfo, COL_INFO);
731 if (parent_tree){
732 item = proto_tree_add_item(parent_tree, proto_goose, tvb, 0, -1, ENC_NA);
733 tree = proto_item_add_subtree(item, ett_goose);
736 /* APPID */
737 proto_tree_add_item(tree, hf_goose_appid, tvb, offset, 2, ENC_BIG_ENDIAN);
739 /* Length */
740 length = tvb_get_ntohs(tvb, offset + 2);
741 proto_tree_add_item(tree, hf_goose_length, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
743 /* Reserved 1 */
744 proto_tree_add_item(tree, hf_goose_reserve1, tvb, offset + 4, 2, ENC_BIG_ENDIAN);
746 /* Reserved 2 */
747 proto_tree_add_item(tree, hf_goose_reserve2, tvb, offset + 6, 2, ENC_BIG_ENDIAN);
749 offset = 8;
750 while (offset < length){
751 old_offset = offset;
752 offset = dissect_goose_GOOSEpdu(FALSE, tvb, offset, &asn1_ctx , tree, -1);
753 if (offset == old_offset) {
754 proto_tree_add_text(tree, tvb, offset, -1, "Internal error, zero-byte GOOSE PDU");
755 return;
762 /*--- proto_register_goose -------------------------------------------*/
763 void proto_register_goose(void) {
765 /* List of fields */
766 static hf_register_info hf[] =
768 { &hf_goose_appid,
769 { "APPID", "goose.appid", FT_UINT16, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL }},
771 { &hf_goose_length,
772 { "Length", "goose.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
774 { &hf_goose_reserve1,
775 { "Reserved 1", "goose.reserve1", FT_UINT16, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL }},
777 { &hf_goose_reserve2,
778 { "Reserved 2", "goose.reserve2", FT_UINT16, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL }},
781 /*--- Included file: packet-goose-hfarr.c ---*/
782 #line 1 "../../asn1/goose/packet-goose-hfarr.c"
783 { &hf_goose_gseMngtPdu,
784 { "gseMngtPdu", "goose.gseMngtPdu_element",
785 FT_NONE, BASE_NONE, NULL, 0,
786 NULL, HFILL }},
787 { &hf_goose_goosePdu,
788 { "goosePdu", "goose.goosePdu_element",
789 FT_NONE, BASE_NONE, NULL, 0,
790 "IECGoosePdu", HFILL }},
791 { &hf_goose_stateID,
792 { "stateID", "goose.stateID",
793 FT_INT32, BASE_DEC, NULL, 0,
794 "INTEGER", HFILL }},
795 { &hf_goose_requestResp,
796 { "requestResp", "goose.requestResp",
797 FT_UINT32, BASE_DEC, VALS(goose_RequestResponse_vals), 0,
798 "RequestResponse", HFILL }},
799 { &hf_goose_requests,
800 { "requests", "goose.requests",
801 FT_UINT32, BASE_DEC, VALS(goose_GSEMngtRequests_vals), 0,
802 "GSEMngtRequests", HFILL }},
803 { &hf_goose_responses,
804 { "responses", "goose.responses",
805 FT_UINT32, BASE_DEC, VALS(goose_GSEMngtResponses_vals), 0,
806 "GSEMngtResponses", HFILL }},
807 { &hf_goose_getGoReference,
808 { "getGoReference", "goose.getGoReference_element",
809 FT_NONE, BASE_NONE, NULL, 0,
810 "GetReferenceRequestPdu", HFILL }},
811 { &hf_goose_getGOOSEElementNumber,
812 { "getGOOSEElementNumber", "goose.getGOOSEElementNumber_element",
813 FT_NONE, BASE_NONE, NULL, 0,
814 "GetElementRequestPdu", HFILL }},
815 { &hf_goose_getGsReference,
816 { "getGsReference", "goose.getGsReference_element",
817 FT_NONE, BASE_NONE, NULL, 0,
818 "GetReferenceRequestPdu", HFILL }},
819 { &hf_goose_getGSSEDataOffset,
820 { "getGSSEDataOffset", "goose.getGSSEDataOffset_element",
821 FT_NONE, BASE_NONE, NULL, 0,
822 "GetElementRequestPdu", HFILL }},
823 { &hf_goose_gseMngtNotSupported,
824 { "gseMngtNotSupported", "goose.gseMngtNotSupported_element",
825 FT_NONE, BASE_NONE, NULL, 0,
826 NULL, HFILL }},
827 { &hf_goose_gseMngtResponses_GetGOReference,
828 { "getGoReference", "goose.getGoReference_element",
829 FT_NONE, BASE_NONE, NULL, 0,
830 "GSEMngtResponsePdu", HFILL }},
831 { &hf_goose_gseMngtResponses_GetGOOSEElementNumber,
832 { "getGOOSEElementNumber", "goose.getGOOSEElementNumber_element",
833 FT_NONE, BASE_NONE, NULL, 0,
834 "GSEMngtResponsePdu", HFILL }},
835 { &hf_goose_gseMngtResponses_GetGSReference,
836 { "getGsReference", "goose.getGsReference_element",
837 FT_NONE, BASE_NONE, NULL, 0,
838 "GSEMngtResponsePdu", HFILL }},
839 { &hf_goose_gseMngtResponses_GetGSSEDataOffset,
840 { "getGSSEDataOffset", "goose.getGSSEDataOffset_element",
841 FT_NONE, BASE_NONE, NULL, 0,
842 "GSEMngtResponsePdu", HFILL }},
843 { &hf_goose_ident,
844 { "ident", "goose.ident",
845 FT_STRING, BASE_NONE, NULL, 0,
846 "VisibleString", HFILL }},
847 { &hf_goose_getReferenceRequestPDU_offset,
848 { "offset", "goose.offset",
849 FT_UINT32, BASE_DEC, NULL, 0,
850 "T_getReferenceRequestPDU_offset", HFILL }},
851 { &hf_goose_getReferenceRequestPDU_offset_item,
852 { "offset item", "goose.offset_item",
853 FT_INT32, BASE_DEC, NULL, 0,
854 "INTEGER", HFILL }},
855 { &hf_goose_references,
856 { "references", "goose.references",
857 FT_UINT32, BASE_DEC, NULL, 0,
858 NULL, HFILL }},
859 { &hf_goose_references_item,
860 { "references item", "goose.references_item",
861 FT_STRING, BASE_NONE, NULL, 0,
862 "VisibleString", HFILL }},
863 { &hf_goose_confRev,
864 { "confRev", "goose.confRev",
865 FT_INT32, BASE_DEC, NULL, 0,
866 "INTEGER", HFILL }},
867 { &hf_goose_posNeg,
868 { "posNeg", "goose.posNeg",
869 FT_UINT32, BASE_DEC, VALS(goose_PositiveNegative_vals), 0,
870 "PositiveNegative", HFILL }},
871 { &hf_goose_responsePositive,
872 { "responsePositive", "goose.responsePositive_element",
873 FT_NONE, BASE_NONE, NULL, 0,
874 NULL, HFILL }},
875 { &hf_goose_datSet,
876 { "datSet", "goose.datSet",
877 FT_STRING, BASE_NONE, NULL, 0,
878 "VisibleString", HFILL }},
879 { &hf_goose_result,
880 { "result", "goose.result",
881 FT_UINT32, BASE_DEC, NULL, 0,
882 "SEQUENCE_OF_RequestResults", HFILL }},
883 { &hf_goose_result_item,
884 { "RequestResults", "goose.RequestResults",
885 FT_UINT32, BASE_DEC, VALS(goose_RequestResults_vals), 0,
886 NULL, HFILL }},
887 { &hf_goose_responseNegative,
888 { "responseNegative", "goose.responseNegative",
889 FT_INT32, BASE_DEC, VALS(goose_GlbErrors_vals), 0,
890 "GlbErrors", HFILL }},
891 { &hf_goose_offset,
892 { "offset", "goose.offset",
893 FT_INT32, BASE_DEC, NULL, 0,
894 "INTEGER", HFILL }},
895 { &hf_goose_reference,
896 { "reference", "goose.reference",
897 FT_STRING, BASE_NONE, NULL, 0,
898 "IA5String", HFILL }},
899 { &hf_goose_error,
900 { "error", "goose.error",
901 FT_INT32, BASE_DEC, VALS(goose_ErrorReason_vals), 0,
902 "ErrorReason", HFILL }},
903 { &hf_goose_gocbRef,
904 { "gocbRef", "goose.gocbRef",
905 FT_STRING, BASE_NONE, NULL, 0,
906 "VisibleString", HFILL }},
907 { &hf_goose_timeAllowedtoLive,
908 { "timeAllowedtoLive", "goose.timeAllowedtoLive",
909 FT_INT32, BASE_DEC, NULL, 0,
910 "INTEGER", HFILL }},
911 { &hf_goose_goID,
912 { "goID", "goose.goID",
913 FT_STRING, BASE_NONE, NULL, 0,
914 "VisibleString", HFILL }},
915 { &hf_goose_t,
916 { "t", "goose.t",
917 FT_STRING, BASE_NONE, NULL, 0,
918 "UtcTime", HFILL }},
919 { &hf_goose_stNum,
920 { "stNum", "goose.stNum",
921 FT_UINT32, BASE_DEC, NULL, 0,
922 "INTEGER", HFILL }},
923 { &hf_goose_sqNum,
924 { "sqNum", "goose.sqNum",
925 FT_UINT32, BASE_DEC, NULL, 0,
926 "INTEGER", HFILL }},
927 { &hf_goose_test,
928 { "test", "goose.test",
929 FT_BOOLEAN, BASE_NONE, NULL, 0,
930 "BOOLEAN", HFILL }},
931 { &hf_goose_ndsCom,
932 { "ndsCom", "goose.ndsCom",
933 FT_BOOLEAN, BASE_NONE, NULL, 0,
934 "BOOLEAN", HFILL }},
935 { &hf_goose_numDatSetEntries,
936 { "numDatSetEntries", "goose.numDatSetEntries",
937 FT_INT32, BASE_DEC, NULL, 0,
938 "INTEGER", HFILL }},
939 { &hf_goose_allData,
940 { "allData", "goose.allData",
941 FT_UINT32, BASE_DEC, NULL, 0,
942 "SEQUENCE_OF_Data", HFILL }},
943 { &hf_goose_allData_item,
944 { "Data", "goose.Data",
945 FT_UINT32, BASE_DEC, VALS(goose_Data_vals), 0,
946 NULL, HFILL }},
947 { &hf_goose_array,
948 { "array", "goose.array",
949 FT_UINT32, BASE_DEC, NULL, 0,
950 "SEQUENCE_OF_Data", HFILL }},
951 { &hf_goose_array_item,
952 { "Data", "goose.Data",
953 FT_UINT32, BASE_DEC, VALS(goose_Data_vals), 0,
954 NULL, HFILL }},
955 { &hf_goose_structure,
956 { "structure", "goose.structure",
957 FT_UINT32, BASE_DEC, NULL, 0,
958 "SEQUENCE_OF_Data", HFILL }},
959 { &hf_goose_structure_item,
960 { "Data", "goose.Data",
961 FT_UINT32, BASE_DEC, VALS(goose_Data_vals), 0,
962 NULL, HFILL }},
963 { &hf_goose_boolean,
964 { "boolean", "goose.boolean",
965 FT_BOOLEAN, BASE_NONE, NULL, 0,
966 NULL, HFILL }},
967 { &hf_goose_bit_string,
968 { "bit-string", "goose.bit_string",
969 FT_BYTES, BASE_NONE, NULL, 0,
970 NULL, HFILL }},
971 { &hf_goose_integer,
972 { "integer", "goose.integer",
973 FT_INT32, BASE_DEC, NULL, 0,
974 NULL, HFILL }},
975 { &hf_goose_unsigned,
976 { "unsigned", "goose.unsigned",
977 FT_INT32, BASE_DEC, NULL, 0,
978 "INTEGER", HFILL }},
979 { &hf_goose_floating_point,
980 { "floating-point", "goose.floating_point",
981 FT_BYTES, BASE_NONE, NULL, 0,
982 "FloatingPoint", HFILL }},
983 { &hf_goose_real,
984 { "real", "goose.real",
985 FT_DOUBLE, BASE_NONE, NULL, 0,
986 NULL, HFILL }},
987 { &hf_goose_octet_string,
988 { "octet-string", "goose.octet_string",
989 FT_BYTES, BASE_NONE, NULL, 0,
990 NULL, HFILL }},
991 { &hf_goose_visible_string,
992 { "visible-string", "goose.visible_string",
993 FT_STRING, BASE_NONE, NULL, 0,
994 "VisibleString", HFILL }},
995 { &hf_goose_binary_time,
996 { "binary-time", "goose.binary_time",
997 FT_BYTES, BASE_NONE, NULL, 0,
998 "TimeOfDay", HFILL }},
999 { &hf_goose_bcd,
1000 { "bcd", "goose.bcd",
1001 FT_INT32, BASE_DEC, NULL, 0,
1002 "INTEGER", HFILL }},
1003 { &hf_goose_booleanArray,
1004 { "booleanArray", "goose.booleanArray",
1005 FT_BYTES, BASE_NONE, NULL, 0,
1006 "BIT_STRING", HFILL }},
1007 { &hf_goose_objId,
1008 { "objId", "goose.objId",
1009 FT_OID, BASE_NONE, NULL, 0,
1010 "OBJECT_IDENTIFIER", HFILL }},
1011 { &hf_goose_mMSString,
1012 { "mMSString", "goose.mMSString",
1013 FT_STRING, BASE_NONE, NULL, 0,
1014 NULL, HFILL }},
1015 { &hf_goose_utc_time,
1016 { "utc-time", "goose.utc_time",
1017 FT_STRING, BASE_NONE, NULL, 0,
1018 "UtcTime", HFILL }},
1020 /*--- End of included file: packet-goose-hfarr.c ---*/
1021 #line 126 "../../asn1/goose/packet-goose-template.c"
1024 /* List of subtrees */
1025 static gint *ett[] = {
1026 &ett_goose,
1028 /*--- Included file: packet-goose-ettarr.c ---*/
1029 #line 1 "../../asn1/goose/packet-goose-ettarr.c"
1030 &ett_goose_GOOSEpdu,
1031 &ett_goose_GSEMngtPdu,
1032 &ett_goose_RequestResponse,
1033 &ett_goose_GSEMngtRequests,
1034 &ett_goose_GSEMngtResponses,
1035 &ett_goose_GetReferenceRequestPdu,
1036 &ett_goose_T_getReferenceRequestPDU_offset,
1037 &ett_goose_GetElementRequestPdu,
1038 &ett_goose_T_references,
1039 &ett_goose_GSEMngtResponsePdu,
1040 &ett_goose_PositiveNegative,
1041 &ett_goose_T_responsePositive,
1042 &ett_goose_SEQUENCE_OF_RequestResults,
1043 &ett_goose_RequestResults,
1044 &ett_goose_IECGoosePdu,
1045 &ett_goose_SEQUENCE_OF_Data,
1046 &ett_goose_Data,
1048 /*--- End of included file: packet-goose-ettarr.c ---*/
1049 #line 132 "../../asn1/goose/packet-goose-template.c"
1052 static ei_register_info ei[] = {
1053 { &ei_goose_mal_utctime, { "goose.malformed.utctime", PI_MALFORMED, PI_WARN, "BER Error: malformed UTCTime encoding", EXPFILL }},
1056 expert_module_t* expert_goose;
1058 /* Register protocol */
1059 proto_goose = proto_register_protocol(PNAME, PSNAME, PFNAME);
1060 register_dissector("goose", dissect_goose, proto_goose);
1062 /* Register fields and subtrees */
1063 proto_register_field_array(proto_goose, hf, array_length(hf));
1064 proto_register_subtree_array(ett, array_length(ett));
1065 expert_goose = expert_register_protocol(proto_goose);
1066 expert_register_field_array(expert_goose, ei, array_length(ei));
1069 /*--- proto_reg_handoff_goose --- */
1070 void proto_reg_handoff_goose(void) {
1072 dissector_handle_t goose_handle;
1073 goose_handle = find_dissector("goose");
1075 dissector_add_uint("ethertype", ETHERTYPE_IEC61850_GOOSE, goose_handle);