int len, guint16 fid, gboolean is_created, gboolean is_closed, gboolean is_generated)
{
smb_info_t *si = pinfo->private_data;
+ smb_saved_info_t *sip = si->sip;
proto_item *it;
proto_tree *tr;
smb_fid_info_t *fid_info=NULL;
return NULL;
}
+ /* Store the fid in the transaction structure and remember if
+ it was in the request or in the reply we saw it
+ */
+ if(sip && (!is_generated) && (!pinfo->fd->flags.visited)) {
+ sip->fid=fid;
+ if(si->request){
+ sip->fid_seen_in_request=TRUE;
+ } else {
+ sip->fid_seen_in_request=FALSE;
+ }
+ }
+
if((!pinfo->fd->flags.visited) && is_closed){
fid_info->closed_in=pinfo->fd->num;
}
dissect_smb_command(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *smb_tree, guint8 cmd, gboolean first_pdu)
{
smb_info_t *si;
+ smb_saved_info_t *sip;
si = pinfo->private_data;
DISSECTOR_ASSERT(si);
cmd_tree = proto_item_add_subtree(cmd_item, ett_smb_command);
+ /* we track FIDs on a per transaction basis.
+ if this was a request and the fid was seen in a reply
+ we add a "generated" fid tree for this pdu and v.v.
+ */
+ sip = si->sip;
+ if (sip && sip->fid) {
+ if( (si->request && (!sip->fid_seen_in_request))
+ ||((!si->request) && sip->fid_seen_in_request) ){
+ dissect_smb_fid(tvb, pinfo, cmd_tree, offset, 0, sip->fid, FALSE, FALSE, TRUE);
+ }
+ }
+
dissector = (si->request)?
smb_dissector[cmd].request:smb_dissector[cmd].response;
sip->cmd = si->cmd;
sip->extra_info = NULL;
sip->extra_info_type = SMB_EI_NONE;
+ sip->fid=0;
+ sip->fid_seen_in_request=0;
g_hash_table_insert(si->ct->unmatched, GUINT_TO_POINTER(pid_mid), sip);
new_key = se_alloc(sizeof(smb_saved_info_key_t));
new_key->frame = sip->frame_req;
SMB_EI_FILEDATA, /* fid tracking */
SMB_EI_UID /* smb_uid_t */
} smb_extra_info_t;
+typedef struct _smb_fid_into_t smb_fid_info_t;
typedef struct {
guint32 frame_req, frame_res;
nstime_t req_time;
guint8 cmd;
void *extra_info;
smb_extra_info_t extra_info_type;
+ /* we save the fid in each transaction so that we can get fid filters
+ to match both request and response */
+ gboolean fid_seen_in_request;
+ guint16 fid;
} smb_saved_info_t;
/*
guint32 share_access;
guint32 create_options;
} smb_fid_saved_info_t;
-typedef struct _smb_fid_into_t {
+struct _smb_fid_into_t {
int opened_in;
int closed_in;
int type;
smb_fid_saved_info_t *fsi;
-} smb_fid_info_t;
+};
/* used for tracking tid to sharename openedframe closedframe */
typedef struct _smb_tid_into_t {