diff options
author | Gerald Combs <gerald@wireshark.org> | 2002-09-22 15:46:42 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2002-09-22 15:46:42 +0000 |
commit | c9cdfff342078d6ef252982737cec3b2f75f1066 (patch) | |
tree | 7674fc1373802e5ab5b6a0efafc4d0b7a9e1fd1c | |
parent | 972849fff175402e63ba6431cf2315b253c543f4 (diff) |
From Greg Morris: More NDS decodes.
Fix a typo in get_string().
svn path=/trunk/; revision=6313
-rwxr-xr-x | ncp2222.py | 2238 | ||||
-rw-r--r-- | packet-ncp-int.h | 6 | ||||
-rw-r--r-- | packet-ncp.c | 124 | ||||
-rw-r--r-- | packet-ncp2222.inc | 7379 |
4 files changed, 9081 insertions, 666 deletions
diff --git a/ncp2222.py b/ncp2222.py index ddbaeeeb3d..ec0af391f6 100755 --- a/ncp2222.py +++ b/ncp2222.py @@ -1,5 +1,5 @@ #!/usr/bin/env python - + """ Creates C code from a table of NCP type 0x2222 packet types. (And 0x3333, which are the replies, but the packets are more commonly @@ -24,7 +24,7 @@ http://developer.novell.com/ndk/doc/docui/index.htm#../ncp/ncp__enu/data/ for a badly-formatted HTML version of the same PDF. -$Id: ncp2222.py,v 1.32 2002/08/23 22:44:57 guy Exp $ +$Id: ncp2222.py,v 1.33 2002/09/22 15:46:41 gerald Exp $ Copyright (c) 2000-2002 by Gilbert Ramirez <gram@alumni.rice.edu> @@ -71,6 +71,7 @@ NO_REPEAT = -1 NO_REQ_COND = -1 NO_LENGTH_CHECK = -2 + PROTO_LENGTH_UNKNOWN = -1 global_highest_var = -1 @@ -201,8 +202,8 @@ class PTVC(NamedList): highest_var = highest_var + 1 var = highest_var - if highest_var > global_highest_var: - global_highest_var = highest_var + if highest_var > global_highest_var: + global_highest_var = highest_var named_vars[var_name] = var else: var = NO_VAR @@ -656,7 +657,7 @@ class NCP: packets.append(self) def rec(start, length, field, endianness=None, **kw): - return _rec(start, length, field, endianness, kw) + return _rec(start, length, field, endianness, kw) def srec(field, endianness=None, **kw): return _rec(-1, -1, field, endianness, kw) @@ -957,7 +958,7 @@ class val_string(Type): value_repr = self.value_format % 0 result = result + "\t{ %s,\tNULL },\n" % (value_repr) result = result + "};\n" - REC_VAL_STRING_RES = self.value_format % value + REC_VAL_STRING_RES = self.value_format % value return result def ValuesCName(self): @@ -1365,7 +1366,8 @@ CachePartialWriteRequests = uint32("cache_partial_write_requests", "Cache Partia CacheReadRequests = uint32("cache_read_requests", "Cache Read Requests") CacheWriteRequests = uint32("cache_write_requests", "Cache Write Requests") CategoryName = stringz("category_name", "Category Name") -CCFileHandle = bytes("cc_file_handle", "File Handle", 4) +CCFileHandle = uint32("cc_file_handle", "File Handle") +CCFileHandle.Display("BASE_HEX") CCFunction = val_string8("cc_function", "OP-Lock Flag", [ [ 0x01, "Clear OP-Lock" ], [ 0x02, "Acknowledge Callback" ], @@ -2780,8 +2782,6 @@ NCPExtensionNumbers = uint32("ncp_extension_numbers", "NCP Extension Numbers") NCPextensionRevisionNumber = uint8("ncp_extension_revision_number", "NCP Extension Revision Number") NCPPeakStaInUse = uint32("ncp_peak_sta_in_use", "Peak Number of Connections since Server was brought up") NCPStaInUseCnt = uint32("ncp_sta_in_use", "Number of Workstations Connected to Server") -NDSFlags = uint32("nds_flags", "NDS Flags") -NDSFlags.Display('BASE_HEX') NDSRequestFlags = bitfield16("nds_request_flags", "NDS Request Flags", [ bf_boolean16(0x0001, "nds_request_flags_output", "Output Fields"), bf_boolean16(0x0002, "nds_request_flags_no_such_entry", "No Such Entry"), @@ -2796,90 +2796,6 @@ NDSRequestFlags = bitfield16("nds_request_flags", "NDS Request Flags", [ bf_boolean16(0x0400, "nds_request_flags_up_ref", "Up Referral"), bf_boolean16(0x0800, "nds_request_flags_dn_ref", "Down Referral"), ]) -NDSVerb = val_string16("nds_verb", "NDS Verb", [ - [ 1, "Resolve Name" ], - [ 2, "Read Entry Information" ], - [ 3, "Read" ], - [ 4, "Compare" ], - [ 5, "List" ], - [ 6, "Search Entries" ], - [ 7, "Add Entry" ], - [ 8, "Remove Entry" ], - [ 9, "Modify Entry" ], - [ 10, "Modify RDN" ], - [ 11, "Create Attribute" ], - [ 12, "Read Attribute Definition" ], - [ 13, "Remove Attribute Definition" ], - [ 14, "Define Class" ], - [ 15, "Read Class Definition" ], - [ 16, "Modify Class Definition" ], - [ 17, "Remove Class Definition" ], - [ 18, "List Containable Classes" ], - [ 19, "Get Effective Rights" ], - [ 20, "Add Partition" ], - [ 21, "Remove Partition" ], - [ 22, "List Partitions" ], - [ 23, "Split Partition" ], - [ 24, "Join Partitions" ], - [ 25, "Add Replica" ], - [ 26, "Remove Replica" ], - [ 27, "Open Stream" ], - [ 28, "Search Filter" ], - [ 29, "Create Subordinate Reference" ], - [ 30, "Link Replica" ], - [ 31, "Change Replica Type" ], - [ 32, "Start Update Schema" ], - [ 33, "End Update Schema" ], - [ 34, "Update Schema" ], - [ 35, "Start Update Replica" ], - [ 36, "End Update Replica" ], - [ 37, "Update Replica" ], - [ 38, "Synchronize Partition" ], - [ 39, "Synchronize Schema" ], - [ 40, "Read Syntaxes" ], - [ 41, "Get Replica Root ID" ], - [ 42, "Begin Move Entry" ], - [ 43, "Finish Move Entry" ], - [ 44, "Release Moved Entry" ], - [ 45, "Backup Entry" ], - [ 46, "Restore Entry" ], - [ 47, "Save DIB" ], - [ 50, "Close Iteration" ], - [ 51, "Unused" ], - [ 52, "Audit Skulking" ], - [ 53, "Get Server Address" ], - [ 54, "Set Keys" ], - [ 55, "Change Password" ], - [ 56, "Verify Password" ], - [ 57, "Begin Login" ], - [ 58, "Finish Login" ], - [ 59, "Begin Authentication" ], - [ 60, "Finish Authentication" ], - [ 61, "Logout" ], - [ 62, "Repair Ring" ], - [ 63, "Repair Timestamps" ], - [ 64, "Create Back Link" ], - [ 65, "Delete External Reference" ], - [ 66, "Rename External Reference" ], - [ 67, "Create Directory Entry" ], - [ 68, "Remove Directory Entry" ], - [ 69, "Designate New Master" ], - [ 70, "Change Tree Name" ], - [ 71, "Partition Entry Count" ], - [ 72, "Check Login Restrictions" ], - [ 73, "Start Join" ], - [ 74, "Low Level Split" ], - [ 75, "Low Level Join" ], - [ 76, "Abort Low Level Join" ], - [ 77, "Get All Servers" ], - [ 255, "EDirectory Call" ], -]) -NDSNewVerb = val_string16("nds_new_verb", "NDS Verb", [ -]) -NDSVersion = uint32("nds_version", "NDS Version") -NDSCRC = uint32("nds_crc", "NDS CRC") -NDSCRC.Display('BASE_HEX') -NDSBuildVersion = uint32("nds_build_version", "NDS Build Version") NDSStatus = uint32("nds_status", "NDS Status") NetBIOSBroadcastWasPropogated = uint32("netbios_broadcast_was_propogated", "NetBIOS Broadcast Was Propogated") NetIDNumber = uint32("net_id_number", "Net ID Number") @@ -4711,17 +4627,11 @@ NCPNetworkAddress = struct("ncp_network_address_struct", [ NetAddress, ], "Network Address") -NDS7Struct = struct("nds_7_struct", [ - NDSCRC, -]) -NDS8Struct = struct("nds_8_struct", [ - NDSCRC, - NDSNewVerb, -]) netAddr = struct("net_addr_struct", [ TransportType, nbytes32("transport_addr", "Transport Address"), ], "Network Address") + NetWareInformationStruct = struct("netware_information_struct", [ DataStreamSpaceAlloc, # (Data Stream Alloc Bit) AttributesDef32, # (Attributes Bit) @@ -4917,13 +4827,6 @@ PhyLockStruct = struct("phy_lock_struct", [ TaskNumByte, LockType, ], "Physical Locks") -PingVersion9 = struct("ping_version_9", [ - TreeName, -]) -PingVersion10 = struct("ping_version_10", [ - Reserved12, - TreeName, -]) printInfo = struct("print_info_struct", [ PrintFlags, TabSize, @@ -5198,346 +5101,348 @@ def define_groups(): # NCP Errors ############################################################################## def define_errors(): - errors[0x0000] = "Ok" - errors[0x0001] = "Transaction tracking is available" - errors[0x0002] = "Ok. The data has been written" - errors[0x0003] = "Calling Station is a Manager" - - errors[0x0100] = "One or more of the ConnectionNumbers in the send list are invalid" - errors[0x0101] = "Invalid space limit" - errors[0x0102] = "Insufficient disk space" - errors[0x0103] = "Queue server cannot add jobs" - errors[0x0104] = "Out of disk space" - errors[0x0105] = "Semaphore overflow" - errors[0x0106] = "Invalid Parameter" - errors[0x0107] = "Invalid Number of Minutes to Delay" + errors[0x0000] = "Ok" + errors[0x0001] = "Transaction tracking is available" + errors[0x0002] = "Ok. The data has been written" + errors[0x0003] = "Calling Station is a Manager" + + errors[0x0100] = "One or more of the ConnectionNumbers in the send list are invalid" + errors[0x0101] = "Invalid space limit" + errors[0x0102] = "Insufficient disk space" + errors[0x0103] = "Queue server cannot add jobs" + errors[0x0104] = "Out of disk space" + errors[0x0105] = "Semaphore overflow" + errors[0x0106] = "Invalid Parameter" + errors[0x0107] = "Invalid Number of Minutes to Delay" errors[0x0108] = "Invalid Start or Network Number" errors[0x0109] = "Cannot Obtain License" - - errors[0x0200] = "One or more clients in the send list are not logged in" - errors[0x0201] = "Queue server cannot attach" - - errors[0x0300] = "One or more clients in the send list are not accepting messages" - - errors[0x0400] = "Client already has message" - errors[0x0401] = "Queue server cannot service job" - - errors[0x7300] = "Revoke Handle Rights Not Found" + + errors[0x0200] = "One or more clients in the send list are not logged in" + errors[0x0201] = "Queue server cannot attach" + + errors[0x0300] = "One or more clients in the send list are not accepting messages" + + errors[0x0400] = "Client already has message" + errors[0x0401] = "Queue server cannot service job" + + errors[0x7300] = "Revoke Handle Rights Not Found" errors[0x7900] = "Invalid Parameter in Request Packet" errors[0x7901] = "Nothing being Compressed" - errors[0x7a00] = "Connection Already Temporary" - errors[0x7b00] = "Connection Already Logged in" - errors[0x7c00] = "Connection Not Authenticated" - - errors[0x7e00] = "NCP failed boundary check" - errors[0x7e01] = "Invalid Length" - - errors[0x7f00] = "Lock Waiting" - errors[0x8000] = "Lock fail" - - errors[0x8100] = "A file handle could not be allocated by the file server" - errors[0x8101] = "Out of File Handles" - - errors[0x8200] = "Unauthorized to open the file" - errors[0x8300] = "Unable to read/write the volume. Possible bad sector on the file server" - errors[0x8301] = "Hard I/O Error" - - errors[0x8400] = "Unauthorized to create the directory" - errors[0x8401] = "Unauthorized to create the file" - - errors[0x8500] = "Unauthorized to delete the specified file" - errors[0x8501] = "Unauthorized to overwrite an existing file in this directory" - - errors[0x8700] = "An unexpected character was encountered in the filename" - errors[0x8701] = "Create Filename Error" - - errors[0x8800] = "Invalid file handle" - errors[0x8900] = "Unauthorized to search this directory" - errors[0x8a00] = "Unauthorized to delete this directory" - errors[0x8b00] = "Unauthorized to rename a file in this directory" - - errors[0x8c00] = "No set privileges" - errors[0x8c01] = "Unauthorized to modify a file in this directory" - errors[0x8c02] = "Unauthorized to change the restriction on this volume" - - errors[0x8d00] = "Some of the affected files are in use by another client" - errors[0x8d01] = "The affected file is in use" - - errors[0x8e00] = "All of the affected files are in use by another client" - errors[0x8f00] = "Some of the affected files are read-only" - - errors[0x9000] = "An attempt to modify a read-only volume occurred" - errors[0x9001] = "All of the affected files are read-only" - errors[0x9002] = "Read Only Access to Volume" - - errors[0x9100] = "Some of the affected files already exist" - errors[0x9101] = "Some Names Exist" - - errors[0x9200] = "Directory with the new name already exists" - errors[0x9201] = "All of the affected files already exist" - - errors[0x9300] = "Unauthorized to read from this file" - errors[0x9400] = "Unauthorized to write to this file" - errors[0x9500] = "The affected file is detached" - - errors[0x9600] = "The file server has run out of memory to service this request" - errors[0x9601] = "No alloc space for message" - errors[0x9602] = "Server Out of Space" - - errors[0x9800] = "The affected volume is not mounted" - errors[0x9801] = "The volume associated with Volume Number is not mounted" - errors[0x9802] = "The resulting volume does not exist" - errors[0x9803] = "The destination volume is not mounted" - errors[0x9804] = "Disk Map Error" - - errors[0x9900] = "The file server has run out of directory space on the affected volume" - errors[0x9a00] = "The request attempted to rename the affected file to another volume" - - errors[0x9b00] = "DirHandle is not associated with a valid directory path" - errors[0x9b01] = "A resulting directory handle is not associated with a valid directory path" - errors[0x9b02] = "The directory associated with DirHandle does not exist" - errors[0x9b03] = "Bad directory handle" - - errors[0x9c00] = "The resulting path is not valid" - errors[0x9c01] = "The resulting file path is not valid" - errors[0x9c02] = "The resulting directory path is not valid" - errors[0x9c03] = "Invalid path" - - errors[0x9d00] = "A directory handle was not available for allocation" - - errors[0x9e00] = "The name of the directory does not conform to a legal name for this name space" - errors[0x9e01] = "The new directory name does not conform to a legal name for this name space" - errors[0x9e02] = "Bad File Name" - - errors[0x9f00] = "The request attempted to delete a directory that is in use by another client" - - errors[0xa000] = "The request attempted to delete a directory that is not empty" - errors[0xa100] = "An unrecoverable error occured on the affected directory" - - errors[0xa200] = "The request attempted to read from a file region that is physically locked" - errors[0xa201] = "I/O Lock Error" - - errors[0xa400] = "Invalid directory rename attempted" + errors[0x7a00] = "Connection Already Temporary" + errors[0x7b00] = "Connection Already Logged in" + errors[0x7c00] = "Connection Not Authenticated" + + errors[0x7e00] = "NCP failed boundary check" + errors[0x7e01] = "Invalid Length" + + errors[0x7f00] = "Lock Waiting" + errors[0x8000] = "Lock fail" + + errors[0x8100] = "A file handle could not be allocated by the file server" + errors[0x8101] = "Out of File Handles" + + errors[0x8200] = "Unauthorized to open the file" + errors[0x8300] = "Unable to read/write the volume. Possible bad sector on the file server" + errors[0x8301] = "Hard I/O Error" + + errors[0x8400] = "Unauthorized to create the directory" + errors[0x8401] = "Unauthorized to create the file" + + errors[0x8500] = "Unauthorized to delete the specified file" + errors[0x8501] = "Unauthorized to overwrite an existing file in this directory" + + errors[0x8700] = "An unexpected character was encountered in the filename" + errors[0x8701] = "Create Filename Error" + + errors[0x8800] = "Invalid file handle" + errors[0x8900] = "Unauthorized to search this directory" + errors[0x8a00] = "Unauthorized to delete this directory" + errors[0x8b00] = "Unauthorized to rename a file in this directory" + + errors[0x8c00] = "No set privileges" + errors[0x8c01] = "Unauthorized to modify a file in this directory" + errors[0x8c02] = "Unauthorized to change the restriction on this volume" + + errors[0x8d00] = "Some of the affected files are in use by another client" + errors[0x8d01] = "The affected file is in use" + + errors[0x8e00] = "All of the affected files are in use by another client" + errors[0x8f00] = "Some of the affected files are read-only" + + errors[0x9000] = "An attempt to modify a read-only volume occurred" + errors[0x9001] = "All of the affected files are read-only" + errors[0x9002] = "Read Only Access to Volume" + + errors[0x9100] = "Some of the affected files already exist" + errors[0x9101] = "Some Names Exist" + + errors[0x9200] = "Directory with the new name already exists" + errors[0x9201] = "All of the affected files already exist" + + errors[0x9300] = "Unauthorized to read from this file" + errors[0x9400] = "Unauthorized to write to this file" + errors[0x9500] = "The affected file is detached" + + errors[0x9600] = "The file server has run out of memory to service this request" + errors[0x9601] = "No alloc space for message" + errors[0x9602] = "Server Out of Space" + + errors[0x9800] = "The affected volume is not mounted" + errors[0x9801] = "The volume associated with Volume Number is not mounted" + errors[0x9802] = "The resulting volume does not exist" + errors[0x9803] = "The destination volume is not mounted" + errors[0x9804] = "Disk Map Error" + + errors[0x9900] = "The file server has run out of directory space on the affected volume" + errors[0x9a00] = "The request attempted to rename the affected file to another volume" + + errors[0x9b00] = "DirHandle is not associated with a valid directory path" + errors[0x9b01] = "A resulting directory handle is not associated with a valid directory path" + errors[0x9b02] = "The directory associated with DirHandle does not exist" + errors[0x9b03] = "Bad directory handle" + + errors[0x9c00] = "The resulting path is not valid" + errors[0x9c01] = "The resulting file path is not valid" + errors[0x9c02] = "The resulting directory path is not valid" + errors[0x9c03] = "Invalid path" + + errors[0x9d00] = "A directory handle was not available for allocation" + + errors[0x9e00] = "The name of the directory does not conform to a legal name for this name space" + errors[0x9e01] = "The new directory name does not conform to a legal name for this name space" + errors[0x9e02] = "Bad File Name" + + errors[0x9f00] = "The request attempted to delete a directory that is in use by another client" + + errors[0xa000] = "The request attempted to delete a directory that is not empty" + errors[0xa100] = "An unrecoverable error occured on the affected directory" + + errors[0xa200] = "The request attempted to read from a file region that is physically locked" + errors[0xa201] = "I/O Lock Error" + + errors[0xa400] = "Invalid directory rename attempted" + errors[0xa500] = "Invalid open create mode" errors[0xa600] = "Auditor Access has been Removed" - errors[0xa700] = "Error Auditing Version" - - errors[0xa800] = "Invalid Support Module ID" + errors[0xa700] = "Error Auditing Version" + + errors[0xa800] = "Invalid Support Module ID" errors[0xa801] = "No Auditing Access Rights" - - errors[0xbe00] = "Invalid Data Stream" - errors[0xbf00] = "Requests for this name space are not valid on this volume" - - errors[0xc000] = "Unauthorized to retrieve accounting data" - - errors[0xc100] = "The ACCOUNT_BALANCE property does not exist" - errors[0xc101] = "No Account Balance" - - errors[0xc200] = "The object has exceeded its credit limit" - errors[0xc300] = "Too many holds have been placed against this account" - errors[0xc400] = "The client account has been disabled" - - errors[0xc500] = "Access to the account has been denied because of intruder detection" - errors[0xc501] = "Login lockout" - errors[0xc502] = "Server Login Locked" - - errors[0xc600] = "The caller does not have operator priviliges" - errors[0xc601] = "The client does not have operator priviliges" - - errors[0xc800] = "Missing EA Key" - errors[0xc900] = "EA Not Found" - errors[0xca00] = "Invalid EA Handle Type" - errors[0xcb00] = "EA No Key No Data" - errors[0xcc00] = "EA Number Mismatch" - errors[0xcd00] = "Extent Number Out of Range" - errors[0xce00] = "EA Bad Directory Number" - errors[0xcf00] = "Invalid EA Handle" - - errors[0xd000] = "Queue error" - errors[0xd001] = "EA Position Out of Range" - - errors[0xd100] = "The queue does not exist" - errors[0xd101] = "EA Access Denied" - - errors[0xd200] = "A queue server is not associated with this queue" - errors[0xd201] = "A queue server is not associated with the selected queue" - errors[0xd202] = "No queue server" - errors[0xd203] = "Data Page Odd Size" - - errors[0xd300] = "No queue rights" - errors[0xd301] = "EA Volume Not Mounted" - - errors[0xd400] = "The queue is full and cannot accept another request" - errors[0xd401] = "The queue associated with ObjectId is full and cannot accept another request" - errors[0xd402] = "Bad Page Boundary" - - errors[0xd500] = "A job does not exist in this queue" - errors[0xd501] = "No queue job" - errors[0xd502] = "The job associated with JobNumber does not exist in this queue" - errors[0xd503] = "Inspect Failure" - - errors[0xd600] = "The file server does not allow unencrypted passwords" - errors[0xd601] = "No job right" - errors[0xd602] = "EA Already Claimed" - - errors[0xd700] = "Bad account" - errors[0xd701] = "The old and new password strings are identical" - errors[0xd702] = "The job is currently being serviced" - errors[0xd703] = "The queue is currently servicing a job" - errors[0xd704] = "Queue servicing" - errors[0xd705] = "Odd Buffer Size" - - errors[0xd800] = "Queue not active" - errors[0xd801] = "No Scorecards" - - errors[0xd900] = "The file server cannot accept another connection as it has reached its limit" - errors[0xd901] = "The client is not security equivalent to one of the objects in the Q_SERVERS group property of the target queue" - errors[0xd902] = "Station is not a server" - errors[0xd903] = "Bad EDS Signature" - - errors[0xda00] = "Attempted to login to the file server during a restricted time period" - errors[0xda01] = "Queue halted" - errors[0xda02] = "EA Space Limit" - - errors[0xdb00] = "Attempted to login to the file server from an unauthorized workstation or network" - errors[0xdb01] = "The queue cannot attach another queue server" - errors[0xdb02] = "Maximum queue servers" - errors[0xdb03] = "EA Key Corrupt" - - errors[0xdc00] = "Account Expired" - errors[0xdc01] = "EA Key Limit" - - errors[0xdd00] = "Tally Corrupt" - errors[0xde00] = "Attempted to login to the file server with an incorrect password" - errors[0xdf00] = "Attempted to login to the file server with a password that has expired" - - errors[0xe000] = "No Login Connections Available" - errors[0xe700] = "No disk track" - errors[0xe800] = "Write to group" - errors[0xe900] = "The object is already a member of the group property" - - errors[0xea00] = "No such member" - errors[0xea01] = "The bindery object is not a member of the set" - errors[0xea02] = "Non-existent member" - - errors[0xeb00] = "The property is not a set property" - - errors[0xec00] = "No such set" - errors[0xec01] = "The set property does not exist" - - errors[0xed00] = "Property exists" - errors[0xed01] = "The property already exists" - errors[0xed02] = "An attempt was made to create a bindery object property that already exists" - - errors[0xee00] = "The object already exists" - errors[0xee01] = "The bindery object already exists" - - errors[0xef00] = "Illegal name" - errors[0xef01] = "Illegal characters in ObjectName field" - errors[0xef02] = "Invalid name" - - errors[0xf000] = "A wildcard was detected in a field that does not support wildcards" - errors[0xf001] = "An illegal wildcard was detected in ObjectName" - - errors[0xf100] = "The client does not have the rights to access this bindery object" - errors[0xf101] = "Bindery security" - errors[0xf102] = "Invalid bindery security" - - errors[0xf200] = "Unauthorized to read from this object" - errors[0xf300] = "Unauthorized to rename this object" - - errors[0xf400] = "Unauthorized to delete this object" - errors[0xf401] = "No object delete privileges" - errors[0xf402] = "Unauthorized to delete this queue" - - errors[0xf500] = "Unauthorized to create this object" - errors[0xf501] = "No object create" - - errors[0xf600] = "No property delete" - errors[0xf601] = "Unauthorized to delete the property of this object" - errors[0xf602] = "Unauthorized to delete this property" - - errors[0xf700] = "Unauthorized to create this property" - errors[0xf701] = "No property create privilege" - - errors[0xf800] = "Unauthorized to write to this property" - errors[0xf900] = "Unauthorized to read this property" - errors[0xfa00] = "Temporary remap error" - - errors[0xfb00] = "No such property" - errors[0xfb01] = "The file server does not support this request" - errors[0xfb02] = "The specified property does not exist" - errors[0xfb03] = "The PASSWORD property does not exist for this bindery object" - errors[0xfb04] = "NDS NCP not available" - errors[0xfb05] = "Bad Directory Handle" - errors[0xfb06] = "Unknown Request" + + errors[0xbe00] = "Invalid Data Stream" + errors[0xbf00] = "Requests for this name space are not valid on this volume" + + errors[0xc000] = "Unauthorized to retrieve accounting data" + + errors[0xc100] = "The ACCOUNT_BALANCE property does not exist" + errors[0xc101] = "No Account Balance" + + errors[0xc200] = "The object has exceeded its credit limit" + errors[0xc300] = "Too many holds have been placed against this account" + errors[0xc400] = "The client account has been disabled" + + errors[0xc500] = "Access to the account has been denied because of intruder detection" + errors[0xc501] = "Login lockout" + errors[0xc502] = "Server Login Locked" + + errors[0xc600] = "The caller does not have operator priviliges" + errors[0xc601] = "The client does not have operator priviliges" + + errors[0xc800] = "Missing EA Key" + errors[0xc900] = "EA Not Found" + errors[0xca00] = "Invalid EA Handle Type" + errors[0xcb00] = "EA No Key No Data" + errors[0xcc00] = "EA Number Mismatch" + errors[0xcd00] = "Extent Number Out of Range" + errors[0xce00] = "EA Bad Directory Number" + errors[0xcf00] = "Invalid EA Handle" + + errors[0xd000] = "Queue error" + errors[0xd001] = "EA Position Out of Range" + + errors[0xd100] = "The queue does not exist" + errors[0xd101] = "EA Access Denied" + + errors[0xd200] = "A queue server is not associated with this queue" + errors[0xd201] = "A queue server is not associated with the selected queue" + errors[0xd202] = "No queue server" + errors[0xd203] = "Data Page Odd Size" + + errors[0xd300] = "No queue rights" + errors[0xd301] = "EA Volume Not Mounted" + + errors[0xd400] = "The queue is full and cannot accept another request" + errors[0xd401] = "The queue associated with ObjectId is full and cannot accept another request" + errors[0xd402] = "Bad Page Boundary" + + errors[0xd500] = "A job does not exist in this queue" + errors[0xd501] = "No queue job" + errors[0xd502] = "The job associated with JobNumber does not exist in this queue" + errors[0xd503] = "Inspect Failure" + + errors[0xd600] = "The file server does not allow unencrypted passwords" + errors[0xd601] = "No job right" + errors[0xd602] = "EA Already Claimed" + + errors[0xd700] = "Bad account" + errors[0xd701] = "The old and new password strings are identical" + errors[0xd702] = "The job is currently being serviced" + errors[0xd703] = "The queue is currently servicing a job" + errors[0xd704] = "Queue servicing" + errors[0xd705] = "Odd Buffer Size" + + errors[0xd800] = "Queue not active" + errors[0xd801] = "No Scorecards" + + errors[0xd900] = "The file server cannot accept another connection as it has reached its limit" + errors[0xd901] = "The client is not security equivalent to one of the objects in the Q_SERVERS group property of the target queue" + errors[0xd902] = "Station is not a server" + errors[0xd903] = "Bad EDS Signature" + + errors[0xda00] = "Attempted to login to the file server during a restricted time period" + errors[0xda01] = "Queue halted" + errors[0xda02] = "EA Space Limit" + + errors[0xdb00] = "Attempted to login to the file server from an unauthorized workstation or network" + errors[0xdb01] = "The queue cannot attach another queue server" + errors[0xdb02] = "Maximum queue servers" + errors[0xdb03] = "EA Key Corrupt" + + errors[0xdc00] = "Account Expired" + errors[0xdc01] = "EA Key Limit" + + errors[0xdd00] = "Tally Corrupt" + errors[0xde00] = "Attempted to login to the file server with an incorrect password" + errors[0xdf00] = "Attempted to login to the file server with a password that has expired" + + errors[0xe000] = "No Login Connections Available" + errors[0xe700] = "No disk track" + errors[0xe800] = "Write to group" + errors[0xe900] = "The object is already a member of the group property" + + errors[0xea00] = "No such member" + errors[0xea01] = "The bindery object is not a member of the set" + errors[0xea02] = "Non-existent member" + + errors[0xeb00] = "The property is not a set property" + + errors[0xec00] = "No such set" + errors[0xec01] = "The set property does not exist" + + errors[0xed00] = "Property exists" + errors[0xed01] = "The property already exists" + errors[0xed02] = "An attempt was made to create a bindery object property that already exists" + + errors[0xee00] = "The object already exists" + errors[0xee01] = "The bindery object already exists" + + errors[0xef00] = "Illegal name" + errors[0xef01] = "Illegal characters in ObjectName field" + errors[0xef02] = "Invalid name" + + errors[0xf000] = "A wildcard was detected in a field that does not support wildcards" + errors[0xf001] = "An illegal wildcard was detected in ObjectName" + + errors[0xf100] = "The client does not have the rights to access this bindery object" + errors[0xf101] = "Bindery security" + errors[0xf102] = "Invalid bindery security" + + errors[0xf200] = "Unauthorized to read from this object" + errors[0xf300] = "Unauthorized to rename this object" + + errors[0xf400] = "Unauthorized to delete this object" + errors[0xf401] = "No object delete privileges" + errors[0xf402] = "Unauthorized to delete this queue" + + errors[0xf500] = "Unauthorized to create this object" + errors[0xf501] = "No object create" + + errors[0xf600] = "No property delete" + errors[0xf601] = "Unauthorized to delete the property of this object" + errors[0xf602] = "Unauthorized to delete this property" + + errors[0xf700] = "Unauthorized to create this property" + errors[0xf701] = "No property create privilege" + + errors[0xf800] = "Unauthorized to write to this property" + errors[0xf900] = "Unauthorized to read this property" + errors[0xfa00] = "Temporary remap error" + + errors[0xfb00] = "No such property" + errors[0xfb01] = "The file server does not support this request" + errors[0xfb02] = "The specified property does not exist" + errors[0xfb03] = "The PASSWORD property does not exist for this bindery object" + errors[0xfb04] = "NDS NCP not available" + errors[0xfb05] = "Bad Directory Handle" + errors[0xfb06] = "Unknown Request" errors[0xfb07] = "Invalid Subfunction Request" errors[0xfb08] = "Attempt to use an invalid parameter (drive number, path, or flag value) during a set drive path call" errors[0xfb09] = "NMAS not installed on this server, NCP NOT Supported" - - errors[0xfc00] = "The message queue cannot accept another message" - errors[0xfc01] = "The trustee associated with ObjectId does not exist" - errors[0xfc02] = "The specified bindery object does not exist" - errors[0xfc03] = "The bindery object associated with ObjectID does not exist" - errors[0xfc04] = "A bindery object does not exist that matches" - errors[0xfc05] = "The specified queue does not exist" - errors[0xfc06] = "No such object" - errors[0xfc07] = "The queue associated with ObjectID does not exist" - - errors[0xfd00] = "Bad station number" - errors[0xfd01] = "The connection associated with ConnectionNumber is not active" - errors[0xfd02] = "Lock collision" - errors[0xfd03] = "Transaction tracking is disabled" - - errors[0xfe00] = "I/O failure" - errors[0xfe01] = "The files containing the bindery on the file server are locked" - errors[0xfe02] = "A file with the specified name already exists in this directory" - errors[0xfe03] = "No more restrictions were found" - errors[0xfe04] = "The file server was unable to lock the file within the specified time limit" - errors[0xfe05] = "The file server was unable to lock all files within the specified time limit" - errors[0xfe06] = "The bindery object associated with ObjectID is not a valid trustee" - errors[0xfe07] = "Directory locked" - errors[0xfe08] = "Bindery locked" - errors[0xfe09] = "Invalid semaphore name length" - errors[0xfe0a] = "The file server was unable to complete the operation within the specified time limit" - errors[0xfe0b] = "Transaction restart" - errors[0xfe0c] = "Bad packet" - errors[0xfe0d] = "Timeout" - errors[0xfe0e] = "User Not Found" - errors[0xfe0f] = "Trustee Not Found" - - errors[0xff00] = "Failure" - errors[0xff01] = "Lock error" - errors[0xff02] = "File not found" - errors[0xff03] = "The file not found or cannot be unlocked" - errors[0xff04] = "Record not found" - errors[0xff05] = "The logical record was not found" - errors[0xff06] = "The printer associated with PrinterNumber does not exist" - errors[0xff07] = "No such printer" - errors[0xff08] = "Unable to complete the request" - errors[0xff09] = "Unauthorized to change privileges of this trustee" - errors[0xff0a] = "No files matching the search criteria were found" - errors[0xff0b] = "A file matching the search criteria was not found" - errors[0xff0c] = "Verification failed" - errors[0xff0d] = "Object associated with ObjectID is not a manager" - errors[0xff0e] = "Invalid initial semaphore value" - errors[0xff0f] = "The semaphore handle is not valid" - errors[0xff10] = "SemaphoreHandle is not associated with a valid sempahore" - errors[0xff11] = "Invalid semaphore handle" - errors[0xff12] = "Transaction tracking is not available" - errors[0xff13] = "The transaction has not yet been written to disk" - errors[0xff14] = "Directory already exists" - errors[0xff15] = "The file already exists and the deletion flag was not set" - errors[0xff16] = "No matching files or directories were found" - errors[0xff17] = "A file or directory matching the search criteria was not found" - errors[0xff18] = "The file already exists" - errors[0xff19] = "Failure, No files found" - errors[0xff1a] = "Unlock Error" - errors[0xff1b] = "I/O Bound Error" - errors[0xff1c] = "Not Accepting Messages" - errors[0xff1d] = "No More Salvageable Files in Directory" - errors[0xff1e] = "Calling Station is Not a Manager" - errors[0xff1f] = "Bindery Failure" - + errors[0xfb0a] = "Station Not Logged In" + + errors[0xfc00] = "The message queue cannot accept another message" + errors[0xfc01] = "The trustee associated with ObjectId does not exist" + errors[0xfc02] = "The specified bindery object does not exist" + errors[0xfc03] = "The bindery object associated with ObjectID does not exist" + errors[0xfc04] = "A bindery object does not exist that matches" + errors[0xfc05] = "The specified queue does not exist" + errors[0xfc06] = "No such object" + errors[0xfc07] = "The queue associated with ObjectID does not exist" + + errors[0xfd00] = "Bad station number" + errors[0xfd01] = "The connection associated with ConnectionNumber is not active" + errors[0xfd02] = "Lock collision" + errors[0xfd03] = "Transaction tracking is disabled" + + errors[0xfe00] = "I/O failure" + errors[0xfe01] = "The files containing the bindery on the file server are locked" + errors[0xfe02] = "A file with the specified name already exists in this directory" + errors[0xfe03] = "No more restrictions were found" + errors[0xfe04] = "The file server was unable to lock the file within the specified time limit" + errors[0xfe05] = "The file server was unable to lock all files within the specified time limit" + errors[0xfe06] = "The bindery object associated with ObjectID is not a valid trustee" + errors[0xfe07] = "Directory locked" + errors[0xfe08] = "Bindery locked" + errors[0xfe09] = "Invalid semaphore name length" + errors[0xfe0a] = "The file server was unable to complete the operation within the specified time limit" + errors[0xfe0b] = "Transaction restart" + errors[0xfe0c] = "Bad packet" + errors[0xfe0d] = "Timeout" + errors[0xfe0e] = "User Not Found" + errors[0xfe0f] = "Trustee Not Found" + + errors[0xff00] = "Failure" + errors[0xff01] = "Lock error" + errors[0xff02] = "File not found" + errors[0xff03] = "The file not found or cannot be unlocked" + errors[0xff04] = "Record not found" + errors[0xff05] = "The logical record was not found" + errors[0xff06] = "The printer associated with Printer Number does not exist" + errors[0xff07] = "No such printer" + errors[0xff08] = "Unable to complete the request" + errors[0xff09] = "Unauthorized to change privileges of this trustee" + errors[0xff0a] = "No files matching the search criteria were found" + errors[0xff0b] = "A file matching the search criteria was not found" + errors[0xff0c] = "Verification failed" + errors[0xff0d] = "Object associated with ObjectID is not a manager" + errors[0xff0e] = "Invalid initial semaphore value" + errors[0xff0f] = "The semaphore handle is not valid" + errors[0xff10] = "SemaphoreHandle is not associated with a valid sempahore" + errors[0xff11] = "Invalid semaphore handle" + errors[0xff12] = "Transaction tracking is not available" + errors[0xff13] = "The transaction has not yet been written to disk" + errors[0xff14] = "Directory already exists" + errors[0xff15] = "The file already exists and the deletion flag was not set" + errors[0xff16] = "No matching files or directories were found" + errors[0xff17] = "A file or directory matching the search criteria was not found" + errors[0xff18] = "The file already exists" + errors[0xff19] = "Failure, No files found" + errors[0xff1a] = "Unlock Error" + errors[0xff1b] = "I/O Bound Error" + errors[0xff1c] = "Not Accepting Messages" + errors[0xff1d] = "No More Salvageable Files in Directory" + errors[0xff1e] = "Calling Station is Not a Manager" + errors[0xff1f] = "Bindery Failure" + errors[0xff20] = "NCP Extension Not Found" ############################################################################## # Produce C code @@ -5623,6 +5528,14 @@ static int ptvc_struct_int_storage; #define REQ_COND_SIZE_VARIABLE 1 #define NO_REQ_COND_SIZE 0 + +#define NTREE 0x00020000 +#define NDEPTH 0x00000002 +#define NREV 0x00000004 +#define NFLAGS 0x00000008 + + + static int hf_ncp_func = -1; static int hf_ncp_length = -1; static int hf_ncp_subfunc = -1; @@ -5633,9 +5546,338 @@ static int hf_ncp_req_frame_num = -1; static int hf_ncp_fragment_size = -1; static int hf_ncp_message_size = -1; static int hf_ncp_nds_flag = -1; -static int hf_ncp_nds_verb = -1; - """ +static int hf_ncp_nds_verb = -1; +static int hf_ping_version = -1; +static int hf_nds_version = -1; +static int hf_nds_flags = -1; +static int hf_nds_flags_tree = -1; +static int hf_nds_flags_depth = -1; +static int hf_nds_flags_rev = -1; +static int hf_nds_flags_flags = -1; +static int hf_nds_reply_depth = -1; +static int hf_nds_reply_rev = -1; +static int hf_nds_reply_flags = -1; +static int hf_nds_p1type = -1; +static int hf_nds_uint32value = -1; +static int hf_nds_bit1 = -1; +static int hf_nds_bit2 = -1; +static int hf_nds_bit3 = -1; +static int hf_nds_bit4 = -1; +static int hf_nds_bit5 = -1; +static int hf_nds_bit6 = -1; +static int hf_nds_bit7 = -1; +static int hf_nds_bit8 = -1; +static int hf_nds_bit9 = -1; +static int hf_nds_bit10 = -1; +static int hf_nds_bit11 = -1; +static int hf_nds_bit12 = -1; +static int hf_nds_bit13 = -1; +static int hf_nds_bit14 = -1; +static int hf_nds_bit15 = -1; +static int hf_nds_bit16 = -1; +static int hf_bit1outflags = -1; +static int hf_bit2outflags = -1; +static int hf_bit3outflags = -1; +static int hf_bit4outflags = -1; +static int hf_bit5outflags = -1; +static int hf_bit6outflags = -1; +static int hf_bit7outflags = -1; +static int hf_bit8outflags = -1; +static int hf_bit9outflags = -1; +static int hf_bit10outflags = -1; +static int hf_bit11outflags = -1; +static int hf_bit12outflags = -1; +static int hf_bit13outflags = -1; +static int hf_bit14outflags = -1; +static int hf_bit15outflags = -1; +static int hf_bit16outflags = -1; +static int hf_bit1nflags = -1; +static int hf_bit2nflags = -1; +static int hf_bit3nflags = -1; +static int hf_bit4nflags = -1; +static int hf_bit5nflags = -1; +static int hf_bit6nflags = -1; +static int hf_bit7nflags = -1; +static int hf_bit8nflags = -1; +static int hf_bit9nflags = -1; +static int hf_bit10nflags = -1; +static int hf_bit11nflags = -1; +static int hf_bit12nflags = -1; +static int hf_bit13nflags = -1; +static int hf_bit14nflags = -1; +static int hf_bit15nflags = -1; +static int hf_bit16nflags = -1; +static int hf_bit1rflags = -1; +static int hf_bit2rflags = -1; +static int hf_bit3rflags = -1; +static int hf_bit4rflags = -1; +static int hf_bit5rflags = -1; +static int hf_bit6rflags = -1; +static int hf_bit7rflags = -1; +static int hf_bit8rflags = -1; +static int hf_bit9rflags = -1; +static int hf_bit10rflags = -1; +static int hf_bit11rflags = -1; +static int hf_bit12rflags = -1; +static int hf_bit13rflags = -1; +static int hf_bit14rflags = -1; +static int hf_bit15rflags = -1; +static int hf_bit16rflags = -1; +static int hf_bit1cflags = -1; +static int hf_bit2cflags = -1; +static int hf_bit3cflags = -1; +static int hf_bit4cflags = -1; +static int hf_bit5cflags = -1; +static int hf_bit6cflags = -1; +static int hf_bit7cflags = -1; +static int hf_bit8cflags = -1; +static int hf_bit9cflags = -1; +static int hf_bit10cflags = -1; +static int hf_bit11cflags = -1; +static int hf_bit12cflags = -1; +static int hf_bit13cflags = -1; +static int hf_bit14cflags = -1; +static int hf_bit15cflags = -1; +static int hf_bit16cflags = -1; +static int hf_bit1acflags = -1; +static int hf_bit2acflags = -1; +static int hf_bit3acflags = -1; +static int hf_bit4acflags = -1; +static int hf_bit5acflags = -1; +static int hf_bit6acflags = -1; +static int hf_bit7acflags = -1; +static int hf_bit8acflags = -1; +static int hf_bit9acflags = -1; +static int hf_bit10acflags = -1; +static int hf_bit11acflags = -1; +static int hf_bit12acflags = -1; +static int hf_bit13acflags = -1; +static int hf_bit14acflags = -1; +static int hf_bit15acflags = -1; +static int hf_bit16acflags = -1; +static int hf_bit1vflags = -1; +static int hf_bit2vflags = -1; +static int hf_bit3vflags = -1; +static int hf_bit4vflags = -1; +static int hf_bit5vflags = -1; +static int hf_bit6vflags = -1; +static int hf_bit7vflags = -1; +static int hf_bit8vflags = -1; +static int hf_bit9vflags = -1; +static int hf_bit10vflags = -1; +static int hf_bit11vflags = -1; +static int hf_bit12vflags = -1; +static int hf_bit13vflags = -1; +static int hf_bit14vflags = -1; +static int hf_bit15vflags = -1; +static int hf_bit16vflags = -1; +static int hf_bit1eflags = -1; +static int hf_bit2eflags = -1; +static int hf_bit3eflags = -1; +static int hf_bit4eflags = -1; +static int hf_bit5eflags = -1; +static int hf_bit6eflags = -1; +static int hf_bit7eflags = -1; +static int hf_bit8eflags = -1; +static int hf_bit9eflags = -1; +static int hf_bit10eflags = -1; +static int hf_bit11eflags = -1; +static int hf_bit12eflags = -1; +static int hf_bit13eflags = -1; +static int hf_bit14eflags = -1; +static int hf_bit15eflags = -1; +static int hf_bit16eflags = -1; +static int hf_bit1infoflagsl = -1; +static int hf_bit2infoflagsl = -1; +static int hf_bit3infoflagsl = -1; +static int hf_bit4infoflagsl = -1; +static int hf_bit5infoflagsl = -1; +static int hf_bit6infoflagsl = -1; +static int hf_bit7infoflagsl = -1; +static int hf_bit8infoflagsl = -1; +static int hf_bit9infoflagsl = -1; +static int hf_bit10infoflagsl = -1; +static int hf_bit11infoflagsl = -1; +static int hf_bit12infoflagsl = -1; +static int hf_bit13infoflagsl = -1; +static int hf_bit14infoflagsl = -1; +static int hf_bit15infoflagsl = -1; +static int hf_bit16infoflagsl = -1; +static int hf_bit1infoflagsh = -1; +static int hf_bit2infoflagsh = -1; +static int hf_bit3infoflagsh = -1; +static int hf_bit4infoflagsh = -1; +static int hf_bit5infoflagsh = -1; +static int hf_bit6infoflagsh = -1; +static int hf_bit7infoflagsh = -1; +static int hf_bit8infoflagsh = -1; +static int hf_bit9infoflagsh = -1; +static int hf_bit10infoflagsh = -1; +static int hf_bit11infoflagsh = -1; +static int hf_bit12infoflagsh = -1; +static int hf_bit13infoflagsh = -1; +static int hf_bit14infoflagsh = -1; +static int hf_bit15infoflagsh = -1; +static int hf_bit16infoflagsh = -1; +static int hf_bit1lflags = -1; +static int hf_bit2lflags = -1; +static int hf_bit3lflags = -1; +static int hf_bit4lflags = -1; +static int hf_bit5lflags = -1; +static int hf_bit6lflags = -1; +static int hf_bit7lflags = -1; +static int hf_bit8lflags = -1; +static int hf_bit9lflags = -1; +static int hf_bit10lflags = -1; +static int hf_bit11lflags = -1; +static int hf_bit12lflags = -1; +static int hf_bit13lflags = -1; +static int hf_bit14lflags = -1; +static int hf_bit15lflags = -1; +static int hf_bit16lflags = -1; +static int hf_bit1l1flagsl = -1; +static int hf_bit2l1flagsl = -1; +static int hf_bit3l1flagsl = -1; +static int hf_bit4l1flagsl = -1; +static int hf_bit5l1flagsl = -1; +static int hf_bit6l1flagsl = -1; +static int hf_bit7l1flagsl = -1; +static int hf_bit8l1flagsl = -1; +static int hf_bit9l1flagsl = -1; +static int hf_bit10l1flagsl = -1; +static int hf_bit11l1flagsl = -1; +static int hf_bit12l1flagsl = -1; +static int hf_bit13l1flagsl = -1; +static int hf_bit14l1flagsl = -1; +static int hf_bit15l1flagsl = -1; +static int hf_bit16l1flagsl = -1; +static int hf_bit1l1flagsh = -1; +static int hf_bit2l1flagsh = -1; +static int hf_bit3l1flagsh = -1; +static int hf_bit4l1flagsh = -1; +static int hf_bit5l1flagsh = -1; +static int hf_bit6l1flagsh = -1; +static int hf_bit7l1flagsh = -1; +static int hf_bit8l1flagsh = -1; +static int hf_bit9l1flagsh = -1; +static int hf_bit10l1flagsh = -1; +static int hf_bit11l1flagsh = -1; +static int hf_bit12l1flagsh = -1; +static int hf_bit13l1flagsh = -1; +static int hf_bit14l1flagsh = -1; +static int hf_bit15l1flagsh = -1; +static int hf_bit16l1flagsh = -1; +static int hf_nds_string = -1; +static int hf_nds_string_value = -1; +static int hf_nds_reply_error = -1; +static int hf_nds_net = -1; +static int hf_nds_node = -1; +static int hf_nds_socket = -1; +static int hf_add_ref_ip = -1; +static int hf_add_ref_udp = -1; +static int hf_add_ref_tcp = -1; +static int hf_referal_record = -1; +static int hf_referal_addcount = -1; +static int hf_nds_port = -1; +static int hf_mv_string = -1; +static int hf_nds_syntax = -1; +static int hf_value_string = -1; +static int hf_nds_buffer_size = -1; +static int hf_nds_ver = -1; +static int hf_nds_nflags = -1; +static int hf_nds_scope = -1; +static int hf_nds_name = -1; +static int hf_nds_comm_trans = -1; +static int hf_nds_tree_trans = -1; +static int hf_nds_iteration = -1; +static int hf_nds_eid = -1; +static int hf_nds_info_type = -1; +static int hf_nds_all_attr = -1; +static int hf_nds_req_flags = -1; +static int hf_nds_attr = -1; +static int hf_nds_crc = -1; +static int hf_nds_referals = -1; +static int hf_nds_result_flags = -1; +static int hf_nds_tag_string = -1; +static int hf_value_bytes = -1; +static int hf_replica_type = -1; +static int hf_replica_state = -1; +static int hf_replica_number = -1; +static int hf_min_nds_ver = -1; +static int hf_nds_ver_include = -1; +static int hf_nds_ver_exclude = -1; +static int hf_nds_es = -1; +static int hf_es_type = -1; +static int hf_delim_string = -1; +static int hf_rdn_string = -1; +static int hf_nds_revent = -1; +static int hf_nds_rnum = -1; +static int hf_nds_name_type = -1; +static int hf_nds_rflags = -1; +static int hf_nds_eflags = -1; +static int hf_nds_depth = -1; +static int hf_nds_class_def_type = -1; +static int hf_nds_classes = -1; +static int hf_nds_return_all_classes = -1; +static int hf_nds_stream_flags = -1; +static int hf_nds_stream_name = -1; +static int hf_nds_file_handle = -1; +static int hf_nds_file_size = -1; +static int hf_nds_dn_output_type = -1; +static int hf_nds_nested_output_type = -1; +static int hf_nds_output_delimiter = -1; +static int hf_nds_output_entry_specifier = -1; +static int hf_es_value = -1; +static int hf_es_rdn_count = -1; +static int hf_nds_replica_num = -1; +static int hf_nds_event_num = -1; +static int hf_es_seconds = -1; +static int hf_nds_compare_results = -1; +static int hf_nds_parent = -1; +static int hf_nds_name_filter = -1; +static int hf_nds_class_filter = -1; +static int hf_nds_time_filter = -1; +static int hf_nds_partition_root_id = -1; +static int hf_nds_replicas = -1; +static int hf_nds_purge = -1; +static int hf_nds_local_partition = -1; +static int hf_partition_busy = -1; +static int hf_nds_number_of_changes = -1; +static int hf_sub_count = -1; +static int hf_nds_revision = -1; +static int hf_nds_base_class = -1; +static int hf_nds_relative_dn = -1; +static int hf_nds_root_dn = -1; +static int hf_nds_parent_dn = -1; +static int hf_deref_base = -1; +static int hf_nds_entry_info = -1; +static int hf_nds_base = -1; +static int hf_nds_privileges = -1; +static int hf_nds_vflags = -1; +static int hf_nds_value_len = -1; +static int hf_nds_cflags = -1; +static int hf_nds_acflags = -1; +static int hf_nds_asn1 = -1; +static int hf_nds_upper = -1; +static int hf_nds_lower = -1; +static int hf_nds_trustee_dn = -1; +static int hf_nds_attribute_dn = -1; +static int hf_nds_acl_add = -1; +static int hf_nds_acl_del = -1; +static int hf_nds_att_add = -1; +static int hf_nds_att_del = -1; +static int hf_nds_keep = -1; +static int hf_nds_new_rdn = -1; +static int hf_nds_time_delay = -1; +static int hf_nds_root_name = -1; +static int hf_nds_new_part_id = -1; +static int hf_nds_child_part_id = -1; +static int hf_nds_master_part_id = -1; +static int hf_nds_target_name = -1; + + """ + # Look at all packet types in the packets collection, and cull information # from them. errors_used_list = [] @@ -5676,8 +5918,7 @@ static int hf_ncp_nds_verb = -1; if isinstance(var, val_string): print "" print var.Code() - - + # Determine which error codes are not used errors_not_used = {} # Copy the keys from the error list... @@ -5828,7 +6069,7 @@ static int hf_ncp_nds_verb = -1; print "%s, " % (val,), print "-1 };" - print "" + print "" @@ -5855,7 +6096,7 @@ static int hf_ncp_nds_verb = -1; print "#define NO_SUBFUNC 0x00" print "/* ncp_record structs for packets */" - print "static const ncp_record ncp_packets[] = {" + print "static const ncp_record ncp_packets[] = {" for pkt in packets: if pkt.HasSubFunction(): func = pkt.FunctionCode('high') @@ -5946,7 +6187,7 @@ final_registration_ncp2222(void) int i; """ - # Create dfilter_t's for conditional_record's + # Create dfilter_t's for conditional_record's print """ for (i = 0; i < NUM_REQ_CONDS; i++) { if (!dfilter_compile((gchar*)req_conds[i].dfilter_text, @@ -6070,9 +6311,21 @@ proto_register_ncp2222(void) { &hf_ncp_nds_flag, { "Flags", "ncp.ndsflag", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, - { &hf_ncp_nds_verb, - { "NDS Verb", "ncp.ndsverb", FT_UINT8, BASE_HEX, VALS(ncp_nds_verb_vals), 0x0, "", HFILL }}, + { &hf_ncp_nds_verb, + { "NDS Verb", "ncp.ndsverb", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL }}, + { &hf_ping_version, + { "NDS Version", "ncp.ping_version", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_version, + { "NDS Version", "ncp.ndsver", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_nds_string, + { "Tree Name", "ncp.nds_string", FT_STRING, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_string_value, + { "NDS String :", "ncp.nds_string_value", FT_STRING, BASE_DEC, NULL, 0x0, "", HFILL }}, + /* * XXX - the page at * @@ -6102,8 +6355,982 @@ proto_register_ncp2222(void) { &hf_ncp_req_frame_num, { "Response to Request in Frame Number", "ncp.req_frame_num", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, - """ + + { &hf_nds_flags, + { "NDS Return Flags", "ncp.nds_flags", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_nds_flags_tree, + { "Tree", "ncp.nds_flags.tree", FT_BOOLEAN, 32, NULL, NTREE, "Return Tree?", HFILL }}, + + { &hf_nds_flags_depth, + { "Depth", "ncp.nds_flags.depth", FT_BOOLEAN, 32, NULL, NDEPTH, "Return Depth?", HFILL }}, + + { &hf_nds_flags_rev, + { "Rev", "ncp.nds_flags.rev", FT_BOOLEAN, 32, NULL, NREV, "Return NDS Revision?", HFILL }}, + + { &hf_nds_flags_flags, + { "Flags", "ncp.nds_flags.flags", FT_BOOLEAN, 32, NULL, NFLAGS, "Return Flags?", HFILL }}, + + { &hf_nds_reply_depth, + { "Distance from Root", "ncp.ndsdepth", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_reply_rev, + { "NDS Revision", "ncp.ndsrev", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_nds_reply_flags, + { "Flags", "ncp.ndsflags", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_nds_p1type, + { "NDS Parameter Type", "ncp.p1type", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_uint32value, + { "NDS Value", "ncp.uint32value", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_bit1, + { "Typeless", "ncp.nds_bit1", FT_BOOLEAN, 16, NULL, 0x00000001, "", HFILL }}, + + { &hf_nds_bit2, + { "All Containers", "ncp.nds_bit2", FT_BOOLEAN, 16, NULL, 0x00000002, "", HFILL }}, + + { &hf_nds_bit3, + { "Slashed", "ncp.nds_bit3", FT_BOOLEAN, 16, NULL, 0x00000004, "", HFILL }}, + + { &hf_nds_bit4, + { "Dotted", "ncp.nds_bit4", FT_BOOLEAN, 16, NULL, 0x00000008, "", HFILL }}, + + { &hf_nds_bit5, + { "Tuned", "ncp.nds_bit5", FT_BOOLEAN, 16, NULL, 0x00000010, "", HFILL }}, + + { &hf_nds_bit6, + { "Not Defined", "ncp.nds_bit6", FT_BOOLEAN, 16, NULL, 0x00000020, "", HFILL }}, + + { &hf_nds_bit7, + { "Not Defined", "ncp.nds_bit7", FT_BOOLEAN, 16, NULL, 0x00000040, "", HFILL }}, + + { &hf_nds_bit8, + { "Not Defined", "ncp.nds_bit8", FT_BOOLEAN, 16, NULL, 0x00000080, "", HFILL }}, + + { &hf_nds_bit9, + { "Not Defined", "ncp.nds_bit9", FT_BOOLEAN, 16, NULL, 0x00000100, "", HFILL }}, + + { &hf_nds_bit10, + { "Not Defined", "ncp.nds_bit10", FT_BOOLEAN, 16, NULL, 0x00000200, "", HFILL }}, + + { &hf_nds_bit11, + { "Not Defined", "ncp.nds_bit11", FT_BOOLEAN, 16, NULL, 0x00000400, "", HFILL }}, + + { &hf_nds_bit12, + { "Not Defined", "ncp.nds_bit12", FT_BOOLEAN, 16, NULL, 0x00000800, "", HFILL }}, + + { &hf_nds_bit13, + { "Not Defined", "ncp.nds_bit13", FT_BOOLEAN, 16, NULL, 0x00001000, "", HFILL }}, + + { &hf_nds_bit14, + { "Not Defined", "ncp.nds_bit14", FT_BOOLEAN, 16, NULL, 0x00002000, "", HFILL }}, + + { &hf_nds_bit15, + { "Not Defined", "ncp.nds_bit15", FT_BOOLEAN, 16, NULL, 0x00004000, "", HFILL }}, + + { &hf_nds_bit16, + { "Not Defined", "ncp.nds_bit16", FT_BOOLEAN, 16, NULL, 0x00008000, "", HFILL }}, + + { &hf_bit1outflags, + { "Output Flags", "ncp.bit1outflags", FT_BOOLEAN, 16, NULL, 0x00000001, "", HFILL }}, + + { &hf_bit2outflags, + { "Entry ID", "ncp.bit2outflags", FT_BOOLEAN, 16, NULL, 0x00000002, "", HFILL }}, + + { &hf_bit3outflags, + { "Replica State", "ncp.bit3outflags", FT_BOOLEAN, 16, NULL, 0x00000004, "", HFILL }}, + + { &hf_bit4outflags, + { "Modification Timestamp", "ncp.bit4outflags", FT_BOOLEAN, 16, NULL, 0x00000008, "", HFILL }}, + + { &hf_bit5outflags, + { "Purge Time", "ncp.bit5outflags", FT_BOOLEAN, 16, NULL, 0x00000010, "", HFILL }}, + + { &hf_bit6outflags, + { "Local Partition ID", "ncp.bit6outflags", FT_BOOLEAN, 16, NULL, 0x00000020, "", HFILL }}, + + { &hf_bit7outflags, + { "Distinguished Name", "ncp.bit7outflags", FT_BOOLEAN, 16, NULL, 0x00000040, "", HFILL }}, + + { &hf_bit8outflags, + { "Replica Type", "ncp.bit8outflags", FT_BOOLEAN, 16, NULL, 0x00000080, "", HFILL }}, + + { &hf_bit9outflags, + { "Partition Busy", "ncp.bit9outflags", FT_BOOLEAN, 16, NULL, 0x00000100, "", HFILL }}, + + { &hf_bit10outflags, + { "Not Defined", "ncp.bit10outflags", FT_BOOLEAN, 16, NULL, 0x00000200, "", HFILL }}, + + { &hf_bit11outflags, + { "Not Defined", "ncp.bit11outflags", FT_BOOLEAN, 16, NULL, 0x00000400, "", HFILL }}, + + { &hf_bit12outflags, + { "Not Defined", "ncp.bit12outflags", FT_BOOLEAN, 16, NULL, 0x00000800, "", HFILL }}, + + { &hf_bit13outflags, + { "Not Defined", "ncp.bit13outflags", FT_BOOLEAN, 16, NULL, 0x00001000, "", HFILL }}, + + { &hf_bit14outflags, + { "Not Defined", "ncp.bit14outflags", FT_BOOLEAN, 16, NULL, 0x00002000, "", HFILL }}, + + { &hf_bit15outflags, + { "Not Defined", "ncp.bit15outflags", FT_BOOLEAN, 16, NULL, 0x00004000, "", HFILL }}, + + { &hf_bit16outflags, + { "Not Defined", "ncp.bit16outflags", FT_BOOLEAN, 16, NULL, 0x00008000, "", HFILL }}, + + { &hf_bit1nflags, + { "Entry ID", "ncp.bit1nflags", FT_BOOLEAN, 16, NULL, 0x00000001, "", HFILL }}, + + { &hf_bit2nflags, + { "Readable", "ncp.bit2nflags", FT_BOOLEAN, 16, NULL, 0x00000002, "", HFILL }}, + + { &hf_bit3nflags, + { "Writeable", "ncp.bit3nflags", FT_BOOLEAN, 16, NULL, 0x00000004, "", HFILL }}, + + { &hf_bit4nflags, + { "Master", "ncp.bit4nflags", FT_BOOLEAN, 16, NULL, 0x00000008, "", HFILL }}, + + { &hf_bit5nflags, + { "Create ID", "ncp.bit5nflags", FT_BOOLEAN, 16, NULL, 0x00000010, "", HFILL }}, + + { &hf_bit6nflags, + { "Walk Tree", "ncp.bit6nflags", FT_BOOLEAN, 16, NULL, 0x00000020, "", HFILL }}, + + { &hf_bit7nflags, + { "Dereference Alias", "ncp.bit7nflags", FT_BOOLEAN, 16, NULL, 0x00000040, "", HFILL }}, + + { &hf_bit8nflags, + { "Not Defined", "ncp.bit8nflags", FT_BOOLEAN, 16, NULL, 0x00000080, "", HFILL }}, + + { &hf_bit9nflags, + { "Not Defined", "ncp.bit9nflags", FT_BOOLEAN, 16, NULL, 0x00000100, "", HFILL }}, + + { &hf_bit10nflags, + { "Not Defined", "ncp.bit10nflags", FT_BOOLEAN, 16, NULL, 0x00000200, "", HFILL }}, + + { &hf_bit11nflags, + { "Not Defined", "ncp.bit11nflags", FT_BOOLEAN, 16, NULL, 0x00000400, "", HFILL }}, + + { &hf_bit12nflags, + { "Not Defined", "ncp.bit12nflags", FT_BOOLEAN, 16, NULL, 0x00000800, "", HFILL }}, + + { &hf_bit13nflags, + { "Not Defined", "ncp.bit13nflags", FT_BOOLEAN, 16, NULL, 0x00001000, "", HFILL }}, + + { &hf_bit14nflags, + { "Prefer Referalls", "ncp.bit14nflags", FT_BOOLEAN, 16, NULL, 0x00002000, "", HFILL }}, + + { &hf_bit15nflags, + { "Prefer Only Referalls", "ncp.bit15nflags", FT_BOOLEAN, 16, NULL, 0x00004000, "", HFILL }}, + + { &hf_bit16nflags, + { "Not Defined", "ncp.bit16nflags", FT_BOOLEAN, 16, NULL, 0x00008000, "", HFILL }}, + + { &hf_bit1rflags, + { "Typeless", "ncp.bit1rflags", FT_BOOLEAN, 16, NULL, 0x00000001, "", HFILL }}, + + { &hf_bit2rflags, + { "Slashed", "ncp.bit2rflags", FT_BOOLEAN, 16, NULL, 0x00000002, "", HFILL }}, + + { &hf_bit3rflags, + { "Dotted", "ncp.bit3rflags", FT_BOOLEAN, 16, NULL, 0x00000004, "", HFILL }}, + + { &hf_bit4rflags, + { "Tuned", "ncp.bit4rflags", FT_BOOLEAN, 16, NULL, 0x00000008, "", HFILL }}, + + { &hf_bit5rflags, + { "Not Defined", "ncp.bit5rflags", FT_BOOLEAN, 16, NULL, 0x00000010, "", HFILL }}, + + { &hf_bit6rflags, + { "Not Defined", "ncp.bit6rflags", FT_BOOLEAN, 16, NULL, 0x00000020, "", HFILL }}, + + { &hf_bit7rflags, + { "Not Defined", "ncp.bit7rflags", FT_BOOLEAN, 16, NULL, 0x00000040, "", HFILL }}, + + { &hf_bit8rflags, + { "Not Defined", "ncp.bit8rflags", FT_BOOLEAN, 16, NULL, 0x00000080, "", HFILL }}, + + { &hf_bit9rflags, + { "Not Defined", "ncp.bit9rflags", FT_BOOLEAN, 16, NULL, 0x00000100, "", HFILL }}, + + { &hf_bit10rflags, + { "Not Defined", "ncp.bit10rflags", FT_BOOLEAN, 16, NULL, 0x00000200, "", HFILL }}, + + { &hf_bit11rflags, + { "Not Defined", "ncp.bit11rflags", FT_BOOLEAN, 16, NULL, 0x00000400, "", HFILL }}, + + { &hf_bit12rflags, + { "Not Defined", "ncp.bit12rflags", FT_BOOLEAN, 16, NULL, 0x00000800, "", HFILL }}, + + { &hf_bit13rflags, + { "Not Defined", "ncp.bit13rflags", FT_BOOLEAN, 16, NULL, 0x00001000, "", HFILL }}, + + { &hf_bit14rflags, + { "Not Defined", "ncp.bit14rflags", FT_BOOLEAN, 16, NULL, 0x00002000, "", HFILL }}, + + { &hf_bit15rflags, + { "Not Defined", "ncp.bit15rflags", FT_BOOLEAN, 16, NULL, 0x00004000, "", HFILL }}, + + { &hf_bit16rflags, + { "Not Defined", "ncp.bit16rflags", FT_BOOLEAN, 16, NULL, 0x00008000, "", HFILL }}, + + { &hf_bit1eflags, + { "Alias Entry", "ncp.bit1eflags", FT_BOOLEAN, 16, NULL, 0x00000001, "", HFILL }}, + + { &hf_bit2eflags, + { "Partition Root", "ncp.bit2eflags", FT_BOOLEAN, 16, NULL, 0x00000002, "", HFILL }}, + + { &hf_bit3eflags, + { "Container Entry", "ncp.bit3eflags", FT_BOOLEAN, 16, NULL, 0x00000004, "", HFILL }}, + + { &hf_bit4eflags, + { "Container Alias", "ncp.bit4eflags", FT_BOOLEAN, 16, NULL, 0x00000008, "", HFILL }}, + + { &hf_bit5eflags, + { "Matches List Filter", "ncp.bit5eflags", FT_BOOLEAN, 16, NULL, 0x00000010, "", HFILL }}, + + { &hf_bit6eflags, + { "Reference Entry", "ncp.bit6eflags", FT_BOOLEAN, 16, NULL, 0x00000020, "", HFILL }}, + + { &hf_bit7eflags, + { "40x Reference Entry", "ncp.bit7eflags", FT_BOOLEAN, 16, NULL, 0x00000040, "", HFILL }}, + + { &hf_bit8eflags, + { "Back Linked", "ncp.bit8eflags", FT_BOOLEAN, 16, NULL, 0x00000080, "", HFILL }}, + + { &hf_bit9eflags, + { "New Entry", "ncp.bit9eflags", FT_BOOLEAN, 16, NULL, 0x00000100, "", HFILL }}, + + { &hf_bit10eflags, + { "Temporary Reference", "ncp.bit10eflags", FT_BOOLEAN, 16, NULL, 0x00000200, "", HFILL }}, + + { &hf_bit11eflags, + { "Audited", "ncp.bit11eflags", FT_BOOLEAN, 16, NULL, 0x00000400, "", HFILL }}, + + { &hf_bit12eflags, + { "Entry Not Present", "ncp.bit12eflags", FT_BOOLEAN, 16, NULL, 0x00000800, "", HFILL }}, + + { &hf_bit13eflags, + { "Entry Verify CTS", "ncp.bit13eflags", FT_BOOLEAN, 16, NULL, 0x00001000, "", HFILL }}, + + { &hf_bit14eflags, + { "Entry Damaged", "ncp.bit14eflags", FT_BOOLEAN, 16, NULL, 0x00002000, "", HFILL }}, + + { &hf_bit15eflags, + { "Not Defined", "ncp.bit15rflags", FT_BOOLEAN, 16, NULL, 0x00004000, "", HFILL }}, + + { &hf_bit16eflags, + { "Not Defined", "ncp.bit16rflags", FT_BOOLEAN, 16, NULL, 0x00008000, "", HFILL }}, + + { &hf_bit1infoflagsl, + { "Output Flags", "ncp.bit1infoflagsl", FT_BOOLEAN, 16, NULL, 0x00000001, "", HFILL }}, + + { &hf_bit2infoflagsl, + { "Entry ID", "ncp.bit2infoflagsl", FT_BOOLEAN, 16, NULL, 0x00000002, "", HFILL }}, + + { &hf_bit3infoflagsl, + { "Entry Flags", "ncp.bit3infoflagsl", FT_BOOLEAN, 16, NULL, 0x00000004, "", HFILL }}, + + { &hf_bit4infoflagsl, + { "Subordinate Count", "ncp.bit4infoflagsl", FT_BOOLEAN, 16, NULL, 0x00000008, "", HFILL }}, + + { &hf_bit5infoflagsl, + { "Modification Time", "ncp.bit5infoflagsl", FT_BOOLEAN, 16, NULL, 0x00000010, "", HFILL }}, + + { &hf_bit6infoflagsl, + { "Modification Timestamp", "ncp.bit6infoflagsl", FT_BOOLEAN, 16, NULL, 0x00000020, "", HFILL }}, + + { &hf_bit7infoflagsl, + { "Creation Timestamp", "ncp.bit7infoflagsl", FT_BOOLEAN, 16, NULL, 0x00000040, "", HFILL }}, + + { &hf_bit8infoflagsl, + { "Partition Root ID", "ncp.bit8infoflagsl", FT_BOOLEAN, 16, NULL, 0x00000080, "", HFILL }}, + + { &hf_bit9infoflagsl, + { "Parent ID", "ncp.bit9infoflagsl", FT_BOOLEAN, 16, NULL, 0x00000100, "", HFILL }}, + + { &hf_bit10infoflagsl, + { "Revision Count", "ncp.bit10infoflagsl", FT_BOOLEAN, 16, NULL, 0x00000200, "", HFILL }}, + + { &hf_bit11infoflagsl, + { "Replica Type", "ncp.bit11infoflagsl", FT_BOOLEAN, 16, NULL, 0x00000400, "", HFILL }}, + + { &hf_bit12infoflagsl, + { "Base Class", "ncp.bit12infoflagsl", FT_BOOLEAN, 16, NULL, 0x00000800, "", HFILL }}, + + { &hf_bit13infoflagsl, + { "Relative Distinguished Name", "ncp.bit13infoflagsl", FT_BOOLEAN, 16, NULL, 0x00001000, "", HFILL }}, + + { &hf_bit14infoflagsl, + { "Distinguished Name", "ncp.bit14infoflagsl", FT_BOOLEAN, 16, NULL, 0x00002000, "", HFILL }}, + + { &hf_bit15infoflagsl, + { "Root Distinguished Name", "ncp.bit15infoflagsl", FT_BOOLEAN, 16, NULL, 0x00004000, "", HFILL }}, + + { &hf_bit16infoflagsl, + { "Parent Distinguished Name", "ncp.bit16infoflagsl", FT_BOOLEAN, 16, NULL, 0x00008000, "", HFILL }}, + { &hf_bit1infoflagsh, + { "Purge Time", "ncp.bit1infoflagsh", FT_BOOLEAN, 16, NULL, 0x00000001, "", HFILL }}, + + { &hf_bit2infoflagsh, + { "Dereference Base Class", "ncp.bit2infoflagsh", FT_BOOLEAN, 16, NULL, 0x00000002, "", HFILL }}, + + { &hf_bit3infoflagsh, + { "Not Defined", "ncp.bit3infoflagsh", FT_BOOLEAN, 16, NULL, 0x00000004, "", HFILL }}, + + { &hf_bit4infoflagsh, + { "Not Defined", "ncp.bit4infoflagsh", FT_BOOLEAN, 16, NULL, 0x00000008, "", HFILL }}, + + { &hf_bit5infoflagsh, + { "Not Defined", "ncp.bit5infoflagsh", FT_BOOLEAN, 16, NULL, 0x00000010, "", HFILL }}, + + { &hf_bit6infoflagsh, + { "Not Defined", "ncp.bit6infoflagsh", FT_BOOLEAN, 16, NULL, 0x00000020, "", HFILL }}, + + { &hf_bit7infoflagsh, + { "Not Defined", "ncp.bit7infoflagsh", FT_BOOLEAN, 16, NULL, 0x00000040, "", HFILL }}, + + { &hf_bit8infoflagsh, + { "Not Defined", "ncp.bit8infoflagsh", FT_BOOLEAN, 16, NULL, 0x00000080, "", HFILL }}, + + { &hf_bit9infoflagsh, + { "Not Defined", "ncp.bit9infoflagsh", FT_BOOLEAN, 16, NULL, 0x00000100, "", HFILL }}, + + { &hf_bit10infoflagsh, + { "Not Defined", "ncp.bit10infoflagsh", FT_BOOLEAN, 16, NULL, 0x00000200, "", HFILL }}, + + { &hf_bit11infoflagsh, + { "Not Defined", "ncp.bit11infoflagsh", FT_BOOLEAN, 16, NULL, 0x00000400, "", HFILL }}, + + { &hf_bit12infoflagsh, + { "Not Defined", "ncp.bit12infoflagshs", FT_BOOLEAN, 16, NULL, 0x00000800, "", HFILL }}, + + { &hf_bit13infoflagsh, + { "Not Defined", "ncp.bit13infoflagsh", FT_BOOLEAN, 16, NULL, 0x00001000, "", HFILL }}, + + { &hf_bit14infoflagsh, + { "Not Defined", "ncp.bit14infoflagsh", FT_BOOLEAN, 16, NULL, 0x00002000, "", HFILL }}, + + { &hf_bit15infoflagsh, + { "Not Defined", "ncp.bit15infoflagsh", FT_BOOLEAN, 16, NULL, 0x00004000, "", HFILL }}, + + { &hf_bit16infoflagsh, + { "Not Defined", "ncp.bit16infoflagsh", FT_BOOLEAN, 16, NULL, 0x00008000, "", HFILL }}, + + { &hf_bit1lflags, + { "List Typeless", "ncp.bit1lflags", FT_BOOLEAN, 16, NULL, 0x00000001, "", HFILL }}, + + { &hf_bit2lflags, + { "List Containers", "ncp.bit2lflags", FT_BOOLEAN, 16, NULL, 0x00000002, "", HFILL }}, + + { &hf_bit3lflags, + { "List Slashed", "ncp.bit3lflags", FT_BOOLEAN, 16, NULL, 0x00000004, "", HFILL }}, + + { &hf_bit4lflags, + { "List Dotted", "ncp.bit4lflags", FT_BOOLEAN, 16, NULL, 0x00000008, "", HFILL }}, + + { &hf_bit5lflags, + { "Dereference Alias", "ncp.bit5lflags", FT_BOOLEAN, 16, NULL, 0x00000010, "", HFILL }}, + + { &hf_bit6lflags, + { "List All Containers", "ncp.bit6lflags", FT_BOOLEAN, 16, NULL, 0x00000020, "", HFILL }}, + + { &hf_bit7lflags, + { "List Obsolete", "ncp.bit7lflags", FT_BOOLEAN, 16, NULL, 0x00000040, "", HFILL }}, + + { &hf_bit8lflags, + { "List Tuned Output", "ncp.bit8lflags", FT_BOOLEAN, 16, NULL, 0x00000080, "", HFILL }}, + + { &hf_bit9lflags, + { "List External Reference", "ncp.bit9lflags", FT_BOOLEAN, 16, NULL, 0x00000100, "", HFILL }}, + + { &hf_bit10lflags, + { "Not Defined", "ncp.bit10lflags", FT_BOOLEAN, 16, NULL, 0x00000200, "", HFILL }}, + + { &hf_bit11lflags, + { "Not Defined", "ncp.bit11lflags", FT_BOOLEAN, 16, NULL, 0x00000400, "", HFILL }}, + + { &hf_bit12lflags, + { "Not Defined", "ncp.bit12lflags", FT_BOOLEAN, 16, NULL, 0x00000800, "", HFILL }}, + + { &hf_bit13lflags, + { "Not Defined", "ncp.bit13lflags", FT_BOOLEAN, 16, NULL, 0x00001000, "", HFILL }}, + + { &hf_bit14lflags, + { "Not Defined", "ncp.bit14lflags", FT_BOOLEAN, 16, NULL, 0x00002000, "", HFILL }}, + + { &hf_bit15lflags, + { "Not Defined", "ncp.bit15lflags", FT_BOOLEAN, 16, NULL, 0x00004000, "", HFILL }}, + + { &hf_bit16lflags, + { "Not Defined", "ncp.bit16lflags", FT_BOOLEAN, 16, NULL, 0x00008000, "", HFILL }}, + + { &hf_bit1l1flagsl, + { "Output Flags", "ncp.bit1l1flagsl", FT_BOOLEAN, 16, NULL, 0x00000001, "", HFILL }}, + + { &hf_bit2l1flagsl, + { "Entry ID", "ncp.bit2l1flagsl", FT_BOOLEAN, 16, NULL, 0x00000002, "", HFILL }}, + + { &hf_bit3l1flagsl, + { "Replica State", "ncp.bit3l1flagsl", FT_BOOLEAN, 16, NULL, 0x00000004, "", HFILL }}, + + { &hf_bit4l1flagsl, + { "Modification Timestamp", "ncp.bit4l1flagsl", FT_BOOLEAN, 16, NULL, 0x00000008, "", HFILL }}, + + { &hf_bit5l1flagsl, + { "Purge Time", "ncp.bit5l1flagsl", FT_BOOLEAN, 16, NULL, 0x00000010, "", HFILL }}, + + { &hf_bit6l1flagsl, + { "Local Partition ID", "ncp.bit6l1flagsl", FT_BOOLEAN, 16, NULL, 0x00000020, "", HFILL }}, + + { &hf_bit7l1flagsl, + { "Distinguished Name", "ncp.bit7l1flagsl", FT_BOOLEAN, 16, NULL, 0x00000040, "", HFILL }}, + + { &hf_bit8l1flagsl, + { "Replica Type", "ncp.bit8l1flagsl", FT_BOOLEAN, 16, NULL, 0x00000080, "", HFILL }}, + + { &hf_bit9l1flagsl, + { "Partition Busy", "ncp.bit9l1flagsl", FT_BOOLEAN, 16, NULL, 0x00000100, "", HFILL }}, + + { &hf_bit10l1flagsl, + { "Not Defined", "ncp.bit10l1flagsl", FT_BOOLEAN, 16, NULL, 0x00000200, "", HFILL }}, + + { &hf_bit11l1flagsl, + { "Not Defined", "ncp.bit11l1flagsl", FT_BOOLEAN, 16, NULL, 0x00000400, "", HFILL }}, + + { &hf_bit12l1flagsl, + { "Not Defined", "ncp.bit12l1flagsl", FT_BOOLEAN, 16, NULL, 0x00000800, "", HFILL }}, + + { &hf_bit13l1flagsl, + { "Not Defined", "ncp.bit13l1flagsl", FT_BOOLEAN, 16, NULL, 0x00001000, "", HFILL }}, + + { &hf_bit14l1flagsl, + { "Not Defined", "ncp.bit14l1flagsl", FT_BOOLEAN, 16, NULL, 0x00002000, "", HFILL }}, + + { &hf_bit15l1flagsl, + { "Not Defined", "ncp.bit15l1flagsl", FT_BOOLEAN, 16, NULL, 0x00004000, "", HFILL }}, + + { &hf_bit16l1flagsl, + { "Not Defined", "ncp.bit16l1flagsl", FT_BOOLEAN, 16, NULL, 0x00008000, "", HFILL }}, + + { &hf_bit1l1flagsh, + { "Not Defined", "ncp.bit1l1flagsh", FT_BOOLEAN, 16, NULL, 0x00000001, "", HFILL }}, + + { &hf_bit2l1flagsh, + { "Not Defined", "ncp.bit2l1flagsh", FT_BOOLEAN, 16, NULL, 0x00000002, "", HFILL }}, + + { &hf_bit3l1flagsh, + { "Not Defined", "ncp.bit3l1flagsh", FT_BOOLEAN, 16, NULL, 0x00000004, "", HFILL }}, + + { &hf_bit4l1flagsh, + { "Not Defined", "ncp.bit4l1flagsh", FT_BOOLEAN, 16, NULL, 0x00000008, "", HFILL }}, + + { &hf_bit5l1flagsh, + { "Not Defined", "ncp.bit5l1flagsh", FT_BOOLEAN, 16, NULL, 0x00000010, "", HFILL }}, + + { &hf_bit6l1flagsh, + { "Not Defined", "ncp.bit6l1flagsh", FT_BOOLEAN, 16, NULL, 0x00000020, "", HFILL }}, + + { &hf_bit7l1flagsh, + { "Not Defined", "ncp.bit7l1flagsh", FT_BOOLEAN, 16, NULL, 0x00000040, "", HFILL }}, + + { &hf_bit8l1flagsh, + { "Not Defined", "ncp.bit8l1flagsh", FT_BOOLEAN, 16, NULL, 0x00000080, "", HFILL }}, + + { &hf_bit9l1flagsh, + { "Not Defined", "ncp.bit9l1flagsh", FT_BOOLEAN, 16, NULL, 0x00000100, "", HFILL }}, + + { &hf_bit10l1flagsh, + { "Not Defined", "ncp.bit10l1flagsh", FT_BOOLEAN, 16, NULL, 0x00000200, "", HFILL }}, + + { &hf_bit11l1flagsh, + { "Not Defined", "ncp.bit11l1flagsh", FT_BOOLEAN, 16, NULL, 0x00000400, "", HFILL }}, + + { &hf_bit12l1flagsh, + { "Not Defined", "ncp.bit12l1flagsh", FT_BOOLEAN, 16, NULL, 0x00000800, "", HFILL }}, + + { &hf_bit13l1flagsh, + { "Not Defined", "ncp.bit13l1flagsh", FT_BOOLEAN, 16, NULL, 0x00001000, "", HFILL }}, + + { &hf_bit14l1flagsh, + { "Not Defined", "ncp.bit14l1flagsh", FT_BOOLEAN, 16, NULL, 0x00002000, "", HFILL }}, + + { &hf_bit15l1flagsh, + { "Not Defined", "ncp.bit15l1flagsh", FT_BOOLEAN, 16, NULL, 0x00004000, "", HFILL }}, + + { &hf_bit16l1flagsh, + { "Not Defined", "ncp.bit16l1flagsh", FT_BOOLEAN, 16, NULL, 0x00008000, "", HFILL }}, + + { &hf_bit1vflags, + { "Naming", "ncp.bit1vflags", FT_BOOLEAN, 16, NULL, 0x00000001, "", HFILL }}, + + { &hf_bit2vflags, + { "Base Class", "ncp.bit2vflags", FT_BOOLEAN, 16, NULL, 0x00000002, "", HFILL }}, + + { &hf_bit3vflags, + { "Present", "ncp.bit3vflags", FT_BOOLEAN, 16, NULL, 0x00000004, "", HFILL }}, + + { &hf_bit4vflags, + { "Value Damaged", "ncp.bit4vflags", FT_BOOLEAN, 16, NULL, 0x00000008, "", HFILL }}, + + { &hf_bit5vflags, + { "Not Defined", "ncp.bit5vflags", FT_BOOLEAN, 16, NULL, 0x00000010, "", HFILL }}, + + { &hf_bit6vflags, + { "Not Defined", "ncp.bit6vflags", FT_BOOLEAN, 16, NULL, 0x00000020, "", HFILL }}, + + { &hf_bit7vflags, + { "Not Defined", "ncp.bit7vflags", FT_BOOLEAN, 16, NULL, 0x00000040, "", HFILL }}, + + { &hf_bit8vflags, + { "Not Defined", "ncp.bit8vflags", FT_BOOLEAN, 16, NULL, 0x00000080, "", HFILL }}, + + { &hf_bit9vflags, + { "Not Defined", "ncp.bit9vflags", FT_BOOLEAN, 16, NULL, 0x00000100, "", HFILL }}, + + { &hf_bit10vflags, + { "Not Defined", "ncp.bit10vflags", FT_BOOLEAN, 16, NULL, 0x00000200, "", HFILL }}, + + { &hf_bit11vflags, + { "Not Defined", "ncp.bit11vflags", FT_BOOLEAN, 16, NULL, 0x00000400, "", HFILL }}, + + { &hf_bit12vflags, + { "Not Defined", "ncp.bit12vflags", FT_BOOLEAN, 16, NULL, 0x00000800, "", HFILL }}, + + { &hf_bit13vflags, + { "Not Defined", "ncp.bit13vflags", FT_BOOLEAN, 16, NULL, 0x00001000, "", HFILL }}, + + { &hf_bit14vflags, + { "Not Defined", "ncp.bit14vflags", FT_BOOLEAN, 16, NULL, 0x00002000, "", HFILL }}, + + { &hf_bit15vflags, + { "Not Defined", "ncp.bit15vflags", FT_BOOLEAN, 16, NULL, 0x00004000, "", HFILL }}, + + { &hf_bit16vflags, + { "Not Defined", "ncp.bit16vflags", FT_BOOLEAN, 16, NULL, 0x00008000, "", HFILL }}, + + { &hf_bit1cflags, + { "Ambiguous Containment", "ncp.bit1cflags", FT_BOOLEAN, 16, NULL, 0x00000001, "", HFILL }}, + + { &hf_bit2cflags, + { "Ambiguous Naming", "ncp.bit2cflags", FT_BOOLEAN, 16, NULL, 0x00000002, "", HFILL }}, + + { &hf_bit3cflags, + { "Class Definition Cannot be Removed", "ncp.bit3cflags", FT_BOOLEAN, 16, NULL, 0x00000004, "", HFILL }}, + + { &hf_bit4cflags, + { "Effective Class", "ncp.bit4cflags", FT_BOOLEAN, 16, NULL, 0x00000008, "", HFILL }}, + + { &hf_bit5cflags, + { "Container Class", "ncp.bit5cflags", FT_BOOLEAN, 16, NULL, 0x00000010, "", HFILL }}, + + { &hf_bit6cflags, + { "Not Defined", "ncp.bit6cflags", FT_BOOLEAN, 16, NULL, 0x00000020, "", HFILL }}, + + { &hf_bit7cflags, + { "Not Defined", "ncp.bit7cflags", FT_BOOLEAN, 16, NULL, 0x00000040, "", HFILL }}, + + { &hf_bit8cflags, + { "Not Defined", "ncp.bit8cflags", FT_BOOLEAN, 16, NULL, 0x00000080, "", HFILL }}, + + { &hf_bit9cflags, + { "Not Defined", "ncp.bit9cflags", FT_BOOLEAN, 16, NULL, 0x00000100, "", HFILL }}, + + { &hf_bit10cflags, + { "Not Defined", "ncp.bit10cflags", FT_BOOLEAN, 16, NULL, 0x00000200, "", HFILL }}, + + { &hf_bit11cflags, + { "Not Defined", "ncp.bit11cflags", FT_BOOLEAN, 16, NULL, 0x00000400, "", HFILL }}, + + { &hf_bit12cflags, + { "Not Defined", "ncp.bit12cflags", FT_BOOLEAN, 16, NULL, 0x00000800, "", HFILL }}, + + { &hf_bit13cflags, + { "Not Defined", "ncp.bit13cflags", FT_BOOLEAN, 16, NULL, 0x00001000, "", HFILL }}, + + { &hf_bit14cflags, + { "Not Defined", "ncp.bit14cflags", FT_BOOLEAN, 16, NULL, 0x00002000, "", HFILL }}, + + { &hf_bit15cflags, + { "Not Defined", "ncp.bit15cflags", FT_BOOLEAN, 16, NULL, 0x00004000, "", HFILL }}, + + { &hf_bit16cflags, + { "Not Defined", "ncp.bit16cflags", FT_BOOLEAN, 16, NULL, 0x00008000, "", HFILL }}, + + { &hf_bit1acflags, + { "Single Valued", "ncp.bit1acflags", FT_BOOLEAN, 16, NULL, 0x00000001, "", HFILL }}, + + { &hf_bit2acflags, + { "Sized", "ncp.bit2acflags", FT_BOOLEAN, 16, NULL, 0x00000002, "", HFILL }}, + + { &hf_bit3acflags, + { "Non-Removable", "ncp.bit3acflags", FT_BOOLEAN, 16, NULL, 0x00000004, "", HFILL }}, + + { &hf_bit4acflags, + { "Read Only", "ncp.bit4acflags", FT_BOOLEAN, 16, NULL, 0x00000008, "", HFILL }}, + + { &hf_bit5acflags, + { "Hidden", "ncp.bit5acflags", FT_BOOLEAN, 16, NULL, 0x00000010, "", HFILL }}, + + { &hf_bit6acflags, + { "String", "ncp.bit6acflags", FT_BOOLEAN, 16, NULL, 0x00000020, "", HFILL }}, + + { &hf_bit7acflags, + { "Synchronize Immediate", "ncp.bit7acflags", FT_BOOLEAN, 16, NULL, 0x00000040, "", HFILL }}, + + { &hf_bit8acflags, + { "Public Read", "ncp.bit8acflags", FT_BOOLEAN, 16, NULL, 0x00000080, "", HFILL }}, + + { &hf_bit9acflags, + { "Server Read", "ncp.bit9acflags", FT_BOOLEAN, 16, NULL, 0x00000100, "", HFILL }}, + + { &hf_bit10acflags, + { "Write Managed", "ncp.bit10acflags", FT_BOOLEAN, 16, NULL, 0x00000200, "", HFILL }}, + + { &hf_bit11acflags, + { "Per Replica", "ncp.bit11acflags", FT_BOOLEAN, 16, NULL, 0x00000400, "", HFILL }}, + + { &hf_bit12acflags, + { "Never Schedule Synchronization", "ncp.bit12acflags", FT_BOOLEAN, 16, NULL, 0x00000800, "", HFILL }}, + + { &hf_bit13acflags, + { "Operational", "ncp.bit13acflags", FT_BOOLEAN, 16, NULL, 0x00001000, "", HFILL }}, + + { &hf_bit14acflags, + { "Not Defined", "ncp.bit14acflags", FT_BOOLEAN, 16, NULL, 0x00002000, "", HFILL }}, + + { &hf_bit15acflags, + { "Not Defined", "ncp.bit15acflags", FT_BOOLEAN, 16, NULL, 0x00004000, "", HFILL }}, + + { &hf_bit16acflags, + { "Not Defined", "ncp.bit16acflags", FT_BOOLEAN, 16, NULL, 0x00008000, "", HFILL }}, + + + { &hf_nds_reply_error, + { "NDS Error", "ncp.ndsreplyerror", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_nds_net, + { "Network","ncp.ndsnet", FT_IPXNET, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_nds_node, + { "Node", "ncp.ndsnode", FT_ETHER, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_nds_socket, + { "Socket", "ncp.ndssocket", FT_UINT16, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_add_ref_ip, + { "Address Referal", "ncp.ipref", FT_IPv4, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_add_ref_udp, + { "Address Referal", "ncp.udpref", FT_IPv4, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_add_ref_tcp, + { "Address Referal", "ncp.tcpref", FT_IPv4, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_referal_record, + { "Referal Record", "ncp.ref_rec", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_referal_addcount, + { "Address Count", "ncp.ref_addcount", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_port, + { "Port", "ncp.ndsport", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_mv_string, + { "Attribute Name ", "ncp.mv_string", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_nds_syntax, + { "Attribute Syntax ", "ncp.nds_syntax", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_value_string, + { "Value ", "ncp.value_string", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_nds_stream_name, + { "Stream Name ", "ncp.nds_stream_name", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_nds_buffer_size, + { "Reply Buffer Size", "ncp.nds_reply_buf", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_ver, + { "NDS Version", "ncp.nds_ver", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_nflags, + { "Flags", "ncp.nds_nflags", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_rflags, + { "Request Flags", "ncp.nds_rflags", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_eflags, + { "Entry Flags", "ncp.nds_eflags", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_nds_scope, + { "Scope", "ncp.nds_scope", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_name, + { "Name", "ncp.nds_name", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_nds_name_type, + { "Name Type", "ncp.nds_name_type", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_nds_comm_trans, + { "Communications Transport", "ncp.nds_comm_trans", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_tree_trans, + { "Tree Walker Transport", "ncp.nds_tree_trans", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_iteration, + { "Iteration Handle", "ncp.nds_iteration", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_file_handle, + { "File Handle", "ncp.nds_file_handle", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_nds_file_size, + { "File Size", "ncp.nds_file_size", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_eid, + { "NDS EID", "ncp.nds_eid", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_nds_depth, + { "Distance object is from Root", "ncp.nds_depth", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_info_type, + { "Info Type", "ncp.nds_info_type", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_nds_class_def_type, + { "Class Definition Type", "ncp.nds_class_def_type", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_nds_all_attr, + { "All Attributes", "ncp.nds_all_attr", FT_UINT32, BASE_DEC, NULL, 0x0, "Return all Attributes?", HFILL }}, + + { &hf_nds_return_all_classes, + { "All Classes", "ncp.nds_return_all_classes", FT_STRING, BASE_NONE, NULL, 0x0, "Return all Classes?", HFILL }}, + + { &hf_nds_req_flags, + { "Request Flags", "ncp.nds_req_flags", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_attr, + { "Attributes", "ncp.nds_attributes", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_classes, + { "Classes", "ncp.nds_classes", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_crc, + { "CRC", "ncp.nds_crc", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_referals, + { "Referals", "ncp.nds_referals", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_result_flags, + { "Result Flags", "ncp.nds_result_flags", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_stream_flags, + { "Streams Flags", "ncp.nds_stream_flags", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_nds_tag_string, + { "Tags", "ncp.nds_tags", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_value_bytes, + { "Bytes", "ncp.value_bytes", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_replica_type, + { "Replica Type", "ncp.rtype", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_replica_state, + { "Replica State", "ncp.rstate", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_nds_rnum, + { "Replica Number", "ncp.rnum", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_revent, + { "Event", "ncp.revent", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_replica_number, + { "Replica Number", "ncp.rnum", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_min_nds_ver, + { "Minimum NDS Version", "ncp.min_nds_version", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_nds_ver_include, + { "Include NDS Version", "ncp.inc_nds_ver", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_nds_ver_exclude, + { "Exclude NDS Version", "ncp.exc_nds_ver", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_nds_es, + { "Input Entry Specifier", "ncp.nds_es", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_es_type, + { "Entry Specifier Type", "ncp.nds_es_type", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_rdn_string, + { "RDN", "ncp.nds_rdn", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_delim_string, + { "Delimeter", "ncp.nds_delim", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_nds_dn_output_type, + { "Output Entry Specifier Type", "ncp.nds_out_es_type", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_nds_nested_output_type, + { "Nested Output Entry Specifier Type", "ncp.nds_nested_out_es", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_nds_output_delimiter, + { "Output Delimiter", "ncp.nds_out_delimiter", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_nds_output_entry_specifier, + { "Output Entry Specifier", "ncp.nds_out_es", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_es_value, + { "Entry Specifier Value", "ncp.nds_es_value", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_es_rdn_count, + { "RDN Count", "ncp.nds_es_rdn_count", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_nds_replica_num, + { "Replica Number", "ncp.nds_replica_num", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_es_seconds, + { "Seconds", "ncp.nds_es_seconds", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_event_num, + { "Event Number", "ncp.nds_event_num", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_compare_results, + { "Compare Results", "ncp.nds_compare_results", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_nds_parent, + { "Parent ID", "ncp.nds_parent", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_nds_name_filter, + { "Name Filter", "ncp.nds_name_filter", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_nds_class_filter, + { "Class Filter", "ncp.nds_class_filter", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_nds_time_filter, + { "Time Filter", "ncp.nds_time_filter", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_nds_partition_root_id, + { "Partition Root ID", "ncp.nds_partition_root_id", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_nds_replicas, + { "Replicas", "ncp.nds_replicas", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_nds_purge, + { "Purge Time", "ncp.nds_purge", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_local_partition, + { "Local Partition ID", "ncp.nds_local_partition", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_partition_busy, + { "Partition Busy", "ncp.nds_partition_busy", FT_BOOLEAN, 16, NULL, 0x0, "", HFILL }}, + + { &hf_nds_number_of_changes, + { "Number of Attribute Changes", "ncp.nds_number_of_changes", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_sub_count, + { "Subordinate Count", "ncp.sub_count", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_revision, + { "Revision Count", "ncp.nds_rev_count", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_base_class, + { "Base Class", "ncp.nds_base_class", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_nds_relative_dn, + { "Relative Distinguished Name", "ncp.nds_relative_dn", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_nds_root_dn, + { "Root Distinguished Name", "ncp.nds_root_dn", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_nds_parent_dn, + { "Parent Distinguished Name", "ncp.nds_parent_dn", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_deref_base, + { "Dereference Base Class", "ncp.nds_deref_base", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_nds_base, + { "Base Class", "ncp.nds_base", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_nds_entry_info, + { "Entry Information", "ncp.nds_entry_info", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_privileges, + { "Privileges", "ncp.nds_privileges", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_nds_vflags, + { "Value Flags", "ncp.nds_vflags", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_nds_value_len, + { "Value Length", "ncp.nds_vlength", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_cflags, + { "Class Flags", "ncp.nds_cflags", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_nds_asn1, + { "ASN.1 ID", "ncp.nds_asn1", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_nds_acflags, + { "Attribute Constraint Flags", "ncp.nds_acflags", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_nds_upper, + { "Upper Limit Value", "ncp.nds_upper", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_lower, + { "Lower Limit Value", "ncp.nds_lower", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_trustee_dn, + { "Trustee Distinguished Name", "ncp.nds_trustee_dn", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_nds_attribute_dn, + { "Attribute Name", "ncp.nds_attribute_dn", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_nds_acl_add, + { "Access Control Lists to Add", "ncp.nds_acl_add", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_acl_del, + { "Access Control Lists to Delete", "ncp.nds_acl_del", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_att_add, + { "Attribute to Add", "ncp.nds_att_add", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_att_del, + { "Attribute to Delete", "ncp.nds_att_del", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_keep, + { "Delete Original RDN", "ncp.nds_keep", FT_BOOLEAN, 32, NULL, 0x0, "", HFILL }}, + + { &hf_nds_new_rdn, + { "New Relative Distinguished Name", "ncp.nds_new_rdn", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_nds_time_delay, + { "Time Delay", "ncp.nds_time_delay", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, + + { &hf_nds_root_name, + { "Root Most Object Name", "ncp.nds_root_name", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + { &hf_nds_new_part_id, + { "New Partition Root ID", "ncp.nds_new_part_id", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_nds_child_part_id, + { "Child Partition Root ID", "ncp.nds_child_part_id", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_nds_master_part_id, + { "Master Partition Root ID", "ncp.nds_master_part_id", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, + + { &hf_nds_target_name, + { "Target Server Name", "ncp.nds_target_dn", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + + + + + """ # Print the registration code for the hf variables for var in sorted_vars: print "\t{ &%s," % (var.HFName()) @@ -6113,7 +7340,7 @@ proto_register_ncp2222(void) var.Mask()) print "\t};\n" - + if ett_list: print "\tstatic gint *ett[] = {" @@ -6121,7 +7348,7 @@ proto_register_ncp2222(void) print "\t\t&%s," % (ett,) print "\t};\n" - + print """ proto_register_field_array(proto_ncp, hf, array_length(hf)); """ @@ -6193,7 +7420,8 @@ def main(): ptvc_lists = UniqueCollection('PTVC Lists') define_errors() - define_groups() + define_groups() + define_ncp2222() msg.write("Defined %d NCP types.\n" % (len(packets),)) @@ -6238,7 +7466,7 @@ def define_ncp2222(): rec( 8, 1, LockFlag ), rec( 9, 2, TimeoutLimit, BE ), rec( 11, (1, 256), FilePath ), - ], info_str=(FilePath, "Lock Exclusive: %s", ", %s")) + ]) pkt.Reply(8) pkt.CompletionCodes([0x0000, 0x8200, 0x9600, 0xfe0d, 0xff01]) # 2222/04 @@ -6253,7 +7481,7 @@ def define_ncp2222(): pkt.Request( (9, 264), [ rec( 7, 1, DirHandle ), rec( 8, (1, 256), FilePath ), - ], info_str=(FilePath, "Release File: %s", ", %s")) + ]) pkt.Reply(8) pkt.CompletionCodes([0x0000, 0x9b00, 0x9c03, 0xff1a]) # 2222/06 @@ -6268,7 +7496,7 @@ def define_ncp2222(): pkt.Request( (9, 264), [ rec( 7, 1, DirHandle ), rec( 8, (1, 256), FilePath ), - ], info_str=(FilePath, "Clear File: %s", ", %s")) + ]) pkt.Reply(8) pkt.CompletionCodes([0x0000, 0x9600, 0x9804, 0x9b03, 0x9c03, 0xa100, 0xfd00, 0xff1a]) @@ -6338,7 +7566,7 @@ def define_ncp2222(): pkt.Request( 11, [ rec( 10, 1, AbortQueueFlag ), ]) - pkt.Reply(8) + pkt.Reply(8) pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8701, 0x8800, 0x8d00, 0x8e00, 0x8f00, 0x9001, 0x9300, 0x9400, 0x9500, 0x9600, 0x9804, 0x9900, 0x9b03, 0x9c03, 0x9d00, @@ -6413,8 +7641,8 @@ def define_ncp2222(): # 2222/12, 18 pkt = NCP(0x12, "Get Volume Info with Number", 'file') pkt.Request( 8, [ - rec( 8, 1, VolumeNumber ) - ]) + rec( 7, 1, VolumeNumber ) + ],info_str=(VolumeNumber, "Get Volume Information for Volume %d", ", %d")) pkt.Reply( 36, [ rec( 8, 2, SectorsPerCluster, BE ), rec( 10, 2, TotalVolumeClusters, BE ), @@ -6536,7 +7764,7 @@ def define_ncp2222(): pkt = NCP(0x1601, "Get Directory Path", 'fileserver') pkt.Request(11, [ rec( 10, 1, DirHandle ), - ]) + ],info_str=(DirHandle, "Get Directory Path for Directory Handle %d", ", %d")) pkt.Reply((9,263), [ rec( 8, (1,255), Path ), ]) @@ -6600,7 +7828,7 @@ def define_ncp2222(): pkt = NCP(0x1606, "Get Volume Name", 'fileserver') pkt.Request(11, [ rec( 10, 1, VolumeNumber ), - ]) + ],info_str=(VolumeNumber, "Get Name for Volume %d", ", %d")) pkt.Reply((9, 263), [ rec( 8, (1,255), VolumeNameLen ), ]) @@ -6688,7 +7916,7 @@ def define_ncp2222(): pkt.Reply(8) pkt.CompletionCodes([0x0000, 0x8b00, 0x9200, 0x9600, 0x9804, 0x9b03, 0x9c03, 0x9e00, 0xa100, 0xef00, 0xfd00, 0xff00]) - + # 2222/1610, 22/16 pkt = NCP(0x1610, "Purge Erased Files", 'file') pkt.Request(10) @@ -6699,7 +7927,7 @@ def define_ncp2222(): pkt = NCP(0x1611, "Recover Erased File", 'fileserver') pkt.Request(11, [ rec( 10, 1, DirHandle ), - ]) + ],info_str=(DirHandle, "Recover Erased File from Directory Handle %d", ", %d")) pkt.Reply(38, [ rec( 8, 15, OldFileName ), rec( 23, 15, NewFileName ), @@ -6736,14 +7964,14 @@ def define_ncp2222(): pkt = NCP(0x1614, "Deallocate Directory Handle", 'fileserver') pkt.Request(11, [ rec( 10, 1, DirHandle ), - ]) + ],info_str=(DirHandle, "Deallocate Directory Handle %d", ", %d")) pkt.Reply(8) pkt.CompletionCodes([0x0000, 0x9b03]) # 2222/1615, 22/21 pkt = NCP(0x1615, "Get Volume Info with Handle", 'file') pkt.Request( 11, [ rec( 10, 1, DirHandle ) - ]) + ],info_str=(DirHandle, "Get Volume Information with Handle %d", ", %d")) pkt.Reply( 36, [ rec( 8, 2, SectorsPerCluster, BE ), rec( 10, 2, TotalVolumeClusters, BE ), @@ -6771,7 +7999,7 @@ def define_ncp2222(): pkt = NCP(0x1617, "Extract a Base Handle", 'fileserver') pkt.Request(11, [ rec( 10, 1, DirHandle ), - ]) + ],info_str=(DirHandle, "Extract a Base Handle from Directory Handle %d", ", %d")) pkt.Reply(22, [ rec( 8, 10, ServerNetworkAddress ), rec( 18, 4, DirHandleLong ), @@ -7103,14 +8331,14 @@ def define_ncp2222(): rec( 11, 4, ObjectID, BE ), rec( 15, 1, Unused ), rec( 16, (1, 255), Path ), - ], info_str=(Path, "Remove Extended Trustee: %s", ", %s")) + ], info_str=(Path, "Remove Extended Trustee from %s", ", %s")) pkt.Reply(8) pkt.CompletionCodes([0x0000, 0x9002, 0x9c03, 0xfe0f, 0xff09]) # 2222/162C, 22/44 pkt = NCP(0x162C, "Get Volume and Purge Information", 'file') pkt.Request( 11, [ rec( 10, 1, VolumeNumber ) - ]) + ],info_str=(VolumeNumber, "Get Volume and Purge Information for Volume %d", ", %d")) pkt.Reply( (38,53), [ rec( 8, 4, TotalBlocks ), rec( 12, 4, FreeBlocks ), @@ -7157,7 +8385,7 @@ def define_ncp2222(): pkt = NCP(0x162F, "Get Name Space Information", 'file') pkt.Request( 11, [ rec( 10, 1, VolumeNumber ) - ]) + ],info_str=(VolumeNumber, "Get Name Space Information for Volume %d", ", %d")) pkt.Reply( (13,521), [ rec( 8, 1, DefinedNameSpaces ), rec( 9, (1,255), NameSpaceName ), @@ -7225,7 +8453,7 @@ def define_ncp2222(): pkt = NCP(0x1633, "Get Extended Volume Information", 'file') pkt.Request( 11, [ rec( 10, 1, VolumeNumber ), - ]) + ],info_str=(VolumeNumber, "Get Extended Volume Information for Volume %d", ", %d")) pkt.Reply( (139,266), [ rec( 8, 2, VolInfoReplyLen ), rec( 10, 128, VolInfoStructure), @@ -7288,8 +8516,8 @@ def define_ncp2222(): pkt = NCP(0x1705, "Get Station's Logged Info", 'file') pkt.Request( 11, [ rec( 10, 1, TargetConnectionNumber ), - ]) - pkt.Reply( 266, [ + ],info_str=(TargetConnectionNumber, "Get Station's Logged Information on Connection %d", ", %d")) + pkt.Reply( 266, [ rec( 8, 16, UserName16 ), rec( 24, 7, LoginTime ), rec( 31, 39, FullName ), @@ -7426,7 +8654,7 @@ def define_ncp2222(): pkt = NCP(0x1713, "Get Internet Address", 'fileserver') pkt.Request(11, [ rec( 10, 1, TargetConnectionNumber ), - ]) + ],info_str=(TargetConnectionNumber, "Get Internet Address for Connection %d", ", %d")) pkt.Reply(20, [ rec( 8, 4, NetworkAddress, BE ), rec( 12, 6, NetworkNodeAddress ), @@ -7454,7 +8682,7 @@ def define_ncp2222(): ]) pkt.CompletionCodes([0x0000, 0x9600, 0xf001, 0xfc06, 0xfe07, 0xff00]) # 2222/1716, 23/22 - pkt = NCP(0x1716, "Get Station's Logged Info (old)", 'file') + pkt = NCP(0x1716, "Get Station's Logged Info", 'file') pkt.Request( 11, [ rec( 10, 1, TargetConnectionNumber ), ]) @@ -7465,7 +8693,7 @@ def define_ncp2222(): rec( 62, 7, LoginTime ), rec( 69, 1, Reserved ), ]) - pkt.CompletionCodes([0x0000, 0x9602, 0xfc06, 0xfd00, 0xfe07, 0xff00]) + pkt.CompletionCodes([0x0000, 0x9602, 0xfb0a, 0xfc06, 0xfd00, 0xfe07, 0xff00]) # 2222/1717, 23/23 pkt = NCP(0x1717, "Get Login Key", 'file') pkt.Request(10) @@ -7528,7 +8756,7 @@ def define_ncp2222(): rec( 62, 7, LoginTime ), rec( 69, 1, Reserved ), ]) - pkt.CompletionCodes([0x0000, 0x9602, 0xfc06, 0xfd00, 0xfe07, 0xff00]) + pkt.CompletionCodes([0x0000, 0x9602, 0xfb02, 0xfc06, 0xfd00, 0xfe07, 0xff00]) # 2222/171D, 23/29 pkt = NCP(0x171D, "Change Connection State", 'file') pkt.Request( 11, [ @@ -8176,7 +9404,7 @@ def define_ncp2222(): # 2222/177C, 23/124 pkt = NCP(0x177C, "Service Queue Job", 'qms') pkt.Request(16, [ - rec( 10, 4, ObjectID, BE ), + rec( 10, 4, QueueID, BE ), rec( 14, 2, ServiceType ), ]) pkt.Reply(94, [ @@ -8500,7 +9728,7 @@ def define_ncp2222(): pkt = NCP(0x17D2, "Clear Connection Number", 'stats') pkt.Request(11, [ rec( 10, 1, ConnectionNumber ), - ]) + ],info_str=(ConnectionNumber, "Clear Connection Number %d", ", %d")) pkt.Reply(8) pkt.CompletionCodes([0x0000, 0xc601, 0xfd00]) # 2222/17D3, 23/211 @@ -8807,7 +10035,7 @@ def define_ncp2222(): rec( 16, 4, UnusedDiskBlocks, BE ), rec( 20, 1, RestrictionsEnforced ), ]) - pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00]) + pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00]) # 2222/17E7, 23/231 pkt = NCP(0x17E7, "Get File Server LAN I/O Statistics", 'stats') pkt.Request(10) @@ -8864,7 +10092,7 @@ def define_ncp2222(): pkt = NCP(0x17E9, "Get Volume Information", 'stats') pkt.Request(11, [ rec( 10, 1, VolumeNumber ), - ]) + ],info_str=(VolumeNumber, "Get Information on Volume %d", ", %d")) pkt.Reply(48, [ rec( 8, 4, SystemIntervalMarker, BE ), rec( 12, 1, VolumeNumber ), @@ -9636,7 +10864,7 @@ def define_ncp2222(): rec( 14, 1, NCPextensionRevisionNumber ), rec( 15, (1, 255), NCPextensionName ), ]) - pkt.CompletionCodes([0x0000, 0xfe00]) + pkt.CompletionCodes([0x0000, 0xfe00, 0xff20]) # 2222/2403, 36/03 pkt = NCP(0x2403, "Get Number of Registered NCP Extensions", 'fileserver') pkt.Request(10) @@ -9680,7 +10908,7 @@ def define_ncp2222(): pkt.Request(11, [ rec( 7, 4, NCPextensionNumber ), # The following value is Unicode - #[ 13, (1,255), RequestData ], + #rec[ 13, (1,255), RequestData ], ]) pkt.Reply(8) # The following value is Unicode @@ -10049,7 +11277,7 @@ def define_ncp2222(): rec( 20, 4, TtlEAsKeySize ), rec( 24, 4, NewEAHandle ), ]) - pkt.CompletionCodes([0x0000, 0xc900, 0xce00, 0xcf00, 0xd101, + pkt.CompletionCodes([0x0000, 0x8800, 0xc900, 0xce00, 0xcf00, 0xd101, 0xd301]) # 2222/5605, 86/05 pkt = NCP(0x5605, "Duplicate Extended Attributes", 'file', has_length=0 ) @@ -10137,8 +11365,8 @@ def define_ncp2222(): ]) pkt.ReqCondSizeVariable() pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501, - 0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600, - 0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16]) + 0x8701, 0x8900, 0x8d00, 0x8f00, 0x9001, 0x9600, + 0x9804, 0x9b03, 0x9c03, 0xa500, 0xbf00, 0xfd00, 0xff16]) # 2222/5702, 87/02 pkt = NCP(0x5702, "Initialize Search", 'file', has_length=0) pkt.Request( (18,272), [ @@ -10365,7 +11593,7 @@ def define_ncp2222(): ], info_str=(Path, "Modify DOS Information for: %s", "/%s")) pkt.Reply(8) pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501, - 0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600, + 0x8701, 0x8c01, 0x8d00, 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) @@ -10380,8 +11608,8 @@ def define_ncp2222(): rec( 19, (1,255), Path, repeat="x" ), ], info_str=(Path, "Delete: %s", "/%s")) pkt.Reply(8) - pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501, - 0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600, + pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501, + 0x8701, 0x8d00, 0x8e00, 0x8f00, 0x9001, 0x9600, 0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16]) # 2222/5709, 87/09 pkt = NCP(0x5709, "Set Short Directory Handle", 'file', has_length=0) @@ -10990,7 +12218,7 @@ def define_ncp2222(): srec( FileNameStruct, req_cond="ncp.ret_info_mask_fname == 1" ), ]) pkt.ReqCondSizeVariable() - pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501, + pkt.CompletionCodes([0x0000, 0x7f00, 0x8000, 0x8101, 0x8401, 0x8501, 0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600, 0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16]) # 2222/5721, 87/33 @@ -11530,7 +12758,7 @@ def define_ncp2222(): 0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600, 0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16]) # 2222/5A80, 90/128 - pkt = NCP(0x5A80, "Move File Data To DM", 'file') + pkt = NCP(0x5A80, "Move File Data To Data Migration", 'file') pkt.Request(27, [ rec( 10, 4, VolumeNumberLong ), rec( 14, 4, DirectoryEntryNumber ), @@ -11544,7 +12772,7 @@ def define_ncp2222(): 0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600, 0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16]) # 2222/5A81, 90/129 - pkt = NCP(0x5A81, "DM File Information", 'file') + pkt = NCP(0x5A81, "Data Migration File Information", 'file') pkt.Request(19, [ rec( 10, 4, VolumeNumberLong ), rec( 14, 4, DirectoryEntryNumber ), @@ -11560,7 +12788,7 @@ def define_ncp2222(): 0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600, 0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16]) # 2222/5A82, 90/130 - pkt = NCP(0x5A82, "Volume DM Status", 'file') + pkt = NCP(0x5A82, "Volume Data Migration Status", 'file') pkt.Request(18, [ rec( 10, 4, VolumeNumberLong ), rec( 14, 4, SupportModuleID ), @@ -11589,7 +12817,7 @@ def define_ncp2222(): 0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600, 0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16]) # 2222/5A84, 90/132 - pkt = NCP(0x5A84, "DM Support Module Information", 'file') + pkt = NCP(0x5A84, "Data Migration Support Module Information", 'file') pkt.Request(18, [ rec( 10, 1, DMInfoLevel ), rec( 11, 3, Reserved3), @@ -11605,7 +12833,7 @@ def define_ncp2222(): 0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600, 0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16]) # 2222/5A85, 90/133 - pkt = NCP(0x5A85, "Move File Data From DM", 'file') + pkt = NCP(0x5A85, "Move File Data From Data Migration", 'file') pkt.Request(19, [ rec( 10, 4, VolumeNumberLong ), rec( 14, 4, DirectoryEntryNumber ), @@ -11629,7 +12857,7 @@ def define_ncp2222(): 0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600, 0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16]) # 2222/5A87, 90/135 - pkt = NCP(0x5A87, "DM Support Module Capacity Request", 'file') + pkt = NCP(0x5A87, "Data Migration Support Module Capacity Request", 'file') pkt.Request(22, [ rec( 10, 4, SupportModuleID ), rec( 14, 4, VolumeNumberLong ), @@ -11672,7 +12900,7 @@ def define_ncp2222(): pkt.Request(10, [ rec( 7, 2, ProposedMaxSize, BE ), rec( 9, 1, SecurityFlag ), - ]) + ],info_str=(ProposedMaxSize, "Get Big Max Packet Size - %d", ", %d")) pkt.Reply(13, [ rec( 8, 2, AcceptedMaxSize, BE ), rec( 10, 2, EchoSocket, BE ), @@ -11716,14 +12944,7 @@ def define_ncp2222(): # 2222/6801, 104/01 pkt = NCP(0x6801, "Ping for NDS NCP", "nds", has_length=0) pkt.Request(8) - pkt.Reply(10, [ - rec( 8, 2, PingVersion ), - rec( 10, 2, Reserved ), - srec(PingVersion9, req_cond="ncp.ping_version==9"), - srec(PingVersion10, req_cond="ncp.ping_version==10"), - #rec( 12, 4, Reserved4 ), - #rec( 16, (4,48), TreeName ), - ]) + pkt.Reply(8) pkt.ReqCondSizeVariable() pkt.CompletionCodes([0x0000, 0x8100, 0xfb04, 0xfe0c]) # 2222/6802, 104/02 @@ -11739,19 +12960,10 @@ def define_ncp2222(): # pkt = NCP(0x6802, "Send NDS Fragmented Request/Reply", "nds", has_length=0) pkt.Request(8) -# rec( 8, 4, FraggerHandle ), -# rec( 12, 4, FragSize ), -# rec( 16, 4, TotalRequest ), -# rec( 20, 4, NDSFlags ), -# rec( 24, 2, NDSVerb, LE ), -# rec( 26, 2, Reserved2), -# srec(NDS8Struct, req_cond="ncp.nds_verb==0x00fe"), -# srec(NDS7Struct, req_cond="ncp.nds_verb!=0x00fe"), -# ]) pkt.Reply(8) pkt.ReqCondSizeVariable() pkt.CompletionCodes([0x0000]) - # 2222/6803, 104/03 + # 2222/6803, 104/03 pkt = NCP(0x6803, "Fragment Close", "nds", has_length=0) pkt.Request(12, [ rec( 8, 4, FraggerHandle ), @@ -12107,7 +13319,7 @@ def define_ncp2222(): ]) pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00]) # 2222/7B03, 123/03 - pkt = NCP(0x7B03, "NetWare File Systems Information", 'stats') + pkt = NCP(0x7B03, "NetWare File System Information", 'stats') pkt.Request(11, [ rec(10, 1, FileSystemID ), ]) diff --git a/packet-ncp-int.h b/packet-ncp-int.h index 2ed1a9e3b1..6aa33c82d7 100644 --- a/packet-ncp-int.h +++ b/packet-ncp-int.h @@ -2,7 +2,7 @@ * Structures and functions for NetWare Core Protocol. * Gilbert Ramirez <gram@alumni.rice.edu> * - * $Id: packet-ncp-int.h,v 1.11 2002/08/28 21:00:23 jmayer Exp $ + * $Id: packet-ncp-int.h,v 1.12 2002/09/22 15:46:42 gerald Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -88,11 +88,15 @@ void dissect_ncp_request(tvbuff_t*, packet_info*, guint16, void dissect_ncp_reply(tvbuff_t *, packet_info*, guint16, guint8, guint16, proto_tree*); +void dissect_ping_req(tvbuff_t *, packet_info*, guint16, guint8, + guint16, proto_tree*); + void dissect_nds_request(tvbuff_t*, packet_info*, guint16, guint8, guint16, proto_tree*); extern int proto_ncp; extern gint ett_ncp; +extern gint ett_nds; /* * NCP packet types. diff --git a/packet-ncp.c b/packet-ncp.c index 50c7eafc97..13c38e9534 100644 --- a/packet-ncp.c +++ b/packet-ncp.c @@ -5,7 +5,7 @@ * Modified to decode server op-lock * & NDS packets by Greg Morris <gmorris@novell.com> * - * $Id: packet-ncp.c,v 1.68 2002/08/28 21:00:23 jmayer Exp $ + * $Id: packet-ncp.c,v 1.69 2002/09/22 15:46:42 gerald Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -82,13 +82,15 @@ static int hf_ncp_slot = -1; static int hf_ncp_control_code = -1; static int hf_ncp_fragment_handle = -1; static int hf_lip_echo = -1; - +static int hf_ping_version = -1; gint ett_ncp = -1; +gint ett_nds = -1; static gint ett_ncp_system_flags = -1; /* desegmentation of NCP over TCP */ static gboolean ncp_desegment = TRUE; +static ncp_nds_true = FALSE; static dissector_handle_t data_handle; @@ -98,6 +100,7 @@ static dissector_handle_t data_handle; #define NCP_RQST_HDR_LENGTH 7 #define NCP_RPLY_HDR_LENGTH 8 + /* Hash functions */ gint ncp_equal (gconstpointer v, gconstpointer v2); guint ncp_hash (gconstpointer v); @@ -138,6 +141,10 @@ static const value_string ncp_ip_signature[] = { (c) 1996 by Steve Conner & Diane Conner Published by Annabooks, San Diego, California ISBN: 0-929392-31-0 + + And: + http:developer.novell.com + NCP documentation */ @@ -159,10 +166,10 @@ static value_string ncp_type_vals[] = { { NCP_SERVICE_REPLY, "Service reply" }, { NCP_WATCHDOG, "Watchdog" }, { NCP_DEALLOCATE_SLOT, "Destroy service connection" }, - { NCP_BROADCAST_SLOT, "Server Broadcast" }, + { NCP_BROADCAST_SLOT, "Server Broadcast" }, { NCP_BURST_MODE_XFER, "Burst mode transfer" }, { NCP_POSITIVE_ACK, "Request being processed" }, - { NCP_LIP_ECHO, "Large Internet Packet Echo" }, + { NCP_LIP_ECHO, "Large Internet Packet Echo" }, { 0, NULL } }; @@ -197,6 +204,7 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset; gint length_remaining; tvbuff_t *next_tvb; + guint32 testvar=0; if (check_col(pinfo->cinfo, COL_PROTOCOL)) col_set_str(pinfo->cinfo, COL_PROTOCOL, "NCP"); @@ -236,15 +244,16 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* Record the offset where the NCP common header starts */ commhdr = hdr_offset; - header.type = tvb_get_ntohs(tvb, commhdr); + header.type = tvb_get_ntohs(tvb, commhdr); header.sequence = tvb_get_guint8(tvb, commhdr+2); header.conn_low = tvb_get_guint8(tvb, commhdr+3); header.conn_high = tvb_get_guint8(tvb, commhdr+5); if (check_col(pinfo->cinfo, COL_INFO)) { - col_add_fstr(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; @@ -272,19 +281,19 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, */ switch (header.type) { - case NCP_BROADCAST_SLOT: /* Server Broadcast */ - proto_tree_add_uint(ncp_tree, hf_ncp_seq, tvb, commhdr + 2, 1, header.sequence); + case NCP_BROADCAST_SLOT: /* Server Broadcast */ + proto_tree_add_uint(ncp_tree, hf_ncp_seq, tvb, commhdr + 2, 1, header.sequence); proto_tree_add_uint(ncp_tree, hf_ncp_connection,tvb, commhdr + 3, 3, nw_connection); proto_tree_add_item(ncp_tree, hf_ncp_task, tvb, commhdr + 4, 1, FALSE); proto_tree_add_item(ncp_tree, hf_ncp_oplock_flag, tvb, commhdr + 9, 1, FALSE); proto_tree_add_item(ncp_tree, hf_ncp_oplock_handle, tvb, commhdr + 10, 4, FALSE); - break; + break; - case NCP_LIP_ECHO: /* Lip Echo Packet */ - proto_tree_add_item(ncp_tree, hf_lip_echo, tvb, commhdr, 13, FALSE); - break; + case NCP_LIP_ECHO: /* Lip Echo Packet */ + proto_tree_add_item(ncp_tree, hf_lip_echo, tvb, commhdr, 2, FALSE); + break; - case NCP_BURST_MODE_XFER: /* Packet Burst Packet */ + case NCP_BURST_MODE_XFER: /* Packet Burst Packet */ /* * XXX - we should keep track of whether there's a burst * outstanding on a connection and, if not, treat the @@ -379,10 +388,20 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, tvb, commhdr + 34, 2, FALSE); break; - case NCP_SERVICE_REQUEST: /* Server NCP Request */ - case NCP_SERVICE_REPLY: /* Server NCP Reply */ case NCP_ALLOCATE_SLOT: /* Allocate Slot Request */ - case NCP_WATCHDOG: /* Watchdog Packet */ + length_remaining = tvb_length_remaining(tvb, commhdr + 4); + if (length_remaining > 4) + { + testvar = tvb_get_ntohl(tvb, commhdr+4); + if( testvar == 0x4c495020) + { + proto_tree_add_item(ncp_tree, hf_lip_echo, tvb, commhdr+4, 13, FALSE); + break; + } + } + case NCP_SERVICE_REQUEST: /* Server NCP Request */ + case NCP_SERVICE_REPLY: /* Server NCP Reply */ + case NCP_WATCHDOG: /* Watchdog Packet */ case NCP_DEALLOCATE_SLOT: /* Deallocate Slot Request */ case NCP_POSITIVE_ACK: /* Positive Acknowledgement */ default: @@ -397,27 +416,49 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, */ switch (header.type) { - case NCP_ALLOCATE_SLOT: /* Allocate Slot Request */ - case NCP_SERVICE_REQUEST: /* Server NCP Request */ + case NCP_ALLOCATE_SLOT: /* Allocate Slot Request */ + length_remaining = tvb_length_remaining(tvb, commhdr + 4); + if (length_remaining > 4) + { + testvar = tvb_get_ntohl(tvb, commhdr+4); + if( testvar == 0x4c495020) + { + proto_tree_add_text(ncp_tree, tvb, commhdr, -1, + "Lip Echo Packet"); + /*break;*/ + } + } + case NCP_SERVICE_REQUEST: /* Server NCP Request */ case NCP_DEALLOCATE_SLOT: /* Deallocate Slot Request */ - case NCP_BROADCAST_SLOT: /* Server Broadcast Packet */ + 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) { - ncp_nds_verb = tvb_get_ntohl(tvb, commhdr+4); - if (tvb_get_guint8(tvb, commhdr+7) == 0x02) { /* NDS Packet to decode */ - dissect_nds_request(next_tvb, pinfo, nw_connection, - header.sequence, header.type, ncp_tree); - } else { - dissect_ncp_request(next_tvb, pinfo, nw_connection, - header.sequence, header.type, ncp_tree); - } - } else { - dissect_ncp_request(next_tvb, pinfo, nw_connection, - header.sequence, header.type, ncp_tree); - } + if (tvb_get_guint8(tvb, commhdr+6)==0x68) { + ncp_nds_verb = tvb_get_ntohl(tvb, commhdr+4); + if (tvb_get_guint8(tvb, commhdr+7)==0x02) { /* NDS Frag Packet to decode */ + dissect_nds_request(next_tvb, pinfo, nw_connection, + header.sequence, header.type, ncp_tree); + } + else + { + if(tvb_get_guint8(tvb, commhdr+7)==0x01) { /* NDS Ping */ + dissect_ping_req(next_tvb, pinfo, nw_connection, + header.sequence, header.type, ncp_tree); + } + else + { + dissect_ncp_request(next_tvb, pinfo, nw_connection, + header.sequence, header.type, ncp_tree); + } + } + } + else + { + dissect_ncp_request(next_tvb, pinfo, nw_connection, + header.sequence, header.type, ncp_tree); + } break; - case NCP_SERVICE_REPLY: /* Server NCP Reply */ + case NCP_SERVICE_REPLY: /* Server NCP Reply */ case NCP_POSITIVE_ACK: /* Positive Acknowledgement */ next_tvb = tvb_new_subset(tvb, hdr_offset, -1, -1); dissect_ncp_reply(next_tvb, pinfo, nw_connection, @@ -482,15 +523,13 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } } break; - - case NCP_LIP_ECHO: /* LIP Echo Packet */ - proto_tree_add_text(ncp_tree, tvb, commhdr, -1, - "Lip Echo Packet"); - break; - + case NCP_LIP_ECHO: /* LIP Echo Packet */ + proto_tree_add_text(ncp_tree, tvb, commhdr, -1, + "Lip Echo Packet"); + break; default: if (tree) { - proto_tree_add_text(ncp_tree, tvb, commhdr + 6, -1, + 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)")); @@ -524,6 +563,7 @@ get_ncp_pdu_len(tvbuff_t *tvb, int offset) * Get the length of the NCP-over-TCP packet. Strip off the "has * signature" flag. */ + return tvb_get_ntohl(tvb, offset + 4) & 0x7fffffff; } @@ -681,10 +721,12 @@ proto_register_ncp(void) { "Large Internet Packet Echo", "ncp.lip_echo", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + }; static gint *ett[] = { &ett_ncp, &ett_ncp_system_flags, + &ett_nds, }; module_t *ncp_module; @@ -715,3 +757,5 @@ proto_reg_handoff_ncp(void) data_handle = find_dissector("data"); } + + diff --git a/packet-ncp2222.inc b/packet-ncp2222.inc index d01794ade2..cdb4d53a33 100644 --- a/packet-ncp2222.inc +++ b/packet-ncp2222.inc @@ -8,7 +8,7 @@ * Gilbert Ramirez <gram@alumni.rice.edu> * Modified to decode NDS packets by Greg Morris <gmorris@novell.com> * - * $Id: packet-ncp2222.inc,v 1.18 2002/08/25 21:41:12 guy Exp $ + * $Id: packet-ncp2222.inc,v 1.19 2002/09/22 15:46:42 gerald Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -32,6 +32,493 @@ #define NCP_PACKET_INIT_COUNT 200 #define PROTO_LENGTH_UNTIL_END -1 +static const value_string nds_tags[] = { + { 0x00000000, "No Such Entry" }, + { 0x00000001, "Local Entry" }, + { 0x00000002, "Remote Entry" }, + { 0x00000003, "Alias Entry" }, + { 0x00000004, "Referral Information" }, + { 0x00000006, "Entry and Referrals" }, + { 0, NULL } +}; + +static const value_string nds_info_type[] = { + { 0x00000000, "Attribute Names Only / " }, + { 0x00000001, "Attribute Name & Value / " }, + { 0x00000002, "Effective Privileges / " }, + { 0x00000003, "Value Information / " }, + { 0x00000004, "Abreviated Value / " }, + { 0, NULL } +}; + +static const value_string nds_kind_of_changes[] = { + { 0x00000000, "Add Attribute" }, + { 0x00000001, "Remove Attribute" }, + { 0x00000002, "Add Value" }, + { 0x00000003, "Remove Value" }, + { 0x00000004, "Add Additional Value" }, + { 0x00000005, "Overwrite Value" }, + { 0x00000006, "Clear Attribute" }, + { 0x00000007, "Clear Value" }, + { 0, NULL } +}; + +static const value_string es_type[] = { + { 0x00000000, "No type is specified" }, + { 0x00000001, "Unicode string" }, + { 0x00000002, "Partial name" }, + { 0x00000003, "Referrals" }, + { 0x00000004, "Tuned name" }, + { 0x00000005, "GUID attribute" }, + { 0x00000006, "Local entry ID" }, + { 0x00000007, "Number of defined entry specifiers" }, + { 0, NULL } +}; + +static const value_string nds_protocol_type[] = { + { 0x00000000, "(IPX Protocol)" }, + { 0x00000001, "(IP Protocol)" }, + { 0x00000002, "(SDLC Protocol)" }, + { 0x00000003, "(TokenRing on Ethernet Protocol)" }, + { 0x00000004, "(OSI Protocol)" }, + { 0x00000005, "(AppleTalk Protocol)" }, + { 0x00000006, "(NetBEUI Protocol)" }, + { 0x00000007, "(Socket Address Protocol)" }, + { 0x00000008, "(UDP Protocol)" }, + { 0x00000009, "(TCP Protocol)" }, + { 0x0000000a, "(UDP v6 Protocol)" }, + { 0x0000000b, "(TCP v6 Protocol)" }, + { 0x0000000c, "(Internal Protocol)" }, + { 0x0000000d, "(URL Protocol)" }, + { 0, NULL } +}; + + +static const value_string nds_syntax[] = { + { 0x00000000, "Unknown Syntax" }, + { 0x00000001, "Distinguished Name" }, + { 0x00000002, "Case Sensitive Unicode String" }, + { 0x00000003, "Non Case Sensitive Unicode String" }, + { 0x00000004, "Printable String" }, + { 0x00000005, "Numeric String" }, + { 0x00000006, "Case Insensitive List" }, + { 0x00000007, "Boolean" }, + { 0x00000008, "Signed Integer" }, + { 0x00000009, "Binary String" }, + { 0x0000000a, "Telephone Number" }, + { 0x0000000b, "Fax Number" }, + { 0x0000000c, "Network Address" }, + { 0x0000000d, "Binary String List" }, + { 0x0000000e, "Email Address" }, + { 0x0000000f, "File System Path" }, + { 0x00000010, "Replica Pointer" }, + { 0x00000011, "Object ACL" }, + { 0x00000012, "Postal Address" }, + { 0x00000013, "Time Stamp" }, + { 0x00000014, "Class Name" }, + { 0x00000015, "Stream" }, + { 0x00000016, "Counter" }, + { 0x00000017, "Back Link" }, + { 0x00000018, "Time" }, + { 0x00000019, "Typed Name" }, + { 0x0000001a, "Hold" }, + { 0x0000001b, "Interval" }, + { 0, NULL } +}; + +static const value_string name_space_type[] = { + { 0x00000000, "DOS Name Space" }, + { 0x00000001, "MAC Name Space" }, + { 0x00000002, "NFS Name Space" }, + { 0x00000003, "FTAM Name Space" }, + { 0x00000004, "OS/2, Long Name Space" }, + { 0, NULL } +}; + + +static const value_string nds_replica_state[] = { + { 0x0000, "On" }, + { 0x0001, "New" }, + { 0x0002, "Dying" }, + { 0x0003, "Locked" }, + { 0x0004, "Create Master State 0" }, + { 0x0005, "Create Master State 1" }, + { 0x0006, "Transition On" }, + { 0x0007, "Dead Replica" }, + { 0x0008, "Begin Add" }, + { 0x000b, "Master Start" }, + { 0x000c, "Master Done" }, + { 0x0017, "Federated" }, + { 0x0030, "Split State 0" }, + { 0x0031, "Split State 1" }, + { 0x0040, "Join State 0" }, + { 0x0041, "Join State 1" }, + { 0x0042, "Join State 2" }, + { 0x0050, "Move Subtree State 0" }, + { 0x0051, "Move Subtree State 1" }, + { 0, NULL } +}; + +static const value_string nds_replica_type[] = { + { 0x0000, "Master" }, + { 0x0001, "Secondary" }, + { 0x0002, "Read Only" }, + { 0x0003, "Sub Ref" }, + { 0, NULL } +}; + +static const value_string class_def_type[] = { + { 0x0000, "Return Class Name" }, + { 0x0001, "Return Class Name, Flag, and Definition" }, + { 0x0002, "Return Class Name, Flag, Definition, and Super Class" }, + { 0x0003, "Return Class Name, Flag, and ASN.1 identifier" }, + { 0x0004, "Return Class Name, Flag, Definition, Super Class, and ACL" }, + { 0x0005, "Return Class Name, Flag, Creation Timestamp, Modification Timestamp, Definition, and ACL" }, + { 0, NULL } +}; + +static const value_string nds_reply_errors[] = { + { 0xffffffff, "(-1) Insufficient Space" }, + { 0xffffff89, "(-119) Buffer too Small" }, + { 0xffffff88, "(-120) RR Volume Flag Not Set" }, + { 0xffffff87, "(-121) No Items Found" }, + { 0xffffff86, "(-122) Connection Already Temporary" }, + { 0xffffff85, "(-123) Connection Already Logged In" }, + { 0xffffff84, "(-124) Connection Not Authenticated" }, + { 0xffffff83, "(-125) Connection Not Logged In" }, + { 0xffffff82, "(-126) NCP Boundary Check Failed" }, + { 0xffffff81, "(-127) Lock Waiting" }, + { 0xffffff80, "(-128) Lock Fail" }, + { 0xffffff7f, "(-129) Out of Handles" }, + { 0xffffff7e, "(-130) No Open Privilege" }, + { 0xffffff7d, "(-131) Hard IO Error" }, + { 0xffffff7c, "(-132) No Create Privilege" }, + { 0xffffff7b, "(-133) No Create Delete Privilege" }, + { 0xffffff7a, "(-134) Create Duplicate When Read Only" }, + { 0xffffff79, "(-135) Create File with Invalid Name" }, + { 0xffffff78, "(-136) Invalid File Handle" }, + { 0xffffff77, "(-137) No Search Privilege" }, + { 0xffffff76, "(-138) No Delete Privilege" }, + { 0xffffff75, "(-139) No Rename Privilege" }, + { 0xffffff74, "(-140) No Set Privilege" }, + { 0xffffff73, "(-141) Some File in Use" }, + { 0xffffff72, "(-142) All File in Use" }, + { 0xffffff71, "(-143) Some Read Only" }, + { 0xffffff70, "(-144) All Read Only" }, + { 0xffffff6f, "(-145) Some names Exist" }, + { 0xffffff6e, "(-146) All Names Exist" }, + { 0xffffff6d, "(-147) No Read Privilege" }, + { 0xffffff6c, "(-148) No Write Privilege" }, + { 0xffffff6b, "(-149) File Detached" }, + { 0xffffff6a, "(-150) No Alloc Space/Target Not a Subdirectory/Insuffficient Memory" }, + { 0xffffff69, "(-151) No Spool Space" }, + { 0xffffff68, "(-152) Invalid Volume" }, + { 0xffffff67, "(-153) Directory Full" }, + { 0xffffff66, "(-154) Rename Across Volume" }, + { 0xffffff65, "(-155) Bad Directory Handle" }, + { 0xffffff64, "(-156) Invalid Path/No Such Extension" }, + { 0xffffff63, "(-157) No Directory Handles" }, + { 0xffffff62, "(-158) Bad File Name" }, + { 0xffffff61, "(-159) Directory Active" }, + { 0xffffff60, "(-160) Directory Not Empty" }, + { 0xffffff5f, "(-161) Directory IO Error" }, + { 0xffffff5e, "(-162) IO Locked" }, + { 0xffffff5d, "(-163) Transaction Restarted" }, + { 0xffffff5c, "(-164) Rename Directory Invalid" }, + { 0xffffff5b, "(-165) Invalid Open/Create Mode" }, + { 0xffffff5a, "(-166) Already in Use" }, + { 0xffffff59, "(-167) Invalid Resource Tag" }, + { 0xffffff58, "(-168) Access Denied" }, + { 0xffffff44, "(-188) Login Signing Required" }, + { 0xffffff43, "(-189) Login Encryption Required" }, + { 0xffffff42, "(-190) Invalid Data Stream" }, + { 0xffffff41, "(-191) Invalid Name Space" }, + { 0xffffff40, "(-192) No Accounting Privileges" }, + { 0xffffff3f, "(-193) No Account Balance" }, + { 0xffffff3e, "(-194) Credit Limit Exceeded" }, + { 0xffffff3d, "(-195) Too Many Holds" }, + { 0xffffff3c, "(-196) Accounting Disabled" }, + { 0xffffff3b, "(-197) Intruder Login Lockout" }, + { 0xffffff3a, "(-198) No Console Rights" }, + { 0xffffff30, "(-208) Queue IO Failure" }, + { 0xffffff2f, "(-209) No Queue" }, + { 0xffffff2e, "(-210) No Queue Server" }, + { 0xffffff2d, "(-211) No Queue Rights" }, + { 0xffffff2c, "(-212) Queue Full" }, + { 0xffffff2b, "(-213) No Queue Job" }, + { 0xffffff2a, "(-214) No Queue Job Rights/Unencrypted Not Allowed" }, + { 0xffffff29, "(-215) Queue In Service/Duplicate Password" }, + { 0xffffff28, "(-216) Queue Not Active/Password Too Short" }, + { 0xffffff27, "(-217) Queue Station Not Server/Maximum Logins Exceeded" }, + { 0xffffff26, "(-218) Queue Halted/Bad Login Time" }, + { 0xffffff25, "(-219) Queue Maximum Servers/Node Address Violation" }, + { 0xffffff24, "(-220) Login Account Expired" }, + { 0xffffff22, "(-222) Bad Password" }, + { 0xffffff21, "(-223) Password Expired" }, + { 0xffffff20, "(-224) No Login Connection Available" }, + { 0xffffff18, "(-232) Write to Group Property" }, + { 0xffffff17, "(-233) Member Already Exists" }, + { 0xffffff16, "(-234) No Such Member" }, + { 0xffffff15, "(-235) Property Not Group" }, + { 0xffffff14, "(-236) No Such Value Set" }, + { 0xffffff13, "(-237) Property Already Exists" }, + { 0xffffff12, "(-238) Object Already Exists" }, + { 0xffffff11, "(-239) Illegal Name" }, + { 0xffffff10, "(-240) Illegal Wildcard" }, + { 0xffffff0f, "(-241) Bindery Security" }, + { 0xffffff0e, "(-242) No Object Read Rights" }, + { 0xffffff0d, "(-243) No Object Rename Rights" }, + { 0xffffff0c, "(-244) No Object Delete Rights" }, + { 0xffffff0b, "(-245) No Object Create Rights" }, + { 0xffffff0a, "(-246) No Property Delete Rights" }, + { 0xffffff09, "(-247) No Property Create Rigths" }, + { 0xffffff08, "(-248) No Property Write Rights" }, + { 0xffffff07, "(-249) No Propery Read Rights" }, + { 0xffffff06, "(-250) Temp Remap" }, + { 0xffffff05, "(-251) Unknown Request/No Such Property" }, + { 0xffffff04, "(-252) Message Queue Full/Target Already Has Message/No Such Object" }, + { 0xffffff03, "(-253) Bad Station Number" }, + { 0xffffff02, "(-254) Bindery Locked/Directory Locked/Spool Delete/Trustee not Found/Timeout" }, + { 0xffffff01, "(-255) Hard Failure" }, + { 0xfffffed3, "(-301) Not Enough Memory" }, + { 0xfffffed2, "(-302) Bad Key" }, + { 0xfffffed1, "(-303) Bad Context" }, + { 0xfffffed0, "(-304) Buffer Full" }, + { 0xfffffecf, "(-305) List Empty" }, + { 0xfffffece, "(-306) Bad Syntax" }, + { 0xfffffecd, "(-307) Buffer Empty" }, + { 0xfffffecc, "(-308) Bad Verb" }, + { 0xfffffecb, "(-309) Expected Identifier" }, + { 0xfffffeca, "(-310) Expected Equals" }, + { 0xfffffec9, "(-311) Attribute Type Expected" }, + { 0xfffffec8, "(-312) Attribute Type Not Expected" }, + { 0xfffffec7, "(-313) Filter Tree Empty" }, + { 0xfffffec6, "(-314) Invalid Object Name" }, + { 0xfffffec5, "(-315) Expected RDN Delimiter" }, + { 0xfffffec4, "(-316) Too Many Tokens" }, + { 0xfffffec3, "(-317) Inconsistent MultiAVA" }, + { 0xfffffec2, "(-318) Country Name Too Long" }, + { 0xfffffec1, "(-319) Internal Error" }, + { 0xfffffec0, "(-320) Can't Add Root" }, + { 0xfffffebf, "(-321) Unable to Attach" }, + { 0xfffffebe, "(-322) Invalid Iteration Handle" }, + { 0xfffffebd, "(-323) Buffer Zero Length" }, + { 0xfffffebc, "(-324) Invalid Replica Type" }, + { 0xfffffebb, "(-325) Invalid Attribute Syntax" }, + { 0xfffffeba, "(-326) Invalid Filter Syntax" }, + { 0xfffffeb8, "(-328) Unicode Error during Context Creation" }, + { 0xfffffeb7, "(-329) Invalid Union Tag" }, + { 0xfffffeb6, "(-330) Invalid Server Response" }, + { 0xfffffeb5, "(-331) Null Pointer" }, + { 0xfffffeb4, "(-332) No Server Found" }, + { 0xfffffeb3, "(-333) No Connection" }, + { 0xfffffeb2, "(-334) RDN Too Long" }, + { 0xfffffeb1, "(-335) Duplicate Type" }, + { 0xfffffeb0, "(-336) Data Store Failure" }, + { 0xfffffeaf, "(-337) Not Logged In" }, + { 0xfffffeae, "(-338) Invalid Password Characters" }, + { 0xfffffead, "(-339) Failed Server Authentication" }, + { 0xfffffeac, "(-340) Transport Failed" }, + { 0xfffffeab, "(-341) No Such Syntax" }, + { 0xfffffeaa, "(-342) Invalid DS Name" }, + { 0xfffffea9, "(-343) Attribute Name Too Long" }, + { 0xfffffea8, "(-344) Invalid TDS" }, + { 0xfffffea7, "(-345) Invalid DS Version" }, + { 0xfffffea6, "(-346) Unicode Translation" }, + { 0xfffffea5, "(-347) Schema Name Too Long" }, + { 0xfffffea4, "(-348) Unicode File Not Found" }, + { 0xfffffea3, "(-349) Unicode Already Loaded" }, + { 0xfffffea2, "(-350) Not Context Owner" }, + { 0xfffffea1, "(-351) Attempt to Authenticate" }, + { 0xfffffea0, "(-352) No Writable Replicas" }, + { 0xfffffe9f, "(-353) DN Too Long" }, + { 0xfffffe9e, "(-354) Rename Not Allowed" }, + { 0xfffffe9d, "(-355) Not NDS for NT" }, + { 0xfffffe9c, "(-356) NDS for NT - No Domain" }, + { 0xfffffe9b, "(-357) NDS for NT - Sync Disabled" }, + { 0xfffffe9a, "(-358) Iterator Invalid Handle" }, + { 0xfffffe99, "(-359) Iterator Invalid Position" }, + { 0xfffffe98, "(-360) Iterator Invalid Search Data" }, + { 0xfffffe97, "(-361) Iterator Invalid Scope" }, + { 0xfffffda7, "(-601) No Such Entry" }, + { 0xfffffda6, "(-602) No Such Value" }, + { 0xfffffda5, "(-603) No Such Attribute" }, + { 0xfffffda4, "(-604) No Such Class" }, + { 0xfffffda3, "(-605) No Such Partition" }, + { 0xfffffda2, "(-606) Entry Already Exists" }, + { 0xfffffda1, "(-607) Not Effective Class" }, + { 0xfffffda0, "(-608) Illegal Attribute" }, + { 0xfffffd9f, "(-609) Missing Mandatory" }, + { 0xfffffd9e, "(-610) Illegal DS Name" }, + { 0xfffffd9d, "(-611) Illegal Containment" }, + { 0xfffffd9c, "(-612) Can't Have Multiple Values" }, + { 0xfffffd9b, "(-613) Syntax Violation" }, + { 0xfffffd9a, "(-614) Duplicate Value" }, + { 0xfffffd99, "(-615) Attribute Already Exists" }, + { 0xfffffd98, "(-616) Maximum Entries Exist" }, + { 0xfffffd97, "(-617) Database Format" }, + { 0xfffffd96, "(-618) Inconsistent Database" }, + { 0xfffffd95, "(-619) Invalid Comparison" }, + { 0xfffffd94, "(-620) Comparison Failed" }, + { 0xfffffd93, "(-621) Transaction Tracking Disabled" }, + { 0xfffffd92, "(-622) Invalid Transport" }, + { 0xfffffd91, "(-623) Syntax Invalid in Name" }, + { 0xfffffd90, "(-624) Replica Already Exists" }, + { 0xfffffd8f, "(-625) Transport Failure" }, + { 0xfffffd8e, "(-626) All Referrals Failed" }, + { 0xfffffd8d, "(-627) Can't Remove Naming Value" }, + { 0xfffffd8c, "(-628) Object Class Violation" }, + { 0xfffffd8b, "(-629) Entry is Not Leaf" }, + { 0xfffffd8a, "(-630) Different Tree" }, + { 0xfffffd89, "(-631) Illegal Replica Type" }, + { 0xfffffd88, "(-632) System Failure" }, + { 0xfffffd87, "(-633) Invalid Entry for Root" }, + { 0xfffffd86, "(-634) No Referrals" }, + { 0xfffffd85, "(-635) Remote Failure" }, + { 0xfffffd84, "(-636) Unreachable Server" }, + { 0xfffffd83, "(-637) Previous Move in Progress" }, + { 0xfffffd82, "(-638) No Character Mapping" }, + { 0xfffffd81, "(-639) Incomplete Authentication" }, + { 0xfffffd80, "(-640) Invalid Certificate" }, + { 0xfffffd7f, "(-641) Invalid Request" }, + { 0xfffffd7e, "(-642) Invalid Iteration" }, + { 0xfffffd7d, "(-643) Schema is Non-removable" }, + { 0xfffffd7c, "(-644) Schema is in Use" }, + { 0xfffffd7b, "(-645) Class Already Exists" }, + { 0xfffffd7a, "(-646) Bad Naming Attributes" }, + { 0xfffffd79, "(-647) Not Root Partition" }, + { 0xfffffd78, "(-648) Insufficient Stack" }, + { 0xfffffd77, "(-649) Insufficient Buffer" }, + { 0xfffffd76, "(-650) Ambiguous Containment" }, + { 0xfffffd75, "(-651) Ambiguous Naming" }, + { 0xfffffd74, "(-652) Duplicate Mandatory" }, + { 0xfffffd73, "(-653) Duplicate Optional" }, + { 0xfffffd72, "(-654) Partition Busy" }, + { 0xfffffd71, "(-655) Multiple Replicas" }, + { 0xfffffd70, "(-656) Crucial Replica" }, + { 0xfffffd6f, "(-657) Schema Sync in Progress" }, + { 0xfffffd6e, "(-658) Skulk in Progress" }, + { 0xfffffd6d, "(-659) Time Not Synchronized" }, + { 0xfffffd6c, "(-660) Record in Use" }, + { 0xfffffd6b, "(-661) DS Volume Not Mounted" }, + { 0xfffffd6a, "(-662) DS Volume IO Failure" }, + { 0xfffffd69, "(-663) DS Locked" }, + { 0xfffffd68, "(-664) Old Epoch" }, + { 0xfffffd67, "(-665) New Epoch" }, + { 0xfffffd66, "(-666) Incompatible DS Version" }, + { 0xfffffd65, "(-667) Partition Root" }, + { 0xfffffd64, "(-668) Entry Not Container" }, + { 0xfffffd63, "(-669) Failed Authentication" }, + { 0xfffffd62, "(-670) Invalid Context" }, + { 0xfffffd61, "(-671) No Such Parent" }, + { 0xfffffd60, "(-672) No Access" }, + { 0xfffffd5f, "(-673) Replica Not On" }, + { 0xfffffd5e, "(-674) Invalid Name Service" }, + { 0xfffffd5d, "(-675) Invalid Task" }, + { 0xfffffd5c, "(-676) Invalide Connection Handle" }, + { 0xfffffd5b, "(-677) Invalid Identity" }, + { 0xfffffd5a, "(-678) Duplicate ACL" }, + { 0xfffffd59, "(-679) Partition Already Exists" }, + { 0xfffffd58, "(-680) Transport Modified" }, + { 0xfffffd57, "(-681) Alias of an Alias" }, + { 0xfffffd56, "(-682) Auditing Failed" }, + { 0xfffffd55, "(-683) Invalid API Version" }, + { 0xfffffd54, "(-684) Secure NCP Violation" }, + { 0xfffffd53, "(-685) Move in Progress" }, + { 0xfffffd52, "(-686) Not a Leaf Partition" }, + { 0xfffffd51, "(-687) Cannot Abort" }, + { 0xfffffd50, "(-688) Cache Overflow" }, + { 0xfffffd4f, "(-689) Invalid Subordinate Count" }, + { 0xfffffd4e, "(-690) Invalid RDN" }, + { 0xfffffd4d, "(-691) Modification Time Not Current" }, + { 0xfffffd4c, "(-692) Incorrect Base Class" }, + { 0xfffffd4b, "(-693) Missing Reference" }, + { 0xfffffd4a, "(-694) Lost Entry" }, + { 0xfffffd49, "(-695) Agent Already Registered" }, + { 0xfffffd48, "(-696) DS Loader Busy" }, + { 0xfffffd47, "(-697) DS Cannot Reload" }, + { 0xfffffd46, "(-698) Replica in Skulk" }, + { 0xfffffd45, "(-699) Fatal" }, + { 0xfffffd44, "(-700) Obsolete API" }, + { 0xfffffd43, "(-701) Synchronization Disabled" }, + { 0xfffffd42, "(-702) Invalid Parameter" }, + { 0xfffffd41, "(-703) Duplicate Template" }, + { 0xfffffd40, "(-704) No Master Replica" }, + { 0xfffffd3f, "(-705) Duplicate Containment" }, + { 0xfffffd3e, "(-706) Not a Sibling" }, + { 0xfffffd3d, "(-707) Invalid Signature" }, + { 0xfffffd3c, "(-708) Invalid Response" }, + { 0xfffffd3b, "(-709) Insufficient Sockets" }, + { 0xfffffd3a, "(-710) Database Read Fail" }, + { 0xfffffd39, "(-711) Invalid Code Page" }, + { 0xfffffd38, "(-712) Invalid Escape Character" }, + { 0xfffffd37, "(-713) Invalide Delimiters" }, + { 0xfffffd36, "(-714) Not Implemented" }, + { 0xfffffd35, "(-715) Checksum Failure" }, + { 0xfffffd34, "(-716) Checksumming Not Supported" }, + { 0xfffffd33, "(-717) CRC Failure" }, + { 0xfffffd32, "(-718) Invalid Entry Handle" }, + { 0xfffffd31, "(-719) Invalid Value Handle" }, + { 0xfffffd30, "(-720) Connection Denied" }, + { 0xfffffd2f, "(-721) No Such Federation Link" }, + { 0xfffffd2e, "(-722) Operetational Schema Mismatch" }, + { 0xfffffd2d, "(-723) Stream Not Found" }, + { 0xfffffd2c, "(-724) DClient Unavailable" }, + { 0xfffffd2b, "(-725) MASV No Access" }, + { 0xfffffd2a, "(-726) MASV Invalid Request" }, + { 0xfffffd29, "(-727) MASV Failure" }, + { 0xfffffd28, "(-728) MASV Already Exists" }, + { 0xfffffd27, "(-729) MASV Not Found" }, + { 0xfffffd26, "(-730) MASV Bad Range" }, + { 0xfffffd25, "(-731) Value Data" }, + { 0xfffffd24, "(-732) Database Locked" }, + { 0xfffffd21, "(-735) Nothing to Abort" }, + { 0xfffffd20, "(-736) End of Stream" }, + { 0xfffffd1f, "(-737) No Such Template" }, + { 0xfffffd1e, "(-738) SAS Locked" }, + { 0xfffffd1d, "(-739) Invalid SAS Version" }, + { 0xfffffd1c, "(-740) SAS Already Registered" }, + { 0xfffffd1b, "(-741) Name Type Not Supported" }, + { 0xfffffd1a, "(-742) Wrong DS Version" }, + { 0xfffffd19, "(-743) Invalid Control Function" }, + { 0xfffffd18, "(-744) Invalid Control State" }, + { 0xfffffd17, "(-745) Cache in Use" }, + { 0xfffffd16, "(-746) Zero Creation Time" }, + { 0xfffffd15, "(-747) Would Block" }, + { 0xfffffd14, "(-748) Connection Timeout" }, + { 0xfffffd13, "(-749) Too Many Referrals" }, + { 0xfffffd12, "(-750) Operation Cancelled" }, + { 0xfffffd11, "(-751) Unknown Target" }, + { 0xfffffd10, "(-752) GUID Failure" }, + { 0xfffffd0f, "(-753) Incompatible OS" }, + { 0xfffffd0e, "(-754) Callback Cancel" }, + { 0xfffffd0d, "(-755) Invalid Synchronization Data" }, + { 0xfffffd0c, "(-756) Stream Exists" }, + { 0xfffffd0b, "(-757) Auxiliary Has Containment" }, + { 0xfffffd0a, "(-758) Auxiliary Not Containere" }, + { 0xfffffd09, "(-759) Auxiliary Not Effective" }, + { 0xfffffd08, "(-760) Auxiliary On Alias" }, + { 0xfffffd07, "(-761) Have Seen State" }, + { 0xfffffd06, "(-762) Verb Locked" }, + { 0xfffffd05, "(-763) Verb Exceeds Table Length" }, + { 0xfffffd04, "(-764) BOF Hit" }, + { 0xfffffd03, "(-765) EOF Hit" }, + { 0xfffffd02, "(-766) Incompatible Replica Version" }, + { 0xfffffd01, "(-767) Query Timeout" }, + { 0xfffffd00, "(-768) Query Maximum Count" }, + { 0xfffffcff, "(-769) Duplicate Naming" }, + { 0xfffffcfe, "(-770) No Transaction Active" }, + { 0xfffffcfd, "(-771) Transaction Active" }, + { 0xfffffcfc, "(-772) Illegal Transaction Operation" }, + { 0xfffffcfb, "(-773) Iterator Syntax" }, + { 0xfffffcfa, "(-774) Repairing DIB" }, + { 0xfffffcf9, "(-775) Invalid OID Format" }, + { 0xffff0000, "Ok" }, + { 0x0000, "Ok" }, + { 0, NULL } +}; + + static void process_ptvc_record(ptvcursor_t *ptvc, const ptvc_record *rec, int *req_cond_results, gboolean really_decode, @@ -62,13 +549,30 @@ typedef struct { guint8 nw_sequence; } ncp_req_hash_key; + +typedef struct { + guint32 nw_eid; +} ncp_req_eid_hash_key; + typedef struct { - const ncp_record *ncp_rec; - gboolean *req_cond_results; - guint32 req_frame_num; + const ncp_record *ncp_rec; + gboolean *req_cond_results; + guint32 req_frame_num; + guint32 req_nds_flags; + guint8 nds_request_verb; + guint8 nds_version; + char * object_name; } ncp_req_hash_value; +typedef struct { + char object_name[256]; + char *object_class; +} ncp_req_eid_hash_value; + static GHashTable *ncp_req_hash = NULL; +static GHashTable *ncp_req_eid_hash = NULL; +static GMemChunk *ncp_req_eid_hash_keys = NULL; +static GMemChunk *ncp_req_eid_hash_values = NULL; static GMemChunk *ncp_req_hash_keys = NULL; static GMemChunk *ncp_req_hash_values = NULL; @@ -86,6 +590,18 @@ ncp_equal(gconstpointer v, gconstpointer v2) return 0; } +gint +ncp_eid_equal(gconstpointer v, gconstpointer v2) +{ + ncp_req_eid_hash_key *val1 = (ncp_req_eid_hash_key*)v; + ncp_req_eid_hash_key *val2 = (ncp_req_eid_hash_key*)v2; + + if (val1->nw_eid == val2->nw_eid ) { + return 1; + } + return 0; +} + guint ncp_hash(gconstpointer v) { @@ -93,6 +609,13 @@ ncp_hash(gconstpointer v) return GPOINTER_TO_UINT(ncp_key->conversation) + ncp_key->nw_sequence; } +guint +ncp_eid_hash(gconstpointer v) +{ + ncp_req_eid_hash_key *ncp_eid_key = (ncp_req_eid_hash_key*)v; + return GPOINTER_TO_UINT(ncp_eid_key->nw_eid); +} + /* Frees memory used by the ncp_req_hash_value's */ static void ncp_req_hash_cleanup(gpointer key _U_, gpointer value, gpointer user_data _U_) @@ -104,6 +627,17 @@ ncp_req_hash_cleanup(gpointer key _U_, gpointer value, gpointer user_data _U_) } } +/* Frees memory used by the ncp_req_hash_value's */ +static void +ncp_req_eid_hash_cleanup(gpointer key _U_, gpointer value, gpointer user_data _U_) +{ + ncp_req_eid_hash_value *request_eid_value = (ncp_req_eid_hash_value*) value; + + if (request_eid_value->object_class) { + g_free(request_eid_value->object_name); + } +} + /* Initializes the hash table and the mem_chunk area each time a new * file is loaded or re-loaded in ethereal */ static void @@ -113,12 +647,21 @@ ncp_init_protocol(void) g_hash_table_foreach(ncp_req_hash, ncp_req_hash_cleanup, NULL); g_hash_table_destroy(ncp_req_hash); } + if (ncp_req_eid_hash) { + g_hash_table_foreach(ncp_req_eid_hash, ncp_req_eid_hash_cleanup, NULL); + g_hash_table_destroy(ncp_req_eid_hash); + } if (ncp_req_hash_keys) g_mem_chunk_destroy(ncp_req_hash_keys); if (ncp_req_hash_values) g_mem_chunk_destroy(ncp_req_hash_values); + if (ncp_req_eid_hash_keys) + g_mem_chunk_destroy(ncp_req_eid_hash_keys); + if (ncp_req_eid_hash_values) + g_mem_chunk_destroy(ncp_req_eid_hash_values); ncp_req_hash = g_hash_table_new(ncp_hash, ncp_equal); + ncp_req_eid_hash = g_hash_table_new(ncp_eid_hash, ncp_eid_equal); ncp_req_hash_keys = g_mem_chunk_new("ncp_req_hash_keys", sizeof(ncp_req_hash_key), NCP_PACKET_INIT_COUNT * sizeof(ncp_req_hash_key), @@ -127,6 +670,14 @@ ncp_init_protocol(void) sizeof(ncp_req_hash_value), NCP_PACKET_INIT_COUNT * sizeof(ncp_req_hash_value), G_ALLOC_ONLY); + ncp_req_eid_hash_keys = g_mem_chunk_new("ncp_req_eid_hash_keys", + sizeof(ncp_req_eid_hash_key), + NCP_PACKET_INIT_COUNT * sizeof(ncp_req_eid_hash_key), + G_ALLOC_ONLY); + ncp_req_eid_hash_values = g_mem_chunk_new("ncp_req_eid_hash_values", + sizeof(ncp_req_eid_hash_value), + NCP_PACKET_INIT_COUNT * sizeof(ncp_req_eid_hash_value), + G_ALLOC_ONLY); } /* After the sequential run, we don't need the ncp_request hash and keys @@ -146,6 +697,15 @@ ncp_postseq_cleanup(void) } /* Don't free the ncp_req_hash_values, as they're * needed during random-access processing of the proto_tree.*/ + if (ncp_req_eid_hash) { + /* Destroy the hash, but don't clean up request_condition data. */ + g_hash_table_destroy(ncp_req_eid_hash); + ncp_req_eid_hash = NULL; + } + if (ncp_req_eid_hash_keys) { + g_mem_chunk_destroy(ncp_req_eid_hash_keys); + ncp_req_eid_hash_keys = NULL; + } } ncp_req_hash_value* @@ -164,12 +724,34 @@ ncp_hash_insert(conversation_t *conversation, guint8 nw_sequence, request_value = g_mem_chunk_alloc(ncp_req_hash_values); request_value->ncp_rec = ncp_rec; request_value->req_cond_results = NULL; - - g_hash_table_insert(ncp_req_hash, request_key, request_value); + request_value->req_nds_flags = NULL; + + g_hash_table_insert(ncp_req_hash, request_key, request_value); return request_value; } +ncp_req_eid_hash_value* +ncp_eid_hash_insert(conversation_t *conversation, guint32 nw_eid, + const ncp_record *ncp_rec) +{ + ncp_req_eid_hash_key *request_eid_key; + ncp_req_eid_hash_value *request_eid_value; + + /* Now remember the request, so we can find it if we later + a reply to it. */ + request_eid_key = g_mem_chunk_alloc(ncp_req_eid_hash_keys); + request_eid_key->nw_eid = nw_eid; + + request_eid_value = g_mem_chunk_alloc(ncp_req_eid_hash_values); + strcpy(request_eid_value->object_name, " "); + request_eid_value->object_class = NULL; + + g_hash_table_insert(ncp_req_eid_hash, request_eid_key, request_eid_value); + + return request_eid_value; +} + /* Returns the ncp_rec*, or NULL if not found. */ ncp_req_hash_value* ncp_hash_lookup(conversation_t *conversation, guint8 nw_sequence) @@ -182,6 +764,17 @@ ncp_hash_lookup(conversation_t *conversation, guint8 nw_sequence) return g_hash_table_lookup(ncp_req_hash, &request_key); } +/* Returns the value_rec* for needed EID, or NULL if not found. */ +ncp_req_eid_hash_value* +ncp_eid_hash_lookup(conversation_t *conversation, guint32 nw_eid) +{ + ncp_req_eid_hash_key request_eid_key; + + request_eid_key.nw_eid = nw_eid; + + return g_hash_table_lookup(ncp_req_eid_hash, &request_eid_key); +} + /* Does NCP func require a subfunction code? */ static gboolean ncp_requires_subfunc(guint8 func) @@ -236,6 +829,7 @@ ncp_record_find(guint8 func, guint8 subfunc) return NULL; } + /* Given a proto_item*, assume it contains an integer value * and return a guint from it. */ guint @@ -292,6 +886,50 @@ typedef struct { char * buffer; } nw_uni_t; +typedef struct { + guint8 vtype; + guint32 vvalue; + char* vstring; + char* vdesc; + guint32 vlength; + guint32 voffset; + guint32 hfname; + char* bit1; + guint32 bit1hfname; + char* bit2; + guint32 bit2hfname; + char* bit3; + guint32 bit3hfname; + char* bit4; + guint32 bit4hfname; + char* bit5; + guint32 bit5hfname; + char* bit6; + guint32 bit6hfname; + char* bit7; + guint32 bit7hfname; + char* bit8; + guint32 bit8hfname; + char* bit9; + guint32 bit9hfname; + char* bit10; + guint32 bit10hfname; + char* bit11; + guint32 bit11hfname; + char* bit12; + guint32 bit12hfname; + char* bit13; + guint32 bit13hfname; + char* bit14; + guint32 bit14hfname; + char* bit15; + guint32 bit15hfname; + char* bit16; + guint32 bit16hfname; + guint8 mvtype; + guint32 vflags; +} nds_val; + /* Given an integer, fill in a nw_date_t struct. */ static void @@ -312,17 +950,14 @@ uint_to_nwtime(guint data, nw_time_t *nwtime) nwtime->hour = ((data & 0xf800) >> 11) + 1; } -static void -unicode_to_string(char * data, nw_uni_t *nw_uni) +char * +unicode_to_string(char * data, guint32 length) { - guint32 i; + int i; guint16 character; int offset = 0; - guint32 length = 0; char * buffer = ""; - length = strlen(data); - if (data[1] == 0x00){ for (i = 0; i < length; i++) { @@ -335,13 +970,14 @@ unicode_to_string(char * data, nw_uni_t *nw_uni) { buffer = data; } - nw_uni->buffer = buffer; + return buffer; } static proto_item* padd_normal(ptvcursor_t *ptvc, const ptvc_record *rec) { - return ptvcursor_add(ptvc, *rec->hf_ptr, + return + ptvcursor_add(ptvc, *rec->hf_ptr, rec->length, rec->endianness); } @@ -397,13 +1033,12 @@ padd_uni(ptvcursor_t *ptvc, const ptvc_record *rec) nw_uni_t nw_uni; guint offset; - offset = ptvcursor_current_offset(ptvc); + nw_uni.buffer = "\0"; + offset = ptvcursor_current_offset(ptvc); item = ptvcursor_add(ptvc, *rec->hf_ptr, rec->length, rec->endianness); - unicode_to_string(get_item_string(item), &nw_uni); - proto_item_set_text(item, get_item_name(item)); proto_item_append_text(item, " %s", nw_uni.buffer); @@ -646,6 +1281,7 @@ clear_repeat_vars(void) } } + /* Given an error_equivalency table and a completion code, return * the string representing the error. */ static const char* @@ -671,6 +1307,10 @@ static const ncp_record ncp5555_request = static const ncp_record ncpbbbb_request = { 0x01, 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, NULL, NULL, ncp_0x2_errors, NULL, NO_REQ_COND_SIZE, NULL }; /* Wrapper around proto_tree_free() */ @@ -681,6 +1321,2534 @@ void free_proto_tree(void *tree) } } + +static guint32 +align_4(tvbuff_t *tvb, guint32 aoffset) +{ + if(tvb_length_remaining(tvb, aoffset) > 4 ) + { + return (aoffset%4); + } + return 0; +} + +static void +get_string(tvbuff_t* tvb, guint offset, guint str_length, char *dest_buf) +{ + guint32 i; + guint16 c_char; + guint32 length_remaining = 0; + + length_remaining = tvb_length_remaining(tvb, offset); + if(str_length > length_remaining) + { + strcpy(dest_buf, "String too long to process"); + return; + } + for ( i = 0; i < str_length; i++ ) + { + c_char = tvb_get_guint8(tvb, offset ); + if (c_char<0x20 || c_char>0x7e) + { + if (c_char != 0x00) + { + c_char = 0x2e; + dest_buf[i] = c_char & 0xff; + } + else + { + i--; + str_length--; + } + } + else + { + dest_buf[i] = c_char & 0xff; + } + offset++; + length_remaining--; + + if(length_remaining==1) + { + dest_buf[i+1] = '\0'; + return; + } + } +dest_buf[i] = '\0'; +return; +} + +/************************************* +* Return based on % format in request +* %d = integer in decimal format = 0 +* %x = integer in hex format = 1 +* %s = string = 2 +**************************************/ +int +get_info_type(gchar* check_string) +{ + guint length; + guint i; + char char_val; + + length = strlen(check_string); + + for (i = 0 ; i < length-1 ; i++ ) { + char_val = check_string[i+1]; + if (check_string[i] == 0x25 && check_string[i+1] == 0x64) { + return 0; + } + if ( check_string[i] == 0x25 && check_string[i+1] == 0x78) { + return 1; + } + } + return 2; +} + +static void +process_bitfield(proto_tree *ncp_tree, tvbuff_t *tvb, nds_val *values) +{ + char flags_str[512]; + char * sep = NULL; + proto_item *tinew; + proto_tree *flags_tree; + int i; + guint32 bvalue = 0; + + bvalue = 0x00000001; + strcpy(flags_str, " ("); + sep = " "; + for (i = 0 ; i < (values->vlength*8); i++ ) { + if (values->vvalue & bvalue) + { + strcat(flags_str, sep); + switch(bvalue){ + case 0x00000001: + strcat(flags_str, values->bit1); + break; + case 0x00000002: + strcat(flags_str, values->bit2); + break; + case 0x00000004: + strcat(flags_str, values->bit3); + break; + case 0x00000008: + strcat(flags_str, values->bit4); + break; + case 0x00000010: + strcat(flags_str, values->bit5); + break; + case 0x00000020: + strcat(flags_str, values->bit6); + break; + case 0x00000040: + strcat(flags_str, values->bit7); + break; + case 0x00000080: + strcat(flags_str, values->bit8); + break; + case 0x00000100: + strcat(flags_str, values->bit9); + break; + case 0x00000200: + strcat(flags_str, values->bit10); + break; + case 0x00000400: + strcat(flags_str, values->bit11); + break; + case 0x00000800: + strcat(flags_str, values->bit12); + break; + case 0x00001000: + strcat(flags_str, values->bit13); + break; + case 0x00002000: + strcat(flags_str, values->bit14); + break; + case 0x00004000: + strcat(flags_str, values->bit15); + break; + case 0x00008000: + strcat(flags_str, values->bit16); + break; + default: + break; + } + sep = ", "; + } + bvalue = bvalue*2; + } + if (flags_str[0] != '\0') + { + strcat(flags_str, " )\0"); + if(values->vlength==4) + { + tinew = proto_tree_add_uint_format(ncp_tree, values->hfname, + tvb, values->voffset, values->vlength, values->vvalue, "%s 0x%08x -%s", + values->vdesc, values->vvalue, flags_str); + } + else + { + tinew = proto_tree_add_uint_format(ncp_tree, values->hfname, + tvb, values->voffset, values->vlength, values->vvalue, "%s 0x%04x -%s", + values->vdesc, values->vvalue, flags_str); + } + + + flags_tree = proto_item_add_subtree(tinew, ett_nds); + + bvalue = 0x00000001; + + for (i = 0 ; i < (values->vlength*8); i++ ) { + + if (values->vvalue & bvalue) + { + switch(bvalue) + { + case 0x00000001: + proto_tree_add_item(flags_tree, values->bit1hfname, tvb, values->voffset, values->vlength, TRUE); + break; + case 0x00000002: + proto_tree_add_item(flags_tree, values->bit2hfname, tvb, values->voffset, values->vlength, TRUE); + break; + case 0x00000004: + proto_tree_add_item(flags_tree, values->bit3hfname, tvb, values->voffset, values->vlength, TRUE); + break; + case 0x0000008: + proto_tree_add_item(flags_tree, values->bit4hfname, tvb, values->voffset, values->vlength, TRUE); + break; + case 0x00000010: + proto_tree_add_item(flags_tree, values->bit5hfname, tvb, values->voffset, values->vlength, TRUE); + break; + case 0x00000020: + proto_tree_add_item(flags_tree, values->bit6hfname, tvb, values->voffset, values->vlength, TRUE); + break; + case 0x00000040: + proto_tree_add_item(flags_tree, values->bit7hfname, tvb, values->voffset, values->vlength, TRUE); + break; + case 0x00000080: + proto_tree_add_item(flags_tree, values->bit8hfname, tvb, values->voffset, values->vlength, TRUE); + break; + case 0x00000100: + proto_tree_add_item(flags_tree, values->bit9hfname, tvb, values->voffset, values->vlength, TRUE); + break; + case 0x00000200: + proto_tree_add_item(flags_tree, values->bit10hfname, tvb, values->voffset, values->vlength, TRUE); + break; + case 0x00000400: + proto_tree_add_item(flags_tree, values->bit11hfname, tvb, values->voffset, values->vlength, TRUE); + break; + case 0x00000800: + proto_tree_add_item(flags_tree, values->bit12hfname, tvb, values->voffset, values->vlength, TRUE); + break; + case 0x00001000: + proto_tree_add_item(flags_tree, values->bit13hfname, tvb, values->voffset, values->vlength, TRUE); + break; + case 0x00002000: + proto_tree_add_item(flags_tree, values->bit14hfname, tvb, values->voffset, values->vlength, TRUE); + break; + case 0x00004000: + proto_tree_add_item(flags_tree, values->bit15hfname, tvb, values->voffset, values->vlength, TRUE); + break; + case 0x00008000: + proto_tree_add_item(flags_tree, values->bit16hfname, tvb, values->voffset, values->vlength, TRUE); + break; + default: + break; + } + } + bvalue = bvalue*2; + } + } +} + + +static void +print_nds_values(proto_tree *vtree, tvbuff_t *tvb, guint32 syntax_type, nds_val *vvalues) +{ + guint32 value1 = 0; + guint32 value2 = 0; + guint32 value3 = 0; + guint32 value4 = 0; + guint32 value5 = 0; + guint32 value6 = 0; + guint32 voffset = 0; + guint8 icounter; + guint32 number_of_values = 0; + guint32 number_of_items = 0; + guint8 r; + proto_item *vitem; + proto_tree *nvtree; + proto_item *aditem; + proto_tree *adtree; + char *valuestr = NULL; + guint16 rtype = 0; + guint16 rstate = 0; + guint16 rnum = 0; + guint16 revent = 0; + + voffset = vvalues->voffset; + if(tvb_get_guint8(tvb, voffset) == 0x00) + { + voffset = voffset+2; + } + + number_of_values = tvb_get_letohl(tvb, voffset); + + vitem = proto_tree_add_uint_format(vtree, hf_nds_uint32value, tvb, voffset, + 4, number_of_values, "Number of Values: %d", number_of_values); + + nvtree = proto_item_add_subtree(vitem, ett_nds); + + voffset = voffset + 4; + + for (icounter = 1 ; icounter <= number_of_values; icounter++ ) + { + switch(syntax_type) + { + case 0x00000006: /* Case Insensitive List */ + case 0x0000000d: /* Binary String List */ + case 0x00000012: /* Postal Address */ + voffset += align_4(tvb, voffset); + voffset = voffset+4; + number_of_items = tvb_get_letohl(tvb, voffset); + voffset = voffset+4; + for (r=1; r<=number_of_items; r++) + { + value1 = tvb_get_letohl(tvb, voffset); + voffset = voffset + 4; + get_string(tvb, voffset, value1, vvalues->vstring); + proto_tree_add_string(nvtree, hf_value_string, tvb, voffset, + value1, vvalues->vstring); + voffset = voffset + value1; + } + voffset += align_4(tvb, voffset); + break; + case 0x00000007: /* Boolean */ + value1 = tvb_get_letohl(tvb, voffset); /* length of field */ + if (value1==0) + { + vvalues->vstring = "False"; + } + else + { + vvalues->vstring = "True"; + } + proto_tree_add_string(nvtree, hf_value_string, tvb, voffset, + value1, vvalues->vstring); + voffset=voffset+8; + break; + case 0x00000009: /* Binary String */ + case 0x00000015: /* Stream */ + value1 = tvb_get_letohl(tvb, voffset); /* length of field */ + if(value1 > tvb_length_remaining(tvb, voffset)) + { + break; + } + voffset += 4; + proto_tree_add_bytes(nvtree, hf_value_bytes, tvb, voffset, value1, tvb_get_ptr(tvb, voffset, value1)); + voffset += value1; + voffset += (value1%2); + break; + case 0x00000008: /* Signed Integer */ + case 0x00000016: /* Counter */ + case 0x00000018: /* Time */ + case 0x0000001b: /* Interval */ + value1 = tvb_get_letohl(tvb, voffset); /* length of field */ + voffset = voffset+4; + value2 = tvb_get_letohl(tvb, voffset); /* Value */ + proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset, + value1, value2, "Value %d", value2); + voffset = voffset+4; + break; + case 0x0000000b: /* Fax Number */ + value1 = tvb_get_letohl(tvb, voffset); /* length of field */ + voffset = voffset+4; + get_string(tvb, voffset, value1, vvalues->vstring); + proto_tree_add_string(nvtree, hf_value_string, tvb, voffset, + value1, vvalues->vstring); + voffset = voffset + value1; + voffset += align_4(tvb, voffset); + value2 = tvb_get_letohl(tvb, voffset); /* Bit Count */ + voffset=voffset+4; + value3 = tvb_get_letohl(tvb, voffset); /* Bit length */ + voffset = voffset+4; + get_string(tvb, voffset, value3, vvalues->vstring); + proto_tree_add_string(nvtree, hf_value_string, tvb, voffset, + value3, vvalues->vstring); + voffset = voffset+value3; + voffset += align_4(tvb, voffset); + break; + case 0x0000000c: /* Network Address */ + value1 = tvb_get_letohl(tvb, voffset); /* length of field */ + voffset = voffset + 4; + value2 = tvb_get_letohl(tvb, voffset); /* type of Protocol */ + valuestr = match_strval(value2, nds_protocol_type); + if (valuestr == NULL) + { + valuestr="(Undefined Protocol)"; + } + proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset, + value1, value2, valuestr, value2); + voffset = voffset+4; + value3 = tvb_get_letohl(tvb, voffset); /* length of address */ + voffset = voffset+4; + switch (value2) + { + case 0x00000000: + proto_tree_add_item(nvtree, hf_nds_net, tvb, voffset, 4, FALSE); + proto_tree_add_item(nvtree, hf_nds_node, tvb, voffset+4, 6, FALSE); + proto_tree_add_item(nvtree, hf_nds_socket, tvb, voffset+10, 2, FALSE); + break; + case 0x00000001: + proto_tree_add_item(nvtree, hf_nds_port, tvb, voffset, 2, FALSE); + value4 = tvb_get_letohl(tvb, voffset+2); + proto_tree_add_ipv4(nvtree, hf_add_ref_ip, tvb, voffset+2, 4, value4); + break; + case 0x00000008: + proto_tree_add_item(nvtree, hf_nds_port, tvb, voffset, 2, FALSE); + value4 = tvb_get_letohl(tvb, voffset+2); + proto_tree_add_ipv4(nvtree, hf_add_ref_udp, tvb, voffset+2, 4, value4); + break; + case 0x00000009: + proto_tree_add_item(nvtree, hf_nds_port, tvb, voffset, 2, FALSE); + value4 = tvb_get_letohl(tvb, voffset+2); + proto_tree_add_ipv4(nvtree, hf_add_ref_tcp, tvb, voffset+2, 4, value4); + break; + case 0x0000000d: + get_string(tvb, voffset, value3, vvalues->vstring); + proto_tree_add_string(nvtree, hf_value_string, tvb, voffset, + value3, vvalues->vstring); + break; + default: + break; + } + voffset = voffset + value3; + voffset += align_4(tvb, voffset); + break; + case 0x0000000f: /* File System Path */ + value1 = tvb_get_letohl(tvb, voffset); /* length of field */ + voffset = voffset + 4; + value2 = tvb_get_letohl(tvb, voffset); /* Name Space */ + valuestr = match_strval(value2, name_space_type); + if (valuestr == NULL) + { + valuestr = "Unknown Name Space"; + } + proto_tree_add_string(nvtree, hf_value_string, tvb, voffset, + 4, valuestr); + voffset = voffset+4; + value3 = tvb_get_letohl(tvb, voffset); /* Length of Volume name */ + voffset = voffset+4; + get_string(tvb, voffset, value3, vvalues->vstring); + proto_tree_add_string(nvtree, hf_value_string, tvb, voffset, + value3, vvalues->vstring); + voffset = voffset+value3; + voffset += align_4(tvb, voffset); + value4 = tvb_get_letohl(tvb, voffset); /* Length of Path name */ + voffset = voffset+4; + get_string(tvb, voffset, value4, vvalues->vstring); + proto_tree_add_string(nvtree, hf_value_string, tvb, voffset, + value4, vvalues->vstring); + voffset = voffset+value4; + voffset += align_4(tvb, voffset); + break; + case 0x00000010: /* Replica Pointer */ + value1 = tvb_get_letohl(tvb, voffset); /* length of field */ + voffset = voffset + 4; + value2 = tvb_get_letohl(tvb, voffset); /* Length of Server name */ + voffset = voffset+4; + get_string(tvb, voffset, value2, vvalues->vstring); + proto_tree_add_string(nvtree, hf_value_string, tvb, voffset, + value2, vvalues->vstring); + voffset = voffset+value2; + voffset += align_4(tvb, voffset); + rtype = tvb_get_letohs(tvb, voffset); /* replica type */ + valuestr = match_strval(rtype, nds_replica_type); + if (valuestr == NULL) + { + valuestr="(Unknown Replica Type)"; + } + proto_tree_add_string(nvtree, hf_replica_type, tvb, voffset, + 2, valuestr); + voffset = voffset+2; + rstate = tvb_get_letohs(tvb, voffset); /* replica state */ + valuestr = match_strval(rstate, nds_replica_state); + if (valuestr == NULL) + { + valuestr="(Unknown Replica State)"; + } + proto_tree_add_string(nvtree, hf_replica_state, tvb, voffset, + 2, valuestr); + voffset = voffset+2; + value3 = tvb_get_letohl(tvb, voffset); /* Replica number */ + proto_tree_add_uint_format(nvtree, hf_replica_number, tvb, voffset, + 4, value3, "Replica Number %d", value3); + voffset = voffset+4; + number_of_items = tvb_get_letohl(tvb, voffset); /* Number of Addresses */ + aditem = proto_tree_add_uint_format(vtree, hf_nds_uint32value, tvb, voffset, + 4, number_of_items, "Number of Addresses: %d", number_of_items); + + adtree = proto_item_add_subtree(aditem, ett_nds); + voffset = voffset+4; + for (r=1; r <= number_of_items; r++) + { + voffset += align_4(tvb, voffset); + value4 = tvb_get_letohl(tvb, voffset); /* type of Protocol */ + valuestr = match_strval(value4, nds_protocol_type); + if (valuestr == NULL) + { + valuestr="(Undefined Protocol)"; + } + proto_tree_add_uint_format(adtree, hf_nds_uint32value, tvb, voffset, + 4, value4, valuestr, value4); + voffset = voffset+4; + value5 = tvb_get_letohl(tvb, voffset); /* length of address */ + voffset = voffset+4; + switch (value4) + { + case 0x00000000: + proto_tree_add_item(adtree, hf_nds_net, tvb, voffset, 4, FALSE); + proto_tree_add_item(adtree, hf_nds_node, tvb, voffset+4, 6, FALSE); + proto_tree_add_item(adtree, hf_nds_socket, tvb, voffset+10, 2, FALSE); + break; + case 0x00000001: + proto_tree_add_item(adtree, hf_nds_port, tvb, voffset, 2, FALSE); + value6 = tvb_get_letohl(tvb, voffset+2); + proto_tree_add_ipv4(adtree, hf_add_ref_ip, tvb, voffset+2, 4, value6); + break; + case 0x00000008: + proto_tree_add_item(adtree, hf_nds_port, tvb, voffset, 2, FALSE); + value6 = tvb_get_letohl(tvb, voffset+2); + proto_tree_add_ipv4(adtree, hf_add_ref_udp, tvb, voffset+2, 4, value6); + break; + case 0x00000009: + proto_tree_add_item(adtree, hf_nds_port, tvb, voffset, 2, FALSE); + value6 = tvb_get_letohl(tvb, voffset+2); + proto_tree_add_ipv4(adtree, hf_add_ref_tcp, tvb, voffset+2, 4, value6); + break; + case 0x0000000d: + get_string(tvb, voffset, value5, vvalues->vstring); + proto_tree_add_string(adtree, hf_value_string, tvb, voffset, + value5, vvalues->vstring); + break; + default: + break; + } + voffset = voffset + value5; + } + voffset += align_4(tvb, voffset); + break; + case 0x00000011: /* Object ACL */ + value1 = tvb_get_letohl(tvb, voffset); /* Length of Field */ + voffset = voffset + 4; + value2 = tvb_get_letohl(tvb, voffset); + voffset = voffset + 4; + get_string(tvb, voffset, value2, vvalues->vstring); /* Unicode String */ + proto_tree_add_string(nvtree, hf_value_string, tvb, voffset, + value2, vvalues->vstring); + voffset = voffset + value2; + voffset += align_4(tvb, voffset); + value3 = tvb_get_letohl(tvb, voffset); + voffset = voffset + 4; + get_string(tvb, voffset, value3, vvalues->vstring); /* Unicode Subject Name */ + proto_tree_add_string(nvtree, hf_value_string, tvb, voffset, + value3, vvalues->vstring); + voffset = voffset + value3; + voffset += align_4(tvb, voffset); + value4 = tvb_get_letohl(tvb, voffset); /* Privileges */ + proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset, + 4, value4, "Privileges %8x", value4); + voffset = voffset+4; + voffset += align_4(tvb, voffset); + break; + case 0x00000013: /* Time Stamp */ + value1 = tvb_get_letohl(tvb, voffset); /* Seconds */ + proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset, + 4, value1, "Lenght of Record: %d", value1); + voffset = voffset+4; + value2 = tvb_get_letohl(tvb, voffset); + proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset, + 4, value2, "Seconds: %d", value2); + voffset = voffset + 4; + rnum = tvb_get_letohs(tvb, voffset); /* replica number */ + proto_tree_add_uint_format(nvtree, hf_nds_rnum, tvb, voffset, + 2, rnum, "Replica Number: %d", rnum); + voffset = voffset+2; + revent = tvb_get_letohs(tvb, voffset); /* Event */ + proto_tree_add_uint_format(nvtree, hf_nds_revent, tvb, voffset, + 2, revent, "Event: %d", revent); + voffset = voffset+14; + voffset += align_4(tvb, voffset); + break; + case 0x00000017: /* Back Link */ + value1 = tvb_get_letohl(tvb, voffset); /* Length */ + proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset, + 4, value1, "Lenght of Record", value1); + voffset = voffset+4; + value2 = tvb_get_letohl(tvb, voffset); /* Remote ID */ + proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset, + 4, value2, "Remote ID %08x", value2); + voffset = voffset+4; + value3 = tvb_get_letohl(tvb, voffset); /* Length of string */ + voffset = voffset+4; + get_string(tvb, voffset, value3, vvalues->vstring); + proto_tree_add_string_format(nvtree, hf_value_string, tvb, voffset, + value3, "Server Distinguished Name - %s", vvalues->vstring); + voffset = voffset+value3; + voffset += align_4(tvb, voffset); + break; + case 0x00000019: /* Typed Name */ + value1 = tvb_get_letohl(tvb, voffset); /* Length */ + proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset, + 4, value1, "Lenght of Record", value1); + voffset = voffset+4; + value2 = tvb_get_letohl(tvb, voffset); /* Level */ + proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset, + 4, value2, "Level %d", value2); + voffset = voffset+4; + value3 = tvb_get_letohl(tvb, voffset); /* Interval */ + proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset, + 4, value3, "Interval %d", value3); + voffset = voffset+4; + value4 = tvb_get_letohl(tvb, voffset); /* Distinguished Name */ + voffset = voffset+4; + get_string(tvb, voffset, value4, vvalues->vstring); + proto_tree_add_string_format(nvtree, hf_value_string, tvb, voffset, + value4, "Distinguished Name - %s", vvalues->vstring); + voffset = voffset+value4; + voffset += align_4(tvb, voffset); + break; + case 0x0000001a: /* Hold */ + value1 = tvb_get_letohl(tvb, voffset); /* Length */ + proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset, + 4, value1, "Lenght of Record", value1); + voffset = voffset+4; + value2 = tvb_get_letohl(tvb, voffset); /* Amount */ + proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset, + 4, value2, "Amount %d", value2); + voffset = voffset+4; + value3 = tvb_get_letohl(tvb, voffset); /* Subject */ + voffset = voffset+4; + get_string(tvb, voffset, value3, vvalues->vstring); + proto_tree_add_string_format(nvtree, hf_value_string, tvb, voffset, + value3, "Subject - %s", vvalues->vstring); + voffset = voffset+value3; + voffset += align_4(tvb, voffset); + break; + case 0x00000001: /* Distinguished Name */ + case 0x00000002: /* Case Sensitive Unicode String */ + case 0x00000003: /* Non Case Sensitive Unicode String */ + case 0x00000004: /* Printable String */ + case 0x00000005: /* Numeric String */ + case 0x0000000a: /* Telephone Number */ + case 0x0000000e: /* Email Address */ + case 0x00000014: /* Class Name */ + default: + value1 = tvb_get_letohl(tvb, voffset); + voffset = voffset + 4; + get_string(tvb, voffset, value1, vvalues->vstring); + proto_tree_add_string(nvtree, hf_value_string, tvb, voffset, + value1, vvalues->vstring); + voffset = voffset + value1; + voffset += align_4(tvb, voffset); + break; + } + voffset += align_4(tvb, voffset); + } + vvalues->voffset=voffset; +return; +} + +static guint32 +print_es_type(proto_tree *estree, tvbuff_t *tvb, nds_val *values, guint32 vtype, guint32 ioffset) +{ + guint32 value1; + guint32 value2; + guint32 value3; + guint32 value4; + guint32 value5; + guint32 number_of_referals; + guint8 r; + guint8 i; + guint16 replica_num; + guint16 event_num; + nw_uni_t mval_buf; + proto_tree *nestree; + proto_item *nesitem; + proto_tree *atree; + proto_item *aitem; + char * vstring=""; + + mval_buf.buffer = ""; + switch (vtype) + { + case 0: /* No Specifier Type */ + value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */ + proto_tree_add_item(estree, hf_es_value, tvb, ioffset, + 4, value1); + ioffset = ioffset + 4; + break; + case 1: /* Unicode String */ + value1 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */ + ioffset = ioffset + 4; + get_string(tvb, ioffset, value1, mval_buf.buffer); + values->vstring = mval_buf.buffer; + proto_tree_add_string_format(estree, hf_mv_string, tvb, ioffset, + value1, values->vstring, "Delimeter ->%s", values->vstring); + ioffset=ioffset + value1; + ioffset += align_4(tvb, ioffset); + value2 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value2, mval_buf.buffer); + values->vstring = mval_buf.buffer; + proto_tree_add_string(estree, hf_mv_string, tvb, ioffset, + value2, values->vstring); + values->voffset=ioffset + value2; + ioffset = values->voffset; + break; + case 2: /* Based */ + value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */ + vstring = match_strval(value1, es_type); + if (vstring == NULL) + { + vstring = "No ES Type Found"; + } + nesitem = proto_tree_add_string_format(estree, hf_es_type, tvb, ioffset, + 4, vstring, "Base Context Type - %s", vstring); + nestree = proto_item_add_subtree(nesitem, ett_nds); + ioffset = ioffset + 4; + switch (value1) + { + case 0: /* No Specifier Type */ + value2 = tvb_get_letohl(tvb, ioffset); /* ES Type */ + proto_tree_add_item(nestree, hf_es_value, tvb, ioffset, + 4, value2); + ioffset = ioffset + 4; + break; + case 1: /* Unicode String */ + value2 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */ + ioffset = ioffset + 4; + get_string(tvb, ioffset, value2, mval_buf.buffer); + values->vstring = mval_buf.buffer; + proto_tree_add_string_format(nestree, hf_mv_string, tvb, ioffset, + value2, values->vstring, "Delimeter ->%s", values->vstring); + ioffset=ioffset + value2; + ioffset += align_4(tvb, ioffset); + value3 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value3, mval_buf.buffer); + values->vstring = mval_buf.buffer; + proto_tree_add_string(nestree, hf_mv_string, tvb, ioffset, + value3, values->vstring); + values->voffset=ioffset + value3; + ioffset = values->voffset; + break; + case 2: /* Based */ + break; + case 3: /* Hinted */ + break; + case 4: /* Tuned */ + value2 = tvb_get_letohl(tvb, ioffset); /* Count */ + proto_tree_add_item(nestree, hf_es_rdn_count, tvb, ioffset, + 4, value2); + ioffset = ioffset + 4; + for (r = 1 ; r <= value2; r++ ) + { + value3 = tvb_get_letohl(tvb, ioffset); /* Seconds */ + proto_tree_add_item(nestree, hf_es_seconds, tvb, ioffset, + 4, value3); + ioffset = ioffset + 4; + replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */ + proto_tree_add_item(nestree, hf_nds_replica_num, tvb, ioffset, + 2, replica_num); + ioffset = ioffset + 2; + event_num = tvb_get_letohs(tvb, ioffset); /* Event */ + proto_tree_add_item(nestree, hf_nds_event_num, tvb, ioffset, + 2, event_num); + ioffset = ioffset + 2; + } + value4 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */ + ioffset = ioffset + 4; + get_string(tvb, ioffset, value4, mval_buf.buffer); + values->vstring = mval_buf.buffer; + proto_tree_add_string(nestree, hf_mv_string, tvb, ioffset, + value4, values->vstring); + ioffset=ioffset + value4; + ioffset += align_4(tvb, ioffset); + value5 = tvb_get_letohl(tvb, ioffset); /* RDN */ + ioffset = ioffset + 4; + get_string(tvb, ioffset, value5, mval_buf.buffer); + values->vstring = mval_buf.buffer; + proto_tree_add_string(nestree, hf_rdn_string, tvb, ioffset, + value5, values->vstring); + ioffset=ioffset + value5; + ioffset += align_4(tvb, ioffset); + break; + case 5: /* GUID */ + case 6: /* ID32 */ + case 7: /* Count */ + default: + value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */ + proto_tree_add_item(estree, hf_es_value, tvb, ioffset, + 4, value1); + ioffset = ioffset + 4; + break; + } + value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */ + vstring = match_strval(value1, es_type); + if (vstring == NULL) + { + vstring = "No ES Type Found"; + } + nesitem = proto_tree_add_string_format(estree, hf_es_type, tvb, ioffset, + 4, vstring, "Object Name Type - %s", vstring); + nestree = proto_item_add_subtree(nesitem, ett_nds); + ioffset = ioffset + 4; + switch (value1) + { + case 0: /* No Specifier Type */ + value2 = tvb_get_letohl(tvb, ioffset); /* ES Type */ + proto_tree_add_item(estree, hf_es_value, tvb, ioffset, + 4, value2); + ioffset = ioffset + 4; + break; + case 1: /* Unicode String */ + value2 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */ + ioffset = ioffset + 4; + get_string(tvb, ioffset, value2, mval_buf.buffer); + values->vstring = mval_buf.buffer; + proto_tree_add_string_format(estree, hf_mv_string, tvb, ioffset, + value2, values->vstring, "Delimeter ->%s", values->vstring); + ioffset=ioffset + value2; + ioffset += align_4(tvb, ioffset); + value3 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value3, mval_buf.buffer); + values->vstring = mval_buf.buffer; + proto_tree_add_string(estree, hf_mv_string, tvb, ioffset, + value3, values->vstring); + values->voffset=ioffset + value3; + ioffset = values->voffset; + break; + case 2: /* Based */ + break; + case 3: /* Hinted */ + break; + case 4: /* Tuned */ + value2 = tvb_get_letohl(tvb, ioffset); /* Count */ + proto_tree_add_item(estree, hf_es_rdn_count, tvb, ioffset, + 4, value2); + ioffset = ioffset + 4; + for (r = 1 ; r <= value2; r++ ) + { + value3 = tvb_get_letohl(tvb, ioffset); /* Seconds */ + proto_tree_add_item(estree, hf_es_seconds, tvb, ioffset, + 4, value3); + ioffset = ioffset + 4; + replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */ + proto_tree_add_item(estree, hf_nds_replica_num, tvb, ioffset, + 2, replica_num); + ioffset = ioffset + 2; + event_num = tvb_get_letohs(tvb, ioffset); /* Event */ + proto_tree_add_item(estree, hf_nds_event_num, tvb, ioffset, + 2, event_num); + ioffset = ioffset + 2; + } + value4 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */ + ioffset = ioffset + 4; + get_string(tvb, ioffset, value4, mval_buf.buffer); + values->vstring = mval_buf.buffer; + proto_tree_add_string(estree, hf_mv_string, tvb, ioffset, + value4, values->vstring); + ioffset=ioffset + value4; + ioffset += align_4(tvb, ioffset); + value5 = tvb_get_letohl(tvb, ioffset); /* RDN */ + ioffset = ioffset + 4; + get_string(tvb, ioffset, value5, mval_buf.buffer); + values->vstring = mval_buf.buffer; + proto_tree_add_string(estree, hf_rdn_string, tvb, ioffset, + value5, values->vstring); + ioffset=ioffset + value5; + ioffset += align_4(tvb, ioffset); + break; + case 5: /* GUID */ + case 6: /* ID32 */ + case 7: /* Count */ + default: + value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */ + proto_tree_add_item(estree, hf_es_value, tvb, ioffset, + 4, value1); + ioffset = ioffset + 4; + break; + } + break; + case 3: /* Hinted */ + number_of_referals = tvb_get_letohl(tvb, ioffset); + + for (r = 1 ; r <= number_of_referals; r++ ) + { + aitem = proto_tree_add_uint_format(estree, hf_referal_record, tvb, 6, 0, + r, "NDS Referal Record #%d", r); + atree = proto_item_add_subtree(aitem, ett_nds); + + value1 = tvb_get_letohl(tvb, ioffset); + + proto_tree_add_uint_format(atree, hf_referal_addcount, tvb, ioffset, 4, + value1, "Number of Addresses in Referal - %d", value1); + + ioffset = ioffset + 4; + for (i = 1 ; i <= value1; i++ ) + { + value2 = tvb_get_letohl(tvb, ioffset); + values->vstring = match_strval(value2, nds_protocol_type); + if (values->vstring == NULL) + { + values->vstring="(Undefined Protocol)"; + } + proto_tree_add_uint_format(atree, hf_nds_uint32value, tvb, ioffset, + 4, value2, vstring, value2); + ioffset = ioffset+4; + value3 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset+4; + switch (value2) + { + case 0x00000000: + proto_tree_add_item(atree, hf_nds_net, tvb, ioffset, 4, FALSE); + proto_tree_add_item(atree, hf_nds_node, tvb, ioffset+4, 6, FALSE); + proto_tree_add_item(atree, hf_nds_socket, tvb, ioffset+10, 2, FALSE); + break; + case 0x00000001: + proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE); + value4 = tvb_get_letohl(tvb, ioffset+2); + proto_tree_add_ipv4(atree, hf_add_ref_ip, tvb, ioffset+2, 4, value4); + break; + case 0x00000008: + proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE); + value4 = tvb_get_letohl(tvb, ioffset+2); + proto_tree_add_ipv4(atree, hf_add_ref_udp, tvb, ioffset+2, 4, value4); + break; + case 0x00000009: + proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE); + value4 = tvb_get_letohl(tvb, ioffset+2); + proto_tree_add_ipv4(atree, hf_add_ref_tcp, tvb, ioffset+2, 4, value4); + break; + case 0x0000000d: + get_string(tvb, ioffset, value3, values->vstring); + proto_tree_add_string(atree, hf_value_string, tvb, ioffset, + value3, values->vstring); + break; + default: + break; + } + ioffset = ioffset + value3; + ioffset += align_4(tvb, ioffset); + } + + } + value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */ + vstring = match_strval(value1, es_type); + if (vstring == NULL) + { + vstring = "No ES Type Found"; + } + nesitem = proto_tree_add_string_format(estree, hf_es_type, tvb, ioffset, + 4, vstring, "Object Name Type - %s", vstring); + nestree = proto_item_add_subtree(nesitem, ett_nds); + ioffset = ioffset + 4; + switch (value1) + { + case 0: /* No Specifier Type */ + value2 = tvb_get_letohl(tvb, ioffset); /* ES Type */ + proto_tree_add_item(estree, hf_es_value, tvb, ioffset, + 4, value2); + ioffset = ioffset + 4; + break; + case 1: /* Unicode String */ + value2 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */ + ioffset = ioffset + 4; + get_string(tvb, ioffset, value2, mval_buf.buffer); + values->vstring = mval_buf.buffer; + proto_tree_add_string_format(estree, hf_mv_string, tvb, ioffset, + value2, values->vstring, "Delimeter ->%s", values->vstring); + ioffset=ioffset + value2; + ioffset += align_4(tvb, ioffset); + value3 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value3, mval_buf.buffer); + values->vstring = mval_buf.buffer; + proto_tree_add_string(estree, hf_mv_string, tvb, ioffset, + value3, values->vstring); + values->voffset=ioffset + value3; + ioffset = values->voffset; + break; + case 2: /* Based */ + break; + case 3: /* Hinted */ + break; + case 4: /* Tuned */ + value2 = tvb_get_letohl(tvb, ioffset); /* Count */ + proto_tree_add_item(estree, hf_es_rdn_count, tvb, ioffset, + 4, value2); + ioffset = ioffset + 4; + for (r = 1 ; r <= value2; r++ ) + { + value3 = tvb_get_letohl(tvb, ioffset); /* Seconds */ + proto_tree_add_item(estree, hf_es_seconds, tvb, ioffset, + 4, value3); + ioffset = ioffset + 4; + replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */ + proto_tree_add_item(estree, hf_nds_replica_num, tvb, ioffset, + 2, replica_num); + ioffset = ioffset + 2; + event_num = tvb_get_letohs(tvb, ioffset); /* Event */ + proto_tree_add_item(estree, hf_nds_event_num, tvb, ioffset, + 2, event_num); + ioffset = ioffset + 2; + } + value4 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */ + ioffset = ioffset + 4; + get_string(tvb, ioffset, value4, mval_buf.buffer); + values->vstring = mval_buf.buffer; + proto_tree_add_string(estree, hf_mv_string, tvb, ioffset, + value4, values->vstring); + ioffset=ioffset + value4; + ioffset += align_4(tvb, ioffset); + value5 = tvb_get_letohl(tvb, ioffset); /* RDN */ + ioffset = ioffset + 4; + get_string(tvb, ioffset, value5, mval_buf.buffer); + values->vstring = mval_buf.buffer; + proto_tree_add_string(estree, hf_rdn_string, tvb, ioffset, + value5, values->vstring); + ioffset=ioffset + value5; + ioffset += align_4(tvb, ioffset); + break; + case 5: /* GUID */ + case 6: /* ID32 */ + case 7: /* Count */ + default: + value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */ + proto_tree_add_item(estree, hf_es_value, tvb, ioffset, + 4, value1); + ioffset = ioffset + 4; + break; + } + break; + case 4: /* Tuned */ + value1 = tvb_get_letohl(tvb, ioffset); /* Count */ + proto_tree_add_item(estree, hf_es_rdn_count, tvb, ioffset, + 4, value1); + ioffset = ioffset + 4; + for (r = 1 ; r <= value1; r++ ) + { + value2 = tvb_get_letohl(tvb, ioffset); /* Seconds */ + proto_tree_add_item(estree, hf_es_seconds, tvb, ioffset, + 4, value2); + ioffset = ioffset + 4; + replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */ + proto_tree_add_item(estree, hf_nds_replica_num, tvb, ioffset, + 2, replica_num); + ioffset = ioffset + 2; + event_num = tvb_get_letohs(tvb, ioffset); /* Event */ + proto_tree_add_item(estree, hf_nds_event_num, tvb, ioffset, + 2, event_num); + ioffset = ioffset + 2; + } + value3 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */ + ioffset = ioffset + 4; + get_string(tvb, ioffset, value3, mval_buf.buffer); + values->vstring = mval_buf.buffer; + proto_tree_add_string(estree, hf_mv_string, tvb, ioffset, + value3, values->vstring); + ioffset=ioffset + value3; + ioffset += align_4(tvb, ioffset); + value4 = tvb_get_letohl(tvb, ioffset); /* RDN */ + ioffset = ioffset + 4; + get_string(tvb, ioffset, value4, mval_buf.buffer); + values->vstring = mval_buf.buffer; + proto_tree_add_string(estree, hf_rdn_string, tvb, ioffset, + value4, values->vstring); + ioffset=ioffset + value4; + ioffset += align_4(tvb, ioffset); + break; + case 5: /* GUID */ + case 6: /* ID32 */ + case 7: /* Count */ + default: + value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */ + proto_tree_add_item(estree, hf_es_value, tvb, ioffset, + 4, value1); + ioffset = ioffset + 4; + break; + } + return ioffset; +} + +static void +process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, nds_val *values) +{ + guint8 i; + guint8 r; + guint8 n; + guint32 ioffset = 0; + guint32 value1 = 0; + guint32 value2 = 0; + guint8 value3 = 0; + guint32 value4 = 0; + guint32 value5 = 0; + guint32 value6 = 0; + guint32 value7 = 0; + guint32 value8 = 0; + char * valuestr = ""; + proto_tree *ntree; + proto_tree *atree; + proto_item *nitem; + proto_item *aitem; + guint32 number_of_referals = 0; + nw_uni_t mval_buf; + proto_tree *estree; + proto_item *esitem; + guint16 replica_num = 0; + guint16 event_num = 0; + guint32 bvalue=0; + nds_val temp_values; + + mval_buf.buffer = ""; + if(values->mvtype != 12) + { + nitem = proto_tree_add_uint_format(ncp_tree, values->hfname, tvb, values->voffset+ioffset, + values->vlength, values->vvalue, values->vdesc, values->vvalue); + } + else + { + nitem = proto_tree_add_string_format(ncp_tree, values->hfname, tvb, values->voffset+ioffset, + values->vlength, values->vdesc, "%s", values->vdesc); + } + ioffset = (values->voffset+4); + + ntree = proto_item_add_subtree(nitem, ett_nds); + + switch (values->mvtype) + { + case 1: /* Attribute Request */ + for (i = 1 ; i <= values->vvalue; i++ ) + { + ioffset += align_4(tvb, ioffset); + value1 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value1, mval_buf.buffer); + values->vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset, + value1, values->vstring); + ioffset = ioffset + value1; + } + break; + case 2: /* Attribute Reply */ + switch(values->vflags) + { + case 0: + for (i = 1 ; i <= values->vvalue; i++ ) + { + ioffset += align_4(tvb, ioffset); + value1 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value1, mval_buf.buffer); + values->vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset, + value1, values->vstring); + ioffset = ioffset + value1; + } + break; + case 1: + for (i = 1 ; i <= values->vvalue; i++ ) + { + value1 = tvb_get_letohl(tvb, ioffset); + values->vstring = match_strval(value1, nds_syntax); + if (values->vstring == NULL) + { + values->vstring = "No Syntax Found"; + } + proto_tree_add_string(ntree, hf_nds_syntax, tvb, ioffset, + 4, values->vstring); + ioffset = ioffset + 4; + value2 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value2, mval_buf.buffer); + values->vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset, + value2, values->vstring); + values->voffset=ioffset + value2; + print_nds_values(ntree, tvb, value1, values); + ioffset = values->voffset; + } + break; + case 2: + for (i = 1 ; i <= values->vvalue; i++ ) + { + value1 = tvb_get_letohl(tvb, ioffset); + values->vstring = match_strval(value1, nds_syntax); + if (values->vstring == NULL) + { + values->vstring = "No Syntax Found"; + } + proto_tree_add_string(ntree, hf_nds_syntax, tvb, ioffset, + 4, values->vstring); + ioffset = ioffset + 4; + value2 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value2, mval_buf.buffer); + values->vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset, + value2, values->vstring); + values->voffset=ioffset + value2; + ioffset += value2; + ioffset += align_4(tvb, ioffset); + value3 = tvb_get_letohl(tvb, ioffset); + + proto_tree_add_uint_format(ntree, hf_nds_uint32value, tvb, ioffset, 4, + value1, "Number of Values - %d", value1); + + ioffset = ioffset + 4; + for (r = 1 ; r <= value3; r++ ) + { + ioffset += 4; /* Length = 4 */ + value4 = tvb_get_letohl(tvb, ioffset); + proto_tree_add_uint(ntree, hf_nds_privileges, tvb, ioffset, + values->vlength, value4); + ioffset = ioffset+4; + } + } + break; + case 3: + for (i = 1 ; i <= values->vvalue; i++ ) + { + value1 = tvb_get_letohl(tvb, ioffset); + values->vstring = match_strval(value1, nds_syntax); + if (values->vstring == NULL) + { + values->vstring = "No Syntax Found"; + } + proto_tree_add_string(ntree, hf_nds_syntax, tvb, ioffset, + 4, values->vstring); + ioffset = ioffset + 4; + value2 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value2, mval_buf.buffer); + values->vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset, + value2, values->vstring); + ioffset = ioffset + value2; + ioffset += align_4(tvb, ioffset); + value3 = tvb_get_letohl(tvb, ioffset); + + aitem = proto_tree_add_uint_format(ntree, hf_nds_uint32value, tvb, ioffset, 4, + value3, "Number of Values - %d", value3); + + atree = proto_item_add_subtree(aitem, ett_nds); + + ioffset = ioffset + 4; + for (r = 1 ; r <= value3; r++ ) + { + ioffset += align_4(tvb, ioffset); + temp_values.vvalue = tvb_get_letohl(tvb, ioffset); + temp_values.vlength = 2; + temp_values.hfname = hf_nds_vflags; + temp_values.voffset = ioffset; + temp_values.vdesc = "Value Flags"; + temp_values.bit1 = "Naming"; + temp_values.bit1hfname = hf_bit1vflags; + temp_values.bit2 = "Base Class"; + temp_values.bit2hfname = hf_bit2vflags; + temp_values.bit3 = "Present"; + temp_values.bit3hfname = hf_bit3vflags; + temp_values.bit4 = "Value Damaged"; + temp_values.bit4hfname = hf_bit4vflags; + temp_values.bit5 = "Not Defined"; + temp_values.bit5hfname = hf_bit5vflags; + temp_values.bit6 = "Not Defined"; + temp_values.bit6hfname = hf_bit6vflags; + temp_values.bit7 = "Not Defined"; + temp_values.bit7hfname = hf_bit7vflags; + temp_values.bit8 = "Not Defined"; + temp_values.bit8hfname = hf_bit8vflags; + temp_values.bit9 = "Not Defined"; + temp_values.bit9hfname = hf_bit9vflags; + temp_values.bit10 = "Not Defined"; + temp_values.bit10hfname = hf_bit10vflags; + temp_values.bit11 = "Not Defined"; + temp_values.bit11hfname = hf_bit11vflags; + temp_values.bit12 = "Not Defined"; + temp_values.bit12hfname = hf_bit12vflags; + temp_values.bit13 = "Not Defined"; + temp_values.bit13hfname = hf_bit13vflags; + temp_values.bit14 = "Not Defined"; + temp_values.bit14hfname = hf_bit14vflags; + temp_values.bit15 = "Not Defined"; + temp_values.bit15hfname = hf_bit15vflags; + temp_values.bit16 = "Not Defined"; + temp_values.bit16hfname = hf_bit16vflags; + process_bitfield(atree, tvb, &temp_values); + ioffset = ioffset + 4; + value4 = tvb_get_letohl(tvb, ioffset); + proto_tree_add_uint_format(atree, hf_es_seconds, tvb, ioffset, + 4, value4, "Seconds %d", value4); + ioffset = ioffset + 4; + replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */ + proto_tree_add_item(atree, hf_nds_replica_num, tvb, ioffset, + 2, replica_num); + ioffset = ioffset + 2; + event_num = tvb_get_letohs(tvb, ioffset); /* Event */ + proto_tree_add_item(atree, hf_nds_event_num, tvb, ioffset, + 2, event_num); + ioffset = ioffset + 2; + value5 = tvb_get_letohl(tvb, ioffset); /* length of field */ + if(value5 > tvb_length_remaining(tvb, ioffset)) + { + break; + } + ioffset += 4; + proto_tree_add_bytes(atree, hf_value_bytes, tvb, ioffset, value5, tvb_get_ptr(tvb, ioffset, value5)); + ioffset += value5; + ioffset += (value5%2); + } + } + break; + case 4: + for (i = 1 ; i <= values->vvalue; i++ ) + { + value1 = tvb_get_letohl(tvb, ioffset); + values->vstring = match_strval(value1, nds_syntax); + if (values->vstring == NULL) + { + values->vstring = "No Syntax Found"; + } + proto_tree_add_string(ntree, hf_nds_syntax, tvb, ioffset, + 4, values->vstring); + ioffset = ioffset + 4; + value2 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value2, mval_buf.buffer); + values->vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset, + value2, values->vstring); + ioffset = ioffset + value2; + value3 = tvb_get_letohl(tvb, ioffset); + + proto_tree_add_uint_format(ntree, hf_nds_uint32value, tvb, ioffset, 4, + value3, "Number of Values - %d", value3); + + ioffset = ioffset + 4; + for (r = 1 ; r <= value3; r++ ) + { + ioffset += align_4(tvb, ioffset); + temp_values.vvalue = tvb_get_letohl(tvb, ioffset); + temp_values.vlength = 2; + temp_values.hfname = hf_nds_vflags; + temp_values.voffset = ioffset; + temp_values.vdesc = "Value Flags"; + temp_values.bit1 = "Naming"; + temp_values.bit1hfname = hf_bit1vflags; + temp_values.bit2 = "Base Class"; + temp_values.bit2hfname = hf_bit2vflags; + temp_values.bit3 = "Present"; + temp_values.bit3hfname = hf_bit3vflags; + temp_values.bit4 = "Value Damaged"; + temp_values.bit4hfname = hf_bit4vflags; + temp_values.bit5 = "Not Defined"; + temp_values.bit5hfname = hf_bit5vflags; + temp_values.bit6 = "Not Defined"; + temp_values.bit6hfname = hf_bit6vflags; + temp_values.bit7 = "Not Defined"; + temp_values.bit7hfname = hf_bit7vflags; + temp_values.bit8 = "Not Defined"; + temp_values.bit8hfname = hf_bit8vflags; + temp_values.bit9 = "Not Defined"; + temp_values.bit9hfname = hf_bit9vflags; + temp_values.bit10 = "Not Defined"; + temp_values.bit10hfname = hf_bit10vflags; + temp_values.bit11 = "Not Defined"; + temp_values.bit11hfname = hf_bit11vflags; + temp_values.bit12 = "Not Defined"; + temp_values.bit12hfname = hf_bit12vflags; + temp_values.bit13 = "Not Defined"; + temp_values.bit13hfname = hf_bit13vflags; + temp_values.bit14 = "Not Defined"; + temp_values.bit14hfname = hf_bit14vflags; + temp_values.bit15 = "Not Defined"; + temp_values.bit15hfname = hf_bit15vflags; + temp_values.bit16 = "Not Defined"; + temp_values.bit16hfname = hf_bit16vflags; + process_bitfield(ntree, tvb, &temp_values); + ioffset = ioffset + 4; + value1 = tvb_get_letohl(tvb, ioffset); + proto_tree_add_uint_format(ntree, hf_es_seconds, tvb, ioffset, + 4, value1, "Seconds %d", value1); + ioffset = ioffset + 4; + replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */ + proto_tree_add_item(ntree, hf_nds_replica_num, tvb, ioffset, + 2, replica_num); + ioffset = ioffset + 2; + event_num = tvb_get_letohs(tvb, ioffset); /* Event */ + proto_tree_add_item(ntree, hf_nds_event_num, tvb, ioffset, + 2, event_num); + ioffset = ioffset + 2; + value1 = tvb_get_letohl(tvb, ioffset); + proto_tree_add_uint(ntree, hf_nds_value_len, tvb, ioffset, + 4, value1); + ioffset = ioffset + 4; + } + } + break; + default: + break; + } + break; + case 3: /* Attribute Request */ + for (i = 1 ; i <= values->vvalue; i++ ) + { + ioffset += align_4(tvb, ioffset); + value1 = tvb_get_letohl(tvb, ioffset); + proto_tree_add_uint_format(ntree, hf_nds_uint32value, tvb, ioffset, + 4, value1, "Value %d", value1); + ioffset = ioffset + value1; + } + break; + case 4: /* Read Class Request */ + for (i = 1 ; i <= values->vvalue; i++ ) + { + ioffset += align_4(tvb, ioffset); + value1 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value1, mval_buf.buffer); + values->vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_nds_base, tvb, ioffset, + value1, values->vstring); + values->mvtype = 1; + ioffset = ioffset + value1; + } + break; + case 5: /* Read Replicas */ + for (i = 1 ; i <= values->vvalue; i++ ) + { + + bvalue = 0x00000001; + + for (r = 0 ; r < 9; r++ ) + { + + if (values->vflags & bvalue) + { + switch(bvalue) + { + case 0x00000001: /*p3values.bit1 = "Output Flags"*/ + temp_values.vvalue = tvb_get_letohl(tvb, ioffset); + temp_values.vlength = 2; + temp_values.hfname = hf_nds_rflags; + temp_values.voffset = ioffset; + temp_values.vdesc = "Output Flags"; + temp_values.bit1 = values->bit1; + temp_values.bit1hfname = hf_bit1outflags; + temp_values.bit2 = values->bit2; + temp_values.bit2hfname = hf_bit2outflags; + temp_values.bit3 = values->bit3; + temp_values.bit3hfname = hf_bit3outflags; + temp_values.bit4 = values->bit4; + temp_values.bit4hfname = hf_bit4outflags; + temp_values.bit5 = values->bit5; + temp_values.bit5hfname = hf_bit5outflags; + temp_values.bit6 = values->bit6; + temp_values.bit6hfname = hf_bit6outflags; + temp_values.bit7 = values->bit7; + temp_values.bit7hfname = hf_bit7outflags; + temp_values.bit8 = values->bit8; + temp_values.bit8hfname = hf_bit8outflags; + temp_values.bit9 = values->bit9; + temp_values.bit9hfname = hf_bit9outflags; + temp_values.bit10 = "Not Defined"; + temp_values.bit10hfname = hf_bit10outflags; + temp_values.bit11 = "Not Defined"; + temp_values.bit11hfname = hf_bit11outflags; + temp_values.bit12 = "Not Defined"; + temp_values.bit12hfname = hf_bit12outflags; + temp_values.bit13 = "Not Defined"; + temp_values.bit13hfname = hf_bit13outflags; + temp_values.bit14 = "Not Defined"; + temp_values.bit14hfname = hf_bit14outflags; + temp_values.bit15 = "Not Defined"; + temp_values.bit15hfname = hf_bit15outflags; + temp_values.bit16 = "Not Defined"; + temp_values.bit16hfname = hf_bit16outflags; + process_bitfield(ntree, tvb, &temp_values); + ioffset = ioffset + 4; + break; + case 0x00000002: /*p3values.bit2 = "Entry ID"*/ + value1 = tvb_get_letohl(tvb, ioffset); + proto_tree_add_uint_format(ntree, hf_nds_eid, tvb, ioffset, + 4, value1, "Entry ID %08x", value1); + ioffset = ioffset + 4; + break; + case 0x00000004: /*p3values.bit3 = "Replica State"*/ + value1 = tvb_get_letohl(tvb, ioffset); + temp_values.vstring = match_strval(value1, nds_replica_state); + if (temp_values.vstring == NULL) + { + temp_values.vstring = "No Replica State Found"; + } + proto_tree_add_string(ntree, hf_replica_state, tvb, ioffset, + 4, temp_values.vstring); + ioffset = ioffset + 4; + break; + case 0x0000008: /*p3values.bit4 = "Modification Timestamp"*/ + value1 = tvb_get_letohl(tvb, ioffset); + proto_tree_add_uint_format(ntree, hf_es_seconds, tvb, ioffset, + 4, value1, "Seconds %d", value1); + ioffset = ioffset + 4; + replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */ + proto_tree_add_item(ntree, hf_nds_replica_num, tvb, ioffset, + 2, replica_num); + ioffset = ioffset + 2; + event_num = tvb_get_letohs(tvb, ioffset); /* Event */ + proto_tree_add_item(ntree, hf_nds_event_num, tvb, ioffset, + 2, event_num); + ioffset = ioffset + 2; + break; + case 0x00000010: /*p3values.bit5 = "Purge Time"*/ + value1 = tvb_get_letohl(tvb, ioffset); + proto_tree_add_uint_format(ntree, hf_nds_purge, tvb, ioffset, + 4, value1, "Purge Time %d", value1); + ioffset = ioffset + 4; + break; + case 0x00000020: /*p3values.bit6 = "Local Partition ID"*/ + value1 = tvb_get_letohl(tvb, ioffset); + proto_tree_add_uint_format(ntree, hf_nds_local_partition, tvb, ioffset, + 4, value1, "Local Partition ID %08x", value1); + ioffset = ioffset + 4; + break; + case 0x00000040: /*p3values.bit7 = "Distinguished Name"*/ + value1 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value1, mval_buf.buffer); + temp_values.vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_nds_name, tvb, ioffset, + value1, temp_values.vstring); + ioffset = ioffset + value1; + break; + 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); + if (temp_values.vstring == NULL) + { + temp_values.vstring = "No Replica Type Found"; + } + 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); + if (temp_values.vstring == NULL) + { + temp_values.vstring = "No Replica State Found"; + } + proto_tree_add_string(ntree, hf_replica_state, tvb, ioffset, + 4, temp_values.vstring); + ioffset = ioffset + 4; + break; + case 0x00000100: /*p3values.bit9 = "Partition Busy"*/ + value1 = tvb_get_letohs(tvb, ioffset); + proto_tree_add_boolean(ntree, hf_partition_busy, tvb, ioffset, 4, value1); + ioffset += 4; + break; + default: + break; + + } + } + bvalue = bvalue*2; + ioffset += align_4(tvb, ioffset); + if(tvb_length_remaining(tvb, ioffset) < 4 ) + { + break; + } + } + if(tvb_length_remaining(tvb, ioffset) < 4 ) + { + break; + } + } + break; + case 6: /* Modify Attribute Request */ + for (i = 0 ; i < values->vvalue; i++ ) + { + ioffset += align_4(tvb, ioffset); + value1 = tvb_get_letohl(tvb, ioffset); + valuestr = match_strval(value1, nds_kind_of_changes); + if (valuestr == NULL) + { + valuestr="(Kind Change Not Found)"; + } + proto_tree_add_uint_format(ntree, hf_nds_uint32value, tvb, ioffset, + values->vlength, value1, valuestr, value1); + ioffset = ioffset+4; + value2 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value2, mval_buf.buffer); /* Name of Attribute */ + temp_values.vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset, + value2, temp_values.vstring); + ioffset = ioffset + value2; + ioffset += align_4(tvb, ioffset); + if(value1 != 1 && value1 != 6) + { + values->voffset = ioffset; + print_nds_values(ntree, tvb, 9, values); + ioffset = values->voffset; + } + } + break; + case 7: /* Address Referal Request */ + for (i = 0 ; i < values->vvalue; i++ ) + { + + value1 = tvb_get_letohl(tvb, ioffset); + valuestr = match_strval(value1, nds_protocol_type); + if (valuestr == NULL) + { + valuestr="(Undefined Protocol)"; + } + proto_tree_add_uint_format(ntree, hf_nds_uint32value, tvb, ioffset, + values->vlength, value1, valuestr, value1); + ioffset = ioffset+4; + } + break; + case 8: /* Address Referal Reply */ + number_of_referals = values->vvalue; + + for (r = 1 ; r <= number_of_referals; r++ ) + { + aitem = proto_tree_add_uint_format(ntree, hf_referal_record, tvb, 6, 0, + r, "NDS Referal Record #%d", r); + atree = proto_item_add_subtree(aitem, ett_nds); + + value1 = tvb_get_letohl(tvb, ioffset); + + proto_tree_add_uint_format(atree, hf_referal_addcount, tvb, ioffset, 4, + value1, "Number of Addresses in Referal - %d", value1); + + ioffset = ioffset + 4; + for (i = 1 ; i <= value1; i++ ) + { + value2 = tvb_get_letohl(tvb, ioffset); + valuestr = match_strval(value2, nds_protocol_type); + if (valuestr == NULL) + { + valuestr="(Undefined Protocol)"; + } + proto_tree_add_uint_format(atree, hf_nds_uint32value, tvb, ioffset, + values->vlength, value2, valuestr, value2); + ioffset = ioffset+4; + value3 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset+4; + switch (value2) + { + case 0x00000000: + proto_tree_add_item(atree, hf_nds_net, tvb, ioffset, 4, FALSE); + proto_tree_add_item(atree, hf_nds_node, tvb, ioffset+4, 6, FALSE); + proto_tree_add_item(atree, hf_nds_socket, tvb, ioffset+10, 2, FALSE); + break; + case 0x00000001: + proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE); + value4 = tvb_get_letohl(tvb, ioffset+2); + proto_tree_add_ipv4(atree, hf_add_ref_ip, tvb, ioffset+2, 4, value4); + break; + case 0x00000008: + proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE); + value4 = tvb_get_letohl(tvb, ioffset+2); + proto_tree_add_ipv4(atree, hf_add_ref_udp, tvb, ioffset+2, 4, value4); + break; + case 0x00000009: + proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE); + value4 = tvb_get_letohl(tvb, ioffset+2); + proto_tree_add_ipv4(atree, hf_add_ref_tcp, tvb, ioffset+2, 4, value4); + break; + case 0x0000000d: + get_string(tvb, ioffset, value3, values->vstring); + proto_tree_add_string(atree, hf_value_string, tvb, ioffset, + value3, values->vstring); + break; + default: + break; + } + ioffset = ioffset + value3; + ioffset += align_4(tvb, ioffset); + } + + } + + break; + case 9: /* Local Address Referal Reply */ + number_of_referals = values->vvalue; + + for (r = 1 ; r <= number_of_referals; r++ ) + { + aitem = proto_tree_add_uint_format(ntree, hf_referal_record, tvb, 6, 0, + r, "NDS Referal Record #%d", r); + atree = proto_item_add_subtree(aitem, ett_nds); + + value2 = tvb_get_letohl(tvb, ioffset); + valuestr = match_strval(value2, nds_protocol_type); + if (valuestr == NULL) + { + valuestr="(Undefined Protocol)"; + } + proto_tree_add_uint_format(atree, hf_nds_uint32value, tvb, ioffset, + values->vlength, value2, valuestr, value2); + ioffset = ioffset+4; + value3 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset+4; + + switch (value2) + { + case 0x00000000: + proto_tree_add_item(atree, hf_nds_net, tvb, ioffset, 4, FALSE); + proto_tree_add_item(atree, hf_nds_node, tvb, ioffset+4, 6, FALSE); + proto_tree_add_item(atree, hf_nds_socket, tvb, ioffset+10, 2, FALSE); + break; + case 0x00000001: + proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE); + ioffset=ioffset+2; + value4 = tvb_get_letohl(tvb, ioffset); + proto_tree_add_ipv4(atree, hf_add_ref_ip, tvb, ioffset, 4, value4); + break; + case 0x00000008: + proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE); + ioffset=ioffset+2; + value4 = tvb_get_letohl(tvb, ioffset); + proto_tree_add_ipv4(atree, hf_add_ref_udp, tvb, ioffset, 4, value4); + break; + case 0x00000009: + proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE); + ioffset=ioffset+2; + value4 = tvb_get_letohl(tvb, ioffset); + proto_tree_add_ipv4(atree, hf_add_ref_tcp, tvb, ioffset, 4, value4); + break; + case 0x0000000d: + get_string(tvb, ioffset, value3, values->vstring); + proto_tree_add_string(atree, hf_value_string, tvb, ioffset, + value3, values->vstring); + break; + default: + break; + } + ioffset = ioffset + value3; + ioffset += align_4(tvb, ioffset); + } + break; + case 10: /* Process Entry Specifiers */ + value2 = tvb_get_letohl(tvb, ioffset); /* ES Type */ + values->vstring = match_strval(value2, es_type); + if (values->vstring == NULL) + { + values->vstring = "No ES Type Found"; + } + esitem = proto_tree_add_string_format(ntree, hf_es_type, tvb, ioffset, + 4, values->vstring, "Output Entry Specifier - %s", values->vstring); + estree = proto_item_add_subtree(esitem, ett_nds); + 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); + if (values->vstring == NULL) + { + values->vstring = "No ES Type Found"; + } + esitem = proto_tree_add_string_format(ntree, hf_es_type, tvb, ioffset, + 4, values->vstring, "Input Entry Specifier - %s", values->vstring); + estree = proto_item_add_subtree(esitem, ett_nds); + ioffset = ioffset + 4; + ioffset = print_es_type(estree, tvb, values, value3, ioffset); + value4 = tvb_get_letohl(tvb, ioffset); + aitem = proto_tree_add_uint_format(ntree, hf_referal_record, tvb, ioffset, 4, + value4, "Referal Protocols - %d", value4); + atree = proto_item_add_subtree(aitem, ett_nds); + ioffset += 4; + for (i = 0 ; i < value4; i++ ) + { + value5 = tvb_get_letohl(tvb, ioffset); + valuestr = match_strval(value5, nds_protocol_type); + if (valuestr == NULL) + { + valuestr="(Undefined Protocol)"; + } + proto_tree_add_string_format(atree, hf_value_string, tvb, ioffset, + 4, valuestr, "Protocol -> %s", valuestr); + ioffset = ioffset+4; + } + value6 = tvb_get_letohl(tvb, ioffset); + aitem = proto_tree_add_uint_format(ntree, hf_referal_record, tvb, ioffset, 4, + value6, "Tree Walking Protocols - %d", value6); + atree = proto_item_add_subtree(aitem, ett_nds); + ioffset += 4; + for (i = 0 ; i < value6; i++ ) + { + value7 = tvb_get_letohl(tvb, ioffset); + valuestr = match_strval(value7, nds_protocol_type); + if (valuestr == NULL) + { + valuestr="(Undefined Protocol)"; + } + proto_tree_add_string_format(atree, hf_value_string, tvb, ioffset, + 4, valuestr, "Protocol -> %s", valuestr); + ioffset = ioffset+4; + } + break; + case 11: /* Print Timestamp */ + replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */ + proto_tree_add_item(ncp_tree, hf_nds_replica_num, tvb, ioffset, + 2, replica_num); + ioffset = ioffset + 2; + event_num = tvb_get_letohs(tvb, ioffset); /* Event */ + proto_tree_add_item(ncp_tree, hf_nds_event_num, tvb, ioffset, + 2, event_num); + ioffset = ioffset + 2; + case 12: /* List Partitions */ + number_of_referals = values->vvalue; + for (i = 0; i < number_of_referals; i++) + { + bvalue = 0x00000001; + + for (r = 0 ; r < 32; r++ ) + { + if (values->vflags & bvalue) + { + switch(bvalue) + { + case 0x00000001: /* Information Flags */ + temp_values.vvalue = tvb_get_letohs(tvb, ioffset); + temp_values.vtype = 5; /* Bitfield */ + temp_values.vstring = ""; + temp_values.vdesc = "Information Flags (low) Byte:"; + temp_values.vlength = 2; + temp_values.hfname= hf_nds_rflags; + temp_values.voffset = ioffset; + temp_values.bit1 = "Output Flags"; + temp_values.bit1hfname = hf_bit1infoflagsl; + temp_values.bit2 = "Entry ID"; + temp_values.bit2hfname = hf_bit2infoflagsl; + temp_values.bit3 = "Entry Flags"; + temp_values.bit3hfname = hf_bit3infoflagsl; + temp_values.bit4 = "Subordinate Count"; + temp_values.bit4hfname = hf_bit4infoflagsl; + temp_values.bit5 = "Modification Time"; + temp_values.bit5hfname = hf_bit5infoflagsl; + temp_values.bit6 = "Modification Timestamp"; + temp_values.bit6hfname = hf_bit6infoflagsl; + temp_values.bit7 = "Creation Timestamp"; + temp_values.bit7hfname = hf_bit7infoflagsl; + temp_values.bit8 = "Partition Root ID"; + temp_values.bit8hfname = hf_bit8infoflagsl; + temp_values.bit9 = "Parent ID"; + temp_values.bit9hfname = hf_bit9infoflagsl; + temp_values.bit10 = "Revision Count"; + temp_values.bit10hfname = hf_bit10infoflagsl; + temp_values.bit11 = "Replica Type"; + temp_values.bit11hfname = hf_bit11infoflagsl; + temp_values.bit12 = "Base Class"; + temp_values.bit12hfname = hf_bit12infoflagsl; + temp_values.bit13 = "Relative Distinguished Name"; + temp_values.bit13hfname = hf_bit13infoflagsl; + temp_values.bit14 = "Distinguished Name"; + temp_values.bit14hfname = hf_bit14infoflagsl; + temp_values.bit15 = "Root Distinguished Name"; + temp_values.bit15hfname = hf_bit15infoflagsl; + temp_values.bit16 = "Parent Distinguished Name"; + temp_values.bit16hfname = hf_bit16infoflagsl; + process_bitfield(ntree, tvb, &temp_values); + ioffset = ioffset+2; + temp_values.vvalue = tvb_get_letohs(tvb, ioffset); + temp_values.vtype = 5; /* Bitfield */ + temp_values.vstring = ""; + temp_values.vdesc = "Information Flags (high) Byte:"; + temp_values.vlength = 2; + temp_values.hfname= hf_nds_rflags; + temp_values.voffset = ioffset; + temp_values.bit1 = "Purge Time"; + temp_values.bit1hfname = hf_bit1infoflagsh; + temp_values.bit2 = "Dereference Base Class"; + temp_values.bit2hfname = hf_bit2infoflagsh; + temp_values.bit3 = "Not Defined"; + temp_values.bit3hfname = hf_bit3infoflagsh; + temp_values.bit4 = "Not Defined"; + temp_values.bit4hfname = hf_bit4infoflagsh; + temp_values.bit5 = "Not Defined"; + temp_values.bit5hfname = hf_bit5infoflagsh; + temp_values.bit6 = "Not Defined"; + temp_values.bit6hfname = hf_bit6infoflagsh; + temp_values.bit7 = "Not Defined"; + temp_values.bit7hfname = hf_bit7infoflagsh; + temp_values.bit8 = "Not Defined"; + temp_values.bit8hfname = hf_bit8infoflagsh; + temp_values.bit9 = "Not Defined"; + temp_values.bit9hfname = hf_bit9infoflagsh; + temp_values.bit10 = "Not Defined"; + temp_values.bit10hfname = hf_bit10infoflagsh; + temp_values.bit11 = "Not Defined"; + temp_values.bit11hfname = hf_bit11infoflagsh; + temp_values.bit12 = "Not Defined"; + temp_values.bit12hfname = hf_bit12infoflagsh; + temp_values.bit13 = "Not Defined"; + temp_values.bit13hfname = hf_bit13infoflagsh; + temp_values.bit14 = "Not Defined"; + temp_values.bit14hfname = hf_bit14infoflagsh; + temp_values.bit15 = "Not Defined"; + temp_values.bit15hfname = hf_bit15infoflagsh; + temp_values.bit16 = "Not Defined"; + temp_values.bit16hfname = hf_bit16infoflagsh; + process_bitfield(ntree, tvb, &temp_values); + ioffset = ioffset+2; + break; + case 0x00000002: /* Entry ID */ + value1 = tvb_get_letohl(tvb, ioffset); + proto_tree_add_uint_format(ntree, hf_nds_eid, tvb, ioffset, + 4, value1, "Entry ID %08x", value1); + ioffset = ioffset + 4; + break; + case 0x00000004: /* Entry Flags */ + temp_values.vvalue = tvb_get_letohl(tvb, ioffset); + temp_values.vtype = 5; /* Bitfield */ + temp_values.vstring = ""; + temp_values.vdesc = "Entry Flags:"; + temp_values.vlength = 2; + temp_values.hfname= hf_nds_eflags; + temp_values.voffset = ioffset; + temp_values.bit1 = "Alias Entry"; + temp_values.bit1hfname = hf_bit1eflags; + temp_values.bit2 = "Partition Root"; + temp_values.bit2hfname = hf_bit2eflags; + temp_values.bit3 = "Container Entry"; + temp_values.bit3hfname = hf_bit3eflags; + temp_values.bit4 = "Container Alias"; + temp_values.bit4hfname = hf_bit4eflags; + temp_values.bit5 = "Matches List Filter"; + temp_values.bit5hfname = hf_bit5eflags; + temp_values.bit6 = "Reference Entry"; + temp_values.bit6hfname = hf_bit6eflags; + temp_values.bit7 = "40x Reference Entry"; + temp_values.bit7hfname = hf_bit7eflags; + temp_values.bit8 = "Back Linked"; + temp_values.bit8hfname = hf_bit8eflags; + temp_values.bit9 = "New Entry"; + temp_values.bit9hfname = hf_bit9eflags; + temp_values.bit10 = "Temporary Reference"; + temp_values.bit10hfname = hf_bit10eflags; + temp_values.bit11 = "Audited"; + temp_values.bit11hfname = hf_bit11eflags; + temp_values.bit12 = "Entry Not Present"; + temp_values.bit12hfname = hf_bit12eflags; + temp_values.bit13 = "Entry Verify CTS"; + temp_values.bit13hfname = hf_bit13eflags; + temp_values.bit14 = "Entry Damaged"; + temp_values.bit14hfname = hf_bit14eflags; + temp_values.bit15 = "Not Defined"; + temp_values.bit15hfname = hf_bit15eflags; + temp_values.bit16 = "Not Defined"; + temp_values.bit16hfname = hf_bit16eflags; + process_bitfield(ntree, tvb, &temp_values); + ioffset = ioffset+4; + break; + case 0x0000008: /* Subordinate Count */ + value1 = tvb_get_letohl(tvb, ioffset); + proto_tree_add_uint_format(ntree, hf_sub_count, tvb, ioffset, + 4, value1, "Subordinate Count %d", value1); + ioffset = ioffset + 4; + break; + case 0x0000010: /* Modification Time */ + value1 = tvb_get_letohl(tvb, ioffset); + proto_tree_add_uint_format(ntree, hf_es_seconds, tvb, ioffset, + 4, value1, "Modification Time in Seconds %d", value1); + ioffset = ioffset + 4; + break; + case 0x0000020: /* Modification Timestamp */ + value1 = tvb_get_letohl(tvb, ioffset); + proto_tree_add_uint_format(ntree, hf_es_seconds, tvb, ioffset, + 4, value1, "Modification Timestamp Seconds %d", value1); + ioffset = ioffset + 4; + replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */ + proto_tree_add_item(ntree, hf_nds_replica_num, tvb, ioffset, + 2, replica_num); + ioffset = ioffset + 2; + event_num = tvb_get_letohs(tvb, ioffset); /* Event */ + proto_tree_add_item(ntree, hf_nds_event_num, tvb, ioffset, + 2, event_num); + ioffset = ioffset + 2; + break; + case 0x0000040: /* Creation Timestamp */ + value1 = tvb_get_letohl(tvb, ioffset); + proto_tree_add_uint_format(ntree, hf_es_seconds, tvb, ioffset, + 4, value1, "Creation Timestamp Seconds %d", value1); + ioffset = ioffset + 4; + replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */ + proto_tree_add_item(ntree, hf_nds_replica_num, tvb, ioffset, + 2, replica_num); + ioffset = ioffset + 2; + event_num = tvb_get_letohs(tvb, ioffset); /* Event */ + proto_tree_add_item(ntree, hf_nds_event_num, tvb, ioffset, + 2, event_num); + ioffset = ioffset + 2; + break; + case 0x00000080: /* Partition Root ID */ + value1 = tvb_get_letohl(tvb, ioffset); + proto_tree_add_uint_format(ntree, hf_nds_partition_root_id, tvb, ioffset, + 4, value1, "Partition Root ID %08x", value1); + ioffset = ioffset + 4; + break; + case 0x00000100: /* Parent ID */ + value1 = tvb_get_letohl(tvb, ioffset); + proto_tree_add_uint_format(ntree, hf_nds_parent, tvb, ioffset, + 4, value1, "Parent ID %08x", value1); + ioffset = ioffset + 4; + break; + case 0x00000200: /* Revision Count */ + value1 = tvb_get_letohl(tvb, ioffset); + proto_tree_add_uint_format(ntree, hf_nds_revision, tvb, ioffset, + 4, value1, "Revision Count %d", value1); + ioffset = ioffset + 4; + break; + case 0x00000400: /* Replica Type & State */ + value1 = tvb_get_letohl(tvb, ioffset); + value2 = value1 & 0x00ff; + temp_values.vstring = match_strval(value2, nds_replica_type); + if (temp_values.vstring == NULL) + { + temp_values.vstring = "No Replica Type Found"; + } + 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); + if (temp_values.vstring == NULL) + { + temp_values.vstring = "No Replica State Found"; + } + proto_tree_add_string(ntree, hf_replica_state, tvb, ioffset, + 4, temp_values.vstring); + ioffset = ioffset + 4; + break; + case 0x00000800: /* Base Class */ + value1 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value1, mval_buf.buffer); + temp_values.vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_nds_base, tvb, ioffset, + value1, temp_values.vstring); + ioffset = ioffset + value1; + break; + case 0x00001000: /* Relative Distinguished Name */ + value1 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value1, mval_buf.buffer); + temp_values.vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_nds_relative_dn, tvb, ioffset, + value1, temp_values.vstring); + ioffset = ioffset + value1; + break; + case 0x00002000: /* Distinguished Name */ + value1 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value1, mval_buf.buffer); + temp_values.vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_nds_name, tvb, ioffset, + value1, temp_values.vstring); + ioffset = ioffset + value1; + break; + case 0x00004000: /* Root Distinguished Name */ + value1 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value1, mval_buf.buffer); + temp_values.vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_nds_name, tvb, ioffset, + value1, temp_values.vstring); + ioffset = ioffset + value1; + break; + case 0x00008000: /* Parent Distinguished Name */ + value1 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value1, mval_buf.buffer); + temp_values.vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_nds_name, tvb, ioffset, + value1, temp_values.vstring); + ioffset = ioffset + value1; + break; + case 0x00010000: /* Purge Time */ + value1 = tvb_get_letohl(tvb, ioffset); + proto_tree_add_uint_format(ntree, hf_nds_purge, tvb, ioffset, + 4, value1, "Purge Time %d", value1); + ioffset = ioffset + 4; + break; + case 0x00020000: /* Dereference Base Class */ + value1 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value1, mval_buf.buffer); + temp_values.vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_deref_base, tvb, ioffset, + value1, temp_values.vstring); + ioffset = ioffset + value1; + break; + default: + break; + + } + ioffset += align_4(tvb, ioffset); + } + bvalue = bvalue*2; + if(tvb_length_remaining(tvb, ioffset) < 4 ) + { + break; + } + } + if(tvb_length_remaining(tvb, ioffset) < 4 ) + { + break; + } + } + break; + case 13: /* Class Names */ + number_of_referals = values->vvalue; + for (i = 0; i < number_of_referals; i++) + { + value1 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value1, mval_buf.buffer); + temp_values.vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_nds_base_class, tvb, ioffset, + value1, temp_values.vstring); + ioffset = ioffset + value1; + ioffset += align_4(tvb, ioffset); + if(values->vflags != 0) + { + temp_values.vvalue = tvb_get_letohl(tvb, ioffset); + temp_values.vtype = 5; /* Bitfield */ + temp_values.vstring = ""; + temp_values.vdesc = "Class Flags:"; + temp_values.vlength = 2; + temp_values.hfname= hf_nds_cflags; + temp_values.voffset = ioffset; + temp_values.bit1 = "Ambiguous Containment"; + temp_values.bit1hfname = hf_bit1cflags; + temp_values.bit2 = "Ambiguous Naming"; + temp_values.bit2hfname = hf_bit2cflags; + temp_values.bit3 = "Class Definition Cannot be Removed"; + temp_values.bit3hfname = hf_bit3cflags; + temp_values.bit4 = "Effective Class"; + temp_values.bit4hfname = hf_bit4cflags; + temp_values.bit5 = "Container Class"; + temp_values.bit5hfname = hf_bit5cflags; + temp_values.bit6 = "Not Defined"; + temp_values.bit6hfname = hf_bit6cflags; + temp_values.bit7 = "Not Defined"; + temp_values.bit7hfname = hf_bit7cflags; + temp_values.bit8 = "Not Defined"; + temp_values.bit8hfname = hf_bit8cflags; + temp_values.bit9 = "Not Defined"; + temp_values.bit9hfname = hf_bit9cflags; + temp_values.bit10 = "Not Defined"; + temp_values.bit10hfname = hf_bit10cflags; + temp_values.bit11 = "Not Defined"; + temp_values.bit11hfname = hf_bit11cflags; + temp_values.bit12 = "Not Defined"; + temp_values.bit12hfname = hf_bit12cflags; + temp_values.bit13 = "Not Defined"; + temp_values.bit13hfname = hf_bit13cflags; + temp_values.bit14 = "Not Defined"; + temp_values.bit14hfname = hf_bit14cflags; + temp_values.bit15 = "Not Defined"; + temp_values.bit15hfname = hf_bit15cflags; + temp_values.bit16 = "Not Defined"; + temp_values.bit16hfname = hf_bit16cflags; + process_bitfield(ntree, tvb, &temp_values); + ioffset = ioffset+4; + if(values->vflags != 5) + { + value1 = tvb_get_letohl(tvb, ioffset); /* length of field */ + if(value1 > tvb_length_remaining(tvb, ioffset)) + { + break; + } + ioffset += 4; + proto_tree_add_bytes(ntree, hf_nds_asn1, tvb, ioffset, value1, tvb_get_ptr(tvb, ioffset, value1)); + ioffset += value1; + ioffset += (value1%2); + } + if(values->vflags == 1 || values->vflags == 2 || values->vflags == 4) + { + value1 = tvb_get_letohl(tvb, ioffset); /* Super Classes */ + proto_tree_add_uint_format(ntree, hf_nds_purge, tvb, ioffset, + 4, value1, "Super Classes %d", value1); + ioffset = ioffset + 4; + for (r = 0; r < value1; r++) + { + value2 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value2, mval_buf.buffer); + temp_values.vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_nds_base_class, tvb, ioffset, + value2, temp_values.vstring); + ioffset = ioffset + value2; + ioffset += align_4(tvb, ioffset); + } + value1 = tvb_get_letohl(tvb, ioffset); /* Containment Classes */ + proto_tree_add_uint_format(ntree, hf_nds_purge, tvb, ioffset, + 4, value1, "Containment Classes %d", value1); + ioffset = ioffset + 4; + for (r = 0; r < value1; r++) + { + value2 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value2, mval_buf.buffer); + temp_values.vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_nds_base_class, tvb, ioffset, + value2, temp_values.vstring); + ioffset = ioffset + value2; + ioffset += align_4(tvb, ioffset); + } + value1 = tvb_get_letohl(tvb, ioffset); /* Naming Attributes */ + proto_tree_add_uint_format(ntree, hf_nds_purge, tvb, ioffset, + 4, value1, "Naming Attributes %d", value1); + ioffset = ioffset + 4; + for (r = 0; r < value1; r++) + { + value2 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value2, mval_buf.buffer); + temp_values.vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_nds_base_class, tvb, ioffset, + value2, temp_values.vstring); + ioffset = ioffset + value2; + ioffset += align_4(tvb, ioffset); + } + value1 = tvb_get_letohl(tvb, ioffset); /* Mandatory Attributes */ + proto_tree_add_uint_format(ntree, hf_nds_purge, tvb, ioffset, + 4, value1, "Mandatory Attributes %d", value1); + ioffset = ioffset + 4; + for (r = 0; r < value1; r++) + { + value2 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value2, mval_buf.buffer); + temp_values.vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_nds_base_class, tvb, ioffset, + value2, temp_values.vstring); + ioffset = ioffset + value2; + ioffset += align_4(tvb, ioffset); + } + value1 = tvb_get_letohl(tvb, ioffset); /* Optional Attributes */ + proto_tree_add_uint_format(ntree, hf_nds_purge, tvb, ioffset, + 4, value1, "Optional Attributes %d", value1); + ioffset = ioffset + 4; + for (r = 0; r < value1; r++) + { + ioffset += align_4(tvb, ioffset); + value2 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value2, mval_buf.buffer); + temp_values.vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_nds_base_class, tvb, ioffset, + value2, temp_values.vstring); + ioffset = ioffset + value2; + if(tvb_length_remaining(tvb, ioffset) < 4 ) + { + break; + } + } + } + if(values->vflags == 2 || values->vflags == 4) /* Class Definitions of Super Classes */ + { + value1 = tvb_get_letohl(tvb, ioffset); /* Containment Classes */ + proto_tree_add_uint_format(ntree, hf_nds_purge, tvb, ioffset, + 4, value1, "Containment Classes %d", value1); + ioffset = ioffset + 4; + for (r = 0; r < value1; r++) + { + value2 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value2, mval_buf.buffer); + temp_values.vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_nds_base_class, tvb, ioffset, + value2, temp_values.vstring); + ioffset = ioffset + value2; + ioffset += align_4(tvb, ioffset); + } + value1 = tvb_get_letohl(tvb, ioffset); /* Naming Attributes */ + proto_tree_add_uint_format(ntree, hf_nds_purge, tvb, ioffset, + 4, value1, "Naming Attributes %d", value1); + ioffset = ioffset + 4; + for (r = 0; r < value1; r++) + { + value2 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value2, mval_buf.buffer); + temp_values.vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_nds_base_class, tvb, ioffset, + value2, temp_values.vstring); + ioffset = ioffset + value2; + ioffset += align_4(tvb, ioffset); + } + value1 = tvb_get_letohl(tvb, ioffset); /* Mandatory Attributes */ + proto_tree_add_uint_format(ntree, hf_nds_purge, tvb, ioffset, + 4, value1, "Mandatory Attributes %d", value1); + ioffset = ioffset + 4; + for (r = 0; r < value1; r++) + { + value2 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value2, mval_buf.buffer); + temp_values.vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_nds_base_class, tvb, ioffset, + value2, temp_values.vstring); + ioffset = ioffset + value2; + ioffset += align_4(tvb, ioffset); + } + value1 = tvb_get_letohl(tvb, ioffset); /* Optional Attributes */ + proto_tree_add_uint_format(ntree, hf_nds_purge, tvb, ioffset, + 4, value1, "Optional Attributes %d", value1); + ioffset = ioffset + 4; + for (r = 0; r < value1; r++) + { + value2 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value2, mval_buf.buffer); + temp_values.vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_nds_base_class, tvb, ioffset, + value2, temp_values.vstring); + ioffset = ioffset + value2; + ioffset += align_4(tvb, ioffset); + } + value1 = tvb_get_letohl(tvb, ioffset); /* Default ACL */ + proto_tree_add_uint_format(ntree, hf_nds_eid, tvb, ioffset, + 4, value1, "Default ACL %08x", value1); + ioffset = ioffset + 4; + if(tvb_length_remaining(tvb, ioffset) < 4 ) + { + break; + } + } + if(values->vflags == 5) /* Base Class Definitions */ + { + value1 = tvb_get_letohl(tvb, ioffset); /* Creation Timestamp */ + proto_tree_add_uint_format(ntree, hf_es_seconds, tvb, ioffset, + 4, value1, "Creation Timestamp Seconds %d", value1); + ioffset = ioffset + 4; + replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */ + proto_tree_add_item(ntree, hf_nds_replica_num, tvb, ioffset, + 2, replica_num); + ioffset = ioffset + 2; + event_num = tvb_get_letohs(tvb, ioffset); /* Event */ + proto_tree_add_item(ntree, hf_nds_event_num, tvb, ioffset, + 2, event_num); + ioffset = ioffset + 2; + value1 = tvb_get_letohl(tvb, ioffset); /* Modification Timestamp */ + proto_tree_add_uint_format(ntree, hf_es_seconds, tvb, ioffset, + 4, value1, "Modification Timestamp Seconds %d", value1); + ioffset = ioffset + 4; + replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */ + proto_tree_add_item(ntree, hf_nds_replica_num, tvb, ioffset, + 2, replica_num); + ioffset = ioffset + 2; + event_num = tvb_get_letohs(tvb, ioffset); /* Event */ + proto_tree_add_item(ntree, hf_nds_event_num, tvb, ioffset, + 2, event_num); + ioffset = ioffset + 2; + /* Class Definition */ + value1 = tvb_get_letohl(tvb, ioffset); /* Super Classes */ + proto_tree_add_uint_format(ntree, hf_nds_purge, tvb, ioffset, + 4, value1, "Super Classes %d", value1); + ioffset = ioffset + 4; + for (r = 0; r < value1; r++) + { + value2 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value2, mval_buf.buffer); + temp_values.vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_nds_base_class, tvb, ioffset, + value2, temp_values.vstring); + ioffset = ioffset + value2; + ioffset += align_4(tvb, ioffset); + } + value1 = tvb_get_letohl(tvb, ioffset); /* Containment Classes */ + proto_tree_add_uint_format(ntree, hf_nds_purge, tvb, ioffset, + 4, value1, "Containment Classes %d", value1); + ioffset = ioffset + 4; + for (r = 0; r < value1; r++) + { + value2 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value2, mval_buf.buffer); + temp_values.vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_nds_base_class, tvb, ioffset, + value2, temp_values.vstring); + ioffset = ioffset + value2; + ioffset += align_4(tvb, ioffset); + } + value1 = tvb_get_letohl(tvb, ioffset); /* Naming Attributes */ + proto_tree_add_uint_format(ntree, hf_nds_purge, tvb, ioffset, + 4, value1, "Naming Attributes %d", value1); + ioffset = ioffset + 4; + for (r = 0; r < value1; r++) + { + value2 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value2, mval_buf.buffer); + temp_values.vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_nds_base_class, tvb, ioffset, + value2, temp_values.vstring); + ioffset = ioffset + value2; + ioffset += align_4(tvb, ioffset); + } + value1 = tvb_get_letohl(tvb, ioffset); /* Mandatory Attributes */ + proto_tree_add_uint_format(ntree, hf_nds_purge, tvb, ioffset, + 4, value1, "Mandatory Attributes %d", value1); + ioffset = ioffset + 4; + for (r = 0; r < value1; r++) + { + value2 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value2, mval_buf.buffer); + temp_values.vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_nds_base_class, tvb, ioffset, + value2, temp_values.vstring); + ioffset = ioffset + value2; + ioffset += align_4(tvb, ioffset); + } + value1 = tvb_get_letohl(tvb, ioffset); /* Optional Attributes */ + proto_tree_add_uint_format(ntree, hf_nds_purge, tvb, ioffset, + 4, value1, "Optional Attributes %d", value1); + ioffset = ioffset + 4; + for (r = 0; r < value1; r++) + { + value2 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value2, mval_buf.buffer); + temp_values.vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_nds_base_class, tvb, ioffset, + value2, temp_values.vstring); + ioffset = ioffset + value2; + ioffset += align_4(tvb, ioffset); + } + value1 = tvb_get_letohl(tvb, ioffset); /* Default ACL */ + proto_tree_add_uint_format(ntree, hf_nds_eid, tvb, ioffset, + 4, value1, "Default ACL %08x", value1); + ioffset = ioffset + 4; + if(tvb_length_remaining(tvb, ioffset) < 4 ) + { + break; + } + } + } + } + break; + case 14: /* Modify Class */ + for (i = 1 ; i <= values->vvalue; i++ ) /* Attribute Names to add*/ + { + ioffset += align_4(tvb, ioffset); + value1 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value1, mval_buf.buffer); + values->vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset, + value1, values->vstring); + ioffset = ioffset + value1; + } + if(tvb_length_remaining(tvb, ioffset) < 4 ) + { + break; + } + ioffset += align_4(tvb, ioffset); + value1 = tvb_get_letohl(tvb, ioffset); + proto_tree_add_uint_format(ntree, hf_nds_att_del, tvb, ioffset, + 4, value1, "Attribute Names to Delete %d", value1); + ioffset = ioffset + 4; + for (i = 1 ; i <= value1; i++ ) /* Attribute Names to delete*/ + { + ioffset += align_4(tvb, ioffset); + value2 = tvb_get_letohl(tvb, ioffset); + ioffset = ioffset + 4; + get_string(tvb, ioffset, value2, mval_buf.buffer); + values->vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset, + value2, values->vstring); + ioffset = ioffset + value2; + } + if(tvb_length_remaining(tvb, ioffset) < 4 ) + { + break; + } + ioffset += align_4(tvb, ioffset); + value1 = tvb_get_letohl(tvb, ioffset); + proto_tree_add_uint_format(ntree, hf_nds_acl_add, tvb, ioffset, + 4, value1, "ACL Templates to Add %d", value1); + ioffset = ioffset + 4; + for (i = 1 ; i <= value1; i++ ) /* ACL templates to add*/ + { + ioffset += align_4(tvb, ioffset); + value2 = tvb_get_letohl(tvb, ioffset); /* Attribute Name */ + ioffset = ioffset + 4; + get_string(tvb, ioffset, value2, mval_buf.buffer); + values->vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_nds_attribute_dn, tvb, ioffset, + value2, values->vstring); + ioffset = ioffset + value2; + ioffset += align_4(tvb, ioffset); + value2 = tvb_get_letohl(tvb, ioffset); /* DN of Trustee */ + ioffset = ioffset + 4; + get_string(tvb, ioffset, value2, mval_buf.buffer); + values->vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_nds_trustee_dn, tvb, ioffset, + value2, values->vstring); + ioffset = ioffset + value2; + ioffset += align_4(tvb, ioffset); + value1 = tvb_get_letohl(tvb, ioffset); + proto_tree_add_uint_format(ntree, hf_nds_privileges, tvb, ioffset, + 4, value1, "Priviledges 0x%08x", value1); + ioffset = ioffset + 4; + } + if(tvb_length_remaining(tvb, ioffset) < 4 ) + { + break; + } + ioffset += align_4(tvb, ioffset); + value1 = tvb_get_letohl(tvb, ioffset); + proto_tree_add_uint_format(ntree, hf_nds_acl_del, tvb, ioffset, + 4, value1, "ACL Templates to Delete %d", value1); + ioffset = ioffset + 4; + for (i = 1 ; i <= value1; i++ ) /* ACL templates to delete*/ + { + ioffset += align_4(tvb, ioffset); + value2 = tvb_get_letohl(tvb, ioffset); /* Attribute Name */ + ioffset = ioffset + 4; + get_string(tvb, ioffset, value2, mval_buf.buffer); + values->vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_nds_attribute_dn, tvb, ioffset, + value2, values->vstring); + ioffset = ioffset + value2; + ioffset += align_4(tvb, ioffset); + value2 = tvb_get_letohl(tvb, ioffset); /* DN of Trustee */ + ioffset = ioffset + 4; + get_string(tvb, ioffset, value2, mval_buf.buffer); + values->vstring = mval_buf.buffer; + proto_tree_add_string(ntree, hf_nds_trustee_dn, tvb, ioffset, + value2, values->vstring); + ioffset = ioffset + value2; + ioffset += align_4(tvb, ioffset); + value1 = tvb_get_letohl(tvb, ioffset); /* Priviledges */ + proto_tree_add_uint_format(ntree, hf_nds_privileges, tvb, ioffset, + 4, value1, "Priviledges 0x%08x", value1); + ioffset = ioffset + 4; + } + break; + default: + break; + } +} + void dissect_ncp_request(tvbuff_t *tvb, packet_info *pinfo, guint16 nw_connection, guint8 sequence, @@ -690,12 +3858,14 @@ dissect_ncp_request(tvbuff_t *tvb, packet_info *pinfo, gboolean requires_subfunc; gboolean has_length = TRUE; ncp_req_hash_value *request_value = NULL; - const ncp_record *ncp_rec = NULL; + const ncp_record *ncp_rec = NULL; conversation_t *conversation; ptvcursor_t *ptvc = NULL; proto_tree *temp_tree = NULL; gboolean run_req_cond = FALSE; gboolean run_info_str = FALSE; + guint32 length_remaining; + guint32 testvar; func = tvb_get_guint8(tvb, 6); @@ -713,7 +3883,23 @@ dissect_ncp_request(tvbuff_t *tvb, packet_info *pinfo, /* Determine which ncp_record to use. */ switch (type) { case NCP_ALLOCATE_SLOT: - ncp_rec = &ncp1111_request; + length_remaining = tvb_length_remaining(tvb, 4); + if (length_remaining > 4) + { + testvar = tvb_get_ntohl(tvb, 4); + if( testvar == 0x4c495020) + { + ncp_rec = &ncplip_echo; + } + else + { + ncp_rec = &ncp1111_request; + } + } + else + { + ncp_rec = &ncp1111_request; + } break; case NCP_SERVICE_REQUEST: ncp_rec = ncp_record_find(func, subfunc); @@ -724,6 +3910,9 @@ dissect_ncp_request(tvbuff_t *tvb, packet_info *pinfo, case NCP_BROADCAST_SLOT: ncp_rec = &ncpbbbb_request; break; + case NCP_LIP_ECHO: + ncp_rec = &ncplip_echo; + break; default: ncp_rec = NULL; } @@ -908,27 +4097,53 @@ dissect_ncp_request(tvbuff_t *tvb, packet_info *pinfo, GPtrArray *parray; int i, len; field_info *finfo; - + int info_type; + parray = proto_get_finfo_ptr_array(ncp_tree, *ncp_rec->req_info_str->hf_ptr); len = g_ptr_array_len(parray); + if (len > 0) { + col_set_str(pinfo->cinfo, COL_INFO, "C "); finfo = g_ptr_array_index(parray, 0); - col_append_fstr(pinfo->cinfo, COL_INFO, - (gchar*) ncp_rec->req_info_str->first_string, - /* XXX - this only works for certain ftypes */ - fvalue_get(finfo->value)); - } + + info_type = get_info_type((gchar*) ncp_rec->req_info_str->first_string); + + if (info_type == 2) { // Is this a string or not? + + col_append_fstr(pinfo->cinfo, COL_INFO, + (gchar*) ncp_rec->req_info_str->first_string, + fvalue_get(finfo->value)); + } + else + { + + col_append_fstr(pinfo->cinfo, COL_INFO, + (gchar*) ncp_rec->req_info_str->first_string, + fvalue_get_integer(finfo->value)); + } + } if (len > 1) { for (i = 1; i < len; i++) { finfo = g_ptr_array_index(parray, i); - col_append_fstr(pinfo->cinfo, COL_INFO, - (gchar*) ncp_rec->req_info_str->repeat_string, - /* XXX - this only works for certain ftypes */ - fvalue_get(finfo->value)); - } + info_type = get_info_type((gchar*) ncp_rec->req_info_str->repeat_string); + + if (info_type == 2) { // Is this a string or not? + + col_append_fstr(pinfo->cinfo, COL_INFO, + (gchar*) ncp_rec->req_info_str->repeat_string, + fvalue_get(finfo->value)); + } + else + { + + col_append_fstr(pinfo->cinfo, COL_INFO, + (gchar*) ncp_rec->req_info_str->repeat_string, + fvalue_get_integer(finfo->value)); + } + } } } @@ -945,14 +4160,44 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree) { conversation_t *conversation; + conversation_t *eid_conversation; ncp_req_hash_value *request_value = NULL; + ncp_req_eid_hash_value *request_eid_value = NULL; const ncp_record *ncp_rec = NULL; + const ncp_record *ncp_eid_rec = NULL; int *req_cond_results; - guint8 completion_code; + guint8 completion_code=0; guint length; ptvcursor_t *ptvc = NULL; const char *error_string; + char *n_string=""; + guint32 nds_string_len = 0; + guint8 ping_version = 0; + guint32 nds_flags = 0; + guint32 nds_offset = 0; + nw_uni_t reply_buffer; + char * verb_string=""; + guint32 nds_error_code = 0; + guint32 nds_error_offset = 0; + guint32 nds_reply_buffer = 0; + char * nds_error_string = NULL; + guint32 nds_frag=0; + nds_val p1values; + nds_val p2values; + nds_val p3values; + nds_val p4values; + nds_val p5values; + nds_val p6values; + nds_val p7values; + nds_val p8values; + nds_val p9values; + gboolean resolve_eid=FALSE; + guint32 global_eid=0; + gboolean add_eid = FALSE; + char *global_object_name='\0'; + + reply_buffer.buffer = "\0"; if (!pinfo->fd->flags.visited) { /* Find the conversation whence the request would have come. */ conversation = find_conversation(&pinfo->src, &pinfo->dst, @@ -989,9 +4234,41 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo, else { error_string = "Not OK"; } + if (ncp_rec && ncp_rec->func==0x68 && ncp_rec->subfunc==0x02) + { + nds_offset = 8; + nds_reply_buffer = tvb_get_letohl(tvb, nds_offset); + nds_frag = tvb_get_letohl(tvb, 12); + if (nds_reply_buffer > 7) + { + nds_offset = 16; + nds_error_code = tvb_get_letohl(tvb, nds_offset); + error_string = match_strval(nds_error_code, nds_reply_errors); + if (error_string == NULL) + { + nds_offset = 19; + nds_error_code = tvb_get_letohl(tvb, nds_offset); + error_string = match_strval(nds_error_code, nds_reply_errors); + } + if (error_string == NULL || nds_error_code == 0x00000000) + { + if (nds_frag != 0xffffffff) + { + error_string = "NDS Fragment"; + } + else + { + error_string = "Ok"; + } + } + } + } if (check_col(pinfo->cinfo, COL_INFO)) { - if (ncp_rec && ncp_rec->func==0x68 && ncp_rec->subfunc==0x02){ + if (ncp_rec && ncp_rec->func==0x68 && ncp_rec->subfunc==0x02) { + col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDS"); + } + if (ncp_rec && ncp_rec->func==0x68 && ncp_rec->subfunc==0x01) { col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDS"); } col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s", @@ -1027,7 +4304,1230 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo, completion_code, completion_code, error_string); proto_tree_add_item(ncp_tree, hf_ncp_connection_status, tvb, 7, 1, FALSE); - + /* Decode NDS Reply packets */ + if (ncp_rec) { + if (ncp_rec->func == 0x68 && ncp_rec->subfunc == 0x01) { + ping_version = tvb_get_guint8(tvb, 8); + proto_tree_add_item(ncp_tree, hf_ping_version, tvb, 8, 1, TRUE); + if (ping_version == 9) { + nds_string_len = tvb_get_ntohl(tvb, 9); + nds_offset = nds_string_len+16; + proto_tree_add_item(ncp_tree, hf_nds_string, tvb, 16, nds_string_len, FALSE); + proto_tree_add_item(ncp_tree, hf_nds_reply_depth, tvb, nds_offset, 4, FALSE); + proto_tree_add_item(ncp_tree, hf_nds_reply_rev, tvb, (nds_offset+4), 4, FALSE); + proto_tree_add_item(ncp_tree, hf_nds_reply_flags, tvb, (nds_offset+8), 4, TRUE); + } + else { + nds_offset = 12; + nds_flags = request_value->req_nds_flags; + if (nds_flags & 0x00200000) { + nds_offset = nds_offset+4; + } + if (nds_flags & 0x00000002) { + proto_tree_add_item(ncp_tree, hf_nds_reply_depth, tvb, nds_offset, 4, TRUE); + nds_offset = nds_offset+4; + } + if (nds_flags & 0x00000004) { + proto_tree_add_item(ncp_tree, hf_nds_reply_rev, tvb, nds_offset, 4, TRUE); + nds_offset = nds_offset+4; + } + if (nds_flags & 0x00000008) { + proto_tree_add_item(ncp_tree, hf_nds_reply_flags, tvb, nds_offset, 4, TRUE); + nds_offset = nds_offset+4; + } + if (nds_flags & 0x00020000) { + nds_string_len = tvb_get_letohl(tvb, nds_offset); + get_string(tvb, nds_offset+4, nds_string_len, reply_buffer.buffer); + /*nds_string_len = strlen(reply_buffer.buffer);*/ + proto_tree_add_text(ncp_tree, tvb, nds_offset+4, nds_string_len, "NDS Tree Name: %s", reply_buffer.buffer); + } + } + } + if (ncp_rec->func == 0x68 && ncp_rec->subfunc == 0x02) + { + nds_offset = 8; + + nds_reply_buffer = tvb_get_letohl(tvb, nds_offset); + proto_tree_add_uint_format(ncp_tree, hf_ncp_fragment_size, tvb, 8, + 4, nds_reply_buffer, "NDS Fragment Size %d", + nds_reply_buffer); + nds_frag = tvb_get_letohl(tvb, 12); + proto_tree_add_uint_format(ncp_tree, hf_ncp_fragment_handle, tvb, 12, + 4, nds_frag, "NDS Fragment Handle 0x%08x", + nds_frag); + if (nds_reply_buffer > 7) + { + nds_offset = 16; + nds_error_code = tvb_get_letohl(tvb, nds_offset); + nds_error_string = match_strval(nds_error_code, nds_reply_errors); + if (nds_error_string == NULL) + { + nds_offset = 19; + nds_error_code = tvb_get_letohl(tvb, nds_offset); + error_string = match_strval(nds_error_code, nds_reply_errors); + } + if (nds_error_string == NULL || nds_error_code == 0x00000000) + { + if (nds_frag != 0xffffffff) + { + nds_error_string = "NDS Fragment"; + } + else + { + nds_error_string = "Ok"; + } + nds_error_code = 0x00000000; + } + 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 (request_value && nds_error_code == 0x00000000 && nds_frag == 0xffffffff) + { + nds_offset = 20; + p1values.vtype = 0; + p2values.vtype = 0; + p3values.vtype = 0; + p4values.vtype = 0; + p5values.vtype = 0; + p6values.vtype = 0; + p7values.vtype = 0; + p8values.vtype = 0; + p9values.vtype = 0; + p1values.vvalue = 0; + p2values.vvalue = 0; + p3values.vvalue = 0; + p4values.vvalue = 0; + p5values.vvalue = 0; + p6values.vvalue = 0; + p7values.vvalue = 0; + p8values.vvalue = 0; + p9values.vvalue = 0; + p1values.vlength = 0; + p2values.vlength = 0; + p3values.vlength = 0; + p4values.vlength = 0; + p5values.vlength = 0; + p6values.vlength = 0; + p7values.vlength = 0; + p8values.vlength = 0; + p9values.vlength = 0; + p1values.voffset = 0; + p2values.voffset = 0; + p3values.voffset = 0; + p4values.voffset = 0; + p5values.voffset = 0; + p6values.voffset = 0; + p7values.voffset = 0; + p8values.voffset = 0; + p9values.voffset = 0; + p1values.hfname = 0; + p2values.hfname = 0; + p3values.hfname = 0; + p4values.hfname = 0; + p5values.hfname = 0; + p6values.hfname = 0; + p7values.hfname = 0; + p8values.hfname = 0; + p9values.hfname = 0; + p1values.vdesc = ""; + p2values.vdesc = ""; + p3values.vdesc = ""; + p4values.vdesc = ""; + p5values.vdesc = ""; + p6values.vdesc = ""; + p7values.vdesc = ""; + p8values.vdesc = ""; + p9values.vdesc = ""; + p1values.vstring = ""; + p2values.vstring = ""; + p3values.vstring = ""; + p4values.vstring = ""; + p5values.vstring = ""; + p6values.vstring = ""; + p7values.vstring = ""; + p8values.vstring = ""; + p9values.vstring = ""; + switch (request_value->nds_request_verb) + { + case 0x01: + verb_string = "Resolve Name"; + if(request_value->nds_version == 0) + { + p1values.vvalue = tvb_get_letohl(tvb, nds_offset); + p1values.vstring = match_strval(p1values.vvalue, nds_tags); + if(p1values.vstring == NULL) + { + p1values.vstring = "No Tags Set"; + } + p1values.vtype = 4; /* String */ + p1values.vdesc = "Tag: %s"; + p1values.vlength = 4; + p1values.voffset = nds_offset; + p1values.hfname = hf_nds_tag_string; + nds_offset = nds_offset+p1values.vlength; + switch(p1values.vvalue) + { + case 0: /* No Such Entry */ + break; + case 1: /* Local Entry */ + p2values.vvalue = tvb_get_letohl(tvb, nds_offset); + p2values.vstring = ""; + p2values.vtype = 3; /* Uint32 */ + p2values.vdesc = "Entry ID: 0x%08x"; + add_eid = TRUE; + global_object_name = request_value->object_name; + global_eid = p2values.vvalue; + p2values.vlength = 4; + p2values.voffset = nds_offset; + p2values.hfname = hf_nds_eid; + nds_offset = nds_offset+p2values.vlength; + p3values.vvalue = tvb_get_letohl(tvb, nds_offset); + p3values.vtype = 6; /* Multivalue Uint32 */ + p3values.vstring = ""; + p3values.vdesc = "Referal Records: %d"; + p3values.vlength = 4; + p3values.voffset = nds_offset; + p3values.hfname = hf_nds_referals; + p3values.mvtype = 9; + break; + case 2: /* Remote Entry */ + nds_offset += 4; /* GUINT32 reserved field */ + p2values.vvalue = tvb_get_letohl(tvb, nds_offset); + p2values.vstring = ""; + p2values.vtype = 3; /* Uint32 */ + p2values.vdesc = "Entry ID: 0x%08x"; + add_eid = TRUE; + global_eid = p2values.vvalue; + global_object_name = request_value->object_name; + p2values.vlength = 4; + p2values.voffset = nds_offset; + p2values.hfname = hf_nds_eid; + nds_offset = nds_offset+p2values.vlength; + p3values.vvalue = tvb_get_letohl(tvb, nds_offset); + p3values.vtype = 6; /* Multivalue Uint32 */ + p3values.vstring = ""; + p3values.vdesc = "Referal Records: %d"; + p3values.vlength = 4; + p3values.voffset = nds_offset; + p3values.hfname = hf_nds_referals; + p3values.mvtype = 9; + break; + case 3: /* Alias Entry */ + p2values.vtype = 4; /* String */ + p2values.vdesc = "Alias Name: %s"; + p2values.vstring = ""; + p2values.mvtype = 1; + p2values.vvalue = 0; + p2values.vlength = 256; + p2values.vlength = tvb_get_letohl(tvb, nds_offset); + if (p2values.vlength == 0x00) + { + p2values.vtype = 0; + break; + } + p2values.voffset = nds_offset+4; + nds_offset += 4; + get_string(tvb, p2values.voffset, p2values.vlength, p2values.vstring); + nds_offset += p2values.vlength; + nds_offset += align_4(tvb, nds_offset); + p2values.hfname= hf_nds_name; + break; + case 4: /* Referral Information */ + p2values.vvalue = tvb_get_letohl(tvb, nds_offset); + p2values.vstring = ""; + p2values.vtype = 3; /* Uint32 */ + p2values.vdesc = "Distance Object is From Root: 0x%08x"; + p2values.vlength = 4; + p2values.voffset = nds_offset; + p2values.hfname = hf_nds_eid; + nds_offset = nds_offset+p2values.vlength; + p3values.vvalue = tvb_get_letohl(tvb, nds_offset); + p3values.vtype = 6; /* Multivalue Uint32 */ + p3values.vstring = ""; + p3values.vdesc = "Referal Records: %d"; + p3values.vlength = 4; + p3values.voffset = nds_offset; + p3values.hfname = hf_nds_depth; + p3values.mvtype = 9; + break; + case 6: /* Entry and Referrals */ + p2values.vvalue = tvb_get_letohl(tvb, nds_offset); + p2values.vstring = ""; + p2values.vtype = 3; /* Uint32 */ + p2values.vdesc = "Result Flags: 0x%08x"; + p2values.vlength = 4; + p2values.voffset = nds_offset; + p2values.hfname = hf_nds_result_flags; + nds_offset = nds_offset+p2values.vlength; + p3values.vvalue = tvb_get_letohl(tvb, nds_offset); + p3values.vstring = ""; + p3values.vtype = 3; /* Uint32 */ + p3values.vdesc = "Entry ID: 0x%08x"; + add_eid = TRUE; + global_eid = p3values.vvalue; + global_object_name = request_value->object_name; + p3values.vlength = 4; + p3values.voffset = nds_offset; + p3values.hfname = hf_nds_eid; + nds_offset = nds_offset+p3values.vlength; + p4values.vvalue = tvb_get_letohl(tvb, nds_offset); + p4values.vtype = 6; /* Multivalue Uint32 */ + p4values.vstring = ""; + p4values.vdesc = "Referal Records: %d"; + p4values.vlength = 4; + p4values.voffset = nds_offset; + p4values.mvtype = 8; + p4values.hfname = hf_nds_referals; + break; + default: + break; + } + } + else + { + p1values.vvalue = tvb_get_letohl(tvb, nds_offset); + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "CRC: 0x%08x"; + p1values.vlength = 4; + p1values.voffset = nds_offset; + p1values.hfname = hf_nds_crc; + nds_offset = nds_offset+p1values.vlength; + p2values.vvalue = tvb_get_letohl(tvb, nds_offset); + p2values.vstring = match_strval(p2values.vvalue, nds_tags); + if(p2values.vstring == NULL) + { + p2values.vstring = "No Tags Set"; + } + p2values.vtype = 4; /* String */ + p2values.vdesc = "Tag: %s"; + p2values.vlength = 4; + p2values.voffset = nds_offset; + nds_offset = nds_offset+p2values.vlength; + p2values.hfname = hf_nds_tag_string; + switch(p2values.vvalue) + { + case 0: /* No Such Entry */ + break; + case 1: /* Local Entry */ + p3values.vvalue = tvb_get_letohl(tvb, nds_offset); + p3values.vstring = ""; + p3values.vtype = 3; /* Uint32 */ + p3values.vdesc = "Entry ID: 0x%08x"; + add_eid = TRUE; + global_eid = p3values.vvalue; + global_object_name = request_value->object_name; + p3values.vlength = 4; + p3values.voffset = nds_offset; + p3values.hfname = hf_nds_eid; + nds_offset = nds_offset+p3values.vlength; + p4values.vvalue = tvb_get_letohl(tvb, nds_offset); + p4values.vtype = 6; /* Multivalue Uint32 */ + p4values.vstring = ""; + p4values.vdesc = "Referal Records: %d"; + p4values.vlength = 4; + p4values.voffset = nds_offset; + p4values.hfname = hf_nds_referals; + p4values.mvtype = 9; + break; + case 2: /* Remote Entry */ + nds_offset += 4; /* GUINT32 reserved field */ + p3values.vvalue = tvb_get_letohl(tvb, nds_offset); + p3values.vstring = ""; + add_eid = TRUE; + global_eid = p3values.vvalue; + global_object_name = request_value->object_name; + p3values.vtype = 3; /* Uint32 */ + p3values.vdesc = "Entry ID: 0x%08x"; + p3values.vlength = 4; + p3values.voffset = nds_offset; + p3values.hfname = hf_nds_eid; + nds_offset = nds_offset+p3values.vlength; + p4values.vvalue = tvb_get_letohl(tvb, nds_offset); + p4values.vtype = 6; /* Multivalue Uint32 */ + p4values.vstring = ""; + p4values.vdesc = "Referal Records: %d"; + p4values.vlength = 4; + p4values.voffset = nds_offset; + p4values.hfname = hf_nds_referals; + p4values.mvtype = 9; + break; + case 3: /* Alias Entry */ + p3values.vtype = 4; /* String */ + p3values.vdesc = "Alias Name: %s"; + p3values.vstring = ""; + p3values.mvtype = 1; + p3values.vvalue = 0; + p3values.vlength = 256; + p3values.vlength = tvb_get_letohl(tvb, nds_offset); + if (p3values.vlength == 0x00) + { + p3values.vtype = 0; + break; + } + p3values.voffset = nds_offset+4; + nds_offset += 4; + get_string(tvb, p3values.voffset, p3values.vlength, p3values.vstring); + nds_offset += p3values.vlength; + nds_offset += align_4(tvb, nds_offset); + p3values.hfname= hf_nds_name; + break; + case 4: /* Referral Information */ + p3values.vvalue = tvb_get_letohl(tvb, nds_offset); + p3values.vstring = ""; + p3values.vtype = 3; /* Uint32 */ + p3values.vdesc = "Distance Object is From Root: 0x%08x"; + p3values.vlength = 4; + p3values.voffset = nds_offset; + p3values.hfname = hf_nds_eid; + nds_offset = nds_offset+p3values.vlength; + p4values.vvalue = tvb_get_letohl(tvb, nds_offset); + p4values.vtype = 6; /* Multivalue Uint32 */ + p4values.vstring = ""; + p4values.vdesc = "Referal Records: %d"; + p4values.vlength = 4; + p4values.voffset = nds_offset; + p4values.hfname = hf_nds_depth; + p4values.mvtype = 8; + break; + case 6: /* Entry and Referrals */ + p3values.vvalue = tvb_get_letohl(tvb, nds_offset); + p3values.vstring = ""; + p3values.vtype = 3; /* Uint32 */ + p3values.vdesc = "Result Flags: 0x%08x"; + p3values.vlength = 4; + p3values.voffset = nds_offset; + p3values.hfname = hf_nds_result_flags; + nds_offset = nds_offset+p3values.vlength; + p4values.vvalue = tvb_get_letohl(tvb, nds_offset); + p4values.vstring = ""; + p4values.vtype = 3; /* Uint32 */ + p4values.vdesc = "Entry ID: 0x%08x"; + add_eid = TRUE; + global_object_name = request_value->object_name; + global_eid = p4values.vvalue; + p4values.vlength = 4; + p4values.voffset = nds_offset; + p4values.hfname = hf_nds_eid; + nds_offset = nds_offset+p4values.vlength; + p5values.vvalue = tvb_get_letohl(tvb, nds_offset); + p5values.vtype = 6; /* Multivalue Uint32 */ + p5values.vstring = ""; + p5values.vdesc = "Referal Records: %d"; + p5values.vlength = 4; + p5values.voffset = nds_offset; + p5values.mvtype = 8; + p5values.hfname = hf_nds_referals; + break; + default: + break; + } + + } + break; + case 0x02: + verb_string = "Read Entry Information"; + if(request_value->nds_version != 0x000000fe) + { + p1values.vvalue = 1; + p1values.vtype = 6; /* Multivalue Uint32 */ + p1values.vstring = ""; + p1values.vdesc = "Entry Information"; + p1values.vlength = 0; + p1values.voffset = nds_offset-4; + p1values.hfname = hf_nds_name; + p1values.mvtype = 12; + p1values.vflags = request_value->req_nds_flags; + } + else + { + p1values.vvalue = tvb_get_letohl(tvb, nds_offset); + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "CRC: 0x%08x"; + p1values.vlength = 4; + p1values.voffset = nds_offset; + p1values.hfname = hf_nds_crc; + nds_offset = nds_offset+p1values.vlength; + p2values.vvalue = 1; + p2values.vtype = 6; /* Multivalue Uint32 */ + p2values.vstring = ""; + p2values.vdesc = "Entry Information"; + p2values.vlength = 0; + p2values.voffset = nds_offset-4; + p2values.hfname = hf_nds_name; + p2values.mvtype = 12; + p2values.vflags = request_value->req_nds_flags; + } + break; + case 0x03: + verb_string = "Read"; + if(request_value->nds_version != 0x000000fe) + { + p1values.vvalue = tvb_get_letohl(tvb, nds_offset); + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Iteration Handle: 0x%08x"; + p1values.vlength = 4; + p1values.voffset = nds_offset; + p1values.hfname = hf_nds_iteration; + nds_offset = nds_offset+p1values.vlength; + p2values.vvalue = tvb_get_letohl(tvb, nds_offset); + p2values.vstring = match_strval(p2values.vvalue, nds_info_type); + if(p2values.vstring == NULL) + { + p2values.vstring = "No Info Type Set"; + } + p2values.vtype = 4; /* String */ + p2values.vdesc = "Info Type: %s"; + p2values.vlength = 4; + p2values.voffset = nds_offset; + p2values.hfname = hf_nds_info_type; + nds_offset = nds_offset+p2values.vlength; + p3values.vvalue = tvb_get_letohl(tvb, nds_offset); + p3values.vtype = 6; /* Multivalue Uint32 */ + p3values.vstring = ""; + p3values.vdesc = "Number of Attributes: %d"; + p3values.vlength = 4; + p3values.voffset = nds_offset; + p3values.hfname = hf_nds_attr; + p3values.mvtype = 2; + p3values.vflags = request_value->req_nds_flags; + } + else + { + p1values.vvalue = tvb_get_letohl(tvb, nds_offset); + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "CRC: 0x%08x"; + p1values.vlength = 4; + p1values.voffset = nds_offset; + p1values.hfname = hf_nds_crc; + nds_offset = nds_offset+p1values.vlength; + p2values.vvalue = tvb_get_letohl(tvb, nds_offset); + p2values.vstring = ""; + p2values.vtype = 3; /* Uint32 */ + p2values.vdesc = "Iteration Handle: 0x%08x"; + p2values.vlength = 4; + p2values.voffset = nds_offset; + p2values.hfname = hf_nds_iteration; + nds_offset = nds_offset+p2values.vlength; + p3values.vvalue = tvb_get_letohl(tvb, nds_offset); + p3values.vstring = match_strval(p3values.vvalue, nds_info_type); + if(p3values.vstring == NULL) + { + p3values.vstring = "No Info Type Set"; + } + p3values.vtype = 4; /* String */ + p3values.vdesc = "Info Type: %s"; + p3values.vlength = 4; + p3values.voffset = nds_offset; + p3values.hfname = hf_nds_info_type; + nds_offset = nds_offset+p3values.vlength; + p4values.vvalue = tvb_get_letohl(tvb, nds_offset); + p4values.vtype = 6; /* Multivalue Uint32 */ + p4values.vstring = ""; + p4values.vdesc = "Number of Attributes: %d"; + p4values.vlength = 4; + p4values.voffset = nds_offset; + p4values.hfname = hf_nds_attr; + p4values.mvtype = 2; + p4values.vflags = request_value->req_nds_flags; + } + break; + case 0x04: + verb_string = "Compare"; + p1values.vvalue = tvb_get_letohl(tvb, nds_offset); + if (p1values.vvalue == 0x00000000) + { + p1values.vstring = "Did Not Match"; + } + else + { + p1values.vstring = "Matched"; + } + p1values.vtype = 4; /* String */ + p1values.vdesc = "Compare Values Returned - %s"; + p1values.vlength = 4; + p1values.voffset = nds_offset; + p1values.mvtype = 0; + p1values.hfname= hf_nds_compare_results; + nds_offset += p1values.vlength; + break; + case 0x05: + verb_string = "List"; + p1values.vvalue = tvb_get_letohl(tvb, nds_offset); + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Iteration Handle: 0x%08x"; + p1values.vlength = 4; + p1values.voffset = nds_offset; + p1values.hfname = hf_nds_iteration; + nds_offset = nds_offset+p1values.vlength; + p2values.vvalue = tvb_get_letohl(tvb, nds_offset);; + p2values.vtype = 6; /* Multivalue Uint32 */ + p2values.vstring = ""; + p2values.vdesc = "Entry Information"; + p2values.vlength = 0; + p2values.voffset = nds_offset; + p2values.hfname = hf_nds_name; + p2values.mvtype = 12; + p2values.vflags = request_value->req_nds_flags; + break; + case 0x06: + verb_string = "Search Entries"; + break; + case 0x07: + verb_string = "Add Entry"; + break; + case 0x08: + verb_string = "Remove Entry"; + break; + case 0x09: + verb_string = "Modify Entry"; + break; + case 0x0a: + verb_string = "Modify RDN"; + break; + case 0x0b: + verb_string = "Define Attribute"; + break; + case 0x0c: + verb_string = "Read Attribute Definition"; + break; + case 0x0d: + verb_string = "Remove Attribute Definition"; + break; + case 0x0e: + verb_string = "Define Class"; + break; + case 0x0f: + verb_string = "Read Class Definition"; + p1values.vvalue = tvb_get_letohl(tvb, nds_offset); + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Iteration Handle: 0x%08x"; + p1values.vlength = 4; + p1values.voffset = nds_offset; + p1values.hfname = hf_nds_iteration; + nds_offset = nds_offset+p1values.vlength; + p2values.vvalue = tvb_get_letohl(tvb, nds_offset); + p2values.vstring = match_strval(p2values.vvalue, class_def_type); + if(p2values.vstring == NULL) + { + p2values.vstring = "No Class Definition Type Set"; + } + p2values.vtype = 4; /* String */ + p2values.vdesc = "Class Definition Type: %s"; + p2values.vlength = 4; + p2values.voffset = nds_offset; + p2values.mvtype = 0; + p2values.hfname= hf_nds_class_def_type; + nds_offset = nds_offset + p2values.vlength; + p3values.vvalue = tvb_get_letohl(tvb, nds_offset);; + p3values.vtype = 6; /* Multivalue Uint32 */ + p3values.vstring = ""; + p3values.vdesc = "Class Definitions %d"; + p3values.vlength = 0; + p3values.voffset = nds_offset; + p3values.hfname = hf_nds_classes; + p3values.mvtype = 13; + p3values.vflags = request_value->req_nds_flags; + break; + case 0x10: + verb_string = "Modify Class Definition"; + break; + case 0x11: + verb_string = "Remove Class Definition"; + break; + case 0x12: + verb_string = "List Containable Classes"; + p1values.vvalue = tvb_get_letohl(tvb, nds_offset); + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Iteration Handle: 0x%08x"; + p1values.vlength = 4; + p1values.voffset = nds_offset; + p1values.hfname = hf_nds_iteration; + nds_offset = nds_offset+p1values.vlength; + p2values.vvalue = tvb_get_letohl(tvb, nds_offset); + p2values.vtype = 6; /* Multivalue Uint32 */ + p2values.vstring = ""; + p2values.vdesc = "Classes: %d"; + p2values.vlength = 4; + p2values.voffset = nds_offset; + p2values.mvtype = 4; + p2values.hfname= hf_nds_classes; + break; + case 0x13: + p1values.vvalue = tvb_get_letohl(tvb, nds_offset); + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Privileges: 0x%08x"; + p1values.vlength = 4; + p1values.voffset = nds_offset; + p1values.hfname = hf_nds_privileges; + nds_offset = nds_offset+p1values.vlength; + break; + case 0x14: + verb_string = "Add Partition"; + break; + case 0x15: + verb_string = "Remove Partition"; + break; + case 0x16: + verb_string = "List Partitions"; + p1values.vvalue = tvb_get_letohl(tvb, nds_offset); + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Iteration Handle: 0x%08x"; + p1values.vlength = 4; + p1values.voffset = nds_offset; + p1values.hfname = hf_nds_iteration; + nds_offset = nds_offset+p1values.vlength; + p2values.vtype = 4; /* String */ + p2values.vdesc = "Server Distinguished Name: %s"; + p2values.vstring = ""; + p2values.mvtype = 1; + p2values.vvalue = 0; + p2values.vlength = 256; + p2values.vlength = tvb_get_letohl(tvb, nds_offset); + if (p2values.vlength == 0x00) + { + p2values.vtype = 0; + break; + } + p2values.voffset = nds_offset+4; + nds_offset += 4; + get_string(tvb, p2values.voffset, p2values.vlength, p2values.vstring); + nds_offset += p2values.vlength; + nds_offset += align_4(tvb, nds_offset); + p2values.hfname= hf_nds_name; + nds_offset += align_4(tvb, nds_offset); + p3values.vvalue = tvb_get_letohl(tvb, nds_offset); + p3values.vtype = 6; /* Multivalue Uint32 */ + p3values.vstring = ""; + p3values.vdesc = "Replicas: %d"; + p3values.vlength = 4; + p3values.voffset = nds_offset; + p3values.hfname = hf_nds_replicas; + p3values.mvtype = 5; + p3values.bit1 = "Output Flags"; + p3values.bit2 = "Entry ID"; + p3values.bit3 = "Replica State"; + p3values.bit4 = "Modification Timestamp"; + p3values.bit5 = "Purge Time"; + p3values.bit6 = "Local Partition ID"; + p3values.bit7 = "Distinguished Name"; + p3values.bit8 = "Replica Type"; + p3values.bit9 = "Partition Busy"; + p3values.vflags = request_value->req_nds_flags; + break; + case 0x17: + verb_string = "Split Partition"; + break; + case 0x18: + verb_string = "Join Partitions"; + break; + case 0x19: + verb_string = "Add Replica"; + break; + case 0x1a: + verb_string = "Remove Replica"; + break; + case 0x1b: + verb_string = "Open Stream"; + p1values.vvalue = tvb_get_ntohl(tvb, nds_offset); + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "File Handle: 0x%08x"; + p1values.vlength = 4; + p1values.voffset = nds_offset; + p1values.hfname = hf_nds_file_handle; + nds_offset = nds_offset+p1values.vlength; + p2values.vvalue = tvb_get_letohl(tvb, nds_offset); + p2values.vstring = ""; + p2values.vtype = 3; /* Uint32 */ + p2values.vdesc = "File Size: %d"; + p2values.vlength = 4; + p2values.voffset = nds_offset; + p2values.hfname = hf_nds_file_size; + nds_offset = nds_offset+p2values.vlength; + break; + case 0x1c: + verb_string = "Search Filter"; + break; + case 0x1d: + verb_string = "Create Subordinate Reference"; + break; + case 0x1e: + verb_string = "Link Replica"; + break; + case 0x1f: + verb_string = "Change Replica Type"; + break; + case 0x20: + verb_string = "Start Update Schema"; + break; + case 0x21: + verb_string = "End Update Schema"; + break; + case 0x22: + verb_string = "Update Schema"; + break; + case 0x23: + verb_string = "Start Update Replica"; + break; + case 0x24: + verb_string = "End Update Replica"; + break; + case 0x25: + verb_string = "Update Replica"; + break; + case 0x26: + verb_string = "Synchronize Partition"; + break; + case 0x27: + verb_string = "Synchronize Schema"; + break; + case 0x28: + verb_string = "Read Syntaxes"; + break; + case 0x29: + verb_string = "Get Replica Root ID"; + break; + case 0x2a: + verb_string = "Begin Move Entry"; + break; + case 0x2b: + verb_string = "Finish Move Entry"; + break; + case 0x2c: + verb_string = "Release Moved Entry"; + break; + case 0x2d: + verb_string = "Backup Entry"; + break; + case 0x2e: + verb_string = "Restore Entry"; + break; + case 0x2f: + verb_string = "Save DIB"; + break; + case 0x30: + verb_string = "Control"; + break; + case 0x31: + verb_string = "Remove Backlink"; + break; + case 0x32: + verb_string = "Close Iteration"; + break; + case 0x33: + verb_string = "Mutate Entry"; + break; + case 0x34: + verb_string = "Audit Skulking"; + break; + case 0x35: + verb_string = "Get Server Address"; + if(request_value->nds_version != 0x000000fe) + { + p1values.vtype = 4; /* String */ + p1values.vdesc = "Distinguished Name: %s"; + p1values.vstring = ""; + p1values.mvtype = 1; + p1values.vvalue = 0; + p1values.vlength = 256; + p1values.vlength = tvb_get_letohl(tvb, nds_offset); + if (p1values.vlength == 0x00) + { + p1values.vtype = 0; + break; + } + p1values.voffset = nds_offset+4; + nds_offset += 4; + get_string(tvb, p1values.voffset, p1values.vlength, p1values.vstring); + nds_offset += p1values.vlength; + nds_offset += align_4(tvb, nds_offset); + p1values.hfname= hf_nds_name; + p2values.vvalue = tvb_get_letohl(tvb, nds_offset); + p2values.vtype = 6; /* Multivalue Uint32 */ + p2values.vstring = ""; + p2values.vdesc = "Referal Records: %d"; + p2values.vlength = 4; + p2values.voffset = nds_offset; + p2values.hfname = hf_nds_referals; + p2values.mvtype = 9; + } + else + { + p1values.vvalue = tvb_get_letohl(tvb, nds_offset); + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Iteration Handle: 0x%08x"; + p1values.vlength = 4; + p1values.voffset = nds_offset; + p1values.hfname = hf_nds_iteration; + nds_offset = nds_offset+p1values.vlength; + p2values.vtype = 4; /* String */ + p2values.vdesc = "Distinguished Name: %s"; + p2values.vstring = ""; + p2values.mvtype = 1; + p2values.vvalue = 0; + p2values.vlength = 256; + p2values.vlength = tvb_get_letohl(tvb, nds_offset); + if (p2values.vlength == 0x00) + { + p2values.vtype = 0; + break; + } + p2values.voffset = nds_offset+4; + nds_offset += 4; + get_string(tvb, p2values.voffset, p2values.vlength, p2values.vstring); + nds_offset += p2values.vlength; + nds_offset += align_4(tvb, nds_offset); + p2values.hfname= hf_nds_name; + p3values.vvalue = tvb_get_letohl(tvb, nds_offset); + p3values.vtype = 6; /* Multivalue Uint32 */ + p3values.vstring = ""; + p3values.vdesc = "Referal Records: %d"; + p3values.vlength = 4; + p3values.voffset = nds_offset; + p3values.hfname = hf_nds_referals; + p3values.mvtype = 9; + } + break; + case 0x36: + verb_string = "Set Keys"; + break; + case 0x37: + verb_string = "Change Password"; + break; + case 0x38: + verb_string = "Verify Password"; + break; + case 0x39: + verb_string = "Begin Login"; + break; + case 0x3a: + verb_string = "Finish Login"; + break; + case 0x3b: + verb_string = "Begin Authentication"; + break; + case 0x3c: + verb_string = "Finish Authentication"; + break; + case 0x3d: + verb_string = "Logout"; + break; + case 0x3e: + verb_string = "Repair Ring"; + break; + case 0x3f: + verb_string = "Repair Timestamps"; + break; + case 0x40: + verb_string = "Create Back Link"; + break; + case 0x41: + verb_string = "Delete External Reference"; + break; + case 0x42: + verb_string = "Rename External Reference"; + break; + case 0x43: + verb_string = "Create Directory Entry"; + break; + case 0x44: + verb_string = "Remove Directory Entry"; + break; + case 0x45: + verb_string = "Designate New Master"; + break; + case 0x46: + verb_string = "Change Tree Name"; + break; + case 0x47: + verb_string = "Partition Entry Count"; + break; + case 0x48: + verb_string = "Check Login Restrictions"; + break; + case 0x49: + verb_string = "Start Join"; + break; + case 0x4a: + verb_string = "Low Level Split"; + break; + case 0x4b: + verb_string = "Low Level Join"; + break; + case 0x4c: + verb_string = "Abort Low Level Join"; + break; + case 0x4d: + verb_string = "Get All Servers"; + break; + default: + verb_string = "NDS Continuation Fragment"; + break; + } + if(request_value->nds_request_verb != NULL) + { + proto_tree_add_uint_format(ncp_tree, hf_ncp_nds_verb, tvb, 6, 0, + request_value->nds_request_verb, "NDS Verb: %d, %s", + request_value->nds_request_verb, verb_string); + } + /* NDS Entry ID's (EID) is identified in the reply packet of an NDS + * resolve name. We need to store this EID and it's associated + * name into our hash so that we can resolve the name for + * other NDS requests. */ + if (!pinfo->fd->flags.visited) { + if(add_eid) + { + request_eid_value = ncp_eid_hash_lookup(conversation, global_eid); + if (!request_eid_value) { + request_eid_value = ncp_eid_hash_insert(conversation, global_eid, ncp_rec); + strcpy(request_eid_value->object_name, global_object_name); + } + } + } + /* For NDS requests with just an EID, resolve name from hash table. */ + if(resolve_eid) + { + request_eid_value = ncp_eid_hash_lookup(conversation, global_eid); + if (request_eid_value) { + global_object_name = request_eid_value->object_name; + proto_tree_add_string_format(ncp_tree, hf_nds_name, tvb, 6, 0, + global_object_name, "NDS Name for EID - %s", + global_object_name); + } + } + if (p1values.vtype != 0) { + switch (p1values.vtype) { + case 1: /* uint8 */ + proto_tree_add_uint_format(ncp_tree, p1values.hfname, tvb, p1values.voffset, + p1values.vlength, p1values.vtype, "NDS Parameter not defined %d", + p1values.vtype); + break; + case 2: /* uint16 */ + proto_tree_add_uint_format(ncp_tree, p1values.hfname, tvb, p1values.voffset, + p1values.vlength, p1values.vtype, "NDS Parameter not defined %d", + p1values.vtype); + break; + case 3: /* uint32 */ + proto_tree_add_uint_format(ncp_tree, p1values.hfname, tvb, p1values.voffset, + p1values.vlength, p1values.vvalue, p1values.vdesc, + p1values.vvalue); + break; + case 4: /* string */ + proto_tree_add_string_format(ncp_tree, p1values.hfname, tvb, p1values.voffset, + p1values.vlength, p1values.vdesc, p1values.vstring); + break; + case 5: /* boolean */ + process_bitfield(ncp_tree, tvb, &p1values); + break; + case 6: /*multivalue uint32 */ + process_multivalues(ncp_tree, tvb, &p1values); + break; + default: + proto_tree_add_uint_format(ncp_tree, hf_nds_p1type, tvb, p1values.voffset, + p1values.vlength, p1values.vtype, "NDS Parameter not defined %d", + p1values.vtype); + break; + } + switch (p2values.vtype) { + case 1: /* uint8 */ + break; + case 2: /* uint16 */ + break; + case 3: /* uint32 */ + proto_tree_add_uint_format(ncp_tree, p2values.hfname, tvb, p2values.voffset, + p2values.vlength, p2values.vvalue, p2values.vdesc, + p2values.vvalue); + break; + case 4: /* string */ + proto_tree_add_string_format(ncp_tree, p2values.hfname, tvb, p2values.voffset, + p2values.vlength, p2values.vdesc, p2values.vstring); + break; + case 5: /* boolean */ + process_bitfield(ncp_tree, tvb, &p2values); + break; + case 6: /*multivalue uint32 */ + process_multivalues(ncp_tree, tvb, &p2values); + break; + default: + break; + } + switch (p3values.vtype) { + case 1: /* uint8 */ + break; + case 2: /* uint16 */ + break; + case 3: /* uint32 */ + proto_tree_add_uint_format(ncp_tree, p3values.hfname, tvb, p3values.voffset, + p3values.vlength, p3values.vvalue, p3values.vdesc, + p3values.vvalue); + break; + case 4: /* string */ + proto_tree_add_string_format(ncp_tree, p3values.hfname, tvb, p3values.voffset, + p3values.vlength, p3values.vdesc, p3values.vstring); + break; + case 5: /* boolean */ + process_bitfield(ncp_tree, tvb, &p3values); + break; + case 6: /*multivalue uint32 */ + process_multivalues(ncp_tree, tvb, &p3values); + break; + default: + break; + } + switch (p4values.vtype) { + case 1: /* uint8 */ + break; + case 2: /* uint16 */ + break; + case 3: /* uint32 */ + proto_tree_add_uint_format(ncp_tree, p4values.hfname, tvb, p4values.voffset, + p4values.vlength, p4values.vvalue, p4values.vdesc, + p4values.vvalue); + break; + case 4: /* string */ + proto_tree_add_string_format(ncp_tree, p4values.hfname, tvb, p4values.voffset, + p4values.vlength, p4values.vdesc, p4values.vstring); + break; + case 5: /* boolean */ + process_bitfield(ncp_tree, tvb, &p4values); + break; + case 6: /*multivalue uint32 */ + process_multivalues(ncp_tree, tvb, &p4values); + break; + default: + break; + } + switch (p5values.vtype) { + case 1: /* uint8 */ + break; + case 2: /* uint16 */ + break; + case 3: /* uint32 */ + proto_tree_add_uint_format(ncp_tree, p5values.hfname, tvb, p5values.voffset, + p5values.vlength, p5values.vvalue, p5values.vdesc, + p5values.vvalue); + break; + case 4: /* string */ + proto_tree_add_string_format(ncp_tree, p5values.hfname, tvb, p5values.voffset, + p5values.vlength, p5values.vdesc, p5values.vstring); + break; + case 5: /* boolean */ + process_bitfield(ncp_tree, tvb, &p5values); + break; + case 6: /*multivalue uint32 */ + process_multivalues(ncp_tree, tvb, &p5values); + break; + default: + break; + } + switch (p6values.vtype) { + case 1: /* uint8 */ + break; + case 2: /* uint16 */ + break; + case 3: /* uint32 */ + proto_tree_add_uint_format(ncp_tree, p6values.hfname, tvb, p6values.voffset, + p6values.vlength, p6values.vvalue, p6values.vdesc, + p6values.vvalue); + break; + case 4: /* string */ + proto_tree_add_string_format(ncp_tree, p6values.hfname, tvb, p6values.voffset, + p6values.vlength, p6values.vdesc, p6values.vstring); + break; + case 5: /* boolean */ + process_bitfield(ncp_tree, tvb, &p6values); + break; + case 6: /*multivalue uint32 */ + process_multivalues(ncp_tree, tvb, &p6values); + break; + default: + break; + } + switch (p7values.vtype) { + case 1: /* uint8 */ + break; + case 2: /* uint16 */ + break; + case 3: /* uint32 */ + proto_tree_add_uint_format(ncp_tree, p7values.hfname, tvb, p7values.voffset, + p7values.vlength, p7values.vvalue, p7values.vdesc, + p7values.vvalue); + break; + case 4: /* string */ + proto_tree_add_string_format(ncp_tree, p7values.hfname, tvb, p7values.voffset, + p7values.vlength, p7values.vdesc, p7values.vstring); + break; + case 5: /* boolean */ + process_bitfield(ncp_tree, tvb, &p7values); + break; + case 6: /*multivalue uint32 */ + process_multivalues(ncp_tree, tvb, &p7values); + break; + default: + break; + } + switch (p8values.vtype) { + case 1: /* uint8 */ + break; + case 2: /* uint16 */ + break; + case 3: /* uint32 */ + proto_tree_add_uint_format(ncp_tree, p8values.hfname, tvb, p8values.voffset, + p8values.vlength, p8values.vvalue, p8values.vdesc, + p8values.vvalue); + break; + case 4: /* string */ + proto_tree_add_string_format(ncp_tree, p8values.hfname, tvb, p8values.voffset, + p8values.vlength, p8values.vdesc, p8values.vstring); + break; + case 5: /* boolean */ + process_bitfield(ncp_tree, tvb, &p8values); + break; + case 6: /*multivalue uint32 */ + process_multivalues(ncp_tree, tvb, &p8values); + break; + default: + break; + } + switch (p9values.vtype) { + case 1: /* uint8 */ + break; + case 2: /* uint16 */ + break; + case 3: /* uint32 */ + proto_tree_add_uint_format(ncp_tree, p9values.hfname, tvb, p9values.voffset, + p9values.vlength, p9values.vvalue, p9values.vdesc, + p9values.vvalue); + break; + case 4: /* string */ + proto_tree_add_string_format(ncp_tree, p9values.hfname, tvb, p9values.voffset, + p9values.vlength, p9values.vdesc, p9values.vstring); + break; + case 5: /* boolean */ + process_bitfield(ncp_tree, tvb, &p9values); + break; + case 6: /*multivalue uint32 */ + process_multivalues(ncp_tree, tvb, &p9values); + break; + default: + break; + } + } + } + } + } /* * Unless this is a reply, that's all there is to parse. */ @@ -1072,75 +5572,2680 @@ dissect_nds_request(tvbuff_t *tvb, packet_info *pinfo, { guint8 func, subfunc = 0; ncp_req_hash_value *request_value = NULL; - const ncp_record *ncp_rec = NULL; + ncp_req_eid_hash_value *request_eid_value = NULL; + const ncp_record *ncp_rec = NULL; + ncp_req_hash_value *nds_rec = NULL; conversation_t *conversation; + conversation_t *eid_conversation; ptvcursor_t *ptvc = NULL; proto_tree *temp_tree = NULL; guint8 nds_verb = 0; char * verb_string = ""; guint32 nds_frag = 0; + nds_val p1values; + nds_val p2values; + nds_val p3values; + nds_val p4values; + nds_val p5values; + nds_val p6values; + nds_val p7values; + nds_val p8values; + nds_val p9values; + guint32 value1= 0; + guint32 value2= 0; + char * nds_string = ""; + guint8 nds_version = 0; + guint32 foffset = 0; + guint32 nlength = 0; + guint32 nds_reply_buffer; + nw_uni_t req_buffer; + char * global_object_name="\0"; + guint32 global_eid=0; + boolean resolve_eid=FALSE; + guint32 global_flags=0; + + p1values.vtype = 0; + p2values.vtype = 0; + p3values.vtype = 0; + p4values.vtype = 0; + p5values.vtype = 0; + p6values.vtype = 0; + p7values.vtype = 0; + p8values.vtype = 0; + p9values.vtype = 0; + p1values.mvtype = 0; + p2values.mvtype = 0; + p3values.mvtype = 0; + p4values.mvtype = 0; + p5values.mvtype = 0; + p6values.mvtype = 0; + p7values.mvtype = 0; + p8values.mvtype = 0; + p9values.mvtype = 0; + req_buffer.buffer = "\0"; + func = tvb_get_guint8(tvb, 6); + subfunc = tvb_get_guint8(tvb, 7); + + ncp_rec = ncp_record_find(func, subfunc); - func = tvb_get_guint8(tvb, 6); - subfunc = tvb_get_guint8(tvb, 7); - - ncp_rec = ncp_record_find(func, subfunc); + /* Check to see if this is a fragment packet */ + nds_frag = tvb_get_letohl(tvb, 8); + - /* Check to see if this is a fragment packet */ - nds_frag = tvb_get_ntohl(tvb, 8); + /* Get NDS Verb */ + if (nds_frag == 0xffffffff) { + nds_verb = tvb_get_guint8(tvb, 24); + if (nds_verb == 0xfe) + { + nds_version = nds_verb; + nds_verb = tvb_get_guint8(tvb, 32); + foffset = 36; + } + else + { + nds_version = 0; + foffset = 28; + } + nds_reply_buffer = tvb_get_letohl(tvb, foffset); + proto_tree_add_uint_format(ncp_tree, hf_nds_buffer_size, tvb, foffset, + 4, nds_reply_buffer, "NDS Reply Buffer Size %d", + nds_reply_buffer); + foffset = foffset+4; + switch(nds_verb) { + + case 0x01: + verb_string = "Resolve Name -> "; + p1values.vvalue = tvb_get_letohl(tvb, foffset); + nds_version = p1values.vvalue; + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Version: %d"; + p1values.vlength = 4; + p1values.hfname = hf_nds_ver; + p1values.voffset = foffset; + foffset = foffset+p1values.vlength; + p2values.vvalue = tvb_get_letohl(tvb, foffset); + p2values.vtype = 5; /* Bitfield */ + p2values.vstring = ""; + p2values.vdesc = "Flags:"; + p2values.vlength = 2; + p2values.hfname= hf_nds_nflags; + p2values.voffset = foffset; + p2values.bit1 = "Entry ID"; + p2values.bit1hfname = hf_bit1nflags; + p2values.bit2 = "Readable"; + p2values.bit2hfname = hf_bit2nflags; + p2values.bit3 = "Writeable"; + p2values.bit3hfname = hf_bit3nflags; + p2values.bit4 = "Master"; + p2values.bit4hfname = hf_bit4nflags; + p2values.bit5 = "Create ID"; + p2values.bit5hfname = hf_bit5nflags; + p2values.bit6 = "Walk Tree"; + p2values.bit6hfname = hf_bit6nflags; + p2values.bit7 = "Dereference Alias"; + p2values.bit7hfname = hf_bit7nflags; + p2values.bit8 = "Not Defined"; + p2values.bit8hfname = hf_bit8nflags; + p2values.bit9 = "Not Defined"; + p2values.bit9hfname = hf_bit9nflags; + p2values.bit10 = "Not Defined"; + p2values.bit10hfname = hf_bit10nflags; + p2values.bit11= "Not Defined"; + p2values.bit11hfname = hf_bit11nflags; + p2values.bit12 = "Not Defined"; + p2values.bit12hfname = hf_bit12nflags; + p2values.bit13 = "Not Defined"; + p2values.bit13hfname = hf_bit13nflags; + p2values.bit14 = "Prefer Referalls"; + p2values.bit14hfname = hf_bit14nflags; + p2values.bit15 = "Prefer Only Referalls"; + p2values.bit15hfname = hf_bit15nflags; + p2values.bit16 = "Not Defined"; + p2values.bit16hfname = hf_bit16nflags; + foffset = foffset+4; + if (p1values.vvalue == 0 || p1values.vvalue == 1) + { + p3values.vtype = 3; /* Uint32 */ + p3values.vdesc = "Scope: %d"; + p3values.vstring = ""; + p3values.vlength = 4; + p3values.voffset = foffset; + p3values.vvalue = tvb_get_letohl(tvb, foffset); + p3values.hfname= hf_nds_scope; + foffset = foffset+p3values.vlength; + p4values.vtype = 4; /* String */ + p4values.vdesc = "Name: %s"; + p4values.vstring = ""; + p4values.mvtype = 1; + p4values.vvalue = 0; + p4values.vlength = 256; + p4values.vlength = tvb_get_letohl(tvb, foffset); + if (p4values.vlength == 0x00) + { + p4values.vtype = 0; + break; + } + p4values.voffset = foffset+4; + foffset = foffset + 4; + get_string(tvb, p4values.voffset, p4values.vlength, req_buffer.buffer); + p4values.vstring = req_buffer.buffer; + global_object_name = req_buffer.buffer; + p4values.hfname= hf_nds_name; + foffset = foffset+p4values.vlength; + foffset += align_4(tvb, foffset); + p5values.vvalue = tvb_get_letohl(tvb, foffset); + p5values.vtype = 6; /* Mulitvalue Uint32 */ + p5values.vstring = ""; + p5values.vdesc = "Communications Transports: %d"; + p5values.vlength = 4; + p5values.hfname= hf_nds_comm_trans; + p5values.voffset = foffset; + p5values.mvtype = 7; + foffset = foffset + (p5values.vvalue * 4) + 4; + p6values.vvalue = tvb_get_letohl(tvb, foffset); + p6values.vtype = 6; /* Multivalue Uint32 */ + p6values.vstring = ""; + p6values.vdesc = "Tree Walker Transport Type: %d"; + p6values.vlength = 4; + p6values.mvtype = 7; + p6values.hfname= hf_nds_tree_trans; + p6values.voffset = foffset; + } + else + { + p3values.vtype = 3; /* Uint32 */ + p3values.vdesc = "Minimum DS Version: %d"; + p3values.vstring = ""; + p3values.vlength = 4; + p3values.voffset = foffset; + p3values.vvalue = tvb_get_letohl(tvb, foffset); + p3values.hfname= hf_min_nds_ver; + foffset = foffset+p3values.vlength; + p4values.vvalue = tvb_get_letohl(tvb, foffset); + p4values.vtype = 6; /* Multivalue Uint32 */ + p4values.vstring = ""; + p4values.vdesc = "Number of Versions to Include: %d"; + p4values.vlength = 4; + p4values.mvtype = 3; + p4values.voffset = foffset; + p4values.hfname= hf_nds_ver_include; + foffset += (p4values.vvalue * 4) + 4; + p5values.vvalue = tvb_get_letohl(tvb, foffset); + p5values.vtype = 6; /* Multivalue Uint32 */ + p5values.vstring = ""; + p5values.vdesc = "Number of Versions to Exclude: %d"; + p5values.vlength = 4; + p5values.mvtype = 3; + p5values.hfname= hf_nds_ver_exclude; + p5values.voffset = foffset; + foffset += 4; + p6values.vtype = 3; /* Uint32 */ + p6values.vdesc = "DN Output Type: %d"; + p6values.vstring = ""; + p6values.vlength = 4; + p6values.voffset = foffset; + p6values.vvalue = tvb_get_letohl(tvb, foffset); + p6values.hfname= hf_nds_dn_output_type; + foffset = foffset+p6values.vlength; + p7values.vtype = 3; /* Uint32 */ + p7values.vdesc = "Nested Output Type: %d"; + p7values.vstring = ""; + p7values.vlength = 4; + p7values.voffset = foffset; + p7values.vvalue = tvb_get_letohl(tvb, foffset); + p7values.hfname= hf_nds_nested_output_type; + foffset = foffset+p7values.vlength; + p8values.vtype = 4; /* String */ + p8values.vdesc = "Output Delimiter: %s"; + p8values.vstring = ""; + p8values.mvtype = 1; + p8values.vvalue = 0; + p8values.vlength = 256; + p8values.vlength = tvb_get_letohl(tvb, foffset); + p8values.voffset = foffset+4; + foffset = foffset + 4; + get_string(tvb, p8values.voffset, p8values.vlength, req_buffer.buffer); + p8values.vstring = req_buffer.buffer; + p8values.hfname= hf_nds_output_delimiter; + foffset = foffset+p8values.vlength; + foffset += align_4(tvb, foffset); + p9values.vvalue = tvb_get_letohl(tvb, foffset); + p9values.vtype = 6; /* Multivalue Uint32 */ + p9values.vstring = ""; + p9values.vdesc = "Size of Entry Specifier: %d"; + p9values.vlength = 4; + p9values.mvtype = 10; + p9values.hfname= hf_nds_output_entry_specifier; + p9values.voffset = foffset; + } + break; + case 0x02: + verb_string = "Read Entry Information"; + p1values.vvalue = tvb_get_letohl(tvb, foffset); + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Version: %d"; + p1values.vlength = 4; + p1values.voffset = foffset; + p1values.hfname= hf_nds_ver; + foffset = foffset+p1values.vlength; + switch(p1values.vvalue) + { + case 0: + p2values.vvalue = tvb_get_letohl(tvb, foffset); + p2values.vstring = ""; + p2values.vtype = 3; /* Uint32 */ + p2values.vdesc = "Entry ID: 0x%08x"; + p2values.vlength = 4; + resolve_eid = TRUE; + global_eid = p2values.vvalue; + p2values.voffset = foffset; + p2values.hfname = hf_nds_eid; + foffset = foffset+p2values.vlength; + break; + case 1: + p2values.vvalue = tvb_get_letohl(tvb, foffset); + p2values.vtype = 5; /* Bitfield */ + p2values.vstring = ""; + p2values.vdesc = "Request Flags:"; + p2values.vlength = 2; + p2values.hfname= hf_nds_rflags; + p2values.voffset = foffset; + p2values.bit1 = "Typeless"; + p2values.bit1hfname = hf_bit1rflags; + p2values.bit2 = "Slashed"; + p2values.bit2hfname = hf_bit2rflags; + p2values.bit3 = "Dotted"; + p2values.bit3hfname = hf_bit3rflags; + p2values.bit4 = "Tuned"; + p2values.bit4hfname = hf_bit4rflags; + p2values.bit5 = "Not Defined"; + p2values.bit5hfname = hf_bit5rflags; + p2values.bit6 = "Not Defined"; + p2values.bit6hfname = hf_bit6rflags; + p2values.bit7 = "Not Defined"; + p2values.bit7hfname = hf_bit7rflags; + p2values.bit8 = "Not Defined"; + p2values.bit8hfname = hf_bit8rflags; + p2values.bit9 = "Not Defined"; + p2values.bit9hfname = hf_bit9rflags; + p2values.bit10 = "Not Defined"; + p2values.bit10hfname = hf_bit10rflags; + p2values.bit11 = "Not Defined"; + p2values.bit11hfname = hf_bit11rflags; + p2values.bit12 = "Not Defined"; + p2values.bit12hfname = hf_bit12rflags; + p2values.bit13 = "Not Defined"; + p2values.bit13hfname = hf_bit13rflags; + p2values.bit14 = "Not Defined"; + p2values.bit14hfname = hf_bit14rflags; + p2values.bit15 = "Not Defined"; + p2values.bit15hfname = hf_bit15rflags; + p2values.bit16 = "Not Defined"; + p2values.bit16hfname = hf_bit16rflags; + if((p2values.vvalue&&0xf000) == 0xc000) + { + p3values.vtype = 4; /* String */ + p3values.vdesc = "Name Type: %s"; + p3values.vstring = "Partial"; + p3values.mvtype = 0; + p3values.vvalue = 0; + p3values.vlength = 0; + p3values.voffset = 0; + p3values.hfname= hf_nds_name_type; + } + else + { + p3values.vtype = 4; /* String */ + p3values.vdesc = "Name Type: %s"; + p3values.vstring = "Full"; + p3values.vvalue = 0; + p3values.mvtype = 0; + p3values.vlength = 0; + p3values.voffset = 0; + p3values.hfname= hf_nds_name_type; + } + foffset = foffset+4; + p4values.vvalue = tvb_get_letohl(tvb, foffset); + p4values.vstring = ""; + p4values.vtype = 3; /* Uint32 */ + p4values.vdesc = "Entry ID: 0x%08x"; + p4values.vlength = 4; + p4values.voffset = foffset; + resolve_eid = TRUE; + global_eid = p4values.vvalue; + p4values.hfname = hf_nds_eid; + foffset = foffset+p4values.vlength; + break; + case 2: + p2values.vvalue = tvb_get_letohl(tvb, foffset); + p2values.vtype = 5; /* Bitfield */ + p2values.vstring = ""; + p2values.vdesc = "Request Flags:"; + p2values.vlength = 2; + p2values.hfname= hf_nds_rflags; + p2values.voffset = foffset; + p2values.bit1 = "Typeless"; + p2values.bit1hfname = hf_bit1rflags; + p2values.bit2 = "Slashed"; + p2values.bit2hfname = hf_bit2rflags; + p2values.bit3 = "Dotted"; + p2values.bit3hfname = hf_bit3rflags; + p2values.bit4 = "Tuned"; + p2values.bit4hfname = hf_bit4rflags; + p2values.bit5 = "Not Defined"; + p2values.bit5hfname = hf_bit5rflags; + p2values.bit6 = "Not Defined"; + p2values.bit6hfname = hf_bit6rflags; + p2values.bit7 = "Not Defined"; + p2values.bit7hfname = hf_bit7rflags; + p2values.bit8 = "Not Defined"; + p2values.bit8hfname = hf_bit8rflags; + p2values.bit9 = "Not Defined"; + p2values.bit9hfname = hf_bit9rflags; + p2values.bit10 = "Not Defined"; + p2values.bit10hfname = hf_bit10rflags; + p2values.bit11 = "Not Defined"; + p2values.bit11hfname = hf_bit11rflags; + p2values.bit12 = "Not Defined"; + p2values.bit12hfname = hf_bit12rflags; + p2values.bit13 = "Not Defined"; + p2values.bit13hfname = hf_bit13rflags; + p2values.bit14 = "Not Defined"; + p2values.bit14hfname = hf_bit14rflags; + p2values.bit15 = "Not Defined"; + p2values.bit15hfname = hf_bit15rflags; + p2values.bit16 = "Not Defined"; + p2values.bit16hfname = hf_bit16rflags; + if((p2values.vvalue&&0xf000) == 0xc000) + { + p3values.vtype = 4; /* String */ + p3values.vdesc = "Name Type: %s"; + p3values.vstring = "Return Partion Name"; + p3values.vvalue = 0; + p3values.vlength = 4; + p3values.voffset = p2values.voffset; + p3values.mvtype = 0; + p3values.hfname= hf_nds_name_type; + } + else + { + p3values.vtype = 4; /* String */ + p3values.vdesc = "Name Type: %s"; + p3values.vstring = "Return Full Name"; + p3values.vvalue = 0; + p3values.vlength = 4; + p3values.mvtype = 0; + p3values.voffset = p2values.voffset; + p3values.hfname= hf_nds_name_type; + } + foffset = foffset+4; + p4values.vvalue = tvb_get_letohs(tvb, foffset); + global_flags = tvb_get_letohl(tvb, foffset); + p4values.vtype = 5; /* Bitfield */ + p4values.vstring = ""; + p4values.vdesc = "Information Flags (low) Byte:"; + p4values.vlength = 2; + p4values.hfname= hf_nds_rflags; + p4values.voffset = foffset; + p4values.bit1 = "Output Flags"; + p4values.bit1hfname = hf_bit1infoflagsl; + p4values.bit2 = "Entry ID"; + p4values.bit2hfname = hf_bit2infoflagsl; + p4values.bit3 = "Entry Flags"; + p4values.bit3hfname = hf_bit3infoflagsl; + p4values.bit4 = "Subordinate Count"; + p4values.bit4hfname = hf_bit4infoflagsl; + p4values.bit5 = "Modification Time"; + p4values.bit5hfname = hf_bit5infoflagsl; + p4values.bit6 = "Modification Timestamp"; + p4values.bit6hfname = hf_bit6infoflagsl; + p4values.bit7 = "Creation Timestamp"; + p4values.bit7hfname = hf_bit7infoflagsl; + p4values.bit8 = "Partition Root ID"; + p4values.bit8hfname = hf_bit8infoflagsl; + p4values.bit9 = "Parent ID"; + p4values.bit9hfname = hf_bit9infoflagsl; + p4values.bit10 = "Revision Count"; + p4values.bit10hfname = hf_bit10infoflagsl; + p4values.bit11 = "Replica Type"; + p4values.bit11hfname = hf_bit11infoflagsl; + p4values.bit12 = "Base Class"; + p4values.bit12hfname = hf_bit12infoflagsl; + p4values.bit13 = "Relative Distinguished Name"; + p4values.bit13hfname = hf_bit13infoflagsl; + p4values.bit14 = "Distinguished Name"; + p4values.bit14hfname = hf_bit14infoflagsl; + p4values.bit15 = "Root Distinguished Name"; + p4values.bit15hfname = hf_bit15infoflagsl; + p4values.bit16 = "Parent Distinguished Name"; + p4values.bit16hfname = hf_bit16infoflagsl; + foffset = foffset+2; + p5values.vvalue = tvb_get_letohs(tvb, foffset); + p5values.vtype = 5; /* Bitfield */ + p5values.vstring = ""; + p5values.vdesc = "Information Flags (high) Byte:"; + p5values.vlength = 2; + p5values.hfname= hf_nds_rflags; + p5values.voffset = foffset; + p5values.bit1 = "Purge Time"; + p5values.bit1hfname = hf_bit1infoflagsh; + p5values.bit2 = "Dereference Base Class"; + p5values.bit2hfname = hf_bit2infoflagsh; + p5values.bit3 = "Not Defined"; + p5values.bit3hfname = hf_bit3infoflagsh; + p5values.bit4 = "Not Defined"; + p5values.bit4hfname = hf_bit4infoflagsh; + p5values.bit5 = "Not Defined"; + p5values.bit5hfname = hf_bit5infoflagsh; + p5values.bit6 = "Not Defined"; + p5values.bit6hfname = hf_bit6infoflagsh; + p5values.bit7 = "Not Defined"; + p5values.bit7hfname = hf_bit7infoflagsh; + p5values.bit8 = "Not Defined"; + p5values.bit8hfname = hf_bit8infoflagsh; + p5values.bit9 = "Not Defined"; + p5values.bit9hfname = hf_bit9infoflagsh; + p5values.bit10 = "Not Defined"; + p5values.bit10hfname = hf_bit10infoflagsh; + p5values.bit11 = "Not Defined"; + p5values.bit11hfname = hf_bit11infoflagsh; + p5values.bit12 = "Not Defined"; + p5values.bit12hfname = hf_bit12infoflagsh; + p5values.bit13 = "Not Defined"; + p5values.bit13hfname = hf_bit13infoflagsh; + p5values.bit14 = "Not Defined"; + p5values.bit14hfname = hf_bit14infoflagsh; + p5values.bit15 = "Not Defined"; + p5values.bit15hfname = hf_bit15infoflagsh; + p5values.bit16 = "Not Defined"; + p5values.bit16hfname = hf_bit16infoflagsh; + foffset = foffset+2; + p6values.vvalue = tvb_get_letohl(tvb, foffset); + p6values.vstring = ""; + p6values.vtype = 3; /* Uint32 */ + p6values.vdesc = "Entry ID: 0x%08x"; + p6values.vlength = 4; + p6values.voffset = foffset; + resolve_eid = TRUE; + global_eid = p6values.vvalue; + p6values.hfname = hf_nds_eid; + foffset = foffset+p6values.vlength; + break; + default: + break; + } + + break; + case 0x03: + verb_string = "Read -> "; + p1values.vvalue = tvb_get_letohl(tvb, foffset); + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Version: %d"; + p1values.vlength = 4; + p1values.voffset = foffset; + p1values.hfname= hf_nds_ver; + foffset = foffset+p1values.vlength; + if(p1values.vvalue == 0) + { + p2values.vvalue = tvb_get_letohl(tvb, foffset); + p2values.vstring = ""; + p2values.vtype = 3; /* Uint32 */ + p2values.vdesc = "Iteration Handle: 0x%08x"; + p2values.vlength = 4; + p2values.voffset = foffset; + p2values.hfname= hf_nds_iteration; + foffset = foffset+p2values.vlength; + p3values.vvalue = tvb_get_letohl(tvb, foffset); + p3values.vstring = ""; + p3values.vtype = 3; /* Uint32 */ + p3values.vdesc = "Entry ID: 0x%08x"; + p3values.vlength = 4; + resolve_eid = TRUE; + global_eid = p3values.vvalue; + p3values.voffset = foffset; + p3values.hfname= hf_nds_eid; + foffset = foffset+p3values.vlength; + p4values.vvalue = tvb_get_letohl(tvb, foffset); + p4values.vstring = match_strval(p4values.vvalue, nds_info_type); + global_flags = p4values.vvalue; + if(p4values.vstring == NULL) + { + p4values.vstring = "No Info Type Set"; + } + p4values.vtype = 4; /* String */ + p4values.vdesc = "Info Type: %s"; + p4values.vlength = 4; + p4values.voffset = foffset; + p4values.mvtype = 1; + p4values.hfname= hf_nds_info_type; + foffset = foffset + p4values.vlength; + p5values.vvalue = tvb_get_letohl(tvb, foffset); + p5values.vstring = ""; + p5values.vtype = 3; /* Uint32 */ + p5values.vdesc = "All Attributes: %d"; + p5values.vlength = 4; + p5values.voffset = foffset; + p5values.hfname= hf_nds_all_attr; + foffset = foffset+p5values.vlength; + p6values.vvalue = tvb_get_letohl(tvb, foffset); + p6values.vtype = 6; /* Multivalue Uint32 */ + p6values.vstring = ""; + p6values.vdesc = "Attributes: %d"; + p6values.vlength = 4; + p6values.voffset = foffset; + p6values.mvtype = 1; + p6values.hfname= hf_nds_attr; + } + else + { + p2values.vvalue = tvb_get_letohl(tvb, foffset); + p2values.vstring = ""; + p2values.vtype = 3; /* Uint32 */ + p2values.vdesc = "Request Flags: 0x%08x"; + p2values.vlength = 4; + p2values.voffset = foffset; + p2values.hfname= hf_nds_req_flags; + foffset = foffset+p2values.vlength; + p3values.vvalue = tvb_get_letohl(tvb, foffset); + p3values.vstring = ""; + p3values.vtype = 3; /* Uint32 */ + p3values.vdesc = "Iteration Handle: 0x%08x"; + p3values.vlength = 4; + p3values.voffset = foffset; + p3values.hfname= hf_nds_iteration; + foffset = foffset+p3values.vlength; + p4values.vvalue = tvb_get_letohl(tvb, foffset); + p4values.vstring = ""; + p4values.vtype = 3; /* Uint32 */ + p4values.vdesc = "Entry ID: 0x%08x"; + p4values.vlength = 4; + resolve_eid = TRUE; + global_eid = p4values.vvalue; + p4values.voffset = foffset; + p4values.hfname= hf_nds_eid; + foffset = foffset+p4values.vlength; + p5values.vvalue = tvb_get_letohl(tvb, foffset); + p5values.vstring = match_strval(p5values.vvalue, nds_info_type); + global_flags = p5values.vvalue; + if(p5values.vstring == NULL) + { + p5values.vstring = "No Info Type Set"; + } + p5values.vtype = 4; /* String */ + p5values.vdesc = "Info Type: %s"; + p5values.vlength = 4; + p5values.voffset = foffset; + p5values.hfname= hf_nds_info_type; + p5values.mvtype = 1; + foffset = foffset+p5values.vlength; + p6values.vvalue = tvb_get_letohl(tvb, foffset); + p6values.vstring = ""; + p6values.vtype = 3; /* Uint32 */ + p6values.vdesc = "All Attributes: %d"; + p6values.vlength = 4; + p6values.voffset = foffset; + p6values.hfname= hf_nds_all_attr; + foffset = foffset+p6values.vlength; + p7values.vvalue = tvb_get_letohl(tvb, foffset); + p7values.vtype = 6; /* Multivalue Uint32 */ + p7values.vstring = ""; + p7values.vdesc = "Attributes: %d"; + p7values.vlength = 4; + p7values.voffset = foffset; + p7values.mvtype = 1; + p7values.hfname= hf_nds_attr; + } + break; + case 0x04: + verb_string = "Compare"; + p1values.vvalue = tvb_get_letohl(tvb, foffset); + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Version: %d"; + p1values.vlength = 4; + p1values.voffset = foffset; + p1values.hfname= hf_nds_ver; + foffset = foffset+p1values.vlength; + p2values.vvalue = tvb_get_letohl(tvb, foffset); + p2values.vstring = ""; + p2values.vtype = 3; /* Uint32 */ + p2values.vdesc = "Entry ID: 0x%08x"; + p2values.vlength = 4; + resolve_eid = TRUE; + global_eid = p2values.vvalue; + p2values.voffset = foffset; + p2values.hfname = hf_nds_eid; + foffset = foffset+p2values.vlength; + foffset += 4; /* Attribute Count = 1 */ + p3values.vtype = 4; /* String */ + p3values.vdesc = "Attribute Name Being Compared: %s"; + p3values.vstring = ""; + p3values.mvtype = 1; + p3values.vvalue = 0; + p3values.vlength = 256; + p3values.vlength = tvb_get_letohl(tvb, foffset); + if (p3values.vlength == 0x00) + { + p3values.vtype = 0; + break; + } + p3values.voffset = foffset+4; + foffset = foffset + 4; + get_string(tvb, p3values.voffset, p3values.vlength, req_buffer.buffer); + p3values.vstring = req_buffer.buffer; + global_object_name = req_buffer.buffer; + p3values.hfname= hf_nds_name; + foffset = foffset+p3values.vlength; + foffset += align_4(tvb, foffset); + foffset += 4; /* Attribute Value Count = 1 */ + /*************** + * Need Trace file to test. Will have to create a + * new mvtype to call print_nds_values. + ***************/ + break; + case 0x05: + verb_string = "List -> "; + p1values.vvalue = tvb_get_letohl(tvb, foffset); + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Version: %d"; + p1values.vlength = 4; + p1values.voffset = foffset; + p1values.hfname= hf_nds_ver; + foffset = foffset+p1values.vlength; + p2values.vvalue = tvb_get_letohl(tvb, foffset); + p2values.vtype = 5; /* Bitfield */ + p2values.vstring = ""; + p2values.vdesc = "Request Flags:"; + p2values.vlength = 2; + p2values.hfname= hf_nds_rflags; + p2values.voffset = foffset; + p2values.bit1 = "List Typeless"; + p2values.bit1hfname = hf_bit1lflags; + p2values.bit2 = "List Containers"; + p2values.bit2hfname = hf_bit2lflags; + p2values.bit3 = "List Slashed"; + p2values.bit3hfname = hf_bit3lflags; + p2values.bit4 = "List Dotted"; + p2values.bit4hfname = hf_bit4lflags; + p2values.bit5 = "Dereference Alias"; + p2values.bit5hfname = hf_bit5lflags; + p2values.bit6 = "List All Containers"; + p2values.bit6hfname = hf_bit6lflags; + p2values.bit7 = "List Obsolete"; + p2values.bit7hfname = hf_bit7lflags; + p2values.bit8 = "List Tuned Output"; + p2values.bit8hfname = hf_bit8lflags; + p2values.bit9 = "List External Reference"; + p2values.bit9hfname = hf_bit9lflags; + p2values.bit10 = "Not Defined"; + p2values.bit10hfname = hf_bit10lflags; + p2values.bit11 = "Not Defined"; + p2values.bit11hfname = hf_bit11lflags; + p2values.bit12 = "Not Defined"; + p2values.bit12hfname = hf_bit12lflags; + p2values.bit13 = "Not Defined"; + p2values.bit13hfname = hf_bit13lflags; + p2values.bit14 = "Not Defined"; + p2values.bit14hfname = hf_bit14lflags; + p2values.bit15 = "Not Defined"; + p2values.bit15hfname = hf_bit15lflags; + p2values.bit16 = "Not Defined"; + p2values.bit16hfname = hf_bit16lflags; + foffset = foffset+p2values.vlength; + foffset += 2; + p3values.vvalue = tvb_get_letohl(tvb, foffset); + p3values.vstring = ""; + p3values.vtype = 3; /* Uint32 */ + p3values.vdesc = "Iteration Handle: 0x%08x"; + p3values.vlength = 4; + p3values.voffset = foffset; + p3values.hfname= hf_nds_iteration; + foffset = foffset+p3values.vlength; + p4values.vvalue = tvb_get_letohl(tvb, foffset); + p4values.vstring = ""; + p4values.vtype = 3; /* Uint32 */ + p4values.vdesc = "Parent ID: 0x%08x"; + p4values.vlength = 4; + p4values.voffset = foffset; + p4values.hfname= hf_nds_parent; + foffset = foffset+p4values.vlength; + p5values.vvalue = tvb_get_letohs(tvb, foffset); + global_flags = tvb_get_letohl(tvb, foffset); + p5values.vtype = 5; /* Bitfield */ + p5values.vstring = ""; + p5values.vdesc = "Information Flags (low) Byte:"; + p5values.vlength = 2; + p5values.hfname= hf_nds_rflags; + p5values.voffset = foffset; + p5values.bit1 = "Output Flags"; + p5values.bit1hfname = hf_bit1infoflagsl; + p5values.bit2 = "Entry ID"; + p5values.bit2hfname = hf_bit2infoflagsl; + p5values.bit3 = "Entry Flags"; + p5values.bit3hfname = hf_bit3infoflagsl; + p5values.bit4 = "Subordinate Count"; + p5values.bit4hfname = hf_bit4infoflagsl; + p5values.bit5 = "Modification Time"; + p5values.bit5hfname = hf_bit5infoflagsl; + p5values.bit6 = "Modification Timestamp"; + p5values.bit6hfname = hf_bit6infoflagsl; + p5values.bit7 = "Creation Timestamp"; + p5values.bit7hfname = hf_bit7infoflagsl; + p5values.bit8 = "Partition Root ID"; + p5values.bit8hfname = hf_bit8infoflagsl; + p5values.bit9 = "Parent ID"; + p5values.bit9hfname = hf_bit9infoflagsl; + p5values.bit10 = "Revision Count"; + p5values.bit10hfname = hf_bit10infoflagsl; + p5values.bit11 = "Replica Type"; + p5values.bit11hfname = hf_bit11infoflagsl; + p5values.bit12 = "Base Class"; + p5values.bit12hfname = hf_bit12infoflagsl; + p5values.bit13 = "Relative Distinguished Name"; + p5values.bit13hfname = hf_bit13infoflagsl; + p5values.bit14 = "Distinguished Name"; + p5values.bit14hfname = hf_bit14infoflagsl; + p5values.bit15 = "Root Distinguished Name"; + p5values.bit15hfname = hf_bit15infoflagsl; + p5values.bit16 = "Parent Distinguished Name"; + p5values.bit16hfname = hf_bit16infoflagsl; + foffset = foffset+2; + p6values.vvalue = tvb_get_letohs(tvb, foffset); + p6values.vtype = 5; /* Bitfield */ + p6values.vstring = ""; + p6values.vdesc = "Information Flags (high) Byte:"; + p6values.vlength = 2; + p6values.hfname= hf_nds_rflags; + p6values.voffset = foffset; + p6values.bit1 = "Purge Time"; + p6values.bit1hfname = hf_bit1infoflagsh; + p6values.bit2 = "Dereference Base Class"; + p6values.bit2hfname = hf_bit2infoflagsh; + p6values.bit3 = "Not Defined"; + p6values.bit3hfname = hf_bit3infoflagsh; + p6values.bit4 = "Not Defined"; + p6values.bit4hfname = hf_bit4infoflagsh; + p6values.bit5 = "Not Defined"; + p6values.bit5hfname = hf_bit5infoflagsh; + p6values.bit6 = "Not Defined"; + p6values.bit6hfname = hf_bit6infoflagsh; + p6values.bit7 = "Not Defined"; + p6values.bit7hfname = hf_bit7infoflagsh; + p6values.bit8 = "Not Defined"; + p6values.bit8hfname = hf_bit8infoflagsh; + p6values.bit9 = "Not Defined"; + p6values.bit9hfname = hf_bit9infoflagsh; + p6values.bit10 = "Not Defined"; + p6values.bit10hfname = hf_bit10infoflagsh; + p6values.bit11 = "Not Defined"; + p6values.bit11hfname = hf_bit11infoflagsh; + p6values.bit12 = "Not Defined"; + p6values.bit12hfname = hf_bit12infoflagsh; + p6values.bit13 = "Not Defined"; + p6values.bit13hfname = hf_bit13infoflagsh; + p6values.bit14 = "Not Defined"; + p6values.bit14hfname = hf_bit14infoflagsh; + p6values.bit15 = "Not Defined"; + p6values.bit15hfname = hf_bit15infoflagsh; + p6values.bit16 = "Not Defined"; + p6values.bit16hfname = hf_bit16infoflagsh; + foffset = foffset+2; + p7values.vtype = 4; /* String */ + p7values.vdesc = "Name Filter: %s"; + p7values.vstring = ""; + p7values.mvtype = 1; + p7values.vvalue = 0; + p7values.vlength = 256; + p7values.vlength = tvb_get_letohl(tvb, foffset); + p7values.voffset = foffset+4; + foffset = foffset + 4; + get_string(tvb, p7values.voffset, p7values.vlength, p7values.vstring); + p7values.hfname= hf_nds_name_filter; + foffset = foffset+p7values.vlength; + if(p1values.vvalue == 0) + { + break; + } + foffset += align_4(tvb, foffset); + p8values.vtype = 4; /* String */ + p8values.vdesc = "Class Filter: %s"; + p8values.vstring = ""; + p8values.mvtype = 1; + p8values.vvalue = 0; + p8values.vlength = 256; + p8values.vlength = tvb_get_letohl(tvb, foffset); + p8values.voffset = foffset+4; + foffset = foffset + 4; + get_string(tvb, p8values.voffset, p8values.vlength, p8values.vstring); + p8values.hfname= hf_nds_class_filter; + foffset = foffset+p8values.vlength; + if(p1values.vvalue == 1) + { + break; + } + foffset += align_4(tvb, foffset); + p9values.vvalue = tvb_get_letohl(tvb, foffset); + p9values.vtype = 6; /* Multivalue Uint32 */ + p9values.vstring = ""; + p9values.vdesc = "Seconds %d"; + p9values.vlength = 4; + p9values.mvtype = 11; + p9values.hfname= hf_nds_time_filter; + p9values.voffset = foffset; + break; + case 0x06: + verb_string = "Search Entries"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x07: + verb_string = "Add Entry"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x08: + verb_string = "Remove Entry"; + p1values.vvalue = tvb_get_letohl(tvb, foffset); + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Version: %d"; + p1values.vlength = 4; + p1values.voffset = foffset; + p1values.hfname= hf_nds_ver; + foffset = foffset+p1values.vlength; + p2values.vvalue = tvb_get_letohl(tvb, foffset); + p2values.vstring = ""; + p2values.vtype = 3; /* Uint32 */ + p2values.vdesc = "Entry ID: 0x%08x"; + p2values.vlength = 4; + resolve_eid = TRUE; + global_eid = p2values.vvalue; + p2values.voffset = foffset; + p2values.hfname= hf_nds_eid; + foffset = foffset+p2values.vlength; + break; + case 0x09: + verb_string = "Modify Entry"; + p1values.vvalue = tvb_get_letohl(tvb, foffset); + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Version: %d"; + p1values.vlength = 4; + p1values.voffset = foffset; + p1values.hfname= hf_nds_ver; + foffset = foffset+p1values.vlength; + p2values.vvalue = tvb_get_letohl(tvb, foffset); + p2values.vtype = 3; /* Uint32 */ + p2values.vstring = ""; + p2values.vdesc = "Request Flags: 0x%08x"; /* always 0 */ + p2values.vlength = 4; + p2values.hfname= hf_nds_rflags; + p2values.voffset = foffset; + foffset = foffset+4; + p3values.vvalue = tvb_get_letohl(tvb, foffset); + p3values.vtype = 3; /* Uint32 */ + p3values.vstring = ""; + p3values.vdesc = "Iteration Handle: 0x%08x"; /* always 0 */ + p3values.vlength = 4; + p3values.hfname= hf_nds_iteration; + p3values.voffset = foffset; + foffset = foffset+4; + p4values.vvalue = tvb_get_letohl(tvb, foffset); + p4values.vstring = ""; + p4values.vtype = 3; /* Uint32 */ + p4values.vdesc = "Entry ID: 0x%08x"; + p4values.vlength = 4; + p4values.voffset = foffset; + resolve_eid = TRUE; + global_eid = p4values.vvalue; + p4values.hfname = hf_nds_eid; + foffset = foffset+p4values.vlength; + p5values.vvalue = tvb_get_letohl(tvb, foffset); + p5values.vtype = 6; /* Multivalue Uint32 */ + p5values.vstring = ""; + p5values.vdesc = "Number of Attributes to Change %d"; + p5values.vlength = 4; + p5values.mvtype = 6; + p5values.hfname= hf_nds_number_of_changes; + p5values.voffset = foffset; + break; + case 0x0a: + verb_string = "Modify RDN"; + p1values.vvalue = tvb_get_letohl(tvb, foffset); + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Version: %d"; + p1values.vlength = 4; + p1values.voffset = foffset; + p1values.hfname= hf_nds_ver; + foffset = foffset+p1values.vlength; + p2values.vvalue = tvb_get_letohl(tvb, foffset); + p2values.vstring = ""; + p2values.vtype = 3; /* Uint32 */ + p2values.vdesc = "Entry ID: 0x%08x"; + p2values.vlength = 4; + resolve_eid = TRUE; + global_eid = p2values.vvalue; + p2values.voffset = foffset; + p2values.hfname = hf_nds_eid; + foffset = foffset+p2values.vlength; + p3values.vvalue = tvb_get_letohl(tvb, foffset); + p3values.vtype = 8; /* Boolean */ + p3values.vdesc = "Keep Original RDN: %s"; + p3values.vlength = 4; + p3values.voffset = foffset; + p3values.mvtype = 0; + p3values.hfname= hf_nds_keep; + foffset = foffset+4; + foffset += align_4(tvb, foffset); + p4values.vtype = 4; /* String */ + p4values.vdesc = "New RDN: %s"; + p4values.vstring = ""; + p4values.mvtype = 0; + p4values.vvalue = 0; + p4values.vlength = 256; + p4values.vlength = tvb_get_letohl(tvb, foffset); + p4values.voffset = foffset+4; + foffset = foffset + 4; + get_string(tvb, p4values.voffset, p4values.vlength, p4values.vstring); + p4values.hfname= hf_nds_new_rdn; + foffset = foffset+p4values.vlength; + break; + case 0x0b: + verb_string = "Define Attribute ->"; + p1values.vvalue = tvb_get_letohl(tvb, foffset); + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Version: %d"; + p1values.vlength = 4; + p1values.voffset = foffset; + p1values.hfname= hf_nds_ver; + foffset = foffset+p1values.vlength; + p2values.vvalue = tvb_get_letohs(tvb, foffset); + global_flags = tvb_get_letohl(tvb, foffset); + p2values.vtype = 5; /* Bitfield */ + p2values.vstring = ""; + p2values.vdesc = "Attribute Constraints:"; + p2values.vlength = 2; + p2values.hfname= hf_nds_acflags; + p2values.voffset = foffset; + p2values.bit1 = "Single Valued"; + p2values.bit1hfname = hf_bit1acflags; + p2values.bit2 = "Sized"; + p2values.bit2hfname = hf_bit2acflags; + p2values.bit3 = "Non-Removable"; + p2values.bit3hfname = hf_bit3acflags; + p2values.bit4 = "Read Only"; + p2values.bit4hfname = hf_bit4acflags; + p2values.bit5 = "Hidden"; + p2values.bit5hfname = hf_bit5acflags; + p2values.bit6 = "String"; + p2values.bit6hfname = hf_bit6acflags; + p2values.bit7 = "Synchronize Immediate"; + p2values.bit7hfname = hf_bit7acflags; + p2values.bit8 = "Public Read"; + p2values.bit8hfname = hf_bit8acflags; + p2values.bit9 = "Server Read"; + p2values.bit9hfname = hf_bit9acflags; + p2values.bit10 = "Write Managed"; + p2values.bit10hfname = hf_bit10acflags; + p2values.bit11 = "Per Replica"; + p2values.bit11hfname = hf_bit11acflags; + p2values.bit12 = "Never Schedule Synchronization"; + p2values.bit12hfname = hf_bit12acflags; + p2values.bit13 = "Operational"; + p2values.bit13hfname = hf_bit13acflags; + p2values.bit14 = "Not Defined"; + p2values.bit14hfname = hf_bit14acflags; + p2values.bit15 = "Not Defined"; + p2values.bit15hfname = hf_bit15acflags; + p2values.bit16 = "Not Defined"; + p2values.bit16hfname = hf_bit16acflags; + foffset = foffset+4; + p3values.vtype = 4; /* String */ + p3values.vdesc = "Attribute Name: %s"; + p3values.vstring = ""; + p3values.mvtype = 1; + p3values.vvalue = 0; + p3values.vlength = 256; + p3values.vlength = tvb_get_letohl(tvb, foffset); + if (p3values.vlength == 0x00) + { + p3values.vtype = 0; + break; + } + p3values.voffset = foffset+4; + foffset = foffset + 4; + get_string(tvb, p3values.voffset, p3values.vlength, req_buffer.buffer); + p3values.vstring = req_buffer.buffer; + global_object_name = req_buffer.buffer; + p3values.hfname= hf_nds_name; + foffset = foffset+p3values.vlength; + foffset += align_4(tvb, foffset); + p4values.vvalue = tvb_get_letohl(tvb, foffset); + p4values.vstring = match_strval(p4values.vvalue, nds_syntax); + if(p4values.vstring == NULL) + { + p4values.vstring = "No Syntax Found"; + } + p4values.vtype = 4; /* String */ + p4values.vdesc = "Syntax: %s"; + p4values.vlength = 4; + p4values.voffset = foffset; + p4values.hfname= hf_nds_syntax; + p4values.mvtype = 0; + foffset = foffset+p4values.vlength; + p5values.vvalue = tvb_get_letohl(tvb, foffset); + p5values.vstring = ""; + p5values.vtype = 3; /* Uint32 */ + p5values.vdesc = "Lower Limit Value %d"; + p5values.vlength = 4; + p5values.voffset = foffset; + p5values.hfname = hf_nds_lower; + foffset += 4; + p6values.vvalue = tvb_get_letohl(tvb, foffset); + p6values.vstring = ""; + p6values.vtype = 3; /* Uint32 */ + p6values.vdesc = "Upper Limit Value %d"; + p6values.vlength = 4; + p6values.voffset = foffset; + p6values.hfname = hf_nds_upper; + p7values.vvalue = tvb_get_letohl(tvb, foffset); /* Length of bytes field */ + foffset += 4; + p7values.vstring = ""; + p7values.vtype = 7; /* Bytes */ + p7values.vdesc = "ASN.1 ID"; + p7values.vlength = p7values.vvalue; + p7values.voffset = foffset; + p7values.hfname = hf_nds_asn1; + break; + case 0x0c: + verb_string = "Read Attribute Definition"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x0d: + verb_string = "Remove Attribute Definition"; + p1values.vvalue = tvb_get_letohl(tvb, foffset); + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Version: %d"; + p1values.vlength = 4; + p1values.voffset = foffset; + p1values.hfname= hf_nds_ver; + foffset = foffset+p1values.vlength; + p2values.vtype = 4; /* String */ + p2values.vdesc = "Attribute Name: %s"; + p2values.vstring = ""; + p2values.mvtype = 1; + p2values.vvalue = 0; + p2values.vlength = 256; + p2values.vlength = tvb_get_letohl(tvb, foffset); + if (p2values.vlength == 0x00) + { + p2values.vtype = 0; + break; + } + p2values.voffset = foffset+4; + foffset = foffset + 4; + get_string(tvb, p2values.voffset, p2values.vlength, req_buffer.buffer); + p2values.vstring = req_buffer.buffer; + global_object_name = req_buffer.buffer; + p2values.hfname= hf_nds_attribute_dn; + break; + case 0x0e: + verb_string = "Define Class"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x0f: + verb_string = "Read Class Definition ->"; + p1values.vvalue = tvb_get_letohl(tvb, foffset); + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Version: %d"; + p1values.vlength = 4; + p1values.voffset = foffset; + p1values.hfname= hf_nds_ver; + foffset = foffset+p1values.vlength; + p2values.vvalue = tvb_get_letohl(tvb, foffset); + p2values.vstring = ""; + p2values.vtype = 3; /* Uint32 */ + p2values.vdesc = "Iteration Handle: 0x%08x"; + p2values.vlength = 4; + p2values.voffset = foffset; + p2values.hfname= hf_nds_iteration; + foffset = foffset+p2values.vlength; + p3values.vvalue = tvb_get_letohl(tvb, foffset); + global_flags = p3values.vvalue; + p3values.vstring = match_strval(p3values.vvalue, class_def_type); + if(p3values.vstring == NULL) + { + p3values.vstring = "No Class Definition Type Set"; + } + p3values.vtype = 4; /* String */ + p3values.vdesc = "Class Definition Type: %s"; + p3values.vlength = 4; + p3values.voffset = foffset; + p3values.mvtype = 0; + p3values.hfname= hf_nds_class_def_type; + foffset = foffset + p3values.vlength; + p4values.vvalue = tvb_get_letohl(tvb, foffset); + if (p4values.vvalue == 0x00000000) + { + p4values.vstring = "Return All Classes = False"; + } + else + { + p4values.vstring = "Return All Classes = True"; + } + p4values.vtype = 4; /* String */ + p4values.vdesc = "Return all Classes %s"; + p4values.vlength = 4; + p4values.voffset = foffset; + p4values.mvtype = 0; + p4values.hfname= hf_nds_return_all_classes; + foffset = foffset + p4values.vlength; + foffset += align_4(tvb, foffset); + p5values.vvalue = tvb_get_letohl(tvb, foffset); + p5values.vtype = 6; /* Multivalue Uint32 */ + p5values.vstring = ""; + p5values.vdesc = "Classes: %d"; + p5values.vlength = 4; + p5values.voffset = foffset; + p5values.mvtype = 4; + p5values.hfname= hf_nds_classes; + break; + case 0x10: + verb_string = "Modify Class Definition -> "; + p1values.vvalue = tvb_get_letohl(tvb, foffset); + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Version: %d"; + p1values.vlength = 4; + p1values.voffset = foffset; + p1values.hfname= hf_nds_ver; + foffset = foffset+p1values.vlength; + p2values.vtype = 4; /* String */ + p2values.vdesc = "Class Name: %s"; + p2values.vstring = ""; + p2values.mvtype = 1; + p2values.vvalue = 0; + p2values.vlength = 256; + p2values.vlength = tvb_get_letohl(tvb, foffset); + if (p2values.vlength == 0x00) + { + p2values.vtype = 0; + break; + } + p2values.voffset = foffset+4; + foffset = foffset + 4; + get_string(tvb, p2values.voffset, p2values.vlength, req_buffer.buffer); + p2values.vstring = req_buffer.buffer; + global_object_name = req_buffer.buffer; + p2values.hfname= hf_nds_base_class; + foffset = foffset+p2values.vlength; + foffset += align_4(tvb, foffset); + p3values.vvalue = tvb_get_letohl(tvb, foffset); + p3values.vtype = 6; /* Multivalue Uint32 */ + p3values.vstring = ""; + p3values.vdesc = "Number of Attributes to Add: %d"; + p3values.vlength = 4; + p3values.voffset = foffset; + p3values.mvtype = 14; + p3values.hfname= hf_nds_att_add; + break; + case 0x11: + verb_string = "Remove Class Definition"; + p1values.vvalue = tvb_get_letohl(tvb, foffset); + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Version: %d"; + p1values.vlength = 4; + p1values.voffset = foffset; + p1values.hfname= hf_nds_ver; + foffset = foffset+p1values.vlength; + p2values.vtype = 4; /* String */ + p2values.vdesc = "Class Name: %s"; + p2values.vstring = ""; + p2values.mvtype = 1; + p2values.vvalue = 0; + p2values.vlength = 256; + p2values.vlength = tvb_get_letohl(tvb, foffset); + if (p2values.vlength == 0x00) + { + p2values.vtype = 0; + break; + } + p2values.voffset = foffset+4; + foffset = foffset + 4; + get_string(tvb, p2values.voffset, p2values.vlength, req_buffer.buffer); + p2values.vstring = req_buffer.buffer; + global_object_name = req_buffer.buffer; + p2values.hfname= hf_nds_base; + break; + case 0x12: + verb_string = "List Containable Classes"; + p1values.vvalue = tvb_get_letohl(tvb, foffset); + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Version: %d"; + p1values.vlength = 4; + p1values.voffset = foffset; + p1values.hfname= hf_nds_ver; + foffset = foffset+p1values.vlength; + p2values.vvalue = tvb_get_letohl(tvb, foffset); + p2values.vstring = ""; + p2values.vtype = 3; /* Uint32 */ + p2values.vdesc = "Iteration Handle: 0x%08x"; + p2values.vlength = 4; + p2values.voffset = foffset; + p2values.hfname= hf_nds_iteration; + foffset = foffset+p2values.vlength; + p3values.vvalue = tvb_get_letohl(tvb, foffset); + p3values.vstring = ""; + p3values.vtype = 3; /* Uint32 */ + p3values.vdesc = "Entry ID: 0x%08x"; + p3values.vlength = 4; + resolve_eid = TRUE; + global_eid = p3values.vvalue; + p3values.voffset = foffset; + p3values.hfname= hf_nds_eid; + foffset = foffset+p3values.vlength; + break; + case 0x13: + verb_string = "Get Effective Rights -> "; + p1values.vvalue = tvb_get_letohl(tvb, foffset); + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Version: %d"; + p1values.vlength = 4; + p1values.voffset = foffset; + p1values.hfname= hf_nds_ver; + foffset = foffset+p1values.vlength; + p2values.vvalue = tvb_get_letohl(tvb, foffset); + p2values.vstring = ""; + p2values.vtype = 3; /* Uint32 */ + p2values.vdesc = "Entry ID: 0x%08x"; + p2values.vlength = 4; + resolve_eid = TRUE; + global_eid = p2values.vvalue; + p2values.voffset = foffset; + p2values.hfname= hf_nds_eid; + foffset = foffset+p2values.vlength; + p3values.vtype = 4; /* String */ + p3values.vdesc = "Trustee Name: %s"; + p3values.vstring = ""; + p3values.mvtype = 1; + p3values.vvalue = 0; + p3values.vlength = 256; + p3values.vlength = tvb_get_letohl(tvb, foffset); + if (p3values.vlength == 0x00) + { + p3values.vtype = 0; + break; + } + p3values.voffset = foffset+4; + foffset = foffset + 4; + get_string(tvb, p3values.voffset, p3values.vlength, req_buffer.buffer); + p3values.vstring = req_buffer.buffer; + p3values.hfname= hf_nds_name; + foffset = foffset+p3values.vlength; + foffset += align_4(tvb, foffset); + p4values.vtype = 4; /* String */ + p4values.vdesc = "Attribute to be Checked: %s"; + p4values.vstring = ""; + p4values.mvtype = 0; + p4values.vvalue = 0; + p4values.vlength = 256; + p4values.vlength = tvb_get_letohl(tvb, foffset); + if (p4values.vlength == 0x00) + { + p4values.vtype = 0; + break; + } + p4values.voffset = foffset+4; + foffset = foffset + 4; + get_string(tvb, p4values.voffset, p4values.vlength, p4values.vstring); + p4values.hfname= hf_nds_name; + foffset = foffset+p4values.vlength; + foffset += align_4(tvb, foffset); + if(p1values.vvalue != 0) + { + p5values.vtype = 4; /* String */ + p5values.vdesc = "Security Equivalence: %s"; + p5values.vstring = ""; + p5values.mvtype = 1; + p5values.vvalue = 0; + p5values.vlength = 256; + p5values.vlength = tvb_get_letohl(tvb, foffset); + if (p5values.vlength == 0x00) + { + p5values.vtype = 0; + break; + } + p5values.voffset = foffset+4; + foffset = foffset + 4; + get_string(tvb, p5values.voffset, p5values.vlength, p5values.vstring); + p5values.hfname= hf_nds_name; + foffset = foffset+p5values.vlength; + foffset += align_4(tvb, foffset); + } + break; + case 0x14: + verb_string = "Add Partition"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x15: + verb_string = "Remove Partition"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x16: + verb_string = "List Partitions"; + p1values.vvalue = tvb_get_letohl(tvb, foffset); + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Version: %d"; + p1values.vlength = 4; + p1values.voffset = foffset; + p1values.hfname= hf_nds_ver; + foffset = foffset+p1values.vlength; + p2values.vvalue = tvb_get_letohl(tvb, foffset); + p2values.vtype = 5; /* Bitfield */ + p2values.vstring = ""; + p2values.vdesc = "Request Flags:"; + p2values.vlength = 2; + p2values.hfname= hf_nds_rflags; + p2values.voffset = foffset; + p2values.bit1 = "Typeless"; + p2values.bit1hfname = hf_nds_bit1; + p2values.bit2 = "All Containers"; + p2values.bit2hfname = hf_nds_bit2; + p2values.bit3 = "Slashed"; + p2values.bit3hfname = hf_nds_bit3; + p2values.bit4 = "Dotted"; + p2values.bit4hfname = hf_nds_bit4; + p2values.bit5 = "Tuned"; + p2values.bit5hfname = hf_nds_bit5; + p2values.bit6 = "Not Defined"; + p2values.bit6hfname = hf_nds_bit6; + p2values.bit7 = "Not Defined"; + p2values.bit7hfname = hf_nds_bit7; + p2values.bit8 = "Not Defined"; + p2values.bit8hfname = hf_nds_bit8; + p2values.bit9 = "Not Defined"; + p2values.bit9hfname = hf_nds_bit9; + p2values.bit10 = "Not Defined"; + p2values.bit10hfname = hf_nds_bit10; + p2values.bit11 = "Not Defined"; + p2values.bit11hfname = hf_nds_bit11; + p2values.bit12 = "Not Defined"; + p2values.bit12hfname = hf_nds_bit12; + p2values.bit13 = "Not Defined"; + p2values.bit13hfname = hf_nds_bit13; + p2values.bit14 = "Not Defined"; + p2values.bit14hfname = hf_nds_bit14; + p2values.bit15 = "Not Defined"; + p2values.bit15hfname = hf_nds_bit15; + p2values.bit16 = "Not Defined"; + p2values.bit16hfname = hf_nds_bit16; + foffset = foffset+p2values.vlength; + p3values.vvalue = tvb_get_letohl(tvb, foffset); + p3values.vstring = ""; + p3values.vtype = 3; /* Uint32 */ + p3values.vdesc = "Iteration Handle: 0x%08x"; + p3values.vlength = 4; + p3values.voffset = foffset; + p3values.hfname= hf_nds_iteration; + foffset = foffset+p3values.vlength; + if(p1values.vvalue == 0) + { + global_flags = 0x000000c0; + break; + } + p4values.vvalue = tvb_get_letohs(tvb, foffset); + p4values.vtype = 5; /* Bitfield */ + p4values.vstring = ""; + p4values.vdesc = "Information Flags (low) Byte:"; + p4values.vlength = 2; + p4values.hfname= hf_nds_rflags; + p4values.voffset = foffset; + p4values.bit1 = "Output Flags"; + p4values.bit1hfname = hf_bit1l1flagsl; + p4values.bit2 = "Entry ID"; + p4values.bit2hfname = hf_bit2l1flagsl; + p4values.bit3 = "Replica State"; + p4values.bit3hfname = hf_bit3l1flagsl; + p4values.bit4 = "Modification Timestamp"; + p4values.bit4hfname = hf_bit4l1flagsl; + p4values.bit5 = "Purge Time"; + p4values.bit5hfname = hf_bit5l1flagsl; + p4values.bit6 = "Local Partition ID"; + p4values.bit6hfname = hf_bit6l1flagsl; + p4values.bit7 = "Distinguished Name"; + p4values.bit7hfname = hf_bit7l1flagsl; + p4values.bit8 = "Replica Type"; + p4values.bit8hfname = hf_bit8l1flagsl; + p4values.bit9 = "Partition Busy"; + p4values.bit9hfname = hf_bit9l1flagsl; + p4values.bit10 = "Not Defined"; + p4values.bit10hfname = hf_bit10l1flagsl; + p4values.bit11 = "Not Defined"; + p4values.bit11hfname = hf_bit11l1flagsl; + p4values.bit12 = "Not Defined"; + p4values.bit12hfname = hf_bit12l1flagsl; + p4values.bit13 = "Not Defined"; + p4values.bit13hfname = hf_bit13l1flagsl; + p4values.bit14 = "Not Defined"; + p4values.bit14hfname = hf_bit14l1flagsl; + p4values.bit15 = "Not Defined"; + p4values.bit15hfname = hf_bit15l1flagsl; + p4values.bit16 = "Not Defined"; + p4values.bit16hfname = hf_bit16l1flagsl; + global_flags = p4values.vvalue; + foffset = foffset+2; + p5values.vvalue = tvb_get_letohs(tvb, foffset); + p5values.vtype = 5; /* Bitfield */ + p5values.vstring = ""; + p5values.vdesc = "Information Flags (high) Byte:"; + p5values.vlength = 2; + p5values.hfname= hf_nds_rflags; + p5values.voffset = foffset; + p5values.bit1 = "Not Defined"; + p5values.bit1hfname = hf_bit1l1flagsl; + p5values.bit2 = "Not Defined"; + p5values.bit2hfname = hf_bit2l1flagsl; + p5values.bit3 = "Not Defined"; + p5values.bit3hfname = hf_bit3l1flagsl; + p5values.bit4 = "Not Defined"; + p5values.bit4hfname = hf_bit4l1flagsl; + p5values.bit5 = "Not Defined"; + p5values.bit5hfname = hf_bit5l1flagsl; + p5values.bit6 = "Not Defined"; + p5values.bit6hfname = hf_bit6l1flagsl; + p5values.bit7 = "Not Defined"; + p5values.bit7hfname = hf_bit7l1flagsl; + p5values.bit8 = "Not Defined"; + p5values.bit8hfname = hf_bit8l1flagsl; + p5values.bit9 = "Not Defined"; + p5values.bit9hfname = hf_bit9l1flagsl; + p5values.bit10 = "Not Defined"; + p5values.bit10hfname = hf_bit10l1flagsl; + p5values.bit11 = "Not Defined"; + p5values.bit11hfname = hf_bit11l1flagsl; + p5values.bit12 = "Not Defined"; + p5values.bit12hfname = hf_bit12l1flagsl; + p5values.bit13 = "Not Defined"; + p5values.bit13hfname = hf_bit13l1flagsl; + p5values.bit14 = "Not Defined"; + p5values.bit14hfname = hf_bit14l1flagsl; + p5values.bit15 = "Not Defined"; + p5values.bit15hfname = hf_bit15l1flagsl; + p5values.bit16 = "Not Defined"; + p5values.bit16hfname = hf_bit16l1flagsl; + foffset = foffset+2; + if(p1values.vvalue == 1) + { + break; + } + p6values.vvalue = tvb_get_letohl(tvb, foffset); + p6values.vstring = ""; + p6values.vtype = 3; /* Uint32 */ + p6values.vdesc = "Partition Root ID: 0x%08x"; + p6values.vlength = 4; + p6values.voffset = foffset; + p6values.hfname= hf_nds_partition_root_id; + foffset = foffset+p6values.vlength; + break; + case 0x17: + verb_string = "Split Partition"; + p1values.vvalue = tvb_get_letohl(tvb, foffset); + nds_version = p1values.vvalue; + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Version: %d"; + p1values.vlength = 4; + p1values.hfname = hf_nds_ver; + p1values.voffset = foffset; + foffset = foffset+p1values.vlength; + p2values.vvalue = tvb_get_letohl(tvb, foffset); + nds_version = p2values.vvalue; + p2values.vstring = ""; + p2values.vtype = 3; /* Uint32 */ + p2values.vdesc = "Flags: 0x%08x"; + p2values.vlength = 4; + p2values.hfname = hf_nds_req_flags; + p2values.voffset = foffset; + foffset = foffset+p2values.vlength; + p3values.vvalue = tvb_get_letohl(tvb, foffset); + p3values.vstring = ""; + p3values.vtype = 3; /* Uint32 */ + p3values.vdesc = "New Partition Root ID: 0x%08x"; + p3values.vlength = 4; + p3values.voffset = foffset; + p3values.hfname= hf_nds_new_part_id; + foffset = foffset+p3values.vlength; + break; + case 0x18: + verb_string = "Join Partitions"; + p1values.vvalue = tvb_get_letohl(tvb, foffset); + nds_version = p1values.vvalue; + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Version: %d"; + p1values.vlength = 4; + p1values.hfname = hf_nds_ver; + p1values.voffset = foffset; + foffset = foffset+p1values.vlength; + p2values.vvalue = tvb_get_letohl(tvb, foffset); + nds_version = p2values.vvalue; + p2values.vstring = ""; + p2values.vtype = 3; /* Uint32 */ + p2values.vdesc = "Flags: 0x%08x"; + p2values.vlength = 4; + p2values.hfname = hf_nds_req_flags; + p2values.voffset = foffset; + foffset = foffset+p2values.vlength; + p3values.vvalue = tvb_get_letohl(tvb, foffset); + p3values.vstring = ""; + p3values.vtype = 3; /* Uint32 */ + p3values.vdesc = "Child Partition Root ID: 0x%08x"; + p3values.vlength = 4; + p3values.voffset = foffset; + p3values.hfname= hf_nds_child_part_id; + foffset = foffset+p3values.vlength; + break; + case 0x19: + verb_string = "Add Replica"; + p1values.vvalue = tvb_get_letohl(tvb, foffset); + nds_version = p1values.vvalue; + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Version: %d"; + p1values.vlength = 4; + p1values.hfname = hf_nds_ver; + p1values.voffset = foffset; + foffset = foffset+p1values.vlength; + p2values.vvalue = tvb_get_letohl(tvb, foffset); + nds_version = p2values.vvalue; + p2values.vstring = ""; + p2values.vtype = 3; /* Uint32 */ + p2values.vdesc = "Flags: 0x%08x"; + p2values.vlength = 4; + p2values.hfname = hf_nds_req_flags; + p2values.voffset = foffset; + foffset = foffset+p2values.vlength; + p3values.vvalue = tvb_get_letohl(tvb, foffset); + p3values.vstring = ""; + p3values.vtype = 3; /* Uint32 */ + p3values.vdesc = "Master Partition Root ID: 0x%08x"; + p3values.vlength = 4; + p3values.voffset = foffset; + p3values.hfname= hf_nds_master_part_id; + foffset = foffset+p3values.vlength; + p4values.vvalue = tvb_get_letohl(tvb, foffset); + p4values.vstring = match_strval(p4values.vvalue, nds_replica_type); + if(p4values.vstring == NULL) + { + p4values.vstring = "No Replica Type Found"; + } + p4values.vtype = 4; /* String */ + p4values.vdesc = "Replica Type: %s"; + p4values.vlength = 4; + p4values.voffset = foffset; + p4values.mvtype = 0; + p4values.hfname= hf_replica_type; + foffset = foffset + p4values.vlength; + p5values.vtype = 4; /* String */ + p5values.vdesc = "Target Server Name: %s"; + p5values.vstring = ""; + p5values.mvtype = 0; + p5values.vvalue = 0; + p5values.vlength = 256; + p5values.vlength = tvb_get_letohl(tvb, foffset); + if (p5values.vlength == 0x00) + { + p5values.vtype = 0; + break; + } + p5values.voffset = foffset+4; + foffset = foffset + 4; + get_string(tvb, p5values.voffset, p5values.vlength, p5values.vstring); + p5values.hfname= hf_nds_target_name; + break; + case 0x1a: + verb_string = "Remove Replica"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x1b: + verb_string = "Open Stream -> "; + p1values.vvalue = tvb_get_letohl(tvb, foffset); + nds_version = p1values.vvalue; + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Version: %d"; + p1values.vlength = 4; + p1values.hfname = hf_nds_ver; + p1values.voffset = foffset; + foffset = foffset+p1values.vlength; + p2values.vvalue = tvb_get_letohl(tvb, foffset); + nds_version = p2values.vvalue; + p2values.vstring = ""; + p2values.vtype = 3; /* Uint32 */ + p2values.vdesc = "Streams Flags: 0x%08x"; + p2values.vlength = 4; + p2values.hfname = hf_nds_stream_flags; + p2values.voffset = foffset; + foffset = foffset+p2values.vlength; + p3values.vvalue = tvb_get_letohl(tvb, foffset); + p3values.vstring = ""; + p3values.vtype = 3; /* Uint32 */ + p3values.vdesc = "Entry ID: 0x%08x"; + p3values.vlength = 4; + resolve_eid = TRUE; + global_eid = p3values.vvalue; + p3values.voffset = foffset; + p3values.hfname= hf_nds_eid; + foffset = foffset+p3values.vlength; + p4values.vtype = 4; /* String */ + p4values.vdesc = "Stream Name: %s"; + p4values.vstring = ""; + p4values.mvtype = 1; + p4values.vvalue = 0; + p4values.vlength = 256; + p4values.vlength = tvb_get_letohl(tvb, foffset); + if (p4values.vlength == 0x00) + { + p4values.vtype = 0; + break; + } + p4values.voffset = foffset+4; + foffset += 4; + get_string(tvb, p4values.voffset, p4values.vlength, p4values.vstring); + foffset += p4values.vlength; + foffset += align_4(tvb, foffset); + p4values.hfname= hf_nds_stream_name; + break; + case 0x1c: + verb_string = "Search Filter"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x1d: + verb_string = "Create Subordinate Reference"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x1e: + verb_string = "Link Replica"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x1f: + verb_string = "Change Replica Type"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x20: + verb_string = "Start Update Schema"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x21: + verb_string = "End Update Schema"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x22: + verb_string = "Update Schema"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x23: + verb_string = "Start Update Replica"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x24: + verb_string = "End Update Replica"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x25: + verb_string = "Update Replica"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x26: + verb_string = "Synchronize Partition"; + p1values.vvalue = tvb_get_letohl(tvb, foffset); + nds_version = p1values.vvalue; + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Version: %d"; + p1values.vlength = 4; + p1values.hfname = hf_nds_ver; + p1values.voffset = foffset; + foffset = foffset+p1values.vlength; + p2values.vvalue = tvb_get_letohl(tvb, foffset); + nds_version = p2values.vvalue; + p2values.vstring = ""; + p2values.vtype = 3; /* Uint32 */ + p2values.vdesc = "Flags: 0x%08x"; + p2values.vlength = 4; + p2values.hfname = hf_nds_req_flags; + p2values.voffset = foffset; + foffset = foffset+p2values.vlength; + p3values.vvalue = tvb_get_letohl(tvb, foffset); + p3values.vstring = ""; + p3values.vtype = 3; /* Uint32 */ + p3values.vdesc = "Time Delay in Seconds: %d"; + p3values.vlength = 4; + p3values.voffset = foffset; + p3values.hfname= hf_nds_time_delay; + foffset = foffset+p3values.vlength; + if(p1values.vvalue == 0) + { + p4values.vtype = 4; /* String */ + p4values.vdesc = "Root Most Object Name: %s"; + p4values.vstring = ""; + p4values.mvtype = 1; + p4values.vvalue = 0; + p4values.vlength = 256; + p4values.vlength = tvb_get_letohl(tvb, foffset); + if (p4values.vlength == 0x00) + { + p4values.vtype = 0; + break; + } + p4values.voffset = foffset+4; + foffset += 4; + get_string(tvb, p4values.voffset, p4values.vlength, p4values.vstring); + foffset += p4values.vlength; + foffset += align_4(tvb, foffset); + p4values.hfname= hf_nds_root_name; + } + else + { + p4values.vvalue = tvb_get_letohl(tvb, foffset); + p4values.vstring = ""; + p4values.vtype = 3; /* Uint32 */ + p4values.vdesc = "Entry ID: 0x%08x"; + p4values.vlength = 4; + resolve_eid = TRUE; + global_eid = p4values.vvalue; + p4values.voffset = foffset; + p4values.hfname= hf_nds_eid; + foffset = foffset+p4values.vlength; + resolve_eid = TRUE; + global_eid = p4values.vvalue; + } + break; + case 0x27: + verb_string = "Synchronize Schema"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x28: + verb_string = "Read Syntaxes"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x29: + verb_string = "Get Replica Root ID"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x2a: + verb_string = "Begin Move Entry"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x2b: + verb_string = "Finish Move Entry"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x2c: + verb_string = "Release Moved Entry"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x2d: + verb_string = "Backup Entry"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x2e: + verb_string = "Restore Entry"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x2f: + verb_string = "Save DIB"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x30: + verb_string = "Control"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x31: + verb_string = "Remove Backlink"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x32: + verb_string = "Close Iteration"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x33: + verb_string = "Mutate Entry"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x34: + verb_string = "Audit Skulking"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x35: + verb_string = "Get Server Address"; + p1values.vvalue = 0; + break; + case 0x36: + verb_string = "Set Keys"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x37: + verb_string = "Change Password"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x38: + verb_string = "Verify Password"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x39: + verb_string = "Begin Login"; + p1values.vvalue = tvb_get_letohl(tvb, foffset); + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Version: %d"; + p1values.vlength = 4; + p1values.voffset = foffset; + p1values.hfname= hf_nds_ver; + foffset = foffset+p1values.vlength; + p2values.vvalue = tvb_get_letohl(tvb, foffset); + p2values.vstring = ""; + p2values.vtype = 3; /* Uint32 */ + p2values.vdesc = "Entry ID: 0x%08x"; + p2values.vlength = 4; + resolve_eid = TRUE; + global_eid = p2values.vvalue; + p2values.voffset = foffset; + p2values.hfname= hf_nds_eid; + foffset = foffset+p2values.vlength; + break; + case 0x3a: + verb_string = "Finish Login"; + p1values.vvalue = tvb_get_letohl(tvb, foffset); + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Reply Buffer Size: %d"; + p1values.vlength = 4; + p1values.voffset = foffset; + p1values.hfname= hf_nds_buffer_size; + foffset = foffset+p1values.vlength; + p2values.vvalue = tvb_get_letohl(tvb, foffset); + p2values.vstring = ""; + p2values.vtype = 3; /* Uint32 */ + p2values.vdesc = "Version: %d"; + p2values.vlength = 4; + p2values.voffset = foffset; + p2values.hfname= hf_nds_ver; + foffset = foffset+p2values.vlength; + p3values.vvalue = tvb_get_letohl(tvb, foffset); + p3values.vstring = ""; + p3values.vtype = 3; /* Uint32 */ + p3values.vdesc = "Entry ID: 0x%08x"; + p3values.vlength = 4; + resolve_eid = TRUE; + global_eid = p3values.vvalue; + p3values.voffset = foffset; + p3values.hfname= hf_nds_eid; + foffset = foffset+p3values.vlength; + break; + case 0x3b: + verb_string = "Begin Authentication"; + p1values.vvalue = tvb_get_letohl(tvb, foffset); + p1values.vstring = ""; + p1values.vtype = 3; /* Uint32 */ + p1values.vdesc = "Version: %d"; + p1values.vlength = 4; + p1values.voffset = foffset; + p1values.hfname= hf_nds_ver; + foffset = foffset+p1values.vlength; + p2values.vvalue = tvb_get_letohl(tvb, foffset); + p2values.vstring = ""; + p2values.vtype = 3; /* Uint32 */ + p2values.vdesc = "Entry ID: 0x%08x"; + p2values.vlength = 4; + resolve_eid = TRUE; + global_eid = p2values.vvalue; + p2values.voffset = foffset; + p2values.hfname= hf_nds_eid; + foffset = foffset+p2values.vlength; + break; + case 0x3c: + verb_string = "Finish Authentication"; + break; + case 0x3d: + verb_string = "Logout"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x3e: + verb_string = "Repair Ring"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x3f: + verb_string = "Repair Timestamps"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x40: + verb_string = "Create Back Link"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x41: + verb_string = "Delete External Reference"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x42: + verb_string = "Rename External Reference"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x43: + verb_string = "Create Directory Entry"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x44: + verb_string = "Remove Directory Entry"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x45: + verb_string = "Designate New Master"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x46: + verb_string = "Change Tree Name"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x47: + verb_string = "Partition Entry Count"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x48: + verb_string = "Check Login Restrictions"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x49: + verb_string = "Start Join"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x4a: + verb_string = "Low Level Split"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x4b: + verb_string = "Low Level Join"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x4c: + verb_string = "Abort Low Level Join"; + p1values.vtype = 0; /* Not Defined */ + break; + case 0x4d: + verb_string = "Get All Servers"; + p1values.vtype = 0; /* Not Defined */ + break; + default: + verb_string = "NDS Continuation Fragment"; + p1values.vtype = 0; /* Not Defined */ + } + } + /* Fill in the INFO column. */ + if (check_col(pinfo->cinfo, COL_INFO)) { + if (ncp_rec) { + + col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDS"); + if (nds_frag != 0xffffffff) { + col_add_fstr(pinfo->cinfo, COL_INFO, "C Continue NDS Fragment %08x", nds_frag); + } + else { + col_add_fstr(pinfo->cinfo, COL_INFO, "C NDS %s", verb_string); + } + } + else { + col_add_fstr(pinfo->cinfo, COL_INFO, + "C Unknown Function %d (0x%02x)", + func, func); + } + + } + 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 + came, and the address and connection to which the request + is being sent, so that we can match up calls with replies. + (We don't include the sequence number, as we may want + to have all packets over the same connection treated + as being part of a single conversation so that we can + let the user select that conversation to be displayed.) */ + + conversation = find_conversation(&pinfo->src, &pinfo->dst, + PT_NCP, nw_connection, nw_connection, 0); + + if (conversation == NULL) { + /* It's not part of any conversation - create a new one. */ + conversation = conversation_new(&pinfo->src, &pinfo->dst, + PT_NCP, nw_connection, nw_connection, 0); + } + + request_value = ncp_hash_insert(conversation, sequence, ncp_rec); + request_value->req_frame_num = pinfo->fd->num; + + /* If this is the first time we're examining the packet, + * check to see if this NCP type uses a "request condition". + * If so, we have to build a proto_tree because request conditions + * use display filters to work, and without a proto_tree, + * display filters can't possibly work. If we already have + * a proto_tree, then wonderful. If we don't, we need to build + * one. */ + if (ncp_rec) { + proto_item *ti; + + temp_tree = proto_tree_create_root(); + proto_tree_set_visible(temp_tree, FALSE); + ti = proto_tree_add_item(temp_tree, proto_ncp, tvb, 0, -1, FALSE); + ncp_tree = proto_item_add_subtree(ti, ett_ncp); + + } + } + + if (ncp_tree) { + /* If the dissection throws an exception, be sure to free + * the temporary proto_tree that was created. Because of the + * way the CLEANUP_PUSH macro works, we can't put it in an 'if' + * block; it has to be in the same scope as the terminating + * CLEANUP_POP or CLEANUP_POP_AND_ALLOC. So, we always + * call CLEANUP_POP and friends, but the value of temp_tree is + * NULL if no cleanup is needed, and non-null if cleanup is needed. + */ + + CLEANUP_PUSH(free_proto_tree, temp_tree); + + conversation = find_conversation(&pinfo->src, &pinfo->dst, + PT_NCP, nw_connection, nw_connection, 0); + + + + switch (type) { + case NCP_BROADCAST_SLOT: + ; /* nothing */ + break; + + case NCP_SERVICE_REQUEST: + + ptvc = ptvcursor_new(ncp_tree, tvb, 7); + if (ncp_rec && ncp_rec->request_ptvc) + { + clear_repeat_vars(); + process_ptvc_record(ptvc, ncp_rec->request_ptvc, NULL, TRUE, ncp_rec); + } + proto_tree_add_uint_format(ncp_tree, hf_ncp_func, tvb, 6, 1, + func, "Function: %d (0x%02X), %s", + func, func, ncp_rec ? ncp_rec->name : "Unknown"); + + proto_tree_add_uint_format(ncp_tree, hf_ncp_subfunc, tvb, 7, 1, + subfunc, "SubFunction: %d (0x%02x)", + subfunc, subfunc); + + proto_tree_add_uint_format(ncp_tree, hf_ncp_fragment_handle, tvb, 8, 4, + nds_frag, "Fragment Handle: (0x%08x)", + nds_frag); + + if (nds_frag == 0xffffffff) { + + proto_tree_add_item(ncp_tree, hf_ncp_fragment_size, tvb, 12, 4, TRUE); + + proto_tree_add_item(ncp_tree, hf_ncp_message_size, tvb, 16, 4, TRUE); + + proto_tree_add_item(ncp_tree, hf_ncp_nds_flag, tvb, 20, 4, FALSE); + + proto_tree_add_uint_format(ncp_tree, hf_ncp_nds_verb, tvb, 24, 4, + nds_verb, "NDS Verb: %d, (0x%02x), %s", + nds_verb, nds_verb, verb_string); + if (p1values.vtype != 0) { + switch (p1values.vtype) { + case 1: /* uint8 */ + proto_tree_add_uint_format(ncp_tree, p1values.hfname, tvb, p1values.voffset, + p1values.vlength, p1values.vtype, "NDS Parameter not defined %d", + p1values.vtype); + break; + case 2: /* uint16 */ + proto_tree_add_uint_format(ncp_tree, p1values.hfname, tvb, p1values.voffset, + p1values.vlength, p1values.vtype, "NDS Parameter not defined %d", + p1values.vtype); + break; + case 3: /* uint32 */ + proto_tree_add_uint_format(ncp_tree, p1values.hfname, tvb, p1values.voffset, + p1values.vlength, p1values.vvalue, p1values.vdesc, + p1values.vvalue); + break; + case 4: /* string */ + proto_tree_add_string_format(ncp_tree, p1values.hfname, tvb, p1values.voffset, + p1values.vlength, p1values.vstring, p1values.vdesc, p1values.vstring); + if (p1values.mvtype == 1) + { + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_str(pinfo->cinfo, COL_INFO, p1values.vstring); + } + } + break; + case 5: /* bitfield */ + process_bitfield(ncp_tree, tvb, &p1values); + break; + case 6: /*multivalue uint32 */ + process_multivalues(ncp_tree, tvb, &p1values); + if (p1values.mvtype == 1 || p1values.mvtype == 10) + { + if (p1values.mvtype == 10) + { + global_object_name = p1values.vstring; + } + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_str(pinfo->cinfo, COL_INFO, p1values.vstring); + } + } + break; + case 7: /* Bytes */ + proto_tree_add_bytes(ncp_tree, p1values.hfname, tvb, p1values.voffset, + p1values.vlength, tvb_get_ptr(tvb, p1values.voffset, p1values.vvalue)); + break; + case 8: + proto_tree_add_item(ncp_tree, p1values.hfname, tvb, p1values.voffset, p1values.vlength, TRUE); + break; + default: + proto_tree_add_uint_format(ncp_tree, hf_nds_p1type, tvb, p1values.voffset, + p1values.vlength, p1values.vtype, "NDS Parameter not defined %d", + p1values.vtype); + break; + } + switch (p2values.vtype) { + case 1: /* uint8 */ + break; + case 2: /* uint16 */ + break; + case 3: /* uint32 */ + proto_tree_add_uint_format(ncp_tree, p2values.hfname, tvb, p2values.voffset, + p2values.vlength, p2values.vvalue, p2values.vdesc, + p2values.vvalue); + break; + case 4: /* string */ + proto_tree_add_string_format(ncp_tree, p2values.hfname, tvb, p2values.voffset, + p2values.vlength, p2values.vstring, p2values.vdesc, p2values.vstring); + if (p2values.mvtype == 1) + { + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_str(pinfo->cinfo, COL_INFO, p2values.vstring); + } + } + break; + case 5: /* boolean */ + process_bitfield(ncp_tree, tvb, &p2values); + break; + case 6: /*multivalue uint32 */ + process_multivalues(ncp_tree, tvb, &p2values); + if (p2values.mvtype == 1 || p2values.mvtype == 10) + { + if (p2values.mvtype == 10) + { + global_object_name = p1values.vstring; + } + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_str(pinfo->cinfo, COL_INFO, p2values.vstring); + } + } + break; + case 7: /* Bytes */ + proto_tree_add_bytes(ncp_tree, p2values.hfname, tvb, p2values.voffset, + p2values.vlength, tvb_get_ptr(tvb, p2values.voffset, p2values.vvalue)); + break; + case 8: + proto_tree_add_item(ncp_tree, p2values.hfname, tvb, p2values.voffset, p2values.vlength, TRUE); + break; + default: + break; + } + switch (p3values.vtype) { + case 1: /* uint8 */ + break; + case 2: /* uint16 */ + break; + case 3: /* uint32 */ + proto_tree_add_uint_format(ncp_tree, p3values.hfname, tvb, p3values.voffset, + p3values.vlength, p3values.vvalue, p3values.vdesc, + p3values.vvalue); + break; + case 4: /* string */ + proto_tree_add_string_format(ncp_tree, p3values.hfname, tvb, p3values.voffset, + p3values.vlength, p3values.vstring, p3values.vdesc, p3values.vstring); + if (p3values.mvtype == 1) + { + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_str(pinfo->cinfo, COL_INFO, p3values.vstring); + } + } + break; + case 5: /* boolean */ + process_bitfield(ncp_tree, tvb, &p3values); + break; + case 6: /*multivalue uint32 */ + process_multivalues(ncp_tree, tvb, &p3values); + if (p3values.mvtype == 1 || p3values.mvtype == 10) + { + if (p3values.mvtype == 10) + { + global_object_name = p3values.vstring; + } + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_str(pinfo->cinfo, COL_INFO, p3values.vstring); + } + } + break; + case 7: /* Bytes */ + proto_tree_add_bytes(ncp_tree, p3values.hfname, tvb, p3values.voffset, + p3values.vlength, tvb_get_ptr(tvb, p3values.voffset, p3values.vvalue)); + break; + case 8: + proto_tree_add_item(ncp_tree, p3values.hfname, tvb, p3values.voffset, p3values.vlength, TRUE); + break; + default: + break; + } + switch (p4values.vtype) { + case 1: /* uint8 */ + break; + case 2: /* uint16 */ + break; + case 3: /* uint32 */ + proto_tree_add_uint_format(ncp_tree, p4values.hfname, tvb, p4values.voffset, + p4values.vlength, p4values.vvalue, p4values.vdesc, + p4values.vvalue); + break; + case 4: /* string */ + proto_tree_add_string_format(ncp_tree, p4values.hfname, tvb, p4values.voffset, + p4values.vlength, p4values.vstring, p4values.vdesc, p4values.vstring); + if (p4values.mvtype == 1) + { + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_str(pinfo->cinfo, COL_INFO, p4values.vstring); + } + } + break; + case 5: /* boolean */ + process_bitfield(ncp_tree, tvb, &p4values); + break; + case 6: /*multivalue uint32 */ + process_multivalues(ncp_tree, tvb, &p4values); + if (p4values.mvtype == 1 || p4values.mvtype == 10) + { + if (p4values.mvtype == 10) + { + global_object_name = p4values.vstring; + } + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_str(pinfo->cinfo, COL_INFO, p4values.vstring); + } + } + break; + case 7: /* Bytes */ + proto_tree_add_bytes(ncp_tree, p4values.hfname, tvb, p4values.voffset, + p4values.vlength, tvb_get_ptr(tvb, p4values.voffset, p4values.vvalue)); + break; + case 8: + proto_tree_add_item(ncp_tree, p4values.hfname, tvb, p4values.voffset, p4values.vlength, TRUE); + break; + default: + break; + } + switch (p5values.vtype) { + case 1: /* uint8 */ + break; + case 2: /* uint16 */ + break; + case 3: /* uint32 */ + proto_tree_add_uint_format(ncp_tree, p5values.hfname, tvb, p5values.voffset, + p5values.vlength, p5values.vvalue, p5values.vdesc, + p5values.vvalue); + break; + case 4: /* string */ + proto_tree_add_string_format(ncp_tree, p5values.hfname, tvb, p5values.voffset, + p5values.vlength, p5values.vstring, p5values.vdesc, p5values.vstring); + if (p5values.mvtype == 1 || p5values.mvtype == 10) + { + if (p5values.mvtype == 10) + { + global_object_name = p5values.vstring; + } + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_str(pinfo->cinfo, COL_INFO, p5values.vstring); + } + } + break; + case 5: /* boolean */ + process_bitfield(ncp_tree, tvb, &p5values); + break; + case 6: /*multivalue uint32 */ + process_multivalues(ncp_tree, tvb, &p5values); + if (p5values.mvtype == 1) + { + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_str(pinfo->cinfo, COL_INFO, p5values.vstring); + } + } + break; + case 7: /* Bytes */ + proto_tree_add_bytes(ncp_tree, p5values.hfname, tvb, p5values.voffset, + p5values.vlength, tvb_get_ptr(tvb, p5values.voffset, p5values.vvalue)); + break; + case 8: + proto_tree_add_item(ncp_tree, p5values.hfname, tvb, p5values.voffset, p5values.vlength, TRUE); + break; + default: + break; + } + switch (p6values.vtype) { + case 1: /* uint8 */ + break; + case 2: /* uint16 */ + break; + case 3: /* uint32 */ + proto_tree_add_uint_format(ncp_tree, p6values.hfname, tvb, p6values.voffset, + p6values.vlength, p6values.vvalue, p6values.vdesc, + p6values.vvalue); + break; + case 4: /* string */ + proto_tree_add_string_format(ncp_tree, p6values.hfname, tvb, p6values.voffset, + p6values.vlength, p6values.vstring, p6values.vdesc, p6values.vstring); + if (p6values.mvtype == 1 || p6values.mvtype == 10) + { + if (p6values.mvtype == 10) + { + global_object_name = p6values.vstring; + } + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_str(pinfo->cinfo, COL_INFO, p6values.vstring); + } + } + break; + case 5: /* boolean */ + process_bitfield(ncp_tree, tvb, &p6values); + break; + case 6: /*multivalue uint32 */ + process_multivalues(ncp_tree, tvb, &p6values); + if (p6values.mvtype == 1) + { + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_str(pinfo->cinfo, COL_INFO, p6values.vstring); + } + } + break; + case 7: /* Bytes */ + proto_tree_add_bytes(ncp_tree, p6values.hfname, tvb, p6values.voffset, + p6values.vlength, tvb_get_ptr(tvb, p6values.voffset, p6values.vvalue)); + break; + case 8: + proto_tree_add_item(ncp_tree, p6values.hfname, tvb, p6values.voffset, p6values.vlength, TRUE); + break; + default: + break; + } + switch (p7values.vtype) { + case 1: /* uint8 */ + break; + case 2: /* uint16 */ + break; + case 3: /* uint32 */ + proto_tree_add_uint_format(ncp_tree, p7values.hfname, tvb, p7values.voffset, + p7values.vlength, p7values.vvalue, p7values.vdesc, + p7values.vvalue); + break; + case 4: /* string */ + proto_tree_add_string_format(ncp_tree, p7values.hfname, tvb, p7values.voffset, + p7values.vlength, p7values.vstring, p7values.vdesc, p7values.vstring); + if (p7values.mvtype == 1 || p7values.mvtype == 10) + { + if (p7values.mvtype == 10) + { + global_object_name = p7values.vstring; + } + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_str(pinfo->cinfo, COL_INFO, p7values.vstring); + } + } + break; + case 5: /* boolean */ + process_bitfield(ncp_tree, tvb, &p7values); + break; + case 6: /*multivalue uint32 */ + process_multivalues(ncp_tree, tvb, &p7values); + if (p7values.mvtype == 1) + { + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_str(pinfo->cinfo, COL_INFO, p7values.vstring); + } + } + break; + case 7: /* Bytes */ + proto_tree_add_bytes(ncp_tree, p7values.hfname, tvb, p7values.voffset, + p7values.vlength, tvb_get_ptr(tvb, p7values.voffset, p7values.vvalue)); + break; + case 8: + proto_tree_add_item(ncp_tree, p7values.hfname, tvb, p7values.voffset, p7values.vlength, TRUE); + break; + default: + break; + } + switch (p8values.vtype) { + case 1: /* uint8 */ + break; + case 2: /* uint16 */ + break; + case 3: /* uint32 */ + proto_tree_add_uint_format(ncp_tree, p8values.hfname, tvb, p8values.voffset, + p8values.vlength, p8values.vvalue, p8values.vdesc, + p8values.vvalue); + break; + case 4: /* string */ + proto_tree_add_string_format(ncp_tree, p8values.hfname, tvb, p8values.voffset, + p8values.vlength, p8values.vstring, p8values.vdesc, p8values.vstring); + if (p8values.mvtype == 1) + { + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_str(pinfo->cinfo, COL_INFO, p8values.vstring); + } + } + break; + case 5: /* boolean */ + process_bitfield(ncp_tree, tvb, &p8values); + break; + case 6: /*multivalue uint32 */ + process_multivalues(ncp_tree, tvb, &p8values); + if (p8values.mvtype == 1 || p8values.mvtype == 10) + { + if (p8values.mvtype == 10) + { + global_object_name = p8values.vstring; + } + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_str(pinfo->cinfo, COL_INFO, p8values.vstring); + } + } + break; + case 7: /* Bytes */ + proto_tree_add_bytes(ncp_tree, p8values.hfname, tvb, p8values.voffset, + p8values.vlength, tvb_get_ptr(tvb, p8values.voffset, p8values.vvalue)); + break; + case 8: + proto_tree_add_item(ncp_tree, p8values.hfname, tvb, p8values.voffset, p8values.vlength, TRUE); + break; + default: + break; + } + switch (p9values.vtype) { + case 1: /* uint8 */ + break; + case 2: /* uint16 */ + break; + case 3: /* uint32 */ + proto_tree_add_uint_format(ncp_tree, p9values.hfname, tvb, p9values.voffset, + p9values.vlength, p9values.vvalue, p9values.vdesc, + p9values.vvalue); + break; + case 4: /* string */ + proto_tree_add_string_format(ncp_tree, p9values.hfname, tvb, p9values.voffset, + p9values.vlength, p9values.vstring, p9values.vdesc, p9values.vstring); + if (p9values.mvtype == 1) + { + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_str(pinfo->cinfo, COL_INFO, p9values.vstring); + } + } + break; + case 5: /* boolean */ + process_bitfield(ncp_tree, tvb, &p9values); + break; + case 6: /*multivalue uint32 */ + process_multivalues(ncp_tree, tvb, &p9values); + if (p9values.mvtype == 1 || p9values.mvtype == 10) + { + if (p9values.mvtype == 10) + { + global_object_name = p9values.vstring; + } + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_str(pinfo->cinfo, COL_INFO, p9values.vstring); + } + } + break; + case 7: /* Bytes */ + proto_tree_add_bytes(ncp_tree, p9values.hfname, tvb, p9values.voffset, + p9values.vlength, tvb_get_ptr(tvb, p9values.voffset, p9values.vvalue)); + break; + case 8: + proto_tree_add_item(ncp_tree, p9values.hfname, tvb, p9values.voffset, p9values.vlength, TRUE); + break; + default: + break; + } + if(resolve_eid) { + + /* For NDS requests with just an EID, resolve name from hash table. */ + request_eid_value = ncp_eid_hash_lookup(conversation, global_eid); + if (request_eid_value) { + global_object_name = request_eid_value->object_name; + if (check_col(pinfo->cinfo, COL_INFO)) + { + col_append_str(pinfo->cinfo, COL_INFO, ", Object Name - "); + col_append_str(pinfo->cinfo, COL_INFO, global_object_name); + } + } + } + } + if (request_value) + { + request_value->nds_request_verb = nds_verb; + request_value->nds_version = nds_version; + request_value->object_name = global_object_name; + request_value->req_nds_flags = global_flags; + } + } + break; + + default: + ; /* nothing */ + break; + } + ptvcursor_free(ptvc); + + /* Free the temporary proto_tree */ + CLEANUP_CALL_AND_POP; + } +} + + +void +dissect_ping_req(tvbuff_t *tvb, packet_info *pinfo, + guint16 nw_connection, guint8 sequence, + guint16 type, proto_tree *ncp_tree) +{ + guint8 func, subfunc = 0; + ncp_req_hash_value *request_value = NULL; + const ncp_record *ncp_rec = NULL; + conversation_t *conversation; + ptvcursor_t *ptvc = NULL; + proto_tree *temp_tree = NULL; + guint32 nds_version = 0; + gint length_remaining = 0; + char flags_str[1+3+1+3+1+3+1+3+1+1]; + char * sep = NULL; + proto_tree *flags_tree; + guint32 nds_flags; + proto_item *tinew; + guint32 nds_flag_tree = 0x00020000; + guint32 nds_flag_depth = 0x00000002; + guint32 nds_flag_rev = 0x00000004; + guint32 nds_flag_flags = 0x00000008; + int ett_nds_flags; + + func = tvb_get_guint8(tvb, 6); + subfunc = tvb_get_guint8(tvb, 7); + + ncp_rec = ncp_record_find(func, subfunc); - /* Get NDS Verb */ - if (nds_frag == 0xffffffff) { - nds_verb = tvb_get_guint8(tvb, 24); - if (nds_verb == 0xfe) { - nds_verb = tvb_get_guint8(tvb, 32); - } - verb_string = match_strval(nds_verb, ncp_nds_verb_vals); - if (verb_string == NULL) { - verb_string = "NDS Continuation Fragment"; - } - } /* Fill in the INFO column. */ - if (check_col(pinfo->cinfo, COL_INFO)) { - if (ncp_rec) { - - col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDS"); - if (nds_frag != 0xffffffff) { - col_add_fstr(pinfo->cinfo, COL_INFO, "Continuation Fragment"); - } - else { - col_add_fstr(pinfo->cinfo, COL_INFO, "C NDS %s", verb_string); - } - } - else { - col_add_fstr(pinfo->cinfo, COL_INFO, - "C Unknown Function %d (0x%02x)", - func, func); - } - - } - 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 - came, and the address and connection to which the request - is being sent, so that we can match up calls with replies. - (We don't include the sequence number, as we may want - to have all packets over the same connection treated + if (check_col(pinfo->cinfo, COL_INFO)) + { + if (ncp_rec) + { + + col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDS"); + col_add_fstr(pinfo->cinfo, COL_INFO, "C Ping for NDS"); + } + + } + 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 + came, and the address and connection to which the request + is being sent, so that we can match up calls with replies. + (We don't include the sequence number, as we may want + to have all packets over the same connection treated as being part of a single conversation so that we can - let the user select that conversation to be displayed.) */ - + let the user select that conversation to be displayed.) */ + conversation = find_conversation(&pinfo->src, &pinfo->dst, PT_NCP, nw_connection, nw_connection, 0); - - if (conversation == NULL) { + + if (conversation == NULL) + { /* It's not part of any conversation - create a new one. */ conversation = conversation_new(&pinfo->src, &pinfo->dst, PT_NCP, nw_connection, nw_connection, 0); } - + request_value = ncp_hash_insert(conversation, sequence, ncp_rec); request_value->req_frame_num = pinfo->fd->num; - + /* If this is the first time we're examining the packet, * check to see if this NCP type uses a "request condition". * If so, we have to build a proto_tree because request conditions @@ -1148,17 +8253,19 @@ dissect_nds_request(tvbuff_t *tvb, packet_info *pinfo, * display filters can't possibly work. If we already have * a proto_tree, then wonderful. If we don't, we need to build * one. */ - if (ncp_rec && ncp_tree == NULL) { - proto_item *ti; - - temp_tree = proto_tree_create_root(); - proto_tree_set_visible(temp_tree, FALSE); - ti = proto_tree_add_item(temp_tree, proto_ncp, tvb, 0, -1, FALSE); - ncp_tree = proto_item_add_subtree(ti, ett_ncp); + if (ncp_rec) + { + proto_item *ti; + + temp_tree = proto_tree_create_root(); + proto_tree_set_visible(temp_tree, FALSE); + ti = proto_tree_add_item(temp_tree, proto_ncp, tvb, 0, -1, FALSE); + ncp_tree = proto_item_add_subtree(ti, ett_ncp); } } - - if (ncp_tree) { + + if (ncp_tree) + { /* If the dissection throws an exception, be sure to free * the temporary proto_tree that was created. Because of the * way the CLEANUP_PUSH macro works, we can't put it in an 'if' @@ -1166,43 +8273,90 @@ dissect_nds_request(tvbuff_t *tvb, packet_info *pinfo, * CLEANUP_POP or CLEANUP_POP_AND_ALLOC. So, we always * call CLEANUP_POP and friends, but the value of temp_tree is * NULL if no cleanup is needed, and non-null if cleanup is needed. - */ - + */ + CLEANUP_PUSH(free_proto_tree, temp_tree); - + conversation = find_conversation(&pinfo->src, &pinfo->dst, PT_NCP, nw_connection, nw_connection, 0); - - switch (type) { - case NCP_BROADCAST_SLOT: + + switch (type) + { + case NCP_BROADCAST_SLOT: ; /* nothing */ break; - + case NCP_SERVICE_REQUEST: proto_tree_add_uint_format(ncp_tree, hf_ncp_func, tvb, 6, 1, func, "Function: %d (0x%02X), %s", func, func, ncp_rec ? ncp_rec->name : "Unknown"); - + proto_tree_add_uint_format(ncp_tree, hf_ncp_subfunc, tvb, 7, 1, subfunc, "SubFunction: %d (0x%02x)", subfunc, subfunc); - - proto_tree_add_uint(ncp_tree, hf_ncp_fragment_handle, tvb, 8, 4, - nds_frag); - - if (nds_frag == 0xffffffff) { - proto_tree_add_item(ncp_tree, hf_ncp_fragment_size, tvb, 12, 4, TRUE); - proto_tree_add_item(ncp_tree, hf_ncp_message_size, tvb, 16, 4, TRUE); - proto_tree_add_item(ncp_tree, hf_ncp_nds_flag, tvb, 20, 4, FALSE); - proto_tree_add_uint_format(ncp_tree, hf_ncp_nds_verb, tvb, 24, 1, - nds_verb, "NDS Verb: %u, (0x%02x), %s", - nds_verb, nds_verb, verb_string); - } + + proto_tree_add_uint_format(ncp_tree, hf_nds_version, tvb, 8, 4, + nds_version, "NDS Version: (0x%x)", + nds_version); + + length_remaining = tvb_length_remaining(tvb, 8); + if (length_remaining > 6) + { + nds_flags = tvb_get_letohl(tvb, 12); + strcpy(flags_str, " "); + sep = "("; + if (nds_flags & nds_flag_tree) + { + strcat(flags_str, sep); + strcat(flags_str, "Tree"); + sep = ","; + } + if (nds_flags & nds_flag_depth) + { + strcat(flags_str, sep); + strcat(flags_str, "Depth"); + sep = ","; + } + if (nds_flags & nds_flag_rev) + { + strcat(flags_str, sep); + strcat(flags_str, "Revision"); + } + if (nds_flags & nds_flag_flags) + { + strcat(flags_str, sep); + strcat(flags_str, "Flags"); + } + if (flags_str[0] != '\0') + { + strcat(flags_str, ")"); + tinew = proto_tree_add_uint_format(ncp_tree, hf_nds_flags, + tvb, 12, 4, nds_flags, "Flags: 0x%08x -%s", nds_flags, + flags_str); + + flags_tree = proto_item_add_subtree(tinew, ett_nds); + + if(request_value) + { + request_value->req_nds_flags = nds_flags; + } + + proto_tree_add_item(flags_tree, hf_nds_flags_tree, + tvb, 12, 4, TRUE); + proto_tree_add_item(flags_tree, hf_nds_flags_flags, + tvb, 12, 4, TRUE); + proto_tree_add_item(flags_tree, hf_nds_flags_rev, + tvb, 12, 4, TRUE); + proto_tree_add_item(flags_tree, hf_nds_flags_depth, + tvb, 12, 4, TRUE); + } + } break; default: ; /* nothing */ break; + } ptvc = ptvcursor_new(ncp_tree, tvb, 7); if (ncp_rec && ncp_rec->request_ptvc) { @@ -1214,4 +8368,5 @@ dissect_nds_request(tvbuff_t *tvb, packet_info *pinfo, /* Free the temporary proto_tree */ CLEANUP_CALL_AND_POP; } + } |