static int dissect_lock(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset, rpc_call_info_value *civ) { proto_item* lock_item = NULL; proto_tree* lock_tree = NULL; lock_item = proto_tree_add_item(tree, hf_klm_lock, tvb, offset, -1, ENC_NA); lock_tree = proto_item_add_subtree(lock_item, ett_klm_lock); offset = dissect_rpc_string(tvb, lock_tree, hf_klm_servername, offset, NULL); offset = dissect_nfs3_fh(tvb, offset, pinfo, lock_tree,"fh", NULL, civ); offset = dissect_rpc_uint32(tvb, lock_tree, hf_klm_pid, offset); offset = dissect_rpc_uint32(tvb, lock_tree, hf_klm_offset, offset); offset = dissect_rpc_uint32(tvb, lock_tree, hf_klm_len, offset); return offset; }
static int gluster_gd_mgmt_probe_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { offset = gluster_gd_mgmt_dissect_uuid(tvb, tree, hf_glusterd_uuid, offset); offset = dissect_rpc_string(tvb, tree, hf_glusterd_hostname, offset, NULL); offset = dissect_rpc_uint32(tvb, tree, hf_glusterd_port, offset); offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree); return offset; }
/* **************************** */ static int dissect_lock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int version, int offset) { proto_item* lock_item = NULL; proto_tree* lock_tree = NULL; guint32 fh_hash, svid, start_offset=0, end_offset=0; if (tree) { lock_item = proto_tree_add_item(tree, hf_nlm_lock, tvb, offset, -1, ENC_NA); if (lock_item) lock_tree = proto_item_add_subtree(lock_item, ett_nlm_lock); } offset = dissect_rpc_string(tvb,lock_tree, hf_nlm_lock_caller_name, offset, NULL); offset = dissect_nfs3_fh(tvb, offset, pinfo, lock_tree, "fh", &fh_hash); if (check_col(pinfo->cinfo, COL_INFO)) { col_append_fstr(pinfo->cinfo, COL_INFO, " FH:0x%08x", fh_hash); } offset = dissect_rpc_data(tvb, lock_tree, hf_nlm_lock_owner, offset); svid = tvb_get_ntohl(tvb, offset); offset = dissect_rpc_uint32(tvb, lock_tree, hf_nlm_lock_svid, offset); if (check_col(pinfo->cinfo, COL_INFO)) { col_append_fstr(pinfo->cinfo, COL_INFO, " svid:%d", svid); } if (version == 4) { start_offset = tvb_get_ntohl(tvb, offset); offset = dissect_rpc_uint64(tvb, lock_tree, hf_nlm_lock_l_offset64, offset); end_offset = tvb_get_ntohl(tvb, offset); offset = dissect_rpc_uint64(tvb, lock_tree, hf_nlm_lock_l_len64, offset); } else { start_offset = tvb_get_ntohl(tvb, offset); offset = dissect_rpc_uint32(tvb, lock_tree, hf_nlm_lock_l_offset, offset); end_offset = tvb_get_ntohl(tvb, offset); offset = dissect_rpc_uint32(tvb, lock_tree, hf_nlm_lock_l_len, offset); } if (check_col(pinfo->cinfo, COL_INFO)) { col_append_fstr(pinfo->cinfo, COL_INFO, " pos:%d-%d", start_offset, end_offset); } return offset; }
static int dissect_mount_dirpath_call(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { char *mountpoint=NULL; if((!pinfo->fd->flags.visited) && nfs_file_name_snooping){ rpc_call_info_value *civ=pinfo->private_data; if(civ->request && (civ->proc==1)){ const gchar *host; unsigned char *name; int len; unsigned char *ptr; host=ip_to_str(pinfo->dst.data); len=tvb_get_ntohl(tvb, offset); if (len >= ITEM_LABEL_LENGTH) THROW(ReportedBoundsError); name=g_malloc(strlen(host)+1+len+1+200); ptr=name; memcpy(ptr, host, strlen(host)); ptr+=strlen(host); *ptr++=':'; tvb_memcpy(tvb, ptr, offset+4, len); ptr+=len; *ptr=0; nfs_name_snoop_add_name(civ->xid, tvb, -1, (gint)strlen(name), 0, 0, name); } } offset = dissect_rpc_string(tvb,tree,hf_mount_path,offset,&mountpoint); if (check_col(pinfo->cinfo, COL_INFO)) { col_append_fstr(pinfo->cinfo, COL_INFO," %s", mountpoint); } return offset; }
static int dissect_mount_dirpath_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { const char *mountpoint=NULL; int offset = 0; if((!pinfo->fd->visited) && nfs_file_name_snooping){ rpc_call_info_value *civ=(rpc_call_info_value *)data; if(civ->request && (civ->proc==1)){ guint32 len_field; len_field = tvb_get_ntohl(tvb, offset); if (len_field < ITEM_LABEL_LENGTH) { gchar *name, *ptr; int addr_len, name_len; name = address_to_str(wmem_packet_scope(), &pinfo->dst); addr_len = (int)strlen(name); /* IP address, colon, path, terminating 0 */ name_len = addr_len + 1 + len_field + 1; name = (gchar *)wmem_realloc(wmem_packet_scope(), (void *)name, name_len); ptr = name + addr_len; *ptr++ = ':'; tvb_memcpy(tvb, ptr, offset+4, len_field); ptr += len_field; *ptr = 0; nfs_name_snoop_add_name(civ->xid, tvb, -1, name_len, 0, 0, name); } } } offset = dissect_rpc_string(tvb,tree,hf_mount_path,offset,&mountpoint); col_append_fstr(pinfo->cinfo, COL_INFO," %s", mountpoint); return offset; }
static int dissect_create_link_parms(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { char *str; offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_client_id, offset); offset = dissect_rpc_bool(tvb, tree, hf_vxi11_core_lock_device, offset); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_lock_timeout, offset); offset = dissect_rpc_string(tvb, tree, hf_vxi11_core_device, offset, &str); if (tree) { proto_item_append_text(tree, " (Create_LinkParms) %s", str); } col_append_fstr(pinfo->cinfo, COL_INFO, " %s", str); return offset; }
static int hf_yppasswd_newpw_gid = -1; static int hf_yppasswd_newpw_gecos = -1; static int hf_yppasswd_newpw_dir = -1; static int hf_yppasswd_newpw_shell = -1; static gint ett_yppasswd = -1; static gint ett_yppasswd_newpw = -1; static int dissect_yppasswd_call(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) { proto_item *lock_item = NULL; proto_tree *lock_tree = NULL; int offset = 0; offset = dissect_rpc_string(tvb, tree, hf_yppasswd_oldpass, offset, NULL); lock_item = proto_tree_add_item(tree, hf_yppasswd_newpw, tvb, offset, -1, ENC_NA); lock_tree = proto_item_add_subtree(lock_item, ett_yppasswd_newpw); offset = dissect_rpc_string(tvb, lock_tree, hf_yppasswd_newpw_name, offset, NULL); offset = dissect_rpc_string(tvb, lock_tree, hf_yppasswd_newpw_passwd, offset, NULL); offset = dissect_rpc_uint32(tvb, lock_tree, hf_yppasswd_newpw_uid, offset); offset = dissect_rpc_uint32(tvb, lock_tree, hf_yppasswd_newpw_gid, offset); offset = dissect_rpc_string(tvb, lock_tree,
} /* Dissectors for individual RPC requests and responses. */ static int dissect_create_link_parms(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data _U_) { const char *str; offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_client_id, offset); offset = dissect_rpc_bool(tvb, tree, hf_vxi11_core_lock_device, offset); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_lock_timeout, offset); offset = dissect_rpc_string(tvb, tree, hf_vxi11_core_device, offset, &str); if (tree) { proto_item_append_text(tree, " (Create_LinkParms) %s", str); } col_append_fstr(pinfo->cinfo, COL_INFO, " %s", str); return offset; } static int dissect_create_link_resp(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
}; static header_field_info hfi_rwall_procedure_v1 RWALL_HFI_INIT = { "V1 Procedure", "rwall.procedure_v1", FT_UINT32, BASE_DEC, VALS(rwall1_proc_vals), 0, NULL, HFILL }; static header_field_info hfi_rwall_message RWALL_HFI_INIT = { "Message", "rwall.message", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }; static gint ett_rwall = -1; static int dissect_rwall_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) { offset = dissect_rpc_string(tvb, tree, hfi_rwall_message.id, offset, NULL); return offset; } static const vsff rwall1_proc[] = { { RWALL_WALL, "RWALL", dissect_rwall_call, NULL }, { 0, NULL, NULL, NULL } }; void proto_register_rwall(void) { #ifndef HAVE_HFI_SECTION_INIT static header_field_info *hfi[] = { &hfi_rwall_procedure_v1,
break; default: break; } return offset; } static int dissect_getfile_call(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) { int offset = 0; offset = dissect_rpc_string(tvb, tree, hf_bootparams_host, offset, NULL); offset = dissect_rpc_string(tvb, tree, hf_bootparams_fileid, offset, NULL); return offset; } static int dissect_getfile_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) { int offset = 0; offset = dissect_rpc_string(tvb, tree, hf_bootparams_host, offset, NULL); offset = dissect_bp_address(tvb, offset, tree, hf_bootparams_hostaddr); offset = dissect_rpc_string(tvb, tree, hf_bootparams_filepath, offset, NULL); return offset;
#include "packet-stat-notify.h" static int proto_statnotify = -1; static int hf_statnotify_procedure_v1 = -1; static int hf_statnotify_name = -1; static int hf_statnotify_state = -1; static int hf_statnotify_priv = -1; static gint ett_statnotify = -1; static int dissect_statnotify_mon(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) { offset = dissect_rpc_string(tvb,tree,hf_statnotify_name,offset,NULL); offset = dissect_rpc_uint32(tvb,tree,hf_statnotify_state,offset); proto_tree_add_item(tree,hf_statnotify_priv,tvb,offset,16,ENC_NA); offset += 16; return offset; } /* proc number, "proc name", dissect_request, dissect_reply */ /* NULL as function pointer means: type of arguments is "void". */ static const vsff statnotify1_proc[] = { { 0, "NULL", NULL, NULL }, { STATNOTIFYPROC_MON, "MON-CALLBACK",
/* RFC 1813, Page 110 */ static int dissect_mountlist(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) { proto_item* lock_item; proto_tree* lock_tree; int old_offset = offset; const char* hostname; const char* directory; lock_item = proto_tree_add_item(tree, hf_mount_mountlist, tvb, offset, -1, ENC_NA); lock_tree = proto_item_add_subtree(lock_item, ett_mount_mountlist); offset = dissect_rpc_string(tvb, lock_tree, hf_mount_mountlist_hostname, offset, &hostname); offset = dissect_rpc_string(tvb, lock_tree, hf_mount_mountlist_directory, offset, &directory); if (lock_item) { /* now we have a nicer string */ proto_item_set_text(lock_item, "Mount List Entry: %s:%s", hostname, directory); /* now we know, that mountlist is shorter */ proto_item_set_len(lock_item, offset - old_offset); } return offset; } /* RFC 1094, Page 26 */
static int hf_ypbind_procedure_v2 = -1; static int hf_ypbind_domain = -1; static int hf_ypbind_resp_type = -1; static int hf_ypbind_error = -1; static int hf_ypbind_addr = -1; static int hf_ypbind_port = -1; static int hf_ypbind_setdom_version = -1; static gint ett_ypbind = -1; static int dissect_ypbind_domain_v2_request(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) { /* domain */ offset = dissect_rpc_string(tvb, tree, hf_ypbind_domain, offset, NULL); return offset; } #define YPBIND_RESP_TYPE_SUCC_VAL 1 #define YPBIND_RESP_TYPE_FAIL_VAL 2 static const value_string resp_type_vals[] = { {YPBIND_RESP_TYPE_SUCC_VAL, "SUCC_VAL"}, {YPBIND_RESP_TYPE_FAIL_VAL, "FAIL_VAL"}, {0, NULL} }; #define YPBIND_ERROR_ERR 1 #define YPBIND_ERROR_NOSERV 2 #define YPBIND_ERROR_RESC 3
*/ static int gluster_dump_reply_detail(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) { proto_item *detail_item; proto_tree *detail_tree; gchar *progname = NULL; detail_item = proto_tree_add_text(tree, tvb, offset, -1, "Available Progam: "); detail_tree = proto_item_add_subtree(detail_item, ett_gluster_dump_detail); /* progname */ offset = dissect_rpc_string(tvb, detail_tree, hf_gluster_progname, offset, &progname); if (tree) proto_item_append_text(detail_item, "%s", progname); /* prognumber (marked as uint64) */ offset = dissect_rpc_uint64(tvb, detail_tree, hf_gluster_prognum, offset); /* progversion (marked as uint64) */ offset = dissect_rpc_uint64(tvb, detail_tree, hf_gluster_progver, offset); return offset; } static int gluster_dump_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
&hostname); offset = dissect_rpc_uint32(tvb, tree, hf_glusterd_port, offset); offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree); return offset; } static int gluster_gd_mgmt_probe_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) { gchar *hostname = NULL; offset = gluster_gd_mgmt_dissect_uuid(tvb, tree, hf_glusterd_uuid, offset); offset = dissect_rpc_string(tvb, tree, hf_glusterd_hostname, offset, &hostname); offset = dissect_rpc_uint32(tvb, tree, hf_glusterd_port, offset); return offset; } static int gluster_gd_mgmt_friend_add_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { gchar *hostname = NULL; offset = gluster_gd_mgmt_dissect_uuid(tvb, tree, hf_glusterd_uuid, offset); offset = dissect_rpc_string(tvb, tree, hf_glusterd_hostname, offset, &hostname);
{ 0, "VTC_MODE_NONE" }, { 1, "VTC_MODE_1" }, { 2, "VTC_MODE_2" }, { 3, "VTC_MODE_3" }, { 4, "VTC_MODE_4" }, { 5, "VTC_MODE_5" }, { 6, "VTC_MODE_6" }, { 7, "VTC_MODE_EVENT_CNT_LAT" }, { 0, NULL }, }; static int dissect_teklink_tlaframeopen_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) { offset = dissect_rpc_uint32(tvb, tree, hf_teklink_unknown_long, offset); offset = dissect_rpc_string(tvb, tree, hf_teklink_unknown_string, offset, NULL); offset = dissect_rpc_string(tvb, tree, hf_teklink_unknown_string, offset, NULL); offset = dissect_rpc_string(tvb, tree, hf_teklink_unknown_string, offset, NULL); return offset; } static int dissect_teklink_tlaframeclose_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) { offset = dissect_rpc_uint32(tvb, tree, hf_teklink_unknown_long, offset); return offset; } static int dissect_teklink_tlaframeclose_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
static int dissect_pcnfsd_username(tvbuff_t *tvb, int offset, proto_tree *tree) { return dissect_rpc_string(tvb, tree, hf_pcnfsd_username, offset, NULL); }