/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* packet-idmp.c */
-/* ../../tools/asn2wrs.py -b -e -L -p idmp -c ./idmp.cnf -s ./packet-idmp-template -D . IDMProtocolSpecification.asn CommonProtocolSpecification.asn */
+/* ../../tools/asn2wrs.py -b -L -p idmp -c ./idmp.cnf -s ./packet-idmp-template -D . -O ../../epan/dissectors IDMProtocolSpecification.asn CommonProtocolSpecification.asn */
/* Input file: packet-idmp-template.c */
-#line 1 "packet-idmp-template.c"
+#line 1 "../../asn1/idmp/packet-idmp-template.c"
/* packet-idmp.c
* Routines for X.519 Internet Directly Mapped Procotol (IDMP) packet dissection
* Graeme Lunt 2020
static const char *saved_protocolID = NULL;
static guint32 opcode = -1;
-void prefs_register_idmp(void); /* forward declaration for use in preferences registration */
+static void prefs_register_idmp(void); /* forward declaration for use in preferences registration */
/* Initialize the protocol and registered fields */
int proto_idmp = -1;
static GHashTable *idmp_segment_table = NULL;
static GHashTable *idmp_reassembled_table = NULL;
-
+
static int hf_idmp_fragments = -1;
static int hf_idmp_fragment = -1;
static int hf_idmp_fragment_overlap = -1;
static int hf_idmp_fragment_multiple_tails = -1;
static int hf_idmp_fragment_too_long_fragment = -1;
static int hf_idmp_fragment_error = -1;
+static int hf_idmp_fragment_count = -1;
static int hf_idmp_reassembled_in = -1;
static int hf_idmp_reassembled_length = -1;
&hf_idmp_fragment_multiple_tails,
&hf_idmp_fragment_too_long_fragment,
&hf_idmp_fragment_error,
+ &hf_idmp_fragment_count,
/* Reassembled in field */
&hf_idmp_reassembled_in,
/* Reassembled length field */
};
-static int call_idmp_oid_callback(tvbuff_t *tvb, int offset, packet_info *pinfo, int op, proto_tree *tree _U_)
+static int call_idmp_oid_callback(tvbuff_t *tvb, int offset, packet_info *pinfo, int op, proto_tree *tree _U_)
{
struct SESSION_DATA_STRUCTURE *session;
-
+
if((session = (struct SESSION_DATA_STRUCTURE*)pinfo->private_data) != NULL) {
if((!saved_protocolID) && (op == (ROS_OP_BIND | ROS_OP_RESULT))) {
/*--- Included file: packet-idmp-hf.c ---*/
-#line 1 "packet-idmp-hf.c"
+#line 1 "../../asn1/idmp/packet-idmp-hf.c"
static int hf_idmp_bind = -1; /* IdmBind */
static int hf_idmp_bindResult = -1; /* IdmBindResult */
static int hf_idmp_bindError = -1; /* IdmBindError */
static int hf_idmp_absent = -1; /* NULL */
/*--- End of included file: packet-idmp-hf.c ---*/
-#line 130 "packet-idmp-template.c"
+#line 132 "../../asn1/idmp/packet-idmp-template.c"
/* Initialize the subtree pointers */
static gint ett_idmp = -1;
/*--- Included file: packet-idmp-ett.c ---*/
-#line 1 "packet-idmp-ett.c"
+#line 1 "../../asn1/idmp/packet-idmp-ett.c"
static gint ett_idmp_IDM_PDU = -1;
static gint ett_idmp_IdmBind = -1;
static gint ett_idmp_IdmBindResult = -1;
static gint ett_idmp_InvokeId = -1;
/*--- End of included file: packet-idmp-ett.c ---*/
-#line 134 "packet-idmp-template.c"
+#line 136 "../../asn1/idmp/packet-idmp-template.c"
/*--- Included file: packet-idmp-fn.c ---*/
-#line 1 "packet-idmp-fn.c"
+#line 1 "../../asn1/idmp/packet-idmp-fn.c"
static int
/*--- End of included file: packet-idmp-fn.c ---*/
-#line 136 "packet-idmp-template.c"
+#line 138 "../../asn1/idmp/packet-idmp-template.c"
void
register_idmp_protocol_info(const char *oid, const ros_info_t *rinfo, int proto _U_, const char *name)
top_tree=parent_tree;
if(parent_tree){
- item = proto_tree_add_item(parent_tree, proto_idmp, tvb, 0, -1, FALSE);
+ item = proto_tree_add_item(parent_tree, proto_idmp, tvb, 0, -1, ENC_NA);
tree = proto_item_add_subtree(item, ett_idmp);
}
/* now check the segment fields */
- proto_tree_add_item(tree, hf_idmp_version, tvb, offset, 1, FALSE); offset++;
- proto_tree_add_item(tree, hf_idmp_final, tvb, offset, 1, FALSE);
+ proto_tree_add_item(tree, hf_idmp_version, tvb, offset, 1, ENC_BIG_ENDIAN); offset++;
+ proto_tree_add_item(tree, hf_idmp_final, tvb, offset, 1, ENC_BIG_ENDIAN);
idmp_final = tvb_get_guint8(tvb, offset); offset++;
- proto_tree_add_item(tree, hf_idmp_length, tvb, offset, 4, FALSE);
+ proto_tree_add_item(tree, hf_idmp_length, tvb, offset, 4, ENC_BIG_ENDIAN);
idmp_length = tvb_get_ntohl(tvb, offset); offset += 4;
if(idmp_reassemble) {
pinfo->fragmented = !idmp_final;
if (check_col(pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, " [%sIDMP fragment, %u byte%s]",
+ col_append_fstr(pinfo->cinfo, COL_INFO, " [%sIDMP fragment, %u byte%s]",
idmp_final ? "Final " : "" ,
idmp_length, plurality(idmp_length, "", "s"));
if(fd_head && fd_head->next) {
proto_tree_add_text(tree, tvb, offset, (idmp_length) ? -1 : 0,
"IDMP segment data (%u byte%s)", idmp_length,
- plurality(idmp_length, "", "s"));
+ plurality(idmp_length, "", "s"));
if (idmp_final) {
/* This is the last segment */
tvb, 0, 0, fd_head->reassembled_in);
}
}
-
- } else {
+
+ } else {
if(!idmp_final) {
if (check_col(pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, " [IDMP fragment, %u byte%s, IDMP reassembly not enabled]",
+ col_append_fstr(pinfo->cinfo, COL_INFO, " [IDMP fragment, %u byte%s, IDMP reassembly not enabled]",
idmp_length, plurality(idmp_length, "", "s"));
proto_tree_add_text(tree, tvb, offset, (idmp_length) ? -1 : 0,
"IDMP segment data (%u byte%s) (IDMP reassembly not enabled)", idmp_length,
- plurality(idmp_length, "", "s"));
+ plurality(idmp_length, "", "s"));
}
}
/* not reassembling - just dissect */
offset = dissect_idmp_IDM_PDU(FALSE, tvb, offset, &asn1_ctx, tree, hf_idmp_PDU);
pinfo->private_data = save_private_data;
- }
+ }
}
{ &hf_idmp_fragment_error,
{ "IDMP defragmentation error", "idmp.fragment.error", FT_FRAMENUM,
BASE_NONE, NULL, 0x00, NULL, HFILL } },
+ { &hf_idmp_fragment_count,
+ { "IDMP fragment count", "idmp.fragment.count", FT_UINT32, BASE_DEC,
+ NULL, 0x00, NULL, HFILL } },
{ &hf_idmp_reassembled_in,
{ "Reassembled IDMP in frame", "idmp.reassembled.in", FT_FRAMENUM, BASE_NONE,
NULL, 0x00, "This IDMP packet is reassembled in this frame", HFILL } },
/*--- Included file: packet-idmp-hfarr.c ---*/
-#line 1 "packet-idmp-hfarr.c"
+#line 1 "../../asn1/idmp/packet-idmp-hfarr.c"
{ &hf_idmp_bind,
{ "bind", "idmp.bind",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
/*--- End of included file: packet-idmp-hfarr.c ---*/
-#line 319 "packet-idmp-template.c"
+#line 324 "../../asn1/idmp/packet-idmp-template.c"
};
/* List of subtrees */
&ett_idmp_fragments,
/*--- Included file: packet-idmp-ettarr.c ---*/
-#line 1 "packet-idmp-ettarr.c"
+#line 1 "../../asn1/idmp/packet-idmp-ettarr.c"
&ett_idmp_IDM_PDU,
&ett_idmp_IdmBind,
&ett_idmp_IdmBindResult,
&ett_idmp_InvokeId,
/*--- End of included file: packet-idmp-ettarr.c ---*/
-#line 327 "packet-idmp-template.c"
+#line 332 "../../asn1/idmp/packet-idmp-template.c"
};
module_t *idmp_module;
" To use this option, you must also enable"
" \"Allow subdissectors to reassemble TCP streams\""
" in the TCP protocol settings.", &idmp_reassemble);
-
+
prefs_register_uint_preference(idmp_module, "tcp.port", "IDMP TCP Port",
"Set the port for Internet Directly Mapped Protocol requests/responses",
10, &global_idmp_tcp_port);
}
-void prefs_register_idmp(void) {
+static void
+prefs_register_idmp(void)
+{
/* de-register the old port */
/* port 102 is registered by TPKT - don't undo this! */
if(idmp_handle)
- dissector_delete("tcp.port", tcp_port, idmp_handle);
+ dissector_delete_uint("tcp.port", tcp_port, idmp_handle);
/* Set our port number for future use */
tcp_port = global_idmp_tcp_port;
if((tcp_port > 0) && idmp_handle)
- dissector_add("tcp.port", global_idmp_tcp_port, idmp_handle);
+ dissector_add_uint("tcp.port", global_idmp_tcp_port, idmp_handle);
}