aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>2005-10-19 14:28:26 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>2005-10-19 14:28:26 +0000
commitab3f0deefcfb20d2fd92ddcbe8266e7632fde627 (patch)
tree974e8ddd8040d46babaddada5a0b4c81e4ac2cc7
parent364702618a921be44f950a138f0c8c1170ce18cd (diff)
From Greg Morris:
makefile.common.diff - epan directory 1. Adds new packet-ncp-sss.c and packet-ncp-sss.h for new Secret Store dissector New Novell Secret Store Services dissector packet-ncp-sss.c packet-ncp-sss.h ncp2222.py.diff 1. Adds a number of return values 2. Adds 64bit file size support 3. Add NCP 89,xx NCP's for UTF8 support 4. Fixes a number of field values for proper dissection 5. Adds support for Secret Store dissector packet-ncp2222.inc.diff 1. Skwelches some compiler warnings 2. Redo of fix for bug 535 which original fix broke dissection of NDS verb 5 3. Adds support for Secret Store dissector 4. Adds expert data 5. Adds tap for service response time 6. Fixes dissection of stream attribute 7. Fixes defragmentation problem with more then 10 fragments 8. Fixes NDS dissection if reply buffer was less then 7 packet-ncp.c.diff 1. Adds tap data 2. Adds expert data 3. Fixes calculation for NCP connection number 4. Fixes malformed packet for destroy service connection packet-ncp.c.diff 1. Adds tap data svn path=/trunk/; revision=16266
-rw-r--r--epan/dissectors/Makefile.common2
-rw-r--r--epan/dissectors/ncp2222.py1423
-rw-r--r--epan/dissectors/packet-ncp-int.h29
-rw-r--r--epan/dissectors/packet-ncp-sss.c977
-rw-r--r--epan/dissectors/packet-ncp-sss.h36
-rw-r--r--epan/dissectors/packet-ncp.c51
-rw-r--r--epan/dissectors/packet-ncp2222.inc242
7 files changed, 2500 insertions, 260 deletions
diff --git a/epan/dissectors/Makefile.common b/epan/dissectors/Makefile.common
index 74799d07cf..6671587329 100644
--- a/epan/dissectors/Makefile.common
+++ b/epan/dissectors/Makefile.common
@@ -431,6 +431,7 @@ DISSECTOR_SRC = \
packet-ncp.c \
packet-ncp2222.c \
packet-ncp-nmas.c \
+ packet-ncp-sss.c \
packet-ndmp.c \
packet-ndps.c \
packet-netbios.c \
@@ -784,6 +785,7 @@ DISSECTOR_INCLUDES = \
packet-mtp3.h \
packet-ncp-int.h \
packet-ncp-nmas.h \
+ packet-ncp-sss.h \
packet-ndps.h \
packet-netbios.h \
packet-nfs.h \
diff --git a/epan/dissectors/ncp2222.py b/epan/dissectors/ncp2222.py
index 76fc22179f..15368e0f91 100644
--- a/epan/dissectors/ncp2222.py
+++ b/epan/dissectors/ncp2222.py
@@ -58,6 +58,7 @@ packets = []
compcode_lists = None
ptvc_lists = None
msg = None
+reply_var = None
REC_START = 0
REC_LENGTH = 1
@@ -190,7 +191,7 @@ class PTVC(NamedList):
for record in records:
offset = record[REC_START]
length = record[REC_LENGTH]
- field = record[REC_FIELD]
+ field = record[REC_FIELD]
endianness = record[REC_ENDIANNESS]
# Variable
@@ -871,6 +872,12 @@ class uint32(Type, CountingNumber):
def __init__(self, abbrev, descr, endianness = LE):
Type.__init__(self, abbrev, descr, 4, endianness)
+class uint64(Type, CountingNumber):
+ type = "uint64"
+ ftype = "FT_UINT64"
+ def __init__(self, abbrev, descr, endianness = LE):
+ Type.__init__(self, abbrev, descr, 8, endianness)
+
class boolean8(uint8):
type = "boolean8"
ftype = "FT_BOOLEAN"
@@ -1250,10 +1257,11 @@ AddNameSpaceAndVol = stringz("add_nm_spc_and_vol", "Add Name Space
AFPEntryID = uint32("afp_entry_id", "AFP Entry ID", BE)
AFPEntryID.Display("BASE_HEX")
AllocAvailByte = uint32("alloc_avail_byte", "Bytes Available for Allocation")
-AllocateMode = val_string16("allocate_mode", "Allocate Mode", [
- [ 0x0000, "Permanent Directory Handle" ],
- [ 0x0001, "Temporary Directory Handle" ],
- [ 0x0002, "Special Temporary Directory Handle" ],
+AllocateMode = bitfield16("alloc_mode", "Allocate Mode", [
+ bf_boolean16(0x0001, "alloc_dir_hdl", "Temporary (True) or Permanent (False) Dir Handle"),
+ bf_boolean16(0x0002, "alloc_spec_temp_dir_hdl","Special Temporary Directory Handle"),
+ bf_boolean16(0x4000, "alloc_reply_lvl2","Reply Level 2"),
+ bf_boolean16(0x8000, "alloc_dst_name_spc","Destination Name Space Input Parameter"),
])
AllocationBlockSize = uint32("allocation_block_size", "Allocation Block Size")
AllocFreeCount = uint32("alloc_free_count", "Reclaimable Free Bytes")
@@ -1297,11 +1305,12 @@ AttributesDef32 = bitfield32("attr_def_32", "Attributes", [
bf_boolean32(0x00000008, "att_def32_execute", "Execute"),
bf_boolean32(0x00000010, "att_def32_sub_only", "Subdirectory"),
bf_boolean32(0x00000020, "att_def32_archive", "Archive"),
+ bf_boolean32(0x00000040, "att_def32_execute_confirm", "Execute Confirm"),
bf_boolean32(0x00000080, "att_def32_shareable", "Shareable"),
bf_boolean32(0x00001000, "att_def32_transaction", "Transactional"),
bf_boolean32(0x00004000, "att_def32_read_audit", "Read Audit"),
bf_boolean32(0x00008000, "att_def32_write_audit", "Write Audit"),
- bf_boolean32(0x00010000, "att_def_purge", "Purge"),
+ bf_boolean32(0x00010000, "att_def_purge", "Immediate Purge"),
bf_boolean32(0x00020000, "att_def_reninhibit", "Rename Inhibit"),
bf_boolean32(0x00040000, "att_def_delinhibit", "Delete Inhibit"),
bf_boolean32(0x00080000, "att_def_cpyinhibit", "Copy Inhibit"),
@@ -1354,7 +1363,7 @@ BusType = val_string8("bus_type", "Bus Type", [
[0x04, "PCI"],
[0x08, "PCMCIA"],
[0x10, "ISA"],
- [0x14, "ISA"],
+ [0x14, "ISA/PCI"],
])
BytesActuallyTransferred = uint32("bytes_actually_transferred", "Bytes Actually Transferred")
BytesRead = fw_string("bytes_read", "Bytes Read", 6)
@@ -1391,7 +1400,7 @@ ChangeBits = bitfield16("change_bits", "Change Bits", [
bf_boolean16(0x0020, "change_bits_adate", "Archive Date"),
bf_boolean16(0x0040, "change_bits_atime", "Archive Time"),
bf_boolean16(0x0080, "change_bits_aid", "Archiver ID"),
- bf_boolean16(0x0100, "change_bits_udate", "Update Date"),
+ bf_boolean16(0x0100, "change_bits_udate", "Update Date"),
bf_boolean16(0x0200, "change_bits_utime", "Update Time"),
bf_boolean16(0x0400, "change_bits_uid", "Update ID"),
bf_boolean16(0x0800, "change_bits_acc_date", "Access Date"),
@@ -1567,11 +1576,17 @@ DataStream = val_string8("data_stream", "Data Stream", [
[ 0x00, "Resource Fork or DOS" ],
[ 0x01, "Data Fork" ],
])
+DataStreamFATBlocks = uint32("data_stream_fat_blks", "Data Stream FAT Blocks")
DataStreamName = nstring8("data_stream_name", "Data Stream Name")
DataStreamNumber = uint8("data_stream_number", "Data Stream Number")
+DataStreamNumberLong = uint32("data_stream_num_long", "Data Stream Number")
DataStreamsCount = uint32("data_streams_count", "Data Streams Count")
DataStreamSize = uint32("data_stream_size", "Size")
DataStreamSpaceAlloc = uint32( "data_stream_space_alloc", "Space Allocated for Data Stream" )
+DataTypeFlag = val_string8("data_type_flag", "Data Type Flag", [
+ [ 0x00, "ASCII Data" ],
+ [ 0x01, "UTF8 Data" ],
+])
Day = uint8("s_day", "Day")
DayOfWeek = val_string8("s_day_of_week", "Day of Week", [
[ 0x00, "Sunday" ],
@@ -1601,7 +1616,7 @@ DenyReadCount = uint16("deny_read_count", "Deny Read Count")
DenyWriteCount = uint16("deny_write_count", "Deny Write Count")
DescriptionStrings = fw_string("description_string", "Description", 100)
DesiredAccessRights = bitfield16("desired_access_rights", "Desired Access Rights", [
- bf_boolean16(0x0001, "dsired_acc_rights_read_o", "Read Only"),
+ bf_boolean16(0x0001, "dsired_acc_rights_read_o", "Read Only"),
bf_boolean16(0x0002, "dsired_acc_rights_write_o", "Write Only"),
bf_boolean16(0x0004, "dsired_acc_rights_deny_r", "Deny Read"),
bf_boolean16(0x0008, "dsired_acc_rights_deny_w", "Deny Write"),
@@ -1988,9 +2003,9 @@ ExtAttrKeySize = uint32("ext_attr_key_size", "Extended Attributes Key Size")
ExtendedAttributesDefined = uint32("extended_attributes_defined", "Extended Attributes Defined")
ExtendedAttributeExtantsUsed = uint32("extended_attribute_extants_used", "Extended Attribute Extants Used")
ExtendedInfo = bitfield16("ext_info", "Extended Return Information", [
- bf_boolean16(0x0001, "ext_info_update", "Update"),
+ bf_boolean16(0x0001, "ext_info_update", "Last Update"),
bf_boolean16(0x0002, "ext_info_dos_name", "DOS Name"),
- bf_boolean16(0x0004, "ext_info_flush", "Flush"),
+ bf_boolean16(0x0004, "ext_info_flush", "Flush Time"),
bf_boolean16(0x0008, "ext_info_parental", "Parental"),
bf_boolean16(0x0010, "ext_info_mac_finder", "MAC Finder"),
bf_boolean16(0x0020, "ext_info_sibling", "Sibling"),
@@ -2157,14 +2172,16 @@ FileMode = uint8("file_mode", "File Mode")
FileName = nstring8("file_name", "Filename")
FileName12 = fw_string("file_name_12", "Filename", 12)
FileName14 = fw_string("file_name_14", "Filename", 14)
+FileName16 = nstring16("file_name_16", "Filename")
FileNameLen = uint8("file_name_len", "Filename Length")
FileOffset = uint32("file_offset", "File Offset")
FilePath = nstring8("file_path", "File Path")
FileSize = uint32("file_size", "File Size", BE)
-FileSize64bit = bytes("f_size_64bit", "64bit File Size", 64)
+FileSize64bit = uint64("f_size_64bit", "64bit File Size")
FileSystemID = uint8("file_system_id", "File System ID")
FileTime = uint16("file_time", "File Time")
FileTime.NWTime()
+FileUseCount = uint16("file_use_count", "File Use Count")
FileWriteFlags = val_string8("file_write_flags", "File Write Flags", [
[ 0x01, "Writing" ],
[ 0x02, "Write aborted" ],
@@ -2298,7 +2315,7 @@ InfoMask = bitfield32("info_mask", "Information Mask", [
bf_boolean32(0x80000000, "info_mask_name", "Name"),
])
InheritedRightsMask = bitfield16("inherited_rights_mask", "Inherited Rights Mask", [
- bf_boolean16(0x0001, "inh_rights_read", "Read Rights"),
+ bf_boolean16(0x0001, "inh_rights_read", "Read Rights"),
bf_boolean16(0x0002, "inh_rights_write", "Write Rights"),
bf_boolean16(0x0004, "inh_rights_open", "Open Rights"),
bf_boolean16(0x0008, "inh_rights_create", "Create Rights"),
@@ -2548,6 +2565,15 @@ Level = uint8("level", "Level")
LFSCounters = uint32("lfs_counters", "LFS Counters")
LimboDataStreamsCount = uint32("limbo_data_streams_count", "Limbo Data Streams Count")
limbCount = uint32("limb_count", "Limb Count")
+limbFlags = bitfield32("limb_flags", "Limb Flags", [
+ bf_boolean32(0x00000002, "scan_entire_folder", "Wild Search"),
+ bf_boolean32(0x00000004, "scan_files_only", "Scan Files Only"),
+ bf_boolean32(0x00000008, "scan_folders_only", "Scan Folders Only"),
+ bf_boolean32(0x00000010, "allow_system", "Allow System Files and Folders"),
+ bf_boolean32(0x00000020, "allow_hidden", "Allow Hidden Files and Folders"),
+])
+
+limbScanNum = uint32("limb_scan_num", "Limb Scan Number")
LimboUsed = uint32("limbo_used", "Limbo Used")
LoadedNameSpaces = uint8("loaded_name_spaces", "Loaded Name Spaces")
LocalConnectionID = uint32("local_connection_id", "Local Connection ID")
@@ -2661,6 +2687,7 @@ MediaList = uint32("media_list", "Media List")
MediaListCount = uint32("media_list_count", "Media List Count")
MediaName = nstring8("media_name", "Media Name")
MediaNumber = uint32("media_number", "Media Number")
+MaxReplyObjectIDCount = uint8("max_reply_obj_id_count", "Max Reply Object ID Count")
MediaObjectType = val_string8("media_object_type", "Object Type", [
[ 0x00, "Adapter" ],
[ 0x01, "Changer" ],
@@ -2757,16 +2784,6 @@ Name12 = fw_string("name12", "Name", 12)
NameLen = uint8("name_len", "Name Space Length")
NameLength = uint8("name_length", "Name Length")
NameList = uint32("name_list", "Name List")
-#
-# XXX - should this value be used to interpret the characters in names,
-# search patterns, and the like?
-#
-# We need to handle character sets better, e.g. translating strings
-# from whatever character set they are in the packet (DOS/Windows code
-# pages, ISO character sets, UNIX EUC character sets, UTF-8, UCS-2/Unicode,
-# Mac character sets, etc.) into UCS-4 or UTF-8 and storing them as such
-# in the protocol tree, and displaying them as best we can.
-#
NameSpace = val_string8("name_space", "Name Space", [
[ 0x00, "DOS" ],
[ 0x01, "MAC" ],
@@ -2974,6 +2991,7 @@ NumberOfAllocs = uint32("num_of_allocs", "Number of Allocations")
NumberOfAttributes = uint32("number_of_attributes", "Number of Attributes")
NumberOfCPUs = uint32("number_of_cpus", "Number of CPU's")
NumberOfDataStreams = uint16("number_of_data_streams", "Number of Data Streams")
+NumberOfDataStreamsLong = uint32("number_of_data_streams_long", "Number of Data Streams")
NumberOfDynamicMemoryAreas = uint16("number_of_dynamic_memory_areas", "Number Of Dynamic Memory Areas")
NumberOfEntries = uint8("number_of_entries", "Number of Entries")
NumberOfLocks = uint8("number_of_locks", "Number of Locks")
@@ -3134,6 +3152,8 @@ OpenCreateMode = bitfield8("open_create_mode", "Open Create Mode", [
bf_boolean8(0x01, "open_create_mode_open", "Open existing file (file must exist)"),
bf_boolean8(0x02, "open_create_mode_replace", "Replace existing file"),
bf_boolean8(0x08, "open_create_mode_create", "Create new file or subdirectory (file or subdirectory cannot exist)"),
+ bf_boolean8(0x20, "open_create_mode_64bit", "Open 64-bit Access"),
+ bf_boolean8(0x40, "open_create_mode_ro", "Open with Read Only Access"),
bf_boolean8(0x80, "open_create_mode_oplock", "Open Callback (Op-Lock)"),
])
OpenForReadCount = uint16("open_for_read_count", "Open For Read Count")
@@ -3144,7 +3164,7 @@ OpenRights = bitfield8("open_rights", "Open Rights", [
bf_boolean8(0x04, "open_rights_deny_read", "Deny Read"),
bf_boolean8(0x08, "open_rights_deny_write", "Deny Write"),
bf_boolean8(0x10, "open_rights_compat", "Compatibility"),
- bf_boolean8(0x40, "open_rights_write_thru", "Write Through"),
+ bf_boolean8(0x40, "open_rights_write_thru", "File Write Through"),
])
OptionNumber = uint8("option_number", "Option Number")
originalSize = uint32("original_size", "Original Size")
@@ -3181,6 +3201,7 @@ PathCookieFlags = val_string16("path_cookie_flags", "Path Cookie Flags", [
])
PathCount = uint8("path_count", "Path Count")
Path = nstring8("path", "Path")
+Path16 = nstring16("path16", "Path")
PathAndName = stringz("path_and_name", "Path and Name")
PendingIOCommands = uint16("pending_io_commands", "Pending IO Commands")
PhysicalDiskNumber = uint8("physical_disk_number", "Physical Disk Number")
@@ -3337,6 +3358,7 @@ Reserved = uint8( "reserved", "Reserved" )
Reserved2 = bytes("reserved2", "Reserved", 2)
Reserved3 = bytes("reserved3", "Reserved", 3)
Reserved4 = bytes("reserved4", "Reserved", 4)
+Reserved5 = bytes("reserved5", "Reserved", 5)
Reserved6 = bytes("reserved6", "Reserved", 6)
Reserved8 = bytes("reserved8", "Reserved", 8)
Reserved10 = bytes("reserved10", "Reserved", 10)
@@ -3364,7 +3386,7 @@ RestrictionsEnforced = val_string8("restrictions_enforced", "Disk Restrictions
])
ReturnInfoCount = uint32("return_info_count", "Return Information Count")
ReturnInfoMask = bitfield16("ret_info_mask", "Return Information", [
- bf_boolean16(0x0001, "ret_info_mask_fname", "Return File Name Information"),
+ bf_boolean16(0x0001, "ret_info_mask_fname", "Return File Name Information"),
bf_boolean16(0x0002, "ret_info_mask_alloc", "Return Allocation Space Information"),
bf_boolean16(0x0004, "ret_info_mask_attr", "Return Attribute Information"),
bf_boolean16(0x0008, "ret_info_mask_size", "Return Size Information"),
@@ -3372,7 +3394,7 @@ ReturnInfoMask = bitfield16("ret_info_mask", "Return Information", [
bf_boolean16(0x0020, "ret_info_mask_eattr", "Return Extended Attributes Information"),
bf_boolean16(0x0040, "ret_info_mask_arch", "Return Archive Information"),
bf_boolean16(0x0080, "ret_info_mask_mod", "Return Modify Information"),
- bf_boolean16(0x0100, "ret_info_mask_create", "Return Creation Information"),
+ bf_boolean16(0x0100, "ret_info_mask_create", "Return Creation Information"),
bf_boolean16(0x0200, "ret_info_mask_ns", "Return Name Space Information"),
bf_boolean16(0x0400, "ret_info_mask_dir", "Return Directory Information"),
bf_boolean16(0x0800, "ret_info_mask_rights", "Return Rights Information"),
@@ -3452,11 +3474,12 @@ SearchBitMap = bitfield8("search_bit_map", "Search Bit Map", [
])
SearchConnNumber = uint32("search_conn_number", "Search Connection Number")
SearchInstance = uint32("search_instance", "Search Instance")
-SearchNumber = uint32("search_number", "Search Number")
+SearchNumber = uint32("search_number", "Search Number")
SearchPattern = nstring8("search_pattern", "Search Pattern")
+SearchPattern16 = nstring16("search_pattern_16", "Search Pattern")
SearchSequence = bytes("search_sequence", "Search Sequence", 9)
-SearchSequenceWord = uint16("search_sequence_word", "Search Sequence", BE)
-Second = uint8("s_second", "Seconds")
+SearchSequenceWord = uint16("search_sequence_word", "Search Sequence", BE)
+Second = uint8("s_second", "Seconds")
SecondsRelativeToTheYear2000 = uint32("sec_rel_to_y2k", "Seconds Relative to the Year 2000")
SecretStoreVerb = val_string8("ss_verb", "Secret Store Verb",[
[ 0x00, "Query Server" ],
@@ -3659,7 +3682,9 @@ StatusFlagBits = bitfield32("status_flag_bits", "Status Flag", [
bf_boolean32(0x00000008, "status_flag_bits_audit", "Audit"),
bf_boolean32(0x00000010, "status_flag_bits_ro", "Read Only"),
bf_boolean32(0x00000020, "status_flag_bits_im_purge", "Immediate Purge"),
- bf_boolean32(0x80000000, "status_flag_bits_nss", "NSS Volume"),
+ bf_boolean32(0x00000040, "status_flag_bits_64bit", "64Bit File Offsets"),
+ bf_boolean32(0x00000080, "status_flag_bits_utf8", "UTF8 NCP Strings"),
+ bf_boolean32(0x80000000, "status_flag_bits_nss", "NSS Volume"),
])
SubAllocClusters = uint32("sub_alloc_clusters", "Sub Alloc Clusters")
SubAllocFreeableClusters = uint32("sub_alloc_freeable_clusters", "Sub Alloc Freeable Clusters")
@@ -3759,6 +3784,7 @@ TransportType = val_string8("transport_type", "Communications
TreeLength = uint32("tree_length", "Tree Length")
TreeName = nstring32("tree_name", "Tree Name")
TreeName.NWUnicode()
+TrusteeAccessMask = uint8("trustee_acc_mask", "Trustee Access Mask")
TrusteeRights = bitfield16("trustee_rights_low", "Trustee Rights", [
bf_boolean16(0x0001, "trustee_rights_read", "Read"),
bf_boolean16(0x0002, "trustee_rights_write", "Write"),
@@ -4104,7 +4130,7 @@ CompDeCompStat = struct("comp_d_comp_stat", [
], "Compression/Decompression Information")
ConnFileStruct = struct("conn_file_struct", [
ConnectionNumberWord,
- TaskNumByte,
+ TaskNumberWord,
LockType,
AccessControl,
LockFlag,
@@ -4308,6 +4334,9 @@ ExtraCacheCntrs = struct("extra_cache_cntrs", [
uint32("id_get_no_read_no_wait_no_alloc_alloc", "ID Get No Read No Wait No Alloc Allocate Count"),
], "Extra Cache Counters Information")
+FileSize64bitStruct = struct("file_sz_64bit_struct", [
+ FileSize64bit,
+])
ReferenceIDStruct = struct("ref_id_struct", [
CurrentReferenceID,
@@ -4316,12 +4345,12 @@ NSAttributeStruct = struct("ns_attrib_struct", [
AttributesDef32,
])
DStreamActual = struct("d_stream_actual", [
- Reserved12,
- # Need to look into how to format this correctly
+ DataStreamNumberLong,
+ DataStreamFATBlocks,
])
DStreamLogical = struct("d_string_logical", [
- Reserved12,
- # Need to look into how to format this correctly
+ DataStreamNumberLong,
+ DataStreamSize,
])
LastUpdatedInSecondsStruct = struct("last_update_in_seconds_struct", [
SecondsRelativeToTheYear2000,
@@ -4329,6 +4358,9 @@ LastUpdatedInSecondsStruct = struct("last_update_in_seconds_struct", [
DOSNameStruct = struct("dos_name_struct", [
FileName,
], "DOS File Name")
+DOSName16Struct = struct("dos_name_16_struct", [
+ FileName16,
+], "DOS File Name")
FlushTimeStruct = struct("flush_time_struct", [
FlushTime,
])
@@ -4381,6 +4413,9 @@ FileInstance = struct("file_instance", [
FileNameStruct = struct("file_name_struct", [
FileName,
], "File Name")
+FileName16Struct = struct("file_name16_struct", [
+ FileName16,
+], "File Name")
FileServerCounters = struct("file_server_counters", [
uint16("too_many_hops", "Too Many Hops"),
uint16("unknown_network", "Unknown Network"),
@@ -4746,7 +4781,7 @@ NWAuditStatus = struct("nw_audit_status", [
AuditFileVersionDate,
val_string16("audit_enable_flag", "Auditing Enabled Flag", [
[ 0x0000, "Auditing Disabled" ],
- [ 0x0100, "Auditing Enabled" ],
+ [ 0x0001, "Auditing Enabled" ],
]),
Reserved2,
uint32("audit_file_size", "Audit File Size"),
@@ -4892,6 +4927,18 @@ printInfo = struct("print_info_struct", [
TargetPrinter,
FormType,
], "Print Information")
+ReplyLevel1Struct = struct("reply_lvl_1_struct", [
+ DirHandle,
+ VolumeNumber,
+ Reserved4,
+], "Reply Level 1")
+ReplyLevel2Struct = struct("reply_lvl_2_struct", [
+ VolumeNumberLong,
+ DirectoryBase,
+ DOSDirectoryBase,
+ NameSpace,
+ DirHandle,
+], "Reply Level 2")
RightsInfoStruct = struct("rights_info_struct", [
InheritedRightsMask,
])
@@ -5041,7 +5088,7 @@ UpdateTimeStruct = struct("update_time_struct", [
UpdateTime,
])
UserInformation = struct("user_info", [
- ConnectionNumber,
+ endian(ConnectionNumber, LE),
UseCount,
Reserved2,
ConnectionServiceType,
@@ -5125,6 +5172,9 @@ VolumeStruct = struct("volume_struct", [
VolumeNameLen,
])
+DataStreamsStruct = struct("number_of_data_streams_struct", [
+ NumberOfDataStreamsLong,
+])
##############################################################################
# NCP Groups
@@ -5153,7 +5203,7 @@ def define_groups():
groups['stats'] = "Server Statistics"
groups['nmas'] = "Novell Modular Authentication Service"
groups['sss'] = "SecretStore Services"
- groups['unknown'] = "Unknown"
+ groups['unknown'] = "Unknown"
##############################################################################
# NCP Errors
@@ -5288,6 +5338,11 @@ def define_errors():
errors[0xa801] = "No Auditing Access Rights"
errors[0xa802] = "No Access Rights"
+ errors[0xa900] = "Error Link in Path"
+ errors[0xa901] = "Invalid Data Type Flag (outdated return value - replaced in NSS as 0x89aa error)"
+
+ errors[0xaa00] = "Invalid Data Type Flag"
+
errors[0xbe00] = "Invalid Data Stream"
errors[0xbf00] = "Requests for this name space are not valid on this volume"
@@ -5506,6 +5561,7 @@ def define_errors():
errors[0xff1e] = "Calling Station is Not a Manager"
errors[0xff1f] = "Bindery Failure"
errors[0xff20] = "NCP Extension Not Found"
+ errors[0xff21] = "Audit Property Not Found"
##############################################################################
# Produce C code
@@ -5534,7 +5590,7 @@ def produce_code():
print """
/*
* Portions Copyright (c) Gilbert Ramirez 2000-2002
- * Portions Copyright (c) Novell, Inc. 2000-2003
+ * Portions Copyright (c) Novell, Inc. 2000-2005
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -5563,8 +5619,10 @@ def produce_code():
#include <epan/emem.h>
#include "packet-ncp-int.h"
#include "packet-ncp-nmas.h"
+#include "packet-ncp-sss.h"
#include <epan/strutil.h>
#include "reassemble.h"
+#include <epan/tap.h>
/* Function declarations for functions used in proto_register_ncp2222() */
static void ncp_init_protocol(void);
@@ -5605,10 +5663,10 @@ static int ptvc_struct_int_storage;
#define NREV 0x00000004
#define NFLAGS 0x00000008
-
static int hf_ncp_func = -1;
static int hf_ncp_length = -1;
static int hf_ncp_subfunc = -1;
+static int hf_ncp_group = -1;
static int hf_ncp_fragment_handle = -1;
static int hf_ncp_completion_code = -1;
static int hf_ncp_connection_status = -1;
@@ -6036,6 +6094,7 @@ static int hf_nds_segment_multiple_tails = -1;
static int hf_nds_segment_too_long_segment = -1;
static int hf_nds_segment_error = -1;
+static proto_item *expert_item = NULL;
"""
@@ -6441,6 +6500,7 @@ static const value_string ncp_nds_verb_vals[] = {
{ 75, "Low Level Join" },
{ 76, "Abort Low Level Join" },
{ 77, "Get All Servers" },
+ { 240, "Ping" },
{ 255, "EDirectory Call" },
{ 0, NULL }
};
@@ -6462,6 +6522,9 @@ proto_register_ncp2222(void)
{ &hf_ncp_completion_code,
{ "Completion Code", "ncp.completion_code", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL }},
+ { &hf_ncp_group,
+ { "NCP Group Type", "ncp.group", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL }},
+
{ &hf_ncp_fragment_handle,
{ "NDS Fragment Handle", "ncp.ndsfrag", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }},
@@ -7775,8 +7838,6 @@ proto_register_ncp2222(void)
{ "NDS Fragments", "nds.fragments", FT_NONE, BASE_NONE,
NULL, 0x0, "NDPS Fragments", HFILL }},
-
-
"""
# Print the registration code for the hf variables
for var in sorted_vars:
@@ -8238,10 +8299,9 @@ def define_ncp2222():
# 2222/1603, 22/3
pkt = NCP(0x1603, "Get Effective Directory Rights", 'fileserver')
- pkt.Request((14,268), [
+ pkt.Request((12,266), [
rec( 10, 1, DirHandle ),
- rec( 11, 2, StartingSearchNumber ),
- rec( 13, (1, 255), Path ),
+ rec( 11, (1, 255), Path ),
], info_str=(Path, "Get Effective Directory Rights: %s", ", %s"))
pkt.Reply(9, [
rec( 8, 1, AccessRightsMask ),
@@ -9186,8 +9246,8 @@ def define_ncp2222():
# FT_IPXNET value.
#
pkt = NCP(0x171A, "Get Internet Address", 'fileserver')
- pkt.Request(11, [
- rec( 10, 1, TargetConnectionNumber ),
+ pkt.Request(12, [
+ rec( 10, 2, TargetConnectionNumber ),
])
pkt.Reply(21, [
rec( 8, 4, NetworkAddress, BE ),
@@ -10613,7 +10673,7 @@ def define_ncp2222():
])
pkt.Reply(33, [
rec( 8, 2, NextRequestRecord ),
- rec( 10, 2, UseCount ),
+ rec( 10, 2, FileUseCount ),
rec( 12, 2, OpenCount ),
rec( 14, 2, OpenForReadCount ),
rec( 16, 2, OpenForWriteCount ),
@@ -10622,7 +10682,7 @@ def define_ncp2222():
rec( 22, 1, Locked ),
rec( 23, 1, ForkCount ),
rec( 24, 2, NumberOfRecords, var="x" ),
- rec( 26, 7, ConnStruct, repeat="x" ),
+ rec( 26, 7, ConnFileStruct, repeat="x" ),
])
pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xff00])
# 2222/17ED, 23/237
@@ -10907,11 +10967,11 @@ def define_ncp2222():
pkt.CompletionCodes([0x0000, 0x9600])
# 2222/2207, 34/07
pkt = NCP(0x2207, "TTS Get Workstation Thresholds", 'tts', has_length=0)
- pkt.Request(10, [
+ pkt.Request(8)
+ pkt.Reply(10, [
rec( 8, 1, LogicalLockThreshold ),
rec( 9, 1, PhysicalLockThreshold ),
])
- pkt.Reply(8)
pkt.CompletionCodes([0x0000])
# 2222/2208, 34/08
pkt = NCP(0x2208, "TTS Set Workstation Thresholds", 'tts', has_length=0)
@@ -11382,7 +11442,7 @@ def define_ncp2222():
pkt.Reply(8)
# The following value is Unicode
#[ 8, (1, 255), ReplyBuffer ],
- pkt.CompletionCodes([0x0000, 0xd504, 0xee00, 0xfe00])
+ pkt.CompletionCodes([0x0000, 0x9c00, 0xd504, 0xee00, 0xfe00])
# 2222/3B, 59
pkt = NCP(0x3B, "Commit File", 'file', has_length=0 )
pkt.Request(14, [
@@ -11415,14 +11475,6 @@ def define_ncp2222():
rec( 13, (1,255), Path ),
], info_str=(Path, "File Search Continue: %s", ", %s"))
pkt.Reply( NO_LENGTH_CHECK, [
- #
- # XXX - don't show this if we got back a non-zero
- # completion code? For example, 255 means "No
- # matching files or directories were found", so
- # presumably it can't show you a matching file or
- # directory instance - it appears to just leave crap
- # there.
- #
srec( DirectoryInstance, req_cond="ncp.sattr_sub==TRUE"),
srec( FileInstance, req_cond="ncp.sattr_sub!=TRUE"),
])
@@ -11755,7 +11807,7 @@ def define_ncp2222():
rec( 20, 4, TtlEAsKeySize ),
rec( 24, 4, NewEAHandle ),
])
- pkt.CompletionCodes([0x0000, 0x8800, 0xc900, 0xce00, 0xcf00, 0xd101,
+ pkt.CompletionCodes([0x0000, 0x8800, 0x8c01, 0xc900, 0xce00, 0xcf00, 0xd101,
0xd301])
# 2222/5605, 86/05
pkt = NCP(0x5605, "Duplicate Extended Attributes", 'file', has_length=0 )
@@ -11842,7 +11894,7 @@ def define_ncp2222():
srec( FileNameStruct, req_cond="ncp.ret_info_mask_fname == 1" ),
])
pkt.ReqCondSizeVariable()
- pkt.CompletionCodes([0x0000, 0x7f00, 0x8001, 0x8101, 0x8401, 0x8501,
+ pkt.CompletionCodes([0x0000, 0x0102, 0x7f00, 0x8001, 0x8101, 0x8401, 0x8501,
0x8701, 0x8900, 0x8d00, 0x8f00, 0x9001, 0x9400, 0x9600,
0x9804, 0x9b03, 0x9c03, 0xa500, 0xa802, 0xbf00, 0xfd00, 0xff16])
# 2222/5702, 87/02
@@ -11948,7 +12000,7 @@ def define_ncp2222():
rec( -1, (1,255), Path, repeat="y" ),
], info_str=(Path, "Rename or Move: %s", "/%s"))
pkt.Reply(8)
- pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
+ pkt.CompletionCodes([0x0000, 0x0102, 0x8000, 0x8101, 0x8401, 0x8501,
0x8701, 0x8d00, 0x8e00, 0x8f00, 0x9001, 0x9200, 0x9600,
0x9804, 0x9a00, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
# 2222/5705, 87/05
@@ -12022,8 +12074,10 @@ def define_ncp2222():
srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
srec( ReferenceIDStruct, req_cond="ncp.ret_info_mask_id == 1" ),
srec( NSAttributeStruct, req_cond="ncp.ret_info_mask_ns_attr == 1" ),
- srec( DStreamActual, req_cond="ncp.ret_info_mask_actual == 1" ),
- srec( DStreamLogical, req_cond="ncp.ret_info_mask_logical == 1" ),
+ srec( DataStreamsStruct, req_cond="ncp.ret_info_mask_actual == 1" ),
+ srec( DStreamActual, req_cond="ncp.ret_info_mask_actual == 1 && ncp.number_of_data_streams_long > 0" ), # , repeat="x"
+ srec( DataStreamsStruct, req_cond="ncp.ret_info_mask_logical == 1" ), # , var="y"
+ srec( DStreamLogical, req_cond="ncp.ret_info_mask_logical == 1 && ncp.number_of_data_streams_long > 0" ), # , repeat="y"
srec( LastUpdatedInSecondsStruct, req_cond="ncp.ext_info_update == 1" ),
srec( DOSNameStruct, req_cond="ncp.ext_info_dos_name == 1" ),
srec( FlushTimeStruct, req_cond="ncp.ext_info_flush == 1" ),
@@ -12033,6 +12087,7 @@ def define_ncp2222():
srec( EffectiveRightsStruct, req_cond="ncp.ext_info_effective == 1" ),
srec( MacTimeStruct, req_cond="ncp.ext_info_mac_date == 1" ),
srec( LastAccessedTimeStruct, req_cond="ncp.ext_info_access == 1" ),
+ srec( FileSize64bitStruct, req_cond="ncp.ext_info_64_bit_fs == 1" ),
srec( FileNameStruct, req_cond="ncp.ret_info_mask_fname == 1" ),
])
pkt.ReqCondSizeVariable()
@@ -12070,14 +12125,14 @@ def define_ncp2222():
rec( 61, (1,255), Path, repeat="x" ),
], info_str=(Path, "Modify DOS Information for: %s", "/%s"))
pkt.Reply(8)
- pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
+ pkt.CompletionCodes([0x0000, 0x0102, 0x8000, 0x8101, 0x8401, 0x8501,
0x8701, 0x8c01, 0x8d00, 0x8e00, 0x8f00, 0x9001, 0x9600,
0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
# 2222/5708, 87/08
pkt = NCP(0x5708, "Delete a File or Subdirectory", 'file', has_length=0)
pkt.Request((20,274), [
rec( 8, 1, NameSpace ),
- rec( 9, 1, Reserved ),
+ rec( 9, 1, Reserved ),
rec( 10, 2, SearchAttributesLow ),
rec( 12, 1, VolumeNumber ),
rec( 13, 4, DirectoryBase ),
@@ -12321,12 +12376,12 @@ def define_ncp2222():
srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
- srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
- srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
- srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
+ srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
+ srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
+ srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
srec( ReferenceIDStruct, req_cond="ncp.ret_info_mask_id == 1" ),
srec( NSAttributeStruct, req_cond="ncp.ret_info_mask_ns_attr == 1" ),
@@ -12341,6 +12396,7 @@ def define_ncp2222():
srec( EffectiveRightsStruct, req_cond="ncp.ext_info_effective == 1" ),
srec( MacTimeStruct, req_cond="ncp.ext_info_mac_date == 1" ),
srec( LastAccessedTimeStruct, req_cond="ncp.ext_info_access == 1" ),
+ srec( FileSize64bitStruct, req_cond="ncp.ext_info_64_bit_fs == 1" ),
srec( FileNameStruct, req_cond="ncp.ret_info_mask_fname == 1" ),
])
pkt.ReqCondSizeVariable()
@@ -12399,10 +12455,10 @@ def define_ncp2222():
0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
# 2222/5718, 87/24
pkt = NCP(0x5718, "Get Name Spaces Loaded List from Volume Number", 'file', has_length=0)
- pkt.Request(10, [
- rec( 8, 1, Reserved ),
- rec( 9, 1, VolumeNumber ),
- ])
+ pkt.Request(11, [
+ rec( 8, 2, Reserved2 ),
+ rec( 10, 1, VolumeNumber ),
+ ], info_str=(VolumeNumber, "Get Name Spaces Loaded List from Vol: %d", "/%d"))
pkt.Reply(11, [
rec( 8, 2, NumberOfNSLoaded, var="x" ),
rec( 10, 1, NameSpace, repeat="x" ),
@@ -12603,7 +12659,7 @@ def define_ncp2222():
srec( FileNameStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_fname == 1)" ),
])
pkt.ReqCondSizeVariable()
- pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
+ pkt.CompletionCodes([0x0000, 0x0102, 0x8000, 0x8101, 0x8401, 0x8501,
0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
# 2222/571F, 87/31
@@ -12611,7 +12667,6 @@ def define_ncp2222():
pkt.Request(15, [
rec( 8, 6, FileHandle ),
rec( 14, 1, HandleInfoLevel ),
- #rec( 15, 1, NameSpace ),
], info_str=(FileHandle, "Get File Information - 0x%s", ", %s"))
pkt.Reply(NO_LENGTH_CHECK, [
rec( 8, 4, VolumeNumberLong ),
@@ -12696,7 +12751,7 @@ def define_ncp2222():
srec( FileNameStruct, req_cond="ncp.ret_info_mask_fname == 1" ),
])
pkt.ReqCondSizeVariable()
- pkt.CompletionCodes([0x0000, 0x7f00, 0x8000, 0x8101, 0x8401, 0x8501,
+ pkt.CompletionCodes([0x0000, 0x0102, 0x7f00, 0x8000, 0x8101, 0x8401, 0x8501,
0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
# 2222/5721, 87/33
@@ -12748,7 +12803,7 @@ def define_ncp2222():
rec( 87, 3, Reserved3 ),
rec( 90, (1,255), FileName ),
])
- pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
+ pkt.CompletionCodes([0x0000, 0x0102, 0x8000, 0x8101, 0x8401, 0x8501,
0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
# 2222/5722, 87/34
@@ -12780,7 +12835,7 @@ def define_ncp2222():
rec( 16, 4, AttributeValidFlag ),
rec( 20, 4, AttributesDef32 ),
])
- pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
+ pkt.CompletionCodes([0x0000, 0x0102, 0x8000, 0x8101, 0x8401, 0x8501,
0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
# 2222/5724, 87/36
@@ -13004,7 +13059,7 @@ def define_ncp2222():
rec( 20, 2, NumBytes, BE ),
])
pkt.Reply(8)
- pkt.CompletionCodes([0x0000, 0x8300, 0x8800, 0x9400, 0x9500, 0xa201, 0xfd00, 0xff1b])
+ pkt.CompletionCodes([0x0000, 0x0102, 0x8300, 0x8800, 0x9400, 0x9500, 0xa201, 0xfd00, 0xff1b])
# 2222/5742, 87/66
pkt = NCP(0x5742, "Get Current Size of File", 'file', has_length=0)
pkt.Request(12, [
@@ -13098,7 +13153,7 @@ def define_ncp2222():
pkt.Reply(8)
pkt.CompletionCodes([0x0000, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
- 0x9804, 0x9b03, 0x9c03, 0xa600, 0xa801, 0xfd00, 0xff16])
+ 0x9804, 0x9b03, 0x9c03, 0xa600, 0xa801, 0xfd00, 0xff21])
# 2222/5807, 8807
pkt = NCP(0x5807, "Disable Auditing On A Volume", "auditing", has_length=0)
pkt.Request(8)
@@ -13240,13 +13295,1156 @@ def define_ncp2222():
pkt.CompletionCodes([0x0000, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
0x9804, 0x9b03, 0x9c03, 0xa600, 0xa801, 0xfd00, 0xff16])
+ # 2222/5901, 89,01
+ pkt = NCP(0x5901, "Enhanced Open/Create File or Subdirectory", "file", has_length=0)
+ pkt.Request((37,290), [
+ rec( 8, 1, NameSpace ),
+ rec( 9, 1, OpenCreateMode ),
+ rec( 10, 2, SearchAttributesLow ),
+ rec( 12, 2, ReturnInfoMask ),
+ rec( 14, 2, ExtendedInfo ),
+ rec( 16, 4, AttributesDef32 ),
+ rec( 20, 2, DesiredAccessRights ),
+ rec( 22, 4, DirectoryBase ),
+ rec( 26, 1, VolumeNumber ),
+ rec( 27, 1, HandleFlag ),
+ rec( 28, 1, DataTypeFlag ),
+ rec( 29, 5, Reserved5 ),
+ rec( 34, 1, PathCount, var="x" ),
+ rec( 35, (2,255), Path16, repeat="x" ),
+ ], info_str=(Path16, "Enhanced Open or Create File or Subdirectory: %s", "/%s"))
+ pkt.Reply( NO_LENGTH_CHECK, [
+ rec( 8, 4, FileHandle, BE ),
+ rec( 12, 1, OpenCreateAction ),
+ rec( 13, 1, Reserved ),
+ srec( DSSpaceAllocateStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
+ srec( PadDSSpaceAllocate, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
+ srec( AttributesStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
+ srec( PadAttributes, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
+ srec( DataStreamSizeStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
+ srec( PadDataStreamSize, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
+ srec( TotalStreamSizeStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
+ srec( PadTotalStreamSize, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
+ srec( CreationInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
+ srec( PadCreationInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
+ srec( ModifyInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
+ srec( PadModifyInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
+ srec( ArchiveInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
+ srec( PadArchiveInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
+ srec( RightsInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
+ srec( PadRightsInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
+ srec( DirEntryStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
+ srec( PadDirEntry, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
+ srec( EAInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
+ srec( PadEAInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
+ srec( NSInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
+ srec( PadNSInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
+ srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc == 1)" ),
+ srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
+ srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
+ srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
+ srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
+ srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
+ srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
+ srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
+ srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
+ srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
+ srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
+ srec( ReferenceIDStruct, req_cond="ncp.ret_info_mask_id == 1" ),
+ srec( NSAttributeStruct, req_cond="ncp.ret_info_mask_ns_attr == 1" ),
+ srec( DStreamActual, req_cond="ncp.ret_info_mask_actual == 1" ),
+ srec( DStreamLogical, req_cond="ncp.ret_info_mask_logical == 1" ),
+ srec( LastUpdatedInSecondsStruct, req_cond="ncp.ext_info_update == 1" ),
+ srec( DOSName16Struct, req_cond="ncp.ext_info_dos_name == 1" ),
+ srec( FlushTimeStruct, req_cond="ncp.ext_info_flush == 1" ),
+ srec( ParentBaseIDStruct, req_cond="ncp.ext_info_parental == 1" ),
+ srec( MacFinderInfoStruct, req_cond="ncp.ext_info_mac_finder == 1" ),
+ srec( SiblingCountStruct, req_cond="ncp.ext_info_sibling == 1" ),
+ srec( EffectiveRightsStruct, req_cond="ncp.ext_info_effective == 1" ),
+ srec( MacTimeStruct, req_cond="ncp.ext_info_mac_date == 1" ),
+ srec( LastAccessedTimeStruct, req_cond="ncp.ext_info_access == 1" ),
+ srec( FileSize64bitStruct, req_cond="ncp.ext_info_64_bit_fs == 1" ),
+ srec( FileName16Struct, req_cond="ncp.ret_info_mask_fname == 1" ),
+ ])
+ pkt.ReqCondSizeVariable()
+ pkt.CompletionCodes([0x0000, 0x0102, 0x7f00, 0x8000, 0x8101, 0x8401, 0x8501,
+ 0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
+ 0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
+ # 2222/5902, 89/02
+ pkt = NCP(0x5902, "Enhanced Initialize Search", 'file', has_length=0)
+ pkt.Request( (25,278), [
+ rec( 8, 1, NameSpace ),
+ rec( 9, 1, Reserved ),
+ rec( 10, 4, DirectoryBase ),
+ rec( 14, 1, VolumeNumber ),
+ rec( 15, 1, HandleFlag ),
+ rec( 16, 1, DataTypeFlag ),
+ rec( 17, 5, Reserved5 ),
+ rec( 22, 1, PathCount, var="x" ),
+ rec( 23, (2,255), Path16, repeat="x" ),
+ ], info_str=(Path16, "Enhanced Set Search Pointer to: %s", "/%s"))
+ pkt.Reply(17, [
+ rec( 8, 1, VolumeNumber ),
+ rec( 9, 4, DirectoryNumber ),
+ rec( 13, 4, DirectoryEntryNumber ),
+ ])
+ pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
+ 0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
+ 0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
+ # 2222/5903, 89/03
+ pkt = NCP(0x5903, "Enhanced Search for File or Subdirectory", 'file', has_length=0)
+ pkt.Request((28, 281), [
+ rec( 8, 1, NameSpace ),
+ rec( 9, 1, DataStream ),
+ rec( 10, 2, SearchAttributesLow ),
+ rec( 12, 2, ReturnInfoMask ),
+ rec( 14, 2, ExtendedInfo ),
+ rec( 16, 9, SearchSequence ),
+ rec( 25, 1, DataTypeFlag ),
+ rec( 26, (2,255), SearchPattern16 ),
+ ], info_str=(SearchPattern16, "Enhanced Search for: %s", "/%s"))
+ pkt.Reply( NO_LENGTH_CHECK, [
+ rec( 8, 9, SearchSequence ),
+ rec( 17, 1, Reserved ),
+ srec( DSSpaceAllocateStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
+ srec( PadDSSpaceAllocate, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
+ srec( AttributesStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
+ srec( PadAttributes, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
+ srec( DataStreamSizeStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
+ srec( PadDataStreamSize, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
+ srec( TotalStreamSizeStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
+ srec( PadTotalStreamSize, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
+ srec( CreationInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
+ srec( PadCreationInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
+ srec( ModifyInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
+ srec( PadModifyInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
+ srec( ArchiveInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
+ srec( PadArchiveInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
+ srec( RightsInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
+ srec( PadRightsInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
+ srec( DirEntryStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
+ srec( PadDirEntry, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
+ srec( EAInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
+ srec( PadEAInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
+ srec( NSInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
+ srec( PadNSInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
+ srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc == 1)" ),
+ srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
+ srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
+ srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
+ srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
+ srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
+ srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
+ srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
+ srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
+ srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
+ srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
+ srec( ReferenceIDStruct, req_cond="ncp.ret_info_mask_id == 1" ),
+ srec( NSAttributeStruct, req_cond="ncp.ret_info_mask_ns_attr == 1" ),
+ srec( DStreamActual, req_cond="ncp.ret_info_mask_actual == 1" ),
+ srec( DStreamLogical, req_cond="ncp.ret_info_mask_logical == 1" ),
+ srec( LastUpdatedInSecondsStruct, req_cond="ncp.ext_info_update == 1" ),
+ srec( DOSName16Struct, req_cond="ncp.ext_info_dos_name == 1" ),
+ srec( FlushTimeStruct, req_cond="ncp.ext_info_flush == 1" ),
+ srec( ParentBaseIDStruct, req_cond="ncp.ext_info_parental == 1" ),
+ srec( MacFinderInfoStruct, req_cond="ncp.ext_info_mac_finder == 1" ),
+ srec( SiblingCountStruct, req_cond="ncp.ext_info_sibling == 1" ),
+ srec( EffectiveRightsStruct, req_cond="ncp.ext_info_effective == 1" ),
+ srec( MacTimeStruct, req_cond="ncp.ext_info_mac_date == 1" ),
+ srec( LastAccessedTimeStruct, req_cond="ncp.ext_info_access == 1" ),
+ srec( FileSize64bitStruct, req_cond="ncp.ext_info_64_bit_fs == 1" ),
+ srec( FileName16Struct, req_cond="ncp.ret_info_mask_fname == 1" ),
+ ])
+ pkt.ReqCondSizeVariable()
+ pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
+ 0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
+ 0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
+ # 2222/5904, 89/04
+ pkt = NCP(0x5904, "Enhanced Rename Or Move a File or Subdirectory", 'file', has_length=0)
+ pkt.Request((42, 548), [
+ rec( 8, 1, NameSpace ),
+ rec( 9, 1, RenameFlag ),
+ rec( 10, 2, SearchAttributesLow ),
+ rec( 12, 4, DirectoryBase ),
+ rec( 16, 1, VolumeNumber ),
+ rec( 17, 1, HandleFlag ),
+ rec( 18, 1, DataTypeFlag ),
+ rec( 19, 5, Reserved5 ),
+ rec( 24, 1, PathCount, var="x" ),
+ rec( 25, 4, DirectoryBase ),
+ rec( 29, 1, VolumeNumber ),
+ rec( 30, 1, HandleFlag ),
+ rec( 31, 1, DataTypeFlag ),
+ rec( 32, 5, Reserved5 ),
+ rec( 37, 1, PathCount, var="y" ),
+ rec( 38, (2, 255), Path16, repeat="x" ),
+ rec( -1, (2,255), Path16, repeat="y" ),
+ ], info_str=(Path16, "Enhanced Rename or Move: %s", "/%s"))
+ pkt.Reply(8)
+ pkt.CompletionCodes([0x0000, 0x0102, 0x8000, 0x8101, 0x8401, 0x8501,
+ 0x8701, 0x8d00, 0x8e00, 0x8f00, 0x9001, 0x9200, 0x9600,
+ 0x9804, 0x9a00, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
+ # 2222/5905, 89/05
+ pkt = NCP(0x5905, "Enhanced Scan File or Subdirectory for Trustees", 'file', has_length=0)
+ pkt.Request((31, 284), [
+ rec( 8, 1, NameSpace ),
+ rec( 9, 1, MaxReplyObjectIDCount ),
+ rec( 10, 2, SearchAttributesLow ),
+ rec( 12, 4, SequenceNumber ),
+ rec( 16, 4, DirectoryBase ),
+ rec( 20, 1, VolumeNumber ),
+ rec( 21, 1, HandleFlag ),
+ rec( 22, 1, DataTypeFlag ),
+ rec( 23, 5, Reserved5 ),
+ rec( 28, 1, PathCount, var="x" ),
+ rec( 29, (2, 255), Path16, repeat="x" ),
+ ], info_str=(Path16, "Enhanced Scan Trustees for: %s", "/%s"))
+ pkt.Reply(20, [
+ rec( 8, 4, SequenceNumber ),
+ rec( 12, 2, ObjectIDCount, var="x" ),
+ rec( 14, 6, TrusteeStruct, repeat="x" ),
+ ])
+ pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
+ 0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
+ 0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
+ # 2222/5906, 89/06
+ pkt = NCP(0x5906, "Enhanced Obtain File or SubDirectory Information", 'file', has_length=0)
+ pkt.Request((31,284), [
+ rec( 8, 1, SrcNameSpace ),
+ rec( 9, 1, DestNameSpace ),
+ rec( 10, 2, SearchAttributesLow ),
+ rec( 12, 2, ReturnInfoMask, LE ),
+ rec( 14, 2, ExtendedInfo ),
+ rec( 16, 4, DirectoryBase ),
+ rec( 20, 1, VolumeNumber ),
+ rec( 21, 1, HandleFlag ),
+ rec( 22, 1, DataTypeFlag ),
+ rec( 23, 5, Reserved5 ),
+ rec( 28, 1, PathCount, var="x" ),
+ rec( 29, (2,255), Path16, repeat="x",),
+ ], info_str=(Path16, "Enhanced Obtain Info for: %s", "/%s"))
+ pkt.Reply(NO_LENGTH_CHECK, [
+ srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
+ srec( PadDSSpaceAllocate, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
+ srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
+ srec( PadAttributes, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
+ srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
+ srec( PadDataStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
+ srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
+ srec( PadTotalStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
+ srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
+ srec( PadCreationInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
+ srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
+ srec( PadModifyInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
+ srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
+ srec( PadArchiveInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
+ srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
+ srec( PadRightsInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
+ srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
+ srec( PadDirEntry, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
+ srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
+ srec( PadEAInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
+ srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
+ srec( PadNSInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
+ srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc == 1)" ),
+ srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
+ srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
+ srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
+ srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
+ srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
+ srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
+ srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
+ srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
+ srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
+ srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
+ srec( ReferenceIDStruct, req_cond="ncp.ret_info_mask_id == 1" ),
+ srec( NSAttributeStruct, req_cond="ncp.ret_info_mask_ns_attr == 1" ),
+ srec( DStreamActual, req_cond="ncp.ret_info_mask_actual == 1" ),
+ srec( DStreamLogical, req_cond="ncp.ret_info_mask_logical == 1" ),
+ srec( LastUpdatedInSecondsStruct, req_cond="ncp.ext_info_update == 1" ),
+ srec( DOSName16Struct, req_cond="ncp.ext_info_dos_name == 1" ),
+ srec( FlushTimeStruct, req_cond="ncp.ext_info_flush == 1" ),
+ srec( ParentBaseIDStruct, req_cond="ncp.ext_info_parental == 1" ),
+ srec( MacFinderInfoStruct, req_cond="ncp.ext_info_mac_finder == 1" ),
+ srec( SiblingCountStruct, req_cond="ncp.ext_info_sibling == 1" ),
+ srec( EffectiveRightsStruct, req_cond="ncp.ext_info_effective == 1" ),
+ srec( MacTimeStruct, req_cond="ncp.ext_info_mac_date == 1" ),
+ srec( LastAccessedTimeStruct, req_cond="ncp.ext_info_access == 1" ),
+ srec( FileSize64bitStruct, req_cond="ncp.ext_info_64_bit_fs == 1" ),
+ srec( FileName16Struct, req_cond="ncp.ret_info_mask_fname == 1" ),
+ ])
+ pkt.ReqCondSizeVariable()
+ pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
+ 0x8700, 0x8900, 0x8d00, 0x8f00, 0x9001, 0x9600,
+ 0x9804, 0x9b03, 0x9c03, 0xa802, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
+ # 2222/5907, 89/07
+ pkt = NCP(0x5907, "Enhanced Modify File or Subdirectory DOS Information", 'file', has_length=0)
+ pkt.Request((69,322), [
+ rec( 8, 1, NameSpace ),
+ rec( 9, 1, Reserved ),
+ rec( 10, 2, SearchAttributesLow ),
+ rec( 12, 2, ModifyDOSInfoMask ),
+ rec( 14, 2, Reserved2 ),
+ rec( 16, 2, AttributesDef16 ),
+ rec( 18, 1, FileMode ),
+ rec( 19, 1, FileExtendedAttributes ),
+ rec( 20, 2, CreationDate ),
+ rec( 22, 2, CreationTime ),
+ rec( 24, 4, CreatorID, BE ),
+ rec( 28, 2, ModifiedDate ),
+ rec( 30, 2, ModifiedTime ),
+ rec( 32, 4, ModifierID, BE ),
+ rec( 36, 2, ArchivedDate ),
+ rec( 38, 2, ArchivedTime ),
+ rec( 40, 4, ArchiverID, BE ),
+ rec( 44, 2, LastAccessedDate ),
+ rec( 46, 2, InheritedRightsMask ),
+ rec( 48, 2, InheritanceRevokeMask ),
+ rec( 50, 4, MaxSpace ),
+ rec( 54, 4, DirectoryBase ),
+ rec( 58, 1, VolumeNumber ),
+ rec( 59, 1, HandleFlag ),
+ rec( 60, 1, DataTypeFlag ),
+ rec( 61, 5, Reserved5 ),
+ rec( 66, 1, PathCount, var="x" ),
+ rec( 67, (2,255), Path16, repeat="x" ),
+ ], info_str=(Path16, "Enhanced Modify DOS Information for: %s", "/%s"))
+ pkt.Reply(8)
+ pkt.CompletionCodes([0x0000, 0x0102, 0x8000, 0x8101, 0x8401, 0x8501,
+ 0x8701, 0x8c01, 0x8d00, 0x8e00, 0x8f00, 0x9001, 0x9600,
+ 0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
+ # 2222/5908, 89/08
+ pkt = NCP(0x5908, "Enhanced Delete a File or Subdirectory", 'file', has_length=0)
+ pkt.Request((27,280), [
+ rec( 8, 1, NameSpace ),
+ rec( 9, 1, Reserved ),
+ rec( 10, 2, SearchAttributesLow ),
+ rec( 12, 4, DirectoryBase ),
+ rec( 16, 1, VolumeNumber ),
+ rec( 17, 1, HandleFlag ),
+ rec( 18, 1, DataTypeFlag ),
+ rec( 19, 5, Reserved5 ),
+ rec( 24, 1, PathCount, var="x" ),
+ rec( 25, (2,255), Path16, repeat="x" ),
+ ], info_str=(Path16, "Enhanced Delete a File or Subdirectory: %s", "/%s"))
+ pkt.Reply(8)
+ pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
+ 0x8701, 0x8900, 0x8a00, 0x8d00, 0x8e00, 0x8f00, 0x9001, 0x9600,
+ 0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
+ # 2222/5909, 89/09
+ pkt = NCP(0x5909, "Enhanced Set Short Directory Handle", 'file', has_length=0)
+ pkt.Request((27,280), [
+ rec( 8, 1, NameSpace ),
+ rec( 9, 1, DataStream ),
+ rec( 10, 1, DestDirHandle ),
+ rec( 11, 1, Reserved ),
+ rec( 12, 4, DirectoryBase ),
+ rec( 16, 1, VolumeNumber ),
+ rec( 17, 1, HandleFlag ),
+ rec( 18, 1, DataTypeFlag ),
+ rec( 19, 5, Reserved5 ),
+ rec( 24, 1, PathCount, var="x" ),
+ rec( 25, (2,255), Path16, repeat="x" ),
+ ], info_str=(Path16, "Enhanced Set Short Directory Handle to: %s", "/%s"))
+ pkt.Reply(8)
+ pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
+ 0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
+ 0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
+ # 2222/590A, 89/10
+ pkt = NCP(0x590A, "Enhanced Add Trustee Set to File or Subdirectory", 'file', has_length=0)
+ pkt.Request((38,291), [
+ rec( 8, 1, NameSpace ),
+ rec( 9, 1, Reserved ),
+ rec( 10, 2, SearchAttributesLow ),
+ rec( 12, 2, AccessRightsMaskWord ),
+ rec( 14, 2, ObjectIDCount, var="y" ),
+ rec( 16, 4, DirectoryBase ),
+ rec( 20, 1, VolumeNumber ),
+ rec( 21, 1, HandleFlag ),
+ rec( 22, 1, DataTypeFlag ),
+ rec( 23, 5, Reserved5 ),
+ rec( 28, 1, PathCount, var="x" ),
+ rec( 29, (2,255), Path16, repeat="x" ),
+ rec( -1, 7, TrusteeStruct, repeat="y" ),
+ ], info_str=(Path16, "Enhanced Add Trustee Set to: %s", "/%s"))
+ pkt.Reply(8)
+ pkt.CompletionCodes([0x0000, 0x0102, 0x8000, 0x8101, 0x8401, 0x8501,
+ 0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
+ 0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfc01, 0xfd00, 0xff16])
+ # 2222/590B, 89/11
+ pkt = NCP(0x590B, "Enhanced Delete Trustee Set from File or SubDirectory", 'file', has_length=0)
+ pkt.Request((34,287), [
+ rec( 8, 1, NameSpace ),
+ rec( 9, 1, Reserved ),
+ rec( 10, 2, ObjectIDCount, var="y" ),
+ rec( 12, 4, DirectoryBase ),
+ rec( 16, 1, VolumeNumber ),
+ rec( 17, 1, HandleFlag ),
+ rec( 18, 1, DataTypeFlag ),
+ rec( 19, 5, Reserved5 ),
+ rec( 24, 1, PathCount, var="x" ),
+ rec( 25, (2,255), Path16, repeat="x" ),
+ rec( -1, 7, TrusteeStruct, repeat="y" ),
+ ], info_str=(Path16, "Enhanced Delete Trustee Set from: %s", "/%s"))
+ pkt.Reply(8)
+ pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
+ 0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
+ 0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
+ # 2222/590C, 89/12
+ pkt = NCP(0x590C, "Enhanced Allocate Short Directory Handle", 'file', has_length=0)
+ pkt.Request((27,280), [
+ rec( 8, 1, NameSpace ),
+ rec( 9, 1, DestNameSpace ),
+ rec( 10, 2, AllocateMode ),
+ rec( 12, 4, DirectoryBase ),
+ rec( 16, 1, VolumeNumber ),
+ rec( 17, 1, HandleFlag ),
+ rec( 18, 1, DataTypeFlag ),
+ rec( 19, 5, Reserved5 ),
+ rec( 24, 1, PathCount, var="x" ),
+ rec( 25, (2,255), Path16, repeat="x" ),
+ ], info_str=(Path16, "Enhanced Allocate Short Directory Handle to: %s", "/%s"))
+ pkt.Reply(NO_LENGTH_CHECK, [
+ srec( ReplyLevel2Struct, req_cond="ncp.alloc_reply_lvl2 == TRUE" ),
+ srec( ReplyLevel1Struct, req_cond="ncp.alloc_reply_lvl2 == FALSE" ),
+ ])
+ pkt.ReqCondSizeVariable()
+ pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
+ 0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
+ 0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
+ # 2222/5910, 89/16
+ pkt = NCP(0x5910, "Enhanced Scan Salvageable Files", 'file', has_length=0)
+ pkt.Request((33,286), [
+ rec( 8, 1, NameSpace ),
+ rec( 9, 1, DataStream ),
+ rec( 10, 2, ReturnInfoMask ),
+ rec( 12, 2, ExtendedInfo ),
+ rec( 14, 4, SequenceNumber ),
+ rec( 18, 4, DirectoryBase ),
+ rec( 22, 1, VolumeNumber ),
+ rec( 23, 1, HandleFlag ),
+ rec( 24, 1, DataTypeFlag ),
+ rec( 25, 5, Reserved5 ),
+ rec( 30, 1, PathCount, var="x" ),
+ rec( 31, (2,255), Path16, repeat="x" ),
+ ], info_str=(Path16, "Enhanced Scan for Deleted Files in: %s", "/%s"))
+ pkt.Reply(NO_LENGTH_CHECK, [
+ rec( 8, 4, SequenceNumber ),
+ rec( 12, 2, DeletedTime ),
+ rec( 14, 2, DeletedDate ),
+ rec( 16, 4, DeletedID, BE ),
+ rec( 20, 4, VolumeID ),
+ rec( 24, 4, DirectoryBase ),
+ srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
+ srec( PadDSSpaceAllocate, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
+ srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
+ srec( PadAttributes, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
+ srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
+ srec( PadDataStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
+ srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
+ srec( PadTotalStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
+ srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
+ srec( PadCreationInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
+ srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
+ srec( PadModifyInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
+ srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
+ srec( PadArchiveInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
+ srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
+ srec( PadRightsInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
+ srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
+ srec( PadDirEntry, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
+ srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
+ srec( PadEAInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
+ srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
+ srec( PadNSInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
+ srec( FileName16Struct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_fname == 1)" ),
+ srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc == 1)" ),
+ srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
+ srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
+ srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
+ srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
+ srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
+ srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
+ srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
+ srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
+ srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
+ srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
+ srec( FileSize64bitStruct, req_cond="ncp.ext_info_64_bit_fs == 1" ),
+ srec( FileName16Struct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_fname == 1)" ),
+ ])
+ pkt.ReqCondSizeVariable()
+ pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
+ 0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
+ 0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
+ # 2222/5911, 89/17
+ pkt = NCP(0x5911, "Enhanced Recover Salvageable File", 'file', has_length=0)
+ pkt.Request((24,278), [
+ rec( 8, 1, NameSpace ),
+ rec( 9, 1, Reserved ),
+ rec( 10, 4, SequenceNumber ),
+ rec( 14, 4, VolumeID ),
+ rec( 18, 4, DirectoryBase ),
+ rec( 22, 1, DataTypeFlag ),
+ rec( 23, (1,255), FileName ),
+ ], info_str=(FileName, "Enhanced Recover Deleted File: %s", ", %s"))
+ pkt.Reply(8)
+ pkt.CompletionCodes([0x0000, 0x0102, 0x8000, 0x8101, 0x8401, 0x8501,
+ 0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
+ 0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
+ # 2222/5913, 89/19
+ pkt = NCP(0x5913, "Enhanced Get Name Space Information", 'file', has_length=0)
+ pkt.Request(18, [
+ rec( 8, 1, SrcNameSpace ),
+ rec( 9, 1, DestNameSpace ),
+ rec( 10, 1, DataTypeFlag ),
+ rec( 11, 1, VolumeNumber ),
+ rec( 12, 4, DirectoryBase ),
+ rec( 16, 2, NamesSpaceInfoMask ),
+ ])
+ pkt.Reply(NO_LENGTH_CHECK, [
+ srec( FileName16Struct, req_cond="ncp.ns_info_mask_modify == TRUE" ),
+ srec( FileAttributesStruct, req_cond="ncp.ns_info_mask_fatt == TRUE" ),
+ srec( CreationDateStruct, req_cond="ncp.ns_info_mask_cdate == TRUE" ),
+ srec( CreationTimeStruct, req_cond="ncp.ns_info_mask_ctime == TRUE" ),
+ srec( OwnerIDStruct, req_cond="ncp.ns_info_mask_owner == TRUE" ),
+ srec( ArchiveDateStruct, req_cond="ncp.ns_info_mask_adate == TRUE" ),
+ srec( ArchiveTimeStruct, req_cond="ncp.ns_info_mask_atime == TRUE" ),
+ srec( ArchiveIdStruct, req_cond="ncp.ns_info_mask_aid == TRUE" ),
+ srec( UpdateDateStruct, req_cond="ncp.ns_info_mask_udate == TRUE" ),
+ srec( UpdateTimeStruct, req_cond="ncp.ns_info_mask_utime == TRUE" ),
+ srec( UpdateIDStruct, req_cond="ncp.ns_info_mask_uid == TRUE" ),
+ srec( LastAccessStruct, req_cond="ncp.ns_info_mask_acc_date == TRUE" ),
+ srec( RightsInfoStruct, req_cond="ncp.ns_info_mask_max_acc_mask == TRUE" ),
+ ])
+ pkt.ReqCondSizeVariable()
+ pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
+ 0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
+ 0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
+ # 2222/5914, 89/20
+ pkt = NCP(0x5914, "Enhanced Search for File or Subdirectory Set", 'file', has_length=0)
+ pkt.Request((30, 283), [
+ rec( 8, 1, NameSpace ),
+ rec( 9, 1, DataStream ),
+ rec( 10, 2, SearchAttributesLow ),
+ rec( 12, 2, ReturnInfoMask ),
+ rec( 14, 2, ExtendedInfo ),
+ rec( 16, 2, ReturnInfoCount ),
+ rec( 18, 9, SearchSequence ),
+ rec( 27, 1, DataTypeFlag ),
+ rec( 28, (2,255), SearchPattern16 ),
+ ])
+ pkt.Reply(NO_LENGTH_CHECK, [
+ rec( 8, 9, SearchSequence ),
+ rec( 17, 1, MoreFlag ),
+ rec( 18, 2, InfoCount ),
+ srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
+ srec( PadDSSpaceAllocate, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
+ srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
+ srec( PadAttributes, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
+ srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
+ srec( PadDataStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
+ srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
+ srec( PadTotalStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
+ srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
+ srec( PadCreationInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
+ srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
+ srec( PadModifyInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
+ srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
+ srec( PadArchiveInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
+ srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
+ srec( PadRightsInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
+ srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
+ srec( PadDirEntry, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
+ srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
+ srec( PadEAInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
+ srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
+ srec( PadNSInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
+ srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc == 1)" ),
+ srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
+ srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
+ srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
+ srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
+ srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
+ srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
+ srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
+ srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
+ srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
+ srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
+ srec( ReferenceIDStruct, req_cond="ncp.ret_info_mask_id == 1" ),
+ srec( NSAttributeStruct, req_cond="ncp.ret_info_mask_ns_attr == 1" ),
+ srec( DStreamActual, req_cond="ncp.ret_info_mask_actual == 1" ),
+ srec( DStreamLogical, req_cond="ncp.ret_info_mask_logical == 1" ),
+ srec( LastUpdatedInSecondsStruct, req_cond="ncp.ext_info_update == 1" ),
+ srec( DOSName16Struct, req_cond="ncp.ext_info_dos_name == 1" ),
+ srec( FlushTimeStruct, req_cond="ncp.ext_info_flush == 1" ),
+ srec( ParentBaseIDStruct, req_cond="ncp.ext_info_parental == 1" ),
+ srec( MacFinderInfoStruct, req_cond="ncp.ext_info_mac_finder == 1" ),
+ srec( SiblingCountStruct, req_cond="ncp.ext_info_sibling == 1" ),
+ srec( EffectiveRightsStruct, req_cond="ncp.ext_info_effective == 1" ),
+ srec( MacTimeStruct, req_cond="ncp.ext_info_mac_date == 1" ),
+ srec( LastAccessedTimeStruct, req_cond="ncp.ext_info_access == 1" ),
+ srec( FileSize64bitStruct, req_cond="ncp.ext_info_64_bit_fs == 1" ),
+ srec( FileName16Struct, req_cond="ncp.ret_info_mask_fname == 1" ),
+ ])
+ pkt.ReqCondSizeVariable()
+ pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
+ 0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
+ 0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
+ # 2222/5916, 89/22
+ pkt = NCP(0x5916, "Enhanced Generate Directory Base and Volume Number", 'file', has_length=0)
+ pkt.Request((27,280), [
+ rec( 8, 1, SrcNameSpace ),
+ rec( 9, 1, DestNameSpace ),
+ rec( 10, 2, dstNSIndicator ),
+ rec( 12, 4, DirectoryBase ),
+ rec( 16, 1, VolumeNumber ),
+ rec( 17, 1, HandleFlag ),
+ rec( 18, 1, DataTypeFlag ),
+ rec( 19, 5, Reserved5 ),
+ rec( 24, 1, PathCount, var="x" ),
+ rec( 25, (2,255), Path16, repeat="x" ),
+ ], info_str=(Path16, "Enhanced Get Volume and Directory Base from: %s", "/%s"))
+ pkt.Reply(17, [
+ rec( 8, 4, DirectoryBase ),
+ rec( 12, 4, DOSDirectoryBase ),
+ rec( 16, 1, VolumeNumber ),
+ ])
+ pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
+ 0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
+ 0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
+ # 2222/5919, 89/25
+ pkt = NCP(0x5919, "Enhanced Set Name Space Information", 'file', has_length=0)
+ pkt.Request(530, [
+ rec( 8, 1, SrcNameSpace ),
+ rec( 9, 1, DestNameSpace ),
+ rec( 10, 1, VolumeNumber ),
+ rec( 11, 4, DirectoryBase ),
+ rec( 15, 2, NamesSpaceInfoMask ),
+ rec( 17, 1, DataTypeFlag ),
+ rec( 18, 512, NSSpecificInfo ),
+ ])
+ pkt.Reply(8)
+ pkt.CompletionCodes([0x0000, 0x0102, 0x8000, 0x8101, 0x8401, 0x8501,
+ 0x8701, 0x8b00, 0x8d00, 0x8f00, 0x9001,
+ 0x9600, 0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00,
+ 0xff16])
+ # 2222/591C, 89/28
+ pkt = NCP(0x591C, "Enhanced Get Full Path String", 'file', has_length=0)
+ pkt.Request((35,288), [
+ rec( 8, 1, SrcNameSpace ),
+ rec( 9, 1, DestNameSpace ),
+ rec( 10, 2, PathCookieFlags ),
+ rec( 12, 4, Cookie1 ),
+ rec( 16, 4, Cookie2 ),
+ rec( 20, 4, DirectoryBase ),
+ rec( 24, 1, VolumeNumber ),
+ rec( 25, 1, HandleFlag ),
+ rec( 26, 1, DataTypeFlag ),
+ rec( 27, 5, Reserved5 ),
+ rec( 32, 1, PathCount, var="x" ),
+ rec( 33, (2,255), Path16, repeat="x" ),
+ ], info_str=(Path16, "Enhanced Get Full Path from: %s", "/%s"))
+ pkt.Reply((24,277), [
+ rec( 8, 2, PathCookieFlags ),
+ rec( 10, 4, Cookie1 ),
+ rec( 14, 4, Cookie2 ),
+ rec( 18, 2, PathComponentSize ),
+ rec( 20, 2, PathComponentCount, var='x' ),
+ rec( 22, (2,255), Path16, repeat='x' ),
+ ])
+ pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
+ 0x8701, 0x8b00, 0x8d00, 0x8f00, 0x9001,
+ 0x9600, 0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00,
+ 0xff16])
+ # 2222/591D, 89/29
+ pkt = NCP(0x591D, "Enhanced Get Effective Directory Rights", 'file', has_length=0)
+ pkt.Request((31, 284), [
+ rec( 8, 1, NameSpace ),
+ rec( 9, 1, DestNameSpace ),
+ rec( 10, 2, SearchAttributesLow ),
+ rec( 12, 2, ReturnInfoMask ),
+ rec( 14, 2, ExtendedInfo ),
+ rec( 16, 4, DirectoryBase ),
+ rec( 20, 1, VolumeNumber ),
+ rec( 21, 1, HandleFlag ),
+ rec( 22, 1, DataTypeFlag ),
+ rec( 23, 5, Reserved5 ),
+ rec( 28, 1, PathCount, var="x" ),
+ rec( 29, (2,255), Path16, repeat="x" ),
+ ], info_str=(Path16, "Enhanced Get Effective Rights for: %s", "/%s"))
+ pkt.Reply(NO_LENGTH_CHECK, [
+ rec( 8, 2, EffectiveRights ),
+ srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
+ srec( PadDSSpaceAllocate, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
+ srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
+ srec( PadAttributes, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
+ srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
+ srec( PadDataStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
+ srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
+ srec( PadTotalStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
+ srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
+ srec( PadCreationInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
+ srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
+ srec( PadModifyInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
+ srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
+ srec( PadArchiveInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
+ srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
+ srec( PadRightsInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
+ srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
+ srec( PadDirEntry, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
+ srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
+ srec( PadEAInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
+ srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
+ srec( PadNSInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
+ srec( FileName16Struct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_fname == 1)" ),
+ srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc == 1)" ),
+ srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
+ srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
+ srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
+ srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
+ srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
+ srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
+ srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
+ srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
+ srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
+ srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
+ srec( FileSize64bitStruct, req_cond="(ncp.ext_info_64_bit_fs == 1) && (ncp.ret_info_mask_fname == 1)" ),
+ srec( FileName16Struct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_fname == 1)" ),
+ ])
+ pkt.ReqCondSizeVariable()
+ pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
+ 0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
+ 0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
+ # 2222/591E, 89/30
+ pkt = NCP(0x591E, "Enhanced Open/Create File or Subdirectory", 'file', has_length=0)
+ pkt.Request((41, 294), [
+ rec( 8, 1, NameSpace ),
+ rec( 9, 1, DataStream ),
+ rec( 10, 1, OpenCreateMode ),
+ rec( 11, 1, Reserved ),
+ rec( 12, 2, SearchAttributesLow ),
+ rec( 14, 2, Reserved2 ),
+ rec( 16, 2, ReturnInfoMask ),
+ rec( 18, 2, ExtendedInfo ),
+ rec( 20, 4, AttributesDef32 ),
+ rec( 24, 2, DesiredAccessRights ),
+ rec( 26, 4, DirectoryBase ),
+ rec( 30, 1, VolumeNumber ),
+ rec( 31, 1, HandleFlag ),
+ rec( 32, 1, DataTypeFlag ),
+ rec( 33, 5, Reserved5 ),
+ rec( 38, 1, PathCount, var="x" ),
+ rec( 39, (2,255), Path16, repeat="x" ),
+ ], info_str=(Path16, "Enhanced Open or Create File: %s", "/%s"))
+ pkt.Reply(NO_LENGTH_CHECK, [
+ rec( 8, 4, FileHandle, BE ),
+ rec( 12, 1, OpenCreateAction ),
+ rec( 13, 1, Reserved ),
+ srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
+ srec( PadDSSpaceAllocate, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
+ srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
+ srec( PadAttributes, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
+ srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
+ srec( PadDataStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
+ srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
+ srec( PadTotalStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
+ srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
+ srec( PadCreationInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
+ srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
+ srec( PadModifyInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
+ srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
+ srec( PadArchiveInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
+ srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
+ srec( PadRightsInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
+ srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
+ srec( PadDirEntry, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
+ srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
+ srec( PadEAInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
+ srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
+ srec( PadNSInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
+ srec( FileName16Struct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_fname == 1)" ),
+ srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc == 1)" ),
+ srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
+ srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
+ srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
+ srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
+ srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
+ srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
+ srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
+ srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
+ srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
+ srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
+ srec( FileSize64bitStruct, req_cond="(ncp.ext_info_64_bit_fs == 1) && (ncp.ret_info_mask_fname == 1)" ),
+ srec( FileName16Struct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_fname == 1)" ),
+ ])
+ pkt.ReqCondSizeVariable()
+ pkt.CompletionCodes([0x0000, 0x0102, 0x8000, 0x8101, 0x8401, 0x8501,
+ 0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
+ 0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
+ # 2222/5920, 89/32
+ pkt = NCP(0x5920, "Enhanced Open/Create File or Subdirectory with Callback", 'file', has_length=0)
+ pkt.Request((37, 290), [
+ rec( 8, 1, NameSpace ),
+ rec( 9, 1, OpenCreateMode ),
+ rec( 10, 2, SearchAttributesLow ),
+ rec( 12, 2, ReturnInfoMask ),
+ rec( 14, 2, ExtendedInfo ),
+ rec( 16, 4, AttributesDef32 ),
+ rec( 20, 2, DesiredAccessRights ),
+ rec( 22, 4, DirectoryBase ),
+ rec( 26, 1, VolumeNumber ),
+ rec( 27, 1, HandleFlag ),
+ rec( 28, 1, DataTypeFlag ),
+ rec( 29, 5, Reserved5 ),
+ rec( 34, 1, PathCount, var="x" ),
+ rec( 35, (2,255), Path16, repeat="x" ),
+ ], info_str=(Path16, "Enhanced Open or Create with Op-Lock: %s", "/%s"))
+ pkt.Reply( NO_LENGTH_CHECK, [
+ rec( 8, 4, FileHandle, BE ),
+ rec( 12, 1, OpenCreateAction ),
+ rec( 13, 1, OCRetFlags ),
+ srec( DSSpaceAllocateStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
+ srec( PadDSSpaceAllocate, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
+ srec( AttributesStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
+ srec( PadAttributes, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
+ srec( DataStreamSizeStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
+ srec( PadDataStreamSize, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
+ srec( TotalStreamSizeStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
+ srec( PadTotalStreamSize, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
+ srec( CreationInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
+ srec( PadCreationInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
+ srec( ModifyInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
+ srec( PadModifyInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
+ srec( ArchiveInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
+ srec( PadArchiveInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
+ srec( RightsInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
+ srec( PadRightsInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
+ srec( DirEntryStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
+ srec( PadDirEntry, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
+ srec( EAInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
+ srec( PadEAInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
+ srec( NSInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
+ srec( PadNSInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
+ srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc == 1)" ),
+ srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
+ srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
+ srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
+ srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
+ srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
+ srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
+ srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
+ srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
+ srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
+ srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
+ srec( ReferenceIDStruct, req_cond="ncp.ret_info_mask_id == 1" ),
+ srec( NSAttributeStruct, req_cond="ncp.ret_info_mask_ns_attr == 1" ),
+ srec( DStreamActual, req_cond="ncp.ret_info_mask_actual == 1" ),
+ srec( DStreamLogical, req_cond="ncp.ret_info_mask_logical == 1" ),
+ srec( LastUpdatedInSecondsStruct, req_cond="ncp.ext_info_update == 1" ),
+ srec( DOSName16Struct, req_cond="ncp.ext_info_dos_name == 1" ),
+ srec( FlushTimeStruct, req_cond="ncp.ext_info_flush == 1" ),
+ srec( ParentBaseIDStruct, req_cond="ncp.ext_info_parental == 1" ),
+ srec( MacFinderInfoStruct, req_cond="ncp.ext_info_mac_finder == 1" ),
+ srec( SiblingCountStruct, req_cond="ncp.ext_info_sibling == 1" ),
+ srec( EffectiveRightsStruct, req_cond="ncp.ext_info_effective == 1" ),
+ srec( MacTimeStruct, req_cond="ncp.ext_info_mac_date == 1" ),
+ srec( LastAccessedTimeStruct, req_cond="ncp.ext_info_access == 1" ),
+ srec( FileSize64bitStruct, req_cond="ncp.ext_info_64_bit_fs == 1" ),
+ srec( FileName16Struct, req_cond="ncp.ret_info_mask_fname == 1" ),
+ ])
+ pkt.ReqCondSizeVariable()
+ pkt.CompletionCodes([0x0000, 0x0102, 0x7f00, 0x8000, 0x8101, 0x8401, 0x8501,
+ 0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
+ 0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
+ # 2222/5921, 89/33
+ pkt = NCP(0x5921, "Enhanced Open/Create File or Subdirectory II with Callback", 'file', has_length=0)
+ pkt.Request((41, 294), [
+ rec( 8, 1, NameSpace ),
+ rec( 9, 1, DataStream ),
+ rec( 10, 1, OpenCreateMode ),
+ rec( 11, 1, Reserved ),
+ rec( 12, 2, SearchAttributesLow ),
+ rec( 14, 2, Reserved2 ),
+ rec( 16, 2, ReturnInfoMask ),
+ rec( 18, 2, ExtendedInfo ),
+ rec( 20, 4, AttributesDef32 ),
+ rec( 24, 2, DesiredAccessRights ),
+ rec( 26, 4, DirectoryBase ),
+ rec( 30, 1, VolumeNumber ),
+ rec( 31, 1, HandleFlag ),
+ rec( 32, 1, DataTypeFlag ),
+ rec( 33, 5, Reserved5 ),
+ rec( 38, 1, PathCount, var="x" ),
+ rec( 39, (2,255), Path16, repeat="x" ),
+ ], info_str=(Path16, "Enhanced Open or Create II with Op-Lock: %s", "/%s"))
+ pkt.Reply( NO_LENGTH_CHECK, [
+ rec( 8, 4, FileHandle ),
+ rec( 12, 1, OpenCreateAction ),
+ rec( 13, 1, OCRetFlags ),
+ srec( DSSpaceAllocateStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
+ srec( PadDSSpaceAllocate, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
+ srec( AttributesStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
+ srec( PadAttributes, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
+ srec( DataStreamSizeStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
+ srec( PadDataStreamSize, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
+ srec( TotalStreamSizeStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
+ srec( PadTotalStreamSize, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
+ srec( CreationInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
+ srec( PadCreationInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
+ srec( ModifyInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
+ srec( PadModifyInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
+ srec( ArchiveInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
+ srec( PadArchiveInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
+ srec( RightsInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
+ srec( PadRightsInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
+ srec( DirEntryStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
+ srec( PadDirEntry, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
+ srec( EAInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
+ srec( PadEAInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
+ srec( NSInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
+ srec( PadNSInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
+ srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc == 1)" ),
+ srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
+ srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
+ srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
+ srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
+ srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
+ srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
+ srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
+ srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
+ srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
+ srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
+ srec( ReferenceIDStruct, req_cond="ncp.ret_info_mask_id == 1" ),
+ srec( NSAttributeStruct, req_cond="ncp.ret_info_mask_ns_attr == 1" ),
+ srec( DStreamActual, req_cond="ncp.ret_info_mask_actual == 1" ),
+ srec( DStreamLogical, req_cond="ncp.ret_info_mask_logical == 1" ),
+ srec( LastUpdatedInSecondsStruct, req_cond="ncp.ext_info_update == 1" ),
+ srec( DOSName16Struct, req_cond="ncp.ext_info_dos_name == 1" ),
+ srec( FlushTimeStruct, req_cond="ncp.ext_info_flush == 1" ),
+ srec( ParentBaseIDStruct, req_cond="ncp.ext_info_parental == 1" ),
+ srec( MacFinderInfoStruct, req_cond="ncp.ext_info_mac_finder == 1" ),
+ srec( SiblingCountStruct, req_cond="ncp.ext_info_sibling == 1" ),
+ srec( EffectiveRightsStruct, req_cond="ncp.ext_info_effective == 1" ),
+ srec( MacTimeStruct, req_cond="ncp.ext_info_mac_date == 1" ),
+ srec( LastAccessedTimeStruct, req_cond="ncp.ext_info_access == 1" ),
+ srec( FileSize64bitStruct, req_cond="ncp.ext_info_64_bit_fs == 1" ),
+ srec( FileName16Struct, req_cond="ncp.ret_info_mask_fname == 1" ),
+ ])
+ pkt.ReqCondSizeVariable()
+ pkt.CompletionCodes([0x0000, 0x0102, 0x8000, 0x8101, 0x8401, 0x8501,
+ 0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
+ 0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
+ # 2222/5923, 89/35
+ pkt = NCP(0x5923, "Enhanced Modify DOS Attributes on a File or Subdirectory", 'file', has_length=0)
+ pkt.Request((35, 288), [
+ rec( 8, 1, NameSpace ),
+ rec( 9, 1, Flags ),
+ rec( 10, 2, SearchAttributesLow ),
+ rec( 12, 2, ReturnInfoMask ),
+ rec( 14, 2, ExtendedInfo ),
+ rec( 16, 4, AttributesDef32 ),
+ rec( 20, 4, DirectoryBase ),
+ rec( 24, 1, VolumeNumber ),
+ rec( 25, 1, HandleFlag ),
+ rec( 26, 1, DataTypeFlag ),
+ rec( 27, 5, Reserved5 ),
+ rec( 32, 1, PathCount, var="x" ),
+ rec( 33, (2,255), Path16, repeat="x" ),
+ ], info_str=(Path16, "Enhanced Modify DOS Attributes for: %s", "/%s"))
+ pkt.Reply(24, [
+ rec( 8, 4, ItemsChecked ),
+ rec( 12, 4, ItemsChanged ),
+ rec( 16, 4, AttributeValidFlag ),
+ rec( 20, 4, AttributesDef32 ),
+ ])
+ pkt.CompletionCodes([0x0000, 0x0102, 0x8000, 0x8101, 0x8401, 0x8501,
+ 0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
+ 0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
+ # 2222/5927, 89/39
+ pkt = NCP(0x5927, "Enhanced Get Directory Disk Space Restriction", 'file', has_length=0)
+ pkt.Request((26, 279), [
+ rec( 8, 1, NameSpace ),
+ rec( 9, 2, Reserved2 ),
+ rec( 11, 4, DirectoryBase ),
+ rec( 15, 1, VolumeNumber ),
+ rec( 16, 1, HandleFlag ),
+ rec( 17, 1, DataTypeFlag ),
+ rec( 18, 5, Reserved5 ),
+ rec( 23, 1, PathCount, var="x" ),
+ rec( 24, (2,255), Path16, repeat="x" ),
+ ], info_str=(Path16, "Enhanced Get Disk Space Restriction for: %s", "/%s"))
+ pkt.Reply(18, [
+ rec( 8, 1, NumberOfEntries, var="x" ),
+ rec( 9, 9, SpaceStruct, repeat="x" ),
+ ])
+ pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
+ 0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
+ 0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00,
+ 0xff16])
+ # 2222/5928, 89/40
+ pkt = NCP(0x5928, "Enhanced Search for File or Subdirectory Set (Extended Errors)", 'file', has_length=0)
+ pkt.Request((30, 283), [
+ rec( 8, 1, NameSpace ),
+ rec( 9, 1, DataStream ),
+ rec( 10, 2, SearchAttributesLow ),
+ rec( 12, 2, ReturnInfoMask ),
+ rec( 14, 2, ExtendedInfo ),
+ rec( 16, 2, ReturnInfoCount ),
+ rec( 18, 9, SearchSequence ),
+ rec( 27, 1, DataTypeFlag ),
+ rec( 28, (2,255), SearchPattern16 ),
+ ], info_str=(SearchPattern16, "Enhanced Search for: %s", ", %s"))
+ pkt.Reply(NO_LENGTH_CHECK, [
+ rec( 8, 9, SearchSequence ),
+ rec( 17, 1, MoreFlag ),
+ rec( 18, 2, InfoCount ),
+ srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
+ srec( PadDSSpaceAllocate, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
+ srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
+ srec( PadAttributes, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
+ srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
+ srec( PadDataStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
+ srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
+ srec( PadTotalStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
+ srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
+ srec( PadCreationInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
+ srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
+ srec( PadModifyInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
+ srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
+ srec( PadArchiveInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
+ srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
+ srec( PadRightsInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
+ srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
+ srec( PadDirEntry, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
+ srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
+ srec( PadEAInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
+ srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
+ srec( PadNSInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
+ srec( FileName16Struct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_fname == 1)" ),
+ srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc == 1)" ),
+ srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
+ srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
+ srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
+ srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
+ srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
+ srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
+ srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
+ srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
+ srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
+ srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
+ srec( FileSize64bitStruct, req_cond="(ncp.ext_info_64_bit_fs == 1) && (ncp.ret_info_mask_fname == 1)" ),
+ srec( FileName16Struct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_fname == 1)" ),
+ ])
+ pkt.ReqCondSizeVariable()
+ pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
+ 0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
+ 0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
+ # 2222/5932, 89/50
+ pkt = NCP(0x5932, "Enhanced Get Object Effective Rights", "file", has_length=0)
+ pkt.Request(25, [
+ rec( 8, 1, NameSpace ),
+ rec( 9, 4, ObjectID ),
+ rec( 13, 4, DirectoryBase ),
+ rec( 17, 1, VolumeNumber ),
+ rec( 18, 1, HandleFlag ),
+ rec( 19, 1, DataTypeFlag ),
+ rec( 20, 5, Reserved5 ),
+ ])
+ pkt.Reply( 10, [
+ rec( 8, 2, TrusteeRights ),
+ ])
+ pkt.CompletionCodes([0x0000, 0x7e01, 0x9b00, 0x9c03, 0xa901, 0xaa00])
+ # 2222/5934, 89/52
+ pkt = NCP(0x5934, "Enhanced Write Extended Attribute", 'file', has_length=0 )
+ pkt.Request((36,98), [
+ rec( 8, 2, EAFlags ),
+ rec( 10, 4, EAHandleOrNetWareHandleOrVolume ),
+ rec( 14, 4, ReservedOrDirectoryNumber ),
+ rec( 18, 4, TtlWriteDataSize ),
+ rec( 22, 4, FileOffset ),
+ rec( 26, 4, EAAccessFlag ),
+ rec( 30, 1, DataTypeFlag ),
+ rec( 31, 2, EAValueLength, var='x' ),
+ rec( 33, (2,64), EAKey ),
+ rec( -1, 1, EAValueRep, repeat='x' ),
+ ], info_str=(EAKey, "Enhanced Write Extended Attribute: %s", ", %s"))
+ pkt.Reply(20, [
+ rec( 8, 4, EAErrorCodes ),
+ rec( 12, 4, EABytesWritten ),
+ rec( 16, 4, NewEAHandle ),
+ ])
+ pkt.CompletionCodes([0x0000, 0xc800, 0xc900, 0xcb00, 0xce00, 0xcf00, 0xd101,
+ 0xd203, 0xa901, 0xaa00, 0xd301, 0xd402])
+ # 2222/5935, 89/53
+ pkt = NCP(0x5935, "Enhanced Read Extended Attribute", 'file', has_length=0 )
+ pkt.Request((29,539), [
+ rec( 8, 2, EAFlags ),
+ rec( 10, 4, EAHandleOrNetWareHandleOrVolume ),
+ rec( 14, 4, ReservedOrDirectoryNumber ),
+ rec( 18, 4, FileOffset ),
+ rec( 22, 4, InspectSize ),
+ rec( 26, 1, DataTypeFlag ),
+ rec( 27, (2,512), EAKey ),
+ ], info_str=(EAKey, "Enhanced Read Extended Attribute: %s", ", %s"))
+ pkt.Reply((26,536), [
+ rec( 8, 4, EAErrorCodes ),
+ rec( 12, 4, TtlValuesLength ),
+ rec( 16, 4, NewEAHandle ),
+ rec( 20, 4, EAAccessFlag ),
+ rec( 24, (2,512), EAValue ),
+ ])
+ pkt.CompletionCodes([0x0000, 0xa901, 0xaa00, 0xc900, 0xce00, 0xcf00, 0xd101,
+ 0xd301])
+ # 2222/5936, 89/54
+ pkt = NCP(0x5936, "Enhanced Enumerate Extended Attribute", 'file', has_length=0 )
+ pkt.Request((27,537), [
+ rec( 8, 2, EAFlags ),
+ rec( 10, 4, EAHandleOrNetWareHandleOrVolume ),
+ rec( 14, 4, ReservedOrDirectoryNumber ),
+ rec( 18, 4, InspectSize ),
+ rec( 22, 2, SequenceNumber ),
+ rec( 24, 1, DataTypeFlag ),
+ rec( 25, (2,512), EAKey ),
+ ], info_str=(EAKey, "Enhanced Enumerate Extended Attribute: %s", ", %s"))
+ pkt.Reply(28, [
+ rec( 8, 4, EAErrorCodes ),
+ rec( 12, 4, TtlEAs ),
+ rec( 16, 4, TtlEAsDataSize ),
+ rec( 20, 4, TtlEAsKeySize ),
+ rec( 24, 4, NewEAHandle ),
+ ])
+ pkt.CompletionCodes([0x0000, 0x8800, 0xa901, 0xaa00, 0xc900, 0xce00, 0xcf00, 0xd101,
+ 0xd301])
+ # 2222/5947, 89/71
+ pkt = NCP(0x5947, "Enhanced Scan Volume Trustee Object Paths", 'file', has_length=0)
+ pkt.Request(21, [
+ rec( 8, 4, VolumeID ),
+ rec( 12, 4, ObjectID ),
+ rec( 16, 4, SequenceNumber ),
+ rec( 20, 1, DataTypeFlag ),
+ ])
+ pkt.Reply((20,273), [
+ rec( 8, 4, SequenceNumber ),
+ rec( 12, 4, ObjectID ),
+ rec( 16, 1, TrusteeAccessMask ),
+ rec( 17, 1, PathCount, var="x" ),
+ rec( 18, (2,255), Path16, repeat="x" ),
+ ])
+ pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
+ 0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
+ 0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
# 2222/5A01, 90/00
pkt = NCP(0x5A01, "Parse Tree", 'file')
- pkt.Request(26, [
+ pkt.Request(46, [
rec( 10, 4, InfoMask ),
rec( 14, 4, Reserved4 ),
rec( 18, 4, Reserved4 ),
rec( 22, 4, limbCount ),
+ rec( 26, 4, limbFlags ),
+ rec( 30, 4, VolumeNumberLong ),
+ rec( 34, 4, DirectoryBase ),
+ rec( 38, 4, limbScanNum ),
+ rec( 42, 4, NameSpace ),
])
pkt.Reply(32, [
rec( 8, 4, limbCount ),
@@ -13429,98 +14627,90 @@ def define_ncp2222():
pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600, 0xfb0b,
0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
- # 2222/5C00, 9201
+ # SecretStore data is dissected by packet-ncp-sss.c
+ # 2222/5C00, 9201
pkt = NCP(0x5C01, "SecretStore Services (Ping Server)", 'sss', 0)
- #Need info on this packet structure and SecretStore Verbs
pkt.Request(8)
pkt.Reply(8)
pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600, 0xfb0b,
0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
# 2222/5C01, 9202
- pkt = NCP(0x5C02, "SecretStore Services", 'sss', 0)
- #Need info on this packet structure and SecretStore Verbs
+ pkt = NCP(0x5C02, "SecretStore Services (Fragment)", 'sss', 0)
pkt.Request(8)
pkt.Reply(8)
pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600, 0xfb0b,
0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
# 2222/5C02, 9203
- pkt = NCP(0x5C03, "SecretStore Services", 'sss', 0)
- #Need info on this packet structure and SecretStore Verbs
+ pkt = NCP(0x5C03, "SecretStore Services (Write App Secrets)", 'sss', 0)
pkt.Request(8)
pkt.Reply(8)
pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600, 0xfb0b,
0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
# 2222/5C03, 9204
- pkt = NCP(0x5C04, "SecretStore Services", 'sss', 0)
- #Need info on this packet structure and SecretStore Verbs
+ pkt = NCP(0x5C04, "SecretStore Services (Add Secret ID)", 'sss', 0)
pkt.Request(8)
pkt.Reply(8)
pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600, 0xfb0b,
0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
# 2222/5C04, 9205
- pkt = NCP(0x5C05, "SecretStore Services", 'sss', 0)
- #Need info on this packet structure and SecretStore Verbs
+ pkt = NCP(0x5C05, "SecretStore Services (Remove Secret ID)", 'sss', 0)
pkt.Request(8)
pkt.Reply(8)
pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600, 0xfb0b,
0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
# 2222/5C05, 9206
- pkt = NCP(0x5C06, "SecretStore Services", 'sss', 0)
- #Need info on this packet structure and SecretStore Verbs
+ pkt = NCP(0x5C06, "SecretStore Services (Remove SecretStore)", 'sss', 0)
pkt.Request(8)
pkt.Reply(8)
pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600, 0xfb0b,
0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
# 2222/5C06, 9207
- pkt = NCP(0x5C07, "SecretStore Services", 'sss', 0)
- #Need info on this packet structure and SecretStore Verbs
+ pkt = NCP(0x5C07, "SecretStore Services (Enumerate Secret IDs)", 'sss', 0)
pkt.Request(8)
pkt.Reply(8)
pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600, 0xfb0b,
0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
# 2222/5C07, 9208
- pkt = NCP(0x5C08, "SecretStore Services", 'sss', 0)
- #Need info on this packet structure and SecretStore Verbs
+ pkt = NCP(0x5C08, "SecretStore Services (Unlock Store)", 'sss', 0)
pkt.Request(8)
pkt.Reply(8)
pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600, 0xfb0b,
0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
# 2222/5C08, 9209
- pkt = NCP(0x5C09, "SecretStore Services", 'sss', 0)
- #Need info on this packet structure and SecretStore Verbs
+ pkt = NCP(0x5C09, "SecretStore Services (Set Master Password)", 'sss', 0)
pkt.Request(8)
pkt.Reply(8)
pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600, 0xfb0b,
0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
# 2222/5C09, 920a
- pkt = NCP(0x5C0a, "SecretStore Services", 'sss', 0)
- #Need info on this packet structure and SecretStore Verbs
+ pkt = NCP(0x5C0a, "SecretStore Services (Get Service Information)", 'sss', 0)
pkt.Request(8)
pkt.Reply(8)
pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600, 0xfb0b,
0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
+ # NMAS packets are dissected in packet-ncp-nmas.c
# 2222/5E, 9401
- pkt = NCP(0x5E01, "NMAS Communications Packet", 'nmas', 0)
+ pkt = NCP(0x5E01, "NMAS Communications Packet (Ping)", 'nmas', 0)
pkt.Request(8)
pkt.Reply(8)
pkt.CompletionCodes([0x0000, 0xfb09])
# 2222/5E, 9402
- pkt = NCP(0x5E02, "NMAS Communications Packet", 'nmas', 0)
+ pkt = NCP(0x5E02, "NMAS Communications Packet (Fragment)", 'nmas', 0)
pkt.Request(8)
pkt.Reply(8)
pkt.CompletionCodes([0x0000, 0xfb09])
# 2222/5E, 9403
- pkt = NCP(0x5E03, "NMAS Communications Packet", 'nmas', 0)
+ pkt = NCP(0x5E03, "NMAS Communications Packet (Abort)", 'nmas', 0)
pkt.Request(8)
pkt.Reply(8)
pkt.CompletionCodes([0x0000, 0xfb09])
@@ -13577,16 +14767,6 @@ def define_ncp2222():
pkt.ReqCondSizeVariable()
pkt.CompletionCodes([0x0000, 0x8100, 0xfb04, 0xfe0c])
# 2222/6802, 104/02
- #
- # XXX - if FraggerHandle is not 0xffffffff, this is not the
- # first fragment, so we can only dissect this by reassembling;
- # the fields after "Fragment Handle" are bogus for non-0xffffffff
- # fragments, so we shouldn't dissect them.
- #
- # XXX - are there TotalRequest requests in the packet, and
- # does each of them have NDSFlags and NDSVerb fields, or
- # does only the first one have it?
- #
pkt = NCP(0x6802, "Send NDS Fragmented Request/Reply", "nds", has_length=0)
pkt.Request(8)
pkt.Reply(8)
@@ -13635,9 +14815,6 @@ def define_ncp2222():
pkt = NCP(0x68C8, "Query Container Audit Status", "auditing", has_length=0)
pkt.Request(12, [
rec( 8, 4, ConnectionNumber ),
-# rec( 12, 4, AuditIDType, LE ),
-# rec( 16, 4, AuditID ),
-# rec( 20, 2, BufferSize ),
])
pkt.Reply(40, [
rec(8, 32, NWAuditStatus ),
@@ -13915,10 +15092,7 @@ def define_ncp2222():
pkt.CompletionCodes([0x0000, 0x7e00, 0xfb06, 0xff00])
# 2222/7B01, 123/01
pkt = NCP(0x7B01, "Get Cache Information", 'stats')
- pkt.Request(12, [
- rec(10, 1, VersionNumber),
- rec(11, 1, RevisionNumber),
- ])
+ pkt.Request(10)
pkt.Reply(288, [
rec(8, 4, CurrentServerTime, LE),
rec(12, 1, VConsoleVersion ),
@@ -13963,7 +15137,7 @@ def define_ncp2222():
# 2222/7B04, 123/04
pkt = NCP(0x7B04, "User Information", 'stats')
pkt.Request(14, [
- rec(10, 4, ConnectionNumber ),
+ rec(10, 4, ConnectionNumber, LE ),
])
pkt.Reply((85, 132), [
rec(8, 4, CurrentServerTime ),
@@ -14670,10 +15844,9 @@ def define_ncp2222():
rec(32, 1, SetCmdFlags ),
rec(33, 3, Reserved3 ),
rec(36, PROTO_LENGTH_UNKNOWN, SetCmdName ),
- #rec(136, 4, SetCmdValueNum ),
])
pkt.ReqCondSizeVariable()
- pkt.CompletionCodes([0x0000, 0x7e01, 0xfb06, 0xff00])
+ pkt.CompletionCodes([0x0000, 0x7e01, 0xc600, 0xfb06, 0xff00])
# 2222/7B46, 123/70
pkt = NCP(0x7B46, "Get Current Compressing File", 'stats')
pkt.Request(14, [
diff --git a/epan/dissectors/packet-ncp-int.h b/epan/dissectors/packet-ncp-int.h
index 765ec04d83..1b5417b992 100644
--- a/epan/dissectors/packet-ncp-int.h
+++ b/epan/dissectors/packet-ncp-int.h
@@ -30,6 +30,8 @@
#ifndef __PACKET_NCP_INT_H__
#define __PACKET_NCP_INT_H__
+#include <epan/expert.h>
+
typedef struct _ptvc_record ptvc_record;
typedef struct _sub_ptvc_record sub_ptvc_record;
@@ -44,6 +46,17 @@ struct _ptvc_record {
unsigned int special_fmt : 2;
};
+/*
+ * Every NCP packet has this common header (except for burst packets).
+ */
+struct ncp_common_header {
+ guint16 type;
+ guint8 sequence;
+ guint8 conn_low;
+ guint8 task;
+ guint8 conn_high; /* type=0x5555 doesn't have this */
+};
+
#define NCP_FMT_NONE 0
#define NCP_FMT_NW_DATE 1
#define NCP_FMT_NW_TIME 2
@@ -68,6 +81,14 @@ typedef struct {
const char *repeat_string;
} info_string_t;
+
+struct novell_tap {
+ int stat;
+ int hdr;
+};
+
+typedef struct novell_tap _novell_tap;
+
typedef struct {
guint8 error_in_packet;
gint ncp_error_index;
@@ -105,7 +126,7 @@ void dissect_ncp_request(tvbuff_t*, packet_info*, guint16,
guint8, guint16, proto_tree*);
void dissect_ncp_reply(tvbuff_t *, packet_info*, guint16, guint8,
- guint16, proto_tree*);
+ guint16, proto_tree*, struct novell_tap*);
void dissect_ping_req(tvbuff_t *, packet_info*, guint16, guint8,
guint16, proto_tree*);
@@ -114,7 +135,7 @@ void dissect_nds_request(tvbuff_t*, packet_info*, guint16,
guint8, guint16, proto_tree*);
void nds_defrag(tvbuff_t*, packet_info*, guint16,
- guint8, guint16, proto_tree*);
+ guint8, guint16, proto_tree*, struct novell_tap*);
extern int proto_ncp;
extern gint ett_ncp;
@@ -122,10 +143,10 @@ extern gint ett_nds;
extern gint ett_nds_segments;
extern gint ett_nds_segment;
-
+/*extern dissector_handle_t nds_data_handle;*/
extern GHashTable *nds_fragment_table;
extern GHashTable *nds_reassembled_table;
-extern dissector_handle_t nds_data_handle;
+
/*
* NCP packet types.
*/
diff --git a/epan/dissectors/packet-ncp-sss.c b/epan/dissectors/packet-ncp-sss.c
new file mode 100644
index 0000000000..2b6e93df8b
--- /dev/null
+++ b/epan/dissectors/packet-ncp-sss.c
@@ -0,0 +1,977 @@
+
+/* packet-ncp-sss.c
+ * Routines for Novell SecretStore Services
+ * Greg Morris <gmorris@novell.com>
+ * Copyright (c) Novell, Inc. 2002-2003
+ *
+ * $Id: packet-ncp-sss.c,v 1.00 2003/06/26 11:36:14 guy Exp $
+ *
+ * Ethereal - Network traffic analyzer
+ * By Gerald Combs <gerald@ethereal.com>
+ * Copyright 1998 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 <string.h>
+#include <glib.h>
+#include <epan/packet.h>
+#include "prefs.h"
+#include "packet-ncp-int.h"
+#include "packet-ncp-sss.h"
+
+static guint32 subverb=0;
+
+static gint ett_sss = -1;
+
+static int proto_sss = -1;
+static int hf_buffer_size = -1;
+static int hf_ping_version = -1;
+static int hf_flags = -1;
+static int hf_context = -1;
+static int hf_frag_handle = -1;
+static int hf_length = -1;
+static int hf_verb = -1;
+static int hf_user = -1;
+static int hf_secret = -1;
+static int hf_sss_version = -1;
+static int hf_return_code = -1;
+static int hf_enc_cred = -1;
+static int hf_enc_data = -1;
+static int hfbit1 = -1;
+static int hfbit2 = -1;
+static int hfbit3 = -1;
+static int hfbit4 = -1;
+static int hfbit5 = -1;
+static int hfbit6 = -1;
+static int hfbit7 = -1;
+static int hfbit8 = -1;
+static int hfbit9 = -1;
+static int hfbit10 = -1;
+static int hfbit11 = -1;
+static int hfbit12 = -1;
+static int hfbit13 = -1;
+static int hfbit14 = -1;
+static int hfbit15 = -1;
+static int hfbit16 = -1;
+static int hfbit17 = -1;
+static int hfbit18 = -1;
+static int hfbit19 = -1;
+static int hfbit20 = -1;
+static int hfbit21 = -1;
+static int hfbit22 = -1;
+static int hfbit23 = -1;
+static int hfbit24 = -1;
+static int hfbit25 = -1;
+static int hfbit26 = -1;
+static int hfbit27 = -1;
+static int hfbit28 = -1;
+static int hfbit29 = -1;
+static int hfbit30 = -1;
+static int hfbit31 = -1;
+static int hfbit32 = -1;
+
+static proto_item *expert_item = NULL;
+
+static const value_string sss_func_enum[] = {
+ { 0x00000001, "Ping Server" },
+ { 0x00000002, "Fragment" },
+ { 0x00000003, "Write App Secrets" },
+ { 0x00000004, "Add Secret ID" },
+ { 0x00000005, "Remove Secret ID" },
+ { 0x00000006, "Remove SecretStore" },
+ { 0x00000007, "Enumerate Secret IDs" },
+ { 0x00000008, "Unlock Store" },
+ { 0x00000009, "Set Master Password" },
+ { 0x0000000a, "Get Service Information" },
+ { 0, NULL }
+};
+
+
+static const value_string sss_verb_enum[] = {
+ { 0x00000000, "Query Server" },
+ { 0x00000001, "Read App Secrets" },
+ { 0x00000002, "Write App Secrets" },
+ { 0x00000003, "Add Secret ID" },
+ { 0x00000004, "Remove Secret ID" },
+ { 0x00000005, "Remove SecretStore" },
+ { 0x00000006, "Enumerate Secret IDs" },
+ { 0x00000007, "Unlock Store" },
+ { 0x00000008, "Set Master Password" },
+ { 0x00000009, "Get Service Information" },
+ { 0x000000ff, "Fragment"},
+ { 0, NULL }
+};
+
+static const value_string sss_subverb_enum[] = {
+ { 0, "Fragmented Ping" },
+ { 2, "Client Put Data" },
+ { 4, "Client Get Data" },
+ { 6, "Client Get User NDS Credentials" },
+ { 8, "Login Store Management" },
+ { 10, "Writable Object Check" },
+ { 1242, "Message Handler" },
+ { 0, NULL }
+};
+
+static const value_string sss_msgverb_enum[] = {
+ { 1, "Echo Data" },
+ { 3, "Start Session" },
+ { 5, "Client Write Data" },
+ { 7, "Client Read Data" },
+ { 9, "End Session" },
+ { 0, NULL }
+};
+
+static const value_string sss_attribute_enum[] = {
+ { 1, "User Name" },
+ { 2, "Tree Name" },
+ { 4, "Clearence" },
+ { 11, "Login Sequence" },
+ { 0, NULL }
+};
+
+static const value_string sss_lsmverb_enum[] = {
+ { 1, "Put Login Configuration" },
+ { 2, "Get Login Configuration" },
+ { 4, "Delete Login Configuration" },
+ { 5, "Put Login Secret" },
+ { 6, "Delete Login Secret" },
+ { 0, NULL }
+};
+
+static const value_string sss_errors_enum[] = {
+ { 0xFFFFFCE0, "(-800) Target object could not be found" },
+ { 0xFFFFFCDF, "(-801) NICI operations have failed" },
+ { 0xFFFFFCDE, "(-802) The Secret ID is not in the user secret store" },
+ { 0xFFFFFCDD, "(-803) Some internal operating system services have not been available" },
+ { 0xFFFFFCDC, "(-804) Access to the target Secret Store has been denied" },
+ { 0xFFFFFCDB, "(-805) NDS internal NDS services have not been available" },
+ { 0xFFFFFCDA, "(-806) Secret has not been initialized with a write" },
+ { 0xFFFFFCD9, "(-807) Size of the buffer is not in a nominal range between minimum and maximum" },
+ { 0xFFFFFCD8, "(-808) Client and server components are not of the compatible versions" },
+ { 0xFFFFFCD7, "(-809) Secret Store data on the server has been corrupted" },
+ { 0xFFFFFCD6, "(-810) Secret ID already exists in the SecretStore" },
+ { 0xFFFFFCD5, "(-811) User NDS password has been changed by the administrator" },
+ { 0xFFFFFCD4, "(-812) Target NDS user object not found" },
+ { 0xFFFFFCD3, "(-813) Target NDS user object does not have a Secret Store" },
+ { 0xFFFFFCD2, "(-814) Secret Store is not on the network" },
+ { 0xFFFFFCD1, "(-815) Length of the Secret ID buffer exceeds the limit" },
+ { 0xFFFFFCD0, "(-816) Length of the enumeration buffer is too short" },
+ { 0xFFFFFCCF, "(-817) User not authenticated" },
+ { 0xFFFFFCCE, "(-818) Not supported operations" },
+ { 0xFFFFFCCD, "(-819) Typed in NDS password not valid" },
+ { 0xFFFFFCCC, "(-820) Session keys of the client and server NICI are out of sync" },
+ { 0xFFFFFCCB, "(-821) Requested service not yet supported" },
+ { 0xFFFFFCCA, "(-822) NDS authentication type not supported" },
+ { 0xFFFFFCC9, "(-823) Unicode text conversion operation failed" },
+ { 0xFFFFFCC8, "(-824) Connection to server is lost" },
+ { 0xFFFFFCC7, "(-825) Cryptographic operation failed" },
+ { 0xFFFFFCC6, "(-826) Opening a connection to the server failed" },
+ { 0xFFFFFCC5, "(-827) Access to server connection failed" },
+ { 0xFFFFFCC4, "(-828) Size of the enumeration buffer exceeds the limit" },
+ { 0xFFFFFCC3, "(-829) Size of the Secret buffer exceeds the limit" },
+ { 0xFFFFFCC2, "(-830) Length of the Secret ID should be greater than zero" },
+ { 0xFFFFFCC1, "(-831) Protocol data corrupted on the wire" },
+ { 0xFFFFFCC0, "(-832) Enhanced protection's password validation failed. Access to the secret denied" },
+ { 0xFFFFFCBF, "(-833) Schema is not extended to support SecretStore on the target tree" },
+ { 0xFFFFFCBE, "(-834) One of the optional service attributes is not instantiated" },
+ { 0xFFFFFCBD, "(-835) Server has been upgraded and the users SecretStore should be updated" },
+ { 0xFFFFFCBC, "(-836) Master password could not be verified to read or unlock the secrets" },
+ { 0xFFFFFCBB, "(-837) Master password has not been set on the SecretStore" },
+ { 0xFFFFFCBA, "(-838) Ability to use master password has been disabled" },
+ { 0xFFFFFCB9, "(-839) Not a writeable replica of NDS" },
+ { 0xFFFFFCB8, "(-840) The API was unable to find a value for an attribute in the Directory" },
+ { 0xFFFFFCB7, "(-841) A parameter passed to the API has not been properly initialized" },
+ { 0xFFFFFCB6, "(-842) The connection to SecretStore requires SSL to be secure" },
+ { 0xFFFFFCB5, "(-843) The client could not locate a server that supports the policy override required by the caller" },
+ { 0xFFFFFCB4, "(-844) Attempt to unlock SecretStore failed because the store is not locked" },
+ { 0xFFFFFCB3, "(-845) NDS Replica on the server that holds SecretStore is out of sync with the replica ring" },
+ { 0xFFFFFC88, "(-888) Feature not yet implemented" },
+ { 0xFFFFFC7D, "(-899) Products BETA life has expired" },
+ { 0, NULL }
+};
+
+
+static void
+process_flags(proto_tree *sss_tree, tvbuff_t *tvb, guint32 foffset)
+{
+ gchar flags_str[1024];
+ gchar *sep;
+ proto_item *tinew;
+ proto_tree *flags_tree;
+ guint32 i;
+ guint32 bvalue = 0;
+ guint32 flags = 0;
+
+ bvalue = 0x00000001;
+ flags_str[0]='\0';
+ sep="";
+ flags = tvb_get_ntohl(tvb, foffset);
+ for (i = 0 ; i < 256; i++)
+ {
+ if (flags & bvalue)
+ {
+ strcat(flags_str, sep);
+ switch(bvalue)
+ {
+ case 0x00000001:
+ strcat(flags_str, "Enhanced Protection");
+ break;
+ case 0x00000002:
+ strcat(flags_str, "Create ID");
+ break;
+ case 0x00000004:
+ strcat(flags_str, "Remove Lock");
+ break;
+ case 0x00000008:
+ strcat(flags_str, "Repair");
+ break;
+ case 0x00000010:
+ strcat(flags_str, "Unicode");
+ break;
+ case 0x00000020:
+ strcat(flags_str, "EP Master Password Used");
+ break;
+ case 0x00000040:
+ strcat(flags_str, "EP Password Used");
+ break;
+ case 0x00000080:
+ strcat(flags_str, "Set Tree Name");
+ break;
+ case 0x00000100:
+ strcat(flags_str, "Get Context");
+ break;
+ case 0x00000200:
+ strcat(flags_str, "Destroy Context");
+ break;
+ case 0x00000400:
+ strcat(flags_str, "Not Defined");
+ break;
+ case 0x00000800:
+ strcat(flags_str, "Not Defined");
+ break;
+ case 0x00001000:
+ strcat(flags_str, "EP Lock");
+ break;
+ case 0x00002000:
+ strcat(flags_str, "Not Initialized");
+ break;
+ case 0x00004000:
+ strcat(flags_str, "Enhanced Protection");
+ break;
+ case 0x00008000:
+ strcat(flags_str, "Store Not Synced");
+ break;
+ case 0x00010000:
+ strcat(flags_str, "Admin Last Modified");
+ break;
+ case 0x00020000:
+ strcat(flags_str, "EP Password Present");
+ break;
+ case 0x00040000:
+ strcat(flags_str, "EP Master Password Present");
+ break;
+ case 0x00080000:
+ strcat(flags_str, "MP Disabled");
+ break;
+ case 0x00100000:
+ strcat(flags_str, "Not Defined");
+ break;
+ case 0x00200000:
+ strcat(flags_str, "Not Defined");
+ break;
+ case 0x00400000:
+ strcat(flags_str, "Not Defined");
+ break;
+ case 0x00800000:
+ strcat(flags_str, "Not Defined");
+ break;
+ case 0x01000000:
+ strcat(flags_str, "Not Defined");
+ break;
+ case 0x02000000:
+ strcat(flags_str, "Not Defined");
+ break;
+ case 0x04000000:
+ strcat(flags_str, "Not Defined");
+ break;
+ case 0x08000000:
+ strcat(flags_str, "Not Defined");
+ break;
+ case 0x10000000:
+ strcat(flags_str, "Not Defined");
+ break;
+ case 0x20000000:
+ strcat(flags_str, "Not Defined");
+ break;
+ case 0x40000000:
+ strcat(flags_str, "Not Defined");
+ break;
+ case 0x80000000:
+ strcat(flags_str, "Not Defined");
+ break;
+ default:
+ break;
+ }
+ sep = ", ";
+ }
+ bvalue = bvalue*2;
+ }
+ tinew = proto_tree_add_uint_format(sss_tree, hf_flags, tvb, foffset, 4, flags, "%s 0x%08x", "Flags:", flags);
+ flags_tree = proto_item_add_subtree(tinew, ett_nds);
+
+ bvalue = 0x00000001;
+
+ for (i = 0 ; i < 256; i++ )
+ {
+ if (flags & bvalue)
+ {
+ switch(bvalue)
+ {
+ case 0x00000001:
+ proto_tree_add_item(flags_tree, hfbit1, tvb, foffset, 4, FALSE);
+ break;
+ case 0x00000002:
+ proto_tree_add_item(flags_tree, hfbit2, tvb, foffset, 4, FALSE);
+ break;
+ case 0x00000004:
+ proto_tree_add_item(flags_tree, hfbit3, tvb, foffset, 4, FALSE);
+ break;
+ case 0x00000008:
+ proto_tree_add_item(flags_tree, hfbit4, tvb, foffset, 4, FALSE);
+ break;
+ case 0x00000010:
+ proto_tree_add_item(flags_tree, hfbit5, tvb, foffset, 4, FALSE);
+ break;
+ case 0x00000020:
+ proto_tree_add_item(flags_tree, hfbit6, tvb, foffset, 4, FALSE);
+ break;
+ case 0x00000040:
+ proto_tree_add_item(flags_tree, hfbit7, tvb, foffset, 4, FALSE);
+ break;
+ case 0x00000080:
+ proto_tree_add_item(flags_tree, hfbit8, tvb, foffset, 4, FALSE);
+ break;
+ case 0x00000100:
+ proto_tree_add_item(flags_tree, hfbit9, tvb, foffset, 4, FALSE);
+ break;
+ case 0x00000200:
+ proto_tree_add_item(flags_tree, hfbit10, tvb, foffset, 4, FALSE);
+ break;
+ case 0x00000400:
+ proto_tree_add_item(flags_tree, hfbit11, tvb, foffset, 4, FALSE);
+ break;
+ case 0x00000800:
+ proto_tree_add_item(flags_tree, hfbit12, tvb, foffset, 4, FALSE);
+ break;
+ case 0x00001000:
+ proto_tree_add_item(flags_tree, hfbit13, tvb, foffset, 4, FALSE);
+ break;
+ case 0x00002000:
+ proto_tree_add_item(flags_tree, hfbit14, tvb, foffset, 4, FALSE);
+ break;
+ case 0x00004000:
+ proto_tree_add_item(flags_tree, hfbit15, tvb, foffset, 4, FALSE);
+ break;
+ case 0x00008000:
+ proto_tree_add_item(flags_tree, hfbit16, tvb, foffset, 4, FALSE);
+ break;
+ case 0x00010000:
+ proto_tree_add_item(flags_tree, hfbit17, tvb, foffset, 4, FALSE);
+ break;
+ case 0x00020000:
+ proto_tree_add_item(flags_tree, hfbit18, tvb, foffset, 4, FALSE);
+ break;
+ case 0x00040000:
+ proto_tree_add_item(flags_tree, hfbit19, tvb, foffset, 4, FALSE);
+ break;
+ case 0x00080000:
+ proto_tree_add_item(flags_tree, hfbit20, tvb, foffset, 4, FALSE);
+ break;
+ case 0x00100000:
+ proto_tree_add_item(flags_tree, hfbit21, tvb, foffset, 4, FALSE);
+ break;
+ case 0x00200000:
+ proto_tree_add_item(flags_tree, hfbit22, tvb, foffset, 4, FALSE);
+ break;
+ case 0x00400000:
+ proto_tree_add_item(flags_tree, hfbit23, tvb, foffset, 4, FALSE);
+ break;
+ case 0x00800000:
+ proto_tree_add_item(flags_tree, hfbit24, tvb, foffset, 4, FALSE);
+ break;
+ case 0x01000000:
+ proto_tree_add_item(flags_tree, hfbit25, tvb, foffset, 4, FALSE);
+ break;
+ case 0x02000000:
+ proto_tree_add_item(flags_tree, hfbit26, tvb, foffset, 4, FALSE);
+ break;
+ case 0x04000000:
+ proto_tree_add_item(flags_tree, hfbit27, tvb, foffset, 4, FALSE);
+ break;
+ case 0x08000000:
+ proto_tree_add_item(flags_tree, hfbit28, tvb, foffset, 4, FALSE);
+ break;
+ case 0x10000000:
+ proto_tree_add_item(flags_tree, hfbit29, tvb, foffset, 4, FALSE);
+ break;
+ case 0x20000000:
+ proto_tree_add_item(flags_tree, hfbit30, tvb, foffset, 4, FALSE);
+ break;
+ case 0x40000000:
+ proto_tree_add_item(flags_tree, hfbit31, tvb, foffset, 4, FALSE);
+ break;
+ case 0x80000000:
+ proto_tree_add_item(flags_tree, hfbit32, tvb, foffset, 4, FALSE);
+ break;
+ default:
+ break;
+ }
+ }
+ bvalue = bvalue*2;
+ }
+ return;
+}
+
+static int
+find_delimiter(tvbuff_t *tvb, int foffset)
+{
+ int i;
+ int length = 0;
+ guint16 c_char;
+
+ for (i=0; i < 256; i++)
+ {
+ c_char = tvb_get_guint8(tvb, foffset);
+ if (c_char == 0x2a || tvb_length_remaining(tvb, foffset)==0)
+ {
+ break;
+ }
+ foffset++;
+ length++;
+ }
+ return length;
+}
+
+static int
+sss_string(tvbuff_t* tvb, int hfinfo, proto_tree *sss_tree, int offset, gboolean little, guint32 length)
+{
+ int foffset = offset;
+ guint32 str_length;
+ char buffer[1024];
+ guint32 i;
+ guint16 c_char;
+ guint32 length_remaining = 0;
+
+ if (length==0)
+ {
+ if (little) {
+ str_length = tvb_get_letohl(tvb, foffset);
+ }
+ else
+ {
+ str_length = tvb_get_ntohl(tvb, foffset);
+ }
+ foffset += 4;
+ }
+ else
+ {
+ str_length = length;
+ }
+ length_remaining = tvb_length_remaining(tvb, foffset);
+ if(str_length > (guint)length_remaining || str_length > 1024)
+ {
+ proto_tree_add_string(sss_tree, hfinfo, tvb, foffset,
+ length_remaining + 4, "<String too long to process>");
+ foffset += length_remaining;
+ return foffset;
+ }
+ if(str_length == 0)
+ {
+ proto_tree_add_string(sss_tree, hfinfo, tvb, offset,
+ 4, "<Not Specified>");
+ return foffset;
+ }
+ for ( i = 0; i < str_length; i++ )
+ {
+ c_char = tvb_get_guint8(tvb, foffset );
+ if (c_char<0x20 || c_char>0x7e)
+ {
+ if (c_char != 0x00)
+ {
+ c_char = 0x2e;
+ buffer[i] = c_char & 0xff;
+ }
+ else
+ {
+ i--;
+ str_length--;
+ }
+ }
+ else
+ {
+ buffer[i] = c_char & 0xff;
+ }
+ foffset++;
+ length_remaining--;
+
+ if(length_remaining==1)
+ {
+ i++;
+ break;
+ }
+ }
+ buffer[i] = '\0';
+
+ if (length==0)
+ {
+ if (little) {
+ str_length = tvb_get_letohl(tvb, offset);
+ }
+ else
+ {
+ str_length = tvb_get_ntohl(tvb, offset);
+ }
+ offset += 4;
+ }
+ else
+ {
+ str_length = length;
+ }
+ proto_tree_add_string(sss_tree, hfinfo, tvb, offset,
+ str_length, buffer);
+ return foffset;
+}
+
+void
+dissect_sss_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, ncp_req_hash_value *request_value)
+{
+ guint8 func, subfunc = 0;
+ guint32 msg_length=0;
+ guint32 foffset= 0;
+ proto_tree *atree;
+ proto_item *aitem;
+
+
+ if (tvb_length_remaining(tvb, foffset)<4) {
+ return;
+ }
+ foffset = 6;
+ func = tvb_get_guint8(tvb, foffset);
+ foffset += 1;
+ subfunc = tvb_get_guint8(tvb, foffset);
+ foffset += 1;
+
+ /* Fill in the INFO column. */
+ if (check_col(pinfo->cinfo, COL_INFO)) {
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "NSSS");
+ col_add_fstr(pinfo->cinfo, COL_INFO, "C SecretStore - %s", match_strval(subfunc, sss_func_enum));
+ }
+ switch (subfunc) {
+ case 1:
+ aitem = proto_tree_add_text(ncp_tree, tvb, foffset, tvb_length_remaining(tvb, foffset), "Packet Type: %s", match_strval(subfunc, sss_func_enum));
+ atree = proto_item_add_subtree(aitem, ett_sss);
+ proto_tree_add_item(atree, hf_ping_version, tvb, foffset, 4, TRUE);
+ foffset += 4;
+ proto_tree_add_item(atree, hf_flags, tvb, foffset, 4, TRUE);
+ foffset += 4;
+ break;
+ case 2:
+ proto_tree_add_item(ncp_tree, hf_frag_handle, tvb, foffset, 4, TRUE);
+ if (tvb_get_letohl(tvb, foffset)==0xffffffff)
+ {
+ foffset += 4;
+ proto_tree_add_item(ncp_tree, hf_buffer_size, tvb, foffset, 4, TRUE);
+ foffset += 4;
+ proto_tree_add_item(ncp_tree, hf_length, tvb, foffset, 4, TRUE);
+ foffset += 4;
+ foffset += 12; /* Blank Context */
+ subverb = tvb_get_letohl(tvb, foffset);
+ if (check_col(pinfo->cinfo, COL_INFO)) {
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", match_strval(subverb, sss_verb_enum));
+ }
+ aitem = proto_tree_add_item(ncp_tree, hf_verb, tvb, foffset, 4, TRUE);
+ atree = proto_item_add_subtree(aitem, ett_sss);
+ if (request_value) {
+ request_value->req_nds_flags=subverb;
+ }
+ foffset += 4;
+ process_flags(atree, tvb, foffset);
+ foffset += 4;
+ proto_tree_add_item(atree, hf_context, tvb, foffset, 4, FALSE);
+ foffset += 4;
+ switch (subverb) {
+ case 0:
+ foffset += 4;
+ foffset = sss_string(tvb, hf_user, atree, foffset, TRUE, 0);
+ break;
+ case 1:
+ foffset = sss_string(tvb, hf_secret, atree, foffset, TRUE, 0);
+ msg_length = tvb_get_letohl(tvb, foffset);
+ foffset += (msg_length+4); /* Unsure of what this length and parameter are */
+ /* A bad secret of length greater then 256 characters will cause frag
+ packets and then we will see these as malformed packets.
+ So check to make sure we still have data in the packet anytime
+ we read a secret. */
+ if (tvb_length_remaining(tvb, foffset) > 4)
+ {
+ foffset = sss_string(tvb, hf_user, atree, foffset, TRUE, 0);
+ }
+ break;
+ case 2:
+ foffset += 4;
+ foffset = sss_string(tvb, hf_secret, atree, foffset, TRUE, 0);
+ if (tvb_length_remaining(tvb, foffset) > 4)
+ {
+ msg_length = tvb_get_letohl(tvb, foffset);
+ foffset += 4;
+ proto_tree_add_item(atree, hf_enc_data, tvb, foffset, msg_length, TRUE);
+ }
+ break;
+ case 3:
+ case 4:
+ foffset = sss_string(tvb, hf_secret, atree, foffset, TRUE, 0);
+ if (tvb_length_remaining(tvb, foffset) > 4)
+ {
+ foffset = sss_string(tvb, hf_user, atree, foffset, TRUE, 0);
+ }
+ break;
+ case 5:
+ break;
+ case 6:
+ foffset = sss_string(tvb, hf_secret, atree, foffset, TRUE, 0);
+ if (tvb_length_remaining(tvb, foffset) > 4)
+ {
+ foffset = sss_string(tvb, hf_user, atree, foffset, TRUE, 0);
+ }
+ break;
+ case 7:
+ msg_length = tvb_get_letohl(tvb, foffset);
+ foffset += 4;
+ proto_tree_add_item(atree, hf_enc_cred, tvb, foffset, msg_length, FALSE);
+ break;
+ case 8:
+ case 9:
+ default:
+ break;
+ }
+
+ }
+ else
+ {
+ if (check_col(pinfo->cinfo, COL_INFO)) {
+ col_add_fstr(pinfo->cinfo, COL_INFO, "C SecretStore - fragment");
+ proto_tree_add_text(ncp_tree, tvb, foffset, 4, "Fragment");
+ }
+ /* Fragments don't really carry a subverb so store 0xff as the subverb number */
+ if (request_value) {
+ request_value->req_nds_flags=255;
+ }
+ if (tvb_length_remaining(tvb, foffset) > 8)
+ {
+ foffset += 4;
+ proto_tree_add_item(ncp_tree, hf_enc_data, tvb, foffset, tvb_length_remaining(tvb, foffset), TRUE);
+ }
+ }
+ break;
+ case 3:
+ /* No Op */
+ break;
+ default:
+ break;
+ }
+}
+
+void
+dissect_sss_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, guint8 subfunc, ncp_req_hash_value *request_value)
+{
+ guint32 foffset=0;
+ guint32 subverb=0;
+ guint8 msgverb=0;
+ guint32 msg_length=0;
+ guint32 return_code=0;
+ guint32 number_of_items=0;
+ gint32 length_of_string=0;
+ guint32 i = 0;
+
+ proto_tree *atree;
+ proto_item *aitem;
+
+ foffset = 8;
+ if (request_value) {
+ subverb = request_value->req_nds_flags;
+ msgverb = request_value->nds_request_verb;
+ }
+ if (check_col(pinfo->cinfo, COL_INFO)) {
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "NSSS");
+ }
+ if (tvb_length_remaining(tvb, foffset)<4) {
+ return;
+ }
+ aitem = proto_tree_add_text(ncp_tree, tvb, foffset, tvb_length_remaining(tvb, foffset), "Function: %s", match_strval(subfunc, sss_func_enum));
+ atree = proto_item_add_subtree(aitem, ett_sss);
+ switch (subfunc) {
+ case 1:
+ proto_tree_add_item(atree, hf_flags, tvb, foffset, 4, TRUE);
+ foffset += 4;
+ proto_tree_add_item(atree, hf_sss_version, tvb, foffset, 4, TRUE);
+ foffset += 4;
+ break;
+ case 2:
+ if (match_strval(subverb, sss_verb_enum)) {
+ proto_tree_add_text(atree, tvb, foffset, tvb_length_remaining(tvb, foffset), "Verb: %s", match_strval(subverb, sss_verb_enum));
+ }
+ proto_tree_add_item(atree, hf_length, tvb, foffset, 4, TRUE);
+ msg_length = tvb_get_letohl(tvb, foffset);
+ return_code = tvb_get_ntohl(tvb, foffset+msg_length);
+ foffset += 4;
+ proto_tree_add_item(atree, hf_frag_handle, tvb, foffset, 4, TRUE);
+ foffset += 4;
+ msg_length -= 4;
+ if ((tvb_get_letohl(tvb, foffset-4)==0xffffffff) && (msg_length > 4))
+ {
+ foffset += 4;
+ return_code = tvb_get_letohl(tvb, foffset);
+ if ( match_strval(return_code, sss_errors_enum) != NULL )
+ {
+ expert_item = proto_tree_add_item(atree, hf_return_code, tvb, foffset, 4, TRUE);
+ expert_add_info_format(pinfo, expert_item, PI_RESPONSE_CODE, PI_ERROR, "SSS Error: %s", match_strval(return_code, sss_errors_enum));
+ if (check_col(pinfo->cinfo, COL_INFO)) {
+ col_add_fstr(pinfo->cinfo, COL_INFO, "R Error - %s", match_strval(return_code, sss_errors_enum));
+ }
+ foffset+=4;
+ }
+ else
+ {
+ proto_tree_add_text(atree, tvb, foffset, 4, "Return Code: Success (0x00000000)");
+ if (tvb_length_remaining(tvb, foffset) > 8) {
+ foffset += 4;
+ if (subverb == 6)
+ {
+ foffset += 4;
+ number_of_items = tvb_get_letohl(tvb, foffset);
+ foffset += 8;
+ for (i=0; i<number_of_items; i++)
+ {
+ length_of_string = find_delimiter(tvb, foffset);
+ if (length_of_string > tvb_length_remaining(tvb, foffset))
+ {
+ return;
+ }
+ foffset = sss_string(tvb, hf_secret, atree, foffset, TRUE, length_of_string);
+ if (tvb_length_remaining(tvb, foffset) < 8)
+ {
+ return;
+ }
+ foffset++;
+ }
+
+ }
+ else
+ {
+ proto_tree_add_item(atree, hf_enc_data, tvb, foffset, tvb_length_remaining(tvb, foffset), TRUE);
+ }
+ }
+ }
+ }
+ else
+ {
+ proto_tree_add_text(atree, tvb, foffset, 4, "Return Code: Success (0x00000000)");
+ if (tvb_length_remaining(tvb, foffset) > 8) {
+ foffset += 4;
+ proto_tree_add_item(atree, hf_enc_data, tvb, foffset, tvb_length_remaining(tvb, foffset), TRUE);
+ }
+ }
+ break;
+ case 3:
+ break;
+ default:
+ break;
+ }
+}
+
+void
+proto_register_sss(void)
+{
+ static hf_register_info hf_sss[] = {
+ { &hf_buffer_size,
+ { "Buffer Size", "sss.buffer", FT_UINT32, BASE_DEC, NULL, 0x0,
+ "Buffer Size", HFILL }},
+
+ { &hf_ping_version,
+ { "Ping Version", "sss.ping_version", FT_UINT32, BASE_HEX, NULL, 0x0,
+ "Ping Version", HFILL }},
+
+ { &hf_flags,
+ { "Flags", "sss.flags", FT_UINT32, BASE_HEX, NULL, 0x0,
+ "Flags", HFILL }},
+
+ { &hf_context,
+ { "Context", "sss.context", FT_UINT32, BASE_HEX, NULL, 0x0,
+ "Context", HFILL }},
+
+ { &hf_frag_handle,
+ { "Fragment Handle", "sss.frag_handle", FT_UINT32, BASE_HEX, NULL, 0x0,
+ "Fragment Handle", HFILL }},
+
+ { &hf_length,
+ { "Length", "sss.length", FT_UINT32, BASE_DEC, NULL, 0x0,
+ "Length", HFILL }},
+
+ { &hf_verb,
+ { "Verb", "sss.verb",
+ FT_UINT32, BASE_HEX, VALS(sss_verb_enum), 0x0,
+ "Verb", HFILL }},
+
+ { &hf_user,
+ { "User", "sss.user",
+ FT_STRING, BASE_NONE, NULL, 0x0,
+ "User", HFILL }},
+
+ { &hf_secret,
+ { "Secret ID", "sss.secret",
+ FT_STRING, BASE_NONE, NULL, 0x0,
+ "Secret ID", HFILL }},
+
+ { &hf_sss_version,
+ { "SecretStore Protocol Version", "sss.version", FT_UINT32, BASE_HEX, NULL, 0x0,
+ "SecretStore Protocol Version", HFILL }},
+
+ { &hf_return_code,
+ { "Return Code", "sss.return_code", FT_UINT32, BASE_HEX, VALS(sss_errors_enum), 0x0,
+ "Return Code", HFILL }},
+
+ { &hf_enc_cred,
+ { "Encrypted Credential", "sss.enc_cred",
+ FT_BYTES, BASE_NONE, NULL, 0x0,
+ "Encrypted Credential", HFILL }},
+
+ { &hf_enc_data,
+ { "Encrypted Data", "sss.enc_data",
+ FT_BYTES, BASE_NONE, NULL, 0x0,
+ "Encrypted Data", HFILL }},
+
+ { &hfbit1,
+ { "Enhanced Protection", "ncp.sss_bit1", FT_BOOLEAN, 32, NULL, 0x00000001, "", HFILL }},
+
+ { &hfbit2,
+ { "Create ID", "ncp.sss_bit2", FT_BOOLEAN, 32, NULL, 0x00000002, "", HFILL }},
+
+ { &hfbit3,
+ { "Remove Lock", "ncp.sss_bit3", FT_BOOLEAN, 32, NULL, 0x00000004, "", HFILL }},
+
+ { &hfbit4,
+ { "Repair", "ncp.sss_bit4", FT_BOOLEAN, 32, NULL, 0x00000008, "", HFILL }},
+
+ { &hfbit5,
+ { "Unicode", "ncp.sss_bit5", FT_BOOLEAN, 32, NULL, 0x00000010, "", HFILL }},
+
+ { &hfbit6,
+ { "EP Master Password Used", "ncp.sss_bit6", FT_BOOLEAN, 32, NULL, 0x00000020, "", HFILL }},
+
+ { &hfbit7,
+ { "EP Password Used", "ncp.sss_bit7", FT_BOOLEAN, 32, NULL, 0x00000040, "", HFILL }},
+
+ { &hfbit8,
+ { "Set Tree Name", "ncp.sss_bit8", FT_BOOLEAN, 32, NULL, 0x00000080, "", HFILL }},
+
+ { &hfbit9,
+ { "Get Context", "ncp.sss_bit9", FT_BOOLEAN, 32, NULL, 0x00000100, "", HFILL }},
+
+ { &hfbit10,
+ { "Destroy Context", "ncp.sss_bit10", FT_BOOLEAN, 32, NULL, 0x00000200, "", HFILL }},
+
+ { &hfbit11,
+ { "Not Defined", "ncp.sss_bit11", FT_BOOLEAN, 32, NULL, 0x00000400, "", HFILL }},
+
+ { &hfbit12,
+ { "Not Defined", "ncp.sss_bit12", FT_BOOLEAN, 32, NULL, 0x00000800, "", HFILL }},
+
+ { &hfbit13,
+ { "Not Defined", "ncp.sss_bit13", FT_BOOLEAN, 32, NULL, 0x00001000, "", HFILL }},
+
+ { &hfbit14,
+ { "Not Defined", "ncp.sss_bit14", FT_BOOLEAN, 32, NULL, 0x00002000, "", HFILL }},
+
+ { &hfbit15,
+ { "Not Defined", "ncp.sss_bit15", FT_BOOLEAN, 32, NULL, 0x00004000, "", HFILL }},
+
+ { &hfbit16,
+ { "Not Defined", "ncp.sss_bit16", FT_BOOLEAN, 32, NULL, 0x00008000, "", HFILL }},
+
+ { &hfbit17,
+ { "EP Lock", "ncp.sss_bit17", FT_BOOLEAN, 32, NULL, 0x00010000, "", HFILL }},
+
+ { &hfbit18,
+ { "Not Initialized", "ncp.sss_bit18", FT_BOOLEAN, 32, NULL, 0x00020000, "", HFILL }},
+
+ { &hfbit19,
+ { "Enhanced Protection", "ncp.sss_bit19", FT_BOOLEAN, 32, NULL, 0x00040000, "", HFILL }},
+
+ { &hfbit20,
+ { "Store Not Synced", "ncp.sss_bit20", FT_BOOLEAN, 32, NULL, 0x00080000, "", HFILL }},
+
+ { &hfbit21,
+ { "Admin Last Modified", "ncp.sss_bit21", FT_BOOLEAN, 32, NULL, 0x00100000, "", HFILL }},
+
+ { &hfbit22,
+ { "EP Password Present", "ncp.sss_bit22", FT_BOOLEAN, 32, NULL, 0x00200000, "", HFILL }},
+
+ { &hfbit23,
+ { "EP Master Password Present", "ncp.sss_bit23", FT_BOOLEAN, 32, NULL, 0x00400000, "", HFILL }},
+
+ { &hfbit24,
+ { "MP Disabled", "ncp.sss_bit24", FT_BOOLEAN, 32, NULL, 0x00800000, "", HFILL }},
+
+ { &hfbit25,
+ { "Not Defined", "ncp.sss_bit25", FT_BOOLEAN, 32, NULL, 0x01000000, "", HFILL }},
+
+ { &hfbit26,
+ { "Not Defined", "ncp.sss_bit26", FT_BOOLEAN, 32, NULL, 0x02000000, "", HFILL }},
+
+ { &hfbit27,
+ { "Not Defined", "ncp.sss_bit27", FT_BOOLEAN, 32, NULL, 0x04000000, "", HFILL }},
+
+ { &hfbit28,
+ { "Not Defined", "ncp.sss_bit28", FT_BOOLEAN, 32, NULL, 0x08000000, "", HFILL }},
+
+ { &hfbit29,
+ { "Not Defined", "ncp.sss_bit29", FT_BOOLEAN, 32, NULL, 0x10000000, "", HFILL }},
+
+ { &hfbit30,
+ { "Not Defined", "ncp.sss_bit30", FT_BOOLEAN, 32, NULL, 0x20000000, "", HFILL }},
+
+ { &hfbit31,
+ { "Not Defined", "ncp.sss_bit31", FT_BOOLEAN, 32, NULL, 0x40000000, "", HFILL }},
+
+ { &hfbit32,
+ { "Not Defined", "ncp.sss_bit32", FT_BOOLEAN, 32, NULL, 0x80000000, "", HFILL }},
+
+ };
+
+ static gint *ett[] = {
+ &ett_sss,
+ };
+ /*module_t *sss_module;*/
+
+ proto_sss = proto_register_protocol("Novell SecretStore Services", "SSS", "sss");
+ proto_register_field_array(proto_sss, hf_sss, array_length(hf_sss));
+ proto_register_subtree_array(ett, array_length(ett));
+}
diff --git a/epan/dissectors/packet-ncp-sss.h b/epan/dissectors/packet-ncp-sss.h
new file mode 100644
index 0000000000..c59fe6e77b
--- /dev/null
+++ b/epan/dissectors/packet-ncp-sss.h
@@ -0,0 +1,36 @@
+/* packet-ncp-sss.h
+ * Declarations of routines for Novell SecretStore Services
+ * Greg Morris <gmorris@novell.com>
+ * Copyright (c) Novell, Inc. 2002-2004
+ *
+ * $Id: packet-ncp-sss.h,v 1.0 2004/02/29 08:01:22 guy Exp $
+ *
+ * Ethereal - Network traffic analyzer
+ * By Gerald Combs <gerald@ethereal.com>
+ * Copyright 2000 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.
+ */
+
+#ifndef __PACKET_NCP_SSS_H__
+#define __PACKET_NCP_SSS_H__
+
+void
+dissect_sss_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, ncp_req_hash_value *request_value);
+
+void
+dissect_sss_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, guint8 subfunc, ncp_req_hash_value *request_value);
+
+#endif
diff --git a/epan/dissectors/packet-ncp.c b/epan/dissectors/packet-ncp.c
index 9b39dfd32d..eb62aa5e57 100644
--- a/epan/dissectors/packet-ncp.c
+++ b/epan/dissectors/packet-ncp.c
@@ -52,6 +52,7 @@
#include "packet-ncp-int.h"
#include <epan/reassemble.h>
#include <epan/conversation.h>
+#include <epan/tap.h>
int proto_ncp = -1;
static int hf_ncp_ip_ver = -1;
@@ -101,6 +102,9 @@ gint ett_nds_segments = -1;
gint ett_nds_segment = -1;
static gint ett_ncp_system_flags = -1;
+static struct novell_tap ncp_tap;
+struct ncp_common_header header;
+struct ncp_common_header *ncp_hdr;
/* Tables for reassembly of fragments. */
GHashTable *nds_fragment_table = NULL;
@@ -112,6 +116,8 @@ static gboolean ncp_desegment = TRUE;
static dissector_handle_t data_handle;
+static proto_item *expert_item = NULL;
+
#define TCP_PORT_NCP 524
#define UDP_PORT_NCP 524
@@ -127,7 +133,6 @@ struct ncp_ip_header {
guint32 length;
};
-
/* This header only appears on NCP over IP request packets */
struct ncp_ip_rqhdr {
guint32 version;
@@ -168,18 +173,6 @@ static const value_string burst_command[] = {
*/
-/*
- * Every NCP packet has this common header (except for burst packets).
- */
-struct ncp_common_header {
- guint16 type;
- guint8 sequence;
- guint8 conn_low;
- guint8 task;
- guint8 conn_high; /* type=0x5555 doesn't have this */
-};
-
-
static value_string ncp_type_vals[] = {
{ NCP_ALLOCATE_SLOT, "Create a service connection" },
{ NCP_SERVICE_REQUEST, "Service request" },
@@ -291,8 +284,7 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_item *ti;
struct ncp_ip_header ncpiph;
struct ncp_ip_rqhdr ncpiphrq;
- struct ncp_common_header header;
- guint16 nw_connection, ncp_burst_seqno, ncp_ack_seqno;
+ guint16 ncp_burst_seqno, ncp_ack_seqno;
guint16 flags = 0;
char flags_str[2+3+1+3+1+3+1+3+1+3+1+1];
const char *sep;
@@ -304,7 +296,7 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
tvbuff_t *next_tvb;
guint32 testvar = 0, ncp_burst_command, burst_len, burst_off, burst_file;
guint8 subfunction;
- guint32 data_offset;
+ guint32 nw_connection, data_offset;
guint16 data_len = 0;
guint16 missing_fraglist_count = 0;
mncp_rhash_value *request_value = NULL;
@@ -316,7 +308,7 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
col_clear(pinfo->cinfo, COL_INFO);
hdr_offset = 0;
-
+ ncp_hdr = &header;
if (is_tcp) {
if (tvb_get_ntohl(tvb, hdr_offset) != NCPIP_RQST && tvb_get_ntohl(tvb, hdr_offset) != NCPIP_RPLY)
hdr_offset += 1;
@@ -450,13 +442,15 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
header.conn_low = tvb_get_guint8(tvb, commhdr+3);
header.conn_high = tvb_get_guint8(tvb, commhdr+5);
+ tap_queue_packet(ncp_tap.hdr, pinfo, ncp_hdr);
+
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO,
"%s",
val_to_str(header.type, ncp_type_vals, "Unknown type (0x%04x)"));
}
- nw_connection = (header.conn_high << 16) + header.conn_low;
+ nw_connection = (header.conn_high * 256) + header.conn_low;
if (tree) {
ti = proto_tree_add_item(tree, proto_ncp, tvb, 0, -1, FALSE);
@@ -478,8 +472,7 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_uint(ncp_tree, hf_ncp_type, tvb, commhdr + 0, 2, header.type);
}
-
- /*
+ /*
* Process the packet-type-specific header.
*/
switch (header.type) {
@@ -712,8 +705,9 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
}
+ case NCP_DEALLOCATE_SLOT: /* Deallocate Slot Request */
+ break;
case NCP_SERVICE_REQUEST: /* Server NCP Request */
- case NCP_DEALLOCATE_SLOT: /* Deallocate Slot Request */
case NCP_BROADCAST_SLOT: /* Server Broadcast Packet */
next_tvb = tvb_new_subset(tvb, hdr_offset, -1, -1);
if (tvb_get_guint8(tvb, commhdr+6) == 0x68) {
@@ -747,7 +741,7 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
case NCP_SERVICE_REPLY: /* Server NCP Reply */
next_tvb = tvb_new_subset(tvb, hdr_offset, -1, -1);
nds_defrag(next_tvb, pinfo, nw_connection, header.sequence,
- header.type, ncp_tree);
+ header.type, ncp_tree, &ncp_tap);
break;
case NCP_POSITIVE_ACK: /* Positive Acknowledgement */
@@ -758,7 +752,7 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
*/
next_tvb = tvb_new_subset(tvb, hdr_offset, -1, -1);
dissect_ncp_reply(next_tvb, pinfo, nw_connection,
- header.sequence, header.type, ncp_tree);
+ header.sequence, header.type, ncp_tree, &ncp_tap);
break;
case NCP_WATCHDOG: /* Watchdog Packet */
@@ -828,10 +822,12 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
default:
if (tree) {
- proto_tree_add_text(ncp_tree, tvb, commhdr + 6, -1,
+ expert_item = proto_tree_add_text(ncp_tree, tvb, commhdr + 6, -1,
"%s packets not supported yet",
val_to_str(header.type, ncp_type_vals,
"Unknown type (0x%04x)"));
+ expert_add_info_format(pinfo, expert_item, PI_UNDECODED, PI_NOTE, "%s packets not supported yet", val_to_str(header.type, ncp_type_vals,
+ "Unknown type (0x%04x)"));
}
break;
}
@@ -854,10 +850,6 @@ get_ncp_pdu_len(tvbuff_t *tvb, int offset)
* packet length+"has signature" flag, so we just say the length is
* "what remains in the packet".
*/
- /*if (tvb_get_guint8(tvb, offset)==0xff)
- {
- offset += 1;
- }*/
signature = tvb_get_ntohl(tvb, offset);
if (signature != NCPIP_RQST && signature != NCPIP_RPLY)
return tvb_length_remaining(tvb, offset);
@@ -886,7 +878,6 @@ dissect_ncp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
void
proto_register_ncp(void)
{
-
static hf_register_info hf[] = {
{ &hf_ncp_ip_sig,
{ "NCP over IP signature", "ncp.ip.signature",
@@ -1074,6 +1065,8 @@ proto_register_ncp(void)
"Whether the NCP dissector should defragment NDS messages spanning multiple packets.",
&nds_defragment);
register_init_routine(&mncp_init_protocol);
+ ncp_tap.stat=register_tap("ncp_srt");
+ ncp_tap.hdr=register_tap("ncp_hdr");
register_postseq_cleanup_routine(&mncp_postseq_cleanup);
}
diff --git a/epan/dissectors/packet-ncp2222.inc b/epan/dissectors/packet-ncp2222.inc
index f427f944f1..55aab8734d 100644
--- a/epan/dissectors/packet-ncp2222.inc
+++ b/epan/dissectors/packet-ncp2222.inc
@@ -1,8 +1,3 @@
-/* This dissector should not be accessing the fvalue_* functions
- directly.
- No other dissector needs to so why does this one need to ?
-*/
-
#define FAKE_TREE_IS_VISIBLE 1
/* fake that the tree is visible so that proto.c will not try to
"fake" generation of finfo values/nodes.
@@ -49,7 +44,7 @@
#define PROTO_LENGTH_UNTIL_END -1
gboolean nds_defragment = TRUE;
-
+dissector_handle_t nds_data_handle;
typedef struct {
guint32 nds_frag_verb;
guint32 nds_frag_version;
@@ -660,7 +655,8 @@ typedef struct {
} ncp_req_eid_hash_key;
typedef struct {
- char object_name[256];
+ ncp_req_eid_hash_key *nds_eid;
+ char object_name[256];
char *object_class;
} ncp_req_eid_hash_value;
@@ -1017,7 +1013,7 @@ typedef struct {
#define MVTYPE_ATTR_REQUEST 1
#define MVTYPE_ATTR_REPLY 2
-#define MVTYPE_ATTR_REQUEST2 3 /* XXX - how does this differ from 1? */
+#define MVTYPE_ATTR_REQUEST2 3
#define MVTYPE_READ_CLASS_REQ 4
#define MVTYPE_READ_REPLICAS 5
#define MVTYPE_MODIFY_ATTR_REQUEST 6
@@ -1409,6 +1405,7 @@ clear_repeat_vars(void)
static const char*
ncp_error_string(const error_equivalency *errors, guint8 completion_code)
{
+
while (errors->ncp_error_index != -1) {
if (errors->error_in_packet == completion_code) {
return ncp_errors[errors->ncp_error_index];
@@ -1420,19 +1417,19 @@ ncp_error_string(const error_equivalency *errors, guint8 completion_code)
}
static const ncp_record ncp1111_request =
- { 0x01, 0x00, NO_SUBFUNC, "Create Connection Service", NCP_GROUP_CONNECTION,
+ { 0xf1, 0x00, NO_SUBFUNC, "Create Connection Service", NCP_GROUP_CONNECTION,
NULL, NULL, ncp_0x2_errors, NULL, NO_REQ_COND_SIZE, NULL };
static const ncp_record ncp5555_request =
- { 0x01, 0x00, NO_SUBFUNC, "Destroy Connection Service", NCP_GROUP_CONNECTION,
+ { 0xf5, 0x00, NO_SUBFUNC, "Destroy Connection Service", NCP_GROUP_CONNECTION,
NULL, NULL, ncp_0x2_errors, NULL, NO_REQ_COND_SIZE, NULL };
static const ncp_record ncpbbbb_request =
- { 0x01, 0x00, NO_SUBFUNC, "Server Broadcast Message", NCP_GROUP_CONNECTION,
+ { 0xfb, 0x00, NO_SUBFUNC, "Server Broadcast Message", NCP_GROUP_CONNECTION,
NULL, NULL, ncp_0x2_errors, NULL, NO_REQ_COND_SIZE, NULL };
static const ncp_record ncplip_echo =
- { 0x01, 0x00, NO_SUBFUNC, "LIP Echo Packet", NCP_GROUP_CONNECTION,
+ { 0xfa, 0x00, NO_SUBFUNC, "LIP Echo Packet", NCP_GROUP_CONNECTION,
NULL, NULL, ncp_0x2_errors, NULL, NO_REQ_COND_SIZE, NULL };
/* Wrapper around proto_tree_free() */
@@ -1813,7 +1810,6 @@ print_nds_values(proto_tree *vtree, tvbuff_t *tvb, guint32 syntax_type, nds_val
voffset=voffset+8;
break;
case 0x00000009: /* Binary String */
- case 0x00000015: /* Stream */
value1 = tvb_get_letohl(tvb, voffset); /* length of field */
length_remaining = tvb_length_remaining(tvb, voffset);
if(length_remaining == -1 || value1 > (guint32) length_remaining)
@@ -1826,6 +1822,18 @@ print_nds_values(proto_tree *vtree, tvbuff_t *tvb, guint32 syntax_type, nds_val
voffset += value1;
voffset += (value1%2);
break;
+ case 0x00000015: /* Stream */
+ value1 = tvb_get_letohl(tvb, voffset); /* length of field */
+ length_remaining = tvb_length_remaining(tvb, voffset);
+ if(length_remaining == -1 || value1 > (guint32) length_remaining)
+ {
+ break;
+ }
+ proto_tree_add_text(nvtree, tvb, voffset, 4, "No value, Open stream file for data.");
+ voffset += 4;
+ voffset += value1;
+ voffset += (value1%2);
+ break;
case 0x00000008: /* Signed Integer */
case 0x00000016: /* Counter */
case 0x00000018: /* Time */
@@ -2381,7 +2389,7 @@ print_es_type(proto_tree *estree, tvbuff_t *tvb, nds_val *values, guint32 vtype,
for (i = 1 ; i <= value1; i++ )
{
value2 = tvb_get_letohl(tvb, ioffset);
- values->vstring = match_strval(value2, nds_protocol_type);
+ values->vstring =(char *)match_strval(value2, nds_protocol_type);
if (values->vstring == NULL)
{
values->vstring="(Undefined Protocol)";
@@ -2649,7 +2657,7 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, nds_val *values)
for (i = 1 ; i <= values->vvalue; i++ )
{
value1 = tvb_get_letohl(tvb, ioffset);
- values->vstring = match_strval(value1, nds_syntax);
+ values->vstring = (char *)match_strval(value1, nds_syntax);
if (values->vstring == NULL)
{
values->vstring = "No Syntax Found";
@@ -2675,7 +2683,7 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, nds_val *values)
for (i = 1 ; i <= values->vvalue; i++ )
{
value1 = tvb_get_letohl(tvb, ioffset);
- values->vstring = match_strval(value1, nds_syntax);
+ values->vstring = (char *)match_strval(value1, nds_syntax);
if (values->vstring == NULL)
{
values->vstring = "No Syntax Found";
@@ -2713,7 +2721,7 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, nds_val *values)
for (i = 1 ; i <= values->vvalue; i++ )
{
value1 = tvb_get_letohl(tvb, ioffset);
- values->vstring = match_strval(value1, nds_syntax);
+ values->vstring = (char *)match_strval(value1, nds_syntax);
if (values->vstring == NULL)
{
values->vstring = "No Syntax Found";
@@ -2808,7 +2816,7 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, nds_val *values)
for (i = 1 ; i <= values->vvalue; i++ )
{
value1 = tvb_get_letohl(tvb, ioffset);
- values->vstring = match_strval(value1, nds_syntax);
+ values->vstring = (char *)match_strval(value1, nds_syntax);
if (values->vstring == NULL)
{
values->vstring = "No Syntax Found";
@@ -3006,7 +3014,7 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, nds_val *values)
break;
case 0x00000004: /*p3values.bit3 = "Replica State"*/
value1 = tvb_get_letohl(tvb, ioffset);
- temp_values.vstring = match_strval(value1, nds_replica_state);
+ temp_values.vstring = (char *)match_strval(value1, nds_replica_state);
if (temp_values.vstring == NULL)
{
temp_values.vstring = "No Replica State Found";
@@ -3053,7 +3061,7 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, nds_val *values)
case 0x00000080: /*p3values.bit8 = "Replica Type & State"*/
value1 = tvb_get_letohl(tvb, ioffset);
value2 = value1 & 0x00ff;
- temp_values.vstring = match_strval(value2, nds_replica_type);
+ temp_values.vstring = (char *)match_strval(value2, nds_replica_type);
if (temp_values.vstring == NULL)
{
temp_values.vstring = "No Replica Type Found";
@@ -3061,7 +3069,7 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, nds_val *values)
proto_tree_add_string(ntree, hf_replica_type, tvb, ioffset,
4, temp_values.vstring);
value3 = value1 & 0xff00;
- temp_values.vstring = match_strval(value3, nds_replica_state);
+ temp_values.vstring = (char *)match_strval(value3, nds_replica_state);
if (temp_values.vstring == NULL)
{
temp_values.vstring = "No Replica State Found";
@@ -3270,7 +3278,7 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, nds_val *values)
case MVTYPE_PROC_ENTRY_SPECIFIERS: /* Process Entry Specifiers */
value2 = tvb_get_letohl(tvb, ioffset); /* ES Type */
- values->vstring = match_strval(value2, es_type);
+ values->vstring = (char *)match_strval(value2, es_type);
if (values->vstring == NULL)
{
values->vstring = "No ES Type Found";
@@ -3281,7 +3289,7 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, nds_val *values)
ioffset = ioffset + 4;
ioffset = print_es_type(estree, tvb, values, value2, ioffset);
value3 = tvb_get_letohl(tvb, ioffset); /* ES Type */
- values->vstring = match_strval(value3, es_type);
+ values->vstring = (char *)match_strval(value3, es_type);
if (values->vstring == NULL)
{
values->vstring = "No ES Type Found";
@@ -3340,6 +3348,14 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, nds_val *values)
case MVTYPE_LIST_PARTITIONS: /* List Partitions */
number_of_referrals = values->vvalue;
+ /* A bad packet could put us in a tight loop so trap for anything
+ * over 256 referals.
+ */
+ if (number_of_referrals > 256) {
+ proto_tree_add_text(ntree, tvb, 0, 0, "[ Bad referal at offset: %u ]", ioffset);
+ THROW(ReportedBoundsError);
+ break;
+ }
for (i = 0; i < number_of_referrals; i++)
{
bvalue = 0x00000001;
@@ -3545,7 +3561,7 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, nds_val *values)
case 0x00000400: /* Replica Type & State */
value1 = tvb_get_letohl(tvb, ioffset);
value2 = value1 & 0x00ff;
- temp_values.vstring = match_strval(value2, nds_replica_type);
+ temp_values.vstring = (char *)match_strval(value2, nds_replica_type);
if (temp_values.vstring == NULL)
{
temp_values.vstring = "No Replica Type Found";
@@ -3553,7 +3569,7 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, nds_val *values)
proto_tree_add_string(ntree, hf_replica_type, tvb, ioffset,
4, temp_values.vstring);
value3 = value1 & 0xff00;
- temp_values.vstring = match_strval(value3, nds_replica_state);
+ temp_values.vstring = (char *)match_strval(value3, nds_replica_state);
if (temp_values.vstring == NULL)
{
temp_values.vstring = "No Replica State Found";
@@ -3628,11 +3644,13 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, nds_val *values)
}
ioffset += align_4(tvb, ioffset);
}
- if (oldioffset >= ioffset) {
- proto_tree_add_text(ntree, tvb, 0, 0, "[ Invalid offset: %u ]", ioffset);
- THROW(ReportedBoundsError);
- }
bvalue = bvalue*2;
+ /* We could loop forever so check to see if bvalue has wrapped to 0.
+ * if so then just abort loop.
+ */
+ if (bvalue==0) {
+ break;
+ }
if(tvb_length_remaining(tvb, ioffset) < 4 )
{
break;
@@ -4126,30 +4144,12 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, nds_val *values)
* we will be unable to dissect the reply packet. For this reason we remember
* these values on the first fragment and then populate the values in the final
* fragment. We only do this on the first dissection.
- *
- * XXX - this has several problems:
- *
- * 1) it uses global variables ("frags");
- *
- * 2) the sequence numbers don't start at a fixed value, they're
- * per-connection sequence numbers;
- *
- * 3) the fragment size and handle aren't put into the protocol
- * tree for fragments other than the last fragment.
- *
- * 2) needs to be fixed by having a way of doing defragmentation using
- * connection sequence numbers; that's needed for fragmentation in
- * connection-oriented protocols, e.g. COTP, as well.
- * That might let us fix 1) as well.
- *
- * 3) should be fixed by putting that into the protocol tree ourselves
- * if this isn't the first fragment.
-*/
+ */
void
-nds_defrag(tvbuff_t *tvb, packet_info *pinfo, guint16 nw_connection, guint8 sequence, guint16 type, proto_tree *tree)
+nds_defrag(tvbuff_t *tvb, packet_info *pinfo, guint16 nw_connection, guint8 sequence, guint16 type, proto_tree *tree, struct novell_tap *ncp_tap)
{
int i, frag_count=0;
- guint len=0;
+ guint len=0;
guint32 tid = 1;
tvbuff_t *frag_tvb = NULL;
fragment_data *fd_head;
@@ -4157,7 +4157,7 @@ nds_defrag(tvbuff_t *tvb, packet_info *pinfo, guint16 nw_connection, guint8 sequ
conversation_t *conversation;
guint32 nds_frag;
- for (i = 0; i < 9; i++) {
+ for (i = 0; i < 99; i++) {
if (!frags[i].nds_fragmented)
{
frags[i].nds_frag = 0xfffffff0;
@@ -4165,7 +4165,7 @@ nds_defrag(tvbuff_t *tvb, packet_info *pinfo, guint16 nw_connection, guint8 sequ
}
/* Check to see if defragmentation is enabeled in the dissector */
if (!nds_defragment) {
- dissect_ncp_reply(tvb, pinfo, nw_connection, sequence, type, tree);
+ dissect_ncp_reply(tvb, pinfo, nw_connection, sequence, type, tree, ncp_tap);
return;
}
/* Has this already been dissected? */
@@ -4178,7 +4178,7 @@ nds_defrag(tvbuff_t *tvb, packet_info *pinfo, guint16 nw_connection, guint8 sequ
this reply */
request_value = ncp_hash_lookup(conversation, sequence);
if (!request_value) {
- dissect_ncp_reply(tvb, pinfo, nw_connection, sequence, type, tree);
+ dissect_ncp_reply(tvb, pinfo, nw_connection, sequence, type, tree, ncp_tap);
return;
}
p_add_proto_data(pinfo->fd, proto_ncp, (void*) request_value);
@@ -4186,14 +4186,14 @@ nds_defrag(tvbuff_t *tvb, packet_info *pinfo, guint16 nw_connection, guint8 sequ
/* else... we haven't seen an NCP Request for that conversation and sequence. */
else
{
- dissect_ncp_reply(tvb, pinfo, nw_connection, sequence, type, tree);
+ dissect_ncp_reply(tvb, pinfo, nw_connection, sequence, type, tree, ncp_tap);
return;
}
}
else {
request_value = p_get_proto_data(pinfo->fd, proto_ncp);
if (!request_value) {
- dissect_ncp_reply(tvb, pinfo, nw_connection, sequence, type, tree);
+ dissect_ncp_reply(tvb, pinfo, nw_connection, sequence, type, tree, ncp_tap);
return;
}
}
@@ -4201,7 +4201,7 @@ nds_defrag(tvbuff_t *tvb, packet_info *pinfo, guint16 nw_connection, guint8 sequ
/* If this isn't an NDS packet then just return */
if (!request_value->ncp_rec ||
request_value->ncp_rec->func!=104 || request_value->ncp_rec->subfunc!=2) {
- dissect_ncp_reply(tvb, pinfo, nw_connection, sequence, type, tree);
+ dissect_ncp_reply(tvb, pinfo, nw_connection, sequence, type, tree, ncp_tap);
return;
}
/* Get the fragment flag */
@@ -4230,7 +4230,7 @@ nds_defrag(tvbuff_t *tvb, packet_info *pinfo, guint16 nw_connection, guint8 sequ
/* is this the end of an existing fragment or just another reply */
if (nds_frag == 0xffffffff && request_value->nds_frag_num == 0xffffffff)
{
- dissect_ncp_reply(tvb, pinfo, nw_connection, sequence, type, tree);
+ dissect_ncp_reply(tvb, pinfo, nw_connection, sequence, type, tree, ncp_tap);
return;
}
@@ -4372,7 +4372,7 @@ nds_defrag(tvbuff_t *tvb, packet_info *pinfo, guint16 nw_connection, guint8 sequ
/* This is the end fragment so dissect */
if (!request_value->nds_frag) {
frags[frag_count].nds_length = 0;
- dissect_ncp_reply(frag_tvb, pinfo, nw_connection, sequence, type, tree);
+ dissect_ncp_reply(frag_tvb, pinfo, nw_connection, sequence, type, tree, ncp_tap);
}
}
}
@@ -4381,7 +4381,7 @@ nds_defrag(tvbuff_t *tvb, packet_info *pinfo, guint16 nw_connection, guint8 sequ
/* This is not any fragment packet */
frags[frag_count].nds_length = 0;
request_value->nds_frag = FALSE;
- dissect_ncp_reply(tvb, pinfo, nw_connection, sequence, type, tree);
+ dissect_ncp_reply(tvb, pinfo, nw_connection, sequence, type, tree, ncp_tap);
}
}
@@ -4482,7 +4482,6 @@ dissect_ncp_request(tvbuff_t *tvb, packet_info *pinfo,
}
}
}
-
if (!pinfo->fd->flags.visited) {
/* This is the first time we've looked at this packet.
Keep track of the address and connection whence the request
@@ -4599,10 +4598,9 @@ dissect_ncp_request(tvbuff_t *tvb, packet_info *pinfo,
}
/* The group is not part of the packet, but it's useful
- * information to display anyway. */
+ * information to display anyway. Put it in the tree for filtering and tap use*/
if (ncp_rec) {
- proto_tree_add_text(ncp_tree, tvb, 0, 0, "Group: %s",
- ncp_groups[ncp_rec->group]);
+ proto_tree_add_uint_format(ncp_tree, hf_ncp_group, tvb, 0, 0, ncp_rec->group, "Group: %s", ncp_groups[ncp_rec->group]);
}
if (ncp_rec && ncp_rec->request_ptvc) {
@@ -4610,6 +4608,10 @@ dissect_ncp_request(tvbuff_t *tvb, packet_info *pinfo,
process_ptvc_record(ptvc, ncp_rec->request_ptvc, NULL, TRUE, ncp_rec);
}
ptvcursor_free(ptvc);
+ /* SecretStore packets are dessected in packet-ncp-sss.c */
+ if (func == 0x5c && ncp_tree) {
+ dissect_sss_request(tvb, pinfo, ncp_tree, request_value);
+ }
/* NMAS packets are dessected in packet-ncp-nmas.c */
if (func == 0x5e && ncp_tree) {
dissect_nmas_request(tvb, pinfo, ncp_tree, request_value);
@@ -4754,7 +4756,7 @@ dissect_ncp_request(tvbuff_t *tvb, packet_info *pinfo,
void
dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
guint16 nw_connection, guint8 sequence, guint16 type,
- proto_tree *ncp_tree)
+ proto_tree *ncp_tree, struct novell_tap *ncp_tap)
{
conversation_t *conversation = NULL;
ncp_req_hash_value *request_value = NULL;
@@ -4792,7 +4794,7 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
strcpy(reply_buffer.buffer, "");
strcpy(global_object_name, "");
-
+
if (!pinfo->fd->flags.visited) {
/* Find the conversation whence the request would have come. */
conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst,
@@ -4807,6 +4809,25 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
p_add_proto_data(pinfo->fd, proto_ncp, (void*) request_value);
}
/* else... we haven't seen an NCP Request for that conversation and sequence. */
+ /* Create Service request packets do not contain nw_connection. The initial */
+ /* value is set to 65535. The reply packet has the valid connection. So, we */
+ /* can't find the request packet in our conversation list. To trap for this */
+ /* we can just perform the search again with 65535 to see if we can locate */
+ /* the proper request packet. */
+ else {
+ conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst,
+ PT_NCP, 65535, 65535, 0);
+ if (conversation != NULL) {
+ /* find the record telling us the request made that caused
+ this reply */
+ request_value = ncp_hash_lookup(conversation, sequence);
+ if (request_value) {
+ ncp_rec = request_value->ncp_rec;
+ }
+ p_add_proto_data(pinfo->fd, proto_ncp, (void*) request_value);
+ }
+ /* else... we haven't seen an NCP Request for that conversation and sequence. */
+ }
}
else {
request_value = p_get_proto_data(pinfo->fd, proto_ncp);
@@ -4822,7 +4843,7 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
}
}
- /* A completion code of 0 always means OK. Non-zero means failure,
+ /* A completion code of 0 always means OK. Non-zero means failure,
* but each non-zero value has a different meaning. And the same value
* can have different meanings, depending on the ncp.func (and ncp.subfunc)
* value. */
@@ -4852,7 +4873,7 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
nds_reply_buffer = tvb_get_letohl(tvb, nds_offset);
nds_offset += 4;
nds_frag = tvb_get_letohl(tvb, nds_offset);
- if (nds_reply_buffer > 7)
+ if (nds_reply_buffer > 3)
{
nds_offset += 4;
nds_error_code = tvb_get_letohl(tvb, nds_offset);
@@ -4863,7 +4884,6 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
}
}
}
-
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s",
type == NCP_SERVICE_REPLY ? "R" : "ACK",
@@ -4871,6 +4891,7 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
}
if (ncp_tree) {
+
if (request_value) {
nstime_t ns;
@@ -4895,11 +4916,22 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
}
}
- proto_tree_add_uint_format(ncp_tree, hf_ncp_completion_code, tvb, 6, 1,
- completion_code, "Completion Code: %d (0x%02x), %s",
+ expert_item = proto_tree_add_uint_format(ncp_tree, hf_ncp_completion_code, tvb, 6, 1,
+ completion_code, "Completion Code: %d (0x89%02x), %s",
completion_code, completion_code, error_string);
+ if (completion_code != 0 || type == NCP_POSITIVE_ACK) {
+
+ expert_add_info_format(pinfo, expert_item, PI_RESPONSE_CODE, PI_ERROR, "Error: %d (0x89%02x) %s", completion_code, completion_code, error_string);
+ }
proto_tree_add_item(ncp_tree, hf_ncp_connection_status, tvb, 7, 1, FALSE);
+
+ /*
+ * Tap the packet before the dissectors are called so we
+ * still get the tap listener called even if there is an
+ * exception.
+ */
+ tap_queue_packet(ncp_tap->stat, pinfo, request_value);
/*
* Unless this is a successful reply, that's all there
@@ -4910,6 +4942,11 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
/* Decode NDS Reply packets */
if (ncp_rec) {
+ /* Dissect SSS Reply packets */
+ if (ncp_rec->func == 0x5c && request_value)
+ {
+ dissect_sss_reply(tvb, pinfo, ncp_tree, ncp_rec->subfunc, request_value);
+ }
/* Dissect NMAS Reply packets */
if (ncp_rec->func == 0x5e && request_value)
{
@@ -5238,17 +5275,15 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
proto_tree_add_uint(ncp_tree, hf_ncp_fragment_handle, tvb, nds_offset,
4, nds_frag);
nds_offset += 4;
- if (nds_reply_buffer > 7)
+ if (nds_reply_buffer > 3)
{
- /*
- * XXX - is this present in
- * replies to continuation
- * messages? It doesn't appear to
- * be.
- */
- proto_tree_add_uint_format(ncp_tree, hf_nds_reply_error, tvb, nds_offset,
+ expert_item = proto_tree_add_uint_format(ncp_tree, hf_nds_reply_error, tvb, nds_offset,
4, nds_error_code, "NDS Completion Code: 0x%08x, %s",
nds_error_code, nds_error_string);
+
+ if (nds_error_code != 0) {
+ expert_add_info_format(pinfo, expert_item, PI_RESPONSE_CODE, PI_ERROR, "NDS Error: 0x%08x %s", nds_error_code, nds_error_string);
+ }
}
if (request_value && nds_error_code == 0x00000000)
{
@@ -5270,10 +5305,10 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
switch (request_value->nds_request_verb)
{
case 0x01:
- if(request_value->nds_version == 0)
+ if(request_value->nds_version < 2)
{
pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
- pvalues[0].vstring = match_strval(pvalues[0].vvalue, nds_tags);
+ pvalues[0].vstring = (char *)match_strval(pvalues[0].vvalue, nds_tags);
if(pvalues[0].vstring == NULL)
{
pvalues[0].vstring = "No Tags Set";
@@ -5402,7 +5437,7 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
pvalues[0].hfname = hf_nds_crc;
nds_offset = nds_offset+pvalues[0].vlength;
pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
- pvalues[1].vstring = match_strval(pvalues[1].vvalue, nds_tags);
+ pvalues[1].vstring = (char *)match_strval(pvalues[1].vvalue, nds_tags);
if(pvalues[1].vstring == NULL)
{
pvalues[1].vstring = "No Tags Set";
@@ -5565,7 +5600,7 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
pvalues[0].hfname = hf_nds_iteration;
nds_offset = nds_offset+pvalues[0].vlength;
pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
- pvalues[1].vstring = match_strval(pvalues[1].vvalue, nds_info_type);
+ pvalues[1].vstring = (char *)match_strval(pvalues[1].vvalue, nds_info_type);
if(pvalues[1].vstring == NULL)
{
pvalues[1].vstring = "No Info Type Set";
@@ -5603,7 +5638,7 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
pvalues[1].hfname = hf_nds_iteration;
nds_offset = nds_offset+pvalues[1].vlength;
pvalues[2].vvalue = tvb_get_letohl(tvb, nds_offset);
- pvalues[2].vstring = match_strval(pvalues[2].vvalue, nds_info_type);
+ pvalues[2].vstring = (char *)match_strval(pvalues[2].vvalue, nds_info_type);
if(pvalues[2].vstring == NULL)
{
pvalues[2].vstring = "No Info Type Set";
@@ -5687,7 +5722,7 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
pvalues[0].hfname = hf_nds_iteration;
nds_offset = nds_offset+pvalues[0].vlength;
pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
- pvalues[1].vstring = match_strval(pvalues[1].vvalue, class_def_type);
+ pvalues[1].vstring = (char *)match_strval(pvalues[1].vvalue, class_def_type);
if(pvalues[1].vstring == NULL)
{
pvalues[1].vstring = "No Class Definition Type Set";
@@ -5986,11 +6021,11 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
if (!pinfo->fd->flags.visited) {
if(add_eid)
{
- request_eid_value = ncp_eid_hash_lookup(conversation, global_eid);
+ request_eid_value = ncp_eid_hash_lookup(conversation, global_eid);
if (!request_eid_value) {
request_eid_value = ncp_eid_hash_insert(global_eid);
strcpy(request_eid_value->object_name, global_object_name);
- }
+ }
}
}
/* For NDS requests with just an EID, resolve name from hash table. */
@@ -6055,8 +6090,9 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
length = tvb_length(tvb);
if (!ncp_rec && length > 8) {
- proto_tree_add_text(ncp_tree, tvb, 8, length - 8,
+ expert_item = proto_tree_add_text(ncp_tree, tvb, 8, length - 8,
"No request record found. Parsing is impossible.");
+ expert_add_info_format(pinfo, expert_item, PI_SEQUENCE, PI_NOTE, "Original Request Packet not Found, Maybe normal at beginning of trace.");
}
else if (ncp_rec && ncp_rec->reply_ptvc) {
/* If a non-zero completion code was found, it is
@@ -6065,7 +6101,6 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
if (completion_code != 0 && tvb_length(tvb) == 8) {
return;
}
- /*printf("func=0x%x subfunc=0x%x\n", ncp_rec->func, ncp_rec->subfunc);*/
/* Any request condition results? */
if (request_value) {
@@ -6595,7 +6630,7 @@ dissect_nds_request(tvbuff_t *tvb, packet_info *pinfo,
pvalues[2].hfname= hf_nds_eid;
foffset = foffset+pvalues[2].vlength;
pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
- pvalues[3].vstring = match_strval(pvalues[3].vvalue, nds_info_type);
+ pvalues[3].vstring = (char *)match_strval(pvalues[3].vvalue, nds_info_type);
global_flags = pvalues[3].vvalue;
if(pvalues[3].vstring == NULL)
{
@@ -6649,7 +6684,7 @@ dissect_nds_request(tvbuff_t *tvb, packet_info *pinfo,
pvalues[3].hfname= hf_nds_eid;
foffset = foffset+pvalues[3].vlength;
pvalues[4].vvalue = tvb_get_letohl(tvb, foffset);
- pvalues[4].vstring = match_strval(pvalues[4].vvalue, nds_info_type);
+ pvalues[4].vstring = (char *)match_strval(pvalues[4].vvalue, nds_info_type);
global_flags = pvalues[4].vvalue;
if(pvalues[4].vstring == NULL)
{
@@ -6937,7 +6972,7 @@ dissect_nds_request(tvbuff_t *tvb, packet_info *pinfo,
pvalues[3].hfname= hf_nds_eid;
foffset = foffset+pvalues[3].vlength;
pvalues[4].vvalue = tvb_get_letohl(tvb, foffset);
- pvalues[4].vstring = match_strval(pvalues[4].vvalue, nds_search_scope);
+ pvalues[4].vstring = (char *)match_strval(pvalues[4].vvalue, nds_search_scope);
if(pvalues[4].vstring == NULL)
{
pvalues[4].vstring = "No Search Scope Defined";
@@ -7385,7 +7420,7 @@ dissect_nds_request(tvbuff_t *tvb, packet_info *pinfo,
foffset = foffset+pvalues[2].vlength;
foffset += align_4(tvb, foffset);
pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
- pvalues[3].vstring = match_strval(pvalues[3].vvalue, nds_syntax);
+ pvalues[3].vstring = (char *)match_strval(pvalues[3].vvalue, nds_syntax);
if(pvalues[3].vstring == NULL)
{
pvalues[3].vstring = "No Syntax Found";
@@ -7468,7 +7503,7 @@ dissect_nds_request(tvbuff_t *tvb, packet_info *pinfo,
foffset = foffset+pvalues[1].vlength;
pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
global_flags = pvalues[2].vvalue;
- pvalues[2].vstring = match_strval(pvalues[2].vvalue, class_def_type);
+ pvalues[2].vstring = (char *)match_strval(pvalues[2].vvalue, class_def_type);
if(pvalues[2].vstring == NULL)
{
pvalues[2].vstring = "No Class Definition Type Set";
@@ -7896,7 +7931,7 @@ dissect_nds_request(tvbuff_t *tvb, packet_info *pinfo,
pvalues[2].hfname= hf_nds_master_part_id;
foffset = foffset+pvalues[2].vlength;
pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
- pvalues[3].vstring = match_strval(pvalues[3].vvalue, nds_replica_type);
+ pvalues[3].vstring = (char *)match_strval(pvalues[3].vvalue, nds_replica_type);
if(pvalues[3].vstring == NULL)
{
pvalues[3].vstring = "No Replica Type Found";
@@ -8251,7 +8286,6 @@ dissect_nds_request(tvbuff_t *tvb, packet_info *pinfo,
}
}
-
/* Keep track of the address and connection whence the request
came, and the address and connection to which the request
is being sent, so that we can match up calls with replies.
@@ -8313,7 +8347,6 @@ dissect_nds_request(tvbuff_t *tvb, packet_info *pinfo,
CLEANUP_PUSH(free_proto_tree, temp_tree);
request_value = ncp_hash_lookup(conversation, sequence);
-
switch (type) {
case NCP_BROADCAST_SLOT:
; /* nothing */
@@ -8550,7 +8583,7 @@ dissect_ping_req(tvbuff_t *tvb, packet_info *pinfo,
request_value = ncp_hash_insert(conversation, sequence, ncp_rec);
request_value->req_frame_num = pinfo->fd->num;
- request_value->req_frame_time=pinfo->fd->abs_ts;
+ request_value->req_frame_time=pinfo->fd->abs_ts;
/* If this is the first time we're examining the packet,
* check to see if this NCP type uses a "request condition".
@@ -8579,8 +8612,8 @@ dissect_ping_req(tvbuff_t *tvb, packet_info *pinfo,
* NULL if no cleanup is needed, and non-null if cleanup is needed.
*/
CLEANUP_PUSH(free_proto_tree, temp_tree);
-
- switch (type) {
+
+ switch (type) {
case NCP_BROADCAST_SLOT:
; /* nothing */
@@ -8594,15 +8627,20 @@ dissect_ping_req(tvbuff_t *tvb, packet_info *pinfo,
proto_tree_add_uint_format(ncp_tree, hf_ncp_subfunc, tvb, 7, 1,
subfunc, "SubFunction: %u (0x%02x)",
subfunc, subfunc);
-
+
length_remaining = tvb_reported_length_remaining(tvb, 8);
+
if (length_remaining >= 8) {
ping_version = tvb_get_letohl(tvb, 8);
proto_tree_add_uint(ncp_tree, hf_nds_ping_version, tvb, 8,
4, ping_version);
nds_flags = tvb_get_letohl(tvb, 12);
- if (request_value)
- request_value->req_nds_flags = nds_flags;
+ if (request_value){
+ request_value->nds_request_verb = 0xf0;
+ request_value->req_nds_flags = nds_flags;
+ }
+ proto_tree_add_uint_hidden(ncp_tree, hf_ncp_nds_verb, tvb, 0, 0,
+ 240);
pvalue.vvalue = tvb_get_letohs(tvb, 12);