⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 packet-cosnaming.c

📁 ethereal公司开发的aodv路由协议代码
💻 C
📖 第 1 页 / 共 3 页
字号:
/* packet-cosnaming.c * Routines for IDL dissection * * Autogenerated from idl2eth * Copyright 2001 Frank Singleton <frank.singleton@ericsson.com> *//* * Ethereal - Network traffic analyzer * By Gerald Combs * Copyright 1999 Gerald Combs */ /* * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. *  * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. *  * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. * */#ifdef HAVE_CONFIG_H# include "config.h"#endif#include "plugins/plugin_api.h"#include <stdio.h>#include <stdlib.h>#include <gmodule.h>#ifdef HAVE_SYS_TYPES_H# include <sys/types.h>#endif#ifdef HAVE_NETINET_IN_H# include <netinet/in.h>#endif#ifdef NEED_SNPRINTF_H# ifdef HAVE_STDARG_H#  include <stdarg.h># else#  include <varargs.h># endif# include "snprintf.h"#endif#include <string.h>#include <glib.h>#include <epan/packet.h>#include <epan/proto.h>#include "packet-giop.h"#include "plugins/plugin_api_defs.h"#ifndef __ETHEREAL_STATIC__G_MODULE_EXPORT const gchar version[] = "0.0.1";#endif/* Struct prototype declaration Start */         /* Struct = IDL:omg.org/CosNaming/NameComponent:1.0 */static void decode_CosNaming_NameComponent_st(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset, MessageHeader *header, gchar *operation);        /* Struct = IDL:omg.org/CosNaming/Binding:1.0 */static void decode_CosNaming_Binding_st(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset, MessageHeader *header, gchar *operation);/* Struct prototype declaration End */ /* Union prototype declaration Start */ /* Union prototype declaration End */ /* Initialise the protocol and subtree pointers */static int proto_cosnaming = -1;static gint ett_cosnaming = -1;/* Initialise the initial Alignment */static guint32  boundary = GIOP_HEADER_SIZE;  /* initial value *//* Initialise the Registered fields *//* TODO - Use registered fields *//* * IDL Operations Start */  static const char CosNaming_NamingContext_bind_op[] = "bind" ;static const char CosNaming_NamingContext_rebind_op[] = "rebind" ;static const char CosNaming_NamingContext_bind_context_op[] = "bind_context" ;static const char CosNaming_NamingContext_rebind_context_op[] = "rebind_context" ;static const char CosNaming_NamingContext_resolve_op[] = "resolve" ;static const char CosNaming_NamingContext_unbind_op[] = "unbind" ;static const char CosNaming_NamingContext_new_context_op[] = "new_context" ;static const char CosNaming_NamingContext_bind_new_context_op[] = "bind_new_context" ;static const char CosNaming_NamingContext_destroy_op[] = "destroy" ;static const char CosNaming_NamingContext_list_op[] = "list" ;static const char CosNaming_BindingIterator_next_one_op[] = "next_one" ;static const char CosNaming_BindingIterator_next_n_op[] = "next_n" ;static const char CosNaming_BindingIterator_destroy_op[] = "destroy" ;/* * IDL Operations End */ /*  Begin Exception (containing members) String  Declare  */static const char user_exception_CosNaming_NamingContext_NotFound[] = "IDL:omg.org/CosNaming/NamingContext/NotFound:1.0" ; static const char user_exception_CosNaming_NamingContext_CannotProceed[] = "IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0" ;     /*  End Exception (containing members) String Declare  *//* * IDL Attributes Start */  /* * IDL Attributes End */ /* * IDL Enums Start */  /* * Enum = IDL:omg.org/CosNaming/BindingType:1.0 */  static const value_string CosNaming_BindingType[] = {   { 0, "nobject" },    { 1, "ncontext" },    { 0,       NULL },};    /* * Enum = IDL:omg.org/CosNaming/NamingContext/NotFoundReason:1.0 */  static const value_string CosNaming_NamingContext_NotFoundReason[] = {   { 0, "missing_node" },    { 1, "not_context" },    { 2, "not_object" },    { 0,       NULL },};    /* * IDL Enums End */  /*  Begin Exception Helper Functions  *//* Exception = IDL:omg.org/CosNaming/NamingContext/NotFound:1.0 */static void decode_ex_CosNaming_NamingContext_NotFound(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 */        guint32   u_octet4;    guint32   u_octet4_loop_NotFound_rest_of_name;    guint32   i_NotFound_rest_of_name;        /* Operation specific Variable declarations End */            stream_is_big_endian = is_big_endian(header);  /* get stream endianess */                    u_octet4 = get_CDR_enum(tvb,offset,stream_is_big_endian, boundary);    if (tree) {       proto_tree_add_text(tree,tvb,*offset-4,4,"Enum value = %u (%s)",u_octet4,val_to_str(u_octet4,CosNaming_NamingContext_NotFoundReason,"Unknown Enum Value"));    }        u_octet4_loop_NotFound_rest_of_name = get_CDR_ulong(tvb, offset, stream_is_big_endian, boundary);    if (tree) {       proto_tree_add_text(tree,tvb,*offset-4, 4 ,"Seq length of NotFound_rest_of_name = %u",u_octet4_loop_NotFound_rest_of_name);       }        for (i_NotFound_rest_of_name=0; i_NotFound_rest_of_name < u_octet4_loop_NotFound_rest_of_name; i_NotFound_rest_of_name++) {            /*  Begin struct "CosNaming_NameComponent"  */                                        decode_CosNaming_NameComponent_st(tvb, pinfo, tree, offset, header, operation);                        /*  End struct "CosNaming_NameComponent"  */            }    }/* Exception = IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0 */static void decode_ex_CosNaming_NamingContext_CannotProceed(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 */        guint32   u_octet4_loop_CannotProceed_rest_of_name;    guint32   i_CannotProceed_rest_of_name;        /* Operation specific Variable declarations End */            stream_is_big_endian = is_big_endian(header);  /* get stream endianess */            get_CDR_object(tvb, pinfo, tree, offset, stream_is_big_endian, boundary);            u_octet4_loop_CannotProceed_rest_of_name = get_CDR_ulong(tvb, offset, stream_is_big_endian, boundary);    if (tree) {       proto_tree_add_text(tree,tvb,*offset-4, 4 ,"Seq length of CannotProceed_rest_of_name = %u",u_octet4_loop_CannotProceed_rest_of_name);       }        for (i_CannotProceed_rest_of_name=0; i_CannotProceed_rest_of_name < u_octet4_loop_CannotProceed_rest_of_name; i_CannotProceed_rest_of_name++) {            /*  Begin struct "CosNaming_NameComponent"  */                                        decode_CosNaming_NameComponent_st(tvb, pinfo, tree, offset, header, operation);                        /*  End struct "CosNaming_NameComponent"  */            }    }    /*  End Exception Helper Functions  *//* * Main delegator for exception handling * */ static gboolean decode_user_exception(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset, MessageHeader *header, gchar *operation ) {        gboolean be;                        /* big endianess */        if (!strcmp(header->exception_id, user_exception_CosNaming_NamingContext_NotFound )) {       decode_ex_CosNaming_NamingContext_NotFound(tvb, pinfo, tree, offset, header, operation);   /*  IDL:omg.org/CosNaming/NamingContext/NotFound:1.0  */       return TRUE;    }            if (!strcmp(header->exception_id, user_exception_CosNaming_NamingContext_CannotProceed )) {       decode_ex_CosNaming_NamingContext_CannotProceed(tvb, pinfo, tree, offset, header, operation);   /*  IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0  */       return TRUE;    }            return FALSE;    /* user exception not found */}    /*  Begin Attribute Helper Functions  */    /*  End Attribute Helper Functions  *//* * IDL:omg.org/CosNaming/NamingContext/bind:1.0 */ static void decode_CosNaming_NamingContext_bind(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 */        guint32   u_octet4_loop_n;    guint32   i_n;        /* Operation specific Variable declarations End */            stream_is_big_endian = is_big_endian(header);        switch(header->message_type) {        case Request:            u_octet4_loop_n = get_CDR_ulong(tvb, offset, stream_is_big_endian, boundary);        if (tree) {           proto_tree_add_text(tree,tvb,*offset-4, 4 ,"Seq length of n = %u",u_octet4_loop_n);           }                for (i_n=0; i_n < u_octet4_loop_n; i_n++) {                    /*  Begin struct "CosNaming_NameComponent"  */                                                        decode_CosNaming_NameComponent_st(tvb, pinfo, tree, offset, header, operation);                                    /*  End struct "CosNaming_NameComponent"  */                    }                get_CDR_object(tvb, pinfo, tree, offset, stream_is_big_endian, boundary);                        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/CosNaming/NamingContext/rebind:1.0 */ static void decode_CosNaming_NamingContext_rebind(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 */        guint32   u_octet4_loop_n;    guint32   i_n;        /* Operation specific Variable declarations End */            stream_is_big_endian = is_big_endian(header);        switch(header->message_type) {        case Request:            u_octet4_loop_n = get_CDR_ulong(tvb, offset, stream_is_big_endian, boundary);        if (tree) {           proto_tree_add_text(tree,tvb,*offset-4, 4 ,"Seq length of n = %u",u_octet4_loop_n);           }                for (i_n=0; i_n < u_octet4_loop_n; i_n++) {                    /*  Begin struct "CosNaming_NameComponent"  */                                                        decode_CosNaming_NameComponent_st(tvb, pinfo, tree, offset, header, operation);                                    /*  End struct "CosNaming_NameComponent"  */                    }                get_CDR_object(tvb, pinfo, tree, offset, stream_is_big_endian, boundary);                        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/CosNaming/NamingContext/bind_context:1.0 */ static void decode_CosNaming_NamingContext_bind_context(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 */        guint32   u_octet4_loop_n;    guint32   i_n;        /* Operation specific Variable declarations End */            stream_is_big_endian = is_big_endian(header);        switch(header->message_type) {        case Request:            u_octet4_loop_n = get_CDR_ulong(tvb, offset, stream_is_big_endian, boundary);        if (tree) {           proto_tree_add_text(tree,tvb,*offset-4, 4 ,"Seq length of n = %u",u_octet4_loop_n);           }                for (i_n=0; i_n < u_octet4_loop_n; i_n++) {                    /*  Begin struct "CosNaming_NameComponent"  */                                                        decode_CosNaming_NameComponent_st(tvb, pinfo, tree, offset, header, operation);                                    /*  End struct "CosNaming_NameComponent"  */                    }                get_CDR_object(tvb, pinfo, tree, offset, stream_is_big_endian, boundary);                        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 ");

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -