Moved dissect_ndr_nt_NTTIME() from packet-dcerpc-samr.c to packet-dcerpc-nt.c

since this function will be used by other NT services as well such as NETLOGON.

svn path=/trunk/; revision=4918
This commit is contained in:
Ronnie Sahlberg 2002-03-10 23:24:48 +00:00
parent 37dd5f340c
commit 853654f2f3
3 changed files with 34 additions and 30 deletions

View File

@ -2,7 +2,7 @@
* Routines for DCERPC over SMB packet disassembly
* Copyright 2001, Tim Potter <tpot@samba.org>
*
* $Id: packet-dcerpc-nt.c,v 1.11 2002/03/10 22:04:25 guy Exp $
* $Id: packet-dcerpc-nt.c,v 1.12 2002/03/10 23:24:48 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -32,6 +32,7 @@
#include "packet-dcerpc.h"
#include "packet-dcerpc-nt.h"
#include "smb.h"
#include "packet-smb-common.h" /* for dissect_smb_64bit_time() */
/*
* This file contains helper routines that are used by the DCERPC over SMB
@ -529,3 +530,29 @@ dissect_ndr_nt_UNICODE_STRING(tvbuff_t *tvb, int offset,
return offset;
}
/* UNICODE_STRING END */
/* This function is used to dissect a DCERPC encoded 64 bit time value.
XXX it should be fixed both here and in dissect_smb_64bit_time so
it can handle both BIG and LITTLE endian encodings
*/
int
dissect_ndr_nt_NTTIME (tvbuff_t *tvb, int offset,
packet_info *pinfo, proto_tree *tree,
char *drep, int hf_index)
{
dcerpc_info *di;
di=pinfo->private_data;
if(di->conformant_run){
/*just a run to handle conformant arrays, nothing to dissect */
return offset;
}
ALIGN_TO_4_BYTES;
offset = dissect_smb_64bit_time(tvb, pinfo, tree, offset,
hf_index);
return offset;
}

View File

@ -2,7 +2,7 @@
* Routines for DCERPC over SMB packet disassembly
* Copyright 2001, Tim Potter <tpot@samba.org>
*
* $Id: packet-dcerpc-nt.h,v 1.7 2002/03/10 21:30:10 guy Exp $
* $Id: packet-dcerpc-nt.h,v 1.8 2002/03/10 23:24:48 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -87,5 +87,9 @@ dissect_ndr_nt_UNICODE_STRING(tvbuff_t *tvb, int offset,
int
dissect_ndr_nt_acct_ctrl(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *parent_tree, char *drep);
int
dissect_ndr_nt_NTTIME (tvbuff_t *tvb, int offset,
packet_info *pinfo, proto_tree *tree,
char *drep, int hf_index);
#endif /* packet-dcerpc-nt.h */

View File

@ -3,7 +3,7 @@
* Copyright 2001, Tim Potter <tpot@samba.org>
* 2002 Added all command dissectors Ronnie Sahlberg
*
* $Id: packet-dcerpc-samr.c,v 1.20 2002/03/10 22:04:25 guy Exp $
* $Id: packet-dcerpc-samr.c,v 1.21 2002/03/10 23:24:48 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -273,33 +273,6 @@ dissect_ndr_nt_STRING (tvbuff_t *tvb, int offset,
return offset;
}
/* This should get fixed both here and in dissect_smb_64bit_time so
one can handle both BIG and LITTLE endian encodings
*/
int dissect_smb_64bit_time(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset, int hf_date);
int
dissect_ndr_nt_NTTIME (tvbuff_t *tvb, int offset,
packet_info *pinfo, proto_tree *tree,
char *drep, int hf_index)
{
dcerpc_info *di;
di=pinfo->private_data;
if(di->conformant_run){
/*just a run to handle conformant arrays, nothing to dissect */
return offset;
}
/* align to 4 byte boundary */
if(offset&0x03){
offset = (offset&0xfffffffc)+4;
}
offset = dissect_smb_64bit_time(tvb, pinfo, tree, offset,
hf_index);
return offset;
}
static int
samr_dissect_SID(tvbuff_t *tvb, int offset,
packet_info *pinfo, proto_tree *tree,