📄 packet-coseventcomm.c
字号:
break; } /* switch(header->message_type) */ break; default: /* Unknown GIOP Message */ g_warning("Unknown GIOP Message"); break; } /* switch(header->message_type) */ }/* * IDL:omg.org/CosEventComm/PullSupplier/try_pull:1.0 */ static void decode_CosEventComm_PullSupplier_try_pull(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset, MessageHeader *header, gchar *operation) { gboolean stream_is_big_endian; /* big endianess */ /* Operation specific Variable declarations Begin */ guint8 u_octet1; /* Operation specific Variable declarations End */ stream_is_big_endian = is_big_endian(header); switch(header->message_type) { case Request: break; case Reply: switch(header->rep_status) { case NO_EXCEPTION: get_CDR_any(tvb,tree,offset,stream_is_big_endian, boundary, header); u_octet1 = get_CDR_boolean(tvb,offset); if (tree) { proto_tree_add_text(tree,tvb,*offset-1,1,"has_event = %u",u_octet1); } break; case USER_EXCEPTION: break; default: /* Unknown Exception */ g_warning("Unknown Exception "); break; } /* switch(header->message_type) */ break; default: /* Unknown GIOP Message */ g_warning("Unknown GIOP Message"); break; } /* switch(header->message_type) */ }/* * IDL:omg.org/CosEventComm/PullSupplier/disconnect_pull_supplier:1.0 */ static void decode_CosEventComm_PullSupplier_disconnect_pull_supplier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset, MessageHeader *header, gchar *operation) { gboolean stream_is_big_endian; /* big endianess */ /* Operation specific Variable declarations Begin */ /* Operation specific Variable declarations End */ stream_is_big_endian = is_big_endian(header); switch(header->message_type) { case Request: break; case Reply: switch(header->rep_status) { case NO_EXCEPTION: /* Function returns void */ break; case USER_EXCEPTION: break; default: /* Unknown Exception */ g_warning("Unknown Exception "); break; } /* switch(header->message_type) */ break; default: /* Unknown GIOP Message */ g_warning("Unknown GIOP Message"); break; } /* switch(header->message_type) */ }/* * IDL:omg.org/CosEventComm/PullConsumer/disconnect_pull_consumer:1.0 */ static void decode_CosEventComm_PullConsumer_disconnect_pull_consumer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset, MessageHeader *header, gchar *operation) { gboolean stream_is_big_endian; /* big endianess */ /* Operation specific Variable declarations Begin */ /* Operation specific Variable declarations End */ stream_is_big_endian = is_big_endian(header); switch(header->message_type) { case Request: break; case Reply: switch(header->rep_status) { case NO_EXCEPTION: /* Function returns void */ break; case USER_EXCEPTION: break; default: /* Unknown Exception */ g_warning("Unknown Exception "); break; } /* switch(header->message_type) */ break; default: /* Unknown GIOP Message */ g_warning("Unknown GIOP Message"); break; } /* switch(header->message_type) */ }static gboolean dissect_coseventcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ptree, int *offset, MessageHeader *header, gchar *operation, gchar *idlname) { proto_item *ti = NULL; proto_tree *tree = NULL; /* init later, inside if(tree) */ gboolean be; /* big endianess */ guint32 offset_saved = (*offset); /* save in case we must back out */ if (check_col(pinfo->cinfo, COL_PROTOCOL)) col_set_str(pinfo->cinfo, COL_PROTOCOL, "COSEVENTCOMM");/* * Do not clear COL_INFO, as nothing is being written there by * this dissector yet. So leave it as is from the GIOP dissector. * TODO: add something useful to COL_INFO * if (check_col(pinfo->cinfo, COL_INFO)) * col_clear(pinfo->cinfo, COL_INFO); */ if (ptree) { ti = proto_tree_add_item(ptree, proto_coseventcomm, tvb, *offset, tvb_length(tvb) - *offset, FALSE); tree = proto_item_add_subtree(ti, ett_coseventcomm); } be = is_big_endian(header); /* get endianess - TODO use passed in stream_is_big_endian instead ? */ /* If we have a USER Exception, then decode it and return */ if ((header->message_type == Reply) && (header->rep_status == USER_EXCEPTION)) { return decode_user_exception(tvb, pinfo, tree, offset, header, operation); } switch(header->message_type) { case Request: case Reply: if (!strcmp(operation, CosEventComm_PushConsumer_push_op )) { decode_CosEventComm_PushConsumer_push(tvb, pinfo, tree, offset, header, operation); return TRUE; } if (!strcmp(operation, CosEventComm_PushConsumer_disconnect_push_consumer_op )) { decode_CosEventComm_PushConsumer_disconnect_push_consumer(tvb, pinfo, tree, offset, header, operation); return TRUE; } if (!strcmp(operation, CosEventComm_PushSupplier_disconnect_push_supplier_op )) { decode_CosEventComm_PushSupplier_disconnect_push_supplier(tvb, pinfo, tree, offset, header, operation); return TRUE; } if (!strcmp(operation, CosEventComm_PullSupplier_pull_op )) { decode_CosEventComm_PullSupplier_pull(tvb, pinfo, tree, offset, header, operation); return TRUE; } if (!strcmp(operation, CosEventComm_PullSupplier_try_pull_op )) { decode_CosEventComm_PullSupplier_try_pull(tvb, pinfo, tree, offset, header, operation); return TRUE; } if (!strcmp(operation, CosEventComm_PullSupplier_disconnect_pull_supplier_op )) { decode_CosEventComm_PullSupplier_disconnect_pull_supplier(tvb, pinfo, tree, offset, header, operation); return TRUE; } if (!strcmp(operation, CosEventComm_PullConsumer_disconnect_pull_consumer_op )) { decode_CosEventComm_PullConsumer_disconnect_pull_consumer(tvb, pinfo, tree, offset, header, operation); return TRUE; } break; case CancelRequest: case LocateRequest: case LocateReply: case CloseConnection: case MessageError: case Fragment: return FALSE; /* not handled yet */ default: return FALSE; /* not handled yet */ } /* switch */ return FALSE;} /* End of main dissector *//* Register the protocol with Ethereal */void proto_register_giop_coseventcomm(void) { /* setup list of header fields */#if 0 static hf_register_info hf[] = { /* no fields yet */ };#endif /* setup protocol subtree array */ static gint *ett[] = { &ett_coseventcomm, }; /* Register the protocol name and description */ proto_coseventcomm = proto_register_protocol("Coseventcomm Dissector Using GIOP API" , "COSEVENTCOMM", "giop-coseventcomm" );#if 0 proto_register_field_array(proto_coseventcomm, hf, array_length(hf));#endif proto_register_subtree_array(ett,array_length(ett)); }/* register me as handler for these interfaces */void proto_register_handoff_giop_coseventcomm(void) { #if 0 /* Register for Explicit Dissection */ register_giop_user_module(dissect_coseventcomm, "COSEVENTCOMM", "CosEventComm/PullConsumer", proto_coseventcomm ); /* explicit dissector */ #endif #if 0 /* Register for Explicit Dissection */ register_giop_user_module(dissect_coseventcomm, "COSEVENTCOMM", "CosEventComm/PushSupplier", proto_coseventcomm ); /* explicit dissector */ #endif #if 0 /* Register for Explicit Dissection */ register_giop_user_module(dissect_coseventcomm, "COSEVENTCOMM", "CosEventComm/PushConsumer", proto_coseventcomm ); /* explicit dissector */ #endif #if 0 /* Register for Explicit Dissection */ register_giop_user_module(dissect_coseventcomm, "COSEVENTCOMM", "CosEventComm/PullSupplier", proto_coseventcomm ); /* explicit dissector */ #endif /* Register for Heuristic Dissection */ register_giop_user(dissect_coseventcomm, "COSEVENTCOMM" ,proto_coseventcomm); /* heuristic dissector */ }#ifndef __ETHEREAL_STATIC__G_MODULE_EXPORT voidplugin_reg_handoff(void){ proto_register_handoff_giop_coseventcomm();}G_MODULE_EXPORT voidplugin_init(plugin_address_table_t *pat){ /* initialise the table of pointers needed in Win32 DLLs */ plugin_address_table_init(pat); if (proto_coseventcomm == -1) { proto_register_giop_coseventcomm(); }}#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -