From Solomon Peachy: WEP cleanups, WEP decryption support and other
[obnox/wireshark/wip.git] / ncp2222.py
1 #!/usr/bin/env python
2
3 """
4 Creates C code from a table of NCP type 0x2222 packet types.
5 (And 0x3333, which are the replies, but the packets are more commonly
6 refered to as type 0x2222; the 0x3333 replies are understood to be
7 part of the 0x2222 "family")
8
9 The data-munging code was written by Gilbert Ramirez.
10 The NCP data comes from Greg Morris <GMORRIS@novell.com>.
11 Many thanks to Novell for letting him work on this.
12
13 Additional data sources:
14 "Programmer's Guide to the NetWare Core Protocol" by Steve Conner and Dianne Conner.
15
16 Novell provides info at:
17
18 http://developer.novell.com/ndk  (where you can download an *.exe file which
19 installs a PDF)
20
21 or
22
23 http://developer.novell.com/ndk/doc/docui/index.htm#../ncp/ncp__enu/data/
24 for a badly-formatted HTML version of the same PDF.
25
26
27 $Id: ncp2222.py,v 1.28 2002/06/09 01:36:43 guy Exp $
28
29
30 Copyright (c) 2000-2002 by Gilbert Ramirez <gram@alumni.rice.edu>
31 and Greg Morris <GMORRIS@novell.com>.
32
33 This program is free software; you can redistribute it and/or
34 modify it under the terms of the GNU General Public License
35 as published by the Free Software Foundation; either version 2
36 of the License, or (at your option) any later version.
37  
38 This program is distributed in the hope that it will be useful,
39 but WITHOUT ANY WARRANTY; without even the implied warranty of
40 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
41 GNU General Public License for more details.
42  
43 You should have received a copy of the GNU General Public License
44 along with this program; if not, write to the Free Software
45 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
46 """
47
48 import os
49 import sys
50 import string
51 import getopt
52 import traceback
53
54 errors          = {}
55 groups          = {}
56 packets         = []
57 compcode_lists  = None
58 ptvc_lists      = None
59 msg             = None
60         
61         
62 REC_START       = 0
63 REC_LENGTH      = 1
64 REC_FIELD       = 2
65 REC_ENDIANNESS  = 3
66 REC_VAR         = 4
67 REC_REPEAT      = 5
68 REC_REQ_COND    = 6
69
70 NO_VAR          = -1
71 NO_REPEAT       = -1
72 NO_REQ_COND     = -1
73 NO_LENGTH_CHECK = -2
74
75 PROTO_LENGTH_UNKNOWN    = -1
76
77 global_highest_var = -1
78 global_req_cond = {}
79
80
81 REQ_COND_SIZE_VARIABLE = "REQ_COND_SIZE_VARIABLE"
82 REQ_COND_SIZE_CONSTANT = "REQ_COND_SIZE_CONSTANT"
83
84 ##############################################################################
85 # Global containers
86 ##############################################################################
87
88 class UniqueCollection:
89         """The UniqueCollection class stores objects which can be compared to other
90         objects of the same class. If two objects in the collection are equivalent,
91         only one is stored."""
92
93         def __init__(self, name):
94                 "Constructor"
95                 self.name = name
96                 self.members = []
97                 self.member_reprs = {}
98
99         def Add(self, object):
100                 """Add an object to the members lists, if a comparable object
101                 doesn't already exist. The object that is in the member list, that is
102                 either the object that was added or the comparable object that was
103                 already in the member list, is returned."""
104
105                 r = repr(object)
106                 # Is 'object' a duplicate of some other member?
107                 if self.member_reprs.has_key(r):
108                         return self.member_reprs[r]
109                 else:
110                         self.member_reprs[r] = object
111                         self.members.append(object)
112                         return object
113
114         def Members(self):
115                 "Returns the list of members."
116                 return self.members
117
118         def HasMember(self, object):
119                 "Does the list of members contain the object?"
120                 if self.members_reprs.has_key(repr(object)):
121                         return 1
122                 else:
123                         return 0
124
125 # This list needs to be defined before the NCP types are defined,
126 # because the NCP types are defined in the global scope, not inside
127 # a function's scope.
128 ptvc_lists      = UniqueCollection('PTVC Lists')
129
130 ##############################################################################
131
132 class NamedList:
133         "NamedList's keep track of PTVC's and Completion Codes"
134         def __init__(self, name, list):
135                 "Constructor"
136                 self.name = name
137                 self.list = list
138
139         def __cmp__(self, other):
140                 "Compare this NamedList to another"
141
142                 if isinstance(other, NamedList):
143                         return cmp(self.list, other.list)
144                 else:
145                         return 0
146
147
148         def Name(self, new_name = None):
149                 "Get/Set name of list"
150                 if new_name != None:
151                         self.name = new_name
152                 return self.name
153
154         def Records(self):
155                 "Returns record lists"
156                 return self.list
157
158         def Null(self):
159                 "Is there no list (different from an empty list)?"
160                 return self.list == None
161
162         def Empty(self):
163                 "It the list empty (different from a null list)?"
164                 assert(not self.Null())
165
166                 if self.list:
167                         return 0
168                 else:
169                         return 1
170
171         def __repr__(self):
172                 return repr(self.list)
173
174 class PTVC(NamedList):
175         """ProtoTree TVBuff Cursor List ("PTVC List") Class"""
176
177         def __init__(self, name, records):
178                 "Constructor"
179                 NamedList.__init__(self, name, [])
180
181                 global global_highest_var
182
183                 expected_offset = None
184                 highest_var = -1
185
186                 named_vars = {}
187
188                 # Make a PTVCRecord object for each list in 'records'
189                 for record in records:
190                         offset = record[REC_START]
191                         length = record[REC_LENGTH]
192                         field = record[REC_FIELD]
193                         endianness = record[REC_ENDIANNESS]
194
195                         # Variable
196                         var_name = record[REC_VAR]
197                         if var_name:
198                                 # Did we already define this var?
199                                 if named_vars.has_key(var_name):
200                                         sys.exit("%s has multiple %s vars." % \
201                                                 (name, var_name))
202
203                                 highest_var = highest_var + 1
204                                 var = highest_var
205                                 if highest_var > global_highest_var:
206                                         global_highest_var = highest_var
207                                 named_vars[var_name] = var
208                         else:
209                                 var = NO_VAR
210
211                         # Repeat
212                         repeat_name = record[REC_REPEAT]
213                         if repeat_name:
214                                 # Do we have this var?
215                                 if not named_vars.has_key(repeat_name):
216                                         sys.exit("%s does not have %s var defined." % \
217                                                 (name, var_name))
218                                 repeat = named_vars[repeat_name]
219                         else:
220                                 repeat = NO_REPEAT
221
222                         # Request Condition
223                         req_cond = record[REC_REQ_COND]
224                         if req_cond != NO_REQ_COND:
225                                 global_req_cond[req_cond] = None
226
227                         ptvc_rec = PTVCRecord(field, length, endianness, var, repeat, req_cond)
228
229                         if expected_offset == None:
230                                 expected_offset = offset
231
232                         elif expected_offset == -1:
233                                 pass
234
235                         elif expected_offset != offset and offset != -1:
236                                 msg.write("Expected offset in %s for %s to be %d\n" % \
237                                         (name, field.HFName(), expected_offset))
238                                 sys.exit(1)
239
240                         # We can't make a PTVC list from a variable-length
241                         # packet, unless the fields can tell us at run time
242                         # how long the packet is. That is, nstring8 is fine, since
243                         # the field has an integer telling us how long the string is.
244                         # Fields that don't have a length determinable at run-time
245                         # cannot be variable-length.
246                         if type(ptvc_rec.Length()) == type(()):
247                                 if isinstance(ptvc_rec.Field(), nstring):
248                                         expected_offset = -1
249                                         pass
250                                 elif isinstance(ptvc_rec.Field(), nbytes):
251                                         expected_offset = -1
252                                         pass
253                                 elif isinstance(ptvc_rec.Field(), struct):
254                                         expected_offset = -1
255                                         pass
256                                 else:
257                                         field = ptvc_rec.Field()
258                                         assert 0, "Cannot make PTVC from %s, type %s" % \
259                                                 (field.HFName(), field)
260
261                         elif expected_offset > -1:
262                                 if ptvc_rec.Length() < 0:
263                                         expected_offset = -1
264                                 else:
265                                         expected_offset = expected_offset + ptvc_rec.Length()
266
267
268                         self.list.append(ptvc_rec)
269
270         def ETTName(self):
271                 return "ett_%s" % (self.Name(),)
272
273
274         def Code(self):
275                 x =  "static const ptvc_record %s[] = {\n" % (self.Name())
276                 for ptvc_rec in self.list:
277                         x = x +  "\t%s,\n" % (ptvc_rec.Code())
278                 x = x + "\t{ NULL, 0, NULL, NO_ENDIANNESS, NO_VAR, NO_REPEAT, NO_REQ_COND, NCP_FMT_NONE }\n"
279                 x = x + "};\n"
280                 return x
281
282         def __repr__(self):
283                 x = ""
284                 for ptvc_rec in self.list:
285                         x = x + repr(ptvc_rec)
286                 return x
287
288
289 class PTVCBitfield(PTVC):
290         def __init__(self, name, vars):
291                 NamedList.__init__(self, name, [])
292
293                 for var in vars:
294                         ptvc_rec = PTVCRecord(var, var.Length(), var.Endianness(),
295                                 NO_VAR, NO_REPEAT, NO_REQ_COND)
296                         self.list.append(ptvc_rec)
297
298         def Code(self):
299                 ett_name = self.ETTName()
300                 x = "static gint %s;\n" % (ett_name,)
301
302                 x = x + "static const ptvc_record ptvc_%s[] = {\n" % (self.Name())
303                 for ptvc_rec in self.list:
304                         x = x +  "\t%s,\n" % (ptvc_rec.Code())
305                 x = x + "\t{ NULL, 0, NULL, NO_ENDIANNESS, NO_VAR, NO_REPEAT, NO_REQ_COND, NCP_FMT_NONE }\n"
306                 x = x + "};\n"
307
308                 x = x + "static const sub_ptvc_record %s = {\n" % (self.Name(),)
309                 x = x + "\t&%s,\n" % (ett_name,)
310                 x = x + "\tNULL,\n"
311                 x = x + "\tptvc_%s,\n" % (self.Name(),)
312                 x = x + "};\n"
313                 return x
314
315
316 class PTVCRecord:
317         def __init__(self, field, length, endianness, var, repeat, req_cond):
318                 "Constructor"
319                 self.field      = field
320                 self.length     = length
321                 self.endianness = endianness
322                 self.var        = var
323                 self.repeat     = repeat
324                 self.req_cond   = req_cond
325
326         def __cmp__(self, other):
327                 "Comparison operator"
328                 if self.field != other.field:
329                         return 1
330                 elif self.length < other.length:
331                         return -1
332                 elif self.length > other.length:
333                         return 1
334                 elif self.endianness != other.endianness:
335                         return 1
336                 else:
337                         return 0
338
339         def Code(self):
340                 # Nice textual representations
341                 if self.var == NO_VAR:
342                         var = "NO_VAR"
343                 else:
344                         var = self.var
345
346                 if self.repeat == NO_REPEAT:
347                         repeat = "NO_REPEAT"
348                 else:
349                         repeat = self.repeat
350
351                 if self.req_cond == NO_REQ_COND:
352                         req_cond = "NO_REQ_COND"
353                 else:
354                         req_cond = global_req_cond[self.req_cond]
355                         assert req_cond != None
356
357                 if isinstance(self.field, struct):
358                         return self.field.ReferenceString(var, repeat, req_cond)
359                 else:
360                         return self.RegularCode(var, repeat, req_cond)
361
362         def RegularCode(self, var, repeat, req_cond):
363                 "String representation"
364                 endianness = 'BE'
365                 if self.endianness == LE:
366                         endianness = 'LE'
367
368                 length = None
369
370                 if type(self.length) == type(0):
371                         length = self.length
372                 else:
373                         # This is for cases where a length is needed
374                         # in order to determine a following variable-length,
375                         # like nstring8, where 1 byte is needed in order
376                         # to determine the variable length.
377                         var_length = self.field.Length()
378                         if var_length > 0:
379                                 length = var_length
380
381                 if length == PROTO_LENGTH_UNKNOWN:
382                         # XXX length = "PROTO_LENGTH_UNKNOWN"
383                         pass
384
385                 assert length, "Length not handled for %s" % (self.field.HFName(),)
386
387                 sub_ptvc_name = self.field.PTVCName()
388                 if sub_ptvc_name != "NULL":
389                         sub_ptvc_name = "&%s" % (sub_ptvc_name,)
390
391
392                 return "{ &%s, %s, %s, %s, %s, %s, %s, %s }" % \
393                         (self.field.HFName(), length, sub_ptvc_name, 
394                         endianness, var, repeat, req_cond,
395                         self.field.SpecialFmt())
396
397         def Offset(self):
398                 return self.offset
399
400         def Length(self):
401                 return self.length
402
403         def Field(self):
404                 return self.field
405
406         def __repr__(self):
407                 return "{%s len=%s end=%s var=%s rpt=%s rqc=%s}" % \
408                         (self.field.HFName(), self.length,
409                         self.endianness, self.var, self.repeat, self.req_cond)
410
411 ##############################################################################
412
413 class NCP:
414         "NCP Packet class"
415         def __init__(self, func_code, description, group, has_length=1):
416                 "Constructor"
417                 self.func_code          = func_code
418                 self.description        = description
419                 self.group              = group
420                 self.codes              = None
421                 self.request_records    = None
422                 self.reply_records      = None
423                 self.has_length         = has_length
424                 self.req_cond_size      = None
425                 self.req_info_str       = None
426
427                 if not groups.has_key(group):
428                         msg.write("NCP 0x%x has invalid group '%s'\n" % \
429                                 (self.func_code, group))
430                         sys.exit(1)
431
432                 if self.HasSubFunction():
433                         # NCP Function with SubFunction
434                         self.start_offset = 10
435                 else:
436                         # Simple NCP Function
437                         self.start_offset = 7
438
439         def ReqCondSize(self):
440                 return self.req_cond_size
441
442         def ReqCondSizeVariable(self):
443                 self.req_cond_size = REQ_COND_SIZE_VARIABLE
444
445         def ReqCondSizeConstant(self):
446                 self.req_cond_size = REQ_COND_SIZE_CONSTANT
447
448         def FunctionCode(self, part=None):
449                 "Returns the function code for this NCP packet."
450                 if part == None:
451                         return self.func_code
452                 elif part == 'high':
453                         if self.HasSubFunction():
454                                 return (self.func_code & 0xff00) >> 8
455                         else:
456                                 return self.func_code
457                 elif part == 'low':
458                         if self.HasSubFunction():
459                                 return self.func_code & 0x00ff
460                         else:
461                                 return 0x00
462                 else:
463                         msg.write("Unknown directive '%s' for function_code()\n" % (part))
464                         sys.exit(1)
465
466         def HasSubFunction(self):
467                 "Does this NPC packet require a subfunction field?"
468                 if self.func_code <= 0xff:
469                         return 0
470                 else:
471                         return 1
472
473         def HasLength(self):
474                 return self.has_length
475
476         def Description(self):
477                 return self.description
478
479         def Group(self):
480                 return self.group
481
482         def PTVCRequest(self):
483                 return self.ptvc_request
484
485         def PTVCReply(self):
486                 return self.ptvc_reply
487
488         def Request(self, size, records=[], **kwargs):
489                 self.request_size = size
490                 self.request_records = records
491                 if self.HasSubFunction():
492                         if self.HasLength():
493                                 self.CheckRecords(size, records, "Request", 10)
494                         else:
495                                 self.CheckRecords(size, records, "Request", 8)
496                 else:
497                         self.CheckRecords(size, records, "Request", 7)
498                 self.ptvc_request = self.MakePTVC(records, "request")
499
500                 if kwargs.has_key("info_str"):
501                         self.req_info_str = kwargs["info_str"]
502
503         def Reply(self, size, records=[]):
504                 self.reply_size = size
505                 self.reply_records = records
506                 self.CheckRecords(size, records, "Reply", 8)
507                 self.ptvc_reply = self.MakePTVC(records, "reply")
508
509         def CheckRecords(self, size, records, descr, min_hdr_length):
510                 "Simple sanity check"
511                 if size == NO_LENGTH_CHECK:
512                         return
513                 min = size
514                 max = size
515                 if type(size) == type(()):
516                         min = size[0]
517                         max = size[1]
518
519                 lower = min_hdr_length
520                 upper = min_hdr_length
521
522                 for record in records:
523                         rec_size = record[REC_LENGTH]
524                         rec_lower = rec_size
525                         rec_upper = rec_size
526                         if type(rec_size) == type(()):
527                                 rec_lower = rec_size[0]
528                                 rec_upper = rec_size[1]
529
530                         lower = lower + rec_lower
531                         upper = upper + rec_upper
532
533                 error = 0
534                 if min != lower:
535                         msg.write("%s records for 2222/0x%x sum to %d bytes minimum, but param1 shows %d\n" \
536                                 % (descr, self.FunctionCode(), lower, min))
537                         error = 1
538                 if max != upper:
539                         msg.write("%s records for 2222/0x%x sum to %d bytes maximum, but param1 shows %d\n" \
540                                 % (descr, self.FunctionCode(), upper, max))
541                         error = 1
542
543                 if error == 1:
544                         sys.exit(1)
545
546
547         def MakePTVC(self, records, name_suffix):
548                 """Makes a PTVC out of a request or reply record list. Possibly adds
549                 it to the global list of PTVCs (the global list is a UniqueCollection,
550                 so an equivalent PTVC may already be in the global list)."""
551
552                 name = "%s_%s" % (self.CName(), name_suffix)
553                 ptvc = PTVC(name, records)
554                 return ptvc_lists.Add(ptvc)
555
556         def CName(self):
557                 "Returns a C symbol based on the NCP function code"
558                 return "ncp_0x%x" % (self.func_code)
559
560         def InfoStrName(self):
561                 "Returns a C symbol based on the NCP function code, for the info_str"
562                 return "info_str_0x%x" % (self.func_code)
563
564         def Variables(self):
565                 """Returns a list of variables used in the request and reply records.
566                 A variable is listed only once, even if it is used twice (once in
567                 the request, once in the reply)."""
568
569                 variables = {}
570                 if self.request_records:
571                         for record in self.request_records:
572                                 var = record[REC_FIELD]
573                                 variables[var.HFName()] = var
574
575                                 sub_vars = var.SubVariables()
576                                 for sv in sub_vars:
577                                         variables[sv.HFName()] = sv
578
579                 if self.reply_records:
580                         for record in self.reply_records:
581                                 var = record[REC_FIELD]
582                                 variables[var.HFName()] = var
583
584                                 sub_vars = var.SubVariables()
585                                 for sv in sub_vars:
586                                         variables[sv.HFName()] = sv
587
588                 return variables.values()
589
590         def CalculateReqConds(self):
591                 """Returns a list of request conditions (dfilter text) used
592                 in the reply records. A request condition is listed only once,
593                 even it it used twice. """
594                 texts = {}
595                 if self.reply_records:
596                         for record in self.reply_records:
597                                 text = record[REC_REQ_COND]
598                                 if text != NO_REQ_COND:
599                                         texts[text] = None
600
601                 if len(texts) == 0:
602                         self.req_conds = None
603                         return None
604
605                 dfilter_texts = texts.keys()
606                 dfilter_texts.sort()
607                 name = "%s_req_cond_indexes" % (self.CName(),)
608                 return NamedList(name, dfilter_texts)
609
610         def GetReqConds(self):
611                 return self.req_conds
612
613         def SetReqConds(self, new_val):
614                 self.req_conds = new_val
615
616
617         def CompletionCodes(self, codes=None):
618                 """Sets or returns the list of completion
619                 codes. Internally, a NamedList is used to store the
620                 completion codes, but the caller of this function never
621                 realizes that because Python lists are the input and
622                 output."""
623
624                 if codes == None:
625                         return self.codes
626
627                 # Sanity check
628                 okay = 1
629                 for code in codes:
630                         if not errors.has_key(code):
631                                 msg.write("Errors table does not have key 0x%04x for NCP=0x%x\n" % (code,
632                                         self.func_code))
633                                 okay = 0
634
635                 # Delay the exit until here so that the programmer can get
636                 # the complete list of missing error codes
637                 if not okay:
638                         sys.exit(1)
639
640                 # Create CompletionCode (NamedList) object and possible
641                 # add it to  the global list of completion code lists.
642                 name = "%s_errors" % (self.CName(),)
643                 codes.sort()
644                 codes_list = NamedList(name, codes)
645                 self.codes = compcode_lists.Add(codes_list)
646
647                 self.Finalize()
648
649         def Finalize(self):
650                 """Adds the NCP object to the global collection of NCP
651                 objects. This is done automatically after setting the
652                 CompletionCode list. Yes, this is a shortcut, but it makes
653                 our list of NCP packet definitions look neater, since an
654                 explicit "add to global list of packets" is not needed."""
655
656                 # Add packet to global collection of packets
657                 packets.append(self)
658
659 def rec(start, length, field, endianness=None, **kw):
660         return _rec(start, length, field, endianness, kw)
661
662 def srec(field, endianness=None, **kw):
663         return _rec(-1, -1, field, endianness, kw)
664
665 def _rec(start, length, field, endianness, kw):
666         # If endianness not explicitly given, use the field's
667         # default endiannes.
668         if endianness == None:
669                 endianness = field.Endianness()
670
671         # Setting a var?
672         if kw.has_key("var"):
673                 # Is the field an INT ?
674                 if not isinstance(field, CountingNumber):
675                         sys.exit("Field %s used as count variable, but not integer." \
676                                 % (field.HFName()))
677                 var = kw["var"]
678         else:
679                 var = None
680
681         # If 'var' not used, 'repeat' can be used.
682         if not var and kw.has_key("repeat"):
683                 repeat = kw["repeat"]
684         else:
685                 repeat = None
686
687         # Request-condition ?
688         if kw.has_key("req_cond"):
689                 req_cond = kw["req_cond"]
690         else:
691                 req_cond = NO_REQ_COND
692
693         return [start, length, field, endianness, var, repeat, req_cond]
694
695
696
697
698 ##############################################################################
699
700 LE              = 1             # Little-Endian
701 BE              = 0             # Big-Endian
702 NA              = -1            # Not Applicable
703
704 class Type:
705         " Virtual class for NCP field types"
706         type            = "Type"
707         ftype           = None
708         disp            = "BASE_DEC"
709         endianness      = NA
710         values          = []
711
712         def __init__(self, abbrev, descr, bytes, endianness = NA):
713                 self.abbrev = abbrev
714                 self.descr = descr
715                 self.bytes = bytes
716                 self.endianness = endianness
717                 self.hfname = "hf_ncp_" + self.abbrev
718                 self.special_fmt = "NCP_FMT_NONE"
719
720         def Length(self):
721                 return self.bytes
722
723         def Abbreviation(self):
724                 return self.abbrev
725
726         def Description(self):
727                 return self.descr
728
729         def HFName(self):
730                 return self.hfname
731
732         def DFilter(self):
733                 return "ncp." + self.abbrev
734
735         def EtherealFType(self):
736                 return self.ftype
737
738         def Display(self, newval=None):
739                 if newval != None:
740                         self.disp = newval
741                 return self.disp
742
743         def ValuesName(self):
744                 return "NULL"
745
746         def Mask(self):
747                 return 0
748
749         def Endianness(self):
750                 return self.endianness
751
752         def SubVariables(self):
753                 return []
754
755         def PTVCName(self):
756                 return "NULL"
757
758         def NWDate(self):
759                 self.special_fmt = "NCP_FMT_NW_DATE"
760
761         def NWTime(self):
762                 self.special_fmt = "NCP_FMT_NW_TIME"
763
764         def SpecialFmt(self):
765                 return self.special_fmt
766
767         def __cmp__(self, other):
768                 return cmp(self.hfname, other.hfname)
769
770 class struct(PTVC, Type):
771         def __init__(self, name, items, descr=None):
772                 name = "struct_%s" % (name,)
773                 NamedList.__init__(self, name, [])
774
775                 self.bytes = 0
776                 self.descr = descr
777                 for item in items:
778                         if isinstance(item, Type):
779                                 field = item
780                                 length = field.Length()
781                                 endianness = field.Endianness()
782                                 var = NO_VAR
783                                 repeat = NO_REPEAT
784                                 req_cond = NO_REQ_COND
785                         elif type(item) == type([]):
786                                 field = item[REC_FIELD]
787                                 length = item[REC_LENGTH]
788                                 endianness = item[REC_ENDIANNESS]
789                                 var = item[REC_VAR]
790                                 repeat = item[REC_REPEAT]
791                                 req_cond = item[REC_REQ_COND]
792                         else:
793                                 assert 0, "Item %s item not handled." % (item,)
794
795                         ptvc_rec = PTVCRecord(field, length, endianness, var,
796                                 repeat, req_cond)
797                         self.list.append(ptvc_rec)
798                         self.bytes = self.bytes + field.Length()
799
800                 self.hfname = self.name
801
802         def Variables(self):
803                 vars = []
804                 for ptvc_rec in self.list:
805                         vars.append(ptvc_rec.Field())
806                 return vars
807
808         def ReferenceString(self, var, repeat, req_cond):
809                 return "{ PTVC_STRUCT, NO_LENGTH, &%s, NO_ENDIANNESS, %s, %s, %s, NCP_FMT_NONE }" % \
810                         (self.name, var, repeat, req_cond)
811
812         def Code(self):
813                 ett_name = self.ETTName()
814                 x = "static gint %s;\n" % (ett_name,)
815                 x = x + "static const ptvc_record ptvc_%s[] = {\n" % (self.name,)
816                 for ptvc_rec in self.list:
817                         x = x +  "\t%s,\n" % (ptvc_rec.Code())
818                 x = x + "\t{ NULL, NO_LENGTH, NULL, NO_ENDIANNESS, NO_VAR, NO_REPEAT, NO_REQ_COND, NCP_FMT_NONE }\n"
819                 x = x + "};\n"
820
821                 x = x + "static const sub_ptvc_record %s = {\n" % (self.name,)
822                 x = x + "\t&%s,\n" % (ett_name,)
823                 if self.descr:
824                         x = x + '\t"%s",\n' % (self.descr,)
825                 else:
826                         x = x + "\tNULL,\n"
827                 x = x + "\tptvc_%s,\n" % (self.Name(),)
828                 x = x + "};\n"
829                 return x
830
831         def __cmp__(self, other):
832                 return cmp(self.HFName(), other.HFName())
833
834
835 class byte(Type):
836         type    = "byte"
837         ftype   = "FT_UINT8"
838         def __init__(self, abbrev, descr):
839                 Type.__init__(self, abbrev, descr, 1)
840
841 class CountingNumber:
842         pass
843
844 # Same as above. Both are provided for convenience
845 class uint8(Type, CountingNumber):
846         type    = "uint8"
847         ftype   = "FT_UINT8"
848         bytes   = 1
849         def __init__(self, abbrev, descr):
850                 Type.__init__(self, abbrev, descr, 1)
851
852 class uint16(Type, CountingNumber):
853         type    = "uint16"
854         ftype   = "FT_UINT16"
855         def __init__(self, abbrev, descr, endianness = LE):
856                 Type.__init__(self, abbrev, descr, 2, endianness)
857
858 class uint24(Type, CountingNumber):
859         type    = "uint24"
860         ftype   = "FT_UINT24"
861         def __init__(self, abbrev, descr, endianness = LE):
862                 Type.__init__(self, abbrev, descr, 3, endianness)
863
864 class uint32(Type, CountingNumber):
865         type    = "uint32"
866         ftype   = "FT_UINT32"
867         def __init__(self, abbrev, descr, endianness = LE):
868                 Type.__init__(self, abbrev, descr, 4, endianness)
869
870 class boolean8(uint8):
871         type    = "boolean8"
872         ftype   = "FT_BOOLEAN"
873
874 class boolean16(uint16):
875         type    = "boolean16"
876         ftype   = "FT_BOOLEAN"
877
878 class boolean24(uint24):
879         type    = "boolean24"
880         ftype   = "FT_BOOLEAN"
881
882 class boolean32(uint32):
883         type    = "boolean32"
884         ftype   = "FT_BOOLEAN"
885
886 class nstring:
887         pass
888
889 class nstring8(Type, nstring):
890         """A string of up to (2^8)-1 characters. The first byte
891         gives the string length."""
892
893         type    = "nstring8"
894         ftype   = "FT_UINT_STRING"
895         def __init__(self, abbrev, descr):
896                 Type.__init__(self, abbrev, descr, 1)
897
898 class nstring16(Type, nstring):
899         """A string of up to (2^16)-2 characters. The first 2 bytes
900         gives the string length."""
901
902         type    = "nstring16"
903         ftype   = "FT_UINT_STRING"
904         def __init__(self, abbrev, descr, endianness = LE):
905                 Type.__init__(self, abbrev, descr, 2, endianness)
906
907 class nstring32(Type, nstring):
908         """A string of up to (2^32)-4 characters. The first 4 bytes
909         gives the string length."""
910
911         type    = "nstring32"
912         ftype   = "FT_UINT_STRING"
913         def __init__(self, abbrev, descr, endianness = LE):
914                 Type.__init__(self, abbrev, descr, 4, endianness)
915
916 class fw_string(Type):
917         """A fixed-width string of n bytes."""
918
919         type    = "fw_string"
920         ftype   = "FT_STRING"
921
922         def __init__(self, abbrev, descr, bytes):
923                 Type.__init__(self, abbrev, descr, bytes)
924
925
926 class stringz(Type):
927         "NUL-terminated string, with a maximum length"
928
929         type    = "stringz"
930         ftype   = "FT_STRINGZ"
931         def __init__(self, abbrev, descr):
932                 Type.__init__(self, abbrev, descr, PROTO_LENGTH_UNKNOWN)
933
934 class val_string(Type):
935         """Abstract class for val_stringN, where N is number
936         of bits that key takes up."""
937
938         type    = "val_string"
939         disp    = 'BASE_HEX'
940
941         def __init__(self, abbrev, descr, val_string_array, endianness = LE):
942                 Type.__init__(self, abbrev, descr, self.bytes, endianness)
943                 self.values = val_string_array
944
945         def Code(self):
946                 result = "static const value_string %s[] = {\n" \
947                                 % (self.ValuesCName())
948                 for val_record in self.values:
949                         value   = val_record[0]
950                         text    = val_record[1]
951                         value_repr = self.value_format % value
952                         result = result + '\t{ %s,\t"%s" },\n' \
953                                         % (value_repr, text)
954
955                 value_repr = self.value_format % 0
956                 result = result + "\t{ %s,\tNULL },\n" % (value_repr)
957                 result = result + "};\n"
958
959                 return result
960
961         def ValuesCName(self):
962                 return "ncp_%s_vals" % (self.abbrev)
963
964         def ValuesName(self):
965                 return "VALS(%s)" % (self.ValuesCName())
966
967 class val_string8(val_string):
968         type            = "val_string8"
969         ftype           = "FT_UINT8"
970         bytes           = 1
971         value_format    = "0x%02x"
972
973 class val_string16(val_string):
974         type            = "val_string16"
975         ftype           = "FT_UINT16"
976         bytes           = 2
977         value_format    = "0x%04x"
978
979 class val_string32(val_string):
980         type            = "val_string32"
981         ftype           = "FT_UINT32"
982         bytes           = 4
983         value_format    = "0x%08x"
984
985 class bytes(Type):
986         type    = 'bytes'
987         ftype   = 'FT_BYTES'
988
989         def __init__(self, abbrev, descr, bytes):
990                 Type.__init__(self, abbrev, descr, bytes, NA)
991
992 class nbytes:
993         pass
994
995 class nbytes8(Type, nbytes):
996         """A series of up to (2^8)-1 bytes. The first byte
997         gives the byte-string length."""
998
999         type    = "nbytes8"
1000         ftype   = "FT_UINT_BYTES"
1001         def __init__(self, abbrev, descr, endianness = LE):
1002                 Type.__init__(self, abbrev, descr, 1, endianness)
1003
1004 class nbytes16(Type, nbytes):
1005         """A series of up to (2^16)-2 bytes. The first 2 bytes
1006         gives the byte-string length."""
1007
1008         type    = "nbytes16"
1009         ftype   = "FT_UINT_BYTES"
1010         def __init__(self, abbrev, descr, endianness = LE):
1011                 Type.__init__(self, abbrev, descr, 2, endianness)
1012
1013 class nbytes32(Type, nbytes):
1014         """A series of up to (2^32)-4 bytes. The first 4 bytes
1015         gives the byte-string length."""
1016
1017         type    = "nbytes32"
1018         ftype   = "FT_UINT_BYTES"
1019         def __init__(self, abbrev, descr, endianness = LE):
1020                 Type.__init__(self, abbrev, descr, 4, endianness)
1021
1022 class bf_uint(Type):
1023         type    = "bf_uint"
1024         disp    = None
1025
1026         def __init__(self, bitmask, abbrev, descr, endianness=LE):
1027                 Type.__init__(self, abbrev, descr, self.bytes, endianness)
1028                 self.bitmask = bitmask
1029
1030         def Mask(self):
1031                 return self.bitmask
1032
1033 class bf_val_str(bf_uint):
1034         type    = "bf_uint"
1035         disp    = None
1036
1037         def __init__(self, bitmask, abbrev, descr, val_string_array, endiannes=LE):
1038                 bf_uint.__init__(self, bitmask, abbrev, descr, endiannes)
1039                 self.values = val_string_array
1040
1041         def ValuesName(self):
1042                 return "VALS(%s)" % (self.ValuesCName())
1043
1044 class bf_val_str8(bf_val_str, val_string8):
1045         type    = "bf_val_str8"
1046         ftype   = "FT_UINT8"
1047         disp    = "BASE_HEX"
1048         bytes   = 1
1049
1050 class bf_val_str16(bf_val_str, val_string16):
1051         type    = "bf_val_str16"
1052         ftype   = "FT_UINT16"
1053         disp    = "BASE_HEX"
1054         bytes   = 2
1055
1056 class bf_val_str32(bf_val_str, val_string32):
1057         type    = "bf_val_str32"
1058         ftype   = "FT_UINT32"
1059         disp    = "BASE_HEX"
1060         bytes   = 4
1061
1062 class bf_boolean:
1063     pass
1064
1065 class bf_boolean8(bf_uint, boolean8, bf_boolean):
1066         type    = "bf_boolean8"
1067         ftype   = "FT_BOOLEAN"
1068         disp    = "8"
1069         bytes   = 1
1070
1071 class bf_boolean16(bf_uint, boolean16, bf_boolean):
1072         type    = "bf_boolean16"
1073         ftype   = "FT_BOOLEAN"
1074         disp    = "16"
1075         bytes   = 2
1076
1077 class bf_boolean24(bf_uint, boolean24, bf_boolean):
1078         type    = "bf_boolean24"
1079         ftype   = "FT_BOOLEAN"
1080         disp    = "24"
1081         bytes   = 3
1082
1083 class bf_boolean32(bf_uint, boolean32, bf_boolean):
1084         type    = "bf_boolean32"
1085         ftype   = "FT_BOOLEAN"
1086         disp    = "32"
1087         bytes   = 4
1088
1089 class bitfield(Type):
1090         type    = "bitfield"
1091         disp    = 'BASE_HEX'
1092
1093         def __init__(self, vars):
1094                 var_hash = {}
1095                 for var in vars:
1096                         if isinstance(var, bf_boolean):
1097                                 if not isinstance(var, self.bf_type):
1098                                         print "%s must be of type %s" % \
1099                                                 (var.Abbreviation(),
1100                                                 self.bf_type)
1101                                         sys.exit(1)
1102                         var_hash[var.bitmask] = var
1103
1104                 bitmasks = var_hash.keys()
1105                 bitmasks.sort()
1106                 bitmasks.reverse()
1107
1108                 ordered_vars = []
1109                 for bitmask in bitmasks:
1110                         var = var_hash[bitmask]
1111                         ordered_vars.append(var)
1112
1113                 self.vars = ordered_vars
1114                 self.ptvcname = "ncp_%s_bitfield" % (self.abbrev,)
1115                 self.hfname = "hf_ncp_%s" % (self.abbrev,)
1116                 self.sub_ptvc = PTVCBitfield(self.PTVCName(), self.vars)
1117
1118         def SubVariables(self):
1119                 return self.vars
1120
1121         def SubVariablesPTVC(self):
1122                 return self.sub_ptvc
1123
1124         def PTVCName(self):
1125                 return self.ptvcname
1126
1127
1128 class bitfield8(bitfield, uint8):
1129         type    = "bitfield8"
1130         ftype   = "FT_UINT8"
1131         bf_type = bf_boolean8
1132
1133         def __init__(self, abbrev, descr, vars):
1134                 uint8.__init__(self, abbrev, descr)
1135                 bitfield.__init__(self, vars)
1136
1137 class bitfield16(bitfield, uint16):
1138         type    = "bitfield16"
1139         ftype   = "FT_UINT16"
1140         bf_type = bf_boolean16
1141
1142         def __init__(self, abbrev, descr, vars, endianness=LE):
1143                 uint16.__init__(self, abbrev, descr, endianness)
1144                 bitfield.__init__(self, vars)
1145
1146 class bitfield24(bitfield, uint24):
1147         type    = "bitfield24"
1148         ftype   = "FT_UINT24"
1149         bf_type = bf_boolean24
1150
1151         def __init__(self, abbrev, descr, vars, endianness=LE):
1152                 uint24.__init__(self, abbrev, descr, endianness)
1153                 bitfield.__init__(self, vars)
1154
1155 class bitfield32(bitfield, uint32):
1156         type    = "bitfield32"
1157         ftype   = "FT_UINT32"
1158         bf_type = bf_boolean32
1159
1160         def __init__(self, abbrev, descr, vars, endianness=LE):
1161                 uint32.__init__(self, abbrev, descr, endianness)
1162                 bitfield.__init__(self, vars)
1163
1164
1165 ##############################################################################
1166 # NCP Field Types. Defined in Appendix A of "Programmer's Guide..."
1167 ##############################################################################
1168 AbortQueueFlag                  = val_string8("abort_q_flag", "Abort Queue Flag", [
1169         [ 0x00, "Place at End of Queue" ],
1170         [ 0x01, "Do Not Place Spool File, Examine Flags" ],
1171 ])
1172 AcceptedMaxSize                 = uint16("accepted_max_size", "Accepted Max Size")
1173 AccessControl                   = val_string8("access_control", "Access Control", [
1174         [ 0x00, "Open for read by this client" ],
1175         [ 0x01, "Open for write by this client" ],
1176         [ 0x02, "Deny read requests from other stations" ],
1177         [ 0x03, "Deny write requests from other stations" ],
1178         [ 0x04, "File detached" ],
1179         [ 0x05, "TTS holding detach" ],
1180         [ 0x06, "TTS holding open" ],
1181 ])
1182 AccessDate                      = uint16("access_date", "Access Date")
1183 AccessDate.NWDate()
1184 AccessMode                      = bitfield8("access_mode", "Access Mode", [
1185         bf_boolean8(0x01, "acc_mode_read", "Read Access"),
1186         bf_boolean8(0x02, "acc_mode_write", "Write Access"),
1187         bf_boolean8(0x04, "acc_mode_deny_read", "Deny Read Access"),
1188         bf_boolean8(0x08, "acc_mode_deny_write", "Deny Write Access"),
1189         bf_boolean8(0x10, "acc_mode_comp", "Compatibility Mode"),
1190 ])
1191 AccessPrivileges                = bitfield8("access_privileges", "Access Privileges", [
1192         bf_boolean8(0x01, "acc_priv_read", "Read Privileges (files only)"),
1193         bf_boolean8(0x02, "acc_priv_write", "Write Privileges (files only)"),
1194         bf_boolean8(0x04, "acc_priv_open", "Open Privileges (files only)"),
1195         bf_boolean8(0x08, "acc_priv_create", "Create Privileges (files only)"),
1196         bf_boolean8(0x10, "acc_priv_delete", "Delete Privileges (files only)"),
1197         bf_boolean8(0x20, "acc_priv_parent", "Parental Privileges (directories only for creating, deleting, and renaming)"),
1198         bf_boolean8(0x40, "acc_priv_search", "Search Privileges (directories only)"),
1199         bf_boolean8(0x80, "acc_priv_modify", "Modify File Status Flags Privileges (files and directories)"),
1200 ])
1201 AccessRightsMask                = bitfield8("access_rights_mask", "Access Rights", [
1202         bf_boolean8(0x0001, "acc_rights_read", "Read Rights"),
1203         bf_boolean8(0x0002, "acc_rights_write", "Write Rights"),
1204         bf_boolean8(0x0004, "acc_rights_open", "Open Rights"),
1205         bf_boolean8(0x0008, "acc_rights_create", "Create Rights"),
1206         bf_boolean8(0x0010, "acc_rights_delete", "Delete Rights"),
1207         bf_boolean8(0x0020, "acc_rights_parent", "Parental Rights"),
1208         bf_boolean8(0x0040, "acc_rights_search", "Search Rights"),
1209         bf_boolean8(0x0080, "acc_rights_modify", "Modify Rights"),
1210 ])
1211 AccessRightsMaskWord            = bitfield16("access_rights_mask_word", "Access Rights", [
1212         bf_boolean16(0x0001, "acc_rights1_read", "Read Rights"),
1213         bf_boolean16(0x0002, "acc_rights1_write", "Write Rights"),
1214         bf_boolean16(0x0004, "acc_rights1_open", "Open Rights"),
1215         bf_boolean16(0x0008, "acc_rights1_create", "Create Rights"),
1216         bf_boolean16(0x0010, "acc_rights1_delete", "Delete Rights"),
1217         bf_boolean16(0x0020, "acc_rights1_parent", "Parental Rights"),
1218         bf_boolean16(0x0040, "acc_rights1_search", "Search Rights"),
1219         bf_boolean16(0x0080, "acc_rights1_modify", "Modify Rights"),
1220         bf_boolean16(0x0100, "acc_rights1_supervisor", "Supervisor Access Rights"),
1221 ])
1222 AccountBalance                  = uint32("account_balance", "Account Balance")
1223 AccountVersion                  = uint8("acct_version", "Acct Version")
1224 ActionFlag                      = bitfield8("action_flag", "Action Flag", [
1225         bf_boolean8(0x01, "act_flag_open", "Open"),
1226         bf_boolean8(0x02, "act_flag_replace", "Replace"),
1227         bf_boolean8(0x10, "act_flag_create", "Create"),
1228 ])
1229 ActiveConnBitList               = fw_string("active_conn_bit_list", "Active Connection List", 512)
1230 ActiveIndexedFiles              = uint16("active_indexed_files", "Active Indexed Files")
1231 ActualMaxBinderyObjects         = uint16("actual_max_bindery_objects", "Actual Max Bindery Objects")
1232 ActualMaxIndexedFiles           = uint16("actual_max_indexed_files", "Actual Max Indexed Files")
1233 ActualMaxOpenFiles              = uint16("actual_max_open_files", "Actual Max Open Files")
1234 ActualMaxSimultaneousTransactions = uint16("actual_max_sim_trans", "Actual Max Simultaneous Transactions")
1235 ActualMaxUsedDirectoryEntries   = uint16("actual_max_used_directory_entries", "Actual Max Used Directory Entries")
1236 ActualMaxUsedRoutingBuffers     = uint16("actual_max_used_routing_buffers", "Actual Max Used Routing Buffers")
1237 ActualResponseCount             = uint16("actual_response_count", "Actual Response Count")
1238 AddNameSpaceAndVol              = stringz("add_nm_spc_and_vol", "Add Name Space and Volume")
1239 AFPEntryID                      = uint32("afp_entry_id", "AFP Entry ID", BE)
1240 AFPEntryID.Display("BASE_HEX")
1241 AllocAvailByte                  = uint32("alloc_avail_byte", "Bytes Available for Allocation")
1242 AllocateMode                    = val_string16("allocate_mode", "Allocate Mode", [
1243         [ 0x0000, "Permanent Directory Handle" ],
1244         [ 0x0001, "Temporary Directory Handle" ],
1245         [ 0x0002, "Special Temporary Directory Handle" ],
1246 ])
1247 AllocationBlockSize             = uint32("allocation_block_size", "Allocation Block Size")
1248 AllocFreeCount                  = uint32("alloc_free_count", "Reclaimable Free Bytes")
1249 ApplicationNumber               = uint16("application_number", "Application Number")
1250 ArchivedTime                    = uint16("archived_time", "Archived Time")
1251 ArchivedTime.NWTime()
1252 ArchivedDate                    = uint16("archived_date", "Archived Date")
1253 ArchivedDate.NWDate()
1254 ArchiverID                      = uint32("archiver_id", "Archiver ID", BE)
1255 ArchiverID.Display("BASE_HEX")
1256 AssociatedNameSpace             = uint8("associated_name_space", "Associated Name Space")
1257 AttachDuringProcessing          = uint16("attach_during_processing", "Attach During Processing")
1258 AttachedIndexedFiles            = uint8("attached_indexed_files", "Attached Indexed Files")
1259 AttachWhileProcessingAttach     = uint16("attach_while_processing_attach", "Attach While Processing Attach")
1260 Attributes                      = uint32("attributes", "Attributes")
1261 AttributesDef                   = bitfield8("attr_def", "Attributes", [
1262         bf_boolean8(0x01, "att_def_ro", "Read Only"),
1263         bf_boolean8(0x02, "att_def_hidden", "Hidden"),
1264         bf_boolean8(0x04, "att_def_system", "System"),
1265         bf_boolean8(0x08, "att_def_execute", "Execute"),
1266         bf_boolean8(0x10, "att_def_sub_only", "Subdirectories Only"),
1267         bf_boolean8(0x20, "att_def_archive", "Archive"),
1268         bf_boolean8(0x80, "att_def_shareable", "Shareable"),
1269 ])
1270 AttributesDef16                 = bitfield16("attr_def_16", "Attributes", [
1271         bf_boolean16(0x0001, "att_def16_ro", "Read Only"),
1272         bf_boolean16(0x0002, "att_def16_hidden", "Hidden"),
1273         bf_boolean16(0x0004, "att_def16_system", "System"),
1274         bf_boolean16(0x0008, "att_def16_execute", "Execute"),
1275         bf_boolean16(0x0010, "att_def16_sub_only", "Subdirectories Only"),
1276         bf_boolean16(0x0020, "att_def16_archive", "Archive"),
1277         bf_boolean16(0x0080, "att_def16_shareable", "Shareable"),
1278         bf_boolean16(0x1000, "att_def16_transaction", "Transactional"),
1279         bf_boolean16(0x4000, "att_def16_read_audit", "Read Audit"),
1280         bf_boolean16(0x8000, "att_def16_write_audit", "Write Audit"),
1281 ])
1282 AttributesDef32                 = bitfield32("attr_def_32", "Attributes", [
1283         bf_boolean32(0x00000001, "att_def32_ro", "Read Only"),
1284         bf_boolean32(0x00000002, "att_def32_hidden", "Hidden"),
1285         bf_boolean32(0x00000004, "att_def32_system", "System"),
1286         bf_boolean32(0x00000008, "att_def32_execute", "Execute"),
1287         bf_boolean32(0x00000010, "att_def32_sub_only", "Subdirectories Only"),
1288         bf_boolean32(0x00000020, "att_def32_archive", "Archive"),
1289         bf_boolean32(0x00000080, "att_def32_shareable", "Shareable"),
1290         bf_boolean32(0x00001000, "att_def32_transaction", "Transactional"),
1291         bf_boolean32(0x00004000, "att_def32_read_audit", "Read Audit"),
1292         bf_boolean32(0x00008000, "att_def32_write_audit", "Write Audit"),
1293         bf_boolean32(0x01000000, "att_def_purge", "Purge"),
1294         bf_boolean32(0x02000000, "att_def_reninhibit", "Rename Inhibit"),
1295         bf_boolean32(0x04000000, "att_def_delinhibit", "Delete Inhibit"),
1296         bf_boolean32(0x08000000, "att_def_cpyinhibit", "Copy Inhibit"),
1297 ])
1298 AttributeValidFlag              = uint32("attribute_valid_flag", "Attribute Valid Flag")
1299 AuditFileVersionDate            = uint16("audit_file_ver_date", "Audit File Version Date")
1300 AuditFileVersionDate.NWDate()
1301 AuditFlag                       = val_string8("audit_flag", "Audit Flag", [
1302         [ 0x00, "Do NOT audit object" ],
1303         [ 0x01, "Audit object" ],
1304 ])
1305 AuditHandle                     = uint32("audit_handle", "Audit File Handle")
1306 AuditHandle.Display("BASE_HEX")
1307 AuditID                         = uint32("audit_id", "Audit ID", BE)
1308 AuditID.Display("BASE_HEX")
1309 AuditIDType                     = val_string16("audit_id_type", "Audit ID Type", [
1310         [ 0x0000, "Volume" ],
1311         [ 0x0001, "Container" ],
1312 ])
1313 AuditVersionDate                = uint16("audit_ver_date", "Auditing Version Date")
1314 AuditVersionDate.NWDate()
1315 AvailableBlocks                 = uint32("available_blocks", "Available Blocks")
1316 AvailableClusters               = uint16("available_clusters", "Available Clusters")
1317 AvailableDirectorySlots         = uint16("available_directory_slots", "Available Directory Slots")
1318 AvailableDirEntries             = uint32("available_dir_entries", "Available Directory Entries")
1319 AvailableIndexedFiles           = uint16("available_indexed_files", "Available Indexed Files")
1320
1321 BackgroundAgedWrites            = uint32("background_aged_writes", "Background Aged Writes")
1322 BackgroundDirtyWrites           = uint32("background_dirty_writes", "Background Dirty Writes")
1323 BadLogicalConnectionCount       = uint16("bad_logical_connection_count", "Bad Logical Connection Count")
1324 BannerName                      = fw_string("banner_name", "Banner Name", 14)
1325 BaseDirectoryID                 = uint32("base_directory_id", "Base Directory ID")
1326 BaseDirectoryID.Display("BASE_HEX")
1327 binderyContext                  = nstring8("bindery_context", "Bindery Context")
1328 BitMap                          = bytes("bit_map", "Bit Map", 512)
1329 BlockNumber                     = uint32("block_number", "Block Number")
1330 BlockSize                       = uint16("block_size", "Block Size")
1331 BlockSizeInSectors              = uint32("block_size_in_sectors", "Block Size in Sectors")
1332 BoardInstalled                  = uint8("board_installed", "Board Installed")
1333 BoardNumber                     = uint32("board_number", "Board Number")
1334 BoardNumbers                    = uint32("board_numbers", "Board Numbers")
1335 BufferSize                      = uint16("buffer_size", "Buffer Size")
1336 BusString                       = stringz("bus_string", "Bus String")
1337 BusType                         = val_string8("bus_type", "Bus Type", [
1338         [0x00, "ISA"],
1339         [0x01, "Micro Channel" ],
1340         [0x02, "EISA"],
1341         [0x04, "PCI"],
1342         [0x08, "PCMCIA"],
1343         [0x10, "ISA"],
1344         [0x14, "ISA"],
1345 ])
1346 BytesActuallyTransferred        = uint32("bytes_actually_transferred", "Bytes Actually Transferred")
1347 BytesRead                       = fw_string("bytes_read", "Bytes Read", 6)
1348 BytesToCopy                     = uint32("bytes_to_copy", "Bytes to Copy")
1349 BytesWritten                    = fw_string("bytes_written", "Bytes Written", 6)
1350
1351 CacheAllocations                = uint32("cache_allocations", "Cache Allocations")
1352 CacheBlockScrapped              = uint16("cache_block_scrapped", "Cache Block Scrapped")
1353 CacheBufferCount                = uint16("cache_buffer_count", "Cache Buffer Count")
1354 CacheBufferSize                 = uint16("cache_buffer_size", "Cache Buffer Size")
1355 CacheFullWriteRequests          = uint32("cache_full_write_requests", "Cache Full Write Requests")
1356 CacheGetRequests                = uint32("cache_get_requests", "Cache Get Requests")
1357 CacheHitOnUnavailableBlock      = uint16("cache_hit_on_unavailable_block", "Cache Hit On Unavailable Block")
1358 CacheHits                       = uint32("cache_hits", "Cache Hits")
1359 CacheMisses                     = uint32("cache_misses", "Cache Misses")
1360 CachePartialWriteRequests       = uint32("cache_partial_write_requests", "Cache Partial Write Requests")
1361 CacheReadRequests               = uint32("cache_read_requests", "Cache Read Requests")
1362 CacheWriteRequests              = uint32("cache_write_requests", "Cache Write Requests")
1363 CategoryName                    = stringz("category_name", "Category Name")
1364 CCFileHandle                    = bytes("cc_file_handle", "File Handle", 4)
1365 CCFunction                      = val_string8("cc_function", "OP-Lock Flag", [
1366         [ 0x01, "Clear OP-Lock" ],
1367         [ 0x02, "Achnowledge Callback" ],
1368         [ 0x03, "Decline Callback" ],
1369 ])
1370 ChangeBits                      = bitfield16("change_bits", "Change Bits", [
1371         bf_boolean16(0x0001, "change_bits_modify", "Modify Name"),
1372         bf_boolean16(0x0002, "change_bits_fatt", "File Attributes"),
1373         bf_boolean16(0x0004, "change_bits_cdate", "Creation Date"),
1374         bf_boolean16(0x0008, "change_bits_ctime", "Creation Time"),
1375         bf_boolean16(0x0010, "change_bits_owner", "Owner ID"),
1376         bf_boolean16(0x0020, "change_bits_adate", "Archive Date"),
1377         bf_boolean16(0x0040, "change_bits_atime", "Archive Time"),
1378         bf_boolean16(0x0080, "change_bits_aid", "Archiver ID"),
1379         bf_boolean16(0x0100, "change_bits_udate", "Update Date"),
1380         bf_boolean16(0x0200, "change_bits_utime", "Update Time"),
1381         bf_boolean16(0x0400, "change_bits_uid", "Update ID"),
1382         bf_boolean16(0x0800, "change_bits_acc_date", "Access Date"),
1383         bf_boolean16(0x1000, "change_bits_max_acc_mask", "Maximum Access Mask"),
1384         bf_boolean16(0x2000, "change_bits_max_space", "Maximum Space"),
1385 ])
1386 ChannelState                    = val_string8("channel_state", "Channel State", [
1387         [ 0x00, "Channel is running" ],
1388         [ 0x01, "Channel is stopping" ],
1389         [ 0x02, "Channel is stopped" ],
1390         [ 0x03, "Channel is not functional" ],
1391 ])
1392 ChannelSynchronizationState     = val_string8("channel_synchronization_state", "Channel Synchronization State", [
1393         [ 0x00, "Channel is not being used" ],
1394         [ 0x02, "NetWare is using the channel; no one else wants it" ],
1395         [ 0x04, "NetWare is using the channel; someone else wants it" ],
1396         [ 0x06, "Someone else is using the channel; NetWare does not need it" ],
1397         [ 0x08, "Someone else is using the channel; NetWare needs it" ],
1398         [ 0x0A, "Someone else has released the channel; NetWare should use it" ],
1399 ])
1400 ChargeAmount                    = uint32("charge_amount", "Charge Amount")
1401 ChargeInformation               = uint32("charge_information", "Charge Information")
1402 ClientCompFlag                  = val_string16("client_comp_flag", "Completion Flag", [
1403         [ 0x0000, "Successful" ],
1404         [ 0x0001, "Illegal Station Number" ],
1405         [ 0x0002, "Client Not Logged In" ],
1406         [ 0x0003, "Client Not Accepting Messages" ],
1407         [ 0x0004, "Client Already has a Message" ],
1408         [ 0x0096, "No Alloc Space for the Message" ],
1409         [ 0x00fd, "Bad Station Number" ],
1410         [ 0x00ff, "Failure" ],
1411 ])      
1412 ClientIDNumber                  = uint32("client_id_number", "Client ID Number", BE)
1413 ClientIDNumber.Display("BASE_HEX")
1414 ClientList                      = uint32("client_list", "Client List")
1415 ClientListCount                 = uint16("client_list_cnt", "Client List Count")
1416 ClientListLen                   = uint8("client_list_len", "Client List Length")
1417 ClientRecordArea                = fw_string("client_record_area", "Client Record Area", 152)
1418 ClientStation                   = uint8("client_station", "Client Station")
1419 ClientStationLong               = uint32("client_station_long", "Client Station")
1420 ClientTaskNumber                = uint8("client_task_number", "Client Task Number")
1421 ClientTaskNumberLong            = uint32("client_task_number_long", "Client Task Number")
1422 ClusterCount                    = uint16("cluster_count", "Cluster Count")
1423 ClustersUsedByDirectories       = uint32("clusters_used_by_directories", "Clusters Used by Directories")
1424 ClustersUsedByExtendedDirectories = uint32("clusters_used_by_extended_dirs", "Clusters Used by Extended Directories")
1425 ClustersUsedByFAT               = uint32("clusters_used_by_fat", "Clusters Used by FAT")
1426 ComCnts                         = uint16("com_cnts", "Communication Counters")
1427 Comment                         = nstring8("comment", "Comment")
1428 CommentType                     = uint16("comment_type", "Comment Type")
1429 CompletionCode                  = uint32("ncompletion_code", "Completion Code")
1430 CompressedDataStreamsCount      = uint32("compressed_data_streams_count", "Compressed Data Streams Count")
1431 CompressedLimboDataStreamsCount = uint32("compressed_limbo_data_streams_count", "Compressed Limbo Data Streams Count")
1432 CompressedSectors               = uint32("compressed_sectors", "Compressed Sectors")
1433 compressionStage                = uint32("compression_stage", "Compression Stage")
1434 compressVolume                  = uint32("compress_volume", "Volume Compression")
1435 ConfigMajorVN                   = uint8("config_major_vn", "Configuration Major Version Number")
1436 ConfigMinorVN                   = uint8("config_minor_vn", "Configuration Minor Version Number")
1437 ConfigurationDescription        = fw_string("configuration_description", "Configuration Description", 80)
1438 ConfigurationText               = fw_string("configuration_text", "Configuration Text", 160)
1439 ConfiguredMaxBinderyObjects     = uint16("configured_max_bindery_objects", "Configured Max Bindery Objects")
1440 ConfiguredMaxOpenFiles          = uint16("configured_max_open_files", "Configured Max Open Files")
1441 ConfiguredMaxRoutingBuffers     = uint16("configured_max_routing_buffers", "Configured Max Routing Buffers")
1442 ConfiguredMaxSimultaneousTransactions = uint16("cfg_max_simultaneous_transactions", "Configured Max Simultaneous Transactions")
1443 ConnectedLAN                    = uint32("connected_lan", "LAN Adapter")
1444 ConnectionControlBits           = bitfield8("conn_ctrl_bits", "Connection Control", [
1445         bf_boolean8(0x01, "enable_brdcasts", "Enable Broadcasts"),
1446         bf_boolean8(0x02, "enable_personal_brdcasts", "Enable Personal Broadcasts"),
1447         bf_boolean8(0x04, "enable_wdog_messages", "Enable Watchdog Message"),
1448         bf_boolean8(0x10, "disable_brdcasts", "Disable Broadcasts"),
1449         bf_boolean8(0x20, "disable_personal_brdcasts", "Disable Personal Broadcasts"),
1450         bf_boolean8(0x40, "disable_wdog_messages", "Disable Watchdog Message"),
1451 ])
1452 ConnectionListCount             = uint32("conn_list_count", "Connection List Count")
1453 ConnectionList                  = uint32("connection_list", "Connection List")
1454 ConnectionNumber                = uint32("connection_number", "Connection Number", BE)
1455 ConnectionNumberList            = nstring8("connection_number_list", "Connection Number List")
1456 ConnectionNumberWord            = uint16("conn_number_word", "Connection Number")
1457 ConnectionNumberByte            = uint8("conn_number_byte", "Connection Number")
1458 ConnectionServiceType           = val_string8("connection_service_type","Connection Service Type",[
1459         [ 0x01, "CLIB backward Compatibility" ],
1460         [ 0x02, "NCP Connection" ],
1461         [ 0x03, "NLM Connection" ],
1462         [ 0x04, "AFP Connection" ],
1463         [ 0x05, "FTAM Connection" ],
1464         [ 0x06, "ANCP Connection" ],
1465         [ 0x07, "ACP Connection" ],
1466         [ 0x08, "SMB Connection" ],
1467         [ 0x09, "Winsock Connection" ],
1468 ])
1469 ConnectionsInUse                = uint16("connections_in_use", "Connections In Use")
1470 ConnectionsMaxUsed              = uint16("connections_max_used", "Connections Max Used")
1471 ConnectionsSupportedMax         = uint16("connections_supported_max", "Connections Supported Max")
1472 ConnectionType                  = val_string8("connection_type", "Connection Type", [
1473         [ 0x00, "Not in use" ],
1474         [ 0x02, "NCP" ],
1475         [ 0x11, "UDP (for IP)" ],
1476 ])
1477 ConnListLen                     = uint8("conn_list_len", "Connection List Length")
1478 Copyright                       = nstring8("copyright", "Copyright")
1479 connList                        = uint32("conn_list", "Connection List")
1480 ControlFlags                    = val_string8("control_flags", "Control Flags", [
1481         [ 0x00, "Forced Record Locking is Off" ],
1482         [ 0x01, "Forced Record Locking is On" ],
1483 ])
1484 ControllerDriveNumber           = uint8("controller_drive_number", "Controller Drive Number")
1485 ControllerNumber                = uint8("controller_number", "Controller Number")
1486 ControllerType                  = uint8("controller_type", "Controller Type")
1487 Cookie1                         = uint32("cookie_1", "Cookie 1")
1488 Cookie2                         = uint32("cookie_2", "Cookie 2")
1489 Copies                          = uint8( "copies", "Copies" )
1490 CoprocessorFlag                 = uint32("co_processor_flag", "CoProcessor Present Flag")
1491 CoProcessorString               = stringz("co_proc_string", "CoProcessor String")
1492 CounterMask                     = val_string8("counter_mask", "Counter Mask", [
1493         [ 0x00, "Counter is Valid" ],
1494         [ 0x01, "Counter is not Valid" ],
1495 ])        
1496 CPUNumber                       = uint32("cpu_number", "CPU Number")
1497 CPUString                       = stringz("cpu_string", "CPU String")
1498 CPUType                         = val_string8("cpu_type", "CPU Type", [
1499         [ 0x00, "80386" ],
1500         [ 0x01, "80486" ],
1501         [ 0x02, "Pentium" ],
1502         [ 0x03, "Pentium Pro" ],
1503 ])    
1504 CreationDate                    = uint16("creation_date", "Creation Date")
1505 CreationDate.NWDate()
1506 CreationTime                    = uint16("creation_time", "Creation Time")
1507 CreationTime.NWTime()
1508 CreatorID                       = uint32("creator_id", "Creator ID", BE)
1509 CreatorID.Display("BASE_HEX")
1510 CreatorNameSpaceNumber          = val_string8("creator_name_space_number", "Creator Name Space Number", [
1511         [ 0x00, "DOS Name Space" ],
1512         [ 0x01, "MAC Name Space" ],
1513         [ 0x02, "NFS Name Space" ],
1514         [ 0x04, "Long Name Space" ],
1515 ])
1516 CreditLimit                     = uint32("credit_limit", "Credit Limit")
1517 CtrlFlags                       = val_string16("ctrl_flags", "Control Flags", [
1518         [ 0x0000, "Do Not Return File Name" ],
1519         [ 0x0001, "Return File Name" ],
1520 ])      
1521 curCompBlks                     = uint32("cur_comp_blks", "Current Compression Blocks")
1522 curInitialBlks                  = uint32("cur_initial_blks", "Current Initial Blocks")
1523 curIntermediateBlks             = uint32("cur_inter_blks", "Current Intermediate Blocks")
1524 CurNumOfRTags                   = uint32("cur_num_of_r_tags", "Current Number of Resource Tags")
1525 CurrentBlockBeingDecompressed   = uint32("cur_blk_being_dcompress", "Current Block Being Decompressed")
1526 CurrentChangedFATs              = uint16("current_changed_fats", "Current Changed FAT Entries")
1527 CurrentEntries                  = uint32("current_entries", "Current Entries")
1528 CurrentFormType                 = uint8( "current_form_type", "Current Form Type" )
1529 CurrentLFSCounters              = uint32("current_lfs_counters", "Current LFS Counters")
1530 CurrentlyUsedRoutingBuffers     = uint16("currently_used_routing_buffers", "Currently Used Routing Buffers")
1531 CurrentOpenFiles                = uint16("current_open_files", "Current Open Files")
1532 CurrentReferenceID              = uint16("curr_ref_id", "Current Reference ID")
1533 CurrentServers                  = uint32("current_servers", "Current Servers")
1534 CurrentServerTime               = uint32("current_server_time", "Time Elapsed Since Server Was Brought Up")
1535 CurrentSpace                    = uint32("current_space", "Current Space")
1536 CurrentTransactionCount         = uint32("current_trans_count", "Current Transaction Count")
1537 CurrentUsedBinderyObjects       = uint16("current_used_bindery_objects", "Current Used Bindery Objects")
1538 CurrentUsedDynamicSpace         = uint32("current_used_dynamic_space", "Current Used Dynamic Space")
1539 CustomCnts                      = uint32("custom_cnts", "Custom Counters")
1540 CustomCount                     = uint32("custom_count", "Custom Count")
1541 CustomCounters                  = uint32("custom_counters", "Custom Counters")
1542 CustomString                    = nstring8("custom_string", "Custom String")
1543 CustomVariableValue             = uint32("custom_var_value", "Custom Variable Value")
1544
1545 Data                            = nstring8("data", "Data")
1546 DataForkFirstFAT                = uint32("data_fork_first_fat", "Data Fork First FAT Entry")
1547 DataForkLen                     = uint32("data_fork_len", "Data Fork Len")
1548 DataForkSize                    = uint32("data_fork_size", "Data Fork Size")
1549 DataSize                        = uint32("data_size", "Data Size")
1550 DataStream                      = val_string8("data_stream", "Data Stream", [
1551         [ 0x00, "Resource Fork or DOS" ],
1552         [ 0x01, "Data Fork" ],
1553 ])
1554 DataStreamName                  = nstring8("data_stream_name", "Data Stream Name")
1555 DataStreamNumber                = uint8("data_stream_number", "Data Stream Number")
1556 DataStreamsCount                = uint32("data_streams_count", "Data Streams Count")
1557 DataStreamSize                  = uint32("data_stream_size", "Size")
1558 DataStreamSpaceAlloc            = uint32( "data_stream_space_alloc", "Space Allocated for Data Stream" )
1559 Day                             = uint8("s_day", "Day")
1560 DayOfWeek                       = val_string8("s_day_of_week", "Day of Week", [
1561         [ 0x00, "Sunday" ],
1562         [ 0x01, "Monday" ],
1563         [ 0x02, "Tuesday" ],
1564         [ 0x03, "Wednesday" ],
1565         [ 0x04, "Thursday" ],
1566         [ 0x05, "Friday" ],
1567         [ 0x06, "Saturday" ],
1568 ])
1569 DeadMirrorTable                 = bytes("dead_mirror_table", "Dead Mirror Table", 32)
1570 DefinedDataStreams              = uint8("defined_data_streams", "Defined Data Streams")
1571 DefinedNameSpaces               = uint8("definded_name_spaces", "Defined Name Spaces")
1572 DeletedDate                     = uint16("deleted_date", "Deleted Date")
1573 DeletedDate.NWDate()
1574 DeletedFileTime                 = uint32( "deleted_file_time", "Deleted File Time")
1575 DeletedFileTime.Display("BASE_HEX")
1576 DeletedTime                     = uint16("deleted_time", "Deleted Time")
1577 DeletedTime.NWTime()
1578 DeletedID                       = uint32( "delete_id", "Deleted ID", BE)
1579 DeletedID.Display("BASE_HEX")
1580 DeleteExistingFileFlag          = val_string8("delete_existing_file_flag", "Delete Existing File Flag", [
1581         [ 0x00, "Do Not Delete Existing File" ],
1582         [ 0x01, "Delete Existing File" ],
1583 ])      
1584 DenyReadCount                   = uint16("deny_read_count", "Deny Read Count")
1585 DenyWriteCount                  = uint16("deny_write_count", "Deny Write Count")
1586 DescriptionStrings              = fw_string("description_string", "Description", 512)
1587 DesiredAccessRights             = bitfield16("desired_access_rights", "Desired Access Rights", [
1588         bf_boolean16(0x0001, "dsired_acc_rights_read_o", "Read Only"),
1589         bf_boolean16(0x0002, "dsired_acc_rights_write_o", "Write Only"),
1590         bf_boolean16(0x0004, "dsired_acc_rights_deny_r", "Deny Read"),
1591         bf_boolean16(0x0008, "dsired_acc_rights_deny_w", "Deny Write"),
1592         bf_boolean16(0x0010, "dsired_acc_rights_compat", "Compatibility"),
1593         bf_boolean16(0x0040, "dsired_acc_rights_w_thru", "File Write Through"),
1594         bf_boolean16(0x0400, "dsired_acc_rights_del_file_cls", "Delete File Close"),
1595 ])
1596 DesiredResponseCount            = uint16("desired_response_count", "Desired Response Count")
1597 DestDirHandle                   = uint8("dest_dir_handle", "Destination Directory Handle")
1598 DestNameSpace                   = val_string8("dest_name_space", "Destination Name Space", [
1599         [ 0x00, "DOS Name Space" ],
1600         [ 0x01, "MAC Name Space" ],
1601         [ 0x02, "NFS Name Space" ],
1602         [ 0x04, "Long Name Space" ],
1603 ])
1604 DestPathComponentCount          = uint8("dest_component_count", "Destination Path Component Count")
1605 DestPath                        = nstring8("dest_path", "Destination Path")
1606 DetachDuringProcessing          = uint16("detach_during_processing", "Detach During Processing")
1607 DetachForBadConnectionNumber    = uint16("detach_for_bad_connection_number", "Detach For Bad Connection Number")
1608 DirHandle                       = uint8("dir_handle", "Directory Handle")
1609 DirHandleName                   = uint8("dir_handle_name", "Handle Name")
1610 DirHandleLong                   = uint32("dir_handle_long", "Directory Handle")
1611 DirectoryAccessRights           = uint8("directory_access_rights", "Directory Access Rights")
1612 DirectoryAttributes             = uint8("directory_attributes", "Directory Attributes")
1613 DirectoryBase                   = uint32("dir_base", "Directory Base")
1614 DirectoryBase.Display("BASE_HEX")
1615 DirectoryCount                  = uint16("dir_count", "Directory Count")
1616 DirectoryEntryNumber            = uint32("directory_entry_number", "Directory Entry Number")
1617 DirectoryEntryNumber.Display('BASE_HEX')
1618 DirectoryEntryNumberWord        = uint16("directory_entry_number_word", "Directory Entry Number")
1619 DirectoryID                     = uint16("directory_id", "Directory ID")
1620 DirectoryID.Display("BASE_HEX")
1621 DirectoryName                   = fw_string("directory_name", "Directory Name",12)
1622 DirectoryName14                 = fw_string("directory_name_14", "Directory Name", 14)
1623 DirectoryNameLen                = uint8("directory_name_len", "Directory Name Length")
1624 DirectoryNumber                 = uint32("directory_number", "Directory Number")
1625 DirectoryNumber.Display("BASE_HEX")
1626 DirectoryPath                   = fw_string("directory_path", "Directory Path", 16)
1627 DirectoryServicesObjectID       = uint32("directory_services_object_id", "Directory Services Object ID")
1628 DirectoryServicesObjectID.Display("BASE_HEX")
1629 DirectoryStamp                  = uint16("directory_stamp", "Directory Stamp (0xD1D1)")
1630 DirtyCacheBuffers               = uint16("dirty_cache_buffers", "Dirty Cache Buffers")
1631 DiskChannelNumber               = uint8("disk_channel_number", "Disk Channel Number")
1632 DiskChannelTable                = val_string8("disk_channel_table", "Disk Channel Table", [
1633         [ 0x01, "XT" ],
1634         [ 0x02, "AT" ],
1635         [ 0x03, "SCSI" ],
1636         [ 0x04, "Disk Coprocessor" ],
1637 ])
1638 DiskSpaceLimit                  = uint32("disk_space_limit", "Disk Space Limit")
1639 DMAChannelsUsed                 = uint32("dma_channels_used", "DMA Channels Used")
1640 DMInfoEntries                   = uint32("dm_info_entries", "DM Info Entries")
1641 DMInfoLevel                     = val_string8("dm_info_level", "DM Info Level", [
1642         [ 0x00, "Return Detailed DM Support Module Information" ],
1643         [ 0x01, "Return Number of DM Support Modules" ],
1644         [ 0x02, "Return DM Support Modules Names" ],
1645 ])      
1646 DMFlags                         = val_string8("dm_flags", "DM Flags", [
1647         [ 0x00, "OnLine Media" ],
1648         [ 0x01, "OffLine Media" ],
1649 ])
1650 DMmajorVersion                  = uint32("dm_major_version", "DM Major Version")
1651 DMminorVersion                  = uint32("dm_minor_version", "DM Minor Version")
1652 DMPresentFlag                   = val_string8("dm_present_flag", "Data Migration Present Flag", [
1653         [ 0x00, "Data Migration NLM is not loaded" ],
1654         [ 0x01, "Data Migration NLM has been loaded and is running" ],
1655 ])      
1656 DOSDirectoryBase                = uint32("dos_directory_base", "DOS Directory Base")
1657 DOSDirectoryBase.Display("BASE_HEX")
1658 DOSDirectoryEntry               = uint32("dos_directory_entry", "DOS Directory Entry")
1659 DOSDirectoryEntry.Display("BASE_HEX")
1660 DOSDirectoryEntryNumber         = uint32("dos_directory_entry_number", "DOS Directory Entry Number")
1661 DOSDirectoryEntryNumber.Display('BASE_HEX')
1662 DOSFileAttributes               = uint8("dos_file_attributes", "DOS File Attributes")
1663 DOSParentDirectoryEntry         = uint32("dos_parent_directory_entry", "DOS Parent Directory Entry")
1664 DOSParentDirectoryEntry.Display('BASE_HEX')
1665 DOSSequence                     = uint32("dos_sequence", "DOS Sequence")
1666 DriveCylinders                  = uint16("drive_cylinders", "Drive Cylinders")
1667 DriveDefinitionString           = fw_string("drive_definition_string", "Drive Definition", 64)
1668 DriveHeads                      = uint8("drive_heads", "Drive Heads")
1669 DriveMappingTable               = bytes("drive_mapping_table", "Drive Mapping Table", 32)
1670 DriveMirrorTable                = bytes("drive_mirror_table", "Drive Mirror Table", 32)
1671 DriverBoardName                 = stringz("driver_board_name", "Driver Board Name")
1672 DriveRemovableFlag              = val_string8("drive_removable_flag", "Drive Removable Flag", [
1673         [ 0x00, "Nonremovable" ],
1674         [ 0xff, "Removable" ],
1675 ])
1676 DriverLogicalName               = stringz("driver_log_name", "Driver Logical Name")
1677 DriverShortName                 = stringz("driver_short_name", "Driver Short Name")
1678 DriveSize                       = uint32("drive_size", "Drive Size")
1679 DstEAFlags                      = val_string16("dst_ea_flags", "Destination EA Flags", [
1680         [ 0x0000, "Return EAHandle,Information Level 0" ],
1681         [ 0x0001, "Return NetWareHandle,Information Level 0" ],
1682         [ 0x0002, "Return Volume/Directory Number,Information Level 0" ],
1683         [ 0x0004, "Return EAHandle,Close Handle on Error,Information Level 0" ],
1684         [ 0x0005, "Return NetWareHandle,Close Handle on Error,Information Level 0" ],
1685         [ 0x0006, "Return Volume/Directory Number,Close Handle on Error,Information Level 0" ],
1686         [ 0x0010, "Return EAHandle,Information Level 1" ],
1687         [ 0x0011, "Return NetWareHandle,Information Level 1" ],
1688         [ 0x0012, "Return Volume/Directory Number,Information Level 1" ],
1689         [ 0x0014, "Return EAHandle,Close Handle on Error,Information Level 1" ],
1690         [ 0x0015, "Return NetWareHandle,Close Handle on Error,Information Level 1" ],
1691         [ 0x0016, "Return Volume/Directory Number,Close Handle on Error,Information Level 1" ],
1692         [ 0x0020, "Return EAHandle,Information Level 2" ],
1693         [ 0x0021, "Return NetWareHandle,Information Level 2" ],
1694         [ 0x0022, "Return Volume/Directory Number,Information Level 2" ],
1695         [ 0x0024, "Return EAHandle,Close Handle on Error,Information Level 2" ],
1696         [ 0x0025, "Return NetWareHandle,Close Handle on Error,Information Level 2" ],
1697         [ 0x0026, "Return Volume/Directory Number,Close Handle on Error,Information Level 2" ],
1698         [ 0x0030, "Return EAHandle,Information Level 3" ],
1699         [ 0x0031, "Return NetWareHandle,Information Level 3" ],
1700         [ 0x0032, "Return Volume/Directory Number,Information Level 3" ],
1701         [ 0x0034, "Return EAHandle,Close Handle on Error,Information Level 3" ],
1702         [ 0x0035, "Return NetWareHandle,Close Handle on Error,Information Level 3" ],
1703         [ 0x0036, "Return Volume/Directory Number,Close Handle on Error,Information Level 3" ],
1704         [ 0x0040, "Return EAHandle,Information Level 4" ],
1705         [ 0x0041, "Return NetWareHandle,Information Level 4" ],
1706         [ 0x0042, "Return Volume/Directory Number,Information Level 4" ],
1707         [ 0x0044, "Return EAHandle,Close Handle on Error,Information Level 4" ],
1708         [ 0x0045, "Return NetWareHandle,Close Handle on Error,Information Level 4" ],
1709         [ 0x0046, "Return Volume/Directory Number,Close Handle on Error,Information Level 4" ],
1710         [ 0x0050, "Return EAHandle,Information Level 5" ],
1711         [ 0x0051, "Return NetWareHandle,Information Level 5" ],
1712         [ 0x0052, "Return Volume/Directory Number,Information Level 5" ],
1713         [ 0x0054, "Return EAHandle,Close Handle on Error,Information Level 5" ],
1714         [ 0x0055, "Return NetWareHandle,Close Handle on Error,Information Level 5" ],
1715         [ 0x0056, "Return Volume/Directory Number,Close Handle on Error,Information Level 5" ],
1716         [ 0x0060, "Return EAHandle,Information Level 6" ],
1717         [ 0x0061, "Return NetWareHandle,Information Level 6" ],
1718         [ 0x0062, "Return Volume/Directory Number,Information Level 6" ],
1719         [ 0x0064, "Return EAHandle,Close Handle on Error,Information Level 6" ],
1720         [ 0x0065, "Return NetWareHandle,Close Handle on Error,Information Level 6" ],
1721         [ 0x0066, "Return Volume/Directory Number,Close Handle on Error,Information Level 6" ],
1722         [ 0x0070, "Return EAHandle,Information Level 7" ],
1723         [ 0x0071, "Return NetWareHandle,Information Level 7" ],
1724         [ 0x0072, "Return Volume/Directory Number,Information Level 7" ],
1725         [ 0x0074, "Return EAHandle,Close Handle on Error,Information Level 7" ],
1726         [ 0x0075, "Return NetWareHandle,Close Handle on Error,Information Level 7" ],
1727         [ 0x0076, "Return Volume/Directory Number,Close Handle on Error,Information Level 7" ],
1728         [ 0x0080, "Return EAHandle,Information Level 0,Immediate Close Handle" ],
1729         [ 0x0081, "Return NetWareHandle,Information Level 0,Immediate Close Handle" ],
1730         [ 0x0082, "Return Volume/Directory Number,Information Level 0,Immediate Close Handle" ],
1731         [ 0x0084, "Return EAHandle,Close Handle on Error,Information Level 0,Immediate Close Handle" ],
1732         [ 0x0085, "Return NetWareHandle,Close Handle on Error,Information Level 0,Immediate Close Handle" ],
1733         [ 0x0086, "Return Volume/Directory Number,Close Handle on Error,Information Level 0,Immediate Close Handle" ],
1734         [ 0x0090, "Return EAHandle,Information Level 1,Immediate Close Handle" ],
1735         [ 0x0091, "Return NetWareHandle,Information Level 1,Immediate Close Handle" ],
1736         [ 0x0092, "Return Volume/Directory Number,Information Level 1,Immediate Close Handle" ],
1737         [ 0x0094, "Return EAHandle,Close Handle on Error,Information Level 1,Immediate Close Handle" ],
1738         [ 0x0095, "Return NetWareHandle,Close Handle on Error,Information Level 1,Immediate Close Handle" ],
1739         [ 0x0096, "Return Volume/Directory Number,Close Handle on Error,Information Level 1,Immediate Close Handle" ],
1740         [ 0x00a0, "Return EAHandle,Information Level 2,Immediate Close Handle" ],
1741         [ 0x00a1, "Return NetWareHandle,Information Level 2,Immediate Close Handle" ],
1742         [ 0x00a2, "Return Volume/Directory Number,Information Level 2,Immediate Close Handle" ],
1743         [ 0x00a4, "Return EAHandle,Close Handle on Error,Information Level 2,Immediate Close Handle" ],
1744         [ 0x00a5, "Return NetWareHandle,Close Handle on Error,Information Level 2,Immediate Close Handle" ],
1745         [ 0x00a6, "Return Volume/Directory Number,Close Handle on Error,Information Level 2,Immediate Close Handle" ],
1746         [ 0x00b0, "Return EAHandle,Information Level 3,Immediate Close Handle" ],
1747         [ 0x00b1, "Return NetWareHandle,Information Level 3,Immediate Close Handle" ],
1748         [ 0x00b2, "Return Volume/Directory Number,Information Level 3,Immediate Close Handle" ],
1749         [ 0x00b4, "Return EAHandle,Close Handle on Error,Information Level 3,Immediate Close Handle" ],
1750         [ 0x00b5, "Return NetWareHandle,Close Handle on Error,Information Level 3,Immediate Close Handle" ],
1751         [ 0x00b6, "Return Volume/Directory Number,Close Handle on Error,Information Level 3,Immediate Close Handle" ],
1752         [ 0x00c0, "Return EAHandle,Information Level 4,Immediate Close Handle" ],
1753         [ 0x00c1, "Return NetWareHandle,Information Level 4,Immediate Close Handle" ],
1754         [ 0x00c2, "Return Volume/Directory Number,Information Level 4,Immediate Close Handle" ],
1755         [ 0x00c4, "Return EAHandle,Close Handle on Error,Information Level 4,Immediate Close Handle" ],
1756         [ 0x00c5, "Return NetWareHandle,Close Handle on Error,Information Level 4,Immediate Close Handle" ],
1757         [ 0x00c6, "Return Volume/Directory Number,Close Handle on Error,Information Level 4,Immediate Close Handle" ],
1758         [ 0x00d0, "Return EAHandle,Information Level 5,Immediate Close Handle" ],
1759         [ 0x00d1, "Return NetWareHandle,Information Level 5,Immediate Close Handle" ],
1760         [ 0x00d2, "Return Volume/Directory Number,Information Level 5,Immediate Close Handle" ],
1761         [ 0x00d4, "Return EAHandle,Close Handle on Error,Information Level 5,Immediate Close Handle" ],
1762         [ 0x00d5, "Return NetWareHandle,Close Handle on Error,Information Level 5,Immediate Close Handle" ],
1763         [ 0x00d6, "Return Volume/Directory Number,Close Handle on Error,Information Level 5,Immediate Close Handle" ],
1764         [ 0x00e0, "Return EAHandle,Information Level 6,Immediate Close Handle" ],
1765         [ 0x00e1, "Return NetWareHandle,Information Level 6,Immediate Close Handle" ],
1766         [ 0x00e2, "Return Volume/Directory Number,Information Level 6,Immediate Close Handle" ],
1767         [ 0x00e4, "Return EAHandle,Close Handle on Error,Information Level 6,Immediate Close Handle" ],
1768         [ 0x00e5, "Return NetWareHandle,Close Handle on Error,Information Level 6,Immediate Close Handle" ],
1769         [ 0x00e6, "Return Volume/Directory Number,Close Handle on Error,Information Level 6,Immediate Close Handle" ],
1770         [ 0x00f0, "Return EAHandle,Information Level 7,Immediate Close Handle" ],
1771         [ 0x00f1, "Return NetWareHandle,Information Level 7,Immediate Close Handle" ],
1772         [ 0x00f2, "Return Volume/Directory Number,Information Level 7,Immediate Close Handle" ],
1773         [ 0x00f4, "Return EAHandle,Close Handle on Error,Information Level 7,Immediate Close Handle" ],
1774         [ 0x00f5, "Return NetWareHandle,Close Handle on Error,Information Level 7,Immediate Close Handle" ],
1775         [ 0x00f6, "Return Volume/Directory Number,Close Handle on Error,Information Level 7,Immediate Close Handle" ],
1776 ])
1777 dstNSIndicator                  = val_string16("dst_ns_indicator", "Destination Name Space Indicator", [
1778         [ 0x0000, "Return Source Name Space Information" ],
1779         [ 0x0001, "Return Destination Name Space Information" ],
1780 ])      
1781 DstQueueID                      = uint32("dst_queue_id", "Destination Queue ID")
1782 DuplicateRepliesSent            = uint16("duplicate_replies_sent", "Duplicate Replies Sent")
1783
1784 EAAccessFlag                    = bitfield16("ea_access_flag", "EA Access Flag", [
1785         bf_boolean16(0x0080, "ea_need_bit_flag", "EA Need Bit Flag"),
1786 ])
1787 EABytesWritten                  = uint32("ea_bytes_written", "Bytes Written")
1788 EACount                         = uint32("ea_count", "Count")
1789 EADataSize                      = uint32("ea_data_size", "Data Size")
1790 EADataSizeDuplicated            = uint32("ea_data_size_duplicated", "Data Size Duplicated")
1791 EADuplicateCount                = uint32("ea_duplicate_count", "Duplicate Count")
1792 EAErrorCodes                    = val_string16("ea_error_codes", "EA Error Codes", [
1793         [ 0x0000, "SUCCESSFUL" ],
1794         [ 0x00c8, "ERR_MISSING_EA_KEY" ],
1795         [ 0x00c9, "ERR_EA_NOT_FOUND" ],
1796         [ 0x00ca, "ERR_INVALID_EA_HANDLE_TYPE" ],
1797         [ 0x00cb, "ERR_EA_NO_KEY_NO_DATA" ],
1798         [ 0x00cc, "ERR_EA_NUMBER_MISMATCH" ],
1799         [ 0x00cd, "ERR_EXTENT_NUMBER_OUT_OF_RANGE" ],
1800         [ 0x00ce, "ERR_EA_BAD_DIR_NUM" ],
1801         [ 0x00cf, "ERR_INVALID_EA_HANDLE" ],
1802         [ 0x00d0, "ERR_EA_POSITION_OUT_OF_RANGE" ],
1803         [ 0x00d1, "ERR_EA_ACCESS_DENIED" ],
1804         [ 0x00d2, "ERR_DATA_PAGE_ODD_SIZE" ],
1805         [ 0x00d3, "ERR_EA_VOLUME_NOT_MOUNTED" ],
1806         [ 0x00d4, "ERR_BAD_PAGE_BOUNDARY" ],
1807         [ 0x00d5, "ERR_INSPECT_FAILURE" ],
1808         [ 0x00d6, "ERR_EA_ALREADY_CLAIMED" ],
1809         [ 0x00d7, "ERR_ODD_BUFFER_SIZE" ],
1810         [ 0x00d8, "ERR_NO_SCORECARDS" ],
1811         [ 0x00d9, "ERR_BAD_EDS_SIGNATURE" ],
1812         [ 0x00da, "ERR_EA_SPACE_LIMIT" ],
1813         [ 0x00db, "ERR_EA_KEY_CORRUPT" ],
1814         [ 0x00dc, "ERR_EA_KEY_LIMIT" ],
1815         [ 0x00dd, "ERR_TALLY_CORRUPT" ],
1816 ])
1817 EAFlags                         = val_string16("ea_flags", "EA Flags", [
1818         [ 0x0000, "Return EAHandle,Information Level 0" ],
1819         [ 0x0001, "Return NetWareHandle,Information Level 0" ],
1820         [ 0x0002, "Return Volume/Directory Number,Information Level 0" ],
1821         [ 0x0004, "Return EAHandle,Close Handle on Error,Information Level 0" ],
1822         [ 0x0005, "Return NetWareHandle,Close Handle on Error,Information Level 0" ],
1823         [ 0x0006, "Return Volume/Directory Number,Close Handle on Error,Information Level 0" ],
1824         [ 0x0010, "Return EAHandle,Information Level 1" ],
1825         [ 0x0011, "Return NetWareHandle,Information Level 1" ],
1826         [ 0x0012, "Return Volume/Directory Number,Information Level 1" ],
1827         [ 0x0014, "Return EAHandle,Close Handle on Error,Information Level 1" ],
1828         [ 0x0015, "Return NetWareHandle,Close Handle on Error,Information Level 1" ],
1829         [ 0x0016, "Return Volume/Directory Number,Close Handle on Error,Information Level 1" ],
1830         [ 0x0020, "Return EAHandle,Information Level 2" ],
1831         [ 0x0021, "Return NetWareHandle,Information Level 2" ],
1832         [ 0x0022, "Return Volume/Directory Number,Information Level 2" ],
1833         [ 0x0024, "Return EAHandle,Close Handle on Error,Information Level 2" ],
1834         [ 0x0025, "Return NetWareHandle,Close Handle on Error,Information Level 2" ],
1835         [ 0x0026, "Return Volume/Directory Number,Close Handle on Error,Information Level 2" ],
1836         [ 0x0030, "Return EAHandle,Information Level 3" ],
1837         [ 0x0031, "Return NetWareHandle,Information Level 3" ],
1838         [ 0x0032, "Return Volume/Directory Number,Information Level 3" ],
1839         [ 0x0034, "Return EAHandle,Close Handle on Error,Information Level 3" ],
1840         [ 0x0035, "Return NetWareHandle,Close Handle on Error,Information Level 3" ],
1841         [ 0x0036, "Return Volume/Directory Number,Close Handle on Error,Information Level 3" ],
1842         [ 0x0040, "Return EAHandle,Information Level 4" ],
1843         [ 0x0041, "Return NetWareHandle,Information Level 4" ],
1844         [ 0x0042, "Return Volume/Directory Number,Information Level 4" ],
1845         [ 0x0044, "Return EAHandle,Close Handle on Error,Information Level 4" ],
1846         [ 0x0045, "Return NetWareHandle,Close Handle on Error,Information Level 4" ],
1847         [ 0x0046, "Return Volume/Directory Number,Close Handle on Error,Information Level 4" ],
1848         [ 0x0050, "Return EAHandle,Information Level 5" ],
1849         [ 0x0051, "Return NetWareHandle,Information Level 5" ],
1850         [ 0x0052, "Return Volume/Directory Number,Information Level 5" ],
1851         [ 0x0054, "Return EAHandle,Close Handle on Error,Information Level 5" ],
1852         [ 0x0055, "Return NetWareHandle,Close Handle on Error,Information Level 5" ],
1853         [ 0x0056, "Return Volume/Directory Number,Close Handle on Error,Information Level 5" ],
1854         [ 0x0060, "Return EAHandle,Information Level 6" ],
1855         [ 0x0061, "Return NetWareHandle,Information Level 6" ],
1856         [ 0x0062, "Return Volume/Directory Number,Information Level 6" ],
1857         [ 0x0064, "Return EAHandle,Close Handle on Error,Information Level 6" ],
1858         [ 0x0065, "Return NetWareHandle,Close Handle on Error,Information Level 6" ],
1859         [ 0x0066, "Return Volume/Directory Number,Close Handle on Error,Information Level 6" ],
1860         [ 0x0070, "Return EAHandle,Information Level 7" ],
1861         [ 0x0071, "Return NetWareHandle,Information Level 7" ],
1862         [ 0x0072, "Return Volume/Directory Number,Information Level 7" ],
1863         [ 0x0074, "Return EAHandle,Close Handle on Error,Information Level 7" ],
1864         [ 0x0075, "Return NetWareHandle,Close Handle on Error,Information Level 7" ],
1865         [ 0x0076, "Return Volume/Directory Number,Close Handle on Error,Information Level 7" ],
1866         [ 0x0080, "Return EAHandle,Information Level 0,Immediate Close Handle" ],
1867         [ 0x0081, "Return NetWareHandle,Information Level 0,Immediate Close Handle" ],
1868         [ 0x0082, "Return Volume/Directory Number,Information Level 0,Immediate Close Handle" ],
1869         [ 0x0084, "Return EAHandle,Close Handle on Error,Information Level 0,Immediate Close Handle" ],
1870         [ 0x0085, "Return NetWareHandle,Close Handle on Error,Information Level 0,Immediate Close Handle" ],
1871         [ 0x0086, "Return Volume/Directory Number,Close Handle on Error,Information Level 0,Immediate Close Handle" ],
1872         [ 0x0090, "Return EAHandle,Information Level 1,Immediate Close Handle" ],
1873         [ 0x0091, "Return NetWareHandle,Information Level 1,Immediate Close Handle" ],
1874         [ 0x0092, "Return Volume/Directory Number,Information Level 1,Immediate Close Handle" ],
1875         [ 0x0094, "Return EAHandle,Close Handle on Error,Information Level 1,Immediate Close Handle" ],
1876         [ 0x0095, "Return NetWareHandle,Close Handle on Error,Information Level 1,Immediate Close Handle" ],
1877         [ 0x0096, "Return Volume/Directory Number,Close Handle on Error,Information Level 1,Immediate Close Handle" ],
1878         [ 0x00a0, "Return EAHandle,Information Level 2,Immediate Close Handle" ],
1879         [ 0x00a1, "Return NetWareHandle,Information Level 2,Immediate Close Handle" ],
1880         [ 0x00a2, "Return Volume/Directory Number,Information Level 2,Immediate Close Handle" ],
1881         [ 0x00a4, "Return EAHandle,Close Handle on Error,Information Level 2,Immediate Close Handle" ],
1882         [ 0x00a5, "Return NetWareHandle,Close Handle on Error,Information Level 2,Immediate Close Handle" ],
1883         [ 0x00a6, "Return Volume/Directory Number,Close Handle on Error,Information Level 2,Immediate Close Handle" ],
1884         [ 0x00b0, "Return EAHandle,Information Level 3,Immediate Close Handle" ],
1885         [ 0x00b1, "Return NetWareHandle,Information Level 3,Immediate Close Handle" ],
1886         [ 0x00b2, "Return Volume/Directory Number,Information Level 3,Immediate Close Handle" ],
1887         [ 0x00b4, "Return EAHandle,Close Handle on Error,Information Level 3,Immediate Close Handle" ],
1888         [ 0x00b5, "Return NetWareHandle,Close Handle on Error,Information Level 3,Immediate Close Handle" ],
1889         [ 0x00b6, "Return Volume/Directory Number,Close Handle on Error,Information Level 3,Immediate Close Handle" ],
1890         [ 0x00c0, "Return EAHandle,Information Level 4,Immediate Close Handle" ],
1891         [ 0x00c1, "Return NetWareHandle,Information Level 4,Immediate Close Handle" ],
1892         [ 0x00c2, "Return Volume/Directory Number,Information Level 4,Immediate Close Handle" ],
1893         [ 0x00c4, "Return EAHandle,Close Handle on Error,Information Level 4,Immediate Close Handle" ],
1894         [ 0x00c5, "Return NetWareHandle,Close Handle on Error,Information Level 4,Immediate Close Handle" ],
1895         [ 0x00c6, "Return Volume/Directory Number,Close Handle on Error,Information Level 4,Immediate Close Handle" ],
1896         [ 0x00d0, "Return EAHandle,Information Level 5,Immediate Close Handle" ],
1897         [ 0x00d1, "Return NetWareHandle,Information Level 5,Immediate Close Handle" ],
1898         [ 0x00d2, "Return Volume/Directory Number,Information Level 5,Immediate Close Handle" ],
1899         [ 0x00d4, "Return EAHandle,Close Handle on Error,Information Level 5,Immediate Close Handle" ],
1900         [ 0x00d5, "Return NetWareHandle,Close Handle on Error,Information Level 5,Immediate Close Handle" ],
1901         [ 0x00d6, "Return Volume/Directory Number,Close Handle on Error,Information Level 5,Immediate Close Handle" ],
1902         [ 0x00e0, "Return EAHandle,Information Level 6,Immediate Close Handle" ],
1903         [ 0x00e1, "Return NetWareHandle,Information Level 6,Immediate Close Handle" ],
1904         [ 0x00e2, "Return Volume/Directory Number,Information Level 6,Immediate Close Handle" ],
1905         [ 0x00e4, "Return EAHandle,Close Handle on Error,Information Level 6,Immediate Close Handle" ],
1906         [ 0x00e5, "Return NetWareHandle,Close Handle on Error,Information Level 6,Immediate Close Handle" ],
1907         [ 0x00e6, "Return Volume/Directory Number,Close Handle on Error,Information Level 6,Immediate Close Handle" ],
1908         [ 0x00f0, "Return EAHandle,Information Level 7,Immediate Close Handle" ],
1909         [ 0x00f1, "Return NetWareHandle,Information Level 7,Immediate Close Handle" ],
1910         [ 0x00f2, "Return Volume/Directory Number,Information Level 7,Immediate Close Handle" ],
1911         [ 0x00f4, "Return EAHandle,Close Handle on Error,Information Level 7,Immediate Close Handle" ],
1912         [ 0x00f5, "Return NetWareHandle,Close Handle on Error,Information Level 7,Immediate Close Handle" ],
1913         [ 0x00f6, "Return Volume/Directory Number,Close Handle on Error,Information Level 7,Immediate Close Handle" ],
1914 ])
1915 EAHandle                        = uint32("ea_handle", "EA Handle")
1916 EAHandle.Display("BASE_HEX")
1917 EAHandleOrNetWareHandleOrVolume = uint32("ea_handle_or_netware_handle_or_volume", "EAHandle or NetWare Handle or Volume (see EAFlags)")
1918 EAKey                           = nstring16("ea_key", "EA Key")
1919 EAKeySize                       = uint32("ea_key_size", "Key Size")
1920 EAKeySizeDuplicated             = uint32("ea_key_size_duplicated", "Key Size Duplicated")
1921 EAValue                         = nstring16("ea_value", "EA Value")
1922 EAValueRep                      = fw_string("ea_value_rep", "EA Value", 1)
1923 EAValueLength                   = uint16("ea_value_length", "Value Length")
1924 EchoSocket                      = uint16("echo_socket", "Echo Socket")
1925 EchoSocket.Display('BASE_HEX')
1926 EffectiveRights                 = bitfield8("effective_rights", "Effective Rights", [
1927         bf_boolean8(0x01, "effective_rights_read", "Read Rights"),
1928         bf_boolean8(0x02, "effective_rights_write", "Write Rights"),
1929         bf_boolean8(0x04, "effective_rights_open", "Open Rights"),
1930         bf_boolean8(0x08, "effective_rights_create", "Create Rights"),
1931         bf_boolean8(0x10, "effective_rights_delete", "Delete Rights"),
1932         bf_boolean8(0x20, "effective_rights_parental", "Parental Rights"),
1933         bf_boolean8(0x40, "effective_rights_search", "Search Rights"),
1934         bf_boolean8(0x80, "effective_rights_modify", "Modify Rights"),
1935 ])
1936 EnumInfoMask                    = bitfield8("enum_info_mask", "Return Information Mask", [
1937         bf_boolean8(0x01, "enum_info_transport", "Transport Information"),
1938         bf_boolean8(0x02, "enum_info_time", "Time Information"),
1939         bf_boolean8(0x04, "enum_info_name", "Name Information"),
1940         bf_boolean8(0x08, "enum_info_lock", "Lock Information"),
1941         bf_boolean8(0x10, "enum_info_print", "Print Information"),
1942         bf_boolean8(0x20, "enum_info_stats", "Statistical Information"),
1943         bf_boolean8(0x40, "enum_info_account", "Accounting Information"),
1944         bf_boolean8(0x80, "enum_info_auth", "Authentication Information"),
1945 ])
1946
1947 eventOffset                     = bytes("event_offset", "Event Offset", 8)
1948 eventOffset.Display("BASE_HEX")
1949 eventTime                       = uint32("event_time", "Event Time")
1950 eventTime.Display("BASE_HEX")
1951 ExpirationTime                  = uint32("expiration_time", "Expiration Time")
1952 ExpirationTime.Display('BASE_HEX')
1953 ExtAttrDataSize                 = uint32("ext_attr_data_size", "Extended Attributes Data Size")
1954 ExtAttrCount                    = uint32("ext_attr_count", "Extended Attributes Count")
1955 ExtAttrKeySize                  = uint32("ext_attr_key_size", "Extended Attributes Key Size")
1956 ExtendedAttributesDefined       = uint32("extended_attributes_defined", "Extended Attributes Defined")
1957 ExtendedAttributeExtantsUsed    = uint32("extended_attribute_extants_used", "Extended Attribute Extants Used")
1958 ExtendedInfo                    = bitfield16("ext_info", "Extended Return Information", [
1959         bf_boolean16(0x0001, "ext_info_update", "Update"),
1960         bf_boolean16(0x0002, "ext_info_dos_name", "DOS Name"),
1961         bf_boolean16(0x0004, "ext_info_flush", "Flush"),
1962         bf_boolean16(0x0008, "ext_info_parental", "Parental"),
1963         bf_boolean16(0x0010, "ext_info_mac_finder", "MAC Finder"),
1964         bf_boolean16(0x0020, "ext_info_sibling", "Sibling"),
1965         bf_boolean16(0x0040, "ext_info_effective", "Effective"),
1966         bf_boolean16(0x0080, "ext_info_mac_date", "MAC Date"),
1967         bf_boolean16(0x0100, "ext_info_access", "Last Access"),
1968         bf_boolean16(0x0400, "ext_info_64_bit_fs", "64 Bit File Sizes"),
1969         bf_boolean16(0x8000, "ext_info_newstyle", "New Style"),
1970 ])
1971 ExtRouterActiveFlag             = boolean8("ext_router_active_flag", "External Router Active Flag")
1972
1973 FailedAllocReqCnt               = uint32("failed_alloc_req", "Failed Alloc Request Count")
1974 FatalFATWriteErrors             = uint16("fatal_fat_write_errors", "Fatal FAT Write Errors")
1975 FATScanErrors                   = uint16("fat_scan_errors", "FAT Scan Errors")
1976 FATWriteErrors                  = uint16("fat_write_errors", "FAT Write Errors")
1977 FieldsLenTable                  = bytes("fields_len_table", "Fields Len Table", 32)
1978 FileCount                       = uint16("file_count", "File Count")
1979 FileDate                        = uint16("file_date", "File Date")
1980 FileDate.NWDate()
1981 FileDirWindow                   = uint16("file_dir_win", "File/Dir Window")
1982 FileDirWindow.Display("BASE_HEX")
1983 FileExecuteType                 = uint8("file_execute_type", "File Execute Type")
1984 FileExtendedAttributes          = val_string8("file_ext_attr", "File Extended Attributes", [
1985         [ 0x00, "Search On All Read Only Opens" ],
1986         [ 0x01, "Search On Read Only Opens With No Path" ],
1987         [ 0x02, "Shell Default Search Mode" ],
1988         [ 0x03, "Search On All Opens With No Path" ],
1989         [ 0x04, "Do Not Search" ],
1990         [ 0x05, "Reserved" ],
1991         [ 0x06, "Search On All Opens" ],
1992         [ 0x07, "Reserved" ],
1993         [ 0x08, "Search On All Read Only Opens/Indexed" ],
1994         [ 0x09, "Search On Read Only Opens With No Path/Indexed" ],
1995         [ 0x0a, "Shell Default Search Mode/Indexed" ],
1996         [ 0x0b, "Search On All Opens With No Path/Indexed" ],
1997         [ 0x0c, "Do Not Search/Indexed" ],
1998         [ 0x0d, "Indexed" ],
1999         [ 0x0e, "Search On All Opens/Indexed" ],
2000         [ 0x0f, "Indexed" ],
2001         [ 0x10, "Search On All Read Only Opens/Transactional" ],
2002         [ 0x11, "Search On Read Only Opens With No Path/Transactional" ],
2003         [ 0x12, "Shell Default Search Mode/Transactional" ],
2004         [ 0x13, "Search On All Opens With No Path/Transactional" ],
2005         [ 0x14, "Do Not Search/Transactional" ],
2006         [ 0x15, "Transactional" ],
2007         [ 0x16, "Search On All Opens/Transactional" ],
2008         [ 0x17, "Transactional" ],
2009         [ 0x18, "Search On All Read Only Opens/Indexed/Transactional" ],
2010         [ 0x19, "Search On Read Only Opens With No Path/Indexed/Transactional" ],
2011         [ 0x1a, "Shell Default Search Mode/Indexed/Transactional" ],
2012         [ 0x1b, "Search On All Opens With No Path/Indexed/Transactional" ],
2013         [ 0x1c, "Do Not Search/Indexed/Transactional" ],
2014         [ 0x1d, "Indexed/Transactional" ],
2015         [ 0x1e, "Search On All Opens/Indexed/Transactional" ],
2016         [ 0x1f, "Indexed/Transactional" ],
2017         [ 0x40, "Search On All Read Only Opens/Read Audit" ],
2018         [ 0x41, "Search On Read Only Opens With No Path/Read Audit" ],
2019         [ 0x42, "Shell Default Search Mode/Read Audit" ],
2020         [ 0x43, "Search On All Opens With No Path/Read Audit" ],
2021         [ 0x44, "Do Not Search/Read Audit" ],
2022         [ 0x45, "Read Audit" ],
2023         [ 0x46, "Search On All Opens/Read Audit" ],
2024         [ 0x47, "Read Audit" ],
2025         [ 0x48, "Search On All Read Only Opens/Indexed/Read Audit" ],
2026         [ 0x49, "Search On Read Only Opens With No Path/Indexed/Read Audit" ],
2027         [ 0x4a, "Shell Default Search Mode/Indexed/Read Audit" ],
2028         [ 0x4b, "Search On All Opens With No Path/Indexed/Read Audit" ],
2029         [ 0x4c, "Do Not Search/Indexed/Read Audit" ],
2030         [ 0x4d, "Indexed/Read Audit" ],
2031         [ 0x4e, "Search On All Opens/Indexed/Read Audit" ],
2032         [ 0x4f, "Indexed/Read Audit" ],
2033         [ 0x50, "Search On All Read Only Opens/Transactional/Read Audit" ],
2034         [ 0x51, "Search On Read Only Opens With No Path/Transactional/Read Audit" ],
2035         [ 0x52, "Shell Default Search Mode/Transactional/Read Audit" ],
2036         [ 0x53, "Search On All Opens With No Path/Transactional/Read Audit" ],
2037         [ 0x54, "Do Not Search/Transactional/Read Audit" ],
2038         [ 0x55, "Transactional/Read Audit" ],
2039         [ 0x56, "Search On All Opens/Transactional/Read Audit" ],
2040         [ 0x57, "Transactional/Read Audit" ],
2041         [ 0x58, "Search On All Read Only Opens/Indexed/Transactional/Read Audit" ],
2042         [ 0x59, "Search On Read Only Opens With No Path/Indexed/Transactional/Read Audit" ],
2043         [ 0x5a, "Shell Default Search Mode/Indexed/Transactional/Read Audit" ],
2044         [ 0x5b, "Search On All Opens With No Path/Indexed/Transactional/Read Audit" ],
2045         [ 0x5c, "Do Not Search/Indexed/Transactional/Read Audit" ],
2046         [ 0x5d, "Indexed/Transactional/Read Audit" ],
2047         [ 0x5e, "Search On All Opens/Indexed/Transactional/Read Audit" ],
2048         [ 0x5f, "Indexed/Transactional/Read Audit" ],
2049         [ 0x80, "Search On All Read Only Opens/Write Audit" ],
2050         [ 0x81, "Search On Read Only Opens With No Path/Write Audit" ],
2051         [ 0x82, "Shell Default Search Mode/Write Audit" ],
2052         [ 0x83, "Search On All Opens With No Path/Write Audit" ],
2053         [ 0x84, "Do Not Search/Write Audit" ],
2054         [ 0x85, "Write Audit" ],
2055         [ 0x86, "Search On All Opens/Write Audit" ],
2056         [ 0x87, "Write Audit" ],
2057         [ 0x88, "Search On All Read Only Opens/Indexed/Write Audit" ],
2058         [ 0x89, "Search On Read Only Opens With No Path/Indexed/Write Audit" ],
2059         [ 0x8a, "Shell Default Search Mode/Indexed/Write Audit" ],
2060         [ 0x8b, "Search On All Opens With No Path/Indexed/Write Audit" ],
2061         [ 0x8c, "Do Not Search/Indexed/Write Audit" ],
2062         [ 0x8d, "Indexed/Write Audit" ],
2063         [ 0x8e, "Search On All Opens/Indexed/Write Audit" ],
2064         [ 0x8f, "Indexed/Write Audit" ],
2065         [ 0x90, "Search On All Read Only Opens/Transactional/Write Audit" ],
2066         [ 0x91, "Search On Read Only Opens With No Path/Transactional/Write Audit" ],
2067         [ 0x92, "Shell Default Search Mode/Transactional/Write Audit" ],
2068         [ 0x93, "Search On All Opens With No Path/Transactional/Write Audit" ],
2069         [ 0x94, "Do Not Search/Transactional/Write Audit" ],
2070         [ 0x95, "Transactional/Write Audit" ],
2071         [ 0x96, "Search On All Opens/Transactional/Write Audit" ],
2072         [ 0x97, "Transactional/Write Audit" ],
2073         [ 0x98, "Search On All Read Only Opens/Indexed/Transactional/Write Audit" ],
2074         [ 0x99, "Search On Read Only Opens With No Path/Indexed/Transactional/Write Audit" ],
2075         [ 0x9a, "Shell Default Search Mode/Indexed/Transactional/Write Audit" ],
2076         [ 0x9b, "Search On All Opens With No Path/Indexed/Transactional/Write Audit" ],
2077         [ 0x9c, "Do Not Search/Indexed/Transactional/Write Audit" ],
2078         [ 0x9d, "Indexed/Transactional/Write Audit" ],
2079         [ 0x9e, "Search On All Opens/Indexed/Transactional/Write Audit" ],
2080         [ 0x9f, "Indexed/Transactional/Write Audit" ],
2081         [ 0xa0, "Search On All Read Only Opens/Read Audit/Write Audit" ],
2082         [ 0xa1, "Search On Read Only Opens With No Path/Read Audit/Write Audit" ],
2083         [ 0xa2, "Shell Default Search Mode/Read Audit/Write Audit" ],
2084         [ 0xa3, "Search On All Opens With No Path/Read Audit/Write Audit" ],
2085         [ 0xa4, "Do Not Search/Read Audit/Write Audit" ],
2086         [ 0xa5, "Read Audit/Write Audit" ],
2087         [ 0xa6, "Search On All Opens/Read Audit/Write Audit" ],
2088         [ 0xa7, "Read Audit/Write Audit" ],
2089         [ 0xa8, "Search On All Read Only Opens/Indexed/Read Audit/Write Audit" ],
2090         [ 0xa9, "Search On Read Only Opens With No Path/Indexed/Read Audit/Write Audit" ],
2091         [ 0xaa, "Shell Default Search Mode/Indexed/Read Audit/Write Audit" ],
2092         [ 0xab, "Search On All Opens With No Path/Indexed/Read Audit/Write Audit" ],
2093         [ 0xac, "Do Not Search/Indexed/Read Audit/Write Audit" ],
2094         [ 0xad, "Indexed/Read Audit/Write Audit" ],
2095         [ 0xae, "Search On All Opens/Indexed/Read Audit/Write Audit" ],
2096         [ 0xaf, "Indexed/Read Audit/Write Audit" ],
2097         [ 0xb0, "Search On All Read Only Opens/Transactional/Read Audit/Write Audit" ],
2098         [ 0xb1, "Search On Read Only Opens With No Path/Transactional/Read Audit/Write Audit" ],
2099         [ 0xb2, "Shell Default Search Mode/Transactional/Read Audit/Write Audit" ],
2100         [ 0xb3, "Search On All Opens With No Path/Transactional/Read Audit/Write Audit" ],
2101         [ 0xb4, "Do Not Search/Transactional/Read Audit/Write Audit" ],
2102         [ 0xb5, "Transactional/Read Audit/Write Audit" ],
2103         [ 0xb6, "Search On All Opens/Transactional/Read Audit/Write Audit" ],
2104         [ 0xb7, "Transactional/Read Audit/Write Audit" ],
2105         [ 0xb8, "Search On All Read Only Opens/Indexed/Transactional/Read Audit/Write Audit" ],
2106         [ 0xb9, "Search On Read Only Opens With No Path/Indexed/Transactional/Read Audit/Write Audit" ],
2107         [ 0xba, "Shell Default Search Mode/Indexed/Transactional/Read Audit/Write Audit" ],
2108         [ 0xbb, "Search On All Opens With No Path/Indexed/Transactional/Read Audit/Write Audit" ],
2109         [ 0xbc, "Do Not Search/Indexed/Transactional/Read Audit/Write Audit" ],
2110         [ 0xbd, "Indexed/Transactional/Read Audit/Write Audit" ],
2111         [ 0xbe, "Search On All Opens/Indexed/Transactional/Read Audit/Write Audit" ],
2112         [ 0xbf, "Indexed/Transactional/Read Audit/Write Audit" ],
2113 ])
2114 fileFlags                       = uint32("file_flags", "File Flags")
2115 FileHandle                      = bytes("file_handle", "File Handle", 6)
2116 FileLimbo                       = uint32("file_limbo", "File Limbo")
2117 FileListCount                   = uint32("file_list_count", "File List Count")
2118 FileLock                        = val_string8("file_lock", "File Lock", [
2119         [ 0x00, "Not Locked" ],
2120         [ 0xfe, "Locked by file lock" ],
2121         [ 0xff, "Unknown" ],
2122 ])
2123 FileLockCount                   = uint16("file_lock_count", "File Lock Count")
2124 FileMode                        = uint8("file_mode", "File Mode")
2125 FileName                        = nstring8("file_name", "Filename")
2126 FileName12                      = fw_string("file_name_12", "Filename", 12)
2127 FileName14                      = fw_string("file_name_14", "Filename", 14)
2128 FileNameLen                     = uint8("file_name_len", "Filename Length")
2129 FileOffset                      = uint32("file_offset", "File Offset")
2130 FilePath                        = nstring8("file_path", "File Path")
2131 FileSize                        = uint32("file_size", "File Size")
2132 FileSystemID                    = uint8("file_system_id", "File System ID")
2133 FileTime                        = uint16("file_time", "File Time")
2134 FileTime.NWTime()
2135 FileWriteFlags                  = val_string8("file_write_flags", "File Write Flags", [
2136         [ 0x01, "Writing" ],
2137         [ 0x02, "Write aborted" ],
2138 ])
2139 FileWriteState                  = val_string8("file_write_state", "File Write State", [
2140         [ 0x00, "Not Writing" ],
2141         [ 0x01, "Write in Progress" ],
2142         [ 0x02, "Write Being Stopped" ],
2143 ])
2144 Filler                          = uint8("filler", "Filler")
2145 FinderAttr                      = bitfield16("finder_attr", "Finder Info Attributes", [
2146         bf_boolean16(0x0001, "finder_attr_desktop", "Object on Desktop"),
2147         bf_boolean16(0x2000, "finder_attr_invisible", "Object is Invisible"),
2148         bf_boolean16(0x4000, "finder_attr_bundle", "Object Has Bundle"),
2149 ])
2150 FixedBitMask                    = uint32("fixed_bit_mask", "Fixed Bit Mask")
2151 FixedBitsDefined                = uint16("fixed_bits_defined", "Fixed Bits Defined")
2152 FlagBits                        = uint8("flag_bits", "Flag Bits")
2153 Flags                           = uint8("flags", "Flags")
2154 FlagsDef                        = uint16("flags_def", "Flags")
2155 FlushTime                       = uint32("flush_time", "Flush Time")
2156 FolderFlag                      = val_string8("folder_flag", "Folder Flag", [
2157         [ 0x00, "Not a Folder" ],
2158         [ 0x01, "Folder" ],
2159 ])
2160 ForkCount                       = uint8("fork_count", "Fork Count")
2161 ForkIndicator                   = val_string8("fork_indicator", "Fork Indicator", [
2162         [ 0x00, "Data Fork" ],
2163         [ 0x01, "Resource Fork" ],
2164 ])
2165 ForceFlag                       = val_string8("force_flag", "Force Server Down Flag", [
2166         [ 0x00, "Down Server if No Files Are Open" ],
2167         [ 0xff, "Down Server Immediately, Auto-Close Open Files" ],
2168 ])
2169 ForgedDetachedRequests          = uint16("forged_detached_requests", "Forged Detached Requests")
2170 FormType                        = uint16( "form_type", "Form Type" )
2171 FormTypeCnt                     = uint32("form_type_count", "Form Types Count")
2172 FoundSomeMem                    = uint32("found_some_mem", "Found Some Memory")
2173 FractionalSeconds               = uint32("fractional_time", "Fractional Time in Seconds")
2174 FraggerHandle                   = uint32("fragger_handle", "Fragment Handle")
2175 FraggerHandle.Display('BASE_HEX')
2176 FragmentWriteOccurred           = uint16("fragment_write_occurred", "Fragment Write Occurred")
2177 FragSize                        = uint32("frag_size", "Fragment Size")
2178 FreeableLimboSectors            = uint32("freeable_limbo_sectors", "Freeable Limbo Sectors")
2179 FreeBlocks                      = uint32("free_blocks", "Free Blocks")
2180 FreedClusters                   = uint32("freed_clusters", "Freed Clusters")
2181 FreeDirectoryEntries            = uint16("free_directory_entries", "Free Directory Entries")
2182 FSEngineFlag                    = boolean8("fs_engine_flag", "FS Engine Flag")
2183 FullName                        = fw_string("full_name", "Full Name", 39)
2184
2185 GetSetFlag                      = val_string8("get_set_flag", "Get Set Flag", [
2186         [ 0x00, "Get the default support module ID" ],
2187         [ 0x01, "Set the default support module ID" ],
2188 ])      
2189 GUID                            = bytes("guid", "GUID", 16)
2190 GUID.Display("BASE_HEX")
2191
2192 HandleFlag                      = val_string8("handle_flag", "Handle Flag", [
2193         [ 0x00, "Short Directory Handle" ],
2194         [ 0x01, "Directory Base" ],
2195         [ 0xFF, "No Handle Present" ],
2196 ])
2197 HandleInfoLevel                 = val_string8("handle_info_level", "Handle Info Level", [
2198         [ 0x00, "Get Limited Information from a File Handle" ],
2199         [ 0x01, "Get Limited Information from a File Handle Using a Name Space" ],
2200         [ 0x02, "Get Information from a File Handle" ],
2201         [ 0x03, "Get Information from a Directory Handle" ],
2202         [ 0x04, "Get Complete Information from a Directory Handle" ],
2203         [ 0x05, "Get Complete Information from a File Handle" ],
2204 ])
2205 HeldBytesRead                   = bytes("held_bytes_read", "Held Bytes Read", 6)
2206 HeldBytesWritten                = bytes("held_bytes_write", "Held Bytes Written", 6)
2207 HeldConnectTimeInMinutes        = uint32("held_conn_time", "Held Connect Time in Minutes")
2208 HeldRequests                    = uint32("user_info_held_req", "Held Requests")
2209 HoldAmount                      = uint32("hold_amount", "Hold Amount")
2210 HoldCancelAmount                = uint32("hold_cancel_amount", "Hold Cancel Amount")
2211 HolderID                        = uint32("holder_id", "Holder ID")
2212 HolderID.Display("BASE_HEX")
2213 HoldTime                        = uint32("hold_time", "Hold Time")
2214 HopsToNet                       = uint16("hops_to_net", "Hop Count")
2215 HorizLocation                   = uint16("horiz_location", "Horizontal Location")
2216 HostAddress                     = bytes("host_address", "Host Address", 6)
2217 HotFixBlocksAvailable           = uint16("hot_fix_blocks_available", "Hot Fix Blocks Available")
2218 HotFixDisabled                  = val_string8("hot_fix_disabled", "Hot Fix Disabled", [
2219         [ 0x00, "Enabled" ],
2220         [ 0x01, "Disabled" ],
2221 ])
2222 HotFixTableSize                 = uint16("hot_fix_table_size", "Hot Fix Table Size")
2223 HotFixTableStart                = uint32("hot_fix_table_start", "Hot Fix Table Start")
2224 Hour                            = uint8("s_hour", "Hour")
2225 HugeBitMask                     = uint32("huge_bit_mask", "Huge Bit Mask")
2226 HugeBitsDefined                 = uint16("huge_bits_defined", "Huge Bits Defined")
2227 HugeData                        = nstring8("huge_data", "Huge Data")
2228 HugeDataUsed                    = uint32("huge_data_used", "Huge Data Used")
2229 HugeStateInfo                   = bytes("huge_state_info", "Huge State Info", 16)
2230
2231 IdentificationNumber            = uint32("identification_number", "Identification Number")
2232 IgnoredRxPkts                   = uint32("ignored_rx_pkts", "Ignored Receive Packets")
2233 IncomingPacketDiscardedNoDGroup = uint16("incoming_packet_discarded_no_dgroup", "Incoming Packet Discarded No DGroup")
2234 InfoCount                       = uint16("info_count", "Info Count")
2235 InfoFlags                       = bitfield32("info_flags", "Info Flags", [
2236         bf_boolean32(0x10000000, "info_flags_security", "Return Object Security"),
2237         bf_boolean32(0x20000000, "info_flags_flags", "Return Object Flags"),
2238         bf_boolean32(0x40000000, "info_flags_type", "Return Object Type"),
2239         bf_boolean32(0x80000000, "info_flags_name", "Return Object Name"),
2240 ])
2241 InfoLevelNumber                 = val_string8("info_level_num", "Information Level Number", [
2242         [ 0x01, "Volume Information Definition" ],
2243         [ 0x02, "Volume Information 2 Definition" ],
2244 ])        
2245 InfoMask                        = bitfield32("info_mask", "Information Mask", [
2246         bf_boolean32(0x00000001, "info_flags_dos_time", "DOS Time"),
2247         bf_boolean32(0x00000002, "info_flags_ref_count", "Reference Count"),
2248         bf_boolean32(0x00000004, "info_flags_dos_attr", "DOS Attributes"),
2249         bf_boolean32(0x00000008, "info_flags_ids", "ID's"),
2250         bf_boolean32(0x00000010, "info_flags_ds_sizes", "Data Stream Sizes"),
2251         bf_boolean32(0x00000020, "info_flags_ns_attr", "Name Space Attributes"),
2252         bf_boolean32(0x00000040, "info_flags_ea_present", "EA Present Flag"),
2253         bf_boolean32(0x00000080, "info_flags_all_attr", "All Attributes"),
2254         bf_boolean32(0x00000100, "info_flags_all_dirbase_num", "All Directory Base Numbers"),
2255         bf_boolean32(0x00000200, "info_flags_max_access_mask", "Maximum Access Mask"),
2256         bf_boolean32(0x00000400, "info_flags_flush_time", "Flush Time"),
2257         bf_boolean32(0x00000800, "info_flags_prnt_base_id", "Parent Base ID"),
2258         bf_boolean32(0x00001000, "info_flags_mac_finder", "Mac Finder Information"),
2259         bf_boolean32(0x00002000, "info_flags_sibling_cnt", "Sibling Count"),
2260         bf_boolean32(0x00004000, "info_flags_effect_rights", "Effective Rights"),
2261         bf_boolean32(0x00008000, "info_flags_mac_time", "Mac Time"),
2262         bf_boolean32(0x20000000, "info_mask_dosname", "DOS Name"),
2263         bf_boolean32(0x40000000, "info_mask_c_name_space", "Creator Name Space & Name"),
2264         bf_boolean32(0x80000000, "info_mask_name", "Name"),
2265 ])
2266 InheritedRightsMask             = bitfield16("inherited_rights_mask", "Inherited Rights Mask", [ 
2267         bf_boolean16(0x0001, "inh_rights_read", "Read Rights"),
2268         bf_boolean16(0x0002, "inh_rights_write", "Write Rights"),
2269         bf_boolean16(0x0004, "inh_rights_open", "Open Rights"),
2270         bf_boolean16(0x0008, "inh_rights_create", "Create Rights"),
2271         bf_boolean16(0x0010, "inh_rights_delete", "Delete Rights"),
2272         bf_boolean16(0x0020, "inh_rights_parent", "Change Access"),
2273         bf_boolean16(0x0040, "inh_rights_search", "See Files Flag"),
2274         bf_boolean16(0x0080, "inh_rights_modify", "Modify Rights"),
2275         bf_boolean16(0x0100, "inh_rights_supervisor", "Supervisor"),
2276 ])
2277 InheritanceRevokeMask           = bitfield16("inheritance_revoke_mask", "Revoke Rights Mask", [
2278         bf_boolean16(0x0001, "inh_revoke_read", "Read Rights"),
2279         bf_boolean16(0x0002, "inh_revoke_write", "Write Rights"),
2280         bf_boolean16(0x0004, "inh_revoke_open", "Open Rights"),
2281         bf_boolean16(0x0008, "inh_revoke_create", "Create Rights"),
2282         bf_boolean16(0x0010, "inh_revoke_delete", "Delete Rights"),
2283         bf_boolean16(0x0020, "inh_revoke_parent", "Change Access"),
2284         bf_boolean16(0x0040, "inh_revoke_search", "See Files Flag"),
2285         bf_boolean16(0x0080, "inh_revoke_modify", "Modify Rights"),
2286         bf_boolean16(0x0100, "inh_revoke_supervisor", "Supervisor"),
2287 ])
2288 InitialSemaphoreValue           = uint8("initial_semaphore_value", "Initial Semaphore Value")
2289 InspectSize                     = uint32("inspect_size", "Inspect Size")
2290 InternetBridgeVersion           = uint8("internet_bridge_version", "Internet Bridge Version")
2291 InterruptNumbersUsed            = uint32("interrupt_numbers_used", "Interrupt Numbers Used")
2292 InUse                           = uint32("in_use", "Bytes in Use")
2293 IOAddressesUsed                 = bytes("io_addresses_used", "IO Addresses Used", 8)
2294 IOErrorCount                    = uint16("io_error_count", "IO Error Count")
2295 IOEngineFlag                    = boolean8("io_engine_flag", "IO Engine Flag")
2296 IPXNotMyNetwork                 = uint16("ipx_not_my_network", "IPX Not My Network")
2297 ItemsChanged                    = uint32("items_changed", "Items Changed")
2298 ItemsChecked                    = uint32("items_checked", "Items Checked")
2299 ItemsCount                      = uint32("items_count", "Items Count")
2300 itemsInList                     = uint32("items_in_list", "Items in List")
2301 ItemsInPacket                   = uint32("items_in_packet", "Items in Packet")
2302
2303 JobControlFlags                 = bitfield8("job_control_flags", "Job Control Flags", [
2304         bf_boolean8(0x08, "job_control_job_recovery", "Job Recovery"),
2305         bf_boolean8(0x10, "job_control_reservice", "ReService Job"),
2306         bf_boolean8(0x20, "job_control_file_open", "File Open"),
2307         bf_boolean8(0x40, "job_control_user_hold", "User Hold"),
2308         bf_boolean8(0x80, "job_control_operator_hold", "Operator Hold"),
2309
2310 ])
2311 JobControlFlagsWord             = bitfield16("job_control_flags_word", "Job Control Flags", [
2312         bf_boolean16(0x0008, "job_control1_job_recovery", "Job Recovery"),
2313         bf_boolean16(0x0010, "job_control1_reservice", "ReService Job"),
2314         bf_boolean16(0x0020, "job_control1_file_open", "File Open"),
2315         bf_boolean16(0x0040, "job_control1_user_hold", "User Hold"),
2316         bf_boolean16(0x0080, "job_control1_operator_hold", "Operator Hold"),
2317
2318 ])
2319 JobCount                        = uint32("job_count", "Job Count")
2320 JobFileHandle                   = bytes("job_file_handle", "Job File Handle", 6)
2321 JobFileHandleLong               = uint32("job_file_handle_long", "Job File Handle")
2322 JobFileHandleLong.Display("BASE_HEX")
2323 JobFileName                     = fw_string("job_file_name", "Job File Name", 14)
2324 JobPosition                     = uint8("job_position", "Job Position")
2325 JobPositionWord                 = uint16("job_position_word", "Job Position")
2326 JobNumber                       = uint16("job_number", "Job Number", BE )
2327 JobNumberLong                   = uint32("job_number_long", "Job Number", BE )
2328 JobNumberList                   = uint32("job_number_list", "Job Number List")
2329 JobType                         = uint16("job_type", "Job Type", BE )
2330
2331 LANCustomVariablesCount         = uint32("lan_cust_var_count", "LAN Custom Variables Count")
2332 LANdriverBoardInstance          = uint16("lan_drv_bd_inst", "LAN Driver Board Instance")
2333 LANdriverBoardNumber            = uint16("lan_drv_bd_num", "LAN Driver Board Number")
2334 LANdriverCardID                 = uint16("lan_drv_card_id", "LAN Driver Card ID")
2335 LANdriverCardName               = fw_string("lan_drv_card_name", "LAN Driver Card Name", 28)
2336 LANdriverCFG_MajorVersion       = uint8("lan_dvr_cfg_major_vrs", "LAN Driver Config - Major Version")
2337 LANdriverCFG_MinorVersion       = uint8("lan_dvr_cfg_minor_vrs", "LAN Driver Config - Minor Version")
2338 LANdriverDMAUsage1              = uint8("lan_drv_dma_usage1", "Primary DMA Channel")
2339 LANdriverDMAUsage2              = uint8("lan_drv_dma_usage2", "Secondary DMA Channel")
2340 LANdriverFlags                  = uint16("lan_drv_flags", "LAN Driver Flags")
2341 LANdriverFlags.Display("BASE_HEX")        
2342 LANdriverInterrupt1             = uint8("lan_drv_interrupt1", "Primary Interrupt Vector")
2343 LANdriverInterrupt2             = uint8("lan_drv_interrupt2", "Secondary Interrupt Vector")
2344 LANdriverIOPortsAndRanges1      = uint16("lan_drv_io_ports_and_ranges_1", "Primary Base I/O Port")
2345 LANdriverIOPortsAndRanges2      = uint16("lan_drv_io_ports_and_ranges_2", "Number of I/O Ports")
2346 LANdriverIOPortsAndRanges3      = uint16("lan_drv_io_ports_and_ranges_3", "Secondary Base I/O Port")
2347 LANdriverIOPortsAndRanges4      = uint16("lan_drv_io_ports_and_ranges_4", "Number of I/O Ports")
2348 LANdriverIOReserved             = bytes("lan_drv_io_reserved", "LAN Driver IO Reserved", 14)
2349 LANdriverLineSpeed              = uint16("lan_drv_line_speed", "LAN Driver Line Speed")
2350 LANdriverLink                   = uint32("lan_drv_link", "LAN Driver Link")
2351 LANdriverLogicalName            = bytes("lan_drv_log_name", "LAN Driver Logical Name", 18)
2352 LANdriverMajorVersion           = uint8("lan_drv_major_ver", "LAN Driver Major Version")
2353 LANdriverMaximumSize            = uint32("lan_drv_max_size", "LAN Driver Maximum Size")
2354 LANdriverMaxRecvSize            = uint32("lan_drv_max_rcv_size", "LAN Driver Maximum Receive Size")
2355 LANdriverMediaID                = uint16("lan_drv_media_id", "LAN Driver Media ID")
2356 LANdriverMediaType              = fw_string("lan_drv_media_type", "LAN Driver Media Type", 40)
2357 LANdriverMemoryDecode0          = uint32("lan_drv_mem_decode_0", "LAN Driver Memory Decode 0")
2358 LANdriverMemoryDecode1          = uint32("lan_drv_mem_decode_1", "LAN Driver Memory Decode 1")
2359 LANdriverMemoryLength0          = uint16("lan_drv_mem_length_0", "LAN Driver Memory Length 0")
2360 LANdriverMemoryLength1          = uint16("lan_drv_mem_length_1", "LAN Driver Memory Length 1")
2361 LANdriverMinorVersion           = uint8("lan_drv_minor_ver", "LAN Driver Minor Version")
2362 LANdriverModeFlags              = val_string8("lan_dvr_mode_flags", "LAN Driver Mode Flags", [
2363         [0x80, "Canonical Address" ],
2364         [0x81, "Canonical Address" ],
2365         [0x82, "Canonical Address" ],
2366         [0x83, "Canonical Address" ],
2367         [0x84, "Canonical Address" ],
2368         [0x85, "Canonical Address" ],
2369         [0x86, "Canonical Address" ],
2370         [0x87, "Canonical Address" ],
2371         [0x88, "Canonical Address" ],
2372         [0x89, "Canonical Address" ],
2373         [0x8a, "Canonical Address" ],
2374         [0x8b, "Canonical Address" ],
2375         [0x8c, "Canonical Address" ],
2376         [0x8d, "Canonical Address" ],
2377         [0x8e, "Canonical Address" ],
2378         [0x8f, "Canonical Address" ],
2379         [0x90, "Canonical Address" ],
2380         [0x91, "Canonical Address" ],
2381         [0x92, "Canonical Address" ],
2382         [0x93, "Canonical Address" ],
2383         [0x94, "Canonical Address" ],
2384         [0x95, "Canonical Address" ],
2385         [0x96, "Canonical Address" ],
2386         [0x97, "Canonical Address" ],
2387         [0x98, "Canonical Address" ],
2388         [0x99, "Canonical Address" ],
2389         [0x9a, "Canonical Address" ],
2390         [0x9b, "Canonical Address" ],
2391         [0x9c, "Canonical Address" ],
2392         [0x9d, "Canonical Address" ],
2393         [0x9e, "Canonical Address" ],
2394         [0x9f, "Canonical Address" ],
2395         [0xa0, "Canonical Address" ],
2396         [0xa1, "Canonical Address" ],
2397         [0xa2, "Canonical Address" ],
2398         [0xa3, "Canonical Address" ],
2399         [0xa4, "Canonical Address" ],
2400         [0xa5, "Canonical Address" ],
2401         [0xa6, "Canonical Address" ],
2402         [0xa7, "Canonical Address" ],
2403         [0xa8, "Canonical Address" ],
2404         [0xa9, "Canonical Address" ],
2405         [0xaa, "Canonical Address" ],
2406         [0xab, "Canonical Address" ],
2407         [0xac, "Canonical Address" ],
2408         [0xad, "Canonical Address" ],
2409         [0xae, "Canonical Address" ],
2410         [0xaf, "Canonical Address" ],
2411         [0xb0, "Canonical Address" ],
2412         [0xb1, "Canonical Address" ],
2413         [0xb2, "Canonical Address" ],
2414         [0xb3, "Canonical Address" ],
2415         [0xb4, "Canonical Address" ],
2416         [0xb5, "Canonical Address" ],
2417         [0xb6, "Canonical Address" ],
2418         [0xb7, "Canonical Address" ],
2419         [0xb8, "Canonical Address" ],
2420         [0xb9, "Canonical Address" ],
2421         [0xba, "Canonical Address" ],
2422         [0xbb, "Canonical Address" ],
2423         [0xbc, "Canonical Address" ],
2424         [0xbd, "Canonical Address" ],
2425         [0xbe, "Canonical Address" ],
2426         [0xbf, "Canonical Address" ],
2427         [0xc0, "Non-Canonical Address" ],
2428         [0xc1, "Non-Canonical Address" ],
2429         [0xc2, "Non-Canonical Address" ],
2430         [0xc3, "Non-Canonical Address" ],
2431         [0xc4, "Non-Canonical Address" ],
2432         [0xc5, "Non-Canonical Address" ],
2433         [0xc6, "Non-Canonical Address" ],
2434         [0xc7, "Non-Canonical Address" ],
2435         [0xc8, "Non-Canonical Address" ],
2436         [0xc9, "Non-Canonical Address" ],
2437         [0xca, "Non-Canonical Address" ],
2438         [0xcb, "Non-Canonical Address" ],
2439         [0xcc, "Non-Canonical Address" ],
2440         [0xcd, "Non-Canonical Address" ],
2441         [0xce, "Non-Canonical Address" ],
2442         [0xcf, "Non-Canonical Address" ],
2443         [0xd0, "Non-Canonical Address" ],
2444         [0xd1, "Non-Canonical Address" ],
2445         [0xd2, "Non-Canonical Address" ],
2446         [0xd3, "Non-Canonical Address" ],
2447         [0xd4, "Non-Canonical Address" ],
2448         [0xd5, "Non-Canonical Address" ],
2449         [0xd6, "Non-Canonical Address" ],
2450         [0xd7, "Non-Canonical Address" ],
2451         [0xd8, "Non-Canonical Address" ],
2452         [0xd9, "Non-Canonical Address" ],
2453         [0xda, "Non-Canonical Address" ],
2454         [0xdb, "Non-Canonical Address" ],
2455         [0xdc, "Non-Canonical Address" ],
2456         [0xdd, "Non-Canonical Address" ],
2457         [0xde, "Non-Canonical Address" ],
2458         [0xdf, "Non-Canonical Address" ],
2459         [0xe0, "Non-Canonical Address" ],
2460         [0xe1, "Non-Canonical Address" ],
2461         [0xe2, "Non-Canonical Address" ],
2462         [0xe3, "Non-Canonical Address" ],
2463         [0xe4, "Non-Canonical Address" ],
2464         [0xe5, "Non-Canonical Address" ],
2465         [0xe6, "Non-Canonical Address" ],
2466         [0xe7, "Non-Canonical Address" ],
2467         [0xe8, "Non-Canonical Address" ],
2468         [0xe9, "Non-Canonical Address" ],
2469         [0xea, "Non-Canonical Address" ],
2470         [0xeb, "Non-Canonical Address" ],
2471         [0xec, "Non-Canonical Address" ],
2472         [0xed, "Non-Canonical Address" ],
2473         [0xee, "Non-Canonical Address" ],
2474         [0xef, "Non-Canonical Address" ],
2475         [0xf0, "Non-Canonical Address" ],
2476         [0xf1, "Non-Canonical Address" ],
2477         [0xf2, "Non-Canonical Address" ],
2478         [0xf3, "Non-Canonical Address" ],
2479         [0xf4, "Non-Canonical Address" ],
2480         [0xf5, "Non-Canonical Address" ],
2481         [0xf6, "Non-Canonical Address" ],
2482         [0xf7, "Non-Canonical Address" ],
2483         [0xf8, "Non-Canonical Address" ],
2484         [0xf9, "Non-Canonical Address" ],
2485         [0xfa, "Non-Canonical Address" ],
2486         [0xfb, "Non-Canonical Address" ],
2487         [0xfc, "Non-Canonical Address" ],
2488         [0xfd, "Non-Canonical Address" ],
2489         [0xfe, "Non-Canonical Address" ],
2490         [0xff, "Non-Canonical Address" ],
2491 ])        
2492 LANDriverNumber                 = uint8("lan_driver_number", "LAN Driver Number")
2493 LANdriverNodeAddress            = bytes("lan_dvr_node_addr", "LAN Driver Node Address", 6)
2494 LANdriverRecvSize               = uint32("lan_drv_rcv_size", "LAN Driver Receive Size")
2495 LANdriverReserved               = uint16("lan_drv_reserved", "LAN Driver Reserved")
2496 LANdriverSendRetries            = uint16("lan_drv_snd_retries", "LAN Driver Send Retries")
2497 LANdriverSharingFlags           = uint16("lan_drv_share", "LAN Driver Sharing Flags")
2498 LANdriverShortName              = fw_string("lan_drv_short_name", "LAN Driver Short Name", 40)
2499 LANdriverSlot                   = uint16("lan_drv_slot", "LAN Driver Slot")
2500 LANdriverSrcRouting             = uint32("lan_drv_src_route", "LAN Driver Source Routing")
2501 LANdriverTransportTime          = uint16("lan_drv_trans_time", "LAN Driver Transport Time")
2502 LastAccessedDate                = uint16("last_access_date", "Last Accessed Date")
2503 LastAccessedDate.NWDate()
2504 LastAccessedTime                = uint16("last_access_time", "Last Accessed Time")
2505 LastAccessedTime.NWTime()
2506 LastGarbCollect                 = uint32("last_garbage_collect", "Last Garbage Collection")
2507 LastInstance                    = uint32("last_instance", "Last Instance")
2508 LastRecordSeen                  = uint16("last_record_seen", "Last Record Seen")
2509 LastSearchIndex                 = uint16("last_search_index", "Search Index")
2510 LastSeen                        = uint32("last_seen", "Last Seen")
2511 LastSequenceNumber              = uint16("last_sequence_number", "Sequence Number")
2512 Level                           = uint8("level", "Level")
2513 LFSCounters                     = uint32("lfs_counters", "LFS Counters")
2514 LimboDataStreamsCount           = uint32("limbo_data_streams_count", "Limbo Data Streams Count")
2515 limbCount                       = uint32("limb_count", "Limb Count")
2516 LimboUsed                       = uint32("limbo_used", "Limbo Used")
2517 LocalConnectionID               = uint32("local_connection_id", "Local Connection ID")
2518 LocalConnectionID.Display("BASE_HEX")
2519 LocalMaxPacketSize              = uint32("local_max_packet_size", "Local Max Packet Size")
2520 LocalMaxSendSize                = uint32("local_max_send_size", "Local Max Send Size")
2521 LocalMaxRecvSize                = uint32("local_max_recv_size", "Local Max Recv Size")
2522 LocalLoginInfoCcode             = uint8("local_login_info_ccode", "Local Login Info C Code")
2523 LocalTargetSocket               = uint32("local_target_socket", "Local Target Socket")
2524 LocalTargetSocket.Display("BASE_HEX")
2525 LockAreaLen                     = uint32("lock_area_len", "Lock Area Length")
2526 LockAreasStartOffset            = uint32("lock_areas_start_offset", "Lock Areas Start Offset")
2527 LockTimeout                     = uint16("lock_timeout", "Lock Timeout")
2528 Locked                          = val_string8("locked", "Locked Flag", [
2529         [ 0x00, "Not Locked Exclusively" ],
2530         [ 0x01, "Locked Exclusively" ],
2531 ])
2532 LockFlag                        = val_string8("lock_flag", "Lock Flag", [
2533         [ 0x00, "Not Locked, Log for Future Exclusive Lock" ],
2534         [ 0x01, "Exclusive Lock (Read/Write)" ],
2535         [ 0x02, "Log for Future Shared Lock"],
2536         [ 0x03, "Shareable Lock (Read-Only)" ],
2537         [ 0xfe, "Locked by a File Lock" ],
2538         [ 0xff, "Locked by Begin Share File Set" ],
2539 ])
2540 LockName                        = nstring8("lock_name", "Lock Name")
2541 LockStatus                      = val_string8("lock_status", "Lock Status", [
2542         [ 0x00, "Locked Exclusive" ],
2543         [ 0x01, "Locked Shareable" ],
2544         [ 0x02, "Logged" ],
2545         [ 0x06, "Lock is Held by TTS"],
2546 ])
2547 LockType                        = val_string8("lock_type", "Lock Type", [
2548         [ 0x00, "Locked" ],
2549         [ 0x01, "Open Shareable" ],
2550         [ 0x02, "Logged" ],
2551         [ 0x03, "Open Normal" ],
2552         [ 0x06, "TTS Holding Lock" ],
2553         [ 0x07, "Transaction Flag Set on This File" ],
2554 ])
2555 LogFileFlagHigh                 = bitfield8("log_file_flag_high", "Log File Flag (byte 2)", [
2556         bf_boolean8(0x80, "log_flag_call_back", "Call Back Requested" ),
2557 ])
2558 LogFileFlagLow                  = bitfield8("log_file_flag_low", "Log File Flag", [
2559         bf_boolean8(0x01, "log_flag_lock_file", "Lock File Immediately" ), 
2560 ])      
2561 LoggedObjectID                  = uint32("logged_object_id", "Logged in Object ID")
2562 LoggedObjectID.Display("BASE_HEX")
2563 LoggedCount                     = uint16("logged_count", "Logged Count")
2564 LogicalConnectionNumber         = uint16("logical_connection_number", "Logical Connection Number", BE)
2565 LogicalDriveCount               = uint8("logical_drive_count", "Logical Drive Count")
2566 LogicalDriveNumber              = uint8("logical_drive_number", "Logical Drive Number")
2567 LogicalLockThreshold            = uint8("logical_lock_threshold", "LogicalLockThreshold")
2568 LogicalRecordName               = nstring8("logical_record_name", "Logical Record Name")
2569 LoginKey                        = bytes("login_key", "Login Key", 8)
2570 LogLockType                     = uint8("log_lock_type", "Log Lock Type")
2571 LogTtlRxPkts                    = uint32("log_ttl_rx_pkts", "Total Received Packets")
2572 LogTtlTxPkts                    = uint32("log_ttl_tx_pkts", "Total Transmitted Packets")
2573 LongName                        = fw_string("long_name", "Long Name", 32)
2574 LRUBlockWasDirty                = uint16("lru_block_was_dirty", "LRU Block Was Dirty")
2575
2576 MacAttr                         = bitfield16("mac_attr", "Attributes", [
2577         bf_boolean16(0x0001, "mac_attr_smode1", "Search Mode"),
2578         bf_boolean16(0x0002, "mac_attr_smode2", "Search Mode"),
2579         bf_boolean16(0x0004, "mac_attr_smode3", "Search Mode"),
2580         bf_boolean16(0x0010, "mac_attr_transaction", "Transaction"),
2581         bf_boolean16(0x0020, "mac_attr_index", "Index"),
2582         bf_boolean16(0x0040, "mac_attr_r_audit", "Read Audit"),
2583         bf_boolean16(0x0080, "mac_attr_w_audit", "Write Audit"),
2584         bf_boolean16(0x0100, "mac_attr_r_only", "Read Only"),
2585         bf_boolean16(0x0200, "mac_attr_hidden", "Hidden"),
2586         bf_boolean16(0x0400, "mac_attr_system", "System"),
2587         bf_boolean16(0x0800, "mac_attr_execute_only", "Execute Only"),
2588         bf_boolean16(0x1000, "mac_attr_subdirectory", "Subdirectory"),
2589         bf_boolean16(0x2000, "mac_attr_archive", "Archive"),
2590         bf_boolean16(0x8000, "mac_attr_share", "Shareable File"),
2591 ])
2592 MACBackupDate                   = uint16("mac_backup_date", "Mac Backup Date")
2593 MACBackupDate.NWDate()
2594 MACBackupTime                   = uint16("mac_backup_time", "Mac Backup Time")
2595 MACBackupTime.NWTime()
2596 MacBaseDirectoryID              = uint32("mac_base_directory_id", "Mac Base Directory ID")
2597 MacBaseDirectoryID.Display("BASE_HEX")
2598 MACCreateDate                   = uint16("mac_create_date", "Mac Create Date")
2599 MACCreateDate.NWDate()
2600 MACCreateTime                   = uint16("mac_create_time", "Mac Create Time")
2601 MACCreateTime.NWTime()
2602 MacDestinationBaseID            = uint32("mac_destination_base_id", "Mac Destination Base ID")
2603 MacDestinationBaseID.Display("BASE_HEX")
2604 MacFinderInfo                   = bytes("mac_finder_info", "Mac Finder Information", 32)
2605 MacLastSeenID                   = uint32("mac_last_seen_id", "Mac Last Seen ID")
2606 MacLastSeenID.Display("BASE_HEX")
2607 MacSourceBaseID                 = uint32("mac_source_base_id", "Mac Source Base ID")
2608 MacSourceBaseID.Display("BASE_HEX")
2609 MajorVersion                    = uint32("major_version", "Major Version")
2610 MaxBytes                        = uint16("max_bytes", "Maximum Number of Bytes")
2611 MaxDataStreams                  = uint32("max_data_streams", "Maximum Data Streams")
2612 MaxDirDepth                     = uint32("max_dir_depth", "Maximum Directory Depth")
2613 MaximumSpace                    = uint16("max_space", "Maximum Space")
2614 MaxNumOfConn                    = uint32("max_num_of_conn", "Maximum Number of Connections")
2615 MaxNumOfLANS                    = uint32("max_num_of_lans", "Maximum Number Of LAN's")
2616 MaxNumOfMedias                  = uint32("max_num_of_medias", "Maximum Number Of Media's")
2617 MaxNumOfNmeSps                  = uint32("max_num_of_nme_sps", "Maximum Number Of Name Spaces")
2618 MaxNumOfSpoolPr                 = uint32("max_num_of_spool_pr", "Maximum Number Of Spool Printers")
2619 MaxNumOfStacks                  = uint32("max_num_of_stacks", "Maximum Number Of Stacks")
2620 MaxNumOfUsers                   = uint32("max_num_of_users", "Maximum Number Of Users")
2621 MaxNumOfVol                     = uint32("max_num_of_vol", "Maximum Number of Volumes")
2622 MaxSpace                        = uint32("maxspace", "Maximum Space")
2623 MaxUsedDynamicSpace             = uint32("max_used_dynamic_space", "Max Used Dynamic Space")
2624 MediaList                       = uint32("media_list", "Media List")
2625 MediaListCount                  = uint32("media_list_count", "Media List Count")
2626 MediaName                       = nstring8("media_name", "Media Name")
2627 MediaNumber                     = uint32("media_number", "Media Number")
2628 MediaObjectType                 = val_string8("media_object_type", "Object Type", [
2629         [ 0x00, "Adapter" ],
2630         [ 0x01, "Changer" ],
2631         [ 0x02, "Removable Device" ],
2632         [ 0x03, "Device" ],
2633         [ 0x04, "Removable Media" ],
2634         [ 0x05, "Partition" ],
2635         [ 0x06, "Slot" ],
2636         [ 0x07, "Hotfix" ],
2637         [ 0x08, "Mirror" ],
2638         [ 0x09, "Parity" ],
2639         [ 0x0a, "Volume Segment" ],
2640         [ 0x0b, "Volume" ],
2641         [ 0x0c, "Clone" ],
2642         [ 0x0d, "Fixed Media" ],
2643         [ 0x0e, "Unknown" ],
2644 ])        
2645 MemberName                      = nstring8("member_name", "Member Name")
2646 MemberType                      = val_string8("member_type", "Member Type", [
2647         [ 0x0000,       "Unknown" ],
2648         [ 0x0001,       "User" ],
2649         [ 0x0002,       "User group" ],
2650         [ 0x0003,       "Print queue" ],
2651         [ 0x0004,       "NetWare file server" ],
2652         [ 0x0005,       "Job server" ],
2653         [ 0x0006,       "Gateway" ],
2654         [ 0x0007,       "Print server" ],
2655         [ 0x0008,       "Archive queue" ],
2656         [ 0x0009,       "Archive server" ],
2657         [ 0x000a,       "Job queue" ],
2658         [ 0x000b,       "Administration" ],
2659         [ 0x0021,       "NAS SNA gateway" ],
2660         [ 0x0026,       "Remote bridge server" ],
2661         [ 0x0027,       "TCP/IP gateway" ],
2662 ])
2663 MessageLanguage                 = uint32("message_language", "NLM Language")
2664 MigratedFiles                   = uint32("migrated_files", "Migrated Files")
2665 MigratedSectors                 = uint32("migrated_sectors", "Migrated Sectors")
2666 MinorVersion                    = uint32("minor_version", "Minor Version")
2667 Minute                          = uint8("s_minute", "Minutes")
2668 MixedModePathFlag               = uint8("mixed_mode_path_flag", "Mixed Mode Path Flag")
2669 ModifiedDate                    = uint16("modified_date", "Modified Date")
2670 ModifiedDate.NWDate()
2671 ModifiedTime                    = uint16("modified_time", "Modified Time")
2672 ModifiedTime.NWTime()
2673 ModifierID                      = uint32("modifier_id", "Modifier ID", BE)
2674 ModifierID.Display("BASE_HEX")
2675 ModifyDOSInfoMask               = bitfield16("modify_dos_info_mask", "Modify DOS Info Mask", [
2676         bf_boolean16(0x0002, "modify_dos_read", "Attributes"),
2677         bf_boolean16(0x0004, "modify_dos_write", "Creation Date"),
2678         bf_boolean16(0x0008, "modify_dos_open", "Creation Time"),
2679         bf_boolean16(0x0010, "modify_dos_create", "Creator ID"),
2680         bf_boolean16(0x0020, "modify_dos_delete", "Archive Date"),
2681         bf_boolean16(0x0040, "modify_dos_parent", "Archive Time"),
2682         bf_boolean16(0x0080, "modify_dos_search", "Archiver ID"),
2683         bf_boolean16(0x0100, "modify_dos_mdate", "Modify Date"),
2684         bf_boolean16(0x0200, "modify_dos_mtime", "Modify Time"),
2685         bf_boolean16(0x0400, "modify_dos_mid", "Modifier ID"),
2686         bf_boolean16(0x0800, "modify_dos_laccess", "Last Access"),
2687         bf_boolean16(0x1000, "modify_dos_inheritance", "Inheritance"),
2688         bf_boolean16(0x2000, "modify_dos_max_space", "Maximum Space"),
2689 ])      
2690 Month                           = val_string8("s_month", "Month", [
2691         [ 0x01, "January"],
2692         [ 0x02, "Febuary"],
2693         [ 0x03, "March"],
2694         [ 0x04, "April"],
2695         [ 0x05, "May"],
2696         [ 0x06, "June"],
2697         [ 0x07, "July"],
2698         [ 0x08, "August"],
2699         [ 0x09, "September"],
2700         [ 0x0a, "October"],
2701         [ 0x0b, "November"],
2702         [ 0x0c, "December"],
2703 ])
2704
2705 MoreFlag                        = val_string8("more_flag", "More Flag", [
2706         [ 0x00, "No More Segments/Entries Available" ],
2707         [ 0x01, "More Segments/Entries Available" ],
2708         [ 0xff, "More Segments/Entries Available" ],
2709 ])
2710 MoreProperties                  = val_string8("more_properties", "More Properties", [
2711         [ 0x00, "No More Properties Available" ],
2712         [ 0x01, "No More Properties Available" ],
2713         [ 0xff, "More Properties Available" ],
2714 ])
2715
2716 Name                            = nstring8("name", "Name")
2717 Name12                          = fw_string("name12", "Name", 12)
2718 NameLen                         = uint8("name_len", "Name Space Length")
2719 NameLength                      = uint8("name_length", "Name Length")
2720 NameList                        = uint32("name_list", "Name List")
2721 #
2722 # XXX - should this value be used to interpret the characters in names,
2723 # search patterns, and the like?
2724 #
2725 # We need to handle character sets better, e.g. translating strings
2726 # from whatever character set they are in the packet (DOS/Windows code
2727 # pages, ISO character sets, UNIX EUC character sets, UTF-8, UCS-2/Unicode,
2728 # Mac character sets, etc.) into UCS-4 or UTF-8 and storing them as such
2729 # in the protocol tree, and displaying them as best we can.
2730 #
2731 NameSpace                       = val_string8("name_space", "Name Space", [
2732         [ 0x00, "DOS" ],
2733         [ 0x01, "MAC" ],
2734         [ 0x02, "NFS" ],
2735         [ 0x03, "FTAM" ],
2736         [ 0x04, "OS/2, Long" ],
2737 ])
2738 NamesSpaceInfoMask                      = bitfield16("ns_info_mask", "Names Space Info Mask", [
2739         bf_boolean16(0x0001, "ns_info_mask_modify", "Modify Name"),
2740         bf_boolean16(0x0002, "ns_info_mask_fatt", "File Attributes"),
2741         bf_boolean16(0x0004, "ns_info_mask_cdate", "Creation Date"),
2742         bf_boolean16(0x0008, "ns_info_mask_ctime", "Creation Time"),
2743         bf_boolean16(0x0010, "ns_info_mask_owner", "Owner ID"),
2744         bf_boolean16(0x0020, "ns_info_mask_adate", "Archive Date"),
2745         bf_boolean16(0x0040, "ns_info_mask_atime", "Archive Time"),
2746         bf_boolean16(0x0080, "ns_info_mask_aid", "Archiver ID"),
2747         bf_boolean16(0x0100, "ns_info_mask_udate", "Update Date"),
2748         bf_boolean16(0x0200, "ns_info_mask_utime", "Update Time"),
2749         bf_boolean16(0x0400, "ns_info_mask_uid", "Update ID"),
2750         bf_boolean16(0x0800, "ns_info_mask_acc_date", "Access Date"),
2751         bf_boolean16(0x1000, "ns_info_mask_max_acc_mask", "Inheritance"),
2752         bf_boolean16(0x2000, "ns_info_mask_max_space", "Maximum Space"),
2753 ])
2754 NameSpaceName                   = nstring8("name_space_name", "Name Space Name")
2755 nameType                        = uint32("name_type", "nameType")
2756 NCPdataSize                     = uint32("ncp_data_size", "NCP Data Size")
2757 NCPextensionMajorVersion        = uint8("ncp_extension_major_version", "NCP Extension Major Version")
2758 NCPextensionMinorVersion        = uint8("ncp_extension_minor_version", "NCP Extension Minor Version")
2759 NCPextensionName                = nstring8("ncp_extension_name", "NCP Extension Name")
2760 NCPextensionNumber              = uint32("ncp_extension_number", "NCP Extension Number")
2761 NCPextensionNumber.Display("BASE_HEX")
2762 NCPExtensionNumbers             = uint32("ncp_extension_numbers", "NCP Extension Numbers")
2763 NCPextensionRevisionNumber      = uint8("ncp_extension_revision_number", "NCP Extension Revision Number")
2764 NCPPeakStaInUse                 = uint32("ncp_peak_sta_in_use", "Peak Number of Connections since Server was brought up")
2765 NCPStaInUseCnt                  = uint32("ncp_sta_in_use", "Number of Workstations Connected to Server")
2766 NDSFlags                        = uint32("nds_flags", "NDS Flags")
2767 NDSFlags.Display('BASE_HEX')
2768 NDSRequestFlags                 = bitfield16("nds_request_flags", "NDS Request Flags", [
2769         bf_boolean16(0x0001, "nds_request_flags_output", "Output Fields"),
2770         bf_boolean16(0x0002, "nds_request_flags_no_such_entry", "No Such Entry"),
2771         bf_boolean16(0x0004, "nds_request_flags_local_entry", "Local Entry"),
2772         bf_boolean16(0x0008, "nds_request_flags_type_ref", "Type Referral"),
2773         bf_boolean16(0x0010, "nds_request_flags_alias_ref", "Alias Referral"),
2774         bf_boolean16(0x0020, "nds_request_flags_req_cnt", "Request Count"),
2775         bf_boolean16(0x0040, "nds_request_flags_req_data_size", "Request Data Size"),
2776         bf_boolean16(0x0080, "nds_request_flags_reply_data_size", "Reply Data Size"),
2777         bf_boolean16(0x0100, "nds_request_flags_trans_ref", "Transport Referral"),
2778         bf_boolean16(0x0200, "nds_request_flags_trans_ref2", "Transport Referral"),
2779         bf_boolean16(0x0400, "nds_request_flags_up_ref", "Up Referral"),
2780         bf_boolean16(0x0800, "nds_request_flags_dn_ref", "Down Referral"),
2781 ])      
2782 NDSVerb                         = val_string16("nds_verb", "NDS Verb", [
2783         [ 1, "Resolve Name" ],
2784         [ 2, "Read Entry Information" ],
2785         [ 3, "Read" ],
2786         [ 4, "Compare" ],
2787         [ 5, "List" ],
2788         [ 6, "Search Entries" ],
2789         [ 7, "Add Entry" ],
2790         [ 8, "Remove Entry" ],
2791         [ 9, "Modify Entry" ],
2792         [ 10, "Modify RDN" ],
2793         [ 11, "Create Attribute" ],
2794         [ 12, "Read Attribute Definition" ],
2795         [ 13, "Remove Attribute Definition" ],
2796         [ 14, "Define Class" ],
2797         [ 15, "Read Class Definition" ],
2798         [ 16, "Modify Class Definition" ],
2799         [ 17, "Remove Class Definition" ],
2800         [ 18, "List Containable Classes" ],
2801         [ 19, "Get Effective Rights" ],
2802         [ 20, "Add Partition" ],
2803         [ 21, "Remove Partition" ],
2804         [ 22, "List Partitions" ],
2805         [ 23, "Split Partition" ],
2806         [ 24, "Join Partitions" ],
2807         [ 25, "Add Replica" ],
2808         [ 26, "Remove Replica" ],
2809         [ 27, "Open Stream" ],
2810         [ 28, "Search Filter" ],
2811         [ 29, "Create Subordinate Reference" ],
2812         [ 30, "Link Replica" ],
2813         [ 31, "Change Replica Type" ],
2814         [ 32, "Start Update Schema" ],
2815         [ 33, "End Update Schema" ],
2816         [ 34, "Update Schema" ],
2817         [ 35, "Start Update Replica" ],
2818         [ 36, "End Update Replica" ],
2819         [ 37, "Update Replica" ],
2820         [ 38, "Synchronize Partition" ],
2821         [ 39, "Synchronize Schema" ],
2822         [ 40, "Read Syntaxes" ],
2823         [ 41, "Get Replica Root ID" ],
2824         [ 42, "Begin Move Entry" ],
2825         [ 43, "Finish Move Entry" ],
2826         [ 44, "Release Moved Entry" ],
2827         [ 45, "Backup Entry" ],
2828         [ 46, "Restore Entry" ],
2829         [ 47, "Save DIB" ],
2830         [ 50, "Close Iteration" ],
2831         [ 51, "Unused" ],
2832         [ 52, "Audit Skulking" ],
2833         [ 53, "Get Server Address" ],
2834         [ 54, "Set Keys" ],
2835         [ 55, "Change Password" ],
2836         [ 56, "Verify Password" ],
2837         [ 57, "Begin Login" ],
2838         [ 58, "Finish Login" ],
2839         [ 59, "Begin Authentication" ],
2840         [ 60, "Finish Authentication" ],
2841         [ 61, "Logout" ],
2842         [ 62, "Repair Ring" ],
2843         [ 63, "Repair Timestamps" ],
2844         [ 64, "Create Back Link" ],
2845         [ 65, "Delete External Reference" ],
2846         [ 66, "Rename External Reference" ],
2847         [ 67, "Create Directory Entry" ],
2848         [ 68, "Remove Directory Entry" ],
2849         [ 69, "Designate New Master" ],
2850         [ 70, "Change Tree Name" ],
2851         [ 71, "Partition Entry Count" ],
2852         [ 72, "Check Login Restrictions" ],
2853         [ 73, "Start Join" ],
2854         [ 74, "Low Level Split" ],
2855         [ 75, "Low Level Join" ],
2856         [ 76, "Abort Low Level Join" ],
2857         [ 77, "Get All Servers" ],
2858 ])
2859 NDSNewVerb                      = val_string16("nds_new_verb", "NDS Verb", [
2860 ])
2861 NDSVersion                      = uint32("nds_version", "NDS Version")
2862 NDSCRC                          = uint32("nds_crc", "NDS CRC")
2863 NDSCRC.Display('BASE_HEX')
2864 NDSBuildVersion                 = uint32("nds_build_version", "NDS Build Version")
2865 NDSStatus                       = uint32("nds_status", "NDS Status")
2866 NetBIOSBroadcastWasPropogated   = uint32("netbios_broadcast_was_propogated", "NetBIOS Broadcast Was Propogated")
2867 NetIDNumber                     = uint32("net_id_number", "Net ID Number")
2868 NetIDNumber.Display("BASE_HEX")
2869 NetAddress                      = nbytes32("address", "Address")
2870 NetStatus                       = uint16("net_status", "Network Status")
2871 NetWareAccessHandle             = bytes("netware_access_handle", "NetWare Access Handle", 6)
2872 NetworkAddress                  = uint32("network_address", "Network Address")
2873 NetworkAddress.Display("BASE_HEX")
2874 NetworkNodeAddress              = bytes("network_node_address", "Network Node Address", 6)
2875 NetworkNumber                   = uint32("network_number", "Network Number")
2876 NetworkNumber.Display("BASE_HEX")
2877 #
2878 # XXX - this should have the "ipx_socket_vals" value_string table
2879 # from "packet-ipx.c".
2880 #
2881 NetworkSocket                   = uint16("network_socket", "Network Socket")
2882 NetworkSocket.Display("BASE_HEX")
2883 NewAccessRights                 = bitfield16("new_access_rights_mask", "New Access Rights", [
2884         bf_boolean16(0x0001, "new_access_rights_read", "Read"),
2885         bf_boolean16(0x0002, "new_access_rights_write", "Write"),
2886         bf_boolean16(0x0004, "new_access_rights_open", "Open"),
2887         bf_boolean16(0x0008, "new_access_rights_create", "Create"),
2888         bf_boolean16(0x0010, "new_access_rights_delete", "Delete"),
2889         bf_boolean16(0x0020, "new_access_rights_parental", "Parental"),
2890         bf_boolean16(0x0040, "new_access_rights_search", "Search"),
2891         bf_boolean16(0x0080, "new_access_rights_modify", "Modify"),
2892         bf_boolean16(0x0100, "new_access_rights_supervisor", "Supervisor"),
2893 ])
2894 NewDirectoryID                  = uint32("new_directory_id", "New Directory ID")
2895 NewDirectoryID.Display("BASE_HEX")
2896 NewEAHandle                     = uint32("new_ea_handle", "New EA Handle")
2897 NewEAHandle.Display("BASE_HEX")
2898 NewFileName                     = fw_string("new_file_name", "New File Name", 14)
2899 NewFileNameLen                  = nstring8("new_file_name_len", "New File Name")
2900 NewFileSize                     = uint32("new_file_size", "New File Size")
2901 NewPassword                     = nstring8("new_password", "New Password")
2902 NewPath                         = nstring8("new_path", "New Path")
2903 NewPosition                     = uint8("new_position", "New Position")
2904 NewObjectName                   = nstring8("new_object_name", "New Object Name")
2905 NextCntBlock                    = uint32("next_cnt_block", "Next Count Block")
2906 NextHugeStateInfo               = bytes("next_huge_state_info", "Next Huge State Info", 16)
2907 nextLimbScanNum                 = uint32("next_limb_scan_num", "Next Limb Scan Number")
2908 NextObjectID                    = uint32("next_object_id", "Next Object ID", BE)
2909 NextObjectID.Display("BASE_HEX")
2910 NextRecord                      = uint32("next_record", "Next Record")
2911 NextRequestRecord               = uint16("next_request_record", "Next Request Record")
2912 NextSearchIndex                 = uint16("next_search_index", "Next Search Index")
2913 NextSearchNumber                = uint16("next_search_number", "Next Search Number")
2914 NextSearchNum                   = uint32("nxt_search_num", "Next Search Number")
2915 nextStartingNumber              = uint32("next_starting_number", "Next Starting Number")
2916 NextTrusteeEntry                = uint32("next_trustee_entry", "Next Trustee Entry")
2917 NextVolumeNumber                = uint32("next_volume_number", "Next Volume Number")
2918 NLMBuffer                       = nstring8("nlm_buffer", "Buffer")
2919 NLMcount                        = uint32("nlm_count", "NLM Count")
2920 NLMFlags                        = bitfield8("nlm_flags", "Flags", [
2921         bf_boolean8(0x01, "nlm_flags_reentrant", "ReEntrant"),
2922         bf_boolean8(0x02, "nlm_flags_multiple", "Can Load Multiple Times"),
2923         bf_boolean8(0x04, "nlm_flags_synchronize", "Synchronize Start"),
2924         bf_boolean8(0x08, "nlm_flags_pseudo", "PseudoPreemption"),
2925 ])
2926 NLMLoadOptions                  = uint32("nlm_load_options", "NLM Load Options")
2927 NLMName                         = stringz("nlm_name_stringz", "NLM Name")
2928 NLMNumber                       = uint32("nlm_number", "NLM Number")
2929 NLMNumbers                      = uint32("nlm_numbers", "NLM Numbers")
2930 NLMsInList                      = uint32("nlms_in_list", "NLM's in List")
2931 NLMStartNumber                  = uint32("nlm_start_num", "NLM Start Number")
2932 NLMType                         = val_string8("nlm_type", "NLM Type", [
2933         [ 0x00, "Generic NLM (.NLM)" ],
2934         [ 0x01, "LAN Driver (.LAN)" ],
2935         [ 0x02, "Disk Driver (.DSK)" ],
2936         [ 0x03, "Name Space Support Module (.NAM)" ],
2937         [ 0x04, "Utility or Support Program (.NLM)" ],
2938         [ 0x05, "Mirrored Server Link (.MSL)" ],
2939         [ 0x06, "OS NLM (.NLM)" ],
2940         [ 0x07, "Paged High OS NLM (.NLM)" ],
2941         [ 0x08, "Host Adapter Module (.HAM)" ],
2942         [ 0x09, "Custom Device Module (.CDM)" ],
2943         [ 0x0a, "File System Engine (.NLM)" ],
2944         [ 0x0b, "Real Mode NLM (.NLM)" ],
2945         [ 0x0c, "Hidden NLM (.NLM)" ],
2946         [ 0x15, "NICI Support (.NLM)" ],
2947         [ 0x16, "NICI Support (.NLM)" ],
2948         [ 0x17, "Cryptography (.NLM)" ],
2949         [ 0x18, "Encryption (.NLM)" ],
2950         [ 0x19, "NICI Support (.NLM)" ],
2951         [ 0x1c, "NICI Support (.NLM)" ],
2952 ])        
2953 nodeFlags                       = uint32("node_flags", "Node Flags")
2954 nodeFlags.Display("BASE_HEX")
2955 NoMoreMemAvlCnt                 = uint32("no_more_mem_avail", "No More Memory Available Count")
2956 NonDedFlag                      = boolean8("non_ded_flag", "Non Dedicated Flag")
2957 NonFreeableAvailableSubAllocSectors = uint32("non_freeable_avail_sub_alloc_sectors", "Non Freeable Available Sub Alloc Sectors")
2958 NonFreeableLimboSectors         = uint32("non_freeable_limbo_sectors", "Non Freeable Limbo Sectors")
2959 NotUsableSubAllocSectors        = uint32("not_usable_sub_alloc_sectors", "Not Usable Sub Alloc Sectors")
2960 NotYetPurgeableBlocks           = uint32("not_yet_purgeable_blocks", "Not Yet Purgeable Blocks")
2961 NSInfoBitMask                   = uint32("ns_info_bit_mask", "Name Space Info Bit Mask")
2962 NSSOAllInFlags                  = bitfield32("nsso_all_in_flags", "SecretStore All Input Flags",[
2963         bf_boolean32(0x00000010, "nsso_all_unicode", "Unicode Data"),
2964         bf_boolean32(0x00000080, "nsso_set_tree", "Set Tree"),
2965         bf_boolean32(0x00000200, "nsso_destroy_ctx", "Destroy Context"),
2966 ])
2967 NSSOGetServiceInFlags           = bitfield32("nsso_get_svc_in_flags", "SecretStore Get Service Flags",[
2968         bf_boolean32(0x00000100, "nsso_get_ctx", "Get Context"),
2969 ])
2970 NSSOReadInFlags                 = bitfield32("nsso_read_in_flags", "SecretStore Read Flags",[
2971         bf_boolean32(0x00000001, "nsso_rw_enh_prot", "Read/Write Enhanced Protection"),
2972         bf_boolean32(0x00000008, "nsso_repair", "Repair SecretStore"),
2973 ])
2974 NSSOReadOrUnlockInFlags         = bitfield32("nsso_read_or_unlock_in_flags", "SecretStore Read or Unlock Flags",[
2975         bf_boolean32(0x00000004, "nsso_ep_master_pwd", "Master Password used instead of ENH Password"),
2976 ])
2977 NSSOUnlockInFlags               = bitfield32("nsso_unlock_in_flags", "SecretStore Unlock Flags",[
2978         bf_boolean32(0x00000004, "nsso_rmv_lock", "Remove Lock from Store"),
2979 ])
2980 NSSOWriteInFlags                = bitfield32("nsso_write_in_flags", "SecretStore Write Flags",[
2981         bf_boolean32(0x00000001, "nsso_enh_prot", "Enhanced Protection"),
2982         bf_boolean32(0x00000002, "nsso_create_id", "Create ID"),
2983         bf_boolean32(0x00000040, "nsso_ep_pwd_used", "Enhanced Protection Password Used"),
2984 ])
2985 NSSOContextOutFlags             = bitfield32("nsso_cts_out_flags", "Type of Context",[ 
2986         bf_boolean32(0x00000001, "nsso_ds_ctx", "DSAPI Context"),
2987         bf_boolean32(0x00000080, "nsso_ldap_ctx", "LDAP Context"),
2988         bf_boolean32(0x00000200, "nsso_dc_ctx", "Reserved"),
2989 ])
2990 NSSOGetServiceOutFlags          = bitfield32("nsso_get_svc_out_flags", "SecretStore Status Flags",[ 
2991         bf_boolean32(0x00400000, "nsso_mstr_pwd", "Master Password Present"),
2992 ])
2993 NSSOGetServiceReadOutFlags      = bitfield32("nsso_get_svc_read_out_flags", "SecretStore Status Flags",[
2994         bf_boolean32(0x00800000, "nsso_mp_disabled", "Master Password Disabled"),
2995 ])
2996 NSSOReadOutFlags                = bitfield32("nsso_read_out_flags", "SecretStore Read Flags",[
2997         bf_boolean32(0x00010000, "nsso_secret_locked", "Enhanced Protection Lock on Secret"),
2998         bf_boolean32(0x00020000, "nsso_secret_not_init", "Secret Not Yet Initialized"),
2999         bf_boolean32(0x00040000, "nsso_secret_marked", "Secret Marked for Enhanced Protection"),
3000         bf_boolean32(0x00080000, "nsso_secret_not_sync", "Secret Not Yet Synchronized in NDS"),
3001         bf_boolean32(0x00200000, "nsso_secret_enh_pwd", "Enhanced Protection Password on Secret"),
3002 ])
3003 NSSOReadOutStatFlags            = bitfield32("nsso_read_out_stat_flags", "SecretStore Read Status Flags",[
3004         bf_boolean32(0x00100000, "nsso_admin_mod", "Admin Modified Secret Last"),
3005 ])
3006 NSSOVerb                        = val_string8("nsso_verb", "SecretStore Verb", [
3007         [ 0x00, "Query Server" ],
3008         [ 0x01, "Read App Secrets" ],
3009         [ 0x02, "Write App Secrets" ],
3010         [ 0x03, "Add Secret ID" ],
3011         [ 0x04, "Remove Secret ID" ],
3012         [ 0x05, "Remove SecretStore" ],
3013         [ 0x06, "Enumerate SecretID's" ],
3014         [ 0x07, "Unlock Store" ],
3015         [ 0x08, "Set Master Password" ],
3016         [ 0x09, "Get Service Information" ],
3017 ])        
3018 NSSpecificInfo                  = fw_string("ns_specific_info", "Name Space Specific Info", 512)                                         
3019 NumberOfAllocs                  = uint32("num_of_allocs", "Number of Allocations")
3020 NumberOfAttributes              = uint32("number_of_attributes", "Number of Attributes")
3021 NumberOfCPUs                    = uint32("number_of_cpus", "Number of CPU's")
3022 NumberOfDataStreams             = uint16("number_of_data_streams", "Number of Data Streams")
3023 NumberOfDynamicMemoryAreas      = uint16("number_of_dynamic_memory_areas", "Number Of Dynamic Memory Areas")
3024 NumberOfEntries                 = uint8("number_of_entries", "Number of Entries")
3025 NumberOfLocks                   = uint8("number_of_locks", "Number of Locks")
3026 NumberOfMinutesToDelay          = uint32("number_of_minutes_to_delay", "Number of Minutes to Delay")
3027 NumberOfNCPExtensions           = uint32("number_of_ncp_extensions", "Number Of NCP Extensions")
3028 NumberOfNSLoaded                = uint16("number_of_ns_loaded", "Number Of Name Spaces Loaded")
3029 NumberOfProtocols               = uint8("number_of_protocols", "Number of Protocols")
3030 NumberOfRecords                 = uint16("number_of_records", "Number of Records")
3031 NumberOfReferencedPublics       = uint32("num_of_ref_publics", "Number of Referenced Public Symbols") 
3032 NumberOfSemaphores              = uint16("number_of_semaphores", "Number Of Semaphores")
3033 NumberOfServiceProcesses        = uint8("number_of_service_processes", "Number Of Service Processes")
3034 NumberOfSetCategories           = uint32("number_of_set_categories", "Number Of Set Categories")
3035 NumberOfSMs                     = uint32("number_of_sms", "Number Of Storage Medias")
3036 NumberOfStations                = uint8("number_of_stations", "Number of Stations")
3037 NumBytes                        = uint16("num_bytes", "Number of Bytes")
3038 NumOfCCinPkt                    = uint32("num_of_cc_in_pkt", "Number of Custom Counters in Packet")
3039 NumOfChecks                     = uint32("num_of_checks", "Number of Checks")
3040 NumOfEntries                    = uint32("num_of_entries", "Number of Entries")
3041 NumOfFilesMigrated              = uint32("num_of_files_migrated", "Number Of Files Migrated")
3042 NumOfGarbageColl                = uint32("num_of_garb_coll", "Number of Garbage Collections")
3043 NumOfNCPReqs                    = uint32("num_of_ncp_reqs", "Number of NCP Requests since Server was brought up")
3044 NumOfSegments                   = uint32("num_of_segments", "Number of Segments")
3045
3046 ObjectCount                     = uint32("object_count", "Object Count")
3047 ObjectFlags                     = val_string8("object_flags", "Object Flags", [
3048         [ 0x00, "Dynamic object" ],
3049         [ 0x01, "Static object" ],
3050 ])
3051 ObjectHasProperties             = val_string8("object_has_properites", "Object Has Properties", [
3052         [ 0x00, "No properties" ],
3053         [ 0xff, "One or more properties" ],
3054 ])
3055 ObjectID                        = uint32("object_id", "Object ID", BE)
3056 ObjectID.Display('BASE_HEX')
3057 ObjectIDCount                   = uint16("object_id_count", "Object ID Count")
3058 ObjectIDInfo                    = uint32("object_id_info", "Object Information")
3059 ObjectInfoReturnCount           = uint32("object_info_rtn_count", "Object Information Count")
3060 ObjectName                      = nstring8("object_name", "Object Name")
3061 ObjectNameLen                   = fw_string("object_name_len", "Object Name", 48)
3062 ObjectNameStringz               = stringz("object_name_stringz", "Object Name")
3063 ObjectNumber                    = uint32("object_number", "Object Number")
3064 ObjectSecurity                  = val_string8("object_security", "Object Security", [
3065         [ 0x00, "Object Read (Anyone) / Object Write (Anyone)" ],
3066         [ 0x01, "Object Read (Logged in) / Object Write (Anyone)" ],
3067         [ 0x02, "Object Read (Logged in as Object) / Object Write (Anyone)" ],
3068         [ 0x03, "Object Read (Supervisor) / Object Write (Anyone)" ],
3069         [ 0x04, "Object Read (Operating System Only) / Object Write (Anyone)" ],
3070         [ 0x10, "Object Read (Anyone) / Object Write (Logged in)" ],
3071         [ 0x11, "Object Read (Logged in) / Object Write (Logged in)" ],
3072         [ 0x12, "Object Read (Logged in as Object) / Object Write (Logged in)" ],
3073         [ 0x13, "Object Read (Supervisor) / Object Write (Logged in)" ],
3074         [ 0x14, "Object Read (Operating System Only) / Object Write (Logged in)" ],
3075         [ 0x20, "Object Read (Anyone) / Object Write (Logged in as Object)" ],
3076         [ 0x21, "Object Read (Logged in) / Object Write (Logged in as Object)" ],
3077         [ 0x22, "Object Read (Logged in as Object) / Object Write (Logged in as Object)" ],
3078         [ 0x23, "Object Read (Supervisor) / Object Write (Logged in as Object)" ],
3079         [ 0x24, "Object Read (Operating System Only) / Object Write (Logged in as Object)" ],
3080         [ 0x30, "Object Read (Anyone) / Object Write (Supervisor)" ],
3081         [ 0x31, "Object Read (Logged in) / Object Write (Supervisor)" ],
3082         [ 0x32, "Object Read (Logged in as Object) / Object Write (Supervisor)" ],
3083         [ 0x33, "Object Read (Supervisor) / Object Write (Supervisor)" ],
3084         [ 0x34, "Object Read (Operating System Only) / Object Write (Supervisor)" ],
3085         [ 0x40, "Object Read (Anyone) / Object Write (Operating System Only)" ],
3086         [ 0x41, "Object Read (Logged in) / Object Write (Operating System Only)" ],
3087         [ 0x42, "Object Read (Logged in as Object) / Object Write (Operating System Only)" ],
3088         [ 0x43, "Object Read (Supervisor) / Object Write (Operating System Only)" ],
3089         [ 0x44, "Object Read (Operating System Only) / Object Write (Operating System Only)" ],
3090 ])
3091 ObjectType                      = val_string16("object_type", "Object Type", [
3092         [ 0x0000,       "Unknown" ],
3093         [ 0x0001,       "User" ],
3094         [ 0x0002,       "User group" ],
3095         [ 0x0003,       "Print queue" ],
3096         [ 0x0004,       "NetWare file server" ],
3097         [ 0x0005,       "Job server" ],
3098         [ 0x0006,       "Gateway" ],
3099         [ 0x0007,       "Print server" ],
3100         [ 0x0008,       "Archive queue" ],
3101         [ 0x0009,       "Archive server" ],
3102         [ 0x000a,       "Job queue" ],
3103         [ 0x000b,       "Administration" ],
3104         [ 0x0021,       "NAS SNA gateway" ],
3105         [ 0x0026,       "Remote bridge server" ],
3106         [ 0x0027,       "TCP/IP gateway" ],
3107 ])
3108 OCRetFlags                      = val_string8("o_c_ret_flags", "Open Create Return Flags", [
3109         [ 0x00, "No CallBack has been registered (No Op-Lock)" ],
3110         [ 0x01, "Request has been registered for CallBack (Op-Lock)" ],
3111 ])
3112 OldestDeletedFileAgeInTicks     = uint32("oldest_deleted_file_age_in_ticks", "Oldest Deleted File Age in Ticks")
3113 OldFileName                     = bytes("old_file_name", "Old File Name", 15)
3114 OldFileSize                     = uint32("old_file_size", "Old File Size")
3115 OpenCount                       = uint16("open_count", "Open Count")
3116 OpenCreateAction                = bitfield8("open_create_action", "Open Create Action", [
3117         bf_boolean8(0x01, "open_create_action_opened", "Opened"),
3118         bf_boolean8(0x02, "open_create_action_created", "Created"),
3119         bf_boolean8(0x04, "open_create_action_replaced", "Replaced"),
3120         bf_boolean8(0x08, "open_create_action_compressed", "Compressed"),
3121         bf_boolean8(0x80, "open_create_action_read_only", "Read Only"),
3122 ])      
3123 OpenCreateMode                  = bitfield8("open_create_mode", "Open Create Mode", [
3124         bf_boolean8(0x01, "open_create_mode_open", "Open existing file (file must exist)"),
3125         bf_boolean8(0x02, "open_create_mode_replace", "Replace existing file"),
3126         bf_boolean8(0x08, "open_create_mode_create", "Create new file or subdirectory (file or subdirectory cannot exist)"),
3127         bf_boolean8(0x80, "open_create_mode_oplock", "Open Callback (Op-Lock)"),
3128 ])
3129 OpenForReadCount                = uint16("open_for_read_count", "Open For Read Count")
3130 OpenForWriteCount               = uint16("open_for_write_count", "Open For Write Count")
3131 OpenRights                      = bitfield8("open_rights", "Open Rights", [
3132         bf_boolean8(0x01, "open_rights_read_only", "Read Only"),
3133         bf_boolean8(0x02, "open_rights_write_only", "Write Only"),
3134         bf_boolean8(0x04, "open_rights_deny_read", "Deny Read"),
3135         bf_boolean8(0x08, "open_rights_deny_write", "Deny Write"),
3136         bf_boolean8(0x10, "open_rights_compat", "Compatibility"),
3137         bf_boolean8(0x40, "open_rights_write_thru", "Write Through"),
3138 ])
3139 OptionNumber                    = uint8("option_number", "Option Number")
3140 originalSize                    = uint32("original_size", "Original Size")
3141 OSLanguageID                    = uint8("os_language_id", "OS Language ID")
3142 OSMajorVersion                  = uint8("os_major_version", "OS Major Version")
3143 OSMinorVersion                  = uint8("os_minor_version", "OS Minor Version")
3144 OSRevision                      = uint8("os_revision", "OS Revision")
3145 OtherFileForkSize               = uint32("other_file_fork_size", "Other File Fork Size")
3146 OtherFileForkFAT                = uint32("other_file_fork_fat", "Other File Fork FAT Entry")
3147 OutgoingPacketDiscardedNoTurboBuffer = uint16("outgoing_packet_discarded_no_turbo_buffer", "Outgoing Packet Discarded No Turbo Buffer")
3148
3149 PacketsDiscardedByHopCount      = uint16("packets_discarded_by_hop_count", "Packets Discarded By Hop Count")
3150 PacketsDiscardedUnknownNet      = uint16("packets_discarded_unknown_net", "Packets Discarded Unknown Net")
3151 PacketsFromInvalidConnection    = uint16("packets_from_invalid_connection", "Packets From Invalid Connection")
3152 PacketsReceivedDuringProcessing = uint16("packets_received_during_processing", "Packets Received During Processing")
3153 PacketsWithBadRequestType       = uint16("packets_with_bad_request_type", "Packets With Bad Request Type")
3154 PacketsWithBadSequenceNumber    = uint16("packets_with_bad_sequence_number", "Packets With Bad Sequence Number")
3155 PageTableOwnerFlag              = uint32("page_table_owner_flag", "Page Table Owner")
3156 ParentID                        = uint32("parent_id", "Parent ID")
3157 ParentID.Display("BASE_HEX")
3158 ParentBaseID                    = uint32("parent_base_id", "Parent Base ID")
3159 ParentBaseID.Display("BASE_HEX")
3160 ParentDirectoryBase             = uint32("parent_directory_base", "Parent Directory Base")
3161 ParentDOSDirectoryBase          = uint32("parent_dos_directory_base", "Parent DOS Directory Base")
3162 ParentObjectNumber              = uint32("parent_object_number", "Parent Object Number")
3163 ParentObjectNumber.Display("BASE_HEX")
3164 Password                        = nstring8("password", "Password")
3165 PathBase                        = uint8("path_base", "Path Base")
3166 PathComponentCount              = uint16("path_component_count", "Path Component Count")
3167 PathComponentSize               = uint16("path_component_size", "Path Component Size")
3168 PathCookieFlags                 = val_string16("path_cookie_flags", "Path Cookie Flags", [
3169         [ 0x0000, "Last component is Not a File Name" ],
3170         [ 0x0001, "Last component is a File Name" ],
3171 ])
3172 PathCount                       = uint8("path_count", "Path Count")
3173 Path                            = nstring8("path", "Path")
3174 PathAndName                     = stringz("path_and_name", "Path and Name")
3175 PendingIOCommands               = uint16("pending_io_commands", "Pending IO Commands")
3176 PhysicalDiskNumber              = uint8("physical_disk_number", "Physical Disk Number")
3177 PhysicalDriveCount              = uint8("physical_drive_count", "Physical Drive Count")
3178 PhysicalLockThreshold           = uint8("physical_lock_threshold", "Physical Lock Threshold")
3179 PingVersion                     = uint16("ping_version", "Ping Version")
3180 PositiveAcknowledgesSent        = uint16("positive_acknowledges_sent", "Positive Acknowledges Sent")
3181 PreCompressedSectors            = uint32("pre_compressed_sectors", "Precompressed Sectors")
3182 PreviousRecord                  = uint32("previous_record", "Previous Record")
3183 PrimaryEntry                    = uint32("primary_entry", "Primary Entry")
3184 PrintFlags                      = bitfield8("print_flags", "Print Flags", [
3185         bf_boolean8(0x08, "print_flags_ff", "Suppress Form Feeds"),
3186         bf_boolean8(0x10, "print_flags_cr", "Create"),
3187         bf_boolean8(0x20, "print_flags_del_spool", "Delete Spool File after Printing"),
3188         bf_boolean8(0x40, "print_flags_exp_tabs", "Expand Tabs in the File"),
3189         bf_boolean8(0x80, "print_flags_banner", "Print Banner Page"),
3190 ])
3191 PrinterHalted                   = val_string8("printer_halted", "Printer Halted", [
3192         [ 0x00, "Printer is not Halted" ],
3193         [ 0xff, "Printer is Halted" ],
3194 ])
3195 PrinterOffLine                  = val_string8( "printer_offline", "Printer Off-Line", [
3196         [ 0x00, "Printer is On-Line" ],
3197         [ 0xff, "Printer is Off-Line" ],
3198 ])
3199 PrintServerVersion              = uint8("print_server_version", "Print Server Version")
3200 Priority                        = uint32("priority", "Priority")
3201 Privileges                      = uint32("privileges", "Login Privileges")
3202 ProcessorType                   = val_string8("processor_type", "Processor Type", [
3203         [ 0x00, "Motorola 68000" ],
3204         [ 0x01, "Intel 8088 or 8086" ],
3205         [ 0x02, "Intel 80286" ],
3206 ])
3207 ProDOSInfo                      = bytes("pro_dos_info", "Pro DOS Info", 6)
3208 ProductMajorVersion             = uint16("product_major_version", "Product Major Version")
3209 ProductMinorVersion             = uint16("product_minor_version", "Product Minor Version")
3210 ProductRevisionVersion          = uint8("product_revision_version", "Product Revision Version")
3211 projectedCompSize               = uint32("projected_comp_size", "Projected Compression Size")
3212 PropertyHasMoreSegments         = val_string8("property_has_more_segments",
3213         "Property Has More Segments", [
3214         [ 0x00, "Is last segment" ],
3215         [ 0xff, "More segments are available" ],
3216 ])
3217 PropertyName                    = nstring8("property_name", "Property Name")
3218 PropertyName16                  = fw_string("property_name_16", "Property Name", 16)
3219 PropertyData                    = bytes("property_data", "Property Data", 128)
3220 PropertySegment                 = uint8("property_segment", "Property Segment")
3221 PropertyType                    = val_string8("property_type", "Property Type", [
3222         [ 0x00, "Display Static property" ],
3223         [ 0x01, "Display Dynamic property" ],
3224         [ 0x02, "Set Static property" ],
3225         [ 0x03, "Set Dynamic property" ],
3226 ])
3227 PropertyValue                   = fw_string("property_value", "Property Value", 128)
3228 ProposedMaxSize                 = uint16("proposed_max_size", "Proposed Max Size")
3229 protocolFlags                   = uint32("protocol_flags", "Protocol Flags")
3230 protocolFlags.Display("BASE_HEX")
3231 PurgeableBlocks                 = uint32("purgeable_blocks", "Purgeable Blocks")
3232 PurgeCcode                      = uint32("purge_c_code", "Purge Completion Code")
3233 PurgeCount                      = uint32("purge_count", "Purge Count")
3234 PurgeFlags                      = val_string16("purge_flags", "Purge Flags", [
3235         [ 0x0000, "Do not Purge All" ],
3236         [ 0x0001, "Purge All" ],
3237         [ 0xffff, "Do not Purge All" ],
3238 ])
3239 PurgeList                       = uint32("purge_list", "Purge List")
3240 PhysicalDiskChannel             = uint8("physical_disk_channel", "Physical Disk Channel")
3241 PhysicalDriveType               = val_string8("physical_drive_type", "Physical Drive Type", [
3242         [ 0x01, "XT" ],
3243         [ 0x02, "AT" ],
3244         [ 0x03, "SCSI" ],
3245         [ 0x04, "Disk Coprocessor" ],
3246         [ 0x05, "PS/2 with MFM Controller" ],
3247         [ 0x06, "PS/2 with ESDI Controller" ],
3248         [ 0x07, "Convergent Technology SBIC" ],
3249 ])      
3250 PhysicalReadErrors              = uint16("physical_read_errors", "Physical Read Errors")
3251 PhysicalReadRequests            = uint32("physical_read_requests", "Physical Read Requests")
3252 PhysicalWriteErrors             = uint16("physical_write_errors", "Physical Write Errors")
3253 PhysicalWriteRequests           = uint32("physical_write_requests", "Physical Write Requests")
3254 PrintToFileFlag                 = boolean8("print_to_file_flag", "Print to File Flag")
3255
3256 QueueID                         = uint32("queue_id", "Queue ID")
3257 QueueID.Display("BASE_HEX")
3258 QueueName                       = nstring8("queue_name", "Queue Name")
3259 QueueStartPosition              = uint32("queue_start_position", "Queue Start Position")
3260 QueueStatus                     = bitfield8("queue_status", "Queue Status", [
3261         bf_boolean8(0x01, "queue_status_new_jobs", "Operator does not want to add jobs to the queue"),
3262         bf_boolean8(0x02, "queue_status_pserver", "Operator does not want additional servers attaching"),
3263         bf_boolean8(0x04, "queue_status_svc_jobs", "Operator does not want servers to service jobs"),
3264 ])
3265 QueueType                       = uint16("queue_type", "Queue Type")
3266 QueueingVersion                 = uint8("qms_version", "QMS Version")
3267
3268 ReadBeyondWrite                 = uint16("read_beyond_write", "Read Beyond Write")
3269 RecordLockCount                 = uint16("rec_lock_count", "Record Lock Count")
3270 RecordStart                     = uint32("record_start", "Record Start")
3271 RecordEnd                       = uint32("record_end", "Record End")
3272 RecordInUseFlag                 = val_string16("record_in_use", "Record in Use", [
3273         [ 0x0000, "Record In Use" ],
3274         [ 0xffff, "Record Not In Use" ],
3275 ])      
3276 RedirectedPrinter               = uint8( "redirected_printer", "Redirected Printer" )
3277 ReferenceCount                  = uint32("reference_count", "Reference Count")
3278 RelationsCount                  = uint16("relations_count", "Relations Count")
3279 ReMirrorCurrentOffset           = uint32("re_mirror_current_offset", "ReMirror Current Offset")
3280 ReMirrorDriveNumber             = uint8("re_mirror_drive_number", "ReMirror Drive Number")
3281 RemoteMaxPacketSize             = uint32("remote_max_packet_size", "Remote Max Packet Size")
3282 RemoteTargetID                  = uint32("remote_target_id", "Remote Target ID")
3283 RemoteTargetID.Display("BASE_HEX")
3284 RemovableFlag                   = uint16("removable_flag", "Removable Flag")
3285 RemoveOpenRights                = bitfield8("remove_open_rights", "Remove Open Rights", [
3286         bf_boolean8(0x01, "remove_open_rights_ro", "Read Only"),
3287         bf_boolean8(0x02, "remove_open_rights_wo", "Write Only"),
3288         bf_boolean8(0x04, "remove_open_rights_dr", "Deny Read"),
3289         bf_boolean8(0x08, "remove_open_rights_dw", "Deny Write"),
3290         bf_boolean8(0x10, "remove_open_rights_comp", "Compatibility"),
3291         bf_boolean8(0x40, "remove_open_rights_write_thru", "Write Through"),
3292 ])
3293 RenameFlag                      = bitfield8("rename_flag", "Rename Flag", [
3294         bf_boolean8(0x01, "rename_flag_ren", "Rename to Myself allows file to be renamed to it's original name"),
3295         bf_boolean8(0x02, "rename_flag_comp", "Compatability allows files that are marked read only to be opened with read/write access"),
3296         bf_boolean8(0x04, "rename_flag_no", "Name Only renames only the specified name space entry name"),
3297 ])
3298 RepliesCancelled                = uint16("replies_cancelled", "Replies Cancelled")
3299 ReplyBuffer                     = nstring8("reply_buffer", "Reply Buffer")
3300 ReplyBufferSize                 = uint32("reply_buffer_size", "Reply Buffer Size")
3301 ReplyQueueJobNumbers            = uint32("reply_queue_job_numbers", "Reply Queue Job Numbers")
3302 RequestBitMap                   = bitfield16("request_bit_map", "Request Bit Map", [
3303         bf_boolean16(0x0001, "request_bit_map_ret_afp_ent", "AFP Entry ID"),
3304         bf_boolean16(0x0002, "request_bit_map_ret_data_fork", "Data Fork Length"),
3305         bf_boolean16(0x0004, "request_bit_map_ret_res_fork", "Resource Fork Length"),
3306         bf_boolean16(0x0008, "request_bit_map_ret_num_off", "Number of Offspring"),
3307         bf_boolean16(0x0010, "request_bit_map_ret_owner", "Owner ID"),
3308         bf_boolean16(0x0020, "request_bit_map_ret_short", "Short Name"),
3309         bf_boolean16(0x0040, "request_bit_map_ret_acc_priv", "Access Privileges"),
3310         bf_boolean16(0x0100, "request_bit_map_ratt", "Return Attributes"),
3311         bf_boolean16(0x0200, "request_bit_map_ret_afp_parent", "AFP Parent Entry ID"),
3312         bf_boolean16(0x0400, "request_bit_map_ret_cr_date", "Creation Date"),
3313         bf_boolean16(0x0800, "request_bit_map_ret_acc_date", "Access Date"),
3314         bf_boolean16(0x1000, "request_bit_map_ret_mod_date", "Modify Date&Time"),
3315         bf_boolean16(0x2000, "request_bit_map_ret_bak_date", "Backup Date&Time"),
3316         bf_boolean16(0x4000, "request_bit_map_ret_finder", "Finder Info"),
3317         bf_boolean16(0x8000, "request_bit_map_ret_long_nm", "Long Name"),
3318 ])              
3319 ResourceForkLen                 = uint32("resource_fork_len", "Resource Fork Len")
3320 RequestCode                     = val_string8("request_code", "Request Code", [
3321         [ 0x00, "Change Logged in to Temporary Authenticated" ],
3322         [ 0x01, "Change Temporary Authenticated to Logged in" ],
3323 ])
3324 RequestData                     = nstring8("request_data", "Request Data")
3325 RequestsReprocessed             = uint16("requests_reprocessed", "Requests Reprocessed")
3326 Reserved                        = uint8( "reserved", "Reserved" )
3327 Reserved2                       = bytes("reserved2", "Reserved", 2)
3328 Reserved3                       = bytes("reserved3", "Reserved", 3)
3329 Reserved4                       = bytes("reserved4", "Reserved", 4)
3330 Reserved6                       = bytes("reserved6", "Reserved", 6)
3331 Reserved8                       = bytes("reserved8", "Reserved", 8)
3332 Reserved10                      = bytes("reserved10", "Reserved", 10)
3333 Reserved12                      = bytes("reserved12", "Reserved", 12)
3334 Reserved16                      = bytes("reserved16", "Reserved", 16)
3335 Reserved20                      = bytes("reserved20", "Reserved", 20)
3336 Reserved28                      = bytes("reserved28", "Reserved", 28)
3337 Reserved36                      = bytes("reserved36", "Reserved", 36)
3338 Reserved44                      = bytes("reserved44", "Reserved", 44)
3339 Reserved48                      = bytes("reserved48", "Reserved", 48)
3340 Reserved51                      = bytes("reserved51", "Reserved", 51)
3341 Reserved56                      = bytes("reserved56", "Reserved", 56)
3342 Reserved64                      = bytes("reserved64", "Reserved", 64)
3343 Reserved120                     = bytes("reserved120", "Reserved", 120)                                  
3344 ReservedOrDirectoryNumber       = uint32("reserved_or_directory_number", "Reserved or Directory Number (see EAFlags)")
3345 ResourceCount                   = uint32("resource_count", "Resource Count")
3346 ResourceForkSize                = uint32("resource_fork_size", "Resource Fork Size")
3347 ResourceName                    = stringz("resource_name", "Resource Name")
3348 ResourceSignature               = fw_string("resource_sig", "Resource Signature", 4)
3349 RestoreTime                     = uint32("restore_time", "Restore Time")
3350 Restriction                     = uint32("restriction", "Disk Space Restriction")
3351 RestrictionsEnforced            = val_string8("restrictions_enforced", "Disk Restrictions Enforce Flag", [
3352         [ 0x00, "Enforced" ],
3353         [ 0xff, "Not Enforced" ],
3354 ])
3355 ReturnInfoCount                 = uint32("return_info_count", "Return Information Count")
3356 ReturnInfoMask                  = bitfield16("ret_info_mask", "Return Information", [
3357         bf_boolean16(0x0001, "ret_info_mask_fname", "Return File Name Information"),
3358         bf_boolean16(0x0002, "ret_info_mask_alloc", "Return Allocation Space Information"),
3359         bf_boolean16(0x0004, "ret_info_mask_attr", "Return Attribute Information"),
3360         bf_boolean16(0x0008, "ret_info_mask_size", "Return Size Information"),
3361         bf_boolean16(0x0010, "ret_info_mask_tspace", "Return Total Space Information"),
3362         bf_boolean16(0x0020, "ret_info_mask_eattr", "Return Extended Attributes Information"),
3363         bf_boolean16(0x0040, "ret_info_mask_arch", "Return Archive Information"),
3364         bf_boolean16(0x0080, "ret_info_mask_mod", "Return Modify Information"),
3365         bf_boolean16(0x0100, "ret_info_mask_create", "Return Creation Information"),
3366         bf_boolean16(0x0200, "ret_info_mask_ns", "Return Name Space Information"),
3367         bf_boolean16(0x0400, "ret_info_mask_dir", "Return Directory Information"),
3368         bf_boolean16(0x0800, "ret_info_mask_rights", "Return Rights Information"),
3369         bf_boolean16(0x1000, "ret_info_mask_id", "Return ID Information"),
3370         bf_boolean16(0x2000, "ret_info_mask_ns_attr", "Return Name Space Attributes Information"),
3371         bf_boolean16(0x4000, "ret_info_mask_actual", "Return Actual Information"),
3372         bf_boolean16(0x8000, "ret_info_mask_logical", "Return Logical Information"),
3373 ])
3374 ReturnedListCount               = uint32("returned_list_count", "Returned List Count")
3375 Revision                        = uint32("revision", "Revision")
3376 RevisionNumber                  = uint8("revision_number", "Revision")
3377 RevQueryFlag                    = val_string8("rev_query_flag", "Revoke Rights Query Flag", [
3378         [ 0x00, "Do not query the locks engine for access rights" ],
3379         [ 0x01, "Query the locks engine and return the access rights" ],
3380 ])
3381 RightsGrantMask                 = bitfield8("rights_grant_mask", "Grant Rights", [
3382         bf_boolean8(0x01, "rights_grant_mask_read", "Read"),
3383         bf_boolean8(0x02, "rights_grant_mask_write", "Write"),
3384         bf_boolean8(0x04, "rights_grant_mask_open", "Open"),
3385         bf_boolean8(0x08, "rights_grant_mask_create", "Create"),
3386         bf_boolean8(0x10, "rights_grant_mask_del", "Delete"),
3387         bf_boolean8(0x20, "rights_grant_mask_parent", "Parental"),
3388         bf_boolean8(0x40, "rights_grant_mask_search", "Search"),
3389         bf_boolean8(0x80, "rights_grant_mask_mod", "Modify"),
3390 ])
3391 RightsRevokeMask                = bitfield8("rights_revoke_mask", "Revoke Rights", [
3392         bf_boolean8(0x01, "rights_revoke_mask_read", "Read"),
3393         bf_boolean8(0x02, "rights_revoke_mask_write", "Write"),
3394         bf_boolean8(0x04, "rights_revoke_mask_open", "Open"),
3395         bf_boolean8(0x08, "rights_revoke_mask_create", "Create"),
3396         bf_boolean8(0x10, "rights_revoke_mask_del", "Delete"),
3397         bf_boolean8(0x20, "rights_revoke_mask_parent", "Parental"),
3398         bf_boolean8(0x40, "rights_revoke_mask_search", "Search"),
3399         bf_boolean8(0x80, "rights_revoke_mask_mod", "Modify"),
3400 ])
3401 RIPSocketNumber                 = uint16("rip_socket_num", "RIP Socket Number")
3402 RIPSocketNumber.Display("BASE_HEX")
3403 RouterDownFlag                  = boolean8("router_dn_flag", "Router Down Flag")
3404 RPCccode                        = val_string16("rpc_c_code", "RPC Completion Code", [
3405         [ 0x0000, "Successful" ],
3406 ])        
3407 RTagNumber                      = uint32("r_tag_num", "Resource Tag Number")
3408 RTagNumber.Display("BASE_HEX")
3409 RpyNearestSrvFlag               = boolean8("rpy_nearest_srv_flag", "Reply to Nearest Server Flag")
3410
3411 SalvageableFileEntryNumber      = uint32("salvageable_file_entry_number", "Salvageable File Entry Number")
3412 SalvageableFileEntryNumber.Display("BASE_HEX")
3413 SAPSocketNumber                 = uint16("sap_socket_number", "SAP Socket Number")
3414 SAPSocketNumber.Display("BASE_HEX")
3415 ScanItems                       = uint32("scan_items", "Number of Items returned from Scan")
3416 SearchAttributes                = bitfield8("sattr", "Search Attributes", [
3417         bf_boolean8(0x01, "sattr_hid", "Hidden"),
3418         bf_boolean8(0x02, "sattr_sys", "System"),
3419         bf_boolean8(0x04, "sattr_sub", "Subdirectory"),
3420 ])      
3421 SearchAttributesLow             = bitfield16("search_att_low", "Search Attributes", [
3422         bf_boolean16(0x0001, "search_att_read_only", "Read Only"),
3423         bf_boolean16(0x0002, "search_att_hidden", "Hidden"),
3424         bf_boolean16(0x0004, "search_att_system", "System"),
3425         bf_boolean16(0x0008, "search_att_execute_only", "Execute Only"),
3426         bf_boolean16(0x0010, "search_att_sub", "Subdirectory"),
3427         bf_boolean16(0x0020, "search_att_archive", "Archive"),
3428         bf_boolean16(0x0040, "search_att_execute_confrim", "Execute Confirm"),
3429         bf_boolean16(0x0080, "search_att_shareable", "Shareable"),
3430         bf_boolean16(0x8000, "search_attr_all_files", "All Files and Directories"),
3431 ])
3432 SearchBitMap                            = bitfield8("search_bit_map", "Search Bit Map", [
3433         bf_boolean8(0x01, "search_bit_map_hidden", "Hidden"),
3434         bf_boolean8(0x02, "search_bit_map_sys", "System"),
3435         bf_boolean8(0x04, "search_bit_map_sub", "Subdirectory"),
3436         bf_boolean8(0x08, "search_bit_map_files", "Files"),
3437 ])      
3438 SearchConnNumber                        = uint32("search_conn_number", "Search Connection Number")
3439 SearchInstance                          = uint32("search_instance", "Search Instance")
3440 SearchNumber                            = uint32("search_number", "Search Number")
3441 SearchPattern                           = nstring8("search_pattern", "Search Pattern")
3442 SearchSequence                          = bytes("search_sequence", "Search Sequence", 9)
3443 SearchSequenceWord                      = uint16("search_sequence_word", "Search Sequence")
3444 Second                                  = uint8("s_second", "Seconds")
3445 SecondsRelativeToTheYear2000            = uint32("sec_rel_to_y2k", "Seconds Relative to the Year 2000") 
3446 SecretStoreVerb                         = val_string8("ss_verb", "Secret Store Verb",[
3447         [ 0x00, "Query Server" ],
3448         [ 0x01, "Read App Secrets" ],
3449         [ 0x02, "Write App Secrets" ],
3450         [ 0x03, "Add Secret ID" ],
3451         [ 0x04, "Remove Secret ID" ],
3452         [ 0x05, "Remove SecretStore" ],
3453         [ 0x06, "Enumerate Secret IDs" ],
3454         [ 0x07, "Unlock Store" ],
3455         [ 0x08, "Set Master Password" ],
3456         [ 0x09, "Get Service Information" ],
3457 ])        
3458 SecurityEquivalentList                  = fw_string("security_equiv_list", "Security Equivalent List", 128) 
3459 SecurityFlag                            = bitfield8("security_flag", "Security Flag", [
3460         bf_boolean8(0x01, "checksuming", "Checksumming"),
3461         bf_boolean8(0x02, "signature", "Signature"),
3462         bf_boolean8(0x04, "complete_signatures", "Complete Signatures"),
3463         bf_boolean8(0x08, "encryption", "Encryption"),
3464         bf_boolean8(0x80, "large_internet_packets", "Large Internet Packets (LIP) Disabled"),
3465 ])      
3466 SecurityRestrictionVersion              = uint8("security_restriction_version", "Security Restriction Version")
3467 SectorsPerBlock                         = uint8("sectors_per_block", "Sectors Per Block")
3468 SectorsPerCluster                       = uint16("sectors_per_cluster", "Sectors Per Cluster" )
3469 SectorsPerClusterLong                   = uint32("sectors_per_cluster_long", "Sectors Per Cluster" )
3470 SectorsPerTrack                         = uint8("sectors_per_track", "Sectors Per Track")
3471 SectorSize                              = uint32("sector_size", "Sector Size")
3472 SemaphoreHandle                         = uint32("semaphore_handle", "Semaphore Handle")
3473 SemaphoreName                           = nstring8("semaphore_name", "Semaphore Name")
3474 SemaphoreNameLen                        = uint8("semaphore_name_len", "Semaphore Name Len")
3475 SemaphoreOpenCount                      = uint8("semaphore_open_count", "Semaphore Open Count")
3476 SemaphoreShareCount                     = uint8("semaphore_share_count", "Semaphore Share Count")
3477 SemaphoreTimeOut                        = uint16("semaphore_time_out", "Semaphore Time Out")
3478 SemaphoreValue                          = uint16("semaphore_value", "Semaphore Value")
3479 SendStatus                              = val_string8("send_status", "Send Status", [
3480         [ 0x00, "Successful" ],
3481         [ 0x01, "Illegal Station Number" ],
3482         [ 0x02, "Client Not Logged In" ],
3483         [ 0x03, "Client Not Accepting Messages" ],
3484         [ 0x04, "Client Already has a Message" ],
3485         [ 0x96, "No Alloc Space for the Message" ],
3486         [ 0xfd, "Bad Station Number" ],
3487         [ 0xff, "Failure" ],
3488 ])
3489 SequenceByte                    = uint8("sequence_byte", "Sequence")
3490 SequenceNumber                  = uint32("sequence_number", "Sequence Number")
3491 SequenceNumber.Display("BASE_HEX")
3492 ServerAddress                   = bytes("server_address", "Server Address", 12)
3493 ServerAppNumber                 = uint16("server_app_num", "Server App Number")
3494 ServerIDList                    = uint32("server_id_list", "Server ID List")
3495 ServerID                        = uint32("server_id_number", "Server ID", BE )
3496 ServerID.Display("BASE_HEX")
3497 ServerInfoFlags                 = val_string16("server_info_flags", "Server Information Flags", [
3498         [ 0x0000, "This server is not a member of a Cluster" ],
3499         [ 0x0001, "This server is a member of a Cluster" ],
3500 ])
3501 serverListFlags                 = uint32("server_list_flags", "Server List Flags")
3502 ServerName                      = fw_string("server_name", "Server Name", 48)
3503 serverName50                    = fw_string("server_name50", "Server Name", 50)
3504 ServerNameLen                   = nstring8("server_name_len", "Server Name")
3505 ServerNameStringz               = stringz("server_name_stringz", "Server Name")
3506 ServerNetworkAddress            = bytes("server_network_address", "Server Network Address", 10)
3507 ServerNode                      = bytes("server_node", "Server Node", 6)
3508 ServerSerialNumber              = uint32("server_serial_number", "Server Serial Number")
3509 ServerStation                   = uint8("server_station", "Server Station")
3510 ServerStationLong               = uint32("server_station_long", "Server Station")
3511 ServerStationList               = uint8("server_station_list", "Server Station List")
3512 ServerStatusRecord              = fw_string("server_status_record", "Server Status Record", 64)
3513 ServerTaskNumber                = uint8("server_task_number", "Server Task Number")
3514 ServerTaskNumberLong            = uint32("server_task_number_long", "Server Task Number")
3515 ServerType                      = uint16("server_type", "Server Type")
3516 ServerType.Display("BASE_HEX")
3517 ServerUtilization               = uint32("server_utilization", "Server Utilization")
3518 ServerUtilizationPercentage     = uint8("server_utilization_percentage", "Server Utilization Percentage")
3519 ServiceType                     = val_string16("Service_type", "Service Type", [
3520         [ 0x0000,       "Unknown" ],
3521         [ 0x0001,       "User" ],
3522         [ 0x0002,       "User group" ],
3523         [ 0x0003,       "Print queue" ],
3524         [ 0x0004,       "NetWare file server" ],
3525         [ 0x0005,       "Job server" ],
3526         [ 0x0006,       "Gateway" ],
3527         [ 0x0007,       "Print server" ],
3528         [ 0x0008,       "Archive queue" ],
3529         [ 0x0009,       "Archive server" ],
3530         [ 0x000a,       "Job queue" ],
3531         [ 0x000b,       "Administration" ],
3532         [ 0x0021,       "NAS SNA gateway" ],
3533         [ 0x0026,       "Remote bridge server" ],
3534         [ 0x0027,       "TCP/IP gateway" ],
3535 ])
3536 SetCmdCategory                  = val_string8("set_cmd_catagory", "Set Command Catagory", [
3537         [ 0x00, "Communications" ],
3538         [ 0x01, "Memory" ],
3539         [ 0x02, "File Cache" ],
3540         [ 0x03, "Directory Cache" ],
3541         [ 0x04, "File System" ],
3542         [ 0x05, "Locks" ],
3543         [ 0x06, "Transaction Tracking" ],
3544         [ 0x07, "Disk" ],
3545         [ 0x08, "Time" ],
3546         [ 0x09, "NCP" ],
3547         [ 0x0a, "Miscellaneous" ],
3548         [ 0x0b, "Error Handling" ],
3549         [ 0x0c, "Directory Services" ],
3550         [ 0x0d, "MultiProcessor" ],
3551         [ 0x0e, "Service Location Protocol" ],
3552         [ 0x0f, "Licensing Services" ],
3553 ])        
3554 SetCmdFlags                             = bitfield8("set_cmd_flags", "Set Command Flags", [
3555         bf_boolean8(0x01, "cmd_flags_startup_only", "Startup.ncf Only"),
3556         bf_boolean8(0x02, "cmd_flags_hidden", "Hidden"),
3557         bf_boolean8(0x04, "cmd_flags_advanced", "Advanced"),
3558         bf_boolean8(0x08, "cmd_flags_later", "Restart Server Required to Take Effect"),
3559         bf_boolean8(0x80, "cmd_flags_secure", "Console Secured"),
3560 ])
3561 SetCmdName                      = stringz("set_cmd_name", "Set Command Name")
3562 SetCmdType                      = val_string8("set_cmd_type", "Set Command Type", [
3563         [ 0x00, "Numeric Value" ],
3564         [ 0x01, "Boolean Value" ],
3565         [ 0x02, "Ticks Value" ],
3566         [ 0x04, "Time Value" ],
3567         [ 0x05, "String Value" ],
3568         [ 0x06, "Trigger Value" ],
3569         [ 0x07, "Numeric Value" ],
3570 ])        
3571 SetCmdValueNum                  = uint32("set_cmd_value_num", "Set Command Value")
3572 SetCmdValueString               = stringz("set_cmd_value_string", "Set Command Value")
3573 SetParmName                     = stringz("set_parm_name", "Set Parameter Name")
3574 SFTErrorTable                   = bytes("sft_error_table", "SFT Error Table", 60)
3575 SFTSupportLevel                 = val_string8("sft_support_level", "SFT Support Level", [
3576         [ 0x01, "Server Offers Hot Disk Error Fixing" ],
3577         [ 0x02, "Server Offers Disk Mirroring and Transaction Tracking" ],
3578         [ 0x03, "Server Offers Physical Server Mirroring" ],
3579 ])
3580 ShareableLockCount              = uint16("shareable_lock_count", "Shareable Lock Count")
3581 SharedMemoryAddresses           = bytes("shared_memory_addresses", "Shared Memory Addresses", 10)
3582 ShortName                       = fw_string("short_name", "Short Name", 12)
3583 ShortStkName                    = fw_string("short_stack_name", "Short Stack Name", 16)
3584 SiblingCount                    = uint32("sibling_count", "Sibling Count")
3585 SMIDs                           = uint32("smids", "Storage Media ID's")
3586 SoftwareDescription             = fw_string("software_description", "Software Description", 65)
3587 SoftwareDriverType              = uint8("software_driver_type", "Software Driver Type")
3588 SoftwareMajorVersionNumber      = uint8("software_major_version_number", "Software Major Version Number")
3589 SoftwareMinorVersionNumber      = uint8("software_minor_version_number", "Software Minor Version Number")
3590 SourceDirHandle                 = uint8("source_dir_handle", "Source Directory Handle")
3591 sourceOriginateTime             = bytes("source_originate_time", "Source Originate Time", 8)
3592 sourceOriginateTime.Display("BASE_HEX")
3593 SourcePath                      = nstring8("source_path", "Source Path")
3594 SourcePathComponentCount        = uint8("source_component_count", "Source Path Component Count")
3595 sourceReturnTime                = bytes("source_return_time", "Source Return Time", 8)
3596 sourceReturnTime.Display("BASE_HEX")
3597 SpaceUsed                       = uint32("space_used", "Space Used")
3598 SpaceMigrated                   = uint32("space_migrated", "Space Migrated")
3599 SrcNameSpace                    = val_string8("src_name_space", "Source Name Space", [
3600         [ 0x00, "DOS Name Space" ],
3601         [ 0x01, "MAC Name Space" ],
3602         [ 0x02, "NFS Name Space" ],
3603         [ 0x04, "Long Name Space" ],
3604 ])
3605 SupModID                        = uint32("sup_mod_id", "Sup Mod ID")
3606 StackCount                      = uint32("stack_count", "Stack Count")
3607 StackFullNameStr                = nstring8("stack_full_name_str", "Stack Full Name")
3608 StackMajorVN                    = uint8("stack_major_vn", "Stack Major Version Number")
3609 StackMinorVN                    = uint8("stack_minor_vn", "Stack Minor Version Number")
3610 StackNumber                     = uint32("stack_number", "Stack Number")
3611 StartConnNumber                 = uint32("start_conn_num", "Starting Connection Number")
3612 StartingBlock                   = uint16("starting_block", "Starting Block")
3613 StartingNumber                  = uint32("starting_number", "Starting Number")
3614 StartingSearchNumber            = uint16("start_search_number", "Start Search Number")
3615 StartNumber                     = uint32("start_number", "Start Number")
3616 startNumberFlag                 = uint16("start_number_flag", "Start Number Flag")
3617 StartVolumeNumber               = uint32("start_volume_number", "Starting Volume Number")
3618 StationList                     = uint32("station_list", "Station List")
3619 StationNumber                   = bytes("station_number", "Station Number", 3)
3620 StatMajorVersion                = uint8("stat_major_version", "Statistics Table Major Version")
3621 StatMinorVersion                = uint8("stat_minor_version", "Statistics Table Minor Version")
3622 Status                          = bitfield16("status", "Status", [
3623         bf_boolean16(0x0001, "user_info_logged_in", "Logged In"),
3624         bf_boolean16(0x0002, "user_info_being_abort", "Being Aborted"),
3625         bf_boolean16(0x0004, "user_info_audited", "Audited"),
3626         bf_boolean16(0x0008, "user_info_need_sec", "Needs Security Change"),
3627         bf_boolean16(0x0010, "user_info_mac_station", "MAC Station"),
3628         bf_boolean16(0x0020, "user_info_temp_authen", "Temporary Authenticated"),
3629         bf_boolean16(0x0040, "user_info_audit_conn", "Audit Connection Recorded"),
3630         bf_boolean16(0x0080, "user_info_dsaudit_conn", "DS Audit Connection Recorded"),
3631         bf_boolean16(0x0100, "user_info_logout", "Logout in Progress"),
3632         bf_boolean16(0x0200, "user_info_int_login", "Internal Login"),
3633         bf_boolean16(0x0400, "user_info_bindery", "Bindery Connection"),
3634 ])
3635 StatusFlagBits                  = bitfield32("status_flag_bits", "Status Flag", [
3636         bf_boolean32(0x00000001, "status_flag_bits_suballoc", "Sub Allocation"),
3637         bf_boolean32(0x00000002, "status_flag_bits_comp", "Compression"),
3638         bf_boolean32(0x00000004, "status_flag_bits_migrate", "Migration"),
3639         bf_boolean32(0x00000008, "status_flag_bits_audit", "Audit"),
3640         bf_boolean32(0x00000010, "status_flag_bits_ro", "Read Only"),
3641         bf_boolean32(0x00000020, "status_flag_bits_im_purge", "Immediate Purge"),
3642         bf_boolean32(0x80000000, "status_flag_bits_nss", "NSS Volume"),
3643 ])
3644 SubAllocClusters                = uint32("sub_alloc_clusters", "Sub Alloc Clusters")
3645 SubAllocFreeableClusters        = uint32("sub_alloc_freeable_clusters", "Sub Alloc Freeable Clusters")
3646 Subdirectory                    = uint32("sub_directory", "Subdirectory")
3647 Subdirectory.Display("BASE_HEX")
3648 SuggestedFileSize               = uint32("suggested_file_size", "Suggested File Size")
3649 SupportModuleID                 = uint32("support_module_id", "Support Module ID")
3650 SynchName                       = nstring8("synch_name", "Synch Name")
3651 SystemIntervalMarker            = uint32("system_interval_marker", "System Interval Marker")
3652
3653 TabSize                         = uint8( "tab_size", "Tab Size" )
3654 TargetClientList                = uint8("target_client_list", "Target Client List")
3655 TargetConnectionNumber          = uint16("target_connection_number", "Target Connection Number")
3656 TargetDirectoryBase             = uint32("target_directory_base", "Target Directory Base")
3657 TargetDirHandle                 = uint8("target_dir_handle", "Target Directory Handle")
3658 TargetEntryID                   = uint32("target_entry_id", "Target Entry ID")
3659 TargetEntryID.Display("BASE_HEX")
3660 TargetExecutionTime             = bytes("target_execution_time", "Target Execution Time", 6)
3661 TargetFileHandle                = bytes("target_file_handle", "Target File Handle", 6)
3662 TargetFileOffset                = uint32("target_file_offset", "Target File Offset")
3663 TargetMessage                   = nstring8("target_message", "Message")
3664 TargetPrinter                   = uint8( "target_ptr", "Target Printer" )
3665 targetReceiveTime               = bytes("target_receive_time", "Target Receive Time", 8)
3666 targetReceiveTime.Display("BASE_HEX")
3667 TargetServerIDNumber            = uint32("target_server_id_number", "Target Server ID Number", BE )
3668 TargetServerIDNumber.Display("BASE_HEX")
3669 targetTransmitTime              = bytes("target_transmit_time", "Target Transmit Time", 8)
3670 targetTransmitTime.Display("BASE_HEX")
3671 TaskNumByte                     = uint8("task_num_byte", "Task Number")
3672 TaskNumber                      = uint32("task_number", "Task Number")
3673 TaskNumberWord                  = uint16("task_number_word", "Task Number")
3674 TextJobDescription              = fw_string("text_job_description", "Text Job Description", 50)
3675 ThrashingCount                  = uint16("thrashing_count", "Thrashing Count")
3676 TimeoutLimit                    = uint16("timeout_limit", "Timeout Limit")
3677 TimesyncStatus                  = bitfield32("timesync_status_flags", "Timesync Status", [
3678         bf_boolean32(0x00000001, "timesync_status_sync", "Time is Synchronized"),
3679         bf_boolean32(0x00000002, "timesync_status_net_sync", "Time is Synchronized to the Network"), 
3680         bf_boolean32(0x00000004, "timesync_status_active", "Time Synchronization is Active"),
3681         bf_boolean32(0x00000008, "timesync_status_external", "External Time Synchronization Active"),
3682         bf_val_str32(0x00000700, "timesync_status_server_type", "Time Server Type", [
3683                 [ 0x01, "Client Time Server" ],
3684                 [ 0x02, "Secondary Time Server" ],
3685                 [ 0x03, "Primary Time Server" ],
3686                 [ 0x04, "Reference Time Server" ],
3687                 [ 0x05, "Single Reference Time Server" ],
3688         ]),
3689         bf_boolean32(0x000f0000, "timesync_status_ext_sync", "External Clock Status"),
3690 ])        
3691 TimeToNet                       = uint16("time_to_net", "Time To Net")
3692 TotalBlocks                     = uint32("total_blocks", "Total Blocks")        
3693 TotalBlocksToDecompress         = uint32("total_blks_to_dcompress", "Total Blocks To Decompress")
3694 TotalBytesRead                  = bytes("user_info_ttl_bytes_rd", "Total Bytes Read", 6)
3695 TotalBytesWritten               = bytes("user_info_ttl_bytes_wrt", "Total Bytes Written", 6)
3696 TotalCacheWrites                = uint32("total_cache_writes", "Total Cache Writes")
3697 TotalChangedFATs                = uint32("total_changed_fats", "Total Changed FAT Entries")
3698 TotalCommonCnts                 = uint32("total_common_cnts", "Total Common Counts")
3699 TotalCntBlocks                  = uint32("total_cnt_blocks", "Total Count Blocks")
3700 TotalDataStreamDiskSpaceAlloc   = uint32("total_stream_size_struct_space_alloc", "Total Data Stream Disk Space Alloc")
3701 TotalDirectorySlots             = uint16("total_directory_slots", "Total Directory Slots")
3702 TotalDirectoryEntries           = uint32("total_dir_entries", "Total Directory Entries")
3703 TotalDynamicSpace               = uint32("total_dynamic_space", "Total Dynamic Space")
3704 TotalExtendedDirectoryExtants   = uint32("total_extended_directory_extants", "Total Extended Directory Extants")
3705 TotalFileServicePackets         = uint32("total_file_service_packets", "Total File Service Packets")
3706 TotalFilesOpened                = uint32("total_files_opened", "Total Files Opened")
3707 TotalLFSCounters                = uint32("total_lfs_counters", "Total LFS Counters")
3708 TotalOffspring                  = uint16("total_offspring", "Total Offspring")
3709 TotalOtherPackets               = uint32("total_other_packets", "Total Other Packets")
3710 TotalQueueJobs                  = uint32("total_queue_jobs", "Total Queue Jobs")
3711 TotalReadRequests               = uint32("total_read_requests", "Total Read Requests")
3712 TotalRequest                    = uint32("total_request", "Total Requests")
3713 TotalRequestPackets             = uint32("total_request_packets", "Total Request Packets")
3714 TotalRoutedPackets              = uint32("total_routed_packets", "Total Routed Packets")
3715 TotalRxPkts                     = uint32("total_rx_pkts", "Total Receive Packets")
3716 TotalServerMemory               = uint16("total_server_memory", "Total Server Memory", BE)
3717 TotalTransactionsBackedOut      = uint32("total_trans_backed_out", "Total Transactions Backed Out")
3718 TotalTransactionsPerformed      = uint32("total_trans_performed", "Total Transactions Performed")
3719 TotalTxPkts                     = uint32("total_tx_pkts", "Total Transmit Packets")
3720 TotalUnfilledBackoutRequests    = uint16("total_unfilled_backout_requests", "Total Unfilled Backout Requests")
3721 TotalVolumeClusters             = uint16("total_volume_clusters", "Total Volume Clusters")
3722 TotalWriteRequests              = uint32("total_write_requests", "Total Write Requests")
3723 TotalWriteTransactionsPerformed = uint32("total_write_trans_performed", "Total Write Transactions Performed")
3724 TrackOnFlag                     = boolean8("track_on_flag", "Track On Flag")
3725 TransactionDiskSpace            = uint16("transaction_disk_space", "Transaction Disk Space")
3726 TransactionFATAllocations       = uint32("transaction_fat_allocations", "Transaction FAT Allocations")
3727 TransactionFileSizeChanges      = uint32("transaction_file_size_changes", "Transaction File Size Changes")
3728 TransactionFilesTruncated       = uint32("transaction_files_truncated", "Transaction Files Truncated")
3729 TransactionNumber               = uint32("transaction_number", "Transaction Number")
3730 TransactionTrackingEnabled      = uint8("transaction_tracking_enabled", "Transaction Tracking Enabled")
3731 TransactionTrackingFlag         = uint16("tts_flag", "Transaction Tracking Flag")
3732 TransactionTrackingSupported    = uint8("transaction_tracking_supported", "Transaction Tracking Supported")
3733 TransactionVolumeNumber         = uint16("transaction_volume_number", "Transaction Volume Number")
3734 TransportType                   = val_string8("transport_type", "Communications Type", [
3735         [ 0x01, "Internet Packet Exchange (IPX)" ],
3736         [ 0x05, "User Datagram Protocol (UDP)" ],
3737         [ 0x06, "Transmission Control Protocol (TCP)" ],
3738 ])
3739 TreeLength                      = uint32("tree_length", "Tree Length")
3740 TreeName                        = fw_string("tree_name", "Tree Name", 48)
3741 TrusteeRights                   = bitfield16("trustee_rights_low", "Trustee Rights", [
3742         bf_boolean16(0x0001, "trustee_rights_read", "Read"),
3743         bf_boolean16(0x0002, "trustee_rights_write", "Write"),
3744         bf_boolean16(0x0004, "trustee_rights_open", "Open"),
3745         bf_boolean16(0x0008, "trustee_rights_create", "Create"),
3746         bf_boolean16(0x0010, "trustee_rights_del", "Delete"),
3747         bf_boolean16(0x0020, "trustee_rights_parent", "Parental"),
3748         bf_boolean16(0x0040, "trustee_rights_search", "Search"),
3749         bf_boolean16(0x0080, "trustee_rights_modify", "Modify"),
3750         bf_boolean16(0x0100, "trustee_rights_super", "Supervisor"),
3751 ])
3752 TTSLevel                        = uint8("tts_level", "TTS Level")
3753 TrusteeSetNumber                = uint8("trustee_set_number", "Trustee Set Number")
3754 TrusteeID                       = uint32("trustee_id_set", "Trustee ID")
3755 TrusteeID.Display("BASE_HEX")
3756 ttlCompBlks                     = uint32("ttl_comp_blks", "Total Compression Blocks")
3757 TtlDSDskSpaceAlloc              = uint32("ttl_ds_disk_space_alloc", "Total Streams Space Allocated")
3758 TtlEAs                          = uint32("ttl_eas", "Total EA's")
3759 TtlEAsDataSize                  = uint32("ttl_eas_data_size", "Total EA's Data Size")
3760 TtlEAsKeySize                   = uint32("ttl_eas_key_size", "Total EA's Key Size")
3761 ttlIntermediateBlks             = uint32("ttl_inter_blks", "Total Intermediate Blocks")
3762 TtlMigratedSize                 = uint32("ttl_migrated_size", "Total Migrated Size")
3763 TtlNumOfRTags                   = uint32("ttl_num_of_r_tags", "Total Number of Resource Tags")
3764 TtlNumOfSetCmds                 = uint32("ttl_num_of_set_cmds", "Total Number of Set Commands")
3765 TtlValuesLength                 = uint32("ttl_values_length", "Total Values Length")
3766 TtlWriteDataSize                = uint32("ttl_write_data_size", "Total Write Data Size")
3767 TurboUsedForFileService         = uint16("turbo_used_for_file_service", "Turbo Used For File Service")
3768
3769 UnclaimedPkts                   = uint32("un_claimed_packets", "Unclaimed Packets")
3770 UnCompressableDataStreamsCount  = uint32("un_compressable_data_streams_count", "Uncompressable Data Streams Count")
3771 Undefined8                      = bytes("undefined_8", "Undefined", 8)
3772 Undefined28                     = bytes("undefined_28", "Undefined", 28)
3773 UndefinedWord                   = uint16("undefined_word", "Undefined")
3774 UniqueID                        = uint8("unique_id", "Unique ID")
3775 UnknownByte                     = uint8("unknown_byte", "Unknown Byte")
3776 Unused                          = uint8("un_used", "Unused")
3777 UnusedBlocks                    = uint32("unused_blocks", "Unused Blocks")
3778 UnUsedDirectoryEntries          = uint32("un_used_directory_entries", "Unused Directory Entries")
3779 UnusedDiskBlocks                = uint32("unused_disk_blocks", "Unused Disk Blocks")
3780 UnUsedExtendedDirectoryExtants  = uint32("un_used_extended_directory_extants", "Unused Extended Directory Extants")
3781 UpdateDate                      = uint16("update_date", "Update Date")
3782 UpdateDate.NWDate()
3783 UpdateID                        = uint32("update_id", "Update ID")
3784 UpdateID.Display("BASE_HEX")
3785 UpdateTime                      = uint16("update_time", "Update Time")
3786 UpdateTime.NWTime()
3787 UseCount                        = val_string16("user_info_use_count", "Use Count", [
3788         [ 0x0000, "Connection is not in use" ],
3789         [ 0x0001, "Connection is in use" ],
3790 ])
3791 UsedBlocks                      = uint32("used_blocks", "Used Blocks")
3792 UserID                          = uint32("user_id", "User ID", BE)
3793 UserID.Display("BASE_HEX")
3794 UserLoginAllowed                = val_string8("user_login_allowed", "Login Status", [
3795         [ 0x00, "Client Login Disabled" ],
3796         [ 0x01, "Client Login Enabled" ],
3797 ])
3798
3799 UserName                        = nstring8("user_name", "User Name")
3800 UserName16                      = fw_string("user_name_16", "User Name", 16)
3801 UserName48                      = fw_string("user_name_48", "User Name", 48)
3802 UserType                        = uint16("user_type", "User Type")
3803 UTCTimeInSeconds                = uint32("uts_time_in_seconds", "UTC Time in Seconds")
3804
3805 ValueAvailable                  = val_string8("value_available", "Value Available", [
3806         [ 0x00, "Has No Value" ],
3807         [ 0xff, "Has Value" ],
3808 ])
3809 VAPVersion                      = uint8("vap_version", "VAP Version")
3810 VariableBitMask                 = uint32("variable_bit_mask", "Variable Bit Mask")
3811 VariableBitsDefined             = uint16("variable_bits_defined", "Variable Bits Defined")
3812 VConsoleRevision                = uint8("vconsole_rev", "Console Revision")
3813 VConsoleVersion                 = uint8("vconsole_ver", "Console Version")
3814 Verb                            = uint32("verb", "Verb")
3815 VerbData                        = uint8("verb_data", "Verb Data")
3816 version                         = uint32("version", "Version")
3817 VersionNumber                   = uint8("version_number", "Version")
3818 VertLocation                    = uint16("vert_location", "Vertical Location")
3819 VirtualConsoleVersion           = uint8("virtual_console_version", "Virtual Console Version")
3820 VolumeID                        = uint32("volume_id", "Volume ID")
3821 VolumeID.Display("BASE_HEX")
3822 VolInfoReplyLen                 = uint16("vol_info_reply_len", "Volume Information Reply Length")
3823 VolumeCachedFlag                = val_string8("volume_cached_flag", "Volume Cached Flag", [
3824         [ 0x00, "Volume is Not Cached" ],
3825         [ 0xff, "Volume is Cached" ],
3826 ])      
3827 VolumeHashedFlag                = val_string8("volume_hashed_flag", "Volume Hashed Flag", [
3828         [ 0x00, "Volume is Not Hashed" ],
3829         [ 0xff, "Volume is Hashed" ],
3830 ])      
3831 VolumeLastModifiedDate          = uint16("volume_last_modified_date", "Volume Last Modified Date")
3832 VolumeLastModifiedDate.NWDate()
3833 VolumeLastModifiedTime          = uint16("volume_last_modified_time", "Volume Last Modified Time") 
3834 VolumeLastModifiedTime.NWTime()
3835 VolumeMountedFlag               = val_string8("volume_mounted_flag", "Volume Mounted Flag", [
3836         [ 0x00, "Volume is Not Mounted" ],
3837         [ 0xff, "Volume is Mounted" ],
3838 ])
3839 VolumeName                      = fw_string("volume_name", "Volume Name", 16)
3840 VolumeNameLen                   = nstring8("volume_name_len", "Volume Name")
3841 VolumeNameStringz               = stringz("volume_name_stringz", "Volume Name")
3842 VolumeNumber                    = uint8("volume_number", "Volume Number")
3843 VolumeNumberLong                = uint32("volume_number_long", "Volume Number")
3844 VolumeRemovableFlag             = val_string8("volume_removable_flag", "Volume Removable Flag", [
3845         [ 0x00, "Disk Cannot be Removed from Server" ],
3846         [ 0xff, "Disk Can be Removed from Server" ],
3847 ])
3848 VolumeRequestFlags              = val_string16("volume_request_flags", "Volume Request Flags", [
3849         [ 0x0000, "Return name with volume number" ],
3850         [ 0x0001, "Do not return name with volume number" ],
3851 ])
3852 VolumeSizeInClusters            = uint32("volume_size_in_clusters", "Volume Size in Clusters")
3853 VolumesSupportedMax             = uint16("volumes_supported_max", "Volumes Supported Max")
3854 VolumeType                      = val_string16("volume_type", "Volume Type", [
3855         [ 0x0000, "NetWare 386" ],
3856         [ 0x0001, "NetWare 286" ],
3857         [ 0x0002, "NetWare 386 Version 30" ],
3858         [ 0x0003, "NetWare 386 Version 31" ],
3859 ])
3860 WastedServerMemory              = uint16("wasted_server_memory", "Wasted Server Memory", BE)
3861 WaitTime                        = uint32("wait_time", "Wait Time")
3862
3863 Year                            = val_string8("year", "Year",[
3864         [ 0x50, "1980" ],
3865         [ 0x51, "1981" ],
3866         [ 0x52, "1982" ],
3867         [ 0x53, "1983" ],
3868         [ 0x54, "1984" ],
3869         [ 0x55, "1985" ],
3870         [ 0x56, "1986" ],
3871         [ 0x57, "1987" ],
3872         [ 0x58, "1988" ],
3873         [ 0x59, "1989" ],
3874         [ 0x5a, "1990" ],
3875         [ 0x5b, "1991" ],
3876         [ 0x5c, "1992" ],
3877         [ 0x5d, "1993" ],
3878         [ 0x5e, "1994" ],
3879         [ 0x5f, "1995" ],
3880         [ 0x60, "1996" ],
3881         [ 0x61, "1997" ],
3882         [ 0x62, "1998" ],
3883         [ 0x63, "1999" ],
3884         [ 0x64, "2000" ],
3885         [ 0x65, "2001" ],
3886         [ 0x66, "2002" ],
3887         [ 0x67, "2003" ],
3888         [ 0x68, "2004" ],
3889         [ 0x69, "2005" ],
3890         [ 0x6a, "2006" ],
3891         [ 0x6b, "2007" ],
3892         [ 0x6c, "2008" ],
3893         [ 0x6d, "2009" ],
3894         [ 0x6e, "2010" ],
3895         [ 0x6f, "2011" ],
3896         [ 0x70, "2012" ],
3897         [ 0x71, "2013" ],
3898         [ 0x72, "2014" ],
3899         [ 0x73, "2015" ],
3900         [ 0x74, "2016" ],
3901         [ 0x75, "2017" ],
3902         [ 0x76, "2018" ],
3903         [ 0x77, "2019" ],
3904         [ 0x78, "2020" ],
3905         [ 0x79, "2021" ],
3906         [ 0x7a, "2022" ],
3907         [ 0x7b, "2023" ],
3908         [ 0x7c, "2024" ],
3909         [ 0x7d, "2025" ],
3910         [ 0x7e, "2026" ],
3911         [ 0x7f, "2027" ],
3912         [ 0xc0, "1984" ],
3913         [ 0xc1, "1985" ],
3914         [ 0xc2, "1986" ],
3915         [ 0xc3, "1987" ],
3916         [ 0xc4, "1988" ],
3917         [ 0xc5, "1989" ],
3918         [ 0xc6, "1990" ],
3919         [ 0xc7, "1991" ],
3920         [ 0xc8, "1992" ],
3921         [ 0xc9, "1993" ],
3922         [ 0xca, "1994" ],
3923         [ 0xcb, "1995" ],
3924         [ 0xcc, "1996" ],
3925         [ 0xcd, "1997" ],
3926         [ 0xce, "1998" ],
3927         [ 0xcf, "1999" ],
3928         [ 0xd0, "2000" ],
3929         [ 0xd1, "2001" ],
3930         [ 0xd2, "2002" ],
3931         [ 0xd3, "2003" ],
3932         [ 0xd4, "2004" ],
3933         [ 0xd5, "2005" ],
3934         [ 0xd6, "2006" ],
3935         [ 0xd7, "2007" ],
3936         [ 0xd8, "2008" ],
3937         [ 0xd9, "2009" ],
3938         [ 0xda, "2010" ],
3939         [ 0xdb, "2011" ],
3940         [ 0xdc, "2012" ],
3941         [ 0xdd, "2013" ],
3942         [ 0xde, "2014" ],
3943         [ 0xdf, "2015" ],
3944 ])
3945 ##############################################################################
3946 # Structs
3947 ##############################################################################
3948                 
3949                 
3950 acctngInfo                      = struct("acctng_info_struct", [
3951         HoldTime,
3952         HoldAmount,
3953         ChargeAmount,
3954         HeldConnectTimeInMinutes,
3955         HeldRequests,
3956         HeldBytesRead,
3957         HeldBytesWritten,
3958 ],"Accounting Information")
3959 AFP10Struct                       = struct("afp_10_struct", [
3960         AFPEntryID,
3961         ParentID,
3962         AttributesDef16,
3963         DataForkLen,
3964         ResourceForkLen,
3965         TotalOffspring,
3966         CreationDate,
3967         LastAccessedDate,
3968         ModifiedDate,
3969         ModifiedTime,
3970         ArchivedDate,
3971         ArchivedTime,
3972         CreatorID,
3973         Reserved4,
3974         FinderAttr,
3975         HorizLocation,
3976         VertLocation,
3977         FileDirWindow,
3978         Reserved16,
3979         LongName,
3980         CreatorID,
3981         ShortName,
3982         AccessPrivileges,
3983 ], "AFP Information" )                
3984 AFP20Struct                       = struct("afp_20_struct", [
3985         AFPEntryID,
3986         ParentID,
3987         AttributesDef16,
3988         DataForkLen,
3989         ResourceForkLen,
3990         TotalOffspring,
3991         CreationDate,
3992         LastAccessedDate,
3993         ModifiedDate,
3994         ModifiedTime,
3995         ArchivedDate,
3996         ArchivedTime,
3997         CreatorID,
3998         Reserved4,
3999         FinderAttr,
4000         HorizLocation,
4001         VertLocation,
4002         FileDirWindow,
4003         Reserved16,
4004         LongName,
4005         CreatorID,
4006         ShortName,
4007         AccessPrivileges,
4008         Reserved,
4009         ProDOSInfo,
4010 ], "AFP Information" )                
4011 ArchiveDateStruct               = struct("archive_date_struct", [
4012         ArchivedDate,
4013 ])                
4014 ArchiveIdStruct                 = struct("archive_id_struct", [
4015         ArchiverID,
4016 ])                
4017 ArchiveInfoStruct               = struct("archive_info_struct", [
4018         ArchivedTime,
4019         ArchivedDate,
4020         ArchiverID,
4021 ], "Archive Information")
4022 ArchiveTimeStruct               = struct("archive_time_struct", [
4023         ArchivedTime,
4024 ])                
4025 AttributesStruct                = struct("attributes_struct", [
4026         AttributesDef32,
4027         FlagsDef,
4028 ], "Attributes")
4029 authInfo                        = struct("auth_info_struct", [
4030         Status,
4031         Reserved2,
4032         Privileges,
4033 ])
4034 BoardNameStruct                 = struct("board_name_struct", [
4035         DriverBoardName,
4036         DriverShortName,
4037         DriverLogicalName,
4038 ], "Board Name")        
4039 CacheInfo                       = struct("cache_info", [
4040         uint32("max_byte_cnt", "Maximum Byte Count"),
4041         uint32("min_num_of_cache_buff", "Minimum Number Of Cache Buffers"),
4042         uint32("min_cache_report_thresh", "Minimum Cache Report Threshold"),
4043         uint32("alloc_waiting", "Allocate Waiting Count"),
4044         uint32("ndirty_blocks", "Number of Dirty Blocks"),
4045         uint32("cache_dirty_wait_time", "Cache Dirty Wait Time"),
4046         uint32("cache_max_concur_writes", "Cache Maximum Concurrent Writes"),
4047         uint32("max_dirty_time", "Maximum Dirty Time"),
4048         uint32("num_dir_cache_buff", "Number Of Directory Cache Buffers"),
4049         uint32("cache_byte_to_block", "Cache Byte To Block Shift Factor"),
4050 ], "Cache Information")
4051 CommonLanStruc                  = struct("common_lan_struct", [
4052         boolean8("not_supported_mask", "Bit Counter Supported"),
4053         Reserved3,
4054         uint32("total_tx_packet_count", "Total Transmit Packet Count"),
4055         uint32("total_rx_packet_count", "Total Receive Packet Count"),
4056         uint32("no_ecb_available_count", "No ECB Available Count"),
4057         uint32("packet_tx_too_big_count", "Transmit Packet Too Big Count"),
4058         uint32("packet_tx_too_small_count", "Transmit Packet Too Small Count"),
4059         uint32("packet_rx_overflow_count", "Receive Packet Overflow Count"),
4060         uint32("packet_rx_too_big_count", "Receive Packet Too Big Count"),
4061         uint32("packet_rs_too_small_count", "Receive Packet Too Small Count"),
4062         uint32("packet_tx_misc_error_count", "Transmit Packet Misc Error Count"),
4063         uint32("packet_rx_misc_error_count", "Receive Packet Misc Error Count"),
4064         uint32("retry_tx_count", "Transmit Retry Count"),
4065         uint32("checksum_error_count", "Checksum Error Count"),
4066         uint32("hardware_rx_mismatch_count", "Hardware Receive Mismatch Count"),
4067 ], "Common LAN Information")
4068 CompDeCompStat                  = struct("comp_d_comp_stat", [ 
4069         uint32("cmphitickhigh", "Compress High Tick"),        
4070         uint32("cmphitickcnt", "Compress High Tick Count"),        
4071         uint32("cmpbyteincount", "Compress Byte In Count"),        
4072         uint32("cmpbyteoutcnt", "Compress Byte Out Count"),        
4073         uint32("cmphibyteincnt", "Compress High Byte In Count"),        
4074         uint32("cmphibyteoutcnt", "Compress High Byte Out Count"),        
4075         uint32("decphitickhigh", "DeCompress High Tick"),        
4076         uint32("decphitickcnt", "DeCompress High Tick Count"),        
4077         uint32("decpbyteincount", "DeCompress Byte In Count"),        
4078         uint32("decpbyteoutcnt", "DeCompress Byte Out Count"),        
4079         uint32("decphibyteincnt", "DeCompress High Byte In Count"),        
4080         uint32("decphibyteoutcnt", "DeCompress High Byte Out Count"),
4081 ], "Compression/Decompression Information")                
4082 ConnFileStruct                  = struct("conn_file_struct", [
4083         ConnectionNumberWord,
4084         TaskNumByte,
4085         LockType,
4086         AccessControl,
4087         LockFlag,
4088 ], "File Connection Information")
4089 ConnStruct                      = struct("conn_struct", [
4090         TaskNumByte,
4091         LockType,
4092         AccessControl,
4093         LockFlag,
4094         VolumeNumber,
4095         DirectoryEntryNumberWord,
4096         FileName14,
4097 ], "Connection Information")
4098 ConnTaskStruct                  = struct("conn_task_struct", [
4099         ConnectionNumberByte,
4100         TaskNumByte,
4101 ], "Task Information")
4102 Counters                        = struct("counters_struct", [
4103         uint32("read_exist_blck", "Read Existing Block Count"),
4104         uint32("read_exist_write_wait", "Read Existing Write Wait Count"),
4105         uint32("read_exist_part_read", "Read Existing Partial Read Count"),
4106         uint32("read_exist_read_err", "Read Existing Read Error Count"),
4107         uint32("wrt_blck_cnt", "Write Block Count"),
4108         uint32("wrt_entire_blck", "Write Entire Block Count"),
4109         uint32("internl_dsk_get", "Internal Disk Get Count"),
4110         uint32("internl_dsk_get_need_to_alloc", "Internal Disk Get Need To Allocate Count"),
4111         uint32("internl_dsk_get_someone_beat", "Internal Disk Get Someone Beat My Count"),
4112         uint32("internl_dsk_get_part_read", "Internal Disk Get Partial Read Count"),
4113         uint32("internl_dsk_get_read_err", "Internal Disk Get Read Error Count"),
4114         uint32("async_internl_dsk_get", "Async Internal Disk Get Count"),
4115         uint32("async_internl_dsk_get_need_to_alloc", "Async Internal Disk Get Need To Alloc"),
4116         uint32("async_internl_dsk_get_someone_beat", "Async Internal Disk Get Someone Beat Me"),
4117         uint32("err_doing_async_read", "Error Doing Async Read Count"),
4118         uint32("internl_dsk_get_no_read", "Internal Disk Get No Read Count"),
4119         uint32("internl_dsk_get_no_read_alloc", "Internal Disk Get No Read Allocate Count"),
4120         uint32("internl_dsk_get_no_read_someone_beat", "Internal Disk Get No Read Someone Beat Me Count"),
4121         uint32("internl_dsk_write", "Internal Disk Write Count"),
4122         uint32("internl_dsk_write_alloc", "Internal Disk Write Allocate Count"),
4123         uint32("internl_dsk_write_someone_beat", "Internal Disk Write Someone Beat Me Count"),
4124         uint32("write_err", "Write Error Count"),
4125         uint32("wait_on_sema", "Wait On Semaphore Count"),
4126         uint32("alloc_blck_i_had_to_wait_for", "Allocate Block I Had To Wait For Someone Count"),
4127         uint32("alloc_blck", "Allocate Block Count"),
4128         uint32("alloc_blck_i_had_to_wait", "Allocate Block I Had To Wait Count"),
4129 ], "Disk Counter Information")
4130 CPUInformation                  = struct("cpu_information", [
4131         PageTableOwnerFlag,
4132         CPUType,
4133         Reserved3,
4134         CoprocessorFlag,
4135         BusType,
4136         Reserved3,
4137         IOEngineFlag,
4138         Reserved3,
4139         FSEngineFlag,
4140         Reserved3, 
4141         NonDedFlag,
4142         Reserved3,
4143         CPUString,
4144         CoProcessorString,
4145         BusString,
4146 ], "CPU Information")
4147 CreationDateStruct              = struct("creation_date_struct", [
4148         CreationDate,
4149 ])                
4150 CreationInfoStruct              = struct("creation_info_struct", [
4151         CreationTime,
4152         CreationDate,
4153         CreatorID,
4154 ], "Creation Information")
4155 CreationTimeStruct              = struct("creation_time_struct", [
4156         CreationTime,
4157 ])
4158 CustomCntsInfo                  = struct("custom_cnts_info", [
4159         CustomVariableValue,
4160         CustomString,
4161 ], "Custom Counters" )        
4162 DataStreamSizeStruct            = struct("data_stream_size_struct", [
4163         DataStreamSize,
4164 ])
4165 DirCacheInfo                    = struct("dir_cache_info", [
4166         uint32("min_time_since_file_delete", "Minimum Time Since File Delete"),
4167         uint32("abs_min_time_since_file_delete", "Absolute Minimum Time Since File Delete"),
4168         uint32("min_num_of_dir_cache_buff", "Minimum Number Of Directory Cache Buffers"),
4169         uint32("max_num_of_dir_cache_buff", "Maximum Number Of Directory Cache Buffers"),
4170         uint32("num_of_dir_cache_buff", "Number Of Directory Cache Buffers"),
4171         uint32("dc_min_non_ref_time", "DC Minimum Non-Referenced Time"),
4172         uint32("dc_wait_time_before_new_buff", "DC Wait Time Before New Buffer"),
4173         uint32("dc_max_concurrent_writes", "DC Maximum Concurrent Writes"),
4174         uint32("dc_dirty_wait_time", "DC Dirty Wait Time"),
4175         uint32("dc_double_read_flag", "DC Double Read Flag"),
4176         uint32("map_hash_node_count", "Map Hash Node Count"),
4177         uint32("space_restriction_node_count", "Space Restriction Node Count"),
4178         uint32("trustee_list_node_count", "Trustee List Node Count"),
4179         uint32("percent_of_vol_used_by_dirs", "Percent Of Volume Used By Directories"),
4180 ], "Directory Cache Information")
4181 DirEntryStruct                  = struct("dir_entry_struct", [
4182         DirectoryEntryNumber,
4183         DOSDirectoryEntryNumber,
4184         VolumeNumberLong,
4185 ], "Directory Entry Information")
4186 DirectoryInstance               = struct("directory_instance", [
4187         SearchSequenceWord,
4188         DirectoryID,
4189         Reserved2,
4190         DirectoryName14,
4191         DirectoryAttributes,
4192         DirectoryAccessRights,
4193         CreationDate,
4194         CreationTime,
4195         CreatorID,
4196         Reserved2,
4197         DirectoryStamp,
4198 ], "Directory Information")
4199 DMInfoLevel0                    = struct("dm_info_level_0", [
4200         uint32("io_flag", "IO Flag"),
4201         uint32("sm_info_size", "Storage Module Information Size"),
4202         uint32("avail_space", "Available Space"),
4203         uint32("used_space", "Used Space"),
4204         stringz("s_module_name", "Storage Module Name"),
4205         uint8("s_m_info", "Storage Media Information"),
4206 ])
4207 DMInfoLevel1                    = struct("dm_info_level_1", [
4208         NumberOfSMs,
4209         SMIDs,
4210 ])
4211 DMInfoLevel2                    = struct("dm_info_level_2", [
4212         Name,
4213 ])
4214 DOSDirectoryEntryStruct         = struct("dos_directory_entry_struct", [
4215         AttributesDef32,
4216         UniqueID,
4217         PurgeFlags,
4218         DestNameSpace,
4219         DirectoryNameLen,
4220         DirectoryName,
4221         CreationTime,
4222         CreationDate,
4223         CreatorID,
4224         ArchivedTime,
4225         ArchivedDate,
4226         ArchiverID,
4227         UpdateTime,
4228         UpdateDate,
4229         NextTrusteeEntry,
4230         Reserved48,
4231         InheritedRightsMask,
4232 ], "DOS Directory Information")
4233 DOSFileEntryStruct              = struct("dos_file_entry_struct", [
4234         AttributesDef32,
4235         UniqueID,
4236         PurgeFlags,
4237         DestNameSpace,
4238         NameLen,
4239         Name12,
4240         CreationTime,
4241         CreationDate,
4242         CreatorID,
4243         ArchivedTime,
4244         ArchivedDate,
4245         ArchiverID,
4246         UpdateTime,
4247         UpdateDate,
4248         UpdateID,
4249         FileSize,
4250         DataForkFirstFAT,
4251         NextTrusteeEntry,
4252         Reserved36,
4253         InheritedRightsMask,
4254         LastAccessedDate,
4255         Reserved28,
4256         PrimaryEntry,
4257         NameList,
4258 ], "DOS File Information")
4259 DSSpaceAllocateStruct           = struct("ds_space_alloc_struct", [
4260         DataStreamSpaceAlloc,
4261 ])
4262 DynMemStruct                    = struct("dyn_mem_struct", [
4263         uint32("dyn_mem_struct_total", "Total Dynamic Space" ),
4264         uint32("dyn_mem_struct_max", "Max Used Dynamic Space" ),
4265         uint32("dyn_mem_struct_cur", "Current Used Dynamic Space" ),
4266 ], "Dynamic Memory Information")
4267 EAInfoStruct                    = struct("ea_info_struct", [
4268         EADataSize,
4269         EACount,
4270         EAKeySize,
4271 ], "Extended Attribute Information")
4272 ExtraCacheCntrs                 = struct("extra_cache_cntrs", [
4273         uint32("internl_dsk_get_no_wait", "Internal Disk Get No Wait Count"),
4274         uint32("internl_dsk_get_no_wait_need", "Internal Disk Get No Wait Need To Allocate Count"),
4275         uint32("internl_dsk_get_no_wait_no_blk", "Internal Disk Get No Wait No Block Count"),
4276         uint32("id_get_no_read_no_wait", "ID Get No Read No Wait Count"),
4277         uint32("id_get_no_read_no_wait_sema", "ID Get No Read No Wait Semaphored Count"),
4278         uint32("id_get_no_read_no_wait_buffer", "ID Get No Read No Wait No Buffer Count"),
4279         uint32("id_get_no_read_no_wait_alloc", "ID Get No Read No Wait Allocate Count"),
4280         uint32("id_get_no_read_no_wait_no_alloc", "ID Get No Read No Wait No Alloc Count"),
4281         uint32("id_get_no_read_no_wait_no_alloc_sema", "ID Get No Read No Wait No Alloc Semaphored Count"),
4282         uint32("id_get_no_read_no_wait_no_alloc_alloc", "ID Get No Read No Wait No Alloc Allocate Count"),
4283 ], "Extra Cache Counters Information")
4284
4285
4286 ReferenceIDStruct               = struct("ref_id_struct", [
4287         CurrentReferenceID,
4288 ])
4289 NSAttributeStruct               = struct("ns_attrib_struct", [
4290         AttributesDef32,
4291 ])
4292 DStreamActual                   = struct("d_stream_actual", [
4293         Reserved12,
4294         # Need to look into how to format this correctly
4295 ])
4296 DStreamLogical                  = struct("d_string_logical", [
4297         Reserved12,
4298         # Need to look into how to format this correctly
4299 ])
4300 LastUpdatedInSecondsStruct      = struct("last_update_in_seconds_struct", [
4301         SecondsRelativeToTheYear2000,
4302 ]) 
4303 DOSNameStruct                   = struct("dos_name_struct", [
4304         FileName,
4305 ], "DOS File Name") 
4306 FlushTimeStruct                 = struct("flush_time_struct", [
4307         FlushTime,
4308 ]) 
4309 ParentBaseIDStruct              = struct("parent_base_id_struct", [
4310         ParentBaseID,
4311 ]) 
4312 MacFinderInfoStruct             = struct("mac_finder_info_struct", [
4313         MacFinderInfo,
4314 ]) 
4315 SiblingCountStruct              = struct("sibling_count_struct", [
4316         SiblingCount,
4317 ]) 
4318 EffectiveRightsStruct           = struct("eff_rights_struct", [
4319         EffectiveRights,
4320         Reserved3,     
4321 ]) 
4322 MacTimeStruct                   = struct("mac_time_struct", [
4323         MACCreateDate,
4324         MACCreateTime,
4325         MACBackupDate,
4326         MACBackupTime,
4327 ])
4328 LastAccessedTimeStruct          = struct("last_access_time_struct", [
4329         LastAccessedTime,      
4330 ])
4331
4332
4333
4334 FileAttributesStruct            = struct("file_attributes_struct", [
4335         AttributesDef32,
4336 ])
4337 FileInfoStruct                  = struct("file_info_struct", [
4338         ParentID,
4339         DirectoryEntryNumber,
4340         TotalBlocksToDecompress,
4341         CurrentBlockBeingDecompressed,
4342 ], "File Information")
4343 FileInstance                    = struct("file_instance", [
4344         SearchSequenceWord,
4345         DirectoryID,
4346         Reserved2,
4347         FileName14,
4348         AttributesDef,
4349         FileMode,
4350         FileSize,
4351         CreationDate,
4352         CreationTime,
4353         UpdateDate,
4354         UpdateTime,
4355 ], "File Instance")
4356 FileNameStruct                  = struct("file_name_struct", [
4357         FileName,
4358 ], "File Name")       
4359 FileServerCounters              = struct("file_server_counters", [
4360         uint16("too_many_hops", "Too Many Hops"),
4361         uint16("unknown_network", "Unknown Network"),
4362         uint16("no_space_for_service", "No Space For Service"),
4363         uint16("no_receive_buff", "No Receive Buffers"),
4364         uint16("not_my_network", "Not My Network"),
4365         uint32("netbios_progated", "NetBIOS Propagated Count"),
4366         uint32("ttl_pckts_srvcd", "Total Packets Serviced"),
4367         uint32("ttl_pckts_routed", "Total Packets Routed"),
4368 ], "File Server Counters")
4369 FileSystemInfo                  = struct("file_system_info", [
4370         uint32("fat_moved", "Number of times the OS has move the location of FAT"),
4371         uint32("fat_write_err", "Number of write errors in both original and mirrored copies of FAT"),
4372         uint32("someone_else_did_it_0", "Someone Else Did It Count 0"),
4373         uint32("someone_else_did_it_1", "Someone Else Did It Count 1"),
4374         uint32("someone_else_did_it_2", "Someone Else Did It Count 2"),
4375         uint32("i_ran_out_someone_else_did_it_0", "I Ran Out Someone Else Did It Count 0"),
4376         uint32("i_ran_out_someone_else_did_it_1", "I Ran Out Someone Else Did It Count 1"),
4377         uint32("i_ran_out_someone_else_did_it_2", "I Ran Out Someone Else Did It Count 2"),
4378         uint32("turbo_fat_build_failed", "Turbo FAT Build Failed Count"),
4379         uint32("extra_use_count_node_count", "Errors allocating a use count node for TTS"),
4380         uint32("extra_extra_use_count_node_count", "Errors allocating an additional use count node for TTS"),
4381         uint32("error_read_last_fat", "Error Reading Last FAT Count"),
4382         uint32("someone_else_using_this_file", "Someone Else Using This File Count"),
4383 ], "File System Information")
4384 GenericInfoDef                  = struct("generic_info_def", [
4385         fw_string("generic_label", "Label", 64),
4386         uint32("generic_ident_type", "Identification Type"),
4387         uint32("generic_ident_time", "Identification Time"),
4388         uint32("generic_media_type", "Media Type"),
4389         uint32("generic_cartridge_type", "Cartridge Type"),
4390         uint32("generic_unit_size", "Unit Size"),
4391         uint32("generic_block_size", "Block Size"),
4392         uint32("generic_capacity", "Capacity"),
4393         uint32("generic_pref_unit_size", "Preferred Unit Size"),
4394         fw_string("generic_name", "Name",64),
4395         uint32("generic_type", "Type"),
4396         uint32("generic_status", "Status"),
4397         uint32("generic_func_mask", "Function Mask"),
4398         uint32("generic_ctl_mask", "Control Mask"),
4399         uint32("generic_parent_count", "Parent Count"),
4400         uint32("generic_sib_count", "Sibling Count"),
4401         uint32("generic_child_count", "Child Count"),
4402         uint32("generic_spec_info_sz", "Specific Information Size"),
4403         uint32("generic_object_uniq_id", "Unique Object ID"),
4404         uint32("generic_media_slot", "Media Slot"),
4405 ], "Generic Information")
4406 HandleInfoLevel0                = struct("handle_info_level_0", [
4407 #        DataStream,
4408 ])
4409 HandleInfoLevel1                = struct("handle_info_level_1", [
4410         DataStream,
4411 ])        
4412 HandleInfoLevel2                = struct("handle_info_level_2", [
4413         DOSDirectoryBase,
4414         NameSpace,
4415         DataStream,
4416 ])        
4417 HandleInfoLevel3                = struct("handle_info_level_3", [
4418         DOSDirectoryBase,
4419         NameSpace,
4420 ])        
4421 HandleInfoLevel4                = struct("handle_info_level_4", [
4422         DOSDirectoryBase,
4423         NameSpace,
4424         ParentDirectoryBase,
4425         ParentDOSDirectoryBase,
4426 ])        
4427 HandleInfoLevel5                = struct("handle_info_level_5", [
4428         DOSDirectoryBase,
4429         NameSpace,
4430         DataStream,
4431         ParentDirectoryBase,
4432         ParentDOSDirectoryBase,
4433 ])        
4434 IPXInformation                  = struct("ipx_information", [
4435         uint32("ipx_send_pkt", "IPX Send Packet Count"),
4436         uint16("ipx_malform_pkt", "IPX Malformed Packet Count"),
4437         uint32("ipx_get_ecb_req", "IPX Get ECB Request Count"),
4438         uint32("ipx_get_ecb_fail", "IPX Get ECB Fail Count"),
4439         uint32("ipx_aes_event", "IPX AES Event Count"),
4440         uint16("ipx_postponed_aes", "IPX Postponed AES Count"),
4441         uint16("ipx_max_conf_sock", "IPX Max Configured Socket Count"),
4442         uint16("ipx_max_open_sock", "IPX Max Open Socket Count"),
4443         uint16("ipx_open_sock_fail", "IPX Open Socket Fail Count"),
4444         uint32("ipx_listen_ecb", "IPX Listen ECB Count"),
4445         uint16("ipx_ecb_cancel_fail", "IPX ECB Cancel Fail Count"),
4446         uint16("ipx_get_lcl_targ_fail", "IPX Get Local Target Fail Count"),
4447 ], "IPX Information")
4448 JobEntryTime                    = struct("job_entry_time", [
4449         Year,
4450         Month,
4451         Day,
4452         Hour,
4453         Minute,
4454         Second,
4455 ], "Job Entry Time")
4456 JobStruct                       = struct("job_struct", [
4457         ClientStation,
4458         ClientTaskNumber,
4459         ClientIDNumber,
4460         TargetServerIDNumber,
4461         TargetExecutionTime,
4462         JobEntryTime,
4463         JobNumber,
4464         JobType,
4465         JobPosition,
4466         JobControlFlags,
4467         JobFileName,
4468         JobFileHandle,
4469         ServerStation,
4470         ServerTaskNumber,
4471         ServerID,
4472         TextJobDescription,
4473         ClientRecordArea,
4474 ], "Job Information")
4475 JobStructNew                    = struct("job_struct_new", [
4476         RecordInUseFlag,
4477         PreviousRecord,
4478         NextRecord,
4479         ClientStationLong,
4480         ClientTaskNumberLong,
4481         ClientIDNumber,
4482         TargetServerIDNumber,
4483         TargetExecutionTime,
4484         JobEntryTime,
4485         JobNumberLong,
4486         JobType,
4487         JobPositionWord,
4488         JobControlFlagsWord,
4489         JobFileName,
4490         JobFileHandleLong,
4491         ServerStationLong,
4492         ServerTaskNumberLong,
4493         ServerID,
4494 ], "Job Information")                
4495 KnownRoutes                     = struct("known_routes", [
4496         NetIDNumber,
4497         HopsToNet,
4498         NetStatus,
4499         TimeToNet,
4500 ], "Known Routes")
4501 KnownServStruc                  = struct("known_server_struct", [
4502         ServerAddress,
4503         HopsToNet,
4504         ServerNameStringz,
4505 ], "Known Servers")                
4506 LANConfigInfo                   = struct("lan_cfg_info", [
4507         LANdriverCFG_MajorVersion,
4508         LANdriverCFG_MinorVersion,
4509         LANdriverNodeAddress,
4510         Reserved,
4511         LANdriverModeFlags,
4512         LANdriverBoardNumber,
4513         LANdriverBoardInstance,
4514         LANdriverMaximumSize,
4515         LANdriverMaxRecvSize,
4516         LANdriverRecvSize,
4517         LANdriverCardID,
4518         LANdriverMediaID,
4519         LANdriverTransportTime,
4520         LANdriverSrcRouting,
4521         LANdriverLineSpeed,
4522         LANdriverReserved,
4523         LANdriverMajorVersion,
4524         LANdriverMinorVersion,
4525         LANdriverFlags,
4526         LANdriverSendRetries,
4527         LANdriverLink,
4528         LANdriverSharingFlags,
4529         LANdriverSlot,
4530         LANdriverIOPortsAndRanges1,
4531         LANdriverIOPortsAndRanges2,
4532         LANdriverIOPortsAndRanges3,
4533         LANdriverIOPortsAndRanges4,
4534         LANdriverMemoryDecode0,
4535         LANdriverMemoryLength0,
4536         LANdriverMemoryDecode1,
4537         LANdriverMemoryLength1,
4538         LANdriverInterrupt1,
4539         LANdriverInterrupt2,
4540         LANdriverDMAUsage1,
4541         LANdriverDMAUsage2,
4542         LANdriverLogicalName,
4543         LANdriverIOReserved,
4544         LANdriverCardName,
4545 ], "LAN Configuration Information")
4546 LastAccessStruct                = struct("last_access_struct", [
4547         LastAccessedDate,
4548 ])
4549 lockInfo                        = struct("lock_info_struct", [
4550         LogicalLockThreshold,
4551         PhysicalLockThreshold,
4552         FileLockCount,
4553         RecordLockCount,
4554 ], "Lock Information")
4555 LockStruct                      = struct("lock_struct", [
4556         TaskNumByte,
4557         LockType,
4558         RecordStart,
4559         RecordEnd,
4560 ], "Locks")
4561 LoginTime                       = struct("login_time", [
4562         Year,
4563         Month,
4564         Day,
4565         Hour,
4566         Minute,
4567         Second,
4568         DayOfWeek,
4569 ], "Login Time")
4570 LogLockStruct                   = struct("log_lock_struct", [
4571         TaskNumByte,
4572         LockStatus,
4573         LockName,
4574 ], "Logical Locks")
4575 LogRecStruct                    = struct("log_rec_struct", [
4576         ConnectionNumberWord,
4577         TaskNumByte,
4578         LockStatus,
4579 ], "Logical Record Locks")
4580 LSLInformation                  = struct("lsl_information", [
4581         uint32("rx_buffers", "Receive Buffers"),
4582         uint32("rx_buffers_75", "Receive Buffers Warning Level"),
4583         uint32("rx_buffers_checked_out", "Receive Buffers Checked Out Count"),
4584         uint32("rx_buffer_size", "Receive Buffer Size"),
4585         uint32("max_phy_packet_size", "Maximum Physical Packet Size"),
4586         uint32("last_time_rx_buff_was_alloc", "Last Time a Receive Buffer was Allocated"),
4587         uint32("max_num_of_protocols", "Maximum Number of Protocols"),
4588         uint32("max_num_of_media_types", "Maximum Number of Media Types"),
4589         uint32("total_tx_packets", "Total Transmit Packets"),
4590         uint32("get_ecb_buf", "Get ECB Buffers"),
4591         uint32("get_ecb_fails", "Get ECB Failures"),
4592         uint32("aes_event_count", "AES Event Count"),
4593         uint32("post_poned_events", "Postponed Events"),
4594         uint32("ecb_cxl_fails", "ECB Cancel Failures"),
4595         uint32("valid_bfrs_reused", "Valid Buffers Reused"),
4596         uint32("enqueued_send_cnt", "Enqueued Send Count"),
4597         uint32("total_rx_packets", "Total Receive Packets"),
4598         uint32("unclaimed_packets", "Unclaimed Packets"),
4599         uint8("stat_table_major_version", "Statistics Table Major Version"),
4600         uint8("stat_table_minor_version", "Statistics Table Minor Version"),
4601 ], "LSL Information")
4602 MaximumSpaceStruct              = struct("max_space_struct", [
4603         MaxSpace,
4604 ])
4605 MemoryCounters                  = struct("memory_counters", [
4606         uint32("orig_num_cache_buff", "Original Number Of Cache Buffers"),
4607         uint32("curr_num_cache_buff", "Current Number Of Cache Buffers"),
4608         uint32("cache_dirty_block_thresh", "Cache Dirty Block Threshold"),
4609         uint32("wait_node", "Wait Node Count"),
4610         uint32("wait_node_alloc_fail", "Wait Node Alloc Failure Count"),
4611         uint32("move_cache_node", "Move Cache Node Count"),
4612         uint32("move_cache_node_from_avai", "Move Cache Node From Avail Count"),
4613         uint32("accel_cache_node_write", "Accelerate Cache Node Write Count"),
4614         uint32("rem_cache_node", "Remove Cache Node Count"),
4615         uint32("rem_cache_node_from_avail", "Remove Cache Node From Avail Count"),
4616 ], "Memory Counters")
4617 MLIDBoardInfo                   = struct("mlid_board_info", [           
4618         uint32("protocol_board_num", "Protocol Board Number"),
4619         uint16("protocol_number", "Protocol Number"),
4620         bytes("protocol_id", "Protocol ID", 6),
4621         nstring8("protocol_name", "Protocol Name"),
4622 ], "MLID Board Information")        
4623 ModifyInfoStruct                = struct("modify_info_struct", [
4624         ModifiedTime,
4625         ModifiedDate,
4626         ModifierID,
4627         LastAccessedDate,
4628 ], "Modification Information")
4629 nameInfo                        = struct("name_info_struct", [
4630         ObjectType,
4631         nstring8("login_name", "Login Name"),
4632 ], "Name Information")
4633 NCPNetworkAddress               = struct("ncp_network_address_struct", [
4634         TransportType,
4635         Reserved3,
4636         NetAddress,
4637 ], "Network Address")
4638
4639 NDS7Struct                      = struct("nds_7_struct", [
4640         NDSCRC,
4641 ])        
4642 NDS8Struct                      = struct("nds_8_struct", [
4643         NDSCRC,
4644         NDSNewVerb,
4645 ])        
4646 netAddr                         = struct("net_addr_struct", [
4647         TransportType,
4648         nbytes32("transport_addr", "Transport Address"),
4649 ], "Network Address")
4650 NetWareInformationStruct        = struct("netware_information_struct", [
4651         DataStreamSpaceAlloc,           # (Data Stream Alloc Bit)
4652         AttributesDef32,                # (Attributes Bit)
4653         FlagsDef,
4654         DataStreamSize,                 # (Data Stream Size Bit)
4655         TotalDataStreamDiskSpaceAlloc,  # (Total Stream Size Bit)
4656         NumberOfDataStreams,
4657         CreationTime,                   # (Creation Bit)
4658         CreationDate,
4659         CreatorID,
4660         ModifiedTime,                   # (Modify Bit)
4661         ModifiedDate,
4662         ModifierID,
4663         LastAccessedDate,
4664         ArchivedTime,                   # (Archive Bit)
4665         ArchivedDate,
4666         ArchiverID,
4667         InheritedRightsMask,            # (Rights Bit)
4668         DirectoryEntryNumber,           # (Directory Entry Bit)
4669         DOSDirectoryEntryNumber,
4670         VolumeNumberLong,
4671         EADataSize,                     # (Extended Attribute Bit)
4672         EACount,
4673         EAKeySize,
4674         CreatorNameSpaceNumber,         # (Name Space Bit)
4675         Reserved3,
4676 ], "NetWare Information")
4677 NLMInformation                  = struct("nlm_information", [
4678         IdentificationNumber,
4679         NLMFlags,
4680         Reserved3,
4681         NLMType,
4682         Reserved3,
4683         ParentID,
4684         MajorVersion,
4685         MinorVersion,
4686         Revision,
4687         Year,
4688         Reserved3,
4689         Month,
4690         Reserved3,
4691         Day,
4692         Reserved3,
4693         AllocAvailByte,
4694         AllocFreeCount,
4695         LastGarbCollect,
4696         MessageLanguage,
4697         NumberOfReferencedPublics,
4698 ], "NLM Information")
4699 NSInfoStruct                    = struct("ns_info_struct", [
4700         NameSpace,
4701         Reserved3,
4702 ])
4703 NWAuditStatus                   = struct("nw_audit_status", [
4704         AuditVersionDate,
4705         AuditFileVersionDate,
4706         val_string16("audit_enable_flag", "Auditing Enabled Flag", [
4707                 [ 0x0000, "Auditing Disabled" ],
4708                 [ 0x0100, "Auditing Enabled" ],
4709         ]),
4710         Reserved2,
4711         uint32("audit_file_size", "Audit File Size"),
4712         uint32("modified_counter", "Modified Counter"),
4713         uint32("audit_file_max_size", "Audit File Maximum Size"),
4714         uint32("audit_file_size_threshold", "Audit File Size Threshold"),
4715         uint32("audit_record_count", "Audit Record Count"),
4716         uint32("auditing_flags", "Auditing Flags"),
4717 ], "NetWare Audit Status")
4718 ObjectSecurityStruct            = struct("object_security_struct", [
4719         ObjectSecurity,
4720 ])
4721 ObjectFlagsStruct               = struct("object_flags_struct", [
4722         ObjectFlags,
4723 ])
4724 ObjectTypeStruct                = struct("object_type_struct", [
4725         ObjectType,
4726         Reserved2,
4727 ])
4728 ObjectNameStruct                = struct("object_name_struct", [
4729         ObjectNameStringz,
4730 ])
4731 ObjectIDStruct                  = struct("object_id_struct", [
4732         ObjectID, 
4733         Restriction,
4734 ])
4735 OpnFilesStruct                  = struct("opn_files_struct", [
4736         TaskNumberWord,
4737         LockType,
4738         AccessControl,
4739         LockFlag,
4740         VolumeNumber,
4741         DOSParentDirectoryEntry,
4742         DOSDirectoryEntry,
4743         ForkCount,
4744         NameSpace,
4745         FileName,
4746 ], "Open Files Information")
4747 OwnerIDStruct                   = struct("owner_id_struct", [
4748         CreatorID,
4749 ])                
4750 PacketBurstInformation          = struct("packet_burst_information", [
4751         uint32("big_invalid_slot", "Big Invalid Slot Count"),
4752         uint32("big_forged_packet", "Big Forged Packet Count"),
4753         uint32("big_invalid_packet", "Big Invalid Packet Count"),
4754         uint32("big_still_transmitting", "Big Still Transmitting Count"),
4755         uint32("still_doing_the_last_req", "Still Doing The Last Request Count"),
4756         uint32("invalid_control_req", "Invalid Control Request Count"),
4757         uint32("control_invalid_message_number", "Control Invalid Message Number Count"),
4758         uint32("control_being_torn_down", "Control Being Torn Down Count"),
4759         uint32("big_repeat_the_file_read", "Big Repeat the File Read Count"),
4760         uint32("big_send_extra_cc_count", "Big Send Extra CC Count"),
4761         uint32("big_return_abort_mess", "Big Return Abort Message Count"),
4762         uint32("big_read_invalid_mess", "Big Read Invalid Message Number Count"),
4763         uint32("big_read_do_it_over", "Big Read Do It Over Count"),
4764         uint32("big_read_being_torn_down", "Big Read Being Torn Down Count"),
4765         uint32("previous_control_packet", "Previous Control Packet Count"),
4766         uint32("send_hold_off_message", "Send Hold Off Message Count"),
4767         uint32("big_read_no_data_avail", "Big Read No Data Available Count"),
4768         uint32("big_read_trying_to_read", "Big Read Trying To Read Too Much Count"),
4769         uint32("async_read_error", "Async Read Error Count"),
4770         uint32("big_read_phy_read_err", "Big Read Physical Read Error Count"),
4771         uint32("ctl_bad_ack_frag_list", "Control Bad ACK Fragment List Count"),
4772         uint32("ctl_no_data_read", "Control No Data Read Count"),
4773         uint32("write_dup_req", "Write Duplicate Request Count"),
4774         uint32("shouldnt_be_ack_here", "Shouldn't Be ACKing Here Count"),
4775         uint32("write_incon_packet_len", "Write Inconsistent Packet Lengths Count"),
4776         uint32("first_packet_isnt_a_write", "First Packet Isn't A Write Count"),
4777         uint32("write_trash_dup_req", "Write Trashed Duplicate Request Count"),
4778         uint32("big_write_inv_message_num", "Big Write Invalid Message Number Count"),
4779         uint32("big_write_being_torn_down", "Big Write Being Torn Down Count"),
4780         uint32("big_write_being_abort", "Big Write Being Aborted Count"),
4781         uint32("zero_ack_frag", "Zero ACK Fragment Count"),
4782         uint32("write_curr_trans", "Write Currently Transmitting Count"),
4783         uint32("try_to_write_too_much", "Trying To Write Too Much Count"),
4784         uint32("write_out_of_mem_for_ctl_nodes", "Write Out Of Memory For Control Nodes Count"),
4785         uint32("write_didnt_need_this_frag", "Write Didn't Need This Fragment Count"),
4786         uint32("write_too_many_buf_check", "Write Too Many Buffers Checked Out Count"),
4787         uint32("write_timeout", "Write Time Out Count"),
4788         uint32("write_got_an_ack0", "Write Got An ACK Count 0"),
4789         uint32("write_got_an_ack1", "Write Got An ACK Count 1"),
4790         uint32("poll_abort_conn", "Poller Aborted The Connnection Count"),
4791         uint32("may_had_out_of_order", "Maybe Had Out Of Order Writes Count"),
4792         uint32("had_an_out_of_order", "Had An Out Of Order Write Count"),
4793         uint32("moved_the_ack_bit_dn", "Moved The ACK Bit Down Count"),
4794         uint32("bumped_out_of_order", "Bumped Out Of Order Write Count"),
4795         uint32("poll_rem_old_out_of_order", "Poller Removed Old Out Of Order Count"),
4796         uint32("write_didnt_need_but_req_ack", "Write Didn't Need But Requested ACK Count"),
4797         uint32("write_trash_packet", "Write Trashed Packet Count"),
4798         uint32("too_many_ack_frag", "Too Many ACK Fragments Count"),
4799         uint32("saved_an_out_of_order_packet", "Saved An Out Of Order Packet Count"),
4800         uint32("conn_being_aborted", "Connection Being Aborted Count"),
4801 ], "Packet Burst Information")
4802
4803 PadDSSpaceAllocate              = struct("pad_ds_space_alloc", [
4804     Reserved4,
4805 ])
4806 PadAttributes                   = struct("pad_attributes", [
4807     Reserved6,
4808 ])
4809 PadDataStreamSize               = struct("pad_data_stream_size", [
4810     Reserved4,
4811 ])    
4812 PadTotalStreamSize              = struct("pad_total_stream_size", [
4813     Reserved6,
4814 ])
4815 PadCreationInfo                 = struct("pad_creation_info", [
4816     Reserved8,
4817 ])
4818 PadModifyInfo                   = struct("pad_modify_info", [
4819     Reserved10,
4820 ])
4821 PadArchiveInfo                  = struct("pad_archive_info", [
4822     Reserved8,
4823 ])
4824 PadRightsInfo                   = struct("pad_rights_info", [
4825     Reserved2,
4826 ])
4827 PadDirEntry                     = struct("pad_dir_entry", [
4828     Reserved12,
4829 ])
4830 PadEAInfo                       = struct("pad_ea_info", [
4831     Reserved12,
4832 ])
4833 PadNSInfo                       = struct("pad_ns_info", [
4834     Reserved4,
4835 ])
4836 PhyLockStruct                   = struct("phy_lock_struct", [
4837         LoggedCount,
4838         ShareableLockCount,
4839         RecordStart,
4840         RecordEnd,
4841         LogicalConnectionNumber,
4842         TaskNumByte,
4843         LockType,
4844 ], "Physical Locks")
4845 PingVersion9                    = struct("ping_version_9", [
4846         TreeLength,
4847         TreeName,
4848 ])        
4849 PingVersion10                   = struct("ping_version_10", [
4850         TreeLength,
4851         Reserved8,
4852         nstring32("tree_uni_name", "Tree Name" ),
4853 ])
4854 printInfo                       = struct("print_info_struct", [
4855         PrintFlags,
4856         TabSize,
4857         Copies,
4858         PrintToFileFlag,
4859         BannerName,
4860         TargetPrinter,
4861         FormType,
4862 ], "Print Information")
4863 RightsInfoStruct                = struct("rights_info_struct", [
4864         InheritedRightsMask,
4865 ])
4866 RoutersInfo                     = struct("routers_info", [
4867         bytes("node", "Node", 6),
4868         ConnectedLAN,
4869         uint16("route_hops", "Hop Count"),
4870         uint16("route_time", "Route Time"),
4871 ], "Router Information")        
4872 RTagStructure                   = struct("r_tag_struct", [
4873         RTagNumber,
4874         ResourceSignature,
4875         ResourceCount,
4876         ResourceName,
4877 ], "Resource Tag")
4878 ScanInfoFileName                = struct("scan_info_file_name", [
4879         SalvageableFileEntryNumber,
4880         FileName,
4881 ])
4882 ScanInfoFileNoName              = struct("scan_info_file_no_name", [
4883         SalvageableFileEntryNumber,        
4884 ])        
4885 Segments                        = struct("segments", [
4886         uint32("volume_segment_dev_num", "Volume Segment Device Number"),
4887         uint32("volume_segment_offset", "Volume Segment Offset"),
4888         uint32("volume_segment_size", "Volume Segment Size"),
4889 ], "Volume Segment Information")            
4890 SemaInfoStruct                  = struct("sema_info_struct", [
4891         LogicalConnectionNumber,
4892         TaskNumByte,
4893 ])
4894 SemaStruct                      = struct("sema_struct", [
4895         OpenCount,
4896         SemaphoreValue,
4897         TaskNumByte,
4898         SemaphoreName,
4899 ], "Semaphore Information")
4900 ServerInfo                      = struct("server_info", [
4901         uint32("reply_canceled", "Reply Canceled Count"),
4902         uint32("write_held_off", "Write Held Off Count"),
4903         uint32("write_held_off_with_dup", "Write Held Off With Duplicate Request"),
4904         uint32("invalid_req_type", "Invalid Request Type Count"),
4905         uint32("being_aborted", "Being Aborted Count"),
4906         uint32("already_doing_realloc", "Already Doing Re-Allocate Count"),
4907         uint32("dealloc_invalid_slot", "De-Allocate Invalid Slot Count"),
4908         uint32("dealloc_being_proc", "De-Allocate Being Processed Count"),
4909         uint32("dealloc_forged_packet", "De-Allocate Forged Packet Count"),
4910         uint32("dealloc_still_transmit", "De-Allocate Still Transmitting Count"),
4911         uint32("start_station_error", "Start Station Error Count"),
4912         uint32("invalid_slot", "Invalid Slot Count"),
4913         uint32("being_processed", "Being Processed Count"),
4914         uint32("forged_packet", "Forged Packet Count"),
4915         uint32("still_transmitting", "Still Transmitting Count"),
4916         uint32("reexecute_request", "Re-Execute Request Count"),
4917         uint32("invalid_sequence_number", "Invalid Sequence Number Count"),
4918         uint32("dup_is_being_sent", "Duplicate Is Being Sent Already Count"),
4919         uint32("sent_pos_ack", "Sent Positive Acknowledge Count"),
4920         uint32("sent_a_dup_reply", "Sent A Duplicate Reply Count"),
4921         uint32("no_mem_for_station", "No Memory For Station Control Count"),
4922         uint32("no_avail_conns", "No Available Connections Count"),
4923         uint32("realloc_slot", "Re-Allocate Slot Count"),
4924         uint32("realloc_slot_came_too_soon", "Re-Allocate Slot Came Too Soon Count"),
4925 ], "Server Information")
4926 ServersSrcInfo                  = struct("servers_src_info", [
4927         ServerNode,
4928         ConnectedLAN,
4929         HopsToNet,
4930 ], "Source Server Information")
4931 SpaceStruct                     = struct("space_struct", [        
4932         Level,
4933         MaxSpace,
4934         CurrentSpace,
4935 ], "Space Information")        
4936 SPXInformation                  = struct("spx_information", [
4937         uint16("spx_max_conn", "SPX Max Connections Count"),
4938         uint16("spx_max_used_conn", "SPX Max Used Connections"),
4939         uint16("spx_est_conn_req", "SPX Establish Connection Requests"),
4940         uint16("spx_est_conn_fail", "SPX Establish Connection Fail"),
4941         uint16("spx_listen_con_req", "SPX Listen Connect Request"),
4942         uint16("spx_listen_con_fail", "SPX Listen Connect Fail"),
4943         uint32("spx_send", "SPX Send Count"),
4944         uint32("spx_window_choke", "SPX Window Choke Count"),
4945         uint16("spx_bad_send", "SPX Bad Send Count"),
4946         uint16("spx_send_fail", "SPX Send Fail Count"),
4947         uint16("spx_abort_conn", "SPX Aborted Connection"),
4948         uint32("spx_listen_pkt", "SPX Listen Packet Count"),
4949         uint16("spx_bad_listen", "SPX Bad Listen Count"),
4950         uint32("spx_incoming_pkt", "SPX Incoming Packet Count"),
4951         uint16("spx_bad_in_pkt", "SPX Bad In Packet Count"),
4952         uint16("spx_supp_pkt", "SPX Suppressed Packet Count"),
4953         uint16("spx_no_ses_listen", "SPX No Session Listen ECB Count"),
4954         uint16("spx_watch_dog", "SPX Watch Dog Destination Session Count"),
4955 ], "SPX Information")
4956 StackInfo                       = struct("stack_info", [
4957         StackNumber,
4958         fw_string("stack_short_name", "Stack Short Name", 16),
4959 ], "Stack Information")        
4960 statsInfo                       = struct("stats_info_struct", [
4961         TotalBytesRead,
4962         TotalBytesWritten,
4963         TotalRequest,
4964 ], "Statistics")
4965 theTimeStruct                   = struct("the_time_struct", [
4966         UTCTimeInSeconds,
4967         FractionalSeconds,
4968         TimesyncStatus,
4969 ])        
4970 timeInfo                        = struct("time_info", [
4971         Year,
4972         Month,
4973         Day,
4974         Hour,
4975         Minute,
4976         Second,
4977         DayOfWeek,
4978         uint32("login_expiration_time", "Login Expiration Time"),
4979 ])              
4980 TotalStreamSizeStruct           = struct("total_stream_size_struct", [
4981         TotalDataStreamDiskSpaceAlloc,
4982         NumberOfDataStreams,
4983 ])
4984 TrendCounters                   = struct("trend_counters", [
4985         uint32("num_of_cache_checks", "Number Of Cache Checks"),
4986         uint32("num_of_cache_hits", "Number Of Cache Hits"),
4987         uint32("num_of_dirty_cache_checks", "Number Of Dirty Cache Checks"),
4988         uint32("num_of_cache_dirty_checks", "Number Of Cache Dirty Checks"),
4989         uint32("cache_used_while_check", "Cache Used While Checking"),
4990         uint32("wait_till_dirty_blcks_dec", "Wait Till Dirty Blocks Decrease Count"),
4991         uint32("alloc_blck_frm_avail", "Allocate Block From Available Count"),
4992         uint32("alloc_blck_frm_lru", "Allocate Block From LRU Count"),
4993         uint32("alloc_blck_already_wait", "Allocate Block Already Waiting"),
4994         uint32("lru_sit_time", "LRU Sitting Time"),
4995         uint32("num_of_cache_check_no_wait", "Number Of Cache Check No Wait"),
4996         uint32("num_of_cache_hits_no_wait", "Number Of Cache Hits No Wait"),
4997 ], "Trend Counters")
4998 TrusteeStruct                   = struct("trustee_struct", [
4999         ObjectID,
5000         AccessRightsMaskWord,
5001 ])
5002 UpdateDateStruct                = struct("update_date_struct", [
5003         UpdateDate,
5004 ])
5005 UpdateIDStruct                  = struct("update_id_struct", [
5006         UpdateID,
5007 ])        
5008 UpdateTimeStruct                = struct("update_time_struct", [
5009         UpdateTime,
5010 ])                
5011 UserInformation                 = struct("user_info", [
5012         ConnectionNumber,
5013         UseCount,
5014         Reserved2,
5015         ConnectionServiceType,
5016         Year,
5017         Month,
5018         Day,
5019         Hour,
5020         Minute,
5021         Second,
5022         DayOfWeek,
5023         Status,
5024         Reserved2,
5025         ExpirationTime,
5026         ObjectType,
5027         Reserved2,
5028         TransactionTrackingFlag,
5029         LogicalLockThreshold,
5030         FileWriteFlags,
5031         FileWriteState,
5032         Reserved,
5033         FileLockCount,
5034         RecordLockCount,
5035         TotalBytesRead,
5036         TotalBytesWritten,
5037         TotalRequest,
5038         HeldRequests,
5039         HeldBytesRead,
5040         HeldBytesWritten,
5041 ], "User Information")
5042 VolInfoStructure                = struct("vol_info_struct", [
5043         VolumeType,
5044         Reserved2,
5045         StatusFlagBits,
5046         SectorSize,
5047         SectorsPerClusterLong,
5048         VolumeSizeInClusters,
5049         FreedClusters,
5050         SubAllocFreeableClusters,
5051         FreeableLimboSectors,
5052         NonFreeableLimboSectors,
5053         NonFreeableAvailableSubAllocSectors,
5054         NotUsableSubAllocSectors,
5055         SubAllocClusters,
5056         DataStreamsCount,
5057         LimboDataStreamsCount,
5058         OldestDeletedFileAgeInTicks,
5059         CompressedDataStreamsCount,
5060         CompressedLimboDataStreamsCount,
5061         UnCompressableDataStreamsCount,
5062         PreCompressedSectors,
5063         CompressedSectors,
5064         MigratedFiles,
5065         MigratedSectors,
5066         ClustersUsedByFAT,
5067         ClustersUsedByDirectories,
5068         ClustersUsedByExtendedDirectories,
5069         TotalDirectoryEntries,
5070         UnUsedDirectoryEntries,
5071         TotalExtendedDirectoryExtants,
5072         UnUsedExtendedDirectoryExtants,
5073         ExtendedAttributesDefined,
5074         ExtendedAttributeExtantsUsed,
5075         DirectoryServicesObjectID,
5076         VolumeLastModifiedTime,
5077         VolumeLastModifiedDate,
5078 ], "Volume Information")
5079 VolInfo2Struct                  = struct("vol_info_struct_2", [
5080         uint32("volume_active_count", "Volume Active Count"),
5081         uint32("volume_use_count", "Volume Use Count"),
5082         uint32("mac_root_ids", "MAC Root IDs"),
5083         VolumeLastModifiedTime,
5084         VolumeLastModifiedDate,
5085         uint32("volume_reference_count", "Volume Reference Count"),
5086         uint32("compression_lower_limit", "Compression Lower Limit"),
5087         uint32("outstanding_ios", "Outstanding IOs"),
5088         uint32("outstanding_compression_ios", "Outstanding Compression IOs"),
5089         uint32("compression_ios_limit", "Compression IOs Limit"),
5090 ], "Extended Volume Information")        
5091 VolumeStruct                    = struct("volume_struct", [
5092         VolumeNumberLong,
5093         VolumeNameLen,
5094 ])
5095
5096
5097 ##############################################################################
5098 # NCP Groups
5099 ##############################################################################
5100 def define_groups():
5101         groups['accounting']    = "Accounting"
5102         groups['afp']           = "AFP"
5103         groups['auditing']      = "Auditing"
5104         groups['bindery']       = "Bindery"
5105         groups['comm']          = "Communication"
5106         groups['connection']    = "Connection"
5107         groups['directory']     = "Directory"
5108         groups['extended']      = "Extended Attribute"
5109         groups['file']          = "File"
5110         groups['fileserver']    = "File Server"
5111         groups['message']       = "Message"
5112         groups['migration']     = "Data Migration"
5113         groups['misc']          = "Miscellaneous"
5114         groups['name']          = "Name Space"
5115         groups['nds']           = "NetWare Directory"
5116         groups['print']         = "Print"
5117         groups['queue']         = "Queue"
5118         groups['sync']          = "Synchronization"
5119         groups['tts']           = "Transaction Tracking"
5120         groups['qms']           = "Queue Management System (QMS)"
5121         groups['stats']         = "Server Statistics"
5122         groups['unknown']       = "Unknown"
5123
5124 ##############################################################################
5125 # NCP Errors
5126 ##############################################################################
5127 def define_errors():
5128         errors[0x0000] = "Ok"
5129         errors[0x0001] = "Transaction tracking is available"
5130         errors[0x0002] = "Ok. The data has been written"
5131         errors[0x0003] = "Calling Station is a Manager"
5132
5133         errors[0x0100] = "One or more of the ConnectionNumbers in the send list are invalid"
5134         errors[0x0101] = "Invalid space limit"
5135         errors[0x0102] = "Insufficient disk space"
5136         errors[0x0103] = "Queue server cannot add jobs"
5137         errors[0x0104] = "Out of disk space"
5138         errors[0x0105] = "Semaphore overflow"
5139         errors[0x0106] = "Invalid Parameter"
5140         errors[0x0107] = "Invalid Number of Minutes to Delay"
5141         errors[0x0108] = "Invalid Start or Network Number"
5142
5143         errors[0x0200] = "One or more clients in the send list are not logged in"
5144         errors[0x0201] = "Queue server cannot attach"
5145
5146         errors[0x0300] = "One or more clients in the send list are not accepting messages"
5147
5148         errors[0x0400] = "Client already has message"
5149         errors[0x0401] = "Queue server cannot service job"
5150
5151         errors[0x7300] = "Revoke Handle Rights Not Found"
5152         errors[0x7900] = "Invalid Parameter in Request Packet"
5153         errors[0x7a00] = "Connection Already Temporary"
5154         errors[0x7b00] = "Connection Already Logged in"
5155         errors[0x7c00] = "Connection Not Authenticated"
5156         
5157         errors[0x7e00] = "NCP failed boundary check"
5158         errors[0x7e01] = "Invalid Length"
5159
5160         errors[0x7f00] = "Lock Waiting"
5161         errors[0x8000] = "Lock fail"
5162
5163         errors[0x8100] = "A file handle could not be allocated by the file server"
5164         errors[0x8101] = "Out of File Handles"
5165         
5166         errors[0x8200] = "Unauthorized to open the file"
5167         errors[0x8300] = "Unable to read/write the volume. Possible bad sector on the file server"
5168         errors[0x8301] = "Hard I/O Error"
5169
5170         errors[0x8400] = "Unauthorized to create the directory"
5171         errors[0x8401] = "Unauthorized to create the file"
5172
5173         errors[0x8500] = "Unauthorized to delete the specified file"
5174         errors[0x8501] = "Unauthorized to overwrite an existing file in this directory"
5175
5176         errors[0x8700] = "An unexpected character was encountered in the filename"
5177         errors[0x8701] = "Create Filename Error"
5178
5179         errors[0x8800] = "Invalid file handle"
5180         errors[0x8900] = "Unauthorized to search this directory"
5181         errors[0x8a00] = "Unauthorized to delete this directory"
5182         errors[0x8b00] = "Unauthorized to rename a file in this directory"
5183
5184         errors[0x8c00] = "No set privileges"
5185         errors[0x8c01] = "Unauthorized to modify a file in this directory"
5186         errors[0x8c02] = "Unauthorized to change the restriction on this volume"
5187
5188         errors[0x8d00] = "Some of the affected files are in use by another client"
5189         errors[0x8d01] = "The affected file is in use"
5190
5191         errors[0x8e00] = "All of the affected files are in use by another client"
5192         errors[0x8f00] = "Some of the affected files are read-only"
5193
5194         errors[0x9000] = "An attempt to modify a read-only volume occurred"
5195         errors[0x9001] = "All of the affected files are read-only"
5196         errors[0x9002] = "Read Only Access to Volume"
5197
5198         errors[0x9100] = "Some of the affected files already exist"
5199         errors[0x9101] = "Some Names Exist"
5200
5201         errors[0x9200] = "Directory with the new name already exists"
5202         errors[0x9201] = "All of the affected files already exist"
5203
5204         errors[0x9300] = "Unauthorized to read from this file"
5205         errors[0x9400] = "Unauthorized to write to this file"
5206         errors[0x9500] = "The affected file is detached"
5207
5208         errors[0x9600] = "The file server has run out of memory to service this request"
5209         errors[0x9601] = "No alloc space for message"
5210         errors[0x9602] = "Server Out of Space"
5211
5212         errors[0x9800] = "The affected volume is not mounted"
5213         errors[0x9801] = "The volume associated with Volume Number is not mounted"
5214         errors[0x9802] = "The resulting volume does not exist"
5215         errors[0x9803] = "The destination volume is not mounted"
5216         errors[0x9804] = "Disk Map Error"
5217
5218         errors[0x9900] = "The file server has run out of directory space on the affected volume"
5219         errors[0x9a00] = "The request attempted to rename the affected file to another volume"
5220
5221         errors[0x9b00] = "DirHandle is not associated with a valid directory path"
5222         errors[0x9b01] = "A resulting directory handle is not associated with a valid directory path"
5223         errors[0x9b02] = "The directory associated with DirHandle does not exist"
5224         errors[0x9b03] = "Bad directory handle"
5225
5226         errors[0x9c00] = "The resulting path is not valid"
5227         errors[0x9c01] = "The resulting file path is not valid"
5228         errors[0x9c02] = "The resulting directory path is not valid"
5229         errors[0x9c03] = "Invalid path"
5230
5231         errors[0x9d00] = "A directory handle was not available for allocation"
5232
5233         errors[0x9e00] = "The name of the directory does not conform to a legal name for this name space"
5234         errors[0x9e01] = "The new directory name does not conform to a legal name for this name space"
5235         errors[0x9e02] = "Bad File Name"
5236
5237         errors[0x9f00] = "The request attempted to delete a directory that is in use by another client"
5238
5239         errors[0xa000] = "The request attempted to delete a directory that is not empty"
5240         errors[0xa100] = "An unrecoverable error occured on the affected directory"
5241
5242         errors[0xa200] = "The request attempted to read from a file region that is physically locked"
5243         errors[0xa201] = "I/O Lock Error"
5244
5245         errors[0xa400] = "Invalid directory rename attempted"
5246         errors[0xa700] = "Error Auditing Version"
5247         errors[0xa800] = "Invalid Support Module ID"
5248         errors[0xbe00] = "Invalid Data Stream"
5249         errors[0xbf00] = "Requests for this name space are not valid on this volume"
5250
5251         errors[0xc000] = "Unauthorized to retrieve accounting data"
5252         
5253         errors[0xc100] = "The ACCOUNT_BALANCE property does not exist"
5254         errors[0xc101] = "No Account Balance"
5255         
5256         errors[0xc200] = "The object has exceeded its credit limit"
5257         errors[0xc300] = "Too many holds have been placed against this account"
5258         errors[0xc400] = "The client account has been disabled"
5259
5260         errors[0xc500] = "Access to the account has been denied because of intruder detection"
5261         errors[0xc501] = "Login lockout"
5262         errors[0xc502] = "Server Login Locked"
5263
5264         errors[0xc600] = "The caller does not have operator priviliges"
5265         errors[0xc601] = "The client does not have operator priviliges"
5266
5267         errors[0xc800] = "Missing EA Key"
5268         errors[0xc900] = "EA Not Found"
5269         errors[0xca00] = "Invalid EA Handle Type"
5270         errors[0xcb00] = "EA No Key No Data"
5271         errors[0xcc00] = "EA Number Mismatch"
5272         errors[0xcd00] = "Extent Number Out of Range"
5273         errors[0xce00] = "EA Bad Directory Number"
5274         errors[0xcf00] = "Invalid EA Handle"
5275
5276         errors[0xd000] = "Queue error"
5277         errors[0xd001] = "EA Position Out of Range"
5278         
5279         errors[0xd100] = "The queue does not exist"
5280         errors[0xd101] = "EA Access Denied"
5281
5282         errors[0xd200] = "A queue server is not associated with this queue"
5283         errors[0xd201] = "A queue server is not associated with the selected queue"
5284         errors[0xd202] = "No queue server"
5285         errors[0xd203] = "Data Page Odd Size"
5286
5287         errors[0xd300] = "No queue rights"
5288         errors[0xd301] = "EA Volume Not Mounted"
5289
5290         errors[0xd400] = "The queue is full and cannot accept another request"
5291         errors[0xd401] = "The queue associated with ObjectId is full and cannot accept another request"
5292         errors[0xd402] = "Bad Page Boundary"
5293
5294         errors[0xd500] = "A job does not exist in this queue"
5295         errors[0xd501] = "No queue job"
5296         errors[0xd502] = "The job associated with JobNumber does not exist in this queue"
5297         errors[0xd503] = "Inspect Failure"
5298
5299         errors[0xd600] = "The file server does not allow unencrypted passwords"
5300         errors[0xd601] = "No job right"
5301         errors[0xd602] = "EA Already Claimed"
5302
5303         errors[0xd700] = "Bad account"
5304         errors[0xd701] = "The old and new password strings are identical"
5305         errors[0xd702] = "The job is currently being serviced"
5306         errors[0xd703] = "The queue is currently servicing a job"
5307         errors[0xd704] = "Queue servicing"
5308         errors[0xd705] = "Odd Buffer Size"
5309
5310         errors[0xd800] = "Queue not active"
5311         errors[0xd801] = "No Scorecards"
5312         
5313         errors[0xd900] = "The file server cannot accept another connection as it has reached its limit"
5314         errors[0xd901] = "The client is not security equivalent to one of the objects in the Q_SERVERS group property of the target queue"
5315         errors[0xd902] = "Station is not a server"
5316         errors[0xd903] = "Bad EDS Signature"
5317
5318         errors[0xda00] = "Attempted to login to the file server during a restricted time period"
5319         errors[0xda01] = "Queue halted"
5320         errors[0xda02] = "EA Space Limit"
5321
5322         errors[0xdb00] = "Attempted to login to the file server from an unauthorized workstation or network"
5323         errors[0xdb01] = "The queue cannot attach another queue server"
5324         errors[0xdb02] = "Maximum queue servers"
5325         errors[0xdb03] = "EA Key Corrupt"
5326
5327         errors[0xdc00] = "Account Expired"
5328         errors[0xdc01] = "EA Key Limit"
5329         
5330         errors[0xdd00] = "Tally Corrupt"
5331         errors[0xde00] = "Attempted to login to the file server with an incorrect password"
5332         errors[0xdf00] = "Attempted to login to the file server with a password that has expired"
5333
5334         errors[0xe000] = "No Login Connections Available"
5335         errors[0xe700] = "No disk track"
5336         errors[0xe800] = "Write to group"
5337         errors[0xe900] = "The object is already a member of the group property"
5338
5339         errors[0xea00] = "No such member"
5340         errors[0xea01] = "The bindery object is not a member of the set"
5341         errors[0xea02] = "Non-existent member"
5342
5343         errors[0xeb00] = "The property is not a set property"
5344
5345         errors[0xec00] = "No such set"
5346         errors[0xec01] = "The set property does not exist"
5347
5348         errors[0xed00] = "Property exists"
5349         errors[0xed01] = "The property already exists"
5350         errors[0xed02] = "An attempt was made to create a bindery object property that already exists"
5351
5352         errors[0xee00] = "The object already exists"
5353         errors[0xee01] = "The bindery object already exists"
5354
5355         errors[0xef00] = "Illegal name"
5356         errors[0xef01] = "Illegal characters in ObjectName field"
5357         errors[0xef02] = "Invalid name"
5358
5359         errors[0xf000] = "A wildcard was detected in a field that does not support wildcards"
5360         errors[0xf001] = "An illegal wildcard was detected in ObjectName"
5361
5362         errors[0xf100] = "The client does not have the rights to access this bindery object"
5363         errors[0xf101] = "Bindery security"
5364         errors[0xf102] = "Invalid bindery security"
5365
5366         errors[0xf200] = "Unauthorized to read from this object"
5367         errors[0xf300] = "Unauthorized to rename this object"
5368
5369         errors[0xf400] = "Unauthorized to delete this object"
5370         errors[0xf401] = "No object delete privileges"
5371         errors[0xf402] = "Unauthorized to delete this queue"
5372
5373         errors[0xf500] = "Unauthorized to create this object"
5374         errors[0xf501] = "No object create"
5375
5376         errors[0xf600] = "No property delete"
5377         errors[0xf601] = "Unauthorized to delete the property of this object"
5378         errors[0xf602] = "Unauthorized to delete this property"
5379
5380         errors[0xf700] = "Unauthorized to create this property"
5381         errors[0xf701] = "No property create privilege"
5382
5383         errors[0xf800] = "Unauthorized to write to this property"
5384         errors[0xf900] = "Unauthorized to read this property"
5385         errors[0xfa00] = "Temporary remap error"
5386
5387         errors[0xfb00] = "No such property"
5388         errors[0xfb01] = "The file server does not support this request"
5389         errors[0xfb02] = "The specified property does not exist"
5390         errors[0xfb03] = "The PASSWORD property does not exist for this bindery object"
5391         errors[0xfb04] = "NDS NCP not available"
5392         errors[0xfb05] = "Bad Directory Handle"
5393         errors[0xfb06] = "Unknown Request"
5394         errors[0xfb07] = "Invalid Subfunction Request"
5395         errors[0xfb08] = "Attempt to use an invalid parameter (drive number, path, or flag value) during a set drive path call"
5396
5397         errors[0xfc00] = "The message queue cannot accept another message"
5398         errors[0xfc01] = "The trustee associated with ObjectId does not exist"
5399         errors[0xfc02] = "The specified bindery object does not exist"
5400         errors[0xfc03] = "The bindery object associated with ObjectID does not exist"
5401         errors[0xfc04] = "A bindery object does not exist that matches"
5402         errors[0xfc05] = "The specified queue does not exist"
5403         errors[0xfc06] = "No such object"
5404         errors[0xfc07] = "The queue associated with ObjectID does not exist"
5405
5406         errors[0xfd00] = "Bad station number"
5407         errors[0xfd01] = "The connection associated with ConnectionNumber is not active"
5408         errors[0xfd02] = "Lock collision"
5409         errors[0xfd03] = "Transaction tracking is disabled"
5410
5411         errors[0xfe00] = "I/O failure"
5412         errors[0xfe01] = "The files containing the bindery on the file server are locked"
5413         errors[0xfe02] = "A file with the specified name already exists in this directory"
5414         errors[0xfe03] = "No more restrictions were found"
5415         errors[0xfe04] = "The file server was unable to lock the file within the specified time limit"
5416         errors[0xfe05] = "The file server was unable to lock all files within the specified time limit"
5417         errors[0xfe06] = "The bindery object associated with ObjectID is not a valid trustee"
5418         errors[0xfe07] = "Directory locked"
5419         errors[0xfe08] = "Bindery locked"
5420         errors[0xfe09] = "Invalid semaphore name length"
5421         errors[0xfe0a] = "The file server was unable to complete the operation within the specified time limit"
5422         errors[0xfe0b] = "Transaction restart"
5423         errors[0xfe0c] = "Bad packet"
5424         errors[0xfe0d] = "Timeout"
5425         errors[0xfe0e] = "User Not Found"
5426         errors[0xfe0f] = "Trustee Not Found"
5427
5428         errors[0xff00] = "Failure"
5429         errors[0xff01] = "Lock error"
5430         errors[0xff02] = "File not found"
5431         errors[0xff03] = "The file not found or cannot be unlocked"
5432         errors[0xff04] = "Record not found"
5433         errors[0xff05] = "The logical record was not found"
5434         errors[0xff06] = "The printer associated with PrinterNumber does not exist"
5435         errors[0xff07] = "No such printer"
5436         errors[0xff08] = "Unable to complete the request"
5437         errors[0xff09] = "Unauthorized to change privileges of this trustee"
5438         errors[0xff0a] = "No files matching the search criteria were found"
5439         errors[0xff0b] = "A file matching the search criteria was not found"
5440         errors[0xff0c] = "Verification failed"
5441         errors[0xff0d] = "Object associated with ObjectID is not a manager"
5442         errors[0xff0e] = "Invalid initial semaphore value"
5443         errors[0xff0f] = "The semaphore handle is not valid"
5444         errors[0xff10] = "SemaphoreHandle is not associated with a valid sempahore"
5445         errors[0xff11] = "Invalid semaphore handle"
5446         errors[0xff12] = "Transaction tracking is not available"
5447         errors[0xff13] = "The transaction has not yet been written to disk"
5448         errors[0xff14] = "Directory already exists"
5449         errors[0xff15] = "The file already exists and the deletion flag was not set"
5450         errors[0xff16] = "No matching files or directories were found"
5451         errors[0xff17] = "A file or directory matching the search criteria was not found"
5452         errors[0xff18] = "The file already exists"
5453         errors[0xff19] = "Failure, No files found"
5454         errors[0xff1a] = "Unlock Error"
5455         errors[0xff1b] = "I/O Bound Error"
5456         errors[0xff1c] = "Not Accepting Messages"
5457         errors[0xff1d] = "No More Salvageable Files in Directory"
5458         errors[0xff1e] = "Calling Station is Not a Manager"
5459         errors[0xff1f] = "Bindery Failure"
5460
5461
5462 ##############################################################################
5463 # Produce C code
5464 ##############################################################################
5465 def ExamineVars(vars, structs_hash, vars_hash):
5466         for var in vars:
5467                 if isinstance(var, struct):
5468                         structs_hash[var.HFName()] = var
5469                         struct_vars = var.Variables()
5470                         ExamineVars(struct_vars, structs_hash, vars_hash)
5471                 else:
5472                         vars_hash[repr(var)] = var
5473                         if isinstance(var, bitfield):
5474                                 sub_vars = var.SubVariables()
5475                                 ExamineVars(sub_vars, structs_hash, vars_hash)
5476
5477 def produce_code():
5478
5479         global errors
5480
5481         print "/*"
5482         print " * Generated automatically from %s" % (sys.argv[0])
5483         print " * Do not edit this file manually, as all changes will be lost."
5484         print " */\n"
5485
5486         print """
5487 /*
5488  * This program is free software; you can redistribute it and/or
5489  * modify it under the terms of the GNU General Public License
5490  * as published by the Free Software Foundation; either version 2
5491  * of the License, or (at your option) any later version.
5492  * 
5493  * This program is distributed in the hope that it will be useful,
5494  * but WITHOUT ANY WARRANTY; without even the implied warranty of
5495  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5496  * GNU General Public License for more details.
5497  * 
5498  * You should have received a copy of the GNU General Public License
5499  * along with this program; if not, write to the Free Software
5500  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
5501  */
5502
5503 #ifdef HAVE_CONFIG_H
5504 # include "config.h"
5505 #endif
5506
5507 #include <glib.h>
5508 #include <epan/packet.h>
5509 #include <epan/conversation.h>
5510 #include "ptvcursor.h"
5511 #include "packet-ncp-int.h"
5512
5513 /* Function declarations for functions used in proto_register_ncp2222() */
5514 static void ncp_init_protocol(void);
5515 static void ncp_postseq_cleanup(void);
5516
5517 /* Endianness macros */
5518 #define BE              0
5519 #define LE              1
5520 #define NO_ENDIANNESS   0
5521
5522 #define NO_LENGTH       -1
5523
5524 /* We use this int-pointer as a special flag in ptvc_record's */
5525 static int ptvc_struct_int_storage;
5526 #define PTVC_STRUCT     (&ptvc_struct_int_storage)
5527
5528 /* Values used in the count-variable ("var"/"repeat") logic. */"""
5529
5530
5531         if global_highest_var > -1:
5532                 print "#define NUM_REPEAT_VARS\t%d" % (global_highest_var + 1)
5533                 print "guint repeat_vars[NUM_REPEAT_VARS];",
5534         else:
5535                 print "#define NUM_REPEAT_VARS\t0"
5536                 print "guint *repeat_vars = NULL;",
5537
5538         print """
5539 #define NO_VAR          NUM_REPEAT_VARS
5540 #define NO_REPEAT       NUM_REPEAT_VARS
5541
5542 #define REQ_COND_SIZE_CONSTANT  0
5543 #define REQ_COND_SIZE_VARIABLE  1
5544 #define NO_REQ_COND_SIZE        0
5545
5546 static int hf_ncp_func = -1;
5547 static int hf_ncp_length = -1;
5548 static int hf_ncp_subfunc = -1;
5549 static int hf_ncp_completion_code = -1;
5550 static int hf_ncp_connection_status = -1;
5551 static int hf_ncp_req_frame_num = -1;
5552         """
5553
5554         # Look at all packet types in the packets collection, and cull information
5555         # from them.
5556         errors_used_list = []
5557         errors_used_hash = {}
5558         groups_used_list = []
5559         groups_used_hash = {}
5560         variables_used_hash = {}
5561         structs_used_hash = {}
5562
5563         for pkt in packets:
5564                 # Determine which error codes are used.
5565                 codes = pkt.CompletionCodes()
5566                 for code in codes.Records():
5567                         if not errors_used_hash.has_key(code):
5568                                 errors_used_hash[code] = len(errors_used_list)
5569                                 errors_used_list.append(code)
5570
5571                 # Determine which groups are used.
5572                 group = pkt.Group()
5573                 if not groups_used_hash.has_key(group):
5574                         groups_used_hash[group] = len(groups_used_list)
5575                         groups_used_list.append(group)
5576
5577                 # Determine which variables are used.
5578                 vars = pkt.Variables()
5579                 ExamineVars(vars, structs_used_hash, variables_used_hash)
5580
5581
5582         # Print the hf variable declarations
5583         sorted_vars = variables_used_hash.values()
5584         sorted_vars.sort()
5585         for var in sorted_vars:
5586                 print "static int " + var.HFName() + " = -1;"
5587
5588
5589         # Print the value_string's
5590         for var in sorted_vars:
5591                 if isinstance(var, val_string):
5592                         print ""
5593                         print var.Code()
5594
5595
5596         # Determine which error codes are not used
5597         errors_not_used = {}
5598         # Copy the keys from the error list...
5599         for code in errors.keys():
5600                 errors_not_used[code] = 1
5601         # ... and remove the ones that *were* used.
5602         for code in errors_used_list:
5603                 del errors_not_used[code]
5604
5605         # Print a remark showing errors not used
5606         list_errors_not_used = errors_not_used.keys()
5607         list_errors_not_used.sort()
5608         for code in list_errors_not_used:
5609                 print "/* Error 0x%04x not used: %s */" % (code, errors[code])
5610         print "\n"
5611
5612         # Print the errors table
5613         print "/* Error strings. */"
5614         print "static const char *ncp_errors[] = {"
5615         for code in errors_used_list:
5616                 print '\t/* %02d (0x%04x) */ "%s",' % (errors_used_hash[code], code, errors[code])
5617         print "};\n"
5618
5619
5620
5621
5622         # Determine which groups are not used
5623         groups_not_used = {}
5624         # Copy the keys from the group list...
5625         for group in groups.keys():
5626                 groups_not_used[group] = 1
5627         # ... and remove the ones that *were* used.
5628         for group in groups_used_list:
5629                 del groups_not_used[group]
5630
5631         # Print a remark showing groups not used
5632         list_groups_not_used = groups_not_used.keys()
5633         list_groups_not_used.sort()
5634         for group in list_groups_not_used:
5635                 print "/* Group not used: %s = %s */" % (group, groups[group])
5636         print "\n"
5637
5638         # Print the groups table
5639         print "/* Group strings. */"
5640         print "static const char *ncp_groups[] = {"
5641         for group in groups_used_list:
5642                 print '\t/* %02d (%s) */ "%s",' % (groups_used_hash[group], group, groups[group])
5643         print "};\n"
5644
5645         # Print the group macros
5646         for group in groups_used_list:
5647                 name = string.upper(group)
5648                 print "#define NCP_GROUP_%s\t%d" % (name, groups_used_hash[group])
5649         print "\n"
5650
5651
5652         # Print the conditional_records for all Request Conditions.
5653         num = 0
5654         print "/* Request-Condition dfilter records. The NULL pointer"
5655         print "   is replaced by a pointer to the created dfilter_t. */"
5656         if len(global_req_cond) == 0:
5657                 print "static conditional_record req_conds = NULL;"
5658         else:
5659                 print "static conditional_record req_conds[] = {"
5660                 for req_cond in global_req_cond.keys():
5661                         print "\t{ \"%s\", NULL }," % (req_cond,)
5662                         global_req_cond[req_cond] = num
5663                         num = num + 1
5664                 print "};"
5665         print "#define NUM_REQ_CONDS %d" % (num,)
5666         print "#define NO_REQ_COND   NUM_REQ_CONDS\n\n"
5667
5668
5669
5670         # Print PTVC's for bitfields
5671         ett_list = []
5672         print "/* PTVC records for bit-fields. */"
5673         for var in sorted_vars:
5674                 if isinstance(var, bitfield):
5675                         sub_vars_ptvc = var.SubVariablesPTVC()
5676                         print "/* %s */" % (sub_vars_ptvc.Name())
5677                         print sub_vars_ptvc.Code()
5678                         ett_list.append(sub_vars_ptvc.ETTName())
5679
5680
5681         # Print the PTVC's for structures
5682         print "/* PTVC records for structs. */"
5683         # Sort them
5684         svhash = {}
5685         for svar in structs_used_hash.values():
5686                 svhash[svar.HFName()] = svar
5687                 if svar.descr:
5688                         ett_list.append(svar.ETTName())
5689
5690         struct_vars = svhash.keys()
5691         struct_vars.sort()
5692         for varname in struct_vars:
5693                 var = svhash[varname]
5694                 print var.Code()
5695
5696         ett_list.sort()
5697
5698         # Print regular PTVC's
5699         print "/* PTVC records. These are re-used to save space. */"
5700         for ptvc in ptvc_lists.Members():
5701                 if not ptvc.Null() and not ptvc.Empty():
5702                         print ptvc.Code()
5703
5704         # Print error_equivalency tables
5705         print "/* Error-Equivalency Tables. These are re-used to save space. */"
5706         for compcodes in compcode_lists.Members():
5707                 errors = compcodes.Records()
5708                 # Make sure the record for error = 0x00 comes last.
5709                 print "static const error_equivalency %s[] = {" % (compcodes.Name())
5710                 for error in errors:
5711                         error_in_packet = error >> 8;
5712                         ncp_error_index = errors_used_hash[error]
5713                         print "\t{ 0x%02x, %d }, /* 0x%04x */" % (error_in_packet,
5714                                 ncp_error_index, error)
5715                 print "\t{ 0x00, -1 }\n};\n"
5716
5717
5718
5719         # Print integer arrays for all ncp_records that need
5720         # a list of req_cond_indexes. Do it "uniquely" to save space;
5721         # if multiple packets share the same set of req_cond's,
5722         # then they'll share the same integer array
5723         print "/* Request Condition Indexes */"
5724         # First, make them unique
5725         req_cond_collection = UniqueCollection("req_cond_collection")
5726         for pkt in packets:
5727                 req_conds = pkt.CalculateReqConds()
5728                 if req_conds:
5729                         unique_list = req_cond_collection.Add(req_conds)
5730                         pkt.SetReqConds(unique_list)
5731                 else:
5732                         pkt.SetReqConds(None)
5733
5734         # Print them
5735         for req_cond in req_cond_collection.Members():
5736                 print "static const int %s[] = {" % (req_cond.Name(),)
5737                 print "\t",
5738                 vals = []
5739                 for text in req_cond.Records():
5740                         vals.append(global_req_cond[text])
5741                 vals.sort()
5742                 for val in vals:
5743                         print "%s, " % (val,),
5744
5745                 print "-1 };"
5746                 print ""
5747
5748
5749
5750         # Functions without length parameter
5751         funcs_without_length = {}
5752
5753         # Print info string structures
5754         print "/* Info Strings */"
5755         for pkt in packets:
5756                 if pkt.req_info_str:
5757                         name = pkt.InfoStrName() + "_req"
5758                         var = pkt.req_info_str[0]
5759                         print "static const info_string_t %s = {" % (name,)
5760                         print "\t&%s," % (var.HFName(),)
5761                         print '\t"%s",' % (pkt.req_info_str[1],)
5762                         print '\t"%s"' % (pkt.req_info_str[2],)
5763                         print "};\n"
5764
5765
5766
5767         # Print ncp_record packet records
5768         print "#define SUBFUNC_WITH_LENGTH      0x02"
5769         print "#define SUBFUNC_NO_LENGTH        0x01"
5770         print "#define NO_SUBFUNC               0x00"
5771
5772         print "/* ncp_record structs for packets */"
5773         print "static const ncp_record ncp_packets[] = {"
5774         for pkt in packets:
5775                 if pkt.HasSubFunction():
5776                         func = pkt.FunctionCode('high')
5777                         if pkt.HasLength():
5778                                 subfunc_string = "SUBFUNC_WITH_LENGTH"
5779                                 # Ensure that the function either has a length param or not
5780                                 if funcs_without_length.has_key(func):
5781                                         sys.exit("Function 0x%04x sometimes has length param, sometimes not." \
5782                                                 % (pkt.FunctionCode(),))
5783                         else:
5784                                 subfunc_string = "SUBFUNC_NO_LENGTH"
5785                                 funcs_without_length[func] = 1
5786                 else:
5787                         subfunc_string = "NO_SUBFUNC"
5788                 print '\t{ 0x%02x, 0x%02x, %s, "%s",' % (pkt.FunctionCode('high'),
5789                         pkt.FunctionCode('low'), subfunc_string, pkt.Description()),
5790
5791                 print '\t%d /* %s */,' % (groups_used_hash[pkt.Group()], pkt.Group())
5792
5793                 ptvc = pkt.PTVCRequest()
5794                 if not ptvc.Null() and not ptvc.Empty():
5795                         ptvc_request = ptvc.Name()
5796                 else:
5797                         ptvc_request = 'NULL'
5798
5799                 ptvc = pkt.PTVCReply()
5800                 if not ptvc.Null() and not ptvc.Empty():
5801                         ptvc_reply = ptvc.Name()
5802                 else:
5803                         ptvc_reply = 'NULL'
5804
5805                 errors = pkt.CompletionCodes()
5806
5807                 req_conds_obj = pkt.GetReqConds()
5808                 if req_conds_obj:
5809                         req_conds = req_conds_obj.Name()
5810                 else:
5811                         req_conds = "NULL"
5812
5813                 if not req_conds_obj:
5814                         req_cond_size = "NO_REQ_COND_SIZE"
5815                 else:
5816                         req_cond_size = pkt.ReqCondSize()
5817                         if req_cond_size == None:
5818                                 msg.write("NCP packet %s nees a ReqCondSize*() call\n" \
5819                                         % (pkt.CName(),))
5820                                 sys.exit(1)
5821                 
5822                 if pkt.req_info_str:
5823                         req_info_str = "&" + pkt.InfoStrName() + "_req"
5824                 else:
5825                         req_info_str = "NULL"
5826
5827                 print '\t\t%s, %s, %s, %s, %s, %s },\n' % \
5828                         (ptvc_request, ptvc_reply, errors.Name(), req_conds,
5829                         req_cond_size, req_info_str)
5830
5831         print '\t{ 0, 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NO_REQ_COND_SIZE, NULL }'
5832         print "};\n"
5833
5834         print "/* ncp funcs that require a subfunc */"
5835         print "static const guint8 ncp_func_requires_subfunc[] = {"
5836         hi_seen = {}
5837         for pkt in packets:
5838                 if pkt.HasSubFunction():
5839                         hi_func = pkt.FunctionCode('high')
5840                         if not hi_seen.has_key(hi_func):
5841                                 print "\t0x%02x," % (hi_func)
5842                                 hi_seen[hi_func] = 1
5843         print "\t0"
5844         print "};\n"
5845
5846
5847         print "/* ncp funcs that have no length parameter */"
5848         print "static const guint8 ncp_func_has_no_length_parameter[] = {"
5849         funcs = funcs_without_length.keys()
5850         funcs.sort()
5851         for func in funcs:
5852                 print "\t0x%02x," % (func,)
5853         print "\t0"
5854         print "};\n"
5855
5856         # final_registration_ncp2222()
5857         print """
5858 void
5859 final_registration_ncp2222(void)
5860 {
5861         int i;
5862         """
5863
5864         # Create dfilter_t's for conditional_record's
5865         print """
5866         for (i = 0; i < NUM_REQ_CONDS; i++) {
5867                 if (!dfilter_compile((gchar*)req_conds[i].dfilter_text,
5868                         &req_conds[i].dfilter)) {
5869                         g_message("NCP dissector failed to compiler dfilter: %s\\n",
5870                         req_conds[i].dfilter_text);
5871                         g_assert_not_reached();
5872                 }
5873         }
5874 }
5875         """
5876
5877         # proto_register_ncp2222()
5878         print """
5879 void
5880 proto_register_ncp2222(void)
5881 {
5882
5883         static hf_register_info hf[] = {
5884         { &hf_ncp_func,
5885         { "Function", "ncp.func", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL }},
5886
5887         { &hf_ncp_length,
5888         { "Packet Length", "ncp.length", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }},
5889
5890         { &hf_ncp_subfunc,
5891         { "SubFunction", "ncp.subfunc", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL }},
5892
5893         { &hf_ncp_completion_code,
5894         { "Completion Code", "ncp.completion_code", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL }},
5895
5896         /*
5897          * XXX - the page at
5898          *
5899          *      http://www.odyssea.com/whats_new/tcpipnet/tcpipnet.html
5900          *
5901          * says of the connection status "The Connection Code field may
5902          * contain values that indicate the status of the client host to
5903          * server connection.  A value of 1 in the fourth bit of this data
5904          * byte indicates that the server is unavailable (server was
5905          * downed).
5906          *
5907          * The page at
5908          *
5909          *      http://www.unm.edu/~network/presentations/course/appendix/appendix_f/tsld088.htm
5910          *
5911          * says that bit 0 is "bad service", bit 2 is "no connection
5912          * available", bit 4 is "service down", and bit 6 is "server
5913          * has a broadcast message waiting for the client".
5914          *
5915          * Should it be displayed in hex, and should those bits (and any
5916          * other bits with significance) be displayed as bitfields
5917          * underneath it?
5918          */
5919         { &hf_ncp_connection_status,
5920         { "Connection Status", "ncp.connection_status", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL }},
5921
5922         { &hf_ncp_req_frame_num,
5923         { "Response to Request in Frame Number", "ncp.req_frame_num", FT_UINT32, BASE_DEC,
5924                 NULL, 0x0, "", HFILL }},
5925         """
5926
5927         # Print the registration code for the hf variables
5928         for var in sorted_vars:
5929                 print "\t{ &%s," % (var.HFName())
5930                 print "\t{ \"%s\", \"%s\", %s, %s, %s, 0x%x, \"\", HFILL }},\n" % \
5931                         (var.Description(), var.DFilter(),
5932                         var.EtherealFType(), var.Display(), var.ValuesName(),
5933                         var.Mask())
5934
5935         print "\t};\n"
5936
5937         if ett_list:
5938                 print "\tstatic gint *ett[] = {"
5939
5940                 for ett in ett_list:
5941                         print "\t\t&%s," % (ett,)
5942
5943                 print "\t};\n"
5944
5945         print """
5946         proto_register_field_array(proto_ncp, hf, array_length(hf));
5947         """
5948
5949         if ett_list:
5950                 print """
5951         proto_register_subtree_array(ett, array_length(ett));
5952                 """
5953
5954         print """
5955         register_init_routine(&ncp_init_protocol);
5956         register_postseq_cleanup_routine(&ncp_postseq_cleanup);
5957         register_final_registration_routine(final_registration_ncp2222);
5958         """
5959
5960         
5961         # End of proto_register_ncp2222()
5962         print "}"
5963         print ""
5964         print '#include "packet-ncp2222.inc"'
5965
5966 def usage():
5967         print "Usage: ncp2222.py -o output_file"
5968         sys.exit(1)
5969
5970 def main():
5971         global compcode_lists
5972         global ptvc_lists
5973         global msg
5974
5975         optstring = "o:"
5976         out_filename = None
5977
5978         try:
5979                 opts, args = getopt.getopt(sys.argv[1:], optstring)
5980         except getopt.error:
5981                 usage()
5982
5983         for opt, arg in opts:
5984                 if opt == "-o":
5985                         out_filename = arg
5986                 else:
5987                         usage()
5988
5989         if len(args) != 0:
5990                 usage()
5991
5992         if not out_filename:
5993                 usage()
5994
5995         # Create the output file
5996         try:
5997                 out_file = open(out_filename, "w")
5998         except IOError, err:
5999                 sys.exit("Could not open %s for writing: %s" % (out_filename,
6000                         err))
6001
6002         # Set msg to current stdout
6003         msg = sys.stdout
6004
6005         # Set stdout to the output file
6006         sys.stdout = out_file
6007
6008         msg.write("Processing NCP definitions...\n")
6009         # Run the code, and if we catch any exception,
6010         # erase the output file.
6011         try:
6012                 compcode_lists  = UniqueCollection('Completion Code Lists')
6013                 ptvc_lists      = UniqueCollection('PTVC Lists')
6014
6015                 define_errors()
6016                 define_groups()
6017                 define_ncp2222()
6018
6019                 msg.write("Defined %d NCP types.\n" % (len(packets),))
6020                 produce_code()
6021         except:
6022                 traceback.print_exc(20, msg)
6023                 try:
6024                         out_file.close()
6025                 except IOError, err:
6026                         msg.write("Could not close %s: %s\n" % (out_filename, err))
6027
6028                 try:
6029                         if os.path.exists(out_filename):
6030                                 os.remove(out_filename)
6031                 except OSError, err:
6032                         msg.write("Could not remove %s: %s\n" % (out_filename, err))
6033
6034                 sys.exit(1)
6035
6036
6037
6038 def define_ncp2222():
6039         ##############################################################################
6040         # NCP Packets. Here I list functions and subfunctions in hexadecimal like the
6041         # NCP book (and I believe LanAlyzer does this too).
6042         # However, Novell lists these in decimal in their on-line documentation.
6043         ##############################################################################
6044         # 2222/01
6045         pkt = NCP(0x01, "File Set Lock", 'file')
6046         pkt.Request(7)
6047         pkt.Reply(8)
6048         pkt.CompletionCodes([0x0000])
6049         # 2222/02
6050         pkt = NCP(0x02, "File Release Lock", 'file')
6051         pkt.Request(7)
6052         pkt.Reply(8)
6053         pkt.CompletionCodes([0x0000, 0xff00])
6054         # 2222/03
6055         pkt = NCP(0x03, "Log File Exclusive", 'file')
6056         pkt.Request( (12, 267), [
6057                 rec( 7, 1, DirHandle ),
6058                 rec( 8, 1, LockFlag ),
6059                 rec( 9, 2, TimeoutLimit, BE ),
6060                 rec( 11, (1, 256), FilePath ),
6061         ], info_str=(FilePath, "Lock Exclusive: %s", ", %s"))
6062         pkt.Reply(8)
6063         pkt.CompletionCodes([0x0000, 0x8200, 0x9600, 0xfe0d, 0xff01])
6064         # 2222/04
6065         pkt = NCP(0x04, "Lock File Set", 'file')
6066         pkt.Request( 9, [
6067                 rec( 7, 2, TimeoutLimit ),
6068         ])
6069         pkt.Reply(8)
6070         pkt.CompletionCodes([0x0000, 0xfe0d, 0xff01])
6071         ## 2222/05
6072         pkt = NCP(0x05, "Release File", 'file')
6073         pkt.Request( (9, 264), [
6074                 rec( 7, 1, DirHandle ),
6075                 rec( 8, (1, 256), FilePath ),
6076         ], info_str=(FilePath, "Release File: %s", ", %s"))
6077         pkt.Reply(8)
6078         pkt.CompletionCodes([0x0000, 0x9b00, 0x9c03, 0xff1a])
6079         # 2222/06
6080         pkt = NCP(0x06, "Release File Set", 'file')
6081         pkt.Request( 8, [
6082                 rec( 7, 1, LockFlag ),
6083         ])
6084         pkt.Reply(8)
6085         pkt.CompletionCodes([0x0000])
6086         # 2222/07
6087         pkt = NCP(0x07, "Clear File", 'file')
6088         pkt.Request( (9, 264), [
6089                 rec( 7, 1, DirHandle ),
6090                 rec( 8, (1, 256), FilePath ),
6091         ], info_str=(FilePath, "Clear File: %s", ", %s"))
6092         pkt.Reply(8)
6093         pkt.CompletionCodes([0x0000, 0x9600, 0x9804, 0x9b03, 0x9c03,
6094                 0xa100, 0xfd00, 0xff1a])
6095         # 2222/08
6096         pkt = NCP(0x08, "Clear File Set", 'file')
6097         pkt.Request( 8, [
6098                 rec( 7, 1, LockFlag ),
6099         ])
6100         pkt.Reply(8)
6101         pkt.CompletionCodes([0x0000])
6102         # 2222/09
6103         pkt = NCP(0x09, "Log Logical Record", 'file')
6104         pkt.Request( (11, 138), [
6105                 rec( 7, 1, LockFlag ),
6106                 rec( 8, 2, TimeoutLimit, BE ),
6107                 rec( 10, (1, 128), LogicalRecordName ),
6108         ], info_str=(LogicalRecordName, "Log Logical Record: %s", ", %s"))
6109         pkt.Reply(8)
6110         pkt.CompletionCodes([0x0000, 0x9600, 0xfe0d, 0xff1a])
6111         # 2222/0A, 10
6112         pkt = NCP(0x0A, "Lock Logical Record Set", 'file')
6113         pkt.Request( 10, [
6114                 rec( 7, 1, LockFlag ),
6115                 rec( 8, 2, TimeoutLimit ),
6116         ])
6117         pkt.Reply(8)
6118         pkt.CompletionCodes([0x0000, 0xfe0d, 0xff1a])
6119         # 2222/0B, 11
6120         pkt = NCP(0x0B, "Clear Logical Record", 'file')
6121         pkt.Request( (8, 135), [
6122                 rec( 7, (1, 128), LogicalRecordName ),
6123         ], info_str=(LogicalRecordName, "Clear Logical Record: %s", ", %s"))
6124         pkt.Reply(8)
6125         pkt.CompletionCodes([0x0000, 0xff1a])
6126         # 2222/0C, 12
6127         pkt = NCP(0x0C, "Release Logical Record", 'file')
6128         pkt.Request( (8, 135), [
6129                 rec( 7, (1, 128), LogicalRecordName ),
6130         ], info_str=(LogicalRecordName, "Release Logical Record: %s", ", %s"))
6131         pkt.Reply(8)
6132         pkt.CompletionCodes([0x0000, 0xff1a])
6133         # 2222/0D, 13
6134         pkt = NCP(0x0D, "Release Logical Record Set", 'file')
6135         pkt.Request( 8, [
6136                 rec( 7, 1, LockFlag ),
6137         ])
6138         pkt.Reply(8)
6139         pkt.CompletionCodes([0x0000])
6140         # 2222/0E, 14
6141         pkt = NCP(0x0E, "Clear Logical Record Set", 'file')
6142         pkt.Request( 8, [
6143                 rec( 7, 1, LockFlag ),
6144         ])
6145         pkt.Reply(8)
6146         pkt.CompletionCodes([0x0000])
6147         # 2222/1100, 17/00
6148         pkt = NCP(0x1100, "Write to Spool File", 'qms')
6149         pkt.Request( (11, 16), [
6150                 rec( 10, ( 1, 6 ), Data ),
6151         ], info_str=(Data, "Write to Spool File: %s", ", %s"))
6152         pkt.Reply(8)
6153         pkt.CompletionCodes([0x0000, 0x0104, 0x8000, 0x8101, 0x8701, 0x8800,
6154                              0x8d00, 0x8e00, 0x8f00, 0x9001, 0x9400, 0x9500,
6155                              0x9600, 0x9804, 0x9900, 0xa100, 0xa201, 0xff19])
6156         # 2222/1101, 17/01
6157         pkt = NCP(0x1101, "Close Spool File", 'qms')
6158         pkt.Request( 11, [
6159                 rec( 10, 1, AbortQueueFlag ),
6160         ])
6161         pkt.Reply(8)
6162         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8701, 0x8800, 0x8d00,
6163                              0x8e00, 0x8f00, 0x9001, 0x9300, 0x9400, 0x9500,
6164                              0x9600, 0x9804, 0x9900, 0x9b03, 0x9c03, 0x9d00,
6165                              0xa100, 0xd000, 0xd100, 0xd202, 0xd300, 0xd400,
6166                              0xda01, 0xe800, 0xea00, 0xeb00, 0xec00, 0xfc06,
6167                              0xfd00, 0xfe07, 0xff06])
6168         # 2222/1102, 17/02
6169         pkt = NCP(0x1102, "Set Spool File Flags", 'qms')
6170         pkt.Request( 30, [
6171                 rec( 10, 1, PrintFlags ),
6172                 rec( 11, 1, TabSize ),
6173                 rec( 12, 1, TargetPrinter ),
6174                 rec( 13, 1, Copies ),
6175                 rec( 14, 1, FormType ),
6176                 rec( 15, 1, Reserved ),
6177                 rec( 16, 14, BannerName ),
6178         ])
6179         pkt.Reply(8)
6180         pkt.CompletionCodes([0x0000, 0x9600, 0xd202, 0xd300, 0xe800, 0xea00,
6181                              0xeb00, 0xec00, 0xfc06, 0xfe07, 0xff06])
6182
6183         # 2222/1103, 17/03
6184         pkt = NCP(0x1103, "Spool A Disk File", 'qms')
6185         pkt.Request( (12, 23), [
6186                 rec( 10, 1, DirHandle ),
6187                 rec( 11, (1, 12), Data ),
6188         ], info_str=(Data, "Spool a Disk File: %s", ", %s"))
6189         pkt.Reply(8)
6190         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8701, 0x8800, 0x8d00,
6191                              0x8e00, 0x8f00, 0x9001, 0x9300, 0x9400, 0x9500,
6192                              0x9600, 0x9804, 0x9900, 0x9b03, 0x9c03, 0x9d00,
6193                              0xa100, 0xd000, 0xd100, 0xd202, 0xd300, 0xd400,
6194                              0xda01, 0xe800, 0xea00, 0xeb00, 0xec00, 0xfc06,
6195                              0xfd00, 0xfe07, 0xff06])
6196
6197         # 2222/1106, 17/06
6198         pkt = NCP(0x1106, "Get Printer Status", 'qms')
6199         pkt.Request( 11, [
6200                 rec( 10, 1, TargetPrinter ),
6201         ])
6202         pkt.Reply(12, [
6203                 rec( 8, 1, PrinterHalted ),
6204                 rec( 9, 1, PrinterOffLine ),
6205                 rec( 10, 1, CurrentFormType ),
6206                 rec( 11, 1, RedirectedPrinter ),
6207         ])
6208         pkt.CompletionCodes([0x0000, 0x9600, 0xfb05, 0xfd00, 0xff06])
6209
6210         # 2222/1109, 17/09
6211         pkt = NCP(0x1109, "Create Spool File", 'qms')
6212         pkt.Request( (12, 23), [
6213                 rec( 10, 1, DirHandle ),
6214                 rec( 11, (1, 12), Data ),
6215         ], info_str=(Data, "Create Spool File: %s", ", %s"))
6216         pkt.Reply(8)
6217         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8400, 0x8701, 0x8d00,
6218                              0x8f00, 0x9001, 0x9400, 0x9600, 0x9804, 0x9900,
6219                              0x9b03, 0x9c03, 0xa100, 0xd000, 0xd100, 0xd202,
6220                              0xd300, 0xd400, 0xda01, 0xe800, 0xea00, 0xeb00,
6221                              0xec00, 0xfc06, 0xfd00, 0xfe07, 0xff06])
6222
6223         # 2222/110A, 17/10
6224         pkt = NCP(0x110A, "Get Printer's Queue", 'qms')
6225         pkt.Request( 11, [
6226                 rec( 10, 1, TargetPrinter ),
6227         ])
6228         pkt.Reply( 12, [
6229                 rec( 8, 4, ObjectID, BE ),
6230         ])
6231         pkt.CompletionCodes([0x0000, 0x9600, 0xff06])
6232
6233         # 2222/12, 18
6234         pkt = NCP(0x12, "Get Volume Info with Number", 'file')
6235         pkt.Request( 8, [
6236                 rec( 8, 1, VolumeNumber )
6237         ])
6238         pkt.Reply( 36, [
6239                 rec( 8, 2, SectorsPerCluster, BE ),
6240                 rec( 10, 2, TotalVolumeClusters, BE ),
6241                 rec( 12, 2, AvailableClusters, BE ),
6242                 rec( 14, 2, TotalDirectorySlots, BE ),
6243                 rec( 16, 2, AvailableDirectorySlots, BE ),
6244                 rec( 18, 16, VolumeName ),
6245                 rec( 34, 2, RemovableFlag, BE ),
6246         ])
6247         pkt.CompletionCodes([0x0000, 0x9804])
6248
6249         # 2222/13, 19
6250         pkt = NCP(0x13, "Get Station Number", 'connection')
6251         pkt.Request(7)
6252         pkt.Reply(11, [
6253                 rec( 8, 3, StationNumber )
6254         ])
6255         pkt.CompletionCodes([0x0000, 0xff00])
6256
6257         # 2222/14, 20
6258         pkt = NCP(0x14, "Get File Server Date And Time", 'fileserver')
6259         pkt.Request(7)
6260         pkt.Reply(15, [
6261                 rec( 8, 1, Year ),
6262                 rec( 9, 1, Month ),
6263                 rec( 10, 1, Day ),
6264                 rec( 11, 1, Hour ),
6265                 rec( 12, 1, Minute ),
6266                 rec( 13, 1, Second ),
6267                 rec( 14, 1, DayOfWeek ),
6268         ])
6269         pkt.CompletionCodes([0x0000])
6270
6271         # 2222/1500, 21/00
6272         pkt = NCP(0x1500, "Send Broadcast Message", 'message')
6273         pkt.Request((13, 70), [
6274                 rec( 10, 1, ClientListLen, var="x" ),
6275                 rec( 11, 1, TargetClientList, repeat="x" ),
6276                 rec( 12, (1, 58), TargetMessage ),
6277         ], info_str=(TargetMessage, "Send Broadcast Message: %s", ", %s"))
6278         pkt.Reply(10, [
6279                 rec( 8, 1, ClientListLen, var="x" ),
6280                 rec( 9, 1, SendStatus, repeat="x" )
6281         ])
6282         pkt.CompletionCodes([0x0000, 0xfd00])
6283
6284         # 2222/1501, 21/01
6285         pkt = NCP(0x1501, "Get Broadcast Message", 'message')
6286         pkt.Request(10)
6287         pkt.Reply((9,66), [
6288                 rec( 8, (1, 58), TargetMessage )
6289         ])
6290         pkt.CompletionCodes([0x0000, 0xfd00])
6291
6292         # 2222/1502, 21/02
6293         pkt = NCP(0x1502, "Disable Broadcasts", 'message')
6294         pkt.Request(10)
6295         pkt.Reply(8)
6296         pkt.CompletionCodes([0x0000])
6297
6298         # 2222/1503, 21/03
6299         pkt = NCP(0x1503, "Enable Broadcasts", 'message')
6300         pkt.Request(10)
6301         pkt.Reply(8)
6302         pkt.CompletionCodes([0x0000])
6303
6304         # 2222/1509, 21/09
6305         pkt = NCP(0x1509, "Broadcast To Console", 'message')
6306         pkt.Request((11, 68), [
6307                 rec( 10, (1, 58), TargetMessage )
6308         ], info_str=(TargetMessage, "Broadcast to Console: %s", ", %s"))
6309         pkt.Reply(8)
6310         pkt.CompletionCodes([0x0000])
6311         # 2222/150A, 21/10
6312         pkt = NCP(0x150A, "Send Broadcast Message", 'message')
6313         pkt.Request((17, 74), [
6314                 rec( 10, 2, ClientListCount, LE, var="x" ),
6315                 rec( 12, 4, ClientList, LE, repeat="x" ),
6316                 rec( 16, (1, 58), TargetMessage ),
6317         ], info_str=(TargetMessage, "Send Broadcast Message: %s", ", %s"))
6318         pkt.Reply(14, [
6319                 rec( 8, 2, ClientListCount, LE, var="x" ),
6320                 rec( 10, 4, ClientCompFlag, LE, repeat="x" ),
6321         ])
6322         pkt.CompletionCodes([0x0000, 0xfd00])
6323
6324         # 2222/150B, 21/11
6325         pkt = NCP(0x150B, "Get Broadcast Message", 'message')
6326         pkt.Request(10)
6327         pkt.Reply((9,66), [
6328                 rec( 8, (1, 58), TargetMessage )
6329         ])
6330         pkt.CompletionCodes([0x0000, 0xfd00])
6331
6332         # 2222/150C, 21/12
6333         pkt = NCP(0x150C, "Connection Message Control", 'message')
6334         pkt.Request(22, [
6335                 rec( 10, 1, ConnectionControlBits ),
6336                 rec( 11, 3, Reserved3 ),
6337                 rec( 14, 4, ConnectionListCount, LE, var="x" ),
6338                 rec( 18, 4, ConnectionList, LE, repeat="x" ),
6339         ])
6340         pkt.Reply(8)
6341         pkt.CompletionCodes([0x0000, 0xff00])
6342
6343         # 2222/1600, 22/0
6344         pkt = NCP(0x1600, "Set Directory Handle", 'fileserver')
6345         pkt.Request((13,267), [
6346                 rec( 10, 1, TargetDirHandle ),
6347                 rec( 11, 1, DirHandle ),
6348                 rec( 12, (1, 255), Path ),
6349         ], info_str=(Path, "Set Directory Handle to: %s", ", %s"))
6350         pkt.Reply(8)
6351         pkt.CompletionCodes([0x0000, 0x9600, 0x9804, 0x9b03, 0x9c03, 0xa100, 0xfa00,
6352                              0xfd00, 0xff00])
6353
6354
6355         # 2222/1601, 22/1
6356         pkt = NCP(0x1601, "Get Directory Path", 'fileserver')
6357         pkt.Request(11, [
6358                 rec( 10, 1, DirHandle ),
6359         ])
6360         pkt.Reply((9,263), [
6361                 rec( 8, (1,255), Path ),
6362         ])
6363         pkt.CompletionCodes([0x0000, 0x9600, 0x9b00, 0x9c00, 0xa100])
6364
6365         # 2222/1602, 22/2
6366         pkt = NCP(0x1602, "Scan Directory Information", 'fileserver')
6367         pkt.Request((14,268), [
6368                 rec( 10, 1, DirHandle ),
6369                 rec( 11, 2, StartingSearchNumber, BE ),
6370                 rec( 13, (1, 255), Path ),
6371         ], info_str=(Path, "Scan Directory Information: %s", ", %s"))
6372         pkt.Reply(36, [
6373                 rec( 8, 16, DirectoryPath ),
6374                 rec( 24, 2, CreationDate, BE ),
6375                 rec( 26, 2, CreationTime, BE ),
6376                 rec( 28, 4, CreatorID, BE ),
6377                 rec( 32, 1, AccessRightsMask ),
6378                 rec( 33, 1, Reserved ),
6379                 rec( 34, 2, NextSearchNumber, BE ),
6380         ])
6381         pkt.CompletionCodes([0x0000, 0x9600, 0x9804, 0x9b03, 0x9c03, 0xa100, 0xfa00,
6382                              0xfd00, 0xff00])
6383
6384         # 2222/1603, 22/3
6385         pkt = NCP(0x1603, "Get Effective Directory Rights", 'fileserver')
6386         pkt.Request((14,268), [
6387                 rec( 10, 1, DirHandle ),
6388                 rec( 11, 2, StartingSearchNumber ),
6389                 rec( 13, (1, 255), Path ),
6390         ], info_str=(Path, "Get Effective Directory Rights: %s", ", %s"))
6391         pkt.Reply(9, [
6392                 rec( 8, 1, AccessRightsMask ),
6393         ])
6394         pkt.CompletionCodes([0x0000, 0x9600, 0x9804, 0x9b03, 0x9c03, 0xa100, 0xfa00,
6395                              0xfd00, 0xff00])
6396
6397         # 2222/1604, 22/4
6398         pkt = NCP(0x1604, "Modify Maximum Rights Mask", 'fileserver')
6399         pkt.Request((14,268), [
6400                 rec( 10, 1, DirHandle ),
6401                 rec( 11, 1, RightsGrantMask ),
6402                 rec( 12, 1, RightsRevokeMask ),
6403                 rec( 13, (1, 255), Path ),
6404         ], info_str=(Path, "Modify Maximum Rights Mask: %s", ", %s"))
6405         pkt.Reply(8)
6406         pkt.CompletionCodes([0x0000, 0x8c00, 0x9600, 0x9804, 0x9b03, 0x9c03, 0xa100, 0xfa00,
6407                              0xfd00, 0xff00])
6408
6409         # 2222/1605, 22/5
6410         pkt = NCP(0x1605, "Get Volume Number", 'fileserver')
6411         pkt.Request((11, 265), [
6412                 rec( 10, (1,255), VolumeNameLen ),
6413         ], info_str=(VolumeNameLen, "Get Volume Number for: %s", ", %s"))
6414         pkt.Reply(9, [
6415                 rec( 8, 1, VolumeNumber ),
6416         ])
6417         pkt.CompletionCodes([0x0000, 0x9600, 0x9804])
6418
6419         # 2222/1606, 22/6
6420         pkt = NCP(0x1606, "Get Volume Name", 'fileserver')
6421         pkt.Request(11, [
6422                 rec( 10, 1, VolumeNumber ),
6423         ])
6424         pkt.Reply((9, 263), [
6425                 rec( 8, (1,255), VolumeNameLen ),
6426         ])
6427         pkt.CompletionCodes([0x0000, 0x9600, 0x9804, 0xff00])
6428
6429         # 2222/160A, 22/10
6430         pkt = NCP(0x160A, "Create Directory", 'fileserver')
6431         pkt.Request((13,267), [
6432                 rec( 10, 1, DirHandle ),
6433                 rec( 11, 1, AccessRightsMask ),
6434                 rec( 12, (1, 255), Path ),
6435         ], info_str=(Path, "Create Directory: %s", ", %s"))
6436         pkt.Reply(8)
6437         pkt.CompletionCodes([0x0000, 0x8400, 0x9600, 0x9804, 0x9900, 0x9b03, 0x9c03,
6438                              0x9e00, 0xa100, 0xfd00, 0xff00])
6439
6440         # 2222/160B, 22/11
6441         pkt = NCP(0x160B, "Delete Directory", 'fileserver')
6442         pkt.Request((13,267), [
6443                 rec( 10, 1, DirHandle ),
6444                 rec( 11, 1, Reserved ),
6445                 rec( 12, (1, 255), Path ),
6446         ], info_str=(Path, "Delete Directory: %s", ", %s"))
6447         pkt.Reply(8)
6448         pkt.CompletionCodes([0x0000, 0x8a00, 0x9600, 0x9804, 0x9b03, 0x9c03,
6449                              0x9f00, 0xa000, 0xa100, 0xfd00, 0xff00])
6450
6451         # 2222/160C, 22/12
6452         pkt = NCP(0x160C, "Scan Directory for Trustees", 'fileserver')
6453         pkt.Request((13,267), [
6454                 rec( 10, 1, DirHandle ),
6455                 rec( 11, 1, TrusteeSetNumber ),
6456                 rec( 12, (1, 255), Path ),
6457         ], info_str=(Path, "Scan Directory for Trustees: %s", ", %s"))
6458         pkt.Reply(57, [
6459                 rec( 8, 16, DirectoryPath ),
6460                 rec( 24, 2, CreationDate, BE ),
6461                 rec( 26, 2, CreationTime, BE ),
6462                 rec( 28, 4, CreatorID ),
6463                 rec( 32, 4, TrusteeID, BE ),
6464                 rec( 36, 4, TrusteeID, BE ),
6465                 rec( 40, 4, TrusteeID, BE ),
6466                 rec( 44, 4, TrusteeID, BE ),
6467                 rec( 48, 4, TrusteeID, BE ),
6468                 rec( 52, 1, AccessRightsMask ),
6469                 rec( 53, 1, AccessRightsMask ),
6470                 rec( 54, 1, AccessRightsMask ),
6471                 rec( 55, 1, AccessRightsMask ),
6472                 rec( 56, 1, AccessRightsMask ),
6473         ])
6474         pkt.CompletionCodes([0x0000, 0x8c00, 0x9600, 0x9804, 0x9b03, 0x9c03,
6475                              0xa100, 0xfd00, 0xff00])
6476
6477         # 2222/160D, 22/13
6478         pkt = NCP(0x160D, "Add Trustee to Directory", 'fileserver')
6479         pkt.Request((17,271), [
6480                 rec( 10, 1, DirHandle ),
6481                 rec( 11, 4, TrusteeID, BE ),
6482                 rec( 15, 1, AccessRightsMask ),
6483                 rec( 16, (1, 255), Path ),
6484         ], info_str=(Path, "Add Trustee to Directory: %s", ", %s"))
6485         pkt.Reply(8)
6486         pkt.CompletionCodes([0x0000, 0x8c00, 0x9600, 0x9804, 0x9900, 0x9b03, 0x9c03,
6487                              0xa100, 0xfc06, 0xfd00, 0xff00])
6488
6489         # 2222/160E, 22/14
6490         pkt = NCP(0x160E, "Delete Trustee from Directory", 'fileserver')
6491         pkt.Request((17,271), [
6492                 rec( 10, 1, DirHandle ),
6493                 rec( 11, 4, TrusteeID, BE ),
6494                 rec( 15, 1, Reserved ),
6495                 rec( 16, (1, 255), Path ),
6496         ], info_str=(Path, "Delete Trustee from Directory: %s", ", %s"))
6497         pkt.Reply(8)
6498         pkt.CompletionCodes([0x0000, 0x8c00, 0x9600, 0x9804, 0x9900, 0x9b03, 0x9c03,
6499                              0xa100, 0xfc06, 0xfd00, 0xfe07, 0xff00])
6500
6501         # 2222/160F, 22/15
6502         pkt = NCP(0x160F, "Rename Directory", 'fileserver')
6503         pkt.Request((13, 521), [
6504                 rec( 10, 1, DirHandle ),
6505                 rec( 11, (1, 255), Path ),
6506                 rec( -1, (1, 255), NewPath ),
6507         ], info_str=(Path, "Rename Directory: %s", ", %s"))
6508         pkt.Reply(8)
6509         pkt.CompletionCodes([0x0000, 0x8b00, 0x9200, 0x9600, 0x9804, 0x9b03, 0x9c03,
6510                              0x9e00, 0xa100, 0xef00, 0xfd00, 0xff00])
6511
6512         # 2222/1610, 22/16
6513         pkt = NCP(0x1610, "Purge Erased Files", 'file')
6514         pkt.Request(10)
6515         pkt.Reply(8)
6516         pkt.CompletionCodes([0x0000, 0x8100, 0x9600, 0x9804, 0xa100, 0xff00])
6517
6518         # 2222/1611, 22/17
6519         pkt = NCP(0x1611, "Recover Erased File", 'fileserver')
6520         pkt.Request(11, [
6521                 rec( 10, 1, DirHandle ),
6522         ])
6523         pkt.Reply(38, [
6524                 rec( 8, 15, OldFileName ),
6525                 rec( 23, 15, NewFileName ),
6526         ])
6527         pkt.CompletionCodes([0x0000, 0x9600, 0x9804, 0x9b03, 0x9c03,
6528                              0xa100, 0xfd00, 0xff00])
6529         # 2222/1612, 22/18
6530         pkt = NCP(0x1612, "Alloc Permanent Directory Handle", 'fileserver')
6531         pkt.Request((13, 267), [
6532                 rec( 10, 1, DirHandle ),
6533                 rec( 11, 1, DirHandleName ),
6534                 rec( 12, (1,255), Path ),
6535         ], info_str=(Path, "Allocate Permanent Directory Handle: %s", ", %s"))
6536         pkt.Reply(10, [
6537                 rec( 8, 1, DirHandle ),
6538                 rec( 9, 1, AccessRightsMask ),
6539         ])
6540         pkt.CompletionCodes([0x0000, 0x9600, 0x9804, 0x9900, 0x9c03, 0x9d00,
6541                              0xa100, 0xfd00, 0xff00])
6542         # 2222/1613, 22/19
6543         pkt = NCP(0x1613, "Alloc Temporary Directory Handle", 'fileserver')
6544         pkt.Request((13, 267), [
6545                 rec( 10, 1, DirHandle ),
6546                 rec( 11, 1, DirHandleName ),
6547                 rec( 12, (1,255), Path ),
6548         ], info_str=(Path, "Allocate Temporary Directory Handle: %s", ", %s"))
6549         pkt.Reply(10, [
6550                 rec( 8, 1, DirHandle ),
6551                 rec( 9, 1, AccessRightsMask ),
6552         ])
6553         pkt.CompletionCodes([0x0000, 0x9600, 0x9804, 0x9900, 0x9c03, 0x9d00,
6554                              0xa100, 0xfd00, 0xff00])
6555         # 2222/1614, 22/20
6556         pkt = NCP(0x1614, "Deallocate Directory Handle", 'fileserver')
6557         pkt.Request(11, [
6558                 rec( 10, 1, DirHandle ),
6559         ])
6560         pkt.Reply(8)
6561         pkt.CompletionCodes([0x0000, 0x9b03])
6562         # 2222/1615, 22/21
6563         pkt = NCP(0x1615, "Get Volume Info with Handle", 'file')
6564         pkt.Request( 11, [
6565                 rec( 10, 1, DirHandle )
6566         ])
6567         pkt.Reply( 36, [
6568                 rec( 8, 2, SectorsPerCluster, BE ),
6569                 rec( 10, 2, TotalVolumeClusters, BE ),
6570                 rec( 12, 2, AvailableClusters, BE ),
6571                 rec( 14, 2, TotalDirectorySlots, BE ),
6572                 rec( 16, 2, AvailableDirectorySlots, BE ),
6573                 rec( 18, 16, VolumeName ),
6574                 rec( 34, 2, RemovableFlag, BE ),
6575         ])
6576         pkt.CompletionCodes([0x0000, 0xff00])
6577         # 2222/1616, 22/22
6578         pkt = NCP(0x1616, "Alloc Special Temporary Directory Handle", 'fileserver')
6579         pkt.Request((13, 267), [
6580                 rec( 10, 1, DirHandle ),
6581                 rec( 11, 1, DirHandleName ),
6582                 rec( 12, (1,255), Path ),
6583         ], info_str=(Path, "Allocate Special Temporary Directory Handle: %s", ", %s"))
6584         pkt.Reply(10, [
6585                 rec( 8, 1, DirHandle ),
6586                 rec( 9, 1, AccessRightsMask ),
6587         ])
6588         pkt.CompletionCodes([0x0000, 0x9600, 0x9804, 0x9900, 0x9c03, 0x9d00,
6589                              0xa100, 0xfd00, 0xff00])
6590         # 2222/1617, 22/23
6591         pkt = NCP(0x1617, "Extract a Base Handle", 'fileserver')
6592         pkt.Request(11, [
6593                 rec( 10, 1, DirHandle ),
6594         ])
6595         pkt.Reply(22, [
6596                 rec( 8, 10, ServerNetworkAddress ),
6597                 rec( 18, 4, DirHandleLong ),
6598         ])
6599         pkt.CompletionCodes([0x0000, 0x9600, 0x9b03])
6600         # 2222/1618, 22/24
6601         pkt = NCP(0x1618, "Restore an Extracted Base Handle", 'fileserver')
6602         pkt.Request(24, [
6603                 rec( 10, 10, ServerNetworkAddress ),
6604                 rec( 20, 4, DirHandleLong ),
6605         ])
6606         pkt.Reply(10, [
6607                 rec( 8, 1, DirHandle ),
6608                 rec( 9, 1, AccessRightsMask ),
6609         ])
6610         pkt.CompletionCodes([0x0000, 0x9600, 0x9804, 0x9b03, 0x9c00, 0x9d00, 0xa100,
6611                              0xfd00, 0xff00])
6612         # 2222/1619, 22/25
6613         pkt = NCP(0x1619, "Set Directory Information", 'fileserver')
6614         pkt.Request((21, 275), [
6615                 rec( 10, 1, DirHandle ),
6616                 rec( 11, 2, CreationDate ),
6617                 rec( 13, 2, CreationTime ),
6618                 rec( 15, 4, CreatorID, BE ),
6619                 rec( 19, 1, AccessRightsMask ),
6620                 rec( 20, (1,255), Path ),
6621         ], info_str=(Path, "Set Directory Information: %s", ", %s"))
6622         pkt.Reply(8)
6623         pkt.CompletionCodes([0x0000, 0x8c00, 0x9600, 0x9804, 0x9b03, 0x9c00, 0xa100,
6624                              0xff16])
6625         # 2222/161A, 22/26
6626         pkt = NCP(0x161A, "Get Path Name of a Volume-Directory Number Pair", 'fileserver')
6627         pkt.Request(13, [
6628                 rec( 10, 1, VolumeNumber ),
6629                 rec( 11, 2, DirectoryEntryNumberWord ),
6630         ])
6631         pkt.Reply((9,263), [
6632                 rec( 8, (1,255), Path ),
6633                 ])
6634         pkt.CompletionCodes([0x0000, 0x9804, 0x9c00, 0xa100])
6635         # 2222/161B, 22/27
6636         pkt = NCP(0x161B, "Scan Salvageable Files", 'fileserver')
6637         pkt.Request(15, [
6638                 rec( 10, 1, DirHandle ),
6639                 rec( 11, 4, SequenceNumber ),
6640         ])
6641         pkt.Reply(140, [
6642                 rec( 8, 4, SequenceNumber ),
6643                 rec( 12, 2, Subdirectory ),
6644                 rec( 14, 2, Reserved2 ),
6645                 rec( 16, 4, AttributesDef32 ),
6646                 rec( 20, 1, UniqueID ),
6647                 rec( 21, 1, FlagsDef ),
6648                 rec( 22, 1, DestNameSpace ),
6649                 rec( 23, 1, FileNameLen ),
6650                 rec( 24, 12, FileName12 ),
6651                 rec( 36, 2, CreationTime ),
6652                 rec( 38, 2, CreationDate ),
6653                 rec( 40, 4, CreatorID, BE ),
6654                 rec( 44, 2, ArchivedTime ),
6655                 rec( 46, 2, ArchivedDate ),
6656                 rec( 48, 4, ArchiverID, BE ),
6657                 rec( 52, 2, UpdateTime ),
6658                 rec( 54, 2, UpdateDate ),
6659                 rec( 56, 4, UpdateID, BE ),
6660                 rec( 60, 4, FileSize, BE ),
6661                 rec( 64, 44, Reserved44 ),
6662                 rec( 108, 2, InheritedRightsMask ),
6663                 rec( 110, 2, LastAccessedDate ),
6664                 rec( 112, 4, DeletedFileTime ),
6665                 rec( 116, 2, DeletedTime ),
6666                 rec( 118, 2, DeletedDate ),
6667                 rec( 120, 4, DeletedID, BE ),
6668                 rec( 124, 16, Reserved16 ),
6669         ])
6670         pkt.CompletionCodes([0x0000, 0xfb01, 0xff1d])
6671         # 2222/161C, 22/28
6672         pkt = NCP(0x161C, "Recover Salvageable File", 'fileserver')
6673         pkt.Request((17,525), [
6674                 rec( 10, 1, DirHandle ),
6675                 rec( 11, 4, SequenceNumber ),
6676                 rec( 15, (1, 255), FileName ),
6677                 rec( -1, (1, 255), NewFileNameLen ),
6678         ], info_str=(FileName, "Recover File: %s", ", %s"))
6679         pkt.Reply(8)
6680         pkt.CompletionCodes([0x0000, 0x8401, 0x9c03, 0xfe02])
6681         # 2222/161D, 22/29
6682         pkt = NCP(0x161D, "Purge Salvageable File", 'fileserver')
6683         pkt.Request(15, [
6684                 rec( 10, 1, DirHandle ),
6685                 rec( 11, 4, SequenceNumber ),
6686         ])
6687         pkt.Reply(8)
6688         pkt.CompletionCodes([0x0000, 0x8500, 0x9c03])
6689         # 2222/161E, 22/30
6690         pkt = NCP(0x161E, "Scan a Directory", 'fileserver')
6691         pkt.Request((17, 271), [
6692                 rec( 10, 1, DirHandle ),
6693                 rec( 11, 1, DOSFileAttributes ),
6694                 rec( 12, 4, SequenceNumber ),
6695                 rec( 16, (1, 255), SearchPattern ),
6696         ], info_str=(SearchPattern, "Scan a Directory: %s", ", %s"))
6697         pkt.Reply(140, [
6698                 rec( 8, 4, SequenceNumber ),
6699                 rec( 12, 4, Subdirectory ),
6700                 rec( 16, 4, AttributesDef32 ),
6701                 rec( 20, 1, UniqueID, LE ),
6702                 rec( 21, 1, PurgeFlags ),
6703                 rec( 22, 1, DestNameSpace ),
6704                 rec( 23, 1, NameLen ),
6705                 rec( 24, 12, Name12 ),
6706                 rec( 36, 2, CreationTime ),
6707                 rec( 38, 2, CreationDate ),
6708                 rec( 40, 4, CreatorID, BE ),
6709                 rec( 44, 2, ArchivedTime ),
6710                 rec( 46, 2, ArchivedDate ),
6711                 rec( 48, 4, ArchiverID, BE ),
6712                 rec( 52, 2, UpdateTime ),
6713                 rec( 54, 2, UpdateDate ),
6714                 rec( 56, 4, UpdateID, BE ),
6715                 rec( 60, 4, FileSize, BE ),
6716                 rec( 64, 44, Reserved44 ),
6717                 rec( 108, 2, InheritedRightsMask ),
6718                 rec( 110, 2, LastAccessedDate ),
6719                 rec( 112, 28, Reserved28 ),
6720         ])
6721         pkt.CompletionCodes([0x0000, 0x8500, 0x9c03])
6722         # 2222/161F, 22/31
6723         pkt = NCP(0x161F, "Get Directory Entry", 'fileserver')
6724         pkt.Request(11, [
6725                 rec( 10, 1, DirHandle ),
6726         ])
6727         pkt.Reply(136, [
6728                 rec( 8, 4, Subdirectory ),
6729                 rec( 12, 4, AttributesDef32 ),
6730                 rec( 16, 1, UniqueID, LE ),
6731                 rec( 17, 1, PurgeFlags ),
6732                 rec( 18, 1, DestNameSpace ),
6733                 rec( 19, 1, NameLen ),
6734                 rec( 20, 12, Name12 ),
6735                 rec( 32, 2, CreationTime ),
6736                 rec( 34, 2, CreationDate ),
6737                 rec( 36, 4, CreatorID, BE ),
6738                 rec( 40, 2, ArchivedTime ),
6739                 rec( 42, 2, ArchivedDate ), 
6740                 rec( 44, 4, ArchiverID, BE ),
6741                 rec( 48, 2, UpdateTime ),
6742                 rec( 50, 2, UpdateDate ),
6743                 rec( 52, 4, NextTrusteeEntry, BE ),
6744                 rec( 56, 48, Reserved48 ),
6745                 rec( 104, 2, MaximumSpace ),
6746                 rec( 106, 2, InheritedRightsMask ),
6747                 rec( 108, 28, Undefined28 ),
6748         ])
6749         pkt.CompletionCodes([0x0000, 0x8900, 0xbf00, 0xfb00])
6750         # 2222/1620, 22/32
6751         pkt = NCP(0x1620, "Scan Volume's User Disk Restrictions", 'fileserver')
6752         pkt.Request(15, [
6753                 rec( 10, 1, VolumeNumber ),
6754                 rec( 11, 4, SequenceNumber ),
6755         ])
6756         pkt.Reply(17, [
6757                 rec( 8, 1, NumberOfEntries, var="x" ),
6758                 rec( 9, 8, ObjectIDStruct, repeat="x" ),
6759         ])
6760         pkt.CompletionCodes([0x0000, 0x9800])
6761         # 2222/1621, 22/33
6762         pkt = NCP(0x1621, "Add User Disk Space Restriction", 'fileserver')
6763         pkt.Request(19, [
6764                 rec( 10, 1, VolumeNumber ),
6765                 rec( 11, 4, ObjectID ),
6766                 rec( 15, 4, DiskSpaceLimit ),
6767         ])
6768         pkt.Reply(8)
6769         pkt.CompletionCodes([0x0000, 0x8c00, 0x9600, 0x9800])
6770         # 2222/1622, 22/34
6771         pkt = NCP(0x1622, "Remove User Disk Space Restrictions", 'fileserver')
6772         pkt.Request(15, [
6773                 rec( 10, 1, VolumeNumber ),
6774                 rec( 11, 4, ObjectID ),
6775         ])
6776         pkt.Reply(8)
6777         pkt.CompletionCodes([0x0000, 0x8c00, 0xfe0e])
6778         # 2222/1623, 22/35
6779         pkt = NCP(0x1623, "Get Directory Disk Space Restriction", 'fileserver')
6780         pkt.Request(11, [
6781                 rec( 10, 1, DirHandle ),
6782         ])
6783         pkt.Reply(18, [
6784                 rec( 8, 1, NumberOfEntries ),
6785                 rec( 9, 1, Level ),
6786                 rec( 10, 4, MaxSpace ),
6787                 rec( 14, 4, CurrentSpace ),
6788         ])
6789         pkt.CompletionCodes([0x0000])
6790         # 2222/1624, 22/36
6791         pkt = NCP(0x1624, "Set Directory Disk Space Restriction", 'fileserver')
6792         pkt.Request(15, [
6793                 rec( 10, 1, DirHandle ),
6794                 rec( 11, 4, DiskSpaceLimit ),
6795         ])
6796         pkt.Reply(8)
6797         pkt.CompletionCodes([0x0000, 0x0101, 0x8c00, 0xbf00])
6798         # 2222/1625, 22/37
6799         pkt = NCP(0x1625, "Set Directory Entry Information", 'fileserver')
6800         pkt.Request(NO_LENGTH_CHECK, [
6801                 rec( 10, 1, DirHandle ),
6802                 rec( 11, 2, SearchAttributesLow ),
6803                 rec( 13, 4, SequenceNumber ),
6804                 rec( 17, 2, ChangeBits ),
6805                 rec( 19, 2, Reserved2 ),
6806                 rec( 21, 4, Subdirectory ),
6807                 srec(DOSDirectoryEntryStruct, req_cond="ncp.search_att_sub == TRUE"),
6808                 srec(DOSFileEntryStruct, req_cond="ncp.search_att_sub == FALSE"),
6809         ])
6810         pkt.Reply(8)
6811         pkt.ReqCondSizeConstant()
6812         pkt.CompletionCodes([0x0000, 0x0106, 0x8c00, 0xbf00])
6813         # 2222/1626, 22/38
6814         pkt = NCP(0x1626, "Scan File or Directory for Extended Trustees", 'fileserver')
6815         pkt.Request((13,267), [
6816                 rec( 10, 1, DirHandle ),
6817                 rec( 11, 1, SequenceByte ),
6818                 rec( 12, (1, 255), Path ),
6819         ], info_str=(Path, "Scan for Extended Trustees: %s", ", %s"))
6820         pkt.Reply(15, [
6821                 rec( 8, 1, NumberOfEntries, var="x" ),
6822                 rec( 9, 4, ObjectID, repeat="x" ),
6823                 rec( 13, 2, AccessRightsMaskWord, repeat="x" ),
6824         ])
6825         pkt.CompletionCodes([0x0000, 0x9800, 0x9b00, 0x9c00])
6826         # 2222/1627, 22/39
6827         pkt = NCP(0x1627, "Add Extended Trustee to Directory or File", 'fileserver')
6828         pkt.Request((18,272), [
6829                 rec( 10, 1, DirHandle ),
6830                 rec( 11, 4, ObjectID, BE ),
6831                 rec( 15, 2, TrusteeRights ),
6832                 rec( 17, (1, 255), Path ),
6833         ], info_str=(Path, "Add Extended Trustee: %s", ", %s"))
6834         pkt.Reply(8)
6835         pkt.CompletionCodes([0x0000, 0x9000])
6836         # 2222/1628, 22/40
6837         pkt = NCP(0x1628, "Scan Directory Disk Space", 'fileserver')
6838         pkt.Request((15,269), [
6839                 rec( 10, 1, DirHandle ),
6840                 rec( 11, 2, SearchAttributesLow ),
6841                 rec( 13, 1, SequenceByte ),
6842                 rec( 14, (1, 255), SearchPattern ),
6843         ], info_str=(SearchPattern, "Scan Directory Disk Space: %s", ", %s"))
6844         pkt.Reply((148), [
6845                 rec( 8, 4, SequenceNumber ),
6846                 rec( 12, 4, Subdirectory ),
6847                 rec( 16, 4, AttributesDef32 ),
6848                 rec( 20, 1, UniqueID ),
6849                 rec( 21, 1, PurgeFlags ),
6850                 rec( 22, 1, DestNameSpace ),
6851                 rec( 23, 1, NameLen ),
6852                 rec( 24, 12, Name12 ),
6853                 rec( 36, 2, CreationTime ),
6854                 rec( 38, 2, CreationDate ),
6855                 rec( 40, 4, CreatorID, BE ),
6856                 rec( 44, 2, ArchivedTime ),
6857                 rec( 46, 2, ArchivedDate ),
6858                 rec( 48, 4, ArchiverID, BE ),
6859                 rec( 52, 2, UpdateTime ),
6860                 rec( 54, 2, UpdateDate ),
6861                 rec( 56, 4, UpdateID, BE ),
6862                 rec( 60, 4, DataForkSize, BE ),
6863                 rec( 64, 4, DataForkFirstFAT, BE ),
6864                 rec( 68, 4, NextTrusteeEntry, BE ),
6865                 rec( 72, 36, Reserved36 ),
6866                 rec( 108, 2, InheritedRightsMask ),
6867                 rec( 110, 2, LastAccessedDate ),
6868                 rec( 112, 4, DeletedFileTime ),
6869                 rec( 116, 2, DeletedTime ),
6870                 rec( 118, 2, DeletedDate ),
6871                 rec( 120, 4, DeletedID, BE ),
6872                 rec( 124, 8, Undefined8 ),
6873                 rec( 132, 4, PrimaryEntry, LE ),
6874                 rec( 136, 4, NameList, LE ),
6875                 rec( 140, 4, OtherFileForkSize, BE ),
6876                 rec( 144, 4, OtherFileForkFAT, BE ),
6877         ])
6878         pkt.CompletionCodes([0x0000, 0x8900, 0x9c03, 0xfb01, 0xff00])
6879         # 2222/1629, 22/41
6880         pkt = NCP(0x1629, "Get Object Disk Usage and Restrictions", 'fileserver')
6881         pkt.Request(15, [
6882                 rec( 10, 1, VolumeNumber ),
6883                 rec( 11, 4, ObjectID, BE ),
6884         ])
6885         pkt.Reply(16, [
6886                 rec( 8, 4, Restriction ),
6887                 rec( 12, 4, InUse ),
6888         ])
6889         pkt.CompletionCodes([0x0000, 0x9802])
6890         # 2222/162A, 22/42
6891         pkt = NCP(0x162A, "Get Effective Rights for Directory Entry", 'fileserver')
6892         pkt.Request((12,266), [
6893                 rec( 10, 1, DirHandle ),
6894                 rec( 11, (1, 255), Path ),
6895         ], info_str=(Path, "Get Effective Rights: %s", ", %s"))
6896         pkt.Reply(10, [
6897                 rec( 8, 2, AccessRightsMaskWord ),
6898         ])
6899         pkt.CompletionCodes([0x0000, 0x9804, 0x9c03])
6900         # 2222/162B, 22/43
6901         pkt = NCP(0x162B, "Remove Extended Trustee from Dir or File", 'fileserver')
6902         pkt.Request((17,271), [
6903                 rec( 10, 1, DirHandle ),
6904                 rec( 11, 4, ObjectID, BE ),
6905                 rec( 15, 1, Unused ),
6906                 rec( 16, (1, 255), Path ),
6907         ], info_str=(Path, "Remove Extended Trustee: %s", ", %s"))
6908         pkt.Reply(8)
6909         pkt.CompletionCodes([0x0000, 0x9002, 0x9c03, 0xfe0f, 0xff09])
6910         # 2222/162C, 22/44
6911         pkt = NCP(0x162C, "Get Volume and Purge Information", 'file')
6912         pkt.Request( 11, [
6913                 rec( 10, 1, VolumeNumber )
6914         ])
6915         pkt.Reply( (38,53), [
6916                 rec( 8, 4, TotalBlocks ),
6917                 rec( 12, 4, FreeBlocks ),
6918                 rec( 16, 4, PurgeableBlocks ),
6919                 rec( 20, 4, NotYetPurgeableBlocks ),
6920                 rec( 24, 4, TotalDirectoryEntries ),
6921                 rec( 28, 4, AvailableDirEntries ),
6922                 rec( 32, 4, Reserved4 ),
6923                 rec( 36, 1, SectorsPerBlock ),
6924                 rec( 37, (1,16), VolumeNameLen ),
6925         ])
6926         pkt.CompletionCodes([0x0000])
6927         # 2222/162D, 22/45
6928         pkt = NCP(0x162D, "Get Directory Information", 'file')
6929         pkt.Request( 11, [
6930                 rec( 10, 1, DirHandle )
6931         ])
6932         pkt.Reply( (30, 45), [
6933                 rec( 8, 4, TotalBlocks ),
6934                 rec( 12, 4, AvailableBlocks ),
6935                 rec( 16, 4, TotalDirectoryEntries ),
6936                 rec( 20, 4, AvailableDirEntries ),
6937                 rec( 24, 4, Reserved4 ),
6938                 rec( 28, 1, SectorsPerBlock ),
6939                 rec( 29, (1,16), VolumeNameLen ),
6940         ])
6941         pkt.CompletionCodes([0x0000, 0x9b03])
6942         # 2222/162E, 22/46
6943         pkt = NCP(0x162E, "Rename Or Move", 'file')
6944         pkt.Request( (17,525), [
6945                 rec( 10, 1, SourceDirHandle ),
6946                 rec( 11, 1, SearchAttributesLow ),
6947                 rec( 12, 1, SourcePathComponentCount ),
6948                 rec( 13, (1,255), SourcePath ),
6949                 rec( -1, 1, DestDirHandle ),
6950                 rec( -1, 1, DestPathComponentCount ),
6951                 rec( -1, (1,255), DestPath ),
6952         ], info_str=(SourcePath, "Rename or Move: %s", ", %s"))
6953         pkt.Reply(8)
6954         pkt.CompletionCodes([0x0000, 0x0102, 0x8701, 0x8b00, 0x8d00, 0x8e00,
6955                              0x8f00, 0x9001, 0x9101, 0x9201, 0x9a00, 0x9b03,
6956                              0x9c03, 0xa400, 0xff17])
6957         # 2222/162F, 22/47
6958         pkt = NCP(0x162F, "Get Name Space Information", 'file')
6959         pkt.Request( 11, [
6960                 rec( 10, 1, VolumeNumber )
6961         ])
6962         pkt.Reply( (13,521), [
6963                 rec( 8, 1, DefinedNameSpaces ),
6964                 rec( 9, (1,255), NameSpaceName ),
6965                 rec( -1, 1, DefinedDataStreams ),
6966                 rec( -1, 1, AssociatedNameSpace ),
6967                 rec( -1, (1,255), DataStreamName ),
6968         ])
6969         pkt.CompletionCodes([0x0000])
6970         # 2222/1630, 22/48
6971         pkt = NCP(0x1630, "Get Name Space Directory Entry", 'file')
6972         pkt.Request( 16, [
6973                 rec( 10, 1, VolumeNumber ),
6974                 rec( 11, 4, DOSSequence ),
6975                 rec( 15, 1, SrcNameSpace ),
6976         ])
6977         pkt.Reply( 112, [
6978                 rec( 8, 4, SequenceNumber ),
6979                 rec( 12, 4, Subdirectory ),
6980                 rec( 16, 4, AttributesDef32 ),
6981                 rec( 20, 1, UniqueID ),
6982                 rec( 21, 1, Flags ),
6983                 rec( 22, 1, SrcNameSpace ),
6984                 rec( 23, 1, NameLength ),
6985                 rec( 24, 12, Name12 ),
6986                 rec( 36, 2, CreationTime ),
6987                 rec( 38, 2, CreationDate ),
6988                 rec( 40, 4, CreatorID, BE ),
6989                 rec( 44, 2, ArchivedTime ),
6990                 rec( 46, 2, ArchivedDate ),
6991                 rec( 48, 4, ArchiverID ),
6992                 rec( 52, 2, UpdateTime ),
6993                 rec( 54, 2, UpdateDate ),
6994                 rec( 56, 4, UpdateID ),
6995                 rec( 60, 4, FileSize ),
6996                 rec( 64, 44, Reserved44 ),
6997                 rec( 108, 2, InheritedRightsMask ),
6998                 rec( 110, 2, LastAccessedDate ),
6999         ])
7000         pkt.CompletionCodes([0x0000, 0x8900, 0x9802, 0xbf00])
7001         # 2222/1631, 22/49
7002         pkt = NCP(0x1631, "Open Data Stream", 'file')
7003         pkt.Request( (15,269), [
7004                 rec( 10, 1, DataStream ),
7005                 rec( 11, 1, DirHandle ),
7006                 rec( 12, 1, AttributesDef ),
7007                 rec( 13, 1, OpenRights ),
7008                 rec( 14, (1, 255), FileName ),
7009         ], info_str=(FileName, "Open Data Stream: %s", ", %s"))
7010         pkt.Reply( 12, [
7011                 rec( 8, 4, CCFileHandle, BE ),
7012         ])
7013         pkt.CompletionCodes([0x0000, 0x8000, 0x8200, 0x9002, 0xbe00, 0xff00])
7014         # 2222/1632, 22/50
7015         pkt = NCP(0x1632, "Get Object Effective Rights for Directory Entry", 'file')
7016         pkt.Request( (16,270), [
7017                 rec( 10, 4, ObjectID, BE ),
7018                 rec( 14, 1, DirHandle ),
7019                 rec( 15, (1, 255), Path ),
7020         ], info_str=(Path, "Get Object Effective Rights: %s", ", %s"))
7021         pkt.Reply( 10, [
7022                 rec( 8, 2, TrusteeRights ),
7023         ])
7024         pkt.CompletionCodes([0x0000, 0x7e01, 0x9b00, 0x9c03])
7025         # 2222/1633, 22/51
7026         pkt = NCP(0x1633, "Get Extended Volume Information", 'file')
7027         pkt.Request( 11, [
7028                 rec( 10, 1, VolumeNumber ),
7029         ])
7030         pkt.Reply( (139,266), [
7031                 rec( 8, 2, VolInfoReplyLen ),
7032                 rec( 10, 128, VolInfoStructure),
7033                 rec( 138, (1,128), VolumeNameLen ),
7034         ])
7035         pkt.CompletionCodes([0x0000, 0x7e01, 0x9804, 0xfb08, 0xff00])
7036         # 2222/1634, 22/52
7037         pkt = NCP(0x1634, "Get Mount Volume List", 'file')
7038         pkt.Request( 22, [
7039                 rec( 10, 4, StartVolumeNumber ),
7040                 rec( 14, 4, VolumeRequestFlags, LE ),
7041                 rec( 18, 4, SrcNameSpace ),
7042         ])
7043         pkt.Reply( 34, [
7044                 rec( 8, 4, ItemsInPacket, var="x" ),
7045                 rec( 12, 4, NextVolumeNumber ),
7046                 rec( 16, 18, VolumeStruct, repeat="x"),
7047         ])
7048         pkt.CompletionCodes([0x0000])
7049         # 2222/1700, 23/00
7050         pkt = NCP(0x1700, "Login User", 'file')
7051         pkt.Request( (12, 58), [
7052                 rec( 10, (1,16), UserName ),
7053                 rec( -1, (1,32), Password ),
7054         ], info_str=(UserName, "Login User: %s", ", %s"))
7055         pkt.Reply(8)
7056         pkt.CompletionCodes([0x0000, 0x9602, 0xc101, 0xc200, 0xc501, 0xd700,
7057                              0xd900, 0xda00, 0xdb00, 0xde00, 0xdf00, 0xe800,
7058                              0xec00, 0xed00, 0xef00, 0xf001, 0xf100, 0xf200,
7059                              0xf600, 0xfb00, 0xfc06, 0xfe07, 0xff00])
7060         # 2222/1701, 23/01
7061         pkt = NCP(0x1701, "Change User Password", 'file')
7062         pkt.Request( (13, 90), [
7063                 rec( 10, (1,16), UserName ),
7064                 rec( -1, (1,32), Password ),
7065                 rec( -1, (1,32), NewPassword ),
7066         ], info_str=(UserName, "Change Password for User: %s", ", %s"))
7067         pkt.Reply(8)
7068         pkt.CompletionCodes([0x0000, 0x9600, 0xd600, 0xf001, 0xf101, 0xf501,
7069                              0xfc06, 0xfe07, 0xff00])
7070         # 2222/1702, 23/02
7071         pkt = NCP(0x1702, "Get User Connection List", 'file')
7072         pkt.Request( (11, 26), [
7073                 rec( 10, (1,16), UserName ),
7074         ], info_str=(UserName, "Get User Connection: %s", ", %s"))
7075         pkt.Reply( (9, 136), [
7076                 rec( 8, (1, 128), ConnectionNumberList ),
7077         ])
7078         pkt.CompletionCodes([0x0000, 0x9600, 0xf001, 0xfc06, 0xfe07, 0xff00])
7079         # 2222/1703, 23/03
7080         pkt = NCP(0x1703, "Get User Number", 'file')
7081         pkt.Request( (11, 26), [
7082                 rec( 10, (1,16), UserName ),
7083         ], info_str=(UserName, "Get User Number: %s", ", %s"))
7084         pkt.Reply( 12, [
7085                 rec( 8, 4, ObjectID, BE ),
7086         ])
7087         pkt.CompletionCodes([0x0000, 0x9600, 0xf001, 0xfc06, 0xfe07, 0xff00])
7088         # 2222/1705, 23/05
7089         pkt = NCP(0x1705, "Get Station's Logged Info", 'file')
7090         pkt.Request( 11, [
7091                 rec( 10, 1, TargetConnectionNumber ),
7092         ])
7093         pkt.Reply( 266, [
7094                 rec( 8, 16, UserName16 ),
7095                 rec( 24, 7, LoginTime ),
7096                 rec( 31, 39, FullName ),
7097                 rec( 70, 4, UserID, BE ),
7098                 rec( 74, 128, SecurityEquivalentList ),
7099                 rec( 202, 64, Reserved64 ),
7100         ])
7101         pkt.CompletionCodes([0x0000, 0x9602, 0xfc06, 0xfd00, 0xfe07, 0xff00])
7102         # 2222/1707, 23/07
7103         pkt = NCP(0x1707, "Get Group Number", 'file')
7104         pkt.Request( 14, [
7105                 rec( 10, 4, ObjectID, BE ),
7106         ])
7107         pkt.Reply( 62, [
7108                 rec( 8, 4, ObjectID, BE ),
7109                 rec( 12, 2, ObjectType, BE ),
7110                 rec( 14, 48, ObjectNameLen ),
7111         ])
7112         pkt.CompletionCodes([0x0000, 0x9602, 0xf101, 0xfc06, 0xfe07, 0xff00])
7113         # 2222/170C, 23/12
7114         pkt = NCP(0x170C, "Verify Serialization", 'file')
7115         pkt.Request( 14, [
7116                 rec( 10, 4, ServerSerialNumber ),
7117         ])
7118         pkt.Reply(8)
7119         pkt.CompletionCodes([0x0000, 0xff00])
7120         # 2222/170D, 23/13
7121         pkt = NCP(0x170D, "Log Network Message", 'file')
7122         pkt.Request( (11, 68), [
7123                 rec( 10, (1, 58), TargetMessage ),
7124         ], info_str=(TargetMessage, "Log Network Message: %s", ", %s"))
7125         pkt.Reply(8)
7126         pkt.CompletionCodes([0x0000, 0x8000, 0x8100, 0x8800, 0x8d00, 0x8e00, 0x8f00,
7127                              0x9001, 0x9400, 0x9600, 0x9804, 0x9900, 0x9b00, 0xa100,
7128                              0xa201, 0xff00])
7129         # 2222/170E, 23/14
7130         pkt = NCP(0x170E, "Get Disk Utilization", 'file')
7131         pkt.Request( 15, [
7132                 rec( 10, 1, VolumeNumber ),
7133                 rec( 11, 4, TrusteeID, BE ),
7134         ])
7135         pkt.Reply( 19, [
7136                 rec( 8, 1, VolumeNumber ),
7137                 rec( 9, 4, TrusteeID, BE ),
7138                 rec( 13, 2, DirectoryCount, BE ),
7139                 rec( 15, 2, FileCount, BE ),
7140                 rec( 17, 2, ClusterCount, BE ),
7141         ])
7142         pkt.CompletionCodes([0x0000, 0x9600, 0x9804, 0xa100, 0xf200])
7143         # 2222/170F, 23/15
7144         pkt = NCP(0x170F, "Scan File Information", 'file')
7145         pkt.Request((15,269), [
7146                 rec( 10, 2, LastSearchIndex ),
7147                 rec( 12, 1, DirHandle ),
7148                 rec( 13, 1, SearchAttributesLow ),
7149                 rec( 14, (1, 255), FileName ),
7150         ], info_str=(FileName, "Scan File Information: %s", ", %s"))
7151         pkt.Reply( 102, [
7152                 rec( 8, 2, NextSearchIndex ),
7153                 rec( 10, 14, FileName14 ),
7154                 rec( 24, 2, AttributesDef16 ),
7155                 rec( 26, 4, FileSize, BE ),
7156                 rec( 30, 2, CreationDate, BE ),
7157                 rec( 32, 2, LastAccessedDate, BE ),
7158                 rec( 34, 2, ModifiedDate, BE ),
7159                 rec( 36, 2, ModifiedTime, BE ),
7160                 rec( 38, 4, CreatorID, BE ),
7161                 rec( 42, 2, ArchivedDate, BE ),
7162                 rec( 44, 2, ArchivedTime, BE ),
7163                 rec( 46, 56, Reserved56 ),
7164         ])
7165         pkt.CompletionCodes([0x0000, 0x8800, 0x8900, 0x9300, 0x9400, 0x9804, 0x9b00, 0x9c00,
7166                              0xa100, 0xfd00, 0xff17])
7167         # 2222/1710, 23/16
7168         pkt = NCP(0x1710, "Set File Information", 'file')
7169         pkt.Request((91,345), [
7170                 rec( 10, 2, AttributesDef16 ),
7171                 rec( 12, 4, FileSize, BE ),
7172                 rec( 16, 2, CreationDate, BE ),
7173                 rec( 18, 2, LastAccessedDate, BE ),
7174                 rec( 20, 2, ModifiedDate, BE ),
7175                 rec( 22, 2, ModifiedTime, BE ),
7176                 rec( 24, 4, CreatorID, BE ),
7177                 rec( 28, 2, ArchivedDate, BE ),
7178                 rec( 30, 2, ArchivedTime, BE ),
7179                 rec( 32, 56, Reserved56 ),
7180                 rec( 88, 1, DirHandle ),
7181                 rec( 89, 1, SearchAttributesLow ),
7182                 rec( 90, (1, 255), FileName ),
7183         ], info_str=(FileName, "Set Information for File: %s", ", %s"))
7184         pkt.Reply(8)
7185         pkt.CompletionCodes([0x0000, 0x8800, 0x8c00, 0x8e00, 0x9400, 0x9600, 0x9804,
7186                              0x9b03, 0x9c00, 0xa100, 0xa201, 0xfc06, 0xfd00, 0xfe07,
7187                              0xff17])
7188         # 2222/1711, 23/17
7189         pkt = NCP(0x1711, "Get File Server Information", 'fileserver')
7190         pkt.Request(10)
7191         pkt.Reply(136, [
7192                 rec( 8, 48, ServerName ),
7193                 rec( 56, 1, OSMajorVersion ),
7194                 rec( 57, 1, OSMinorVersion ),
7195                 rec( 58, 2, ConnectionsSupportedMax, BE ),
7196                 rec( 60, 2, ConnectionsInUse, BE ),
7197                 rec( 62, 2, VolumesSupportedMax, BE ),
7198                 rec( 64, 1, OSRevision ),
7199                 rec( 65, 1, SFTSupportLevel ),
7200                 rec( 66, 1, TTSLevel ),
7201                 rec( 67, 2, ConnectionsMaxUsed, BE ),
7202                 rec( 69, 1, AccountVersion ),
7203                 rec( 70, 1, VAPVersion ),
7204                 rec( 71, 1, QueueingVersion ),
7205                 rec( 72, 1, PrintServerVersion ),
7206                 rec( 73, 1, VirtualConsoleVersion ),
7207                 rec( 74, 1, SecurityRestrictionVersion ),
7208                 rec( 75, 1, InternetBridgeVersion ),
7209                 rec( 76, 1, MixedModePathFlag ),
7210                 rec( 77, 1, LocalLoginInfoCcode ),
7211                 rec( 78, 2, ProductMajorVersion, BE ),
7212                 rec( 80, 2, ProductMinorVersion, BE ),
7213                 rec( 82, 2, ProductRevisionVersion, BE ),
7214                 rec( 84, 1, OSLanguageID, LE ),
7215                 rec( 85, 51, Reserved51 ),
7216         ])
7217         pkt.CompletionCodes([0x0000, 0x9600])
7218         # 2222/1712, 23/18
7219         pkt = NCP(0x1712, "Get Network Serial Number", 'fileserver')
7220         pkt.Request(10)
7221         pkt.Reply(14, [
7222                 rec( 8, 4, ServerSerialNumber ),
7223                 rec( 12, 2, ApplicationNumber ),
7224         ])
7225         pkt.CompletionCodes([0x0000, 0x9600])
7226         # 2222/1713, 23/19
7227         pkt = NCP(0x1713, "Get Internet Address", 'fileserver')
7228         pkt.Request(11, [
7229                 rec( 10, 1, TargetConnectionNumber ),
7230         ])
7231         pkt.Reply(20, [
7232                 rec( 8, 4, NetworkAddress, BE ),
7233                 rec( 12, 6, NetworkNodeAddress ),
7234                 rec( 18, 2, NetworkSocket, BE ),
7235         ])
7236         pkt.CompletionCodes([0x0000, 0xff00])
7237         # 2222/1714, 23/20
7238         pkt = NCP(0x1714, "Login Object", 'file')
7239         pkt.Request( (12, 58), [
7240                 rec( 10, (1,16), UserName ),
7241                 rec( -1, (1,32), Password ),
7242         ], info_str=(UserName, "Login Object: %s", ", %s"))
7243         pkt.Reply(8)
7244         pkt.CompletionCodes([0x0000, 0x9602, 0xc101, 0xc200, 0xc501, 0xd600, 0xd700,
7245                              0xd900, 0xda00, 0xdb00, 0xde00, 0xdf00, 0xe800, 0xec00,
7246                              0xed00, 0xef00, 0xf001, 0xf100, 0xf200, 0xf600, 0xfb00,
7247                              0xfc06, 0xfe07, 0xff00])
7248         # 2222/1715, 23/21
7249         pkt = NCP(0x1715, "Get Object Connection List", 'file')
7250         pkt.Request( (11, 26), [
7251                 rec( 10, (1,16), UserName ),
7252         ], info_str=(UserName, "Get Object Connection List: %s", ", %s"))
7253         pkt.Reply( (9, 136), [
7254                 rec( 8, (1, 128), ConnectionNumberList ),
7255         ])
7256         pkt.CompletionCodes([0x0000, 0x9600, 0xf001, 0xfc06, 0xfe07, 0xff00])
7257         # 2222/1716, 23/22
7258         pkt = NCP(0x1716, "Get Station's Logged Info (old)", 'file')
7259         pkt.Request( 11, [
7260                 rec( 10, 1, TargetConnectionNumber ),
7261         ])
7262         pkt.Reply( 70, [
7263                 rec( 8, 4, UserID, BE ),
7264                 rec( 12, 2, ObjectType, BE ),
7265                 rec( 14, 48, ObjectNameLen ),
7266                 rec( 62, 7, LoginTime ),       
7267                 rec( 69, 1, Reserved ),
7268         ])
7269         pkt.CompletionCodes([0x0000, 0x9602, 0xfc06, 0xfd00, 0xfe07, 0xff00])
7270         # 2222/1717, 23/23
7271         pkt = NCP(0x1717, "Get Login Key", 'file')
7272         pkt.Request(10)
7273         pkt.Reply( 16, [
7274                 rec( 8, 8, LoginKey ),
7275         ])
7276         pkt.CompletionCodes([0x0000, 0x9602])
7277         # 2222/1718, 23/24
7278         pkt = NCP(0x1718, "Keyed Object Login", 'file')
7279         pkt.Request( (21, 68), [
7280                 rec( 10, 8, LoginKey ),
7281                 rec( 18, 2, ObjectType, BE ),
7282                 rec( 20, (1,48), ObjectName ),
7283         ], info_str=(ObjectName, "Keyed Object Login: %s", ", %s"))
7284         pkt.Reply(8)
7285         pkt.CompletionCodes([0x0000, 0x9602, 0xc101, 0xc200, 0xc500, 0xd900, 0xda00,
7286                              0xdb00, 0xdc00, 0xde00])
7287         # 2222/171A, 23/26
7288         #
7289         # XXX - for NCP-over-IP, the NetworkAddress field appears to be
7290         # an IP address, rather than an IPX network address, and should
7291         # be dissected as an FT_IPv4 value; the NetworkNodeAddress and
7292         # NetworkSocket are 0.
7293         #
7294         # For NCP-over-IPX, it should probably be dissected as an
7295         # FT_IPXNET value.
7296         #
7297         pkt = NCP(0x171A, "Get Internet Address", 'fileserver')
7298         pkt.Request(11, [
7299                 rec( 10, 1, TargetConnectionNumber ),
7300         ])
7301         pkt.Reply(21, [
7302                 rec( 8, 4, NetworkAddress, BE ),
7303                 rec( 12, 6, NetworkNodeAddress ),
7304                 rec( 18, 2, NetworkSocket, BE ),
7305                 rec( 20, 1, ConnectionType ),
7306         ])
7307         pkt.CompletionCodes([0x0000])
7308         # 2222/171B, 23/27
7309         pkt = NCP(0x171B, "Get Object Connection List", 'file')
7310         pkt.Request( (17,64), [
7311                 rec( 10, 4, SearchConnNumber ),
7312                 rec( 14, 2, ObjectType, BE ),
7313                 rec( 16, (1,48), ObjectName ),
7314         ], info_str=(ObjectName, "Get Object Connection List: %s", ", %s"))
7315         pkt.Reply( (10,137), [
7316                 rec( 8, 1, ConnListLen, var="x" ),
7317                 rec( 9, (1,128), ConnectionNumberList, repeat="x" ),
7318         ])
7319         pkt.CompletionCodes([0x0000, 0x9600, 0xf001, 0xfc06, 0xfe07, 0xff00])
7320         # 2222/171C, 23/28
7321         pkt = NCP(0x171C, "Get Station's Logged Info", 'file')
7322         pkt.Request( 14, [
7323                 rec( 10, 4, TargetConnectionNumber ),
7324         ])
7325         pkt.Reply( 70, [
7326                 rec( 8, 4, UserID, BE ),
7327                 rec( 12, 2, ObjectType, BE ),
7328                 rec( 14, 48, ObjectNameLen ),
7329                 rec( 62, 7, LoginTime ),
7330                 rec( 69, 1, Reserved ),
7331         ])
7332         pkt.CompletionCodes([0x0000, 0x9602, 0xfc06, 0xfd00, 0xfe07, 0xff00])
7333         # 2222/171D, 23/29
7334         pkt = NCP(0x171D, "Change Connection State", 'file')
7335         pkt.Request( 11, [
7336                 rec( 10, 1, RequestCode ),
7337         ])
7338         pkt.Reply(8)
7339         pkt.CompletionCodes([0x0000, 0x7a00, 0x7b00, 0x7c00, 0xe000, 0xfb06, 0xfd00])
7340         # 2222/171E, 23/30
7341         pkt = NCP(0x171E, "Set Watchdog Delay Interval", 'file')
7342         pkt.Request( 14, [
7343                 rec( 10, 4, NumberOfMinutesToDelay ),
7344         ])
7345         pkt.Reply(8)
7346         pkt.CompletionCodes([0x0000, 0x0107])
7347         # 2222/171F, 23/31
7348         pkt = NCP(0x171F, "Get Connection List From Object", 'file')
7349         pkt.Request( 18, [
7350                 rec( 10, 4, ObjectID, BE ),
7351                 rec( 14, 4, ConnectionNumber ),
7352         ])
7353         pkt.Reply( (9, 136), [
7354                 rec( 8, (1, 128), ConnectionNumberList ),
7355         ])
7356         pkt.CompletionCodes([0x0000, 0x9600, 0xf001, 0xfc06, 0xfe07, 0xff00])
7357         # 2222/1720, 23/32
7358         pkt = NCP(0x1720, "Scan Bindery Object (List)", 'bindery')
7359         pkt.Request((23,70), [
7360                 rec( 10, 4, NextObjectID, BE ),
7361                 rec( 14, 4, ObjectType, BE ),
7362                 rec( 18, 4, InfoFlags ),
7363                 rec( 22, (1,48), ObjectName ),
7364         ], info_str=(ObjectName, "Scan Bindery Object: %s", ", %s"))
7365         pkt.Reply(NO_LENGTH_CHECK, [
7366                 rec( 8, 4, ObjectInfoReturnCount ),
7367                 rec( 12, 4, NextObjectID, BE ),
7368                 rec( 16, 4, ObjectIDInfo ),
7369                 srec(ObjectTypeStruct, req_cond="ncp.info_flags_type == TRUE"),
7370                 srec(ObjectSecurityStruct, req_cond="ncp.info_flags_security == TRUE"),
7371                 srec(ObjectFlagsStruct, req_cond="ncp.info_flags_flags == TRUE"),
7372                 srec(ObjectNameStruct, req_cond="ncp.info_flags_name == TRUE"),
7373         ])
7374         pkt.ReqCondSizeVariable()
7375         pkt.CompletionCodes([0x0000, 0x9600, 0xef01, 0xfc02, 0xfe01, 0xff00])
7376         # 2222/1721, 23/33
7377         pkt = NCP(0x1721, "Generate GUIDs", 'nds')
7378         pkt.Request( 14, [
7379                 rec( 10, 4, ReturnInfoCount ),
7380         ])
7381         pkt.Reply(28, [
7382                 rec( 8, 4, ReturnInfoCount, var="x" ),
7383                 rec( 12, 16, GUID, repeat="x" ),
7384         ])
7385         pkt.CompletionCodes([0x0000])
7386         # 2222/1732, 23/50
7387         pkt = NCP(0x1732, "Create Bindery Object", 'bindery')
7388         pkt.Request( (15,62), [
7389                 rec( 10, 1, ObjectFlags ),
7390                 rec( 11, 1, ObjectSecurity ),
7391                 rec( 12, 2, ObjectType, BE ),
7392                 rec( 14, (1,48), ObjectName ),
7393         ], info_str=(ObjectName, "Create Bindery Object: %s", ", %s"))
7394         pkt.Reply(8)
7395         pkt.CompletionCodes([0x0000, 0x9600, 0xe700, 0xee00, 0xef00, 0xf101, 0xf501,
7396                              0xfc06, 0xfe07, 0xff00])
7397         # 2222/1733, 23/51
7398         pkt = NCP(0x1733, "Delete Bindery Object", 'bindery')
7399         pkt.Request( (13,60), [
7400                 rec( 10, 2, ObjectType, BE ),
7401                 rec( 12, (1,48), ObjectName ),
7402         ], info_str=(ObjectName, "Delete Bindery Object: %s", ", %s"))
7403         pkt.Reply(8)
7404         pkt.CompletionCodes([0x0000, 0x9600, 0xf000, 0xf200, 0xf400, 0xf600, 0xfb00,
7405                              0xfc06, 0xfe07, 0xff00])
7406         # 2222/1734, 23/52
7407         pkt = NCP(0x1734, "Rename Bindery Object", 'bindery')
7408         pkt.Request( (14,108), [
7409                 rec( 10, 2, ObjectType, BE ),
7410                 rec( 12, (1,48), ObjectName ),
7411                 rec( -1, (1,48), NewObjectName ),
7412         ], info_str=(ObjectName, "Rename Bindery Object: %s", ", %s"))
7413         pkt.Reply(8)
7414         pkt.CompletionCodes([0x0000, 0x9600, 0xee00, 0xf000, 0xf300, 0xfc06, 0xfe07, 0xff00])
7415         # 2222/1735, 23/53
7416         pkt = NCP(0x1735, "Get Bindery Object ID", 'bindery')
7417         pkt.Request((13,60), [
7418                 rec( 10, 2, ObjectType, BE ),
7419                 rec( 12, (1,48), ObjectName ),
7420         ], info_str=(ObjectName, "Get Bindery Object: %s", ", %s"))
7421         pkt.Reply(62, [
7422                 rec( 8, 4, ObjectID, BE ),
7423                 rec( 12, 2, ObjectType, BE ),
7424                 rec( 14, 48, ObjectNameLen ),
7425         ])
7426         pkt.CompletionCodes([0x0000, 0x9600, 0xef01, 0xf000, 0xfc02, 0xfe01, 0xff00])
7427         # 2222/1736, 23/54
7428         pkt = NCP(0x1736, "Get Bindery Object Name", 'bindery')
7429         pkt.Request( 14, [
7430                 rec( 10, 4, ObjectID, BE ),
7431         ])
7432         pkt.Reply( 62, [
7433                 rec( 8, 4, ObjectID, BE ),
7434                 rec( 12, 2, ObjectType, BE ),
7435                 rec( 14, 48, ObjectNameLen ),
7436         ])
7437         pkt.CompletionCodes([0x0000, 0x9600, 0xf101, 0xfc02, 0xfe01, 0xff00])
7438         # 2222/1737, 23/55
7439         pkt = NCP(0x1737, "Scan Bindery Object", 'bindery')
7440         pkt.Request((17,64), [
7441                 rec( 10, 4, ObjectID, BE ),
7442                 rec( 14, 2, ObjectType, BE ),
7443                 rec( 16, (1,48), ObjectName ),
7444         ], info_str=(ObjectName, "Scann Bindery Object: %s", ", %s"))
7445         pkt.Reply(65, [
7446                 rec( 8, 4, ObjectID, BE ),
7447                 rec( 12, 2, ObjectType, BE ),
7448                 rec( 14, 48, ObjectNameLen ),
7449                 rec( 62, 1, ObjectFlags ),
7450                 rec( 63, 1, ObjectSecurity ),
7451                 rec( 64, 1, ObjectHasProperties ),
7452         ])
7453         pkt.CompletionCodes([0x0000, 0x9600, 0xef01, 0xfc02,
7454                              0xfe01, 0xff00])
7455         # 2222/1738, 23/56
7456         pkt = NCP(0x1738, "Change Bindery Object Security", 'bindery')
7457         pkt.Request((14,61), [
7458                 rec( 10, 1, ObjectSecurity ),
7459                 rec( 11, 2, ObjectType, BE ),
7460                 rec( 13, (1,48), ObjectName ),
7461         ], info_str=(ObjectName, "Change Bindery Object Security: %s", ", %s"))
7462         pkt.Reply(8)
7463         pkt.CompletionCodes([0x0000, 0x9600, 0xf000, 0xf101, 0xf501, 0xfc02, 0xfe01, 0xff00])
7464         # 2222/1739, 23/57
7465         pkt = NCP(0x1739, "Create Property", 'bindery')
7466         pkt.Request((16,78), [
7467                 rec( 10, 2, ObjectType, BE ),
7468                 rec( 12, (1,48), ObjectName ),
7469                 rec( -1, 1, PropertyType ),
7470                 rec( -1, 1, ObjectSecurity ),
7471                 rec( -1, (1,16), PropertyName ),
7472         ], info_str=(PropertyName, "Create Property: %s", ", %s"))
7473         pkt.Reply(8)
7474         pkt.CompletionCodes([0x0000, 0x9600, 0xed00, 0xef00, 0xf000, 0xf101,
7475                              0xf200, 0xf600, 0xf700, 0xfb00, 0xfc02, 0xfe01,
7476                              0xff00])
7477         # 2222/173A, 23/58
7478         pkt = NCP(0x173A, "Delete Property", 'bindery')
7479         pkt.Request((14,76), [
7480                 rec( 10, 2, ObjectType, BE ),
7481                 rec( 12, (1,48), ObjectName ),
7482                 rec( -1, (1,16), PropertyName ),
7483         ], info_str=(PropertyName, "Delete Property: %s", ", %s"))
7484         pkt.Reply(8)
7485         pkt.CompletionCodes([0x0000, 0x9600, 0xf000, 0xf101, 0xf600, 0xfb00, 0xfc02,
7486                              0xfe01, 0xff00])
7487         # 2222/173B, 23/59
7488         pkt = NCP(0x173B, "Change Property Security", 'bindery')
7489         pkt.Request((15,77), [
7490                 rec( 10, 2, ObjectType, BE ),
7491                 rec( 12, (1,48), ObjectName ),
7492                 rec( -1, 1, ObjectSecurity ),
7493                 rec( -1, (1,16), PropertyName ),
7494         ], info_str=(PropertyName, "Change Property Security: %s", ", %s"))
7495         pkt.Reply(8)
7496         pkt.CompletionCodes([0x0000, 0x9600, 0xf000, 0xf101, 0xf200, 0xf600, 0xfb00,
7497                              0xfc02, 0xfe01, 0xff00])
7498         # 2222/173C, 23/60
7499         pkt = NCP(0x173C, "Scan Property", 'bindery')
7500         pkt.Request((18,80), [
7501                 rec( 10, 2, ObjectType, BE ),
7502                 rec( 12, (1,48), ObjectName ),
7503                 rec( -1, 4, LastInstance, BE ),
7504                 rec( -1, (1,16), PropertyName ),
7505         ], info_str=(PropertyName, "Scan Property: %s", ", %s"))
7506         pkt.Reply( 32, [
7507                 rec( 8, 16, PropertyName16 ),
7508                 rec( 24, 1, ObjectFlags ),
7509                 rec( 25, 1, ObjectSecurity ),
7510                 rec( 26, 4, SearchInstance, BE ),
7511                 rec( 30, 1, ValueAvailable ),
7512                 rec( 31, 1, MoreProperties ),
7513         ])
7514         pkt.CompletionCodes([0x0000, 0x9600, 0xf000, 0xf101, 0xf200, 0xf600, 0xfb00,
7515                              0xfc02, 0xfe01, 0xff00])
7516         # 2222/173D, 23/61
7517         pkt = NCP(0x173D, "Read Property Value", 'bindery')
7518         pkt.Request((15,77), [
7519                 rec( 10, 2, ObjectType, BE ),
7520                 rec( 12, (1,48), ObjectName ),
7521                 rec( -1, 1, PropertySegment ),
7522                 rec( -1, (1,16), PropertyName ),
7523         ], info_str=(PropertyName, "Read Property Value: %s", ", %s"))
7524         pkt.Reply(138, [
7525                 rec( 8, 128, PropertyData ),
7526                 rec( 136, 1, PropertyHasMoreSegments ),
7527                 rec( 137, 1, PropertyType ),
7528         ])
7529         pkt.CompletionCodes([0x0000, 0x8800, 0x9300, 0x9600, 0xec01,
7530                              0xf000, 0xf100, 0xf900, 0xfb02, 0xfc02,
7531                              0xfe01, 0xff00])
7532         # 2222/173E, 23/62
7533         pkt = NCP(0x173E, "Write Property Value", 'bindery')
7534         pkt.Request((144,206), [
7535                 rec( 10, 2, ObjectType, BE ),
7536                 rec( 12, (1,48), ObjectName ),
7537                 rec( -1, 1, PropertySegment ),
7538                 rec( -1, 1, MoreFlag ),
7539                 rec( -1, (1,16), PropertyName ),
7540                 rec( -1, 128, PropertyValue ),
7541         ], info_str=(PropertyName, "Write Property Value: %s", ", %s"))
7542         pkt.Reply(8)
7543         pkt.CompletionCodes([0x0000, 0x9600, 0xe800, 0xec01, 0xf000, 0xf800,
7544                              0xfb02, 0xfc03, 0xfe01, 0xff00 ])
7545         # 2222/173F, 23/63
7546         pkt = NCP(0x173F, "Verify Bindery Object Password", 'bindery')
7547         pkt.Request((14,92), [
7548                 rec( 10, 2, ObjectType, BE ),
7549                 rec( 12, (1,48), ObjectName ),
7550                 rec( -1, (1,32), Password ),
7551         ], info_str=(ObjectName, "Verify Bindery Object Password: %s", ", %s"))
7552         pkt.Reply(8)
7553         pkt.CompletionCodes([0x0000, 0x9600, 0xe800, 0xec01, 0xf000, 0xf101,
7554                              0xfb02, 0xfc03, 0xfe01, 0xff00 ])
7555         # 2222/1740, 23/64
7556         pkt = NCP(0x1740, "Change Bindery Object Password", 'bindery')
7557         pkt.Request((15,124), [
7558                 rec( 10, 2, ObjectType, BE ),
7559                 rec( 12, (1,48), ObjectName ),
7560                 rec( -1, (1,32), Password ),
7561                 rec( -1, (1,32), NewPassword ),
7562         ], info_str=(ObjectName, "Change Bindery Object Password: %s", ", %s"))
7563         pkt.Reply(8)
7564         pkt.CompletionCodes([0x0000, 0x9600, 0xc501, 0xd701, 0xe800, 0xec01, 0xf001,
7565                              0xf100, 0xf800, 0xfb02, 0xfc03, 0xfe01, 0xff00])
7566         # 2222/1741, 23/65
7567         pkt = NCP(0x1741, "Add Bindery Object To Set", 'bindery')
7568         pkt.Request((19,128), [
7569                 rec( 10, 2, ObjectType, BE ),
7570                 rec( 12, (1,48), ObjectName ),
7571                 rec( -1, (1,16), PropertyName ),
7572                 rec( -1, 4, MemberType, BE ),
7573                 rec( -1, (1,48), MemberName ),
7574         ], info_str=(MemberName, "Add Bindery Object to Set: %s", ", %s"))
7575         pkt.Reply(8)
7576         pkt.CompletionCodes([0x0000, 0x9600, 0xe800, 0xe900, 0xea00, 0xeb00,
7577                              0xec01, 0xf000, 0xf800, 0xfb02, 0xfc03, 0xfe01,
7578                              0xff00])
7579         # 2222/1742, 23/66
7580         pkt = NCP(0x1742, "Delete Bindery Object From Set", 'bindery')
7581         pkt.Request((19,128), [
7582                 rec( 10, 2, ObjectType, BE ),
7583                 rec( 12, (1,48), ObjectName ),
7584                 rec( -1, (1,16), PropertyName ),
7585                 rec( -1, 4, MemberType, BE ),
7586                 rec( -1, (1,48), MemberName ),
7587         ], info_str=(MemberName, "Delete Bindery Object from Set: %s", ", %s"))
7588         pkt.Reply(8)
7589         pkt.CompletionCodes([0x0000, 0x9600, 0xeb00, 0xf000, 0xf800, 0xfb02,
7590                              0xfc03, 0xfe01, 0xff00])
7591         # 2222/1743, 23/67
7592         pkt = NCP(0x1743, "Is Bindery Object In Set", 'bindery')
7593         pkt.Request((19,128), [
7594                 rec( 10, 2, ObjectType, BE ),
7595                 rec( 12, (1,48), ObjectName ),
7596                 rec( -1, (1,16), PropertyName ),
7597                 rec( -1, 4, MemberType, BE ),
7598                 rec( -1, (1,48), MemberName ),
7599         ], info_str=(MemberName, "Is Bindery Object in Set: %s", ", %s"))
7600         pkt.Reply(8)
7601         pkt.CompletionCodes([0x0000, 0x9600, 0xea00, 0xeb00, 0xec01, 0xf000,
7602                              0xfb02, 0xfc03, 0xfe01, 0xff00])
7603         # 2222/1744, 23/68
7604         pkt = NCP(0x1744, "Close Bindery", 'bindery')
7605         pkt.Request(10)
7606         pkt.Reply(8)
7607         pkt.CompletionCodes([0x0000, 0xff00])
7608         # 2222/1745, 23/69
7609         pkt = NCP(0x1745, "Open Bindery", 'bindery')
7610         pkt.Request(10)
7611         pkt.Reply(8)
7612         pkt.CompletionCodes([0x0000, 0xff00])
7613         # 2222/1746, 23/70
7614         pkt = NCP(0x1746, "Get Bindery Access Level", 'bindery')
7615         pkt.Request(10)
7616         pkt.Reply(13, [
7617                 rec( 8, 1, ObjectSecurity ),
7618                 rec( 9, 4, LoggedObjectID, BE ),
7619         ])
7620         pkt.CompletionCodes([0x0000, 0x9600])
7621         # 2222/1747, 23/71
7622         pkt = NCP(0x1747, "Scan Bindery Object Trustee Paths", 'bindery')
7623         pkt.Request(17, [
7624                 rec( 10, 1, VolumeNumber ),
7625                 rec( 11, 2, LastSequenceNumber, BE ),
7626                 rec( 13, 4, ObjectID, BE ),
7627         ])
7628         pkt.Reply((16,270), [
7629                 rec( 8, 2, LastSequenceNumber, BE),
7630                 rec( 10, 4, ObjectID, BE ),
7631                 rec( 14, 1, ObjectSecurity ),
7632                 rec( 15, (1,255), Path ),
7633         ])
7634         pkt.CompletionCodes([0x0000, 0x9300, 0x9600, 0xa100, 0xf000, 0xf100,
7635                              0xf200, 0xfc02, 0xfe01, 0xff00])
7636         # 2222/1748, 23/72
7637         pkt = NCP(0x1748, "Get Bindery Object Access Level", 'bindery')
7638         pkt.Request(14, [
7639                 rec( 10, 4, ObjectID, BE ),
7640         ])
7641         pkt.Reply(9, [
7642                 rec( 8, 1, ObjectSecurity ),
7643         ])
7644         pkt.CompletionCodes([0x0000, 0x9600])
7645         # 2222/1749, 23/73
7646         pkt = NCP(0x1749, "Is Calling Station a Manager", 'bindery')
7647         pkt.Request(10)
7648         pkt.Reply(8)
7649         pkt.CompletionCodes([0x0003, 0xff1e])
7650         # 2222/174A, 23/74
7651         pkt = NCP(0x174A, "Keyed Verify Password", 'bindery')
7652         pkt.Request((21,68), [
7653                 rec( 10, 8, LoginKey ),
7654                 rec( 18, 2, ObjectType, BE ),
7655                 rec( 20, (1,48), ObjectName ),
7656         ], info_str=(ObjectName, "Keyed Verify Password: %s", ", %s"))
7657         pkt.Reply(8)
7658         pkt.CompletionCodes([0x0000, 0xc500, 0xfe01, 0xff0c])
7659         # 2222/174B, 23/75
7660         pkt = NCP(0x174B, "Keyed Change Password", 'bindery')
7661         pkt.Request((22,100), [
7662                 rec( 10, 8, LoginKey ),
7663                 rec( 18, 2, ObjectType, BE ),
7664                 rec( 20, (1,48), ObjectName ),
7665                 rec( -1, (1,32), Password ),
7666         ], info_str=(ObjectName, "Keyed Change Password: %s", ", %s"))
7667         pkt.Reply(8)
7668         pkt.CompletionCodes([0x0000, 0xc500, 0xfe01, 0xff0c])
7669         # 2222/174C, 23/76
7670         pkt = NCP(0x174C, "List Relations Of an Object", 'bindery')
7671         pkt.Request((18,80), [
7672                 rec( 10, 4, LastSeen, BE ),
7673                 rec( 14, 2, ObjectType, BE ),
7674                 rec( 16, (1,48), ObjectName ),
7675                 rec( -1, (1,16), PropertyName ),
7676         ], info_str=(ObjectName, "List Relations of an Object: %s", ", %s"))
7677         pkt.Reply(14, [
7678                 rec( 8, 2, RelationsCount, BE, var="x" ),
7679                 rec( 10, 4, ObjectID, BE, repeat="x" ),
7680         ])
7681         pkt.CompletionCodes([0x0000, 0xf000, 0xf200, 0xfe01, 0xff00])
7682         # 2222/1764, 23/100
7683         pkt = NCP(0x1764, "Create Queue", 'qms')
7684         pkt.Request((15,316), [
7685                 rec( 10, 2, QueueType, BE ),
7686                 rec( 12, (1,48), QueueName ),
7687                 rec( -1, 1, PathBase ),
7688                 rec( -1, (1,255), Path ),
7689         ], info_str=(QueueName, "Create Queue: %s", ", %s"))
7690         pkt.Reply(12, [
7691                 rec( 8, 4, QueueID, BE ),
7692         ])
7693         pkt.CompletionCodes([0x0000, 0x9600, 0x9900, 0xd000, 0xd100,
7694                              0xd200, 0xd300, 0xd400, 0xd500, 0xd601,
7695                              0xd703, 0xd800, 0xd902, 0xda01, 0xdb02,
7696                              0xee00, 0xff00])
7697         # 2222/1765, 23/101
7698         pkt = NCP(0x1765, "Destroy Queue", 'qms')
7699         pkt.Request(14, [
7700                 rec( 10, 4, QueueID, BE ),
7701         ])
7702         pkt.Reply(8)
7703         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
7704                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
7705                              0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
7706         # 2222/1766, 23/102
7707         pkt = NCP(0x1766, "Read Queue Current Status", 'qms')
7708         pkt.Request(14, [
7709                 rec( 10, 4, QueueID, BE ),
7710         ])
7711         pkt.Reply(20, [
7712                 rec( 8, 4, QueueID, BE ),
7713                 rec( 12, 1, QueueStatus ),
7714                 rec( 13, 1, CurrentEntries ),
7715                 rec( 14, 1, CurrentServers, var="x" ),
7716                 rec( 15, 4, ServerIDList, repeat="x" ),
7717                 rec( 19, 1, ServerStationList, repeat="x" ),
7718         ])
7719         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
7720                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
7721                              0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
7722         # 2222/1767, 23/103
7723         pkt = NCP(0x1767, "Set Queue Current Status", 'qms')
7724         pkt.Request(15, [
7725                 rec( 10, 4, QueueID, BE ),
7726                 rec( 14, 1, QueueStatus ),
7727         ])
7728         pkt.Reply(8)
7729         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
7730                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
7731                              0xd800, 0xd902, 0xda01, 0xdb02, 0xfc07,
7732                              0xff00])
7733         # 2222/1768, 23/104
7734         pkt = NCP(0x1768, "Create Queue Job And File", 'qms')
7735         pkt.Request(264, [
7736                 rec( 10, 4, QueueID, BE ),
7737                 rec( 14, 250, JobStruct ),
7738         ])
7739         pkt.Reply(62, [
7740                 rec( 8, 1, ClientStation ),
7741                 rec( 9, 1, ClientTaskNumber ),
7742                 rec( 10, 4, ClientIDNumber, BE ),
7743                 rec( 14, 4, TargetServerIDNumber, BE ),
7744                 rec( 18, 6, TargetExecutionTime ),
7745                 rec( 24, 6, JobEntryTime ),
7746                 rec( 30, 2, JobNumber, BE ),
7747                 rec( 32, 2, JobType, BE ),
7748                 rec( 34, 1, JobPosition ),
7749                 rec( 35, 1, JobControlFlags ),
7750                 rec( 36, 14, JobFileName ),
7751                 rec( 50, 6, JobFileHandle ),
7752                 rec( 56, 1, ServerStation ),
7753                 rec( 57, 1, ServerTaskNumber ),
7754                 rec( 58, 4, ServerID, BE ),
7755         ])              
7756         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
7757                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
7758                              0xd800, 0xd902, 0xda01, 0xdb02, 0xfc07,
7759                              0xff00])
7760         # 2222/1769, 23/105
7761         pkt = NCP(0x1769, "Close File And Start Queue Job", 'qms')
7762         pkt.Request(16, [
7763                 rec( 10, 4, QueueID, BE ),
7764                 rec( 14, 2, JobNumber, BE ),
7765         ])
7766         pkt.Reply(8)
7767         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
7768                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
7769                              0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
7770         # 2222/176A, 23/106
7771         pkt = NCP(0x176A, "Remove Job From Queue", 'qms')
7772         pkt.Request(16, [
7773                 rec( 10, 4, QueueID, BE ),
7774                 rec( 14, 2, JobNumber, BE ),
7775         ])
7776         pkt.Reply(8)
7777         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
7778                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
7779                              0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
7780         # 2222/176B, 23/107
7781         pkt = NCP(0x176B, "Get Queue Job List", 'qms')
7782         pkt.Request(14, [
7783                 rec( 10, 4, QueueID, BE ),
7784         ])
7785         pkt.Reply(12, [
7786                 rec( 8, 2, JobCount, BE, var="x" ),
7787                 rec( 10, 2, JobNumber, BE, repeat="x" ),
7788         ])
7789         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
7790                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
7791                              0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
7792         # 2222/176C, 23/108
7793         pkt = NCP(0x176C, "Read Queue Job Entry", 'qms')
7794         pkt.Request(16, [
7795                 rec( 10, 4, QueueID, BE ),
7796                 rec( 14, 2, JobNumber, BE ),
7797         ])
7798         pkt.Reply(258, [
7799             rec( 8, 250, JobStruct ),
7800         ])              
7801         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
7802                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
7803                              0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
7804         # 2222/176D, 23/109
7805         pkt = NCP(0x176D, "Change Queue Job Entry", 'qms')
7806         pkt.Request(260, [
7807             rec( 14, 250, JobStruct ),
7808         ])
7809         pkt.Reply(8)            
7810         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
7811                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
7812                              0xd800, 0xd902, 0xda01, 0xdb02, 0xff18])
7813         # 2222/176E, 23/110
7814         pkt = NCP(0x176E, "Change Queue Job Position", 'qms')
7815         pkt.Request(17, [
7816                 rec( 10, 4, QueueID, BE ),
7817                 rec( 14, 2, JobNumber, BE ),
7818                 rec( 16, 1, NewPosition ),
7819         ])
7820         pkt.Reply(8)
7821         pkt.CompletionCodes([0x0000, 0x9600, 0xd000, 0xd100, 0xd500,
7822                              0xd601, 0xfe07, 0xff1f])
7823         # 2222/176F, 23/111
7824         pkt = NCP(0x176F, "Attach Queue Server To Queue", 'qms')
7825         pkt.Request(14, [
7826                 rec( 10, 4, QueueID, BE ),
7827         ])
7828         pkt.Reply(8)
7829         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
7830                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
7831                              0xd800, 0xd902, 0xda01, 0xdb02, 0xea00,
7832                              0xfc06, 0xff00])
7833         # 2222/1770, 23/112
7834         pkt = NCP(0x1770, "Detach Queue Server From Queue", 'qms')
7835         pkt.Request(14, [
7836                 rec( 10, 4, QueueID, BE ),
7837         ])
7838         pkt.Reply(8)
7839         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
7840                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
7841                              0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
7842         # 2222/1771, 23/113
7843         pkt = NCP(0x1771, "Service Queue Job", 'qms')
7844         pkt.Request(16, [
7845                 rec( 10, 4, QueueID, BE ),
7846                 rec( 14, 2, ServiceType, BE ),
7847         ])
7848         pkt.Reply(62, [
7849                 rec( 8, 1, ClientStation ),
7850                 rec( 9, 1, ClientTaskNumber ),
7851                 rec( 10, 4, ClientIDNumber, BE ),
7852                 rec( 14, 4, TargetServerIDNumber, BE ),
7853                 rec( 18, 6, TargetExecutionTime ),
7854                 rec( 24, 6, JobEntryTime ),
7855                 rec( 30, 2, JobNumber, BE ),
7856                 rec( 32, 2, JobType, BE ),
7857                 rec( 34, 1, JobPosition ),
7858                 rec( 35, 1, JobControlFlags ),
7859                 rec( 36, 14, JobFileName ),
7860                 rec( 50, 6, JobFileHandle ),
7861                 rec( 56, 1, ServerStation ),
7862                 rec( 57, 1, ServerTaskNumber ),
7863                 rec( 58, 4, ServerID, BE ),
7864         ])              
7865         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
7866                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
7867                              0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
7868         # 2222/1772, 23/114
7869         pkt = NCP(0x1772, "Finish Servicing Queue Job", 'qms')
7870         pkt.Request(20, [
7871                 rec( 10, 4, QueueID, BE ),
7872                 rec( 14, 2, JobNumber, BE ),
7873                 rec( 16, 4, ChargeInformation, BE ),
7874         ])
7875         pkt.Reply(8)            
7876         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
7877                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
7878                              0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
7879         # 2222/1773, 23/115
7880         pkt = NCP(0x1773, "Abort Servicing Queue Job", 'qms')
7881         pkt.Request(16, [
7882                 rec( 10, 4, QueueID, BE ),
7883                 rec( 14, 2, JobNumber, BE ),
7884         ])
7885         pkt.Reply(8)            
7886         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
7887                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
7888                              0xd800, 0xd902, 0xda01, 0xdb02, 0xff18])
7889         # 2222/1774, 23/116
7890         pkt = NCP(0x1774, "Change To Client Rights", 'qms')
7891         pkt.Request(16, [
7892                 rec( 10, 4, QueueID, BE ),
7893                 rec( 14, 2, JobNumber, BE ),
7894         ])
7895         pkt.Reply(8)            
7896         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
7897                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
7898                              0xd800, 0xd902, 0xda01, 0xdb02, 0xff18])
7899         # 2222/1775, 23/117
7900         pkt = NCP(0x1775, "Restore Queue Server Rights", 'qms')
7901         pkt.Request(10)
7902         pkt.Reply(8)            
7903         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
7904                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
7905                              0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
7906         # 2222/1776, 23/118
7907         pkt = NCP(0x1776, "Read Queue Server Current Status", 'qms')
7908         pkt.Request(19, [
7909                 rec( 10, 4, QueueID, BE ),
7910                 rec( 14, 4, ServerID, BE ),
7911                 rec( 18, 1, ServerStation ),
7912         ])
7913         pkt.Reply(72, [
7914                 rec( 8, 64, ServerStatusRecord ),
7915         ])
7916         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
7917                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
7918                              0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
7919         # 2222/1777, 23/119
7920         pkt = NCP(0x1777, "Set Queue Server Current Status", 'qms')
7921         pkt.Request(78, [
7922                 rec( 10, 4, QueueID, BE ),
7923                 rec( 14, 64, ServerStatusRecord ),
7924         ])
7925         pkt.Reply(8)
7926         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
7927                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
7928                              0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
7929         # 2222/1778, 23/120
7930         pkt = NCP(0x1778, "Get Queue Job File Size", 'qms')
7931         pkt.Request(16, [
7932                 rec( 10, 4, QueueID, BE ),
7933                 rec( 14, 2, JobNumber, BE ),
7934         ])
7935         pkt.Reply(20, [
7936                 rec( 8, 4, QueueID, BE ),
7937                 rec( 12, 4, JobNumberLong ),
7938                 rec( 16, 4, FileSize, BE ),
7939         ])
7940         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
7941                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
7942                              0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
7943         # 2222/1779, 23/121
7944         pkt = NCP(0x1779, "Create Queue Job And File", 'qms')
7945         pkt.Request(264, [
7946                 rec( 10, 4, QueueID, BE ),
7947                 rec( 14, 250, JobStruct ),
7948         ])
7949         pkt.Reply(94, [
7950                 rec( 8, 86, JobStructNew ),
7951         ])              
7952         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
7953                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
7954                              0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
7955         # 2222/177A, 23/122
7956         pkt = NCP(0x177A, "Read Queue Job Entry", 'qms')
7957         pkt.Request(18, [
7958                 rec( 10, 4, QueueID, BE ),
7959                 rec( 14, 4, JobNumberLong ),
7960         ])
7961         pkt.Reply(258, [
7962             rec( 8, 250, JobStruct ),
7963         ])              
7964         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
7965                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
7966                              0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
7967         # 2222/177B, 23/123
7968         pkt = NCP(0x177B, "Change Queue Job Entry", 'qms')
7969         pkt.Request(264, [
7970                 rec( 10, 4, QueueID, BE ),
7971                 rec( 14, 250, JobStruct ),
7972         ])
7973         pkt.Reply(8)            
7974         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
7975                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
7976                              0xd800, 0xd902, 0xda01, 0xdb02, 0xfc07, 0xff00])
7977         # 2222/177C, 23/124
7978         pkt = NCP(0x177C, "Service Queue Job", 'qms')
7979         pkt.Request(16, [
7980                 rec( 10, 4, ObjectID, BE ),
7981                 rec( 14, 2, ServiceType ),
7982         ])
7983         pkt.Reply(94, [
7984             rec( 8, 86, JobStructNew ),
7985         ])              
7986         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
7987                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
7988                              0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
7989         # 2222/177D, 23/125
7990         pkt = NCP(0x177D, "Read Queue Current Status", 'qms')
7991         pkt.Request(14, [
7992                 rec( 10, 4, QueueID, BE ),
7993         ])
7994         pkt.Reply(32, [
7995                 rec( 8, 4, QueueID, BE ),
7996                 rec( 12, 1, QueueStatus ),
7997                 rec( 13, 3, Reserved3 ),
7998                 rec( 16, 4, CurrentEntries ),
7999                 rec( 20, 4, CurrentServers, var="x" ),
8000                 rec( 24, 4, ServerIDList, repeat="x" ),
8001                 rec( 28, 4, ServerStationList, repeat="x" ),
8002         ])
8003         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
8004                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
8005                              0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
8006         # 2222/177E, 23/126
8007         pkt = NCP(0x177E, "Set Queue Current Status", 'qms')
8008         pkt.Request(15, [
8009                 rec( 10, 4, QueueID, BE ),
8010                 rec( 14, 1, QueueStatus ),
8011         ])
8012         pkt.Reply(8)
8013         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
8014                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
8015                              0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
8016         # 2222/177F, 23/127
8017         pkt = NCP(0x177F, "Close File And Start Queue Job", 'qms')
8018         pkt.Request(18, [
8019                 rec( 10, 4, QueueID, BE ),
8020                 rec( 14, 4, JobNumberLong ),
8021         ])
8022         pkt.Reply(8)
8023         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
8024                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
8025                              0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
8026         # 2222/1780, 23/128
8027         pkt = NCP(0x1780, "Remove Job From Queue", 'qms')
8028         pkt.Request(18, [
8029                 rec( 10, 4, QueueID, BE ),
8030                 rec( 14, 4, JobNumberLong ),
8031         ])
8032         pkt.Reply(8)
8033         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
8034                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
8035                              0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
8036         # 2222/1781, 23/129
8037         pkt = NCP(0x1781, "Get Queue Job List", 'qms')
8038         pkt.Request(18, [
8039                 rec( 10, 4, QueueID, BE ),
8040                 rec( 14, 4, JobNumberLong ),
8041         ])
8042         pkt.Reply(20, [
8043                 rec( 8, 4, TotalQueueJobs ),
8044                 rec( 12, 4, ReplyQueueJobNumbers, var="x" ),
8045                 rec( 16, 4, JobNumberList, repeat="x" ),
8046         ])
8047         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
8048                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
8049                              0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
8050         # 2222/1782, 23/130
8051         pkt = NCP(0x1782, "Change Job Priority", 'qms')
8052         pkt.Request(22, [
8053                 rec( 10, 4, QueueID, BE ),
8054                 rec( 14, 4, JobNumberLong ),
8055                 rec( 18, 4, Priority ),
8056         ])
8057         pkt.Reply(8)
8058         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
8059                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
8060                              0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
8061         # 2222/1783, 23/131
8062         pkt = NCP(0x1783, "Finish Servicing Queue Job", 'qms')
8063         pkt.Request(22, [
8064                 rec( 10, 4, QueueID, BE ),
8065                 rec( 14, 4, JobNumberLong ),
8066                 rec( 18, 4, ChargeInformation ),
8067         ])
8068         pkt.Reply(8)            
8069         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
8070                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
8071                              0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
8072         # 2222/1784, 23/132
8073         pkt = NCP(0x1784, "Abort Servicing Queue Job", 'qms')
8074         pkt.Request(18, [
8075                 rec( 10, 4, QueueID, BE ),
8076                 rec( 14, 4, JobNumberLong ),
8077         ])
8078         pkt.Reply(8)            
8079         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
8080                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
8081                              0xd800, 0xd902, 0xda01, 0xdb02, 0xff18])
8082         # 2222/1785, 23/133
8083         pkt = NCP(0x1785, "Change To Client Rights", 'qms')
8084         pkt.Request(18, [
8085                 rec( 10, 4, QueueID, BE ),
8086                 rec( 14, 4, JobNumberLong ),
8087         ])
8088         pkt.Reply(8)            
8089         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
8090                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
8091                              0xd800, 0xd902, 0xda01, 0xdb02, 0xff18])
8092         # 2222/1786, 23/134
8093         pkt = NCP(0x1786, "Read Queue Server Current Status", 'qms')
8094         pkt.Request(22, [
8095                 rec( 10, 4, QueueID, BE ),
8096                 rec( 14, 4, ServerID, BE ),
8097                 rec( 18, 4, ServerStation ),
8098         ])
8099         pkt.Reply(72, [
8100                 rec( 8, 64, ServerStatusRecord ),
8101         ])
8102         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
8103                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
8104                              0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
8105         # 2222/1787, 23/135
8106         pkt = NCP(0x1787, "Get Queue Job File Size", 'qms')
8107         pkt.Request(18, [
8108                 rec( 10, 4, QueueID, BE ),
8109                 rec( 14, 4, JobNumberLong ),
8110         ])
8111         pkt.Reply(20, [
8112                 rec( 8, 4, QueueID, BE ),
8113                 rec( 12, 4, JobNumberLong ),
8114                 rec( 16, 4, FileSize, BE ),
8115         ])
8116         pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
8117                              0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
8118                              0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
8119         # 2222/1788, 23/136
8120         pkt = NCP(0x1788, "Move Queue Job From Src Q to Dst Q", 'qms')
8121         pkt.Request(22, [
8122                 rec( 10, 4, QueueID, BE ),
8123                 rec( 14, 4, JobNumberLong ),
8124                 rec( 18, 4, DstQueueID, BE ),
8125         ])
8126         pkt.Reply(12, [
8127                 rec( 8, 4, JobNumberLong ),
8128         ])
8129         pkt.CompletionCodes([0x0000, 0x7e01, 0xfc06])
8130         # 2222/1789, 23/137
8131         pkt = NCP(0x1789, "Get Queue Jobs From Form List", 'qms')
8132         pkt.Request(24, [
8133                 rec( 10, 4, QueueID, BE ),
8134                 rec( 14, 4, QueueStartPosition ),
8135                 rec( 18, 4, FormTypeCnt, var="x" ),
8136                 rec( 22, 2, FormType, repeat="x" ),
8137         ])
8138         pkt.Reply(20, [
8139                 rec( 8, 4, TotalQueueJobs ),
8140                 rec( 12, 4, JobCount, var="x" ),
8141                 rec( 16, 4, JobNumberList, repeat="x" ),
8142         ])
8143         pkt.CompletionCodes([0x0000, 0x7e01, 0xfc06])
8144         # 2222/178A, 23/138
8145         pkt = NCP(0x178A, "Service Queue Job By Form List", 'qms')
8146         pkt.Request(24, [
8147                 rec( 10, 4, QueueID, BE ),
8148                 rec( 14, 4, QueueStartPosition ),
8149                 rec( 18, 4, FormTypeCnt, var= "x" ),
8150                 rec( 22, 2, FormType, repeat="x" ),
8151         ])
8152         pkt.Reply(94, [
8153            rec( 8, 86, JobStructNew ),
8154         ])              
8155         pkt.CompletionCodes([0x0000, 0x7e01, 0xfc06])
8156         # 2222/1796, 23/150
8157         pkt = NCP(0x1796, "Get Current Account Status", 'accounting')
8158         pkt.Request((13,60), [
8159                 rec( 10, 2, ObjectType, BE ),
8160                 rec( 12, (1,48), ObjectName ),
8161         ], info_str=(ObjectName, "Get Current Account Status: %s", ", %s"))
8162         pkt.Reply(264, [
8163                 rec( 8, 4, AccountBalance, BE ),
8164                 rec( 12, 4, CreditLimit, BE ),
8165                 rec( 16, 120, Reserved120 ),
8166                 rec( 136, 4, HolderID, BE ),
8167                 rec( 140, 4, HoldAmount, BE ),
8168                 rec( 144, 4, HolderID, BE ),
8169                 rec( 148, 4, HoldAmount, BE ),
8170                 rec( 152, 4, HolderID, BE ),
8171                 rec( 156, 4, HoldAmount, BE ),
8172                 rec( 160, 4, HolderID, BE ),
8173                 rec( 164, 4, HoldAmount, BE ),
8174                 rec( 168, 4, HolderID, BE ),
8175                 rec( 172, 4, HoldAmount, BE ),
8176                 rec( 176, 4, HolderID, BE ),
8177                 rec( 180, 4, HoldAmount, BE ),
8178                 rec( 184, 4, HolderID, BE ),
8179                 rec( 188, 4, HoldAmount, BE ),
8180                 rec( 192, 4, HolderID, BE ),
8181                 rec( 196, 4, HoldAmount, BE ),
8182                 rec( 200, 4, HolderID, BE ),
8183                 rec( 204, 4, HoldAmount, BE ),
8184                 rec( 208, 4, HolderID, BE ),
8185                 rec( 212, 4, HoldAmount, BE ),
8186                 rec( 216, 4, HolderID, BE ),
8187                 rec( 220, 4, HoldAmount, BE ),
8188                 rec( 224, 4, HolderID, BE ),
8189                 rec( 228, 4, HoldAmount, BE ),
8190                 rec( 232, 4, HolderID, BE ),
8191                 rec( 236, 4, HoldAmount, BE ),
8192                 rec( 240, 4, HolderID, BE ),
8193                 rec( 244, 4, HoldAmount, BE ),
8194                 rec( 248, 4, HolderID, BE ),
8195                 rec( 252, 4, HoldAmount, BE ),
8196                 rec( 256, 4, HolderID, BE ),
8197                 rec( 260, 4, HoldAmount, BE ),
8198         ])              
8199         pkt.CompletionCodes([0x0000, 0x9600, 0xc000, 0xc101, 0xc400, 0xe800,
8200                              0xea00, 0xeb00, 0xec00, 0xfc06, 0xfe07, 0xff00])
8201         # 2222/1797, 23/151
8202         pkt = NCP(0x1797, "Submit Account Charge", 'accounting')
8203         pkt.Request((26,327), [
8204                 rec( 10, 2, ServiceType, BE ),
8205                 rec( 12, 4, ChargeAmount, BE ),
8206                 rec( 16, 4, HoldCancelAmount, BE ),
8207                 rec( 20, 2, ObjectType, BE ),
8208                 rec( 22, 2, CommentType, BE ),
8209                 rec( 24, (1,48), ObjectName ),
8210                 rec( -1, (1,255), Comment ),
8211         ], info_str=(ObjectName, "Submit Account Charge: %s", ", %s"))
8212         pkt.Reply(8)            
8213         pkt.CompletionCodes([0x0000, 0x0102, 0x8800, 0x9400, 0x9600, 0xa201,
8214                              0xc000, 0xc101, 0xc200, 0xc400, 0xe800, 0xea00,
8215                              0xeb00, 0xec00, 0xfe07, 0xff00])
8216         # 2222/1798, 23/152
8217         pkt = NCP(0x1798, "Submit Account Hold", 'accounting')
8218         pkt.Request((17,64), [
8219                 rec( 10, 4, HoldCancelAmount, BE ),
8220                 rec( 14, 2, ObjectType, BE ),
8221                 rec( 16, (1,48), ObjectName ),
8222         ], info_str=(ObjectName, "Submit Account Hold: %s", ", %s"))
8223         pkt.Reply(8)            
8224         pkt.CompletionCodes([0x0000, 0x0102, 0x8800, 0x9400, 0x9600, 0xa201,
8225                              0xc000, 0xc101, 0xc200, 0xc400, 0xe800, 0xea00,
8226                              0xeb00, 0xec00, 0xfe07, 0xff00])
8227         # 2222/1799, 23/153
8228         pkt = NCP(0x1799, "Submit Account Note", 'accounting')
8229         pkt.Request((18,319), [
8230                 rec( 10, 2, ServiceType, BE ),
8231                 rec( 12, 2, ObjectType, BE ),
8232                 rec( 14, 2, CommentType, BE ),
8233                 rec( 16, (1,48), ObjectName ),
8234                 rec( -1, (1,255), Comment ),
8235         ], info_str=(ObjectName, "Submit Account Note: %s", ", %s"))
8236         pkt.Reply(8)            
8237         pkt.CompletionCodes([0x0000, 0x0102, 0x9600, 0xc000, 0xc101, 0xc400,
8238                              0xe800, 0xea00, 0xeb00, 0xec00, 0xf000, 0xfc06,
8239                              0xff00])
8240         # 2222/17c8, 23/200
8241         pkt = NCP(0x17c8, "Check Console Privileges", 'stats')
8242         pkt.Request(10)
8243         pkt.Reply(8)            
8244         pkt.CompletionCodes([0x0000, 0xc601])
8245         # 2222/17c9, 23/201
8246         pkt = NCP(0x17c9, "Get File Server Description Strings", 'stats')
8247         pkt.Request(10)
8248         pkt.Reply(520, [
8249                 rec( 8, 512, DescriptionStrings ),
8250         ])
8251         pkt.CompletionCodes([0x0000, 0x9600])
8252         # 2222/17CA, 23/202
8253         pkt = NCP(0x17CA, "Set File Server Date And Time", 'stats')
8254         pkt.Request(16, [
8255                 rec( 10, 1, Year ),
8256                 rec( 11, 1, Month ),
8257                 rec( 12, 1, Day ),
8258                 rec( 13, 1, Hour ),
8259                 rec( 14, 1, Minute ),
8260                 rec( 15, 1, Second ),
8261         ])
8262         pkt.Reply(8)
8263         pkt.CompletionCodes([0x0000, 0xc601])
8264         # 2222/17CB, 23/203
8265         pkt = NCP(0x17CB, "Disable File Server Login", 'stats')
8266         pkt.Request(10)
8267         pkt.Reply(8)
8268         pkt.CompletionCodes([0x0000, 0xc601])
8269         # 2222/17CC, 23/204
8270         pkt = NCP(0x17CC, "Enable File Server Login", 'stats')
8271         pkt.Request(10)
8272         pkt.Reply(8)
8273         pkt.CompletionCodes([0x0000, 0xc601])
8274         # 2222/17CD, 23/205
8275         pkt = NCP(0x17CD, "Get File Server Login Status", 'stats')
8276         pkt.Request(10)
8277         pkt.Reply(12, [
8278                 rec( 8, 4, UserLoginAllowed ),
8279         ])
8280         pkt.CompletionCodes([0x0000, 0x9600, 0xfb01])
8281         # 2222/17CF, 23/207
8282         pkt = NCP(0x17CF, "Disable Transaction Tracking", 'stats')
8283         pkt.Request(10)
8284         pkt.Reply(8)
8285         pkt.CompletionCodes([0x0000, 0xc601])
8286         # 2222/17D0, 23/208
8287         pkt = NCP(0x17D0, "Enable Transaction Tracking", 'stats')
8288         pkt.Request(10)
8289         pkt.Reply(8)
8290         pkt.CompletionCodes([0x0000, 0xc601])
8291         # 2222/17D1, 23/209
8292         pkt = NCP(0x17D1, "Send Console Broadcast", 'stats')
8293         pkt.Request((13,267), [
8294                 rec( 10, 1, NumberOfStations, var="x" ),
8295                 rec( 11, 1, StationList, repeat="x" ),
8296                 rec( 12, (1, 255), TargetMessage ),
8297         ], info_str=(TargetMessage, "Send Console Broadcast: %s", ", %s"))
8298         pkt.Reply(8)
8299         pkt.CompletionCodes([0x0000, 0xc601, 0xfd00])
8300         # 2222/17D2, 23/210
8301         pkt = NCP(0x17D2, "Clear Connection Number", 'stats')
8302         pkt.Request(11, [
8303                 rec( 10, 1, ConnectionNumber ),
8304         ])
8305         pkt.Reply(8)
8306         pkt.CompletionCodes([0x0000, 0xc601, 0xfd00])
8307         # 2222/17D3, 23/211
8308         pkt = NCP(0x17D3, "Down File Server", 'stats')
8309         pkt.Request(11, [
8310                 rec( 10, 1, ForceFlag ),
8311         ])
8312         pkt.Reply(8)
8313         pkt.CompletionCodes([0x0000, 0xc601, 0xff00])
8314         # 2222/17D4, 23/212
8315         pkt = NCP(0x17D4, "Get File System Statistics", 'stats')
8316         pkt.Request(10)
8317         pkt.Reply(50, [
8318                 rec( 8, 4, SystemIntervalMarker, BE ),
8319                 rec( 12, 2, ConfiguredMaxOpenFiles ),
8320                 rec( 14, 2, ActualMaxOpenFiles ),
8321                 rec( 16, 2, CurrentOpenFiles ),
8322                 rec( 18, 4, TotalFilesOpened ),
8323                 rec( 22, 4, TotalReadRequests ),
8324                 rec( 26, 4, TotalWriteRequests ),
8325                 rec( 30, 2, CurrentChangedFATs ),
8326                 rec( 32, 4, TotalChangedFATs ),
8327                 rec( 36, 2, FATWriteErrors ),
8328                 rec( 38, 2, FatalFATWriteErrors ),
8329                 rec( 40, 2, FATScanErrors ),
8330                 rec( 42, 2, ActualMaxIndexedFiles ),
8331                 rec( 44, 2, ActiveIndexedFiles ),
8332                 rec( 46, 2, AttachedIndexedFiles ),
8333                 rec( 48, 2, AvailableIndexedFiles ),
8334         ])
8335         pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xff00])
8336         # 2222/17D5, 23/213
8337         pkt = NCP(0x17D5, "Get Transaction Tracking Statistics", 'stats')
8338         pkt.Request((13,267), [
8339                 rec( 10, 2, LastRecordSeen ),
8340                 rec( 12, (1,255), SemaphoreName ),
8341         ])
8342         pkt.Reply(53, [
8343                 rec( 8, 4, SystemIntervalMarker, BE ),
8344                 rec( 12, 1, TransactionTrackingSupported ),
8345                 rec( 13, 1, TransactionTrackingEnabled ),
8346                 rec( 14, 2, TransactionVolumeNumber ),
8347                 rec( 16, 2, ConfiguredMaxSimultaneousTransactions ),
8348                 rec( 18, 2, ActualMaxSimultaneousTransactions ),
8349                 rec( 20, 2, CurrentTransactionCount ),
8350                 rec( 22, 4, TotalTransactionsPerformed ),
8351                 rec( 26, 4, TotalWriteTransactionsPerformed ),
8352                 rec( 30, 4, TotalTransactionsBackedOut ),
8353                 rec( 34, 2, TotalUnfilledBackoutRequests ),
8354                 rec( 36, 2, TransactionDiskSpace ),
8355                 rec( 38, 4, TransactionFATAllocations ),
8356                 rec( 42, 4, TransactionFileSizeChanges ),
8357                 rec( 46, 4, TransactionFilesTruncated ),
8358                 rec( 50, 1, NumberOfEntries, var="x" ),
8359                 rec( 51, 2, ConnTaskStruct, repeat="x" ),
8360         ])
8361         pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xff00])
8362         # 2222/17D6, 23/214
8363         pkt = NCP(0x17D6, "Read Disk Cache Statistics", 'stats')
8364         pkt.Request(10)
8365         pkt.Reply(86, [
8366                 rec( 8, 4, SystemIntervalMarker, BE ),
8367                 rec( 12, 2, CacheBufferCount ),
8368                 rec( 14, 2, CacheBufferSize ),
8369                 rec( 16, 2, DirtyCacheBuffers ),
8370                 rec( 18, 4, CacheReadRequests ),
8371                 rec( 22, 4, CacheWriteRequests ),
8372                 rec( 26, 4, CacheHits ),
8373                 rec( 30, 4, CacheMisses ),
8374                 rec( 34, 4, PhysicalReadRequests ),
8375                 rec( 38, 4, PhysicalWriteRequests ),
8376                 rec( 42, 2, PhysicalReadErrors ),
8377                 rec( 44, 2, PhysicalWriteErrors ),
8378                 rec( 46, 4, CacheGetRequests ),
8379                 rec( 50, 4, CacheFullWriteRequests ),
8380                 rec( 54, 4, CachePartialWriteRequests ),
8381                 rec( 58, 4, BackgroundDirtyWrites ),
8382                 rec( 62, 4, BackgroundAgedWrites ),
8383                 rec( 66, 4, TotalCacheWrites ),
8384                 rec( 70, 4, CacheAllocations ),
8385                 rec( 74, 2, ThrashingCount ),
8386                 rec( 76, 2, LRUBlockWasDirty ),
8387                 rec( 78, 2, ReadBeyondWrite ),
8388                 rec( 80, 2, FragmentWriteOccurred ),
8389                 rec( 82, 2, CacheHitOnUnavailableBlock ),
8390                 rec( 84, 2, CacheBlockScrapped ),
8391         ])
8392         pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xff00])
8393         # 2222/17D7, 23/215
8394         pkt = NCP(0x17D7, "Get Drive Mapping Table", 'stats')
8395         pkt.Request(10)
8396         pkt.Reply(184, [
8397                 rec( 8, 4, SystemIntervalMarker, BE ),
8398                 rec( 12, 1, SFTSupportLevel ),
8399                 rec( 13, 1, LogicalDriveCount ),
8400                 rec( 14, 1, PhysicalDriveCount ),
8401                 rec( 15, 1, DiskChannelTable ),
8402                 rec( 16, 4, Reserved4 ),
8403                 rec( 20, 2, PendingIOCommands, BE ),
8404                 rec( 22, 32, DriveMappingTable ),
8405                 rec( 54, 32, DriveMirrorTable ),
8406                 rec( 86, 32, DeadMirrorTable ),
8407                 rec( 118, 1, ReMirrorDriveNumber ),
8408                 rec( 119, 1, Filler ),
8409                 rec( 120, 4, ReMirrorCurrentOffset, BE ),
8410                 rec( 124, 60, SFTErrorTable ),
8411         ])
8412         pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xff00])
8413         # 2222/17D8, 23/216
8414         pkt = NCP(0x17D8, "Read Physical Disk Statistics", 'stats')
8415         pkt.Request(11, [
8416                 rec( 10, 1, PhysicalDiskNumber ),
8417         ])
8418         pkt.Reply(101, [
8419                 rec( 8, 4, SystemIntervalMarker, BE ),
8420                 rec( 12, 1, PhysicalDiskChannel ),
8421                 rec( 13, 1, DriveRemovableFlag ),
8422                 rec( 14, 1, PhysicalDriveType ),
8423                 rec( 15, 1, ControllerDriveNumber ),
8424                 rec( 16, 1, ControllerNumber ),
8425                 rec( 17, 1, ControllerType ),
8426                 rec( 18, 4, DriveSize ),
8427                 rec( 22, 2, DriveCylinders ),
8428                 rec( 24, 1, DriveHeads ),
8429                 rec( 25, 1, SectorsPerTrack ),
8430                 rec( 26, 64, DriveDefinitionString ),
8431                 rec( 90, 2, IOErrorCount ),
8432                 rec( 92, 4, HotFixTableStart ),
8433                 rec( 96, 2, HotFixTableSize ),
8434                 rec( 98, 2, HotFixBlocksAvailable ),
8435                 rec( 100, 1, HotFixDisabled ),
8436         ])
8437         pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xff00])
8438         # 2222/17D9, 23/217
8439         pkt = NCP(0x17D9, "Get Disk Channel Statistics", 'stats')
8440         pkt.Request(11, [
8441                 rec( 10, 1, DiskChannelNumber ),
8442         ])
8443         pkt.Reply(192, [
8444                 rec( 8, 4, SystemIntervalMarker, BE ),
8445                 rec( 12, 2, ChannelState, BE ),
8446                 rec( 14, 2, ChannelSynchronizationState, BE ),
8447                 rec( 16, 1, SoftwareDriverType ),
8448                 rec( 17, 1, SoftwareMajorVersionNumber ),
8449                 rec( 18, 1, SoftwareMinorVersionNumber ),
8450                 rec( 19, 65, SoftwareDescription ),
8451                 rec( 84, 8, IOAddressesUsed ),
8452                 rec( 92, 10, SharedMemoryAddresses ),
8453                 rec( 102, 4, InterruptNumbersUsed ),
8454                 rec( 106, 4, DMAChannelsUsed ),
8455                 rec( 110, 1, FlagBits ),
8456                 rec( 111, 1, Reserved ),
8457                 rec( 112, 80, ConfigurationDescription ),
8458         ])
8459         pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xff00])
8460         # 2222/17DB, 23/219
8461         pkt = NCP(0x17DB, "Get Connection's Open Files", 'file')
8462         pkt.Request(14, [
8463                 rec( 10, 2, ConnectionNumber ),
8464                 rec( 12, 2, LastRecordSeen, BE ),
8465         ])
8466         pkt.Reply(32, [
8467                 rec( 8, 2, NextRequestRecord ),
8468                 rec( 10, 1, NumberOfRecords, var="x" ),
8469                 rec( 11, 21, ConnStruct, repeat="x" ),
8470         ])
8471         pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xff00])
8472         # 2222/17DC, 23/220
8473         pkt = NCP(0x17DC, "Get Connection Using A File", 'file')
8474         pkt.Request((14,268), [
8475                 rec( 10, 2, LastRecordSeen, BE ),
8476                 rec( 12, 1, DirHandle ),
8477                 rec( 13, (1,255), Path ),
8478         ], info_str=(Path, "Get Connection Using File: %s", ", %s"))
8479         pkt.Reply(30, [
8480                 rec( 8, 2, UseCount, BE ),
8481                 rec( 10, 2, OpenCount, BE ),
8482                 rec( 12, 2, OpenForReadCount, BE ),
8483                 rec( 14, 2, OpenForWriteCount, BE ),
8484                 rec( 16, 2, DenyReadCount, BE ),
8485                 rec( 18, 2, DenyWriteCount, BE ),
8486                 rec( 20, 2, NextRequestRecord, BE ),
8487                 rec( 22, 1, Locked ),
8488                 rec( 23, 1, NumberOfRecords, var="x" ),
8489                 rec( 24, 6, ConnFileStruct, repeat="x" ),
8490         ])
8491         pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xff00])
8492         # 2222/17DD, 23/221
8493         pkt = NCP(0x17DD, "Get Physical Record Locks By Connection And File", 'file')
8494         pkt.Request(31, [
8495                 rec( 10, 2, TargetConnectionNumber ),
8496                 rec( 12, 2, LastRecordSeen, BE ),
8497                 rec( 14, 1, VolumeNumber ),
8498                 rec( 15, 2, DirectoryID ),
8499                 rec( 17, 14, FileName14 ),
8500         ], info_str=(FileName14, "Get Physical Record Locks by Connection and File: %s", ", %s"))
8501         pkt.Reply(22, [
8502                 rec( 8, 2, NextRequestRecord ),
8503                 rec( 10, 1, NumberOfLocks, var="x" ),
8504                 rec( 11, 1, Reserved ),
8505                 rec( 12, 10, LockStruct, repeat="x" ),
8506         ])
8507         pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
8508         # 2222/17DE, 23/222
8509         pkt = NCP(0x17DE, "Get Physical Record Locks By File", 'file')
8510         pkt.Request((14,268), [
8511                 rec( 10, 2, TargetConnectionNumber ),
8512                 rec( 12, 1, DirHandle ),
8513                 rec( 13, (1,255), Path ),
8514         ], info_str=(Path, "Get Physical Record Locks by File: %s", ", %s"))
8515         pkt.Reply(28, [
8516                 rec( 8, 2, NextRequestRecord ),
8517                 rec( 10, 1, NumberOfLocks, var="x" ),
8518                 rec( 11, 1, Reserved ),
8519                 rec( 12, 16, PhyLockStruct, repeat="x" ),
8520         ])
8521         pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
8522         # 2222/17DF, 23/223
8523         pkt = NCP(0x17DF, "Get Logical Records By Connection", 'file')
8524         pkt.Request(14, [
8525                 rec( 10, 2, TargetConnectionNumber ),
8526                 rec( 12, 2, LastRecordSeen, BE ),
8527         ])
8528         pkt.Reply((14,268), [
8529                 rec( 8, 2, NextRequestRecord ),
8530                 rec( 10, 1, NumberOfRecords, var="x" ),
8531                 rec( 11, (3, 257), LogLockStruct, repeat="x" ),
8532         ])
8533         pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
8534         # 2222/17E0, 23/224
8535         pkt = NCP(0x17E0, "Get Logical Record Information", 'file')
8536         pkt.Request((13,267), [
8537                 rec( 10, 2, LastRecordSeen ),
8538                 rec( 12, (1,255), LogicalRecordName ),
8539         ], info_str=(LogicalRecordName, "Get Logical Record Information: %s", ", %s"))
8540         pkt.Reply(20, [
8541                 rec( 8, 2, UseCount, BE ),
8542                 rec( 10, 2, ShareableLockCount, BE ),
8543                 rec( 12, 2, NextRequestRecord ),
8544                 rec( 14, 1, Locked ),
8545                 rec( 15, 1, NumberOfRecords, var="x" ),
8546                 rec( 16, 4, LogRecStruct, repeat="x" ),
8547         ])
8548         pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
8549         # 2222/17E1, 23/225
8550         pkt = NCP(0x17E1, "Get Connection's Semaphores", 'file')
8551         pkt.Request(14, [
8552                 rec( 10, 2, ConnectionNumber ),
8553                 rec( 12, 2, LastRecordSeen ),
8554         ])
8555         pkt.Reply((18,272), [
8556                 rec( 8, 2, NextRequestRecord ),
8557                 rec( 10, 2, NumberOfSemaphores, var="x" ),
8558                 rec( 12, (6,260), SemaStruct, repeat="x" ),
8559         ])
8560         pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
8561         # 2222/17E2, 23/226
8562         pkt = NCP(0x17E2, "Get Semaphore Information", 'file')
8563         pkt.Request((13,267), [
8564                 rec( 10, 2, LastRecordSeen ),
8565                 rec( 12, (1,255), SemaphoreName ),
8566         ], info_str=(SemaphoreName, "Get Semaphore Information: %s", ", %s"))
8567         pkt.Reply(17, [
8568                 rec( 8, 2, NextRequestRecord, BE ),
8569                 rec( 10, 2, OpenCount, BE ),
8570                 rec( 12, 1, SemaphoreValue ),
8571                 rec( 13, 1, NumberOfRecords, var="x" ),
8572                 rec( 14, 3, SemaInfoStruct, repeat="x" ),
8573         ])
8574         pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
8575         # 2222/17E3, 23/227
8576         pkt = NCP(0x17E3, "Get LAN Driver Configuration Information", 'stats')
8577         pkt.Request(11, [
8578                 rec( 10, 1, LANDriverNumber ),
8579         ])
8580         pkt.Reply(180, [
8581                 rec( 8, 4, NetworkAddress, BE ),
8582                 rec( 12, 6, HostAddress ),
8583                 rec( 18, 1, BoardInstalled ),
8584                 rec( 19, 1, OptionNumber ),
8585                 rec( 20, 160, ConfigurationText ),
8586         ])
8587         pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
8588         # 2222/17E5, 23/229
8589         pkt = NCP(0x17E5, "Get Connection Usage Statistics", 'stats')
8590         pkt.Request(12, [
8591                 rec( 10, 2, ConnectionNumber ),
8592         ])
8593         pkt.Reply(26, [
8594                 rec( 8, 2, NextRequestRecord ),
8595                 rec( 10, 6, BytesRead ),
8596                 rec( 16, 6, BytesWritten ),
8597                 rec( 22, 4, TotalRequestPackets ),
8598          ])
8599         pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
8600         # 2222/17E6, 23/230
8601         pkt = NCP(0x17E6, "Get Object's Remaining Disk Space", 'stats')
8602         pkt.Request(14, [
8603                 rec( 10, 4, ObjectID, BE ),
8604         ])
8605         pkt.Reply(21, [
8606                 rec( 8, 4, SystemIntervalMarker, BE ),
8607                 rec( 12, 4, ObjectID ),
8608                 rec( 16, 4, UnusedDiskBlocks, BE ),
8609                 rec( 20, 1, RestrictionsEnforced ),
8610          ])
8611         pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
8612         # 2222/17E7, 23/231
8613         pkt = NCP(0x17E7, "Get File Server LAN I/O Statistics", 'stats')
8614         pkt.Request(10)
8615         pkt.Reply(74, [
8616                 rec( 8, 4, SystemIntervalMarker, BE ),
8617                 rec( 12, 2, ConfiguredMaxRoutingBuffers ),
8618                 rec( 14, 2, ActualMaxUsedRoutingBuffers ),
8619                 rec( 16, 2, CurrentlyUsedRoutingBuffers ),
8620                 rec( 18, 4, TotalFileServicePackets ),
8621                 rec( 22, 2, TurboUsedForFileService ),
8622                 rec( 24, 2, PacketsFromInvalidConnection ),
8623                 rec( 26, 2, BadLogicalConnectionCount ),
8624                 rec( 28, 2, PacketsReceivedDuringProcessing ),
8625                 rec( 30, 2, RequestsReprocessed ),
8626                 rec( 32, 2, PacketsWithBadSequenceNumber ),
8627                 rec( 34, 2, DuplicateRepliesSent ),
8628                 rec( 36, 2, PositiveAcknowledgesSent ),
8629                 rec( 38, 2, PacketsWithBadRequestType ),
8630                 rec( 40, 2, AttachDuringProcessing ),
8631                 rec( 42, 2, AttachWhileProcessingAttach ),
8632                 rec( 44, 2, ForgedDetachedRequests ),
8633                 rec( 46, 2, DetachForBadConnectionNumber ),
8634                 rec( 48, 2, DetachDuringProcessing ),
8635                 rec( 50, 2, RepliesCancelled ),
8636                 rec( 52, 2, PacketsDiscardedByHopCount ),
8637                 rec( 54, 2, PacketsDiscardedUnknownNet ),
8638                 rec( 56, 2, IncomingPacketDiscardedNoDGroup ),
8639                 rec( 58, 2, OutgoingPacketDiscardedNoTurboBuffer ),
8640                 rec( 60, 2, IPXNotMyNetwork ),
8641                 rec( 62, 4, NetBIOSBroadcastWasPropogated ),
8642                 rec( 66, 4, TotalOtherPackets ),
8643                 rec( 70, 4, TotalRoutedPackets ),
8644          ])
8645         pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
8646         # 2222/17E8, 23/232
8647         pkt = NCP(0x17E8, "Get File Server Misc Information", 'stats')
8648         pkt.Request(10)
8649         pkt.Reply(40, [
8650                 rec( 8, 4, SystemIntervalMarker, BE ),
8651                 rec( 12, 1, ProcessorType ),
8652                 rec( 13, 1, Reserved ),
8653                 rec( 14, 1, NumberOfServiceProcesses ),
8654                 rec( 15, 1, ServerUtilizationPercentage ),
8655                 rec( 16, 2, ConfiguredMaxBinderyObjects ),
8656                 rec( 18, 2, ActualMaxBinderyObjects ),
8657                 rec( 20, 2, CurrentUsedBinderyObjects ),
8658                 rec( 22, 2, TotalServerMemory ),
8659                 rec( 24, 2, WastedServerMemory ),
8660                 rec( 26, 2, NumberOfDynamicMemoryAreas, var="x" ),
8661                 rec( 28, 12, DynMemStruct, repeat="x" ),
8662          ])
8663         pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
8664         # 2222/17E9, 23/233
8665         pkt = NCP(0x17E9, "Get Volume Information", 'stats')
8666         pkt.Request(11, [
8667                 rec( 10, 1, VolumeNumber ),
8668         ])
8669         pkt.Reply(48, [
8670                 rec( 8, 4, SystemIntervalMarker, BE ),
8671                 rec( 12, 1, VolumeNumber ),
8672                 rec( 13, 1, LogicalDriveNumber ),
8673                 rec( 14, 2, BlockSize ),
8674                 rec( 16, 2, StartingBlock ),
8675                 rec( 18, 2, TotalBlocks ),
8676                 rec( 20, 2, FreeBlocks ),
8677                 rec( 22, 2, TotalDirectoryEntries ),
8678                 rec( 24, 2, FreeDirectoryEntries ),
8679                 rec( 26, 2, ActualMaxUsedDirectoryEntries ),
8680                 rec( 28, 1, VolumeHashedFlag ),
8681                 rec( 29, 1, VolumeCachedFlag ),
8682                 rec( 30, 1, VolumeRemovableFlag ),
8683                 rec( 31, 1, VolumeMountedFlag ),
8684                 rec( 32, 16, VolumeName ),
8685          ])
8686         pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
8687         # 2222/17EA, 23/234
8688         pkt = NCP(0x17EA, "Get Connection's Task Information", 'stats')
8689         pkt.Request(12, [
8690                 rec( 10, 2, ConnectionNumber ),
8691         ])
8692         pkt.Reply(18, [
8693                 rec( 8, 2, NextRequestRecord ),
8694                 rec( 10, 4, NumberOfAttributes, var="x" ),
8695                 rec( 14, 4, Attributes, repeat="x" ),
8696          ])
8697         pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
8698         # 2222/17EB, 23/235
8699         pkt = NCP(0x17EB, "Get Connection's Open Files", 'file')
8700         pkt.Request(14, [
8701                 rec( 10, 2, ConnectionNumber ),
8702                 rec( 12, 2, LastRecordSeen ),
8703         ])
8704         pkt.Reply((29,283), [
8705                 rec( 8, 2, NextRequestRecord ),
8706                 rec( 10, 2, NumberOfRecords, var="x" ),
8707                 rec( 12, (17, 271), OpnFilesStruct, repeat="x" ),
8708         ])
8709         pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xff00])
8710         # 2222/17EC, 23/236
8711         pkt = NCP(0x17EC, "Get Connection Using A File", 'file')
8712         pkt.Request(18, [
8713                 rec( 10, 1, DataStreamNumber ),
8714                 rec( 11, 1, VolumeNumber ),
8715                 rec( 12, 4, DirectoryBase, LE ),
8716                 rec( 16, 2, LastRecordSeen ),
8717         ])
8718         pkt.Reply(33, [
8719                 rec( 8, 2, NextRequestRecord ),
8720                 rec( 10, 2, UseCount ),
8721                 rec( 12, 2, OpenCount ),
8722                 rec( 14, 2, OpenForReadCount ),
8723                 rec( 16, 2, OpenForWriteCount ),
8724                 rec( 18, 2, DenyReadCount ),
8725                 rec( 20, 2, DenyWriteCount ),
8726                 rec( 22, 1, Locked ),
8727                 rec( 23, 1, ForkCount ),
8728                 rec( 24, 2, NumberOfRecords, var="x" ),
8729                 rec( 26, 7, ConnStruct, repeat="x" ),
8730         ])
8731         pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xff00])
8732         # 2222/17ED, 23/237
8733         pkt = NCP(0x17ED, "Get Physical Record Locks By Connection And File", 'file')
8734         pkt.Request(20, [
8735                 rec( 10, 2, TargetConnectionNumber ),
8736                 rec( 12, 1, DataStreamNumber ),
8737                 rec( 13, 1, VolumeNumber ),
8738                 rec( 14, 4, DirectoryBase, LE ),
8739                 rec( 18, 2, LastRecordSeen ),
8740         ])
8741         pkt.Reply(23, [
8742                 rec( 8, 2, NextRequestRecord ),
8743                 rec( 10, 2, NumberOfLocks, var="x" ),
8744                 rec( 12, 11, LockStruct, repeat="x" ),
8745         ])
8746         pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
8747         # 2222/17EE, 23/238
8748         pkt = NCP(0x17EE, "Get Physical Record Locks By File", 'file')
8749         pkt.Request(18, [
8750                 rec( 10, 1, DataStreamNumber ),
8751                 rec( 11, 1, VolumeNumber ),
8752                 rec( 12, 4, DirectoryBase ),
8753                 rec( 16, 2, LastRecordSeen ),
8754         ])
8755         pkt.Reply(30, [
8756                 rec( 8, 2, NextRequestRecord ),
8757                 rec( 10, 2, NumberOfLocks, var="x" ),
8758                 rec( 12, 18, PhyLockStruct, repeat="x" ),
8759         ])
8760         pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
8761         # 2222/17EF, 23/239
8762         pkt = NCP(0x17EF, "Get Logical Records By Connection", 'file')
8763         pkt.Request(14, [
8764                 rec( 10, 2, TargetConnectionNumber ),
8765                 rec( 12, 2, LastRecordSeen ),
8766         ])
8767         pkt.Reply((16,270), [
8768                 rec( 8, 2, NextRequestRecord ),
8769                 rec( 10, 2, NumberOfRecords, var="x" ),
8770                 rec( 12, (4, 258), LogLockStruct, repeat="x" ),
8771         ])
8772         pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
8773         # 2222/17F0, 23/240
8774         pkt = NCP(0x17F0, "Get Logical Record Information (old)", 'file')
8775         pkt.Request((13,267), [
8776                 rec( 10, 2, LastRecordSeen ),
8777                 rec( 12, (1,255), LogicalRecordName ),
8778         ])
8779         pkt.Reply(22, [
8780                 rec( 8, 2, ShareableLockCount ),
8781                 rec( 10, 2, UseCount ),
8782                 rec( 12, 1, Locked ),
8783                 rec( 13, 2, NextRequestRecord ),
8784                 rec( 15, 2, NumberOfRecords, var="x" ),
8785                 rec( 17, 5, LogRecStruct, repeat="x" ),
8786         ])
8787         pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
8788         # 2222/17F1, 23/241
8789         pkt = NCP(0x17F1, "Get Connection's Semaphores", 'file')
8790         pkt.Request(14, [
8791                 rec( 10, 2, ConnectionNumber ),
8792                 rec( 12, 2, LastRecordSeen ),
8793         ])
8794         pkt.Reply((19,273), [
8795                 rec( 8, 2, NextRequestRecord ),
8796                 rec( 10, 2, NumberOfSemaphores, var="x" ),
8797                 rec( 12, (7, 261), SemaStruct, repeat="x" ),
8798         ])
8799         pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
8800         # 2222/17F2, 23/242
8801         pkt = NCP(0x17F2, "Get Semaphore Information", 'file')
8802         pkt.Request((13,267), [
8803                 rec( 10, 2, LastRecordSeen ),
8804                 rec( 12, (1,255), SemaphoreName ),
8805         ], info_str=(SemaphoreName, "Get Semaphore Information: %s", ", %s"))
8806         pkt.Reply(20, [
8807                 rec( 8, 2, NextRequestRecord ),
8808                 rec( 10, 2, OpenCount ),
8809                 rec( 12, 2, SemaphoreValue ),
8810                 rec( 14, 2, NumberOfRecords, var="x" ),
8811                 rec( 16, 4, SemaInfoStruct, repeat="x" ),
8812         ])
8813         pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
8814         # 2222/17F3, 23/243
8815         pkt = NCP(0x17F3, "Map Directory Number to Path", 'file')
8816         pkt.Request(16, [
8817                 rec( 10, 1, VolumeNumber ),
8818                 rec( 11, 4, DirectoryNumber ),
8819                 rec( 15, 1, NameSpace ),
8820         ])
8821         pkt.Reply((9,263), [
8822                 rec( 8, (1,255), Path ),
8823         ])
8824         pkt.CompletionCodes([0x0000, 0x9600, 0x9c00, 0xc601, 0xfd00, 0xff00])
8825         # 2222/17F4, 23/244
8826         pkt = NCP(0x17F4, "Convert Path to Dir Entry", 'file')
8827         pkt.Request((12,266), [
8828                 rec( 10, 1, DirHandle ),
8829                 rec( 11, (1,255), Path ),
8830         ], info_str=(Path, "Convert Path to Directory Entry: %s", ", %s"))
8831         pkt.Reply(13, [
8832                 rec( 8, 1, VolumeNumber ),
8833                 rec( 9, 4, DirectoryNumber ),
8834         ])
8835         pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
8836         # 2222/17FD, 23/253
8837         pkt = NCP(0x17FD, "Send Console Broadcast", 'stats')
8838         pkt.Request((16, 270), [
8839                 rec( 10, 1, NumberOfStations, var="x" ),
8840                 rec( 11, 4, StationList, repeat="x" ),
8841                 rec( 15, (1, 255), TargetMessage ),
8842         ], info_str=(TargetMessage, "Send Console Broadcast: %s", ", %s"))
8843         pkt.Reply(8)
8844         pkt.CompletionCodes([0x0000, 0xc601, 0xfd00])
8845         # 2222/17FE, 23/254
8846         pkt = NCP(0x17FE, "Clear Connection Number", 'stats')
8847         pkt.Request(14, [
8848                 rec( 10, 4, ConnectionNumber ),
8849         ])
8850         pkt.Reply(8)
8851         pkt.CompletionCodes([0x0000, 0xc601, 0xfd00])
8852         # 2222/18, 24
8853         pkt = NCP(0x18, "End of Job", 'connection')
8854         pkt.Request(7)
8855         pkt.Reply(8)
8856         pkt.CompletionCodes([0x0000])
8857         # 2222/19, 25
8858         pkt = NCP(0x19, "Logout", 'connection')
8859         pkt.Request(7)
8860         pkt.Reply(8)
8861         pkt.CompletionCodes([0x0000])
8862         # 2222/1A, 26
8863         pkt = NCP(0x1A, "Log Physical Record (old)", 'file')
8864         pkt.Request(24, [
8865                 rec( 7, 1, LockFlag ),
8866                 rec( 8, 6, FileHandle ),
8867                 rec( 14, 4, LockAreasStartOffset, BE ),
8868                 rec( 18, 4, LockAreaLen, BE ),
8869                 rec( 22, 2, LockTimeout, BE ),
8870         ])
8871         pkt.Reply(8)
8872         pkt.CompletionCodes([0x0000, 0x8800, 0x9600, 0xfd02, 0xfe04, 0xff01])
8873         # 2222/1B, 27
8874         pkt = NCP(0x1B, "Lock Physical Record Set (old)", 'file')
8875         pkt.Request(10, [
8876                 rec( 7, 1, LockFlag ),
8877                 rec( 8, 2, LockTimeout, BE ),
8878         ])
8879         pkt.Reply(8)
8880         pkt.CompletionCodes([0x0000, 0x8800, 0x9600, 0xfd02, 0xfe04, 0xff01])
8881         # 2222/1C, 28
8882         pkt = NCP(0x1C, "Release Physical Record", 'file')
8883         pkt.Request(22, [
8884                 rec( 7, 1, Reserved ),
8885                 rec( 8, 6, FileHandle ),
8886                 rec( 14, 4, LockAreasStartOffset, BE ),
8887                 rec( 18, 4, LockAreaLen, BE ),
8888         ])
8889         pkt.Reply(8)
8890         pkt.CompletionCodes([0x0000, 0x8800, 0x9600, 0xfd02, 0xfe04, 0xff03])
8891         # 2222/1D, 29
8892         pkt = NCP(0x1D, "Release Physical Record Set", 'file')
8893         pkt.Request(8, [
8894                 rec( 7, 1, LockFlag ),
8895         ])
8896         pkt.Reply(8)
8897         pkt.CompletionCodes([0x0000, 0x8800, 0x9600, 0xfd02, 0xfe04, 0xff03])
8898         # 2222/1E, 30
8899         pkt = NCP(0x1E, "Clear Physical Record", 'file')
8900         pkt.Request(22, [
8901                 rec( 7, 1, Reserved ),
8902                 rec( 8, 6, FileHandle ),
8903                 rec( 14, 4, LockAreasStartOffset, BE ),
8904                 rec( 18, 4, LockAreaLen, BE ),
8905         ])
8906         pkt.Reply(8)
8907         pkt.CompletionCodes([0x0000, 0x8800, 0x9600, 0xfd02, 0xfe04, 0xff03])
8908         # 2222/1F, 31
8909         pkt = NCP(0x1F, "Clear Physical Record Set", 'file')
8910         pkt.Request(8, [
8911                 rec( 7, 1, LockFlag ),
8912         ])
8913         pkt.Reply(8)
8914         pkt.CompletionCodes([0x0000, 0x8800, 0x9600, 0xfd02, 0xfe04, 0xff03])
8915         # 2222/2000, 32/00
8916         pkt = NCP(0x2000, "Open Semaphore", 'file', has_length=0)
8917         pkt.Request(10, [
8918                 rec( 8, 1, InitialSemaphoreValue ),
8919                 rec( 9, 1, SemaphoreNameLen ),
8920         ])
8921         pkt.Reply(13, [
8922                   rec( 8, 4, SemaphoreHandle, BE ),
8923                   rec( 12, 1, SemaphoreOpenCount ),
8924         ])
8925         pkt.CompletionCodes([0x0000, 0x9600, 0xff01])
8926         # 2222/2001, 32/01
8927         pkt = NCP(0x2001, "Examine Semaphore", 'file', has_length=0)
8928         pkt.Request(12, [
8929                 rec( 8, 4, SemaphoreHandle, BE ),
8930         ])
8931         pkt.Reply(10, [
8932                   rec( 8, 1, SemaphoreValue ),
8933                   rec( 9, 1, SemaphoreOpenCount ),
8934         ])
8935         pkt.CompletionCodes([0x0000, 0x9600, 0xff01])
8936         # 2222/2002, 32/02
8937         pkt = NCP(0x2002, "Wait On Semaphore", 'file', has_length=0)
8938         pkt.Request(14, [
8939                 rec( 8, 4, SemaphoreHandle, BE ),
8940                 rec( 12, 2, SemaphoreTimeOut, BE ), 
8941         ])
8942         pkt.Reply(8)
8943         pkt.CompletionCodes([0x0000, 0x9600, 0xff01])
8944         # 2222/2003, 32/03
8945         pkt = NCP(0x2003, "Signal Semaphore", 'file', has_length=0)
8946         pkt.Request(12, [
8947                 rec( 8, 4, SemaphoreHandle, BE ),
8948         ])
8949         pkt.Reply(8)
8950         pkt.CompletionCodes([0x0000, 0x9600, 0xff01])
8951         # 2222/2004, 32/04
8952         pkt = NCP(0x2004, "Close Semaphore", 'file', has_length=0)
8953         pkt.Request(12, [
8954                 rec( 8, 4, SemaphoreHandle, BE ),
8955         ])
8956         pkt.Reply(8)
8957         pkt.CompletionCodes([0x0000, 0x9600, 0xff01])
8958         # 2222/21, 33
8959         pkt = NCP(0x21, "Negotiate Buffer Size", 'connection')
8960         pkt.Request(9, [
8961                 rec( 7, 2, BufferSize, BE ),
8962         ])
8963         pkt.Reply(10, [
8964                 rec( 8, 2, BufferSize, BE ),
8965         ])
8966         pkt.CompletionCodes([0x0000])
8967         # 2222/2200, 34/00
8968         pkt = NCP(0x2200, "TTS Is Available", 'tts', has_length=0)
8969         pkt.Request(8)
8970         pkt.Reply(8)
8971         pkt.CompletionCodes([0x0001, 0xfd03, 0xff12])
8972         # 2222/2201, 34/01
8973         pkt = NCP(0x2201, "TTS Begin Transaction", 'tts', has_length=0)
8974         pkt.Request(8)
8975         pkt.Reply(8)
8976         pkt.CompletionCodes([0x0000])
8977         # 2222/2202, 34/02
8978         pkt = NCP(0x2202, "TTS End Transaction", 'tts', has_length=0)
8979         pkt.Request(8)
8980         pkt.Reply(12, [
8981                   rec( 8, 4, TransactionNumber, BE ),
8982         ])                
8983         pkt.CompletionCodes([0x0000, 0xff01])
8984         # 2222/2203, 34/03
8985         pkt = NCP(0x2203, "TTS Abort Transaction", 'tts', has_length=0)
8986         pkt.Request(8)
8987         pkt.Reply(8)
8988         pkt.CompletionCodes([0x0000, 0xfd03, 0xfe0b, 0xff01])
8989         # 2222/2204, 34/04
8990         pkt = NCP(0x2204, "TTS Transaction Status", 'tts', has_length=0)
8991         pkt.Request(12, [
8992                   rec( 8, 4, TransactionNumber, BE ),
8993         ])              
8994         pkt.Reply(8)
8995         pkt.CompletionCodes([0x0000])
8996         # 2222/2205, 34/05
8997         pkt = NCP(0x2205, "TTS Get Application Thresholds", 'tts', has_length=0)
8998         pkt.Request(8)          
8999         pkt.Reply(10, [
9000                   rec( 8, 1, LogicalLockThreshold ),
9001                   rec( 9, 1, PhysicalLockThreshold ),
9002         ])
9003         pkt.CompletionCodes([0x0000])
9004         # 2222/2206, 34/06
9005         pkt = NCP(0x2206, "TTS Set Application Thresholds", 'tts', has_length=0)
9006         pkt.Request(10, [               
9007                   rec( 8, 1, LogicalLockThreshold ),
9008                   rec( 9, 1, PhysicalLockThreshold ),
9009         ])
9010         pkt.Reply(8)
9011         pkt.CompletionCodes([0x0000, 0x9600])
9012         # 2222/2207, 34/07
9013         pkt = NCP(0x2207, "TTS Get Workstation Thresholds", 'tts', has_length=0)
9014         pkt.Request(10, [               
9015                   rec( 8, 1, LogicalLockThreshold ),
9016                   rec( 9, 1, PhysicalLockThreshold ),
9017         ])
9018         pkt.Reply(8)
9019         pkt.CompletionCodes([0x0000])
9020         # 2222/2208, 34/08
9021         pkt = NCP(0x2208, "TTS Set Workstation Thresholds", 'tts', has_length=0)
9022         pkt.Request(10, [               
9023                   rec( 8, 1, LogicalLockThreshold ),
9024                   rec( 9, 1, PhysicalLockThreshold ),
9025         ])
9026         pkt.Reply(8)
9027         pkt.CompletionCodes([0x0000])
9028         # 2222/2209, 34/09
9029         pkt = NCP(0x2209, "TTS Get Transaction Bits", 'tts', has_length=0)
9030         pkt.Request(8)
9031         pkt.Reply(9, [
9032                 rec( 8, 1, ControlFlags ),
9033         ])
9034         pkt.CompletionCodes([0x0000])
9035         # 2222/220A, 34/10
9036         pkt = NCP(0x220A, "TTS Set Transaction Bits", 'tts', has_length=0)
9037         pkt.Request(9, [
9038                 rec( 8, 1, ControlFlags ),
9039         ])
9040         pkt.Reply(8)
9041         pkt.CompletionCodes([0x0000])
9042         # 2222/2301, 35/01
9043         pkt = NCP(0x2301, "AFP Create Directory", 'afp')
9044         pkt.Request((49, 303), [
9045                 rec( 10, 1, VolumeNumber ),
9046                 rec( 11, 4, BaseDirectoryID, BE ),
9047                 rec( 15, 1, Reserved ),
9048                 rec( 16, 4, CreatorID ),
9049                 rec( 20, 4, Reserved4 ),
9050                 rec( 24, 2, FinderAttr ),
9051                 rec( 26, 2, HorizLocation ),
9052                 rec( 28, 2, VertLocation ),
9053                 rec( 30, 2, FileDirWindow ),
9054                 rec( 32, 16, Reserved16 ),
9055                 rec( 48, (1,255), Path ),
9056         ], info_str=(Path, "AFP Create Directory: %s", ", %s"))
9057         pkt.Reply(12, [
9058                 rec( 8, 4, NewDirectoryID, BE ),
9059         ])
9060         pkt.CompletionCodes([0x0000, 0x8301, 0x8400, 0x8800, 0x9300, 0x9600, 0x9804,
9061                              0x9900, 0x9c03, 0x9e02, 0xa100, 0xa201, 0xfd00, 0xff18])
9062         # 2222/2302, 35/02
9063         pkt = NCP(0x2302, "AFP Create File", 'afp')
9064         pkt.Request((49, 303), [
9065                 rec( 10, 1, VolumeNumber ),
9066                 rec( 11, 4, BaseDirectoryID, BE ),
9067                 rec( 15, 1, DeleteExistingFileFlag ),
9068                 rec( 16, 4, CreatorID, BE ),
9069                 rec( 20, 4, Reserved4 ),
9070                 rec( 24, 2, FinderAttr ),
9071                 rec( 26, 2, HorizLocation, BE ),
9072                 rec( 28, 2, VertLocation, BE ),
9073                 rec( 30, 2, FileDirWindow, BE ),
9074                 rec( 32, 16, Reserved16 ),
9075                 rec( 48, (1,255), Path ),
9076         ], info_str=(Path, "AFP Create File: %s", ", %s"))
9077         pkt.Reply(12, [
9078                 rec( 8, 4, NewDirectoryID, BE ),
9079         ])
9080         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8301, 0x8400, 0x8701, 0x8800,
9081                              0x8a00, 0x8d00, 0x8e00, 0x8f00, 0x9300, 0x9600, 0x9804,
9082                              0x9900, 0x9b03, 0x9c03, 0x9e02, 0xa100, 0xa201, 0xfd00,
9083                              0xff18])
9084         # 2222/2303, 35/03
9085         pkt = NCP(0x2303, "AFP Delete", 'afp')
9086         pkt.Request((16,270), [
9087                 rec( 10, 1, VolumeNumber ),
9088                 rec( 11, 4, BaseDirectoryID, BE ),
9089                 rec( 15, (1,255), Path ),
9090         ], info_str=(Path, "AFP Delete: %s", ", %s"))
9091         pkt.Reply(8)
9092         pkt.CompletionCodes([0x0000, 0x8301, 0x8800, 0x8a00, 0x8d00, 0x8e00, 0x8f00,
9093                              0x9000, 0x9300, 0x9600, 0x9804, 0x9b03, 0x9c03, 0x9e02,
9094                              0xa000, 0xa100, 0xa201, 0xfd00, 0xff19])
9095         # 2222/2304, 35/04
9096         pkt = NCP(0x2304, "AFP Get Entry ID From Name", 'afp')
9097         pkt.Request((16,270), [
9098                 rec( 10, 1, VolumeNumber ),
9099                 rec( 11, 4, BaseDirectoryID, BE ),
9100                 rec( 15, (1,255), Path ),
9101         ], info_str=(Path, "AFP Get Entry from Name: %s", ", %s"))
9102         pkt.Reply(12, [
9103                 rec( 8, 4, TargetEntryID, BE ),
9104         ])
9105         pkt.CompletionCodes([0x0000, 0x8301, 0x8800, 0x9300, 0x9600, 0x9804, 0x9c03,
9106                              0xa100, 0xa201, 0xfd00, 0xff19])
9107         # 2222/2305, 35/05
9108         pkt = NCP(0x2305, "AFP Get File Information", 'afp')
9109         pkt.Request((18,272), [
9110                 rec( 10, 1, VolumeNumber ),
9111                 rec( 11, 4, BaseDirectoryID, BE ),
9112                 rec( 15, 2, RequestBitMap, BE ),
9113                 rec( 17, (1,255), Path ),
9114         ], info_str=(Path, "AFP Get File Information: %s", ", %s"))
9115         pkt.Reply(121, [
9116                 rec( 8, 4, AFPEntryID, BE ),
9117                 rec( 12, 4, ParentID, BE ),
9118                 rec( 16, 2, AttributesDef16, LE ),
9119                 rec( 18, 4, DataForkLen, BE ),
9120                 rec( 22, 4, ResourceForkLen, BE ),
9121                 rec( 26, 2, TotalOffspring, BE  ),
9122                 rec( 28, 2, CreationDate, BE ),
9123                 rec( 30, 2, LastAccessedDate, BE ),
9124                 rec( 32, 2, ModifiedDate, BE ),
9125                 rec( 34, 2, ModifiedTime, BE ),
9126                 rec( 36, 2, ArchivedDate, BE ),
9127                 rec( 38, 2, ArchivedTime, BE ),
9128                 rec( 40, 4, CreatorID, BE ),
9129                 rec( 44, 4, Reserved4 ),
9130                 rec( 48, 2, FinderAttr ),
9131                 rec( 50, 2, HorizLocation ),
9132                 rec( 52, 2, VertLocation ),
9133                 rec( 54, 2, FileDirWindow ),
9134                 rec( 56, 16, Reserved16 ),
9135                 rec( 72, 32, LongName ),
9136                 rec( 104, 4, CreatorID, BE ),
9137                 rec( 108, 12, ShortName ),
9138                 rec( 120, 1, AccessPrivileges ),
9139         ])              
9140         pkt.CompletionCodes([0x0000, 0x8301, 0x8800, 0x9300, 0x9600, 0x9804, 0x9c03,
9141                              0xa100, 0xa201, 0xfd00, 0xff19])
9142         # 2222/2306, 35/06
9143         pkt = NCP(0x2306, "AFP Get Entry ID From NetWare Handle", 'afp')
9144         pkt.Request(16, [
9145                 rec( 10, 6, FileHandle ),
9146         ])
9147         pkt.Reply(14, [
9148                 rec( 8, 1, VolumeID ),
9149                 rec( 9, 4, TargetEntryID, BE ),
9150                 rec( 13, 1, ForkIndicator ),
9151         ])              
9152         pkt.CompletionCodes([0x0000, 0x8301, 0x8800, 0x9300, 0x9600, 0xa201])
9153         # 2222/2307, 35/07
9154         pkt = NCP(0x2307, "AFP Rename", 'afp')
9155         pkt.Request((21, 529), [
9156                 rec( 10, 1, VolumeNumber ),
9157                 rec( 11, 4, MacSourceBaseID, BE ),
9158                 rec( 15, 4, MacDestinationBaseID, BE ),
9159                 rec( 19, (1,255), Path ),
9160                 rec( -1, (1,255), NewFileNameLen ),
9161         ], info_str=(Path, "AFP Rename: %s", ", %s"))
9162         pkt.Reply(8)            
9163         pkt.CompletionCodes([0x0000, 0x8301, 0x8401, 0x8800, 0x8b00, 0x8e00,
9164                              0x9001, 0x9201, 0x9300, 0x9600, 0x9804, 0x9900,
9165                              0x9c03, 0x9e00, 0xa100, 0xa201, 0xfd00, 0xff0a])
9166         # 2222/2308, 35/08
9167         pkt = NCP(0x2308, "AFP Open File Fork", 'afp')
9168         pkt.Request((18, 272), [
9169                 rec( 10, 1, VolumeNumber ),
9170                 rec( 11, 4, MacBaseDirectoryID, BE ),
9171                 rec( 15, 1, ForkIndicator ),
9172                 rec( 16, 1, AccessMode ),
9173                 rec( 17, (1,255), Path ),
9174         ], info_str=(Path, "AFP Open File Fork: %s", ", %s"))
9175         pkt.Reply(22, [
9176                 rec( 8, 4, AFPEntryID, BE ),
9177                 rec( 12, 4, DataForkLen, BE ),
9178                 rec( 16, 6, NetWareAccessHandle ),
9179         ])
9180         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8301, 0x8800, 0x9300,
9181                              0x9400, 0x9600, 0x9804, 0x9900, 0x9c03, 0xa100,
9182                              0xa201, 0xfd00, 0xff16])
9183         # 2222/2309, 35/09
9184         pkt = NCP(0x2309, "AFP Set File Information", 'afp')
9185         pkt.Request((64, 318), [
9186                 rec( 10, 1, VolumeNumber ),
9187                 rec( 11, 4, MacBaseDirectoryID, BE ),
9188                 rec( 15, 2, RequestBitMap, BE ),
9189                 rec( 17, 2, MacAttr, BE ),
9190                 rec( 19, 2, CreationDate, BE ),
9191                 rec( 21, 2, LastAccessedDate, BE ),
9192                 rec( 23, 2, ModifiedDate, BE ),
9193                 rec( 25, 2, ModifiedTime, BE ),
9194                 rec( 27, 2, ArchivedDate, BE ),
9195                 rec( 29, 2, ArchivedTime, BE ),
9196                 rec( 31, 4, CreatorID, BE ),
9197                 rec( 35, 4, Reserved4 ),
9198                 rec( 39, 2, FinderAttr ),
9199                 rec( 41, 2, HorizLocation ),
9200                 rec( 43, 2, VertLocation ),
9201                 rec( 45, 2, FileDirWindow ),
9202                 rec( 47, 16, Reserved16 ),
9203                 rec( 63, (1,255), Path ),
9204         ], info_str=(Path, "AFP Set File Information: %s", ", %s"))
9205         pkt.Reply(8)            
9206         pkt.CompletionCodes([0x0000, 0x0104, 0x8301, 0x8800, 0x9300, 0x9400,
9207                              0x9500, 0x9600, 0x9804, 0x9c03, 0xa100, 0xa201,
9208                              0xfd00, 0xff16])
9209         # 2222/230A, 35/10
9210         pkt = NCP(0x230A, "AFP Scan File Information", 'afp')
9211         pkt.Request((26, 280), [
9212                 rec( 10, 1, VolumeNumber ),
9213                 rec( 11, 4, MacBaseDirectoryID, BE ),
9214                 rec( 15, 4, MacLastSeenID, BE ),
9215                 rec( 19, 2, DesiredResponseCount, BE ),
9216                 rec( 21, 2, SearchBitMap, BE ),
9217                 rec( 23, 2, RequestBitMap, BE ),
9218                 rec( 25, (1,255), Path ),
9219         ], info_str=(Path, "AFP Scan File Information: %s", ", %s"))
9220         pkt.Reply(123, [
9221                 rec( 8, 2, ActualResponseCount, BE, var="x" ),
9222                 rec( 10, 113, AFP10Struct, repeat="x" ),
9223         ])      
9224         pkt.CompletionCodes([0x0000, 0x8301, 0x8800, 0x9300, 0x9600, 0x9804,
9225                              0x9c03, 0xa100, 0xa201, 0xfd00, 0xff16])
9226         # 2222/230B, 35/11
9227         pkt = NCP(0x230B, "AFP Alloc Temporary Directory Handle", 'afp')
9228         pkt.Request((16,270), [
9229                 rec( 10, 1, VolumeNumber ),
9230                 rec( 11, 4, MacBaseDirectoryID, BE ),
9231                 rec( 15, (1,255), Path ),
9232         ], info_str=(Path, "AFP Allocate Temporary Directory Handle: %s", ", %s"))
9233         pkt.Reply(10, [
9234                 rec( 8, 1, DirHandle ),
9235                 rec( 9, 1, AccessRightsMask ),
9236         ])
9237         pkt.CompletionCodes([0x0000, 0x8301, 0x8800, 0x9300, 0x9600,
9238                              0x9804, 0x9b03, 0x9c03, 0x9d00, 0xa100,
9239                              0xa201, 0xfd00, 0xff00])
9240         # 2222/230C, 35/12
9241         pkt = NCP(0x230C, "AFP Get Entry ID From Path Name", 'afp')
9242         pkt.Request((12,266), [
9243                 rec( 10, 1, DirHandle ),
9244                 rec( 11, (1,255), Path ),
9245         ], info_str=(Path, "AFP Get Entry ID from Path Name: %s", ", %s"))
9246         pkt.Reply(12, [
9247                 rec( 8, 4, AFPEntryID, BE ),
9248         ])
9249         pkt.CompletionCodes([0x0000, 0x8301, 0x8800, 0x9300, 0x9600,
9250                              0x9804, 0x9b03, 0x9c03, 0xa100, 0xa201,
9251                              0xfd00, 0xff00])
9252         # 2222/230D, 35/13
9253         pkt = NCP(0x230D, "AFP 2.0 Create Directory", 'afp')
9254         pkt.Request((55,309), [
9255                 rec( 10, 1, VolumeNumber ),
9256                 rec( 11, 4, BaseDirectoryID, BE ),
9257                 rec( 15, 1, Reserved ),
9258                 rec( 16, 4, CreatorID, BE ),
9259                 rec( 20, 4, Reserved4 ),
9260                 rec( 24, 2, FinderAttr ),
9261                 rec( 26, 2, HorizLocation ),
9262                 rec( 28, 2, VertLocation ),
9263                 rec( 30, 2, FileDirWindow ),
9264                 rec( 32, 16, Reserved16 ),
9265                 rec( 48, 6, ProDOSInfo ),
9266                 rec( 54, (1,255), Path ),
9267         ], info_str=(Path, "AFP 2.0 Create Directory: %s", ", %s"))
9268         pkt.Reply(12, [
9269                 rec( 8, 4, NewDirectoryID, BE ),
9270         ])
9271         pkt.CompletionCodes([0x0000, 0x8301, 0x8400, 0x8800, 0x9300,
9272                              0x9600, 0x9804, 0x9900, 0x9c03, 0x9e00,
9273                              0xa100, 0xa201, 0xfd00, 0xff00])
9274         # 2222/230E, 35/14
9275         pkt = NCP(0x230E, "AFP 2.0 Create File", 'afp')
9276         pkt.Request((55,309), [
9277                 rec( 10, 1, VolumeNumber ),
9278                 rec( 11, 4, BaseDirectoryID, BE ),
9279                 rec( 15, 1, DeleteExistingFileFlag ),
9280                 rec( 16, 4, CreatorID, BE ),
9281                 rec( 20, 4, Reserved4 ),
9282                 rec( 24, 2, FinderAttr ),
9283                 rec( 26, 2, HorizLocation ),
9284                 rec( 28, 2, VertLocation ),
9285                 rec( 30, 2, FileDirWindow ),
9286                 rec( 32, 16, Reserved16 ),
9287                 rec( 48, 6, ProDOSInfo ),
9288                 rec( 54, (1,255), Path ),
9289         ], info_str=(Path, "AFP 2.0 Create File: %s", ", %s"))
9290         pkt.Reply(12, [
9291                 rec( 8, 4, NewDirectoryID, BE ),
9292         ])
9293         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8301, 0x8400,
9294                              0x8701, 0x8800, 0x8a00, 0x8d00, 0x8e00,
9295                              0x8f00, 0x9001, 0x9300, 0x9600, 0x9804,
9296                              0x9900, 0x9b03, 0x9c03, 0x9e00, 0xa100,
9297                              0xa201, 0xfd00, 0xff00])
9298         # 2222/230F, 35/15
9299         pkt = NCP(0x230F, "AFP 2.0 Get File Or Directory Information", 'afp')
9300         pkt.Request((18,272), [
9301                 rec( 10, 1, VolumeNumber ),
9302                 rec( 11, 4, BaseDirectoryID, BE ),
9303                 rec( 15, 2, RequestBitMap, BE ),
9304                 rec( 17, (1,255), Path ),
9305         ], info_str=(Path, "AFP 2.0 Get Information: %s", ", %s"))
9306         pkt.Reply(128, [
9307                 rec( 8, 4, AFPEntryID, BE ),
9308                 rec( 12, 4, ParentID, BE ),
9309                 rec( 16, 2, AttributesDef16 ),
9310                 rec( 18, 4, DataForkLen, BE ),
9311                 rec( 22, 4, ResourceForkLen, BE ),
9312                 rec( 26, 2, TotalOffspring, BE ),
9313                 rec( 28, 2, CreationDate, BE ),
9314                 rec( 30, 2, LastAccessedDate, BE ),
9315                 rec( 32, 2, ModifiedDate, BE ),
9316                 rec( 34, 2, ModifiedTime, BE ),
9317                 rec( 36, 2, ArchivedDate, BE ),
9318                 rec( 38, 2, ArchivedTime, BE ),
9319                 rec( 40, 4, CreatorID, BE ),
9320                 rec( 44, 4, Reserved4 ),
9321                 rec( 48, 2, FinderAttr ),
9322                 rec( 50, 2, HorizLocation ),
9323                 rec( 52, 2, VertLocation ),
9324                 rec( 54, 2, FileDirWindow ),
9325                 rec( 56, 16, Reserved16 ),
9326                 rec( 72, 32, LongName ),
9327                 rec( 104, 4, CreatorID, BE ),
9328                 rec( 108, 12, ShortName ),
9329                 rec( 120, 1, AccessPrivileges ),
9330                 rec( 121, 1, Reserved ),
9331                 rec( 122, 6, ProDOSInfo ),
9332         ])              
9333         pkt.CompletionCodes([0x0000, 0x8301, 0x8800, 0x9300, 0x9600, 0x9804, 0x9c03,
9334                              0xa100, 0xa201, 0xfd00, 0xff19])
9335         # 2222/2310, 35/16
9336         pkt = NCP(0x2310, "AFP 2.0 Set File Information", 'afp')
9337         pkt.Request((70, 324), [
9338                 rec( 10, 1, VolumeNumber ),
9339                 rec( 11, 4, MacBaseDirectoryID, BE ),
9340                 rec( 15, 2, RequestBitMap, BE ),
9341                 rec( 17, 2, AttributesDef16 ),
9342                 rec( 19, 2, CreationDate, BE ),
9343                 rec( 21, 2, LastAccessedDate, BE ),
9344                 rec( 23, 2, ModifiedDate, BE ),
9345                 rec( 25, 2, ModifiedTime, BE ),
9346                 rec( 27, 2, ArchivedDate, BE ),
9347                 rec( 29, 2, ArchivedTime, BE ),
9348                 rec( 31, 4, CreatorID, BE ),
9349                 rec( 35, 4, Reserved4 ),
9350                 rec( 39, 2, FinderAttr ),
9351                 rec( 41, 2, HorizLocation ),
9352                 rec( 43, 2, VertLocation ),
9353                 rec( 45, 2, FileDirWindow ),
9354                 rec( 47, 16, Reserved16 ),
9355                 rec( 63, 6, ProDOSInfo ),
9356                 rec( 69, (1,255), Path ),
9357         ], info_str=(Path, "AFP 2.0 Set File Information: %s", ", %s"))
9358         pkt.Reply(8)            
9359         pkt.CompletionCodes([0x0000, 0x0104, 0x8301, 0x8800, 0x9300, 0x9400,
9360                              0x9500, 0x9600, 0x9804, 0x9c03, 0xa100, 0xa201,
9361                              0xfd00, 0xff16])
9362         # 2222/2311, 35/17
9363         pkt = NCP(0x2311, "AFP 2.0 Scan File Information", 'afp')
9364         pkt.Request((26, 280), [
9365                 rec( 10, 1, VolumeNumber ),
9366                 rec( 11, 4, MacBaseDirectoryID, BE ),
9367                 rec( 15, 4, MacLastSeenID, BE ),
9368                 rec( 19, 2, DesiredResponseCount, BE ),
9369                 rec( 21, 2, SearchBitMap, BE ),
9370                 rec( 23, 2, RequestBitMap, BE ),
9371                 rec( 25, (1,255), Path ),
9372         ], info_str=(Path, "AFP 2.0 Scan File Information: %s", ", %s"))
9373         pkt.Reply(14, [
9374                 rec( 8, 2, ActualResponseCount, var="x" ),
9375                 rec( 10, 4, AFP20Struct, repeat="x" ),
9376         ])      
9377         pkt.CompletionCodes([0x0000, 0x8301, 0x8800, 0x9300, 0x9600, 0x9804,
9378                              0x9c03, 0xa100, 0xa201, 0xfd00, 0xff16])
9379         # 2222/2312, 35/18
9380         pkt = NCP(0x2312, "AFP Get DOS Name From Entry ID", 'afp')
9381         pkt.Request(15, [
9382                 rec( 10, 1, VolumeNumber ),
9383                 rec( 11, 4, AFPEntryID, BE ),
9384         ])
9385         pkt.Reply((9,263), [
9386                 rec( 8, (1,255), Path ),
9387         ])      
9388         pkt.CompletionCodes([0x0000, 0x8900, 0x9600, 0xbf00])
9389         # 2222/2313, 35/19
9390         pkt = NCP(0x2313, "AFP Get Macintosh Info On Deleted File", 'afp')
9391         pkt.Request(15, [
9392                 rec( 10, 1, VolumeNumber ),
9393                 rec( 11, 4, DirectoryNumber, BE ),
9394         ])
9395         pkt.Reply((51,305), [
9396                 rec( 8, 4, CreatorID, BE ),
9397                 rec( 12, 4, Reserved4 ),
9398                 rec( 16, 2, FinderAttr ),
9399                 rec( 18, 2, HorizLocation ),
9400                 rec( 20, 2, VertLocation ),
9401                 rec( 22, 2, FileDirWindow ),
9402                 rec( 24, 16, Reserved16 ),
9403                 rec( 40, 6, ProDOSInfo ),
9404                 rec( 46, 4, ResourceForkSize, BE ),
9405                 rec( 50, (1,255), FileName ),
9406         ])      
9407         pkt.CompletionCodes([0x0000, 0x9c03, 0xbf00])
9408         # 2222/2400, 36/00
9409         pkt = NCP(0x2400, "Get NCP Extension Information", 'fileserver')
9410         pkt.Request(14, [
9411                 rec( 10, 4, NCPextensionNumber, LE ),
9412         ])
9413         pkt.Reply((16,270), [
9414                 rec( 8, 4, NCPextensionNumber ),
9415                 rec( 12, 1, NCPextensionMajorVersion ),
9416                 rec( 13, 1, NCPextensionMinorVersion ),
9417                 rec( 14, 1, NCPextensionRevisionNumber ),
9418                 rec( 15, (1, 255), NCPextensionName ),
9419         ])      
9420         pkt.CompletionCodes([0x0000, 0xfe00])
9421         # 2222/2401, 36/01
9422         pkt = NCP(0x2401, "Get NCP Extension Maximum Data Size", 'fileserver')
9423         pkt.Request(10)
9424         pkt.Reply(10, [
9425                 rec( 8, 2, NCPdataSize ),
9426         ])      
9427         pkt.CompletionCodes([0x0000, 0xfe00])
9428         # 2222/2402, 36/02
9429         pkt = NCP(0x2402, "Get NCP Extension Information by Name", 'fileserver')
9430         pkt.Request((11, 265), [
9431                 rec( 10, (1,255), NCPextensionName ),
9432         ], info_str=(NCPextensionName, "Get NCP Extension Information by Name: %s", ", %s"))
9433         pkt.Reply((16,270), [
9434                 rec( 8, 4, NCPextensionNumber ),
9435                 rec( 12, 1, NCPextensionMajorVersion ),
9436                 rec( 13, 1, NCPextensionMinorVersion ),
9437                 rec( 14, 1, NCPextensionRevisionNumber ),
9438                 rec( 15, (1, 255), NCPextensionName ),
9439         ])      
9440         pkt.CompletionCodes([0x0000, 0xfe00])
9441         # 2222/2403, 36/03
9442         pkt = NCP(0x2403, "Get Number of Registered NCP Extensions", 'fileserver')
9443         pkt.Request(10)
9444         pkt.Reply(12, [
9445                 rec( 8, 4, NumberOfNCPExtensions ),
9446         ])      
9447         pkt.CompletionCodes([0x0000, 0xfe00])
9448         # 2222/2404, 36/04
9449         pkt = NCP(0x2404, "Get NCP Extension Registered Verbs List", 'fileserver')
9450         pkt.Request(14, [
9451                 rec( 10, 4, StartingNumber ),
9452         ])
9453         pkt.Reply(20, [
9454                 rec( 8, 4, ReturnedListCount, var="x" ),
9455                 rec( 12, 4, nextStartingNumber ),
9456                 rec( 16, 4, NCPExtensionNumbers, repeat="x" ),
9457         ])      
9458         pkt.CompletionCodes([0x0000, 0xfe00])
9459         # 2222/2405, 36/05
9460         pkt = NCP(0x2405, "Return NCP Extension Information", 'fileserver')
9461         pkt.Request(14, [
9462                 rec( 10, 4, NCPextensionNumber ),
9463         ])
9464         pkt.Reply((16,270), [
9465                 rec( 8, 4, NCPextensionNumber ),
9466                 rec( 12, 1, NCPextensionMajorVersion ),
9467                 rec( 13, 1, NCPextensionMinorVersion ),
9468                 rec( 14, 1, NCPextensionRevisionNumber ),
9469                 rec( 15, (1, 255), NCPextensionName ),
9470         ])      
9471         pkt.CompletionCodes([0x0000, 0xfe00])
9472         # 2222/2406, 36/06
9473         pkt = NCP(0x2406, "Return NCP Extension Maximum Data Size", 'fileserver')
9474         pkt.Request(10)
9475         pkt.Reply(12, [
9476                 rec( 8, 4, NCPdataSize ),
9477         ])      
9478         pkt.CompletionCodes([0x0000, 0xfe00])
9479         # 2222/25, 37
9480         pkt = NCP(0x25, "Execute NCP Extension", 'fileserver')
9481         pkt.Request(11, [
9482                 rec( 7, 4, NCPextensionNumber ),
9483                 # The following value is Unicode
9484                 #[ 13, (1,255), RequestData ],
9485         ])
9486         pkt.Reply(8)
9487                 # The following value is Unicode
9488                 #[ 8, (1, 255), ReplyBuffer ],
9489         pkt.CompletionCodes([0x0000, 0xee00, 0xfe00])
9490         # 2222/3B, 59
9491         pkt = NCP(0x3B, "Commit File", 'file', has_length=0 )
9492         pkt.Request(14, [
9493                 rec( 7, 1, Reserved ),
9494                 rec( 8, 6, FileHandle ),
9495         ])
9496         pkt.Reply(8)    
9497         pkt.CompletionCodes([0x0000, 0x8800, 0x9804, 0xff00])
9498         # 2222/3E, 62
9499         pkt = NCP(0x3E, "File Search Initialize", 'file', has_length=0 )
9500         pkt.Request((9, 263), [
9501                 rec( 7, 1, DirHandle ),
9502                 rec( 8, (1,255), Path ),
9503         ], info_str=(Path, "Initialize File Search: %s", ", %s"))
9504         pkt.Reply(14, [
9505                 rec( 8, 1, VolumeNumber ),
9506                 rec( 9, 2, DirectoryID, BE ),
9507                 rec( 11, 2, SequenceNumber, BE ),
9508                 rec( 13, 1, AccessRightsMask ),
9509         ])
9510         pkt.CompletionCodes([0x0000, 0x9600, 0x9804, 0x9b03, 0x9c03, 0xa100,
9511                              0xfd00, 0xff16])
9512         # 2222/3F, 63
9513         pkt = NCP(0x3F, "File Search Continue", 'file', has_length=0 )
9514         pkt.Request((14, 268), [
9515                 rec( 7, 1, VolumeNumber ),
9516                 rec( 8, 2, DirectoryID, BE ),
9517                 rec( 10, 2, SequenceNumber, BE ),
9518                 rec( 12, 1, SearchAttributes ),
9519                 rec( 13, (1,255), Path ),
9520         ], info_str=(Path, "File Search Continue: %s", ", %s"))
9521         pkt.Reply( NO_LENGTH_CHECK, [
9522                 srec( DirectoryInstance, req_cond="ncp.sattr_sub==TRUE"),
9523                 srec( FileInstance, req_cond="ncp.sattr_sub!=TRUE"),
9524         ])
9525         pkt.ReqCondSizeVariable()
9526         pkt.CompletionCodes([0x0000, 0xff16])
9527         # 2222/40, 64
9528         pkt = NCP(0x40, "Search for a File", 'file')
9529         pkt.Request((12, 266), [
9530                 rec( 7, 2, SequenceNumber, BE ),
9531                 rec( 9, 1, DirHandle ),
9532                 rec( 10, 1, SearchAttributes ),
9533                 rec( 11, (1,255), FileName ),
9534         ], info_str=(FileName, "Search for File: %s", ", %s"))
9535         pkt.Reply(40, [
9536                 rec( 8, 2, SequenceNumber, BE ),
9537                 rec( 10, 2, Reserved2 ),
9538                 rec( 12, 14, FileName14 ),
9539                 rec( 26, 1, AttributesDef ),
9540                 rec( 27, 1, FileExecuteType ),
9541                 rec( 28, 4, FileSize ),
9542                 rec( 32, 2, CreationDate, BE ),
9543                 rec( 34, 2, LastAccessedDate, BE ),
9544                 rec( 36, 2, ModifiedDate, BE ),
9545                 rec( 38, 2, ModifiedTime, BE ),
9546         ])
9547         pkt.CompletionCodes([0x0000, 0x8900, 0x9600, 0x9804, 0x9b03,
9548                              0x9c03, 0xa100, 0xfd00, 0xff16])
9549         # 2222/41, 65
9550         pkt = NCP(0x41, "Open File", 'file')
9551         pkt.Request((10, 264), [
9552                 rec( 7, 1, DirHandle ),
9553                 rec( 8, 1, SearchAttributes ),
9554                 rec( 9, (1,255), FileName ),
9555         ], info_str=(FileName, "Open File: %s", ", %s"))
9556         pkt.Reply(44, [
9557                 rec( 8, 6, FileHandle ),
9558                 rec( 14, 2, Reserved2 ),
9559                 rec( 16, 14, FileName14 ),
9560                 rec( 30, 1, AttributesDef ),
9561                 rec( 31, 1, FileExecuteType ),
9562                 rec( 32, 4, FileSize, BE ),
9563                 rec( 36, 2, CreationDate, BE ),
9564                 rec( 38, 2, LastAccessedDate, BE ),
9565                 rec( 40, 2, ModifiedDate, BE ),
9566                 rec( 42, 2, ModifiedTime, BE ),
9567         ])
9568         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8200, 0x9400,
9569                              0x9600, 0x9804, 0x9c03, 0xa100, 0xfd00,
9570                              0xff16])
9571         # 2222/42, 66
9572         pkt = NCP(0x42, "Close File", 'file')
9573         pkt.Request(14, [
9574                 rec( 7, 1, Reserved ),
9575                 rec( 8, 6, FileHandle ),
9576         ])
9577         pkt.Reply(8)
9578         pkt.CompletionCodes([0x0000, 0xff1a])
9579         # 2222/43, 67
9580         pkt = NCP(0x43, "Create File", 'file')
9581         pkt.Request((10, 264), [
9582                 rec( 7, 1, DirHandle ),
9583                 rec( 8, 1, AttributesDef ),
9584                 rec( 9, (1,255), FileName ),
9585         ], info_str=(FileName, "Create File: %s", ", %s"))
9586         pkt.Reply(44, [
9587                 rec( 8, 6, FileHandle ),
9588                 rec( 14, 2, Reserved2 ),
9589                 rec( 16, 14, FileName14 ),
9590                 rec( 30, 1, AttributesDef ),
9591                 rec( 31, 1, FileExecuteType ),
9592                 rec( 32, 4, FileSize, BE ),
9593                 rec( 36, 2, CreationDate, BE ),
9594                 rec( 38, 2, LastAccessedDate, BE ),
9595                 rec( 40, 2, ModifiedDate, BE ),
9596                 rec( 42, 2, ModifiedTime, BE ),
9597         ])
9598         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
9599                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
9600                              0x9804, 0x9900, 0x9b03, 0x9c03, 0xfd00,
9601                              0xff00])
9602         # 2222/44, 68
9603         pkt = NCP(0x44, "Erase File", 'file')
9604         pkt.Request((10, 264), [
9605                 rec( 7, 1, DirHandle ),
9606                 rec( 8, 1, SearchAttributes ),
9607                 rec( 9, (1,255), FileName ),
9608         ], info_str=(FileName, "Erase File: %s", ", %s"))
9609         pkt.Reply(8)
9610         pkt.CompletionCodes([0x0000, 0x8a00, 0x8d00, 0x8e00, 0x8f00,
9611                              0x9001, 0x9600, 0x9804, 0x9b03, 0x9c03,
9612                              0xa100, 0xfd00, 0xff00])
9613         # 2222/45, 69
9614         pkt = NCP(0x45, "Rename File", 'file')
9615         pkt.Request((12, 520), [
9616                 rec( 7, 1, DirHandle ),
9617                 rec( 8, 1, SearchAttributes ),
9618                 rec( 9, (1,255), FileName ),
9619                 rec( -1, 1, TargetDirHandle ),
9620                 rec( -1, (1, 255), NewFileNameLen ),
9621         ], info_str=(FileName, "Rename File: %s", ", %s"))
9622         pkt.Reply(8)
9623         pkt.CompletionCodes([0x0000, 0x8701, 0x8b00, 0x8d00, 0x8e00,
9624                              0x8f00, 0x9001, 0x9101, 0x9201, 0x9600,
9625                              0x9804, 0x9a00, 0x9b03, 0x9c03, 0xa100,
9626                              0xfd00, 0xff16])
9627         # 2222/46, 70
9628         pkt = NCP(0x46, "Set File Attributes", 'file')
9629         pkt.Request((11, 265), [
9630                 rec( 7, 1, AttributesDef ),
9631                 rec( 8, 1, DirHandle ),
9632                 rec( 9, 1, SearchAttributes ),
9633                 rec( 10, (1,255), FileName ),
9634         ], info_str=(FileName, "Set File Attributes: %s", ", %s"))
9635         pkt.Reply(8)
9636         pkt.CompletionCodes([0x0000, 0x8c00, 0x8d00, 0x8e00, 0x9600,
9637                              0x9804, 0x9b03, 0x9c03, 0xa100, 0xfd00,
9638                              0xff16])
9639         # 2222/47, 71
9640         pkt = NCP(0x47, "Get Current Size of File", 'file')
9641         pkt.Request(13, [
9642                 rec( 7, 6, FileHandle ),
9643         ])
9644         pkt.Reply(12, [
9645                 rec( 8, 4, FileSize, BE ),
9646         ])
9647         pkt.CompletionCodes([0x0000, 0x8800])
9648         # 2222/48, 72
9649         pkt = NCP(0x48, "Read From A File", 'file')
9650         pkt.Request(20, [
9651                 rec( 7, 1, Reserved ),
9652                 rec( 8, 6, FileHandle ),
9653                 rec( 14, 4, FileOffset, BE ), 
9654                 rec( 18, 2, MaxBytes, BE ),     
9655         ])
9656         pkt.Reply(10, [ 
9657                 rec( 8, 2, NumBytes, BE ),      
9658         ])
9659         pkt.CompletionCodes([0x0000, 0x8300, 0x8800, 0x9300, 0xff00])
9660         # 2222/49, 73
9661         pkt = NCP(0x49, "Write to a File", 'file')
9662         pkt.Request(20, [
9663                 rec( 7, 1, Reserved ),
9664                 rec( 8, 6, FileHandle ),
9665                 rec( 14, 4, FileOffset, BE ),
9666                 rec( 18, 2, MaxBytes, BE ),     
9667         ])
9668         pkt.Reply(8)
9669         pkt.CompletionCodes([0x0000, 0x8300, 0x8800, 0x9400, 0x9500, 0xa201, 0xff1b])
9670         # 2222/4A, 74
9671         pkt = NCP(0x4A, "Copy from One File to Another", 'file')
9672         pkt.Request(30, [
9673                 rec( 7, 1, Reserved ),
9674                 rec( 8, 6, FileHandle ),
9675                 rec( 14, 6, TargetFileHandle ),
9676                 rec( 20, 4, FileOffset, BE ),
9677                 rec( 24, 4, TargetFileOffset, BE ),
9678                 rec( 28, 2, BytesToCopy, BE ),
9679         ])
9680         pkt.Reply(12, [
9681                 rec( 8, 4, BytesActuallyTransferred, BE ),
9682         ])
9683         pkt.CompletionCodes([0x0000, 0x0104, 0x8300, 0x8800, 0x9300, 0x9400,
9684                              0x9500, 0x9600, 0xa201, 0xff1b])
9685         # 2222/4B, 75
9686         pkt = NCP(0x4B, "Set File Time Date Stamp", 'file')
9687         pkt.Request(18, [
9688                 rec( 7, 1, Reserved ),
9689                 rec( 8, 6, FileHandle ),
9690                 rec( 14, 2, FileTime, BE ),
9691                 rec( 16, 2, FileDate, BE ),
9692         ])
9693         pkt.Reply(8)
9694         pkt.CompletionCodes([0x0000, 0x8800, 0x9600])
9695         # 2222/4C, 76
9696         pkt = NCP(0x4C, "Open File", 'file')
9697         pkt.Request((11, 265), [
9698                 rec( 7, 1, DirHandle ),
9699                 rec( 8, 1, SearchAttributes ),
9700                 rec( 9, 1, AccessRightsMask ),
9701                 rec( 10, (1,255), FileName ),
9702         ], info_str=(FileName, "Open File: %s", ", %s"))
9703         pkt.Reply(44, [
9704                 rec( 8, 6, FileHandle ),
9705                 rec( 14, 2, Reserved2 ),
9706                 rec( 16, 14, FileName14 ),
9707                 rec( 30, 1, AttributesDef ),
9708                 rec( 31, 1, FileExecuteType ),
9709                 rec( 32, 4, FileSize, BE ),
9710                 rec( 36, 2, CreationDate, BE ),
9711                 rec( 38, 2, LastAccessedDate, BE ),
9712                 rec( 40, 2, ModifiedDate, BE ),
9713                 rec( 42, 2, ModifiedTime, BE ),
9714         ])
9715         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8200, 0x9400,
9716                              0x9600, 0x9804, 0x9c03, 0xa100, 0xfd00,
9717                              0xff16])
9718         # 2222/4D, 77
9719         pkt = NCP(0x4D, "Create File", 'file')
9720         pkt.Request((10, 264), [
9721                 rec( 7, 1, DirHandle ),
9722                 rec( 8, 1, AttributesDef ),
9723                 rec( 9, (1,255), FileName ),
9724         ], info_str=(FileName, "Create File: %s", ", %s"))
9725         pkt.Reply(44, [
9726                 rec( 8, 6, FileHandle ),
9727                 rec( 14, 2, Reserved2 ),
9728                 rec( 16, 14, FileName14 ),
9729                 rec( 30, 1, AttributesDef ),
9730                 rec( 31, 1, FileExecuteType ),
9731                 rec( 32, 4, FileSize, BE ),
9732                 rec( 36, 2, CreationDate, BE ),
9733                 rec( 38, 2, LastAccessedDate, BE ),
9734                 rec( 40, 2, ModifiedDate, BE ),
9735                 rec( 42, 2, ModifiedTime, BE ),
9736         ])
9737         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
9738                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
9739                              0x9804, 0x9900, 0x9b03, 0x9c03, 0xfd00,
9740                              0xff00])
9741         # 2222/4F, 79
9742         pkt = NCP(0x4F, "Set File Extended Attributes", 'file')
9743         pkt.Request((11, 265), [
9744                 rec( 7, 1, AttributesDef ),
9745                 rec( 8, 1, DirHandle ),
9746                 rec( 9, 1, AccessRightsMask ),
9747                 rec( 10, (1,255), FileName ),
9748         ], info_str=(FileName, "Set File Extended Attributes: %s", ", %s"))
9749         pkt.Reply(8)
9750         pkt.CompletionCodes([0x0000, 0x8c00, 0x8d00, 0x8e00, 0x9600,
9751                              0x9804, 0x9b03, 0x9c03, 0xa100, 0xfd00,
9752                              0xff16])
9753         # 2222/54, 84
9754         pkt = NCP(0x54, "Open/Create File", 'file')
9755         pkt.Request((12, 266), [
9756                 rec( 7, 1, DirHandle ),
9757                 rec( 8, 1, AttributesDef ),
9758                 rec( 9, 1, AccessRightsMask ),
9759                 rec( 10, 1, ActionFlag ),
9760                 rec( 11, (1,255), FileName ),
9761         ], info_str=(FileName, "Open/Create File: %s", ", %s"))
9762         pkt.Reply(44, [
9763                 rec( 8, 6, FileHandle ),
9764                 rec( 14, 2, Reserved2 ),
9765                 rec( 16, 14, FileName14 ),
9766                 rec( 30, 1, AttributesDef ),
9767                 rec( 31, 1, FileExecuteType ),
9768                 rec( 32, 4, FileSize, BE ),
9769                 rec( 36, 2, CreationDate, BE ),
9770                 rec( 38, 2, LastAccessedDate, BE ),
9771                 rec( 40, 2, ModifiedDate, BE ),
9772                 rec( 42, 2, ModifiedTime, BE ),
9773         ])
9774         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
9775                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
9776                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
9777         # 2222/55, 85
9778         pkt = NCP(0x55, "Get Sparse File Data Block Bit Map", 'file')
9779         pkt.Request(17, [
9780                 rec( 7, 6, FileHandle ),
9781                 rec( 13, 4, FileOffset ),
9782         ])
9783         pkt.Reply(528, [
9784                 rec( 8, 4, AllocationBlockSize ),
9785                 rec( 12, 4, Reserved4 ),
9786                 rec( 16, 512, BitMap ),
9787         ])
9788         pkt.CompletionCodes([0x0000, 0x8800])
9789         # 2222/5601, 86/01
9790         pkt = NCP(0x5601, "Close Extended Attribute Handle", 'file', has_length=0 )
9791         pkt.Request(14, [
9792                 rec( 8, 2, Reserved2 ),
9793                 rec( 10, 4, EAHandle ),
9794         ])
9795         pkt.Reply(8)
9796         pkt.CompletionCodes([0x0000, 0xcf00, 0xd301])
9797         # 2222/5602, 86/02
9798         pkt = NCP(0x5602, "Write Extended Attribute", 'file', has_length=0 )
9799         pkt.Request((35,97), [
9800                 rec( 8, 2, EAFlags ),
9801                 rec( 10, 4, EAHandleOrNetWareHandleOrVolume ),
9802                 rec( 14, 4, ReservedOrDirectoryNumber ),
9803                 rec( 18, 4, TtlWriteDataSize ),
9804                 rec( 22, 4, FileOffset ),
9805                 rec( 26, 4, EAAccessFlag ),
9806                 rec( 30, 2, EAValueLength, var='x' ),
9807                 rec( 32, (2,64), EAKey ),
9808                 rec( -1, 1, EAValueRep, repeat='x' ),
9809         ], info_str=(EAKey, "Write Extended Attribute: %s", ", %s"))
9810         pkt.Reply(20, [
9811                 rec( 8, 4, EAErrorCodes ),
9812                 rec( 12, 4, EABytesWritten ),
9813                 rec( 16, 4, NewEAHandle ),
9814         ])
9815         pkt.CompletionCodes([0x0000, 0xc800, 0xc900, 0xcb00, 0xce00, 0xcf00, 0xd101,
9816                              0xd203, 0xd301, 0xd402])
9817         # 2222/5603, 86/03
9818         pkt = NCP(0x5603, "Read Extended Attribute", 'file', has_length=0 )
9819         pkt.Request((28,538), [
9820                 rec( 8, 2, EAFlags ),
9821                 rec( 10, 4, EAHandleOrNetWareHandleOrVolume ),
9822                 rec( 14, 4, ReservedOrDirectoryNumber ),
9823                 rec( 18, 4, FileOffset ),
9824                 rec( 22, 4, InspectSize ),
9825                 rec( 26, (2,512), EAKey ),
9826         ], info_str=(EAKey, "Read Extended Attribute: %s", ", %s"))
9827         pkt.Reply((26,536), [
9828                 rec( 8, 4, EAErrorCodes ),
9829                 rec( 12, 4, TtlValuesLength ),
9830                 rec( 16, 4, NewEAHandle ),
9831                 rec( 20, 4, EAAccessFlag ),
9832                 rec( 24, (2,512), EAValue ),
9833         ])
9834         pkt.CompletionCodes([0x0000, 0xc900, 0xce00, 0xcf00, 0xd101,
9835                              0xd301])
9836         # 2222/5604, 86/04
9837         pkt = NCP(0x5604, "Enumerate Extended Attribute", 'file', has_length=0 )
9838         pkt.Request((26,536), [
9839                 rec( 8, 2, EAFlags ),
9840                 rec( 10, 4, EAHandleOrNetWareHandleOrVolume ),
9841                 rec( 14, 4, ReservedOrDirectoryNumber ),
9842                 rec( 18, 4, InspectSize ),
9843                 rec( 22, 2, SequenceNumber ),
9844                 rec( 24, (2,512), EAKey ),
9845         ], info_str=(EAKey, "Enumerate Extended Attribute: %s", ", %s"))
9846         pkt.Reply(28, [
9847                 rec( 8, 4, EAErrorCodes ),
9848                 rec( 12, 4, TtlEAs ),
9849                 rec( 16, 4, TtlEAsDataSize ),
9850                 rec( 20, 4, TtlEAsKeySize ),
9851                 rec( 24, 4, NewEAHandle ),
9852         ])
9853         pkt.CompletionCodes([0x0000, 0xc900, 0xce00, 0xcf00, 0xd101,
9854                              0xd301])
9855         # 2222/5605, 86/05
9856         pkt = NCP(0x5605, "Duplicate Extended Attributes", 'file', has_length=0 )
9857         pkt.Request(28, [
9858                 rec( 8, 2, EAFlags ),
9859                 rec( 10, 2, DstEAFlags ),
9860                 rec( 12, 4, EAHandleOrNetWareHandleOrVolume ),
9861                 rec( 16, 4, ReservedOrDirectoryNumber ),
9862                 rec( 20, 4, EAHandleOrNetWareHandleOrVolume ),
9863                 rec( 24, 4, ReservedOrDirectoryNumber ),
9864         ])
9865         pkt.Reply(20, [
9866                 rec( 8, 4, EADuplicateCount ),
9867                 rec( 12, 4, EADataSizeDuplicated ),
9868                 rec( 16, 4, EAKeySizeDuplicated ),
9869         ])
9870         pkt.CompletionCodes([0x0000, 0xd101])
9871         # 2222/5701, 87/01
9872         pkt = NCP(0x5701, "Open/Create File or Subdirectory", 'file', has_length=0)
9873         pkt.Request((30, 284), [
9874                 rec( 8, 1, NameSpace  ),
9875                 rec( 9, 1, OpenCreateMode ),
9876                 rec( 10, 2, SearchAttributesLow ),
9877                 rec( 12, 2, ReturnInfoMask ),
9878                 rec( 14, 2, ExtendedInfo ),
9879                 rec( 16, 4, AttributesDef32 ),
9880                 rec( 20, 2, DesiredAccessRights ),
9881                 rec( 22, 1, VolumeNumber ),
9882                 rec( 23, 4, DirectoryBase ),
9883                 rec( 27, 1, HandleFlag ),
9884                 rec( 28, 1, PathCount, var="x" ),
9885                 rec( 29, (1,255), Path, repeat="x" ),
9886         ], info_str=(Path, "Open or Create: %s", "/%s"))
9887         pkt.Reply( NO_LENGTH_CHECK, [
9888                 rec( 8, 4, FileHandle ),
9889                 rec( 12, 1, OpenCreateAction ),
9890                 rec( 13, 1, Reserved ),
9891                 srec( DSSpaceAllocateStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
9892                 srec( PadDSSpaceAllocate, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
9893                 srec( AttributesStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
9894                 srec( PadAttributes, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
9895                 srec( DataStreamSizeStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
9896                 srec( PadDataStreamSize, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
9897                 srec( TotalStreamSizeStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
9898                 srec( PadTotalStreamSize, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
9899                 srec( CreationInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
9900                 srec( PadCreationInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
9901                 srec( ModifyInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
9902                 srec( PadModifyInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
9903                 srec( ArchiveInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
9904                 srec( PadArchiveInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
9905                 srec( RightsInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
9906                 srec( PadRightsInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
9907                 srec( DirEntryStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
9908                 srec( PadDirEntry, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
9909                 srec( EAInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
9910                 srec( PadEAInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
9911                 srec( NSInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
9912                 srec( PadNSInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
9913                 srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc  == 1)" ),
9914                 srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
9915                 srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
9916                 srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
9917                 srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
9918                 srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
9919                 srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
9920                 srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
9921                 srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
9922                 srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
9923                 srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
9924                 srec( ReferenceIDStruct, req_cond="ncp.ret_info_mask_id == 1" ), 
9925                 srec( NSAttributeStruct, req_cond="ncp.ret_info_mask_ns_attr == 1" ),
9926                 srec( DStreamActual, req_cond="ncp.ret_info_mask_actual == 1" ),
9927                 srec( DStreamLogical, req_cond="ncp.ret_info_mask_logical == 1" ),
9928                 srec( LastUpdatedInSecondsStruct, req_cond="ncp.ext_info_update == 1" ), 
9929                 srec( DOSNameStruct, req_cond="ncp.ext_info_dos_name == 1" ), 
9930                 srec( FlushTimeStruct, req_cond="ncp.ext_info_flush == 1" ), 
9931                 srec( ParentBaseIDStruct, req_cond="ncp.ext_info_parental == 1" ), 
9932                 srec( MacFinderInfoStruct, req_cond="ncp.ext_info_mac_finder == 1" ), 
9933                 srec( SiblingCountStruct, req_cond="ncp.ext_info_sibling == 1" ), 
9934                 srec( EffectiveRightsStruct, req_cond="ncp.ext_info_effective == 1" ), 
9935                 srec( MacTimeStruct, req_cond="ncp.ext_info_mac_date == 1" ),
9936                 srec( LastAccessedTimeStruct, req_cond="ncp.ext_info_access == 1" ), 
9937                 srec( FileNameStruct, req_cond="ncp.ret_info_mask_fname == 1" ),
9938         ])
9939         pkt.ReqCondSizeVariable()
9940         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
9941                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
9942                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
9943         # 2222/5702, 87/02
9944         pkt = NCP(0x5702, "Initialize Search", 'file', has_length=0)
9945         pkt.Request( (18,272), [
9946                 rec( 8, 1, NameSpace  ),
9947                 rec( 9, 1, Reserved ),
9948                 rec( 10, 1, VolumeNumber ),
9949                 rec( 11, 4, DirectoryBase ),
9950                 rec( 15, 1, HandleFlag ),
9951                 rec( 16, 1, PathCount, var="x" ),
9952                 rec( 17, (1,255), Path, repeat="x" ),
9953         ], info_str=(Path, "Set Search Pointer to: %s", "/%s"))
9954         pkt.Reply(17, [
9955                 rec( 8, 1, VolumeNumber ),
9956                 rec( 9, 4, DirectoryNumber ),
9957                 rec( 13, 4, DirectoryEntryNumber ),
9958         ])
9959         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
9960                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
9961                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
9962         # 2222/5703, 87/03
9963         pkt = NCP(0x5703, "Search for File or Subdirectory", 'file', has_length=0)
9964         pkt.Request((26, 280), [
9965                 rec( 8, 1, NameSpace  ),
9966                 rec( 9, 1, DataStream ),
9967                 rec( 10, 2, SearchAttributesLow ),
9968                 rec( 12, 2, ReturnInfoMask ),
9969                 rec( 14, 2, ExtendedInfo ),
9970                 rec( 16, 9, SearchSequence ),
9971                 rec( 25, (1,255), SearchPattern ),
9972         ], info_str=(SearchPattern, "Search for: %s", "/%s"))
9973         pkt.Reply( NO_LENGTH_CHECK, [
9974                 rec( 8, 9, SearchSequence ),
9975                 rec( 17, 1, Reserved ),
9976                 srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
9977                 srec( PadDSSpaceAllocate, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
9978                 srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
9979                 srec( PadAttributes, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
9980                 srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
9981                 srec( PadDataStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
9982                 srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
9983                 srec( PadTotalStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
9984                 srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
9985                 srec( PadCreationInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
9986                 srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
9987                 srec( PadModifyInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
9988                 srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
9989                 srec( PadArchiveInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
9990                 srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
9991                 srec( PadRightsInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
9992                 srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
9993                 srec( PadDirEntry, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
9994                 srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
9995                 srec( PadEAInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
9996                 srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
9997                 srec( PadNSInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
9998                 srec( FileNameStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_fname == 1)" ),
9999                 srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc  == 1)" ),
10000                 srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
10001                 srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
10002                 srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
10003                 srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
10004                 srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
10005                 srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
10006                 srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
10007                 srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
10008                 srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
10009                 srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
10010                 srec( FileNameStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_fname == 1)" ),
10011         ])
10012         pkt.ReqCondSizeVariable()
10013         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10014                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
10015                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
10016         # 2222/5704, 87/04
10017         pkt = NCP(0x5704, "Rename Or Move a File or Subdirectory", 'file', has_length=0)
10018         pkt.Request((28, 536), [
10019                 rec( 8, 1, NameSpace  ),
10020                 rec( 9, 1, RenameFlag ),
10021                 rec( 10, 2, SearchAttributesLow ),
10022                 rec( 12, 1, VolumeNumber ),
10023                 rec( 13, 4, DirectoryBase ),
10024                 rec( 17, 1, HandleFlag ),
10025                 rec( 18, 1, PathCount, var="x" ),
10026                 rec( 19, 1, VolumeNumber ),
10027                 rec( 20, 4, DirectoryBase ),
10028                 rec( 24, 1, HandleFlag ),
10029                 rec( 25, 1, PathCount, var="y" ),
10030                 rec( 26, (1, 255), Path, repeat="x" ),
10031                 rec( -1, (1,255), Path, repeat="y" ),
10032         ], info_str=(Path, "Rename or Move: %s", "/%s"))
10033         pkt.Reply(8)
10034         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10035                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9200, 0x9600,
10036                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
10037         # 2222/5705, 87/05
10038         pkt = NCP(0x5705, "Scan File or Subdirectory for Trustees", 'file', has_length=0)
10039         pkt.Request((24, 278), [
10040                 rec( 8, 1, NameSpace  ),
10041                 rec( 9, 1, Reserved ),
10042                 rec( 10, 2, SearchAttributesLow ),
10043                 rec( 12, 4, SequenceNumber ),
10044                 rec( 16, 1, VolumeNumber ),
10045                 rec( 17, 4, DirectoryBase ),
10046                 rec( 21, 1, HandleFlag ),
10047                 rec( 22, 1, PathCount, var="x" ),
10048                 rec( 23, (1, 255), Path, repeat="x" ),
10049         ], info_str=(Path, "Scan Trustees for: %s", "/%s"))
10050         pkt.Reply(20, [
10051                 rec( 8, 4, SequenceNumber ),
10052                 rec( 12, 2, ObjectIDCount, var="x" ),
10053                 rec( 14, 6, TrusteeStruct, repeat="x" ),
10054         ])
10055         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10056                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
10057                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
10058         # 2222/5706, 87/06
10059         pkt = NCP(0x5706, "Obtain File or SubDirectory Information", 'file', has_length=0)
10060         pkt.Request((24,278), [
10061                 rec( 10, 1, SrcNameSpace ),
10062                 rec( 11, 1, DestNameSpace ),
10063                 rec( 12, 2, SearchAttributesLow ),
10064                 rec( 14, 2, ReturnInfoMask, LE ),
10065                 rec( 16, 2, ExtendedInfo ),
10066                 rec( 18, 1, VolumeNumber ),
10067                 rec( 19, 4, DirectoryBase ),
10068                 rec( 23, 1, HandleFlag ),
10069                 rec( 24, 1, PathCount, var="x" ),
10070                 rec( 25, (1,255), Path, repeat="x",),
10071         ], info_str=(Path, "Obtain Info for: %s", "/%s"))
10072         pkt.Reply(NO_LENGTH_CHECK, [
10073             srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
10074             srec( PadDSSpaceAllocate, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
10075             srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
10076             srec( PadAttributes, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
10077             srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
10078             srec( PadDataStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
10079             srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
10080             srec( PadTotalStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
10081             srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
10082             srec( PadCreationInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
10083             srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
10084             srec( PadModifyInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
10085             srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
10086             srec( PadArchiveInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
10087             srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
10088             srec( PadRightsInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
10089             srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
10090             srec( PadDirEntry, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
10091             srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
10092             srec( PadEAInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
10093             srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
10094             srec( PadNSInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
10095             srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc  == 1)" ),
10096             srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
10097             srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
10098             srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
10099             srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
10100             srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
10101             srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
10102             srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
10103             srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
10104             srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
10105             srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
10106             srec( ReferenceIDStruct, req_cond="ncp.ret_info_mask_id == 1" ), 
10107             srec( NSAttributeStruct, req_cond="ncp.ret_info_mask_ns_attr == 1" ),
10108             srec( DStreamActual, req_cond="ncp.ret_info_mask_actual == 1" ),
10109             srec( DStreamLogical, req_cond="ncp.ret_info_mask_logical == 1" ),
10110             srec( LastUpdatedInSecondsStruct, req_cond="ncp.ext_info_update == 1" ), 
10111             srec( DOSNameStruct, req_cond="ncp.ext_info_dos_name == 1" ), 
10112             srec( FlushTimeStruct, req_cond="ncp.ext_info_flush == 1" ), 
10113             srec( ParentBaseIDStruct, req_cond="ncp.ext_info_parental == 1" ), 
10114             srec( MacFinderInfoStruct, req_cond="ncp.ext_info_mac_finder == 1" ), 
10115             srec( SiblingCountStruct, req_cond="ncp.ext_info_sibling == 1" ), 
10116             srec( EffectiveRightsStruct, req_cond="ncp.ext_info_effective == 1" ), 
10117             srec( MacTimeStruct, req_cond="ncp.ext_info_mac_date == 1" ),
10118             srec( LastAccessedTimeStruct, req_cond="ncp.ext_info_access == 1" ), 
10119             srec( FileNameStruct, req_cond="ncp.ret_info_mask_fname == 1" ),
10120         ])
10121         pkt.ReqCondSizeVariable()
10122         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10123                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
10124                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
10125         # 2222/5707, 87/07
10126         pkt = NCP(0x5707, "Modify File or Subdirectory DOS Information", 'file', has_length=0)
10127         pkt.Request((62,316), [
10128                 rec( 8, 1, NameSpace ),
10129                 rec( 9, 1, Reserved ),
10130                 rec( 10, 2, SearchAttributesLow ),
10131                 rec( 12, 2, ModifyDOSInfoMask ),
10132                 rec( 14, 2, Reserved2 ),
10133                 rec( 16, 2, AttributesDef16 ),
10134                 rec( 18, 1, FileMode ),
10135                 rec( 19, 1, FileExtendedAttributes ),
10136                 rec( 20, 2, CreationDate ),
10137                 rec( 22, 2, CreationTime ),
10138                 rec( 24, 4, CreatorID, BE ),
10139                 rec( 28, 2, ModifiedDate ),
10140                 rec( 30, 2, ModifiedTime ),
10141                 rec( 32, 4, ModifierID, BE ),
10142                 rec( 36, 2, ArchivedDate ),
10143                 rec( 38, 2, ArchivedTime ),
10144                 rec( 40, 4, ArchiverID, BE ),
10145                 rec( 44, 2, LastAccessedDate ),
10146                 rec( 46, 2, InheritedRightsMask ),
10147                 rec( 48, 2, InheritanceRevokeMask ),
10148                 rec( 50, 4, MaxSpace ),
10149                 rec( 54, 1, VolumeNumber ),
10150                 rec( 55, 4, DirectoryBase ),
10151                 rec( 59, 1, HandleFlag ),
10152                 rec( 60, 1, PathCount, var="x" ),
10153                 rec( 61, (1,255), Path, repeat="x" ),
10154         ], info_str=(Path, "Modify DOS Information for: %s", "/%s"))
10155         pkt.Reply(8)
10156         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10157                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
10158                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
10159         # 2222/5708, 87/08
10160         pkt = NCP(0x5708, "Delete a File or Subdirectory", 'file', has_length=0)
10161         pkt.Request((20,274), [
10162                 rec( 8, 1, NameSpace ),
10163                 rec( 9, 1, Reserved ),
10164                 rec( 10, 2, SearchAttributesLow ),
10165                 rec( 12, 1, VolumeNumber ),
10166                 rec( 13, 4, DirectoryBase ),
10167                 rec( 17, 1, HandleFlag ),
10168                 rec( 18, 1, PathCount, var="x" ),
10169                 rec( 19, (1,255), Path, repeat="x" ),
10170         ], info_str=(Path, "Delete: %s", "/%s"))
10171         pkt.Reply(8)
10172         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10173                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
10174                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
10175         # 2222/5709, 87/09
10176         pkt = NCP(0x5709, "Set Short Directory Handle", 'file', has_length=0)
10177         pkt.Request((20,274), [
10178                 rec( 8, 1, NameSpace ),
10179                 rec( 9, 1, DataStream ),
10180                 rec( 10, 1, DestDirHandle ),
10181                 rec( 11, 1, Reserved ),
10182                 rec( 12, 1, VolumeNumber ),
10183                 rec( 13, 4, DirectoryBase ),
10184                 rec( 17, 1, HandleFlag ),
10185                 rec( 18, 1, PathCount, var="x" ),
10186                 rec( 19, (1,255), Path, repeat="x" ),
10187         ], info_str=(Path, "Set Short Directory Handle to: %s", "/%s"))
10188         pkt.Reply(8)
10189         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10190                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
10191                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
10192         # 2222/570A, 87/10
10193         pkt = NCP(0x570A, "Add Trustee Set to File or Subdirectory", 'file', has_length=0)
10194         pkt.Request((31,285), [
10195                 rec( 8, 1, NameSpace ),
10196                 rec( 9, 1, Reserved ),
10197                 rec( 10, 2, SearchAttributesLow ),
10198                 rec( 12, 2, AccessRightsMaskWord ),
10199                 rec( 14, 2, ObjectIDCount, var="y" ),
10200                 rec( 16, 1, VolumeNumber ),
10201                 rec( 17, 4, DirectoryBase ),
10202                 rec( 21, 1, HandleFlag ),
10203                 rec( 22, 1, PathCount, var="x" ),
10204                 rec( 23, (1,255), Path, repeat="x" ),
10205                 rec( -1, 7, TrusteeStruct, repeat="y" ),
10206         ], info_str=(Path, "Add Trustee Set to: %s", "/%s"))
10207         pkt.Reply(8)
10208         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10209                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
10210                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfc01, 0xfd00, 0xff16])
10211         # 2222/570B, 87/11
10212         pkt = NCP(0x570B, "Delete Trustee Set from File or SubDirectory", 'file', has_length=0)
10213         pkt.Request((27,281), [
10214                 rec( 8, 1, NameSpace ),
10215                 rec( 9, 1, Reserved ),
10216                 rec( 10, 2, ObjectIDCount, var="y" ),
10217                 rec( 12, 1, VolumeNumber ),
10218                 rec( 13, 4, DirectoryBase ),
10219                 rec( 17, 1, HandleFlag ),
10220                 rec( 18, 1, PathCount, var="x" ),
10221                 rec( 19, (1,255), Path, repeat="x" ),
10222                 rec( -1, 7, TrusteeStruct, repeat="y" ),
10223         ], info_str=(Path, "Delete Trustee Set from: %s", "/%s"))
10224         pkt.Reply(8)
10225         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10226                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
10227                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
10228         # 2222/570C, 87/12
10229         pkt = NCP(0x570C, "Allocate Short Directory Handle", 'file', has_length=0)
10230         pkt.Request((20,274), [
10231                 rec( 8, 1, NameSpace ),
10232                 rec( 9, 1, Reserved ),
10233                 rec( 10, 2, AllocateMode ),
10234                 rec( 12, 1, VolumeNumber ),
10235                 rec( 13, 4, DirectoryBase ),
10236                 rec( 17, 1, HandleFlag ),
10237                 rec( 18, 1, PathCount, var="x" ),
10238                 rec( 19, (1,255), Path, repeat="x" ),
10239         ], info_str=(Path, "Allocate Short Directory Handle to: %s", "/%s"))
10240         pkt.Reply(14, [
10241                 rec( 8, 1, DirHandle ),
10242                 rec( 9, 1, VolumeNumber ),
10243                 rec( 10, 4, Reserved4 ),
10244         ])
10245         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10246                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
10247                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
10248         # 2222/5710, 87/16
10249         pkt = NCP(0x5710, "Scan Salvageable Files", 'file', has_length=0)
10250         pkt.Request((26,280), [
10251                 rec( 8, 1, NameSpace ),
10252                 rec( 9, 1, DataStream ),
10253                 rec( 10, 2, ReturnInfoMask ),
10254                 rec( 12, 2, ExtendedInfo ),
10255                 rec( 14, 4, SequenceNumber ),
10256                 rec( 18, 1, VolumeNumber ),
10257                 rec( 19, 4, DirectoryBase ),
10258                 rec( 23, 1, HandleFlag ),
10259                 rec( 24, 1, PathCount, var="x" ),
10260                 rec( 25, (1,255), Path, repeat="x" ),
10261         ], info_str=(Path, "Scan for Deleted Files in: %s", "/%s"))
10262         pkt.Reply(NO_LENGTH_CHECK, [
10263                 rec( 8, 4, SequenceNumber ),
10264                 rec( 12, 2, DeletedTime ),
10265                 rec( 14, 2, DeletedDate ),
10266                 rec( 16, 4, DeletedID, BE ),
10267                 rec( 20, 4, VolumeID ),
10268                 rec( 24, 4, DirectoryBase ),
10269                 srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
10270                 srec( PadDSSpaceAllocate, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
10271                 srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
10272                 srec( PadAttributes, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
10273                 srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
10274                 srec( PadDataStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
10275                 srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
10276                 srec( PadTotalStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
10277                 srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
10278                 srec( PadCreationInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
10279                 srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
10280                 srec( PadModifyInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
10281                 srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
10282                 srec( PadArchiveInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
10283                 srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
10284                 srec( PadRightsInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
10285                 srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
10286                 srec( PadDirEntry, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
10287                 srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
10288                 srec( PadEAInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
10289                 srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
10290                 srec( PadNSInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
10291                 srec( FileNameStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_fname == 1)" ),
10292                 srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc  == 1)" ),
10293                 srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
10294                 srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
10295                 srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
10296                 srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
10297                 srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
10298                 srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
10299                 srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
10300                 srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
10301                 srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
10302                 srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
10303                 srec( FileNameStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_fname == 1)" ),
10304         ])
10305         pkt.ReqCondSizeVariable()
10306         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10307                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
10308                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
10309         # 2222/5711, 87/17
10310         pkt = NCP(0x5711, "Recover Salvageable File", 'file', has_length=0)
10311         pkt.Request((23,277), [
10312                 rec( 8, 1, NameSpace ),
10313                 rec( 9, 1, Reserved ),
10314                 rec( 10, 4, SequenceNumber ),
10315                 rec( 14, 4, VolumeID ),
10316                 rec( 18, 4, DirectoryBase ),
10317                 rec( 22, (1,255), FileName ),
10318         ], info_str=(FileName, "Recover Deleted File: %s", ", %s"))
10319         pkt.Reply(8)
10320         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10321                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
10322                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
10323         # 2222/5712, 87/18
10324         pkt = NCP(0x5712, "Purge Salvageable Files", 'file', has_length=0)
10325         pkt.Request(22, [
10326                 rec( 8, 1, NameSpace ),
10327                 rec( 9, 1, Reserved ),
10328                 rec( 10, 4, SequenceNumber ),
10329                 rec( 14, 4, VolumeID ),
10330                 rec( 18, 4, DirectoryBase ),
10331         ])
10332         pkt.Reply(8)
10333         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10334                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
10335                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
10336         # 2222/5713, 87/19
10337         pkt = NCP(0x5713, "Get Name Space Information", 'file', has_length=0)
10338         pkt.Request(18, [
10339                 rec( 8, 1, SrcNameSpace ),
10340                 rec( 9, 1, DestNameSpace ),
10341                 rec( 10, 1, Reserved ),
10342                 rec( 11, 1, VolumeNumber ),
10343                 rec( 12, 4, DirectoryBase ),
10344                 rec( 16, 2, NamesSpaceInfoMask ),
10345         ])
10346         pkt.Reply(NO_LENGTH_CHECK, [
10347             srec( FileNameStruct, req_cond="ncp.ns_info_mask_modify == TRUE" ),
10348             srec( FileAttributesStruct, req_cond="ncp.ns_info_mask_fatt == TRUE" ),
10349             srec( CreationDateStruct, req_cond="ncp.ns_info_mask_cdate == TRUE" ),
10350             srec( CreationTimeStruct, req_cond="ncp.ns_info_mask_ctime == TRUE" ),
10351             srec( OwnerIDStruct, req_cond="ncp.ns_info_mask_owner == TRUE" ),
10352             srec( ArchiveDateStruct, req_cond="ncp.ns_info_mask_adate == TRUE" ),
10353             srec( ArchiveTimeStruct, req_cond="ncp.ns_info_mask_atime == TRUE" ),
10354             srec( ArchiveIdStruct, req_cond="ncp.ns_info_mask_aid == TRUE" ),
10355             srec( UpdateDateStruct, req_cond="ncp.ns_info_mask_udate == TRUE" ),
10356             srec( UpdateTimeStruct, req_cond="ncp.ns_info_mask_utime == TRUE" ),
10357             srec( UpdateIDStruct, req_cond="ncp.ns_info_mask_uid == TRUE" ),
10358             srec( LastAccessStruct, req_cond="ncp.ns_info_mask_acc_date == TRUE" ),
10359             srec( RightsInfoStruct, req_cond="ncp.ns_info_mask_max_acc_mask == TRUE" ),
10360         ])
10361         pkt.ReqCondSizeVariable()
10362         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10363                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
10364                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
10365         # 2222/5714, 87/20
10366         pkt = NCP(0x5714, "Search for File or Subdirectory Set", 'file', has_length=0)
10367         pkt.Request((28, 282), [
10368                 rec( 8, 1, NameSpace  ),
10369                 rec( 9, 1, DataStream ),
10370                 rec( 10, 2, SearchAttributesLow ),
10371                 rec( 12, 2, ReturnInfoMask ),
10372                 rec( 14, 2, ExtendedInfo ),
10373                 rec( 16, 2, ReturnInfoCount ),
10374                 rec( 18, 9, SearchSequence ),
10375                 rec( 27, (1,255), SearchPattern ),
10376         ], info_str=(SearchPattern, "Search for: %s", ", %s"))
10377         pkt.Reply(NO_LENGTH_CHECK, [
10378                 rec( 8, 9, SearchSequence ),
10379                 rec( 17, 1, MoreFlag ),
10380                 rec( 18, 2, InfoCount ),
10381             srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
10382             srec( PadDSSpaceAllocate, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
10383             srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
10384             srec( PadAttributes, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
10385             srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
10386             srec( PadDataStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
10387             srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
10388             srec( PadTotalStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
10389             srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
10390             srec( PadCreationInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
10391             srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
10392             srec( PadModifyInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
10393             srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
10394             srec( PadArchiveInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
10395             srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
10396             srec( PadRightsInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
10397             srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
10398             srec( PadDirEntry, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
10399             srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
10400             srec( PadEAInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
10401             srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
10402             srec( PadNSInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
10403             srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc  == 1)" ),
10404             srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
10405             srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
10406             srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
10407             srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
10408             srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
10409             srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
10410             srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
10411             srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
10412             srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
10413             srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
10414             srec( ReferenceIDStruct, req_cond="ncp.ret_info_mask_id == 1" ), 
10415             srec( NSAttributeStruct, req_cond="ncp.ret_info_mask_ns_attr == 1" ),
10416             srec( DStreamActual, req_cond="ncp.ret_info_mask_actual == 1" ),
10417             srec( DStreamLogical, req_cond="ncp.ret_info_mask_logical == 1" ),
10418             srec( LastUpdatedInSecondsStruct, req_cond="ncp.ext_info_update == 1" ), 
10419             srec( DOSNameStruct, req_cond="ncp.ext_info_dos_name == 1" ), 
10420             srec( FlushTimeStruct, req_cond="ncp.ext_info_flush == 1" ), 
10421             srec( ParentBaseIDStruct, req_cond="ncp.ext_info_parental == 1" ), 
10422             srec( MacFinderInfoStruct, req_cond="ncp.ext_info_mac_finder == 1" ), 
10423             srec( SiblingCountStruct, req_cond="ncp.ext_info_sibling == 1" ), 
10424             srec( EffectiveRightsStruct, req_cond="ncp.ext_info_effective == 1" ), 
10425             srec( MacTimeStruct, req_cond="ncp.ext_info_mac_date == 1" ),
10426             srec( LastAccessedTimeStruct, req_cond="ncp.ext_info_access == 1" ), 
10427             srec( FileNameStruct, req_cond="ncp.ret_info_mask_fname == 1" ),
10428         ])
10429         pkt.ReqCondSizeVariable()
10430         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10431                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
10432                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
10433         # 2222/5715, 87/21
10434         pkt = NCP(0x5715, "Get Path String from Short Directory Handle", 'file', has_length=0)
10435         pkt.Request(10, [
10436                 rec( 8, 1, NameSpace ),
10437                 rec( 9, 1, DirHandle ),
10438         ])
10439         pkt.Reply((9,263), [
10440                 rec( 8, (1,255), Path ),
10441         ])
10442         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10443                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
10444                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
10445         # 2222/5716, 87/22
10446         pkt = NCP(0x5716, "Generate Directory Base and Volume Number", 'file', has_length=0)
10447         pkt.Request((20,274), [
10448                 rec( 8, 1, SrcNameSpace ),
10449                 rec( 9, 1, DestNameSpace ),
10450                 rec( 10, 2, dstNSIndicator ),
10451                 rec( 12, 1, VolumeNumber ),
10452                 rec( 13, 4, DirectoryBase ),
10453                 rec( 17, 1, HandleFlag ),
10454                 rec( 18, 1, PathCount, var="x" ),
10455                 rec( 19, (1,255), Path, repeat="x" ),
10456         ], info_str=(Path, "Get Volume and Directory Base from: %s", "/%s"))
10457         pkt.Reply(17, [
10458                 rec( 8, 4, DirectoryBase ),
10459                 rec( 12, 4, DOSDirectoryBase ),
10460                 rec( 16, 1, VolumeNumber ),
10461         ])
10462         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10463                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
10464                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
10465         # 2222/5717, 87/23
10466         pkt = NCP(0x5717, "Query Name Space Information Format", 'file', has_length=0)
10467         pkt.Request(10, [
10468                 rec( 8, 1, NameSpace ),
10469                 rec( 9, 1, VolumeNumber ),
10470         ])
10471         pkt.Reply(58, [
10472                 rec( 8, 4, FixedBitMask ),
10473                 rec( 12, 4, VariableBitMask ),
10474                 rec( 16, 4, HugeBitMask ),
10475                 rec( 20, 2, FixedBitsDefined ),
10476                 rec( 22, 2, VariableBitsDefined ),
10477                 rec( 24, 2, HugeBitsDefined ),
10478                 rec( 26, 32, FieldsLenTable ),
10479         ])
10480         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10481                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
10482                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
10483         # 2222/5718, 87/24
10484         pkt = NCP(0x5718, "Get Name Spaces Loaded List from Volume Number", 'file', has_length=0)
10485         pkt.Request(10, [
10486                 rec( 8, 1, Reserved ),
10487                 rec( 9, 1, VolumeNumber ),
10488         ])
10489         pkt.Reply(11, [
10490                 rec( 8, 2, NumberOfNSLoaded, var="x" ),
10491                 rec( 10, 1, NameSpace, repeat="x" ),
10492         ])
10493         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10494                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
10495                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
10496         # 2222/5719, 87/25
10497         pkt = NCP(0x5719, "Set Name Space Information", 'file', has_length=0)
10498         pkt.Request(531, [
10499                 rec( 8, 1, SrcNameSpace ),
10500                 rec( 9, 1, DestNameSpace ),
10501                 rec( 10, 1, VolumeNumber ),
10502                 rec( 11, 4, DirectoryBase ),
10503                 rec( 15, 2, NamesSpaceInfoMask ),
10504                 rec( 17, 2, Reserved2 ),
10505                 rec( 19, 512, NSSpecificInfo ),
10506         ])
10507         pkt.Reply(8)
10508         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10509                              0x8701, 0x8b00, 0x8d00, 0x8f00, 0x9001,
10510                              0x9600, 0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00,
10511                              0xff16])
10512         # 2222/571A, 87/26
10513         pkt = NCP(0x571A, "Get Huge Name Space Information", 'file', has_length=0)
10514         pkt.Request(34, [
10515                 rec( 8, 1, NameSpace ),
10516                 rec( 9, 1, VolumeNumber ),
10517                 rec( 10, 4, DirectoryBase ),
10518                 rec( 14, 4, HugeBitMask ),
10519                 rec( 18, 16, HugeStateInfo ),
10520         ])
10521         pkt.Reply((25,279), [
10522                 rec( 8, 16, NextHugeStateInfo ),
10523                 rec( 24, (1,255), HugeData ),
10524         ])
10525         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10526                              0x8701, 0x8b00, 0x8d00, 0x8f00, 0x9001,
10527                              0x9600, 0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00,
10528                              0xff16])
10529         # 2222/571B, 87/27
10530         pkt = NCP(0x571B, "Set Huge Name Space Information", 'file', has_length=0)
10531         pkt.Request((35,289), [
10532                 rec( 8, 1, NameSpace ),
10533                 rec( 9, 1, VolumeNumber ),
10534                 rec( 10, 4, DirectoryBase ),
10535                 rec( 14, 4, HugeBitMask ),
10536                 rec( 18, 16, HugeStateInfo ),
10537                 rec( 34, (1,255), HugeData ),
10538         ])
10539         pkt.Reply(28, [
10540                 rec( 8, 16, NextHugeStateInfo ),
10541                 rec( 24, 4, HugeDataUsed ),
10542         ])
10543         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10544                              0x8701, 0x8b00, 0x8d00, 0x8f00, 0x9001,
10545                              0x9600, 0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00,
10546                              0xff16])
10547         # 2222/571C, 87/28
10548         pkt = NCP(0x571C, "Get Full Path String", 'file', has_length=0)
10549         pkt.Request((28,282), [
10550                 rec( 8, 1, SrcNameSpace ),
10551                 rec( 9, 1, DestNameSpace ),
10552                 rec( 10, 2, PathCookieFlags ),
10553                 rec( 12, 4, Cookie1 ),
10554                 rec( 16, 4, Cookie2 ),
10555                 rec( 20, 1, VolumeNumber ),
10556                 rec( 21, 4, DirectoryBase ),
10557                 rec( 25, 1, HandleFlag ),
10558                 rec( 26, 1, PathCount, var="x" ),
10559                 rec( 27, (1,255), Path, repeat="x" ),
10560         ], info_str=(Path, "Get Full Path from: %s", "/%s"))
10561         pkt.Reply((23,277), [
10562                 rec( 8, 2, PathCookieFlags ),
10563                 rec( 10, 4, Cookie1 ),
10564                 rec( 14, 4, Cookie2 ),
10565                 rec( 18, 2, PathComponentSize ),
10566                 rec( 20, 2, PathComponentCount, var='x' ),
10567                 rec( 22, (1,255), Path, repeat='x' ),
10568         ])
10569         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10570                              0x8701, 0x8b00, 0x8d00, 0x8f00, 0x9001,
10571                              0x9600, 0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00,
10572                              0xff16])
10573         # 2222/571D, 87/29
10574         pkt = NCP(0x571D, "Get Effective Directory Rights", 'file', has_length=0)
10575         pkt.Request((24, 278), [
10576                 rec( 8, 1, NameSpace  ),
10577                 rec( 9, 1, DestNameSpace ),
10578                 rec( 10, 2, SearchAttributesLow ),
10579                 rec( 12, 2, ReturnInfoMask ),
10580                 rec( 14, 2, ExtendedInfo ),
10581                 rec( 16, 1, VolumeNumber ),
10582                 rec( 17, 4, DirectoryBase ),
10583                 rec( 21, 1, HandleFlag ),
10584                 rec( 22, 1, PathCount, var="x" ),
10585                 rec( 23, (1,255), Path, repeat="x" ),
10586         ], info_str=(Path, "Get Effective Rights for: %s", "/%s"))
10587         pkt.Reply(NO_LENGTH_CHECK, [
10588                 rec( 8, 2, EffectiveRights ),
10589                 srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
10590                 srec( PadDSSpaceAllocate, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
10591                 srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
10592                 srec( PadAttributes, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
10593                 srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
10594                 srec( PadDataStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
10595                 srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
10596                 srec( PadTotalStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
10597                 srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
10598                 srec( PadCreationInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
10599                 srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
10600                 srec( PadModifyInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
10601                 srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
10602                 srec( PadArchiveInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
10603                 srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
10604                 srec( PadRightsInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
10605                 srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
10606                 srec( PadDirEntry, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
10607                 srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
10608                 srec( PadEAInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
10609                 srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
10610                 srec( PadNSInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
10611                 srec( FileNameStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_fname == 1)" ),
10612                 srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc  == 1)" ),
10613                 srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
10614                 srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
10615                 srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
10616                 srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
10617                 srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
10618                 srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
10619                 srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
10620                 srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
10621                 srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
10622                 srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
10623                 srec( FileNameStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_fname == 1)" ),
10624         ])
10625         pkt.ReqCondSizeVariable()
10626         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10627                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
10628                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
10629         # 2222/571E, 87/30
10630         pkt = NCP(0x571E, "Open/Create File or Subdirectory", 'file', has_length=0)
10631         pkt.Request((34, 288), [
10632                 rec( 8, 1, NameSpace  ),
10633                 rec( 9, 1, DataStream ),
10634                 rec( 10, 1, OpenCreateMode ),
10635                 rec( 11, 1, Reserved ),
10636                 rec( 12, 2, SearchAttributesLow ),
10637                 rec( 14, 2, Reserved2 ),
10638                 rec( 16, 2, ReturnInfoMask ),
10639                 rec( 18, 2, ExtendedInfo ),
10640                 rec( 20, 4, AttributesDef32 ),
10641                 rec( 24, 2, DesiredAccessRights ),
10642                 rec( 26, 1, VolumeNumber ),
10643                 rec( 27, 4, DirectoryBase ),
10644                 rec( 31, 1, HandleFlag ),
10645                 rec( 32, 1, PathCount, var="x" ),
10646                 rec( 33, (1,255), Path, repeat="x" ),
10647         ], info_str=(Path, "Open or Create File: %s", "/%s"))
10648         pkt.Reply(NO_LENGTH_CHECK, [
10649                 rec( 8, 4, FileHandle, BE ),
10650                 rec( 12, 1, OpenCreateAction ),
10651                 rec( 13, 1, Reserved ),
10652                 srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
10653                 srec( PadDSSpaceAllocate, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
10654                 srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
10655                 srec( PadAttributes, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
10656                 srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
10657                 srec( PadDataStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
10658                 srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
10659                 srec( PadTotalStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
10660                 srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
10661                 srec( PadCreationInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
10662                 srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
10663                 srec( PadModifyInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
10664                 srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
10665                 srec( PadArchiveInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
10666                 srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
10667                 srec( PadRightsInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
10668                 srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
10669                 srec( PadDirEntry, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
10670                 srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
10671                 srec( PadEAInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
10672                 srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
10673                 srec( PadNSInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
10674                 srec( FileNameStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_fname == 1)" ),
10675                 srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc  == 1)" ),
10676                 srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
10677                 srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
10678                 srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
10679                 srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
10680                 srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
10681                 srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
10682                 srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
10683                 srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
10684                 srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
10685                 srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
10686                 srec( FileNameStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_fname == 1)" ),
10687         ])
10688         pkt.ReqCondSizeVariable()
10689         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10690                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
10691                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
10692         # 2222/571F, 87/31
10693         pkt = NCP(0x571F, "Get File Information", 'file', has_length=0)
10694         pkt.Request(16, [
10695                 rec( 8, 6, FileHandle  ),
10696                 rec( 14, 1, HandleInfoLevel ),
10697                 rec( 15, 1, NameSpace ),
10698         ])
10699         pkt.Reply(NO_LENGTH_CHECK, [
10700                 rec( 8, 4, VolumeNumberLong ),
10701                 rec( 12, 4, DirectoryBase ),
10702                 srec(HandleInfoLevel0, req_cond="ncp.handle_info_level==0x00" ),
10703                 srec(HandleInfoLevel1, req_cond="ncp.handle_info_level==0x01" ),
10704                 srec(HandleInfoLevel2, req_cond="ncp.handle_info_level==0x02" ),
10705                 srec(HandleInfoLevel3, req_cond="ncp.handle_info_level==0x03" ),
10706                 srec(HandleInfoLevel4, req_cond="ncp.handle_info_level==0x04" ),
10707                 srec(HandleInfoLevel5, req_cond="ncp.handle_info_level==0x05" ),
10708         ])
10709         pkt.ReqCondSizeVariable()
10710         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10711                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
10712                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
10713         # 2222/5720, 87/32
10714         pkt = NCP(0x5720, "Open/Create File or Subdirectory with Callback", 'file', has_length=0)
10715         pkt.Request((30, 284), [
10716                 rec( 8, 1, NameSpace  ),
10717                 rec( 9, 1, OpenCreateMode ),
10718                 rec( 10, 2, SearchAttributesLow ),
10719                 rec( 12, 2, ReturnInfoMask ),
10720                 rec( 14, 2, ExtendedInfo ),
10721                 rec( 16, 4, AttributesDef32 ),
10722                 rec( 20, 2, DesiredAccessRights ),
10723                 rec( 22, 1, VolumeNumber ),
10724                 rec( 23, 4, DirectoryBase ),
10725                 rec( 27, 1, HandleFlag ),
10726                 rec( 28, 1, PathCount, var="x" ),
10727                 rec( 29, (1,255), Path, repeat="x" ),
10728         ], info_str=(Path, "Open or Create with Op-Lock: %s", "/%s"))
10729         pkt.Reply( NO_LENGTH_CHECK, [
10730                 rec( 8, 4, FileHandle, BE ),
10731                 rec( 12, 1, OpenCreateAction ),
10732                 rec( 13, 1, OCRetFlags ),
10733                 srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
10734                 srec( PadDSSpaceAllocate, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
10735                 srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
10736                 srec( PadAttributes, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
10737                 srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
10738                 srec( PadDataStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
10739                 srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
10740                 srec( PadTotalStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
10741                 srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
10742                 srec( PadCreationInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
10743                 srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
10744                 srec( PadModifyInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
10745                 srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
10746                 srec( PadArchiveInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
10747                 srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
10748                 srec( PadRightsInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
10749                 srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
10750                 srec( PadDirEntry, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
10751                 srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
10752                 srec( PadEAInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
10753                 srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
10754                 srec( PadNSInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
10755                 srec( FileNameStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_fname == 1)" ),
10756                 srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc  == 1)" ),
10757                 srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
10758                 srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
10759                 srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
10760                 srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
10761                 srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
10762                 srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
10763                 srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
10764                 srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
10765                 srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
10766                 srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
10767                 srec( FileNameStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_fname == 1)" ),
10768         ])
10769         pkt.ReqCondSizeVariable()
10770         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10771                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
10772                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
10773         # 2222/5721, 87/33
10774         pkt = NCP(0x5721, "Open/Create File or Subdirectory II with Callback", 'file', has_length=0)
10775         pkt.Request((34, 288), [
10776                 rec( 8, 1, NameSpace  ),
10777                 rec( 9, 1, DataStream ),
10778                 rec( 10, 1, OpenCreateMode ),
10779                 rec( 11, 1, Reserved ),
10780                 rec( 12, 2, SearchAttributesLow ),
10781                 rec( 14, 2, Reserved2 ),
10782                 rec( 16, 2, ReturnInfoMask ),
10783                 rec( 18, 2, ExtendedInfo ),
10784                 rec( 20, 4, AttributesDef32 ),
10785                 rec( 24, 2, DesiredAccessRights ),
10786                 rec( 26, 1, VolumeNumber ),
10787                 rec( 27, 4, DirectoryBase ),
10788                 rec( 31, 1, HandleFlag ),
10789                 rec( 32, 1, PathCount, var="x" ),
10790                 rec( 33, (1,255), Path, repeat="x" ),
10791         ], info_str=(FilePath, "Open or Create II with Op-Lock: %s", "/%s"))
10792         pkt.Reply((91,345), [
10793                 rec( 8, 4, FileHandle ),
10794                 rec( 12, 1, OpenCreateAction ),
10795                 rec( 13, 1, OCRetFlags ),
10796                 rec( 14, 4, DataStreamSpaceAlloc ),
10797                 rec( 18, 6, AttributesStruct ),
10798                 rec( 24, 4, DataStreamSize ),
10799                 rec( 28, 4, TtlDSDskSpaceAlloc ),
10800                 rec( 32, 2, NumberOfDataStreams ),
10801                 rec( 34, 2, CreationTime ),
10802                 rec( 36, 2, CreationDate ),
10803                 rec( 38, 4, CreatorID, BE ),
10804                 rec( 42, 2, ModifiedTime ),
10805                 rec( 44, 2, ModifiedDate ),
10806                 rec( 46, 4, ModifierID, BE ),
10807                 rec( 50, 2, LastAccessedDate ),
10808                 rec( 52, 2, ArchivedTime ),
10809                 rec( 54, 2, ArchivedDate ),
10810                 rec( 56, 4, ArchiverID, BE ),
10811                 rec( 60, 2, InheritedRightsMask ),
10812                 rec( 62, 4, DirectoryEntryNumber ),
10813                 rec( 66, 4, DOSDirectoryEntryNumber ),
10814                 rec( 70, 4, VolumeNumberLong ),
10815                 rec( 74, 4, EADataSize ),
10816                 rec( 78, 4, EACount ),
10817                 rec( 82, 4, EAKeySize ),
10818                 rec( 86, 1, CreatorNameSpaceNumber ),
10819                 rec( 87, 3, Reserved3 ),
10820                 rec( 90, (1,255), FileName ),
10821         ])
10822         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10823                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
10824                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
10825         # 2222/5722, 87/34
10826         pkt = NCP(0x5722, "Open CallBack Control (Op-Lock)", 'file', has_length=0)
10827         pkt.Request(13, [
10828                 rec( 10, 4, CCFileHandle ),
10829                 rec( 14, 1, CCFunction ),
10830         ])
10831         pkt.Reply(8)
10832         pkt.CompletionCodes([0x0000, 0x8800])
10833         # 2222/5723, 87/35
10834         pkt = NCP(0x5723, "Modify DOS Attributes on a File or Subdirectory", 'file', has_length=0)
10835         pkt.Request((29, 283), [
10836                 rec( 8, 1, NameSpace  ),
10837                 rec( 9, 2, FlagsDef ),
10838                 rec( 11, 2, SearchAttributesLow ),
10839                 rec( 13, 2, ReturnInfoMask ),
10840                 rec( 15, 2, ExtendedInfo ),
10841                 rec( 17, 4, AttributesDef32 ),
10842                 rec( 21, 1, VolumeNumber ),
10843                 rec( 22, 4, DirectoryBase ),
10844                 rec( 26, 1, HandleFlag ),
10845                 rec( 27, 1, PathCount, var="x" ),
10846                 rec( 28, (1,255), Path, repeat="x" ),
10847         ], info_str=(Path, "Modify DOS Attributes for: %s", "/%s"))
10848         pkt.Reply(24, [
10849                 rec( 8, 4, ItemsChecked ),
10850                 rec( 12, 4, ItemsChanged ),
10851                 rec( 16, 4, AttributeValidFlag ),
10852                 rec( 20, 4, AttributesDef32 ),
10853         ])
10854         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10855                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
10856                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
10857         # 2222/5724, 87/36
10858         pkt = NCP(0x5724, "Log File", 'file', has_length=0)
10859         pkt.Request((28, 282), [
10860                 rec( 8, 1, NameSpace  ),
10861                 rec( 9, 1, Reserved ),
10862                 rec( 10, 2, Reserved2 ),
10863                 rec( 12, 1, LogFileFlagLow ),
10864                 rec( 13, 1, LogFileFlagHigh ),
10865                 rec( 14, 2, Reserved2 ),
10866                 rec( 16, 4, WaitTime ),
10867                 rec( 20, 1, VolumeNumber ),
10868                 rec( 21, 4, DirectoryBase ),
10869                 rec( 25, 1, HandleFlag ),
10870                 rec( 26, 1, PathCount, var="x" ),
10871                 rec( 27, (1,255), Path, repeat="x" ),
10872         ], info_str=(Path, "Lock File: %s", "/%s"))
10873         pkt.Reply(8)
10874         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10875                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
10876                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
10877         # 2222/5725, 87/37
10878         pkt = NCP(0x5725, "Release File", 'file', has_length=0)
10879         pkt.Request((20, 274), [
10880                 rec( 8, 1, NameSpace  ),
10881                 rec( 9, 1, Reserved ),
10882                 rec( 10, 2, Reserved2 ),
10883                 rec( 12, 1, VolumeNumber ),
10884                 rec( 13, 4, DirectoryBase ),
10885                 rec( 17, 1, HandleFlag ),
10886                 rec( 18, 1, PathCount, var="x" ),
10887                 rec( 19, (1,255), Path, repeat="x" ),
10888         ], info_str=(Path, "Release Lock on: %s", "/%s"))
10889         pkt.Reply(8)
10890         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10891                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
10892                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
10893         # 2222/5726, 87/38
10894         pkt = NCP(0x5726, "Clear File", 'file', has_length=0)
10895         pkt.Request((20, 274), [
10896                 rec( 8, 1, NameSpace  ),
10897                 rec( 9, 1, Reserved ),
10898                 rec( 10, 2, Reserved2 ),
10899                 rec( 12, 1, VolumeNumber ),
10900                 rec( 13, 4, DirectoryBase ),
10901                 rec( 17, 1, HandleFlag ),
10902                 rec( 18, 1, PathCount, var="x" ),
10903                 rec( 19, (1,255), Path, repeat="x" ),
10904         ], info_str=(Path, "Clear File: %s", "/%s"))
10905         pkt.Reply(8)
10906         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10907                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
10908                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
10909         # 2222/5727, 87/39
10910         pkt = NCP(0x5727, "Get Directory Disk Space Restriction", 'file', has_length=0)
10911         pkt.Request((19, 273), [
10912                 rec( 8, 1, NameSpace  ),
10913                 rec( 9, 2, Reserved2 ),
10914                 rec( 11, 1, VolumeNumber ),
10915                 rec( 12, 4, DirectoryBase ),
10916                 rec( 16, 1, HandleFlag ),
10917                 rec( 17, 1, PathCount, var="x" ),
10918                 rec( 18, (1,255), Path, repeat="x" ),
10919         ], info_str=(Path, "Get Disk Space Restriction for: %s", "/%s"))
10920         pkt.Reply(18, [
10921                 rec( 8, 1, NumberOfEntries, var="x" ),
10922                 rec( 9, 9, SpaceStruct, repeat="x" ),
10923         ])
10924         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10925                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
10926                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00,
10927                              0xff16])
10928         # 2222/5728, 87/40
10929         pkt = NCP(0x5728, "Search for File or Subdirectory Set (Extended Errors)", 'file', has_length=0)
10930         pkt.Request((28, 282), [
10931                 rec( 8, 1, NameSpace  ),
10932                 rec( 9, 1, DataStream ),
10933                 rec( 10, 2, SearchAttributesLow ),
10934                 rec( 12, 2, ReturnInfoMask ),
10935                 rec( 14, 2, ExtendedInfo ),
10936                 rec( 16, 2, ReturnInfoCount ),
10937                 rec( 18, 9, SearchSequence ),
10938                 rec( 27, (1,255), SearchPattern ),
10939         ], info_str=(SearchPattern, "Search for: %s", ", %s"))
10940         pkt.Reply(NO_LENGTH_CHECK, [
10941                 rec( 8, 9, SearchSequence ),
10942                 rec( 17, 1, MoreFlag ),
10943                 rec( 18, 2, InfoCount ),
10944                 srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
10945                 srec( PadDSSpaceAllocate, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
10946                 srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
10947                 srec( PadAttributes, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
10948                 srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
10949                 srec( PadDataStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
10950                 srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
10951                 srec( PadTotalStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
10952                 srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
10953                 srec( PadCreationInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
10954                 srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
10955                 srec( PadModifyInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
10956                 srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
10957                 srec( PadArchiveInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
10958                 srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
10959                 srec( PadRightsInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
10960                 srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
10961                 srec( PadDirEntry, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
10962                 srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
10963                 srec( PadEAInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
10964                 srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
10965                 srec( PadNSInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
10966                 srec( FileNameStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_fname == 1)" ),
10967                 srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc  == 1)" ),
10968                 srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
10969                 srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
10970                 srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
10971                 srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
10972                 srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
10973                 srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
10974                 srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
10975                 srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
10976                 srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
10977                 srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
10978                 srec( FileNameStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_fname == 1)" ),
10979         ])
10980         pkt.ReqCondSizeVariable()
10981         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
10982                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
10983                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
10984         # 2222/5729, 87/41
10985         pkt = NCP(0x5729, "Scan Salvageable Files", 'file', has_length=0)
10986         pkt.Request((24,278), [
10987                 rec( 8, 1, NameSpace ),
10988                 rec( 9, 1, Reserved ),
10989                 rec( 10, 2, CtrlFlags, LE ),
10990                 rec( 12, 4, SequenceNumber ),
10991                 rec( 16, 1, VolumeNumber ),
10992                 rec( 17, 4, DirectoryBase ),
10993                 rec( 21, 1, HandleFlag ),
10994                 rec( 22, 1, PathCount, var="x" ),
10995                 rec( 23, (1,255), Path, repeat="x" ),
10996         ], info_str=(Path, "Scan Deleted Files: %s", "/%s"))
10997         pkt.Reply(NO_LENGTH_CHECK, [
10998                 rec( 8, 4, SequenceNumber ),
10999                 rec( 12, 4, DirectoryBase ),
11000                 rec( 16, 4, ScanItems, var="x" ),
11001                 srec(ScanInfoFileName, req_cond="ncp.ctrl_flags==0x0001", repeat="x" ),
11002                 srec(ScanInfoFileNoName, req_cond="ncp.ctrl_flags==0x0000", repeat="x" ),
11003         ])
11004         pkt.ReqCondSizeVariable()
11005         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
11006                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
11007                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
11008         # 2222/572A, 87/42
11009         pkt = NCP(0x572A, "Purge Salvageable File List", 'file', has_length=0)
11010         pkt.Request(28, [
11011                 rec( 8, 1, NameSpace ),
11012                 rec( 9, 1, Reserved ),
11013                 rec( 10, 2, PurgeFlags ),
11014                 rec( 12, 4, VolumeNumberLong ),
11015                 rec( 16, 4, DirectoryBase ),
11016                 rec( 20, 4, PurgeCount, var="x" ),
11017                 rec( 24, 4, PurgeList, repeat="x" ),
11018         ])
11019         pkt.Reply(16, [
11020                 rec( 8, 4, PurgeCount, var="x" ),
11021                 rec( 12, 4, PurgeCcode, repeat="x" ),
11022         ])
11023         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
11024                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
11025                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
11026         # 2222/572B, 87/43
11027         pkt = NCP(0x572B, "Revoke File Handle Rights", 'file', has_length=0)
11028         pkt.Request(17, [
11029                 rec( 8, 3, Reserved3 ),
11030                 rec( 11, 1, RevQueryFlag ),
11031                 rec( 12, 4, FileHandle ),
11032                 rec( 16, 1, RemoveOpenRights ),
11033         ])
11034         pkt.Reply(13, [
11035                 rec( 8, 4, FileHandle ),
11036                 rec( 12, 1, OpenRights ),
11037         ])
11038         pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
11039                              0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
11040                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
11041         # 2222/572C, 87/44
11042         pkt = NCP(0x572C, "Update File Handle Rights", 'file', has_length=0)
11043         pkt.Request(24, [
11044                 rec( 8, 2, Reserved2 ),
11045                 rec( 10, 1, VolumeNumber ),
11046                 rec( 11, 1, NameSpace ),
11047                 rec( 12, 4, DirectoryNumber ),
11048                 rec( 16, 2, AccessRightsMaskWord ),
11049                 rec( 18, 2, NewAccessRights ),
11050                 rec( 20, 4, FileHandle, BE ),
11051         ])
11052         pkt.Reply(16, [
11053                 rec( 8, 4, FileHandle, BE ),
11054                 rec( 12, 4, EffectiveRights ),
11055         ])
11056         pkt.CompletionCodes([0x0000, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
11057                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11058                              0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
11059         # 2222/5801, 8801
11060         pkt = NCP(0x5801, "Query Volume Audit Status", "auditing", has_length=0)
11061         pkt.Request(12, [
11062                 rec( 8, 4, ConnectionNumber ),
11063         ])
11064         pkt.Reply(40, [
11065                 rec(8, 32, NWAuditStatus ),
11066         ])
11067         pkt.CompletionCodes([0x0000, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
11068                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11069                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
11070         # 2222/5802, 8802
11071         pkt = NCP(0x5802, "Add User Audit Property", "auditing", has_length=0)
11072         pkt.Request(25, [
11073                 rec(8, 4, AuditIDType ),
11074                 rec(12, 4, AuditID ),
11075                 rec(16, 4, AuditHandle ),
11076                 rec(20, 4, ObjectID ),
11077                 rec(24, 1, AuditFlag ),
11078         ])
11079         pkt.Reply(8)
11080         pkt.CompletionCodes([0x0000, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
11081                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11082                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
11083         # 2222/5803, 8803
11084         pkt = NCP(0x5803, "Add Auditor Access", "auditing", has_length=0)
11085         pkt.Request(8)
11086         pkt.Reply(8)
11087         pkt.CompletionCodes([0x0000, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
11088                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11089                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
11090         # 2222/5804, 8804
11091         pkt = NCP(0x5804, "Change Auditor Volume Password", "auditing", has_length=0)
11092         pkt.Request(8)
11093         pkt.Reply(8)
11094         pkt.CompletionCodes([0x0000, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
11095                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11096                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
11097         # 2222/5805, 8805
11098         pkt = NCP(0x5805, "Check Auditor Access", "auditing", has_length=0)
11099         pkt.Request(8)
11100         pkt.Reply(8)
11101         pkt.CompletionCodes([0x0000, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
11102                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11103                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
11104         # 2222/5806, 8806
11105         pkt = NCP(0x5806, "Delete User Audit Property", "auditing", has_length=0)
11106         pkt.Request(8)
11107         pkt.Reply(8)
11108         pkt.CompletionCodes([0x0000, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
11109                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11110                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
11111         # 2222/5807, 8807
11112         pkt = NCP(0x5807, "Disable Auditing On A Volume", "auditing", has_length=0)
11113         pkt.Request(8)
11114         pkt.Reply(8)
11115         pkt.CompletionCodes([0x0000, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
11116                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11117                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
11118         # 2222/5808, 8808
11119         pkt = NCP(0x5808, "Enable Auditing On A Volume", "auditing", has_length=0)
11120         pkt.Request(8)
11121         pkt.Reply(8)
11122         pkt.CompletionCodes([0x0000, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
11123                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11124                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
11125         # 2222/5809, 8809
11126         pkt = NCP(0x5809, "Query User Being Audited", "auditing", has_length=0)
11127         pkt.Request(8)
11128         pkt.Reply(8)
11129         pkt.CompletionCodes([0x0000, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
11130                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11131                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
11132         # 2222/580A, 88,10
11133         pkt = NCP(0x580A, "Read Audit Bit Map", "auditing", has_length=0)
11134         pkt.Request(8)
11135         pkt.Reply(8)
11136         pkt.CompletionCodes([0x0000, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
11137                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11138                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
11139         # 2222/580B, 88,11
11140         pkt = NCP(0x580B, "Read Audit File Configuration Header", "auditing", has_length=0)
11141         pkt.Request(8)
11142         pkt.Reply(8)
11143         pkt.CompletionCodes([0x0000, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
11144                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11145                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
11146         # 2222/580D, 88,13
11147         pkt = NCP(0x580D, "Remove Auditor Access", "auditing", has_length=0)
11148         pkt.Request(8)
11149         pkt.Reply(8)
11150         pkt.CompletionCodes([0x0000, 0x300, 0x8000, 0x8101, 0x8401, 0x8501,
11151                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11152                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
11153         # 2222/580E, 88,14
11154         pkt = NCP(0x580E, "Reset Audit File", "auditing", has_length=0)
11155         pkt.Request(8)
11156         pkt.Reply(8)
11157         pkt.CompletionCodes([0x0000, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
11158                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11159                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
11160         # 2222/5810, 88,16
11161         pkt = NCP(0x5810, "Write Audit Bit Map", "auditing", has_length=0)
11162         pkt.Request(8)
11163         pkt.Reply(8)
11164         pkt.CompletionCodes([0x0000, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
11165                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11166                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
11167         # 2222/5811, 88,17
11168         pkt = NCP(0x5811, "Write Audit File Configuration Header", "auditing", has_length=0)
11169         pkt.Request(8)
11170         pkt.Reply(8)
11171         pkt.CompletionCodes([0x0000, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
11172                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11173                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
11174         # 2222/5812, 88,18
11175         pkt = NCP(0x5812, "Change Auditor Volume Password2", "auditing", has_length=0)
11176         pkt.Request(8)
11177         pkt.Reply(8)
11178         pkt.CompletionCodes([0x0000, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
11179                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11180                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
11181         # 2222/5813, 88,19
11182         pkt = NCP(0x5813, "Return Audit Flags", "auditing", has_length=0)
11183         pkt.Request(8)
11184         pkt.Reply(8)
11185         pkt.CompletionCodes([0x0000, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
11186                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11187                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
11188         # 2222/5814, 88,20
11189         pkt = NCP(0x5814, "Close Old Audit File", "auditing", has_length=0)
11190         pkt.Request(8)
11191         pkt.Reply(8)
11192         pkt.CompletionCodes([0x0000, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
11193                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11194                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
11195         # 2222/5816, 88,22
11196         pkt = NCP(0x5816, "Check Level Two Access", "auditing", has_length=0)
11197         pkt.Request(8)
11198         pkt.Reply(8)
11199         pkt.CompletionCodes([0x0000, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
11200                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11201                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
11202         # 2222/5817, 88,23
11203         pkt = NCP(0x5817, "Return Old Audit File List", "auditing", has_length=0)
11204         pkt.Request(8)
11205         pkt.Reply(8)
11206         pkt.CompletionCodes([0x0000, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
11207                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11208                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
11209         # 2222/5818, 88,24
11210         pkt = NCP(0x5818, "Init Audit File Reads", "auditing", has_length=0)
11211         pkt.Request(8)
11212         pkt.Reply(8)
11213         pkt.CompletionCodes([0x0000, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
11214                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11215                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
11216         # 2222/5819, 88,25
11217         pkt = NCP(0x5819, "Read Auditing File", "auditing", has_length=0)
11218         pkt.Request(8)
11219         pkt.Reply(8)
11220         pkt.CompletionCodes([0x0000, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
11221                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11222                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
11223         # 2222/581A, 88,26
11224         pkt = NCP(0x581A, "Delete Old Audit File", "auditing", has_length=0)
11225         pkt.Request(8)
11226         pkt.Reply(8)
11227         pkt.CompletionCodes([0x0000, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
11228                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11229                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
11230         # 2222/581E, 88,30
11231         pkt = NCP(0x581E, "Restart Volume auditing", "auditing", has_length=0)
11232         pkt.Request(8)
11233         pkt.Reply(8)
11234         pkt.CompletionCodes([0x0000, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
11235                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11236                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
11237         # 2222/581F, 88,31
11238         pkt = NCP(0x581F, "Set Volume Password", "auditing", has_length=0)
11239         pkt.Request(8)
11240         pkt.Reply(8)
11241         pkt.CompletionCodes([0x0000, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
11242                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11243                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
11244         # 2222/5A01, 90/00
11245         pkt = NCP(0x5A01, "Parse Tree", 'file')
11246         pkt.Request(26, [
11247                 rec( 10, 4, InfoMask ),
11248                 rec( 14, 4, Reserved4 ),
11249                 rec( 18, 4, Reserved4 ),
11250                 rec( 22, 4, limbCount ),
11251         ])
11252         pkt.Reply(32, [
11253                 rec( 8, 4, limbCount ),
11254                 rec( 12, 4, ItemsCount ),
11255                 rec( 16, 4, nextLimbScanNum ),
11256                 rec( 20, 4, CompletionCode ),
11257                 rec( 24, 1, FolderFlag ),
11258                 rec( 25, 3, Reserved ),
11259                 rec( 28, 4, DirectoryBase ),
11260         ])
11261         pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
11262                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11263                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
11264         # 2222/5A0A, 90/10
11265         pkt = NCP(0x5A0A, "Get Reference Count from Dir Entry Number", 'file')
11266         pkt.Request(19, [
11267                 rec( 10, 4, VolumeNumberLong ),
11268                 rec( 14, 4, DirectoryBase ),
11269                 rec( 18, 1, NameSpace ),
11270         ])
11271         pkt.Reply(12, [
11272                 rec( 8, 4, ReferenceCount ),
11273         ])
11274         pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
11275                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11276                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
11277         # 2222/5A0B, 90/11
11278         pkt = NCP(0x5A0B, "Get Reference Count from Dir Handle", 'file')
11279         pkt.Request(14, [
11280                 rec( 10, 4, DirHandle ),
11281         ])
11282         pkt.Reply(12, [
11283                 rec( 8, 4, ReferenceCount ),
11284         ])
11285         pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
11286                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11287                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
11288         # 2222/5A0C, 90/12
11289         pkt = NCP(0x5A0C, "Set Compressed File Size", 'file')
11290         pkt.Request(20, [
11291                 rec( 10, 6, FileHandle ),
11292                 rec( 16, 4, SuggestedFileSize ),
11293         ])
11294         pkt.Reply(16, [
11295                 rec( 8, 4, OldFileSize ),
11296                 rec( 12, 4, NewFileSize ),
11297         ])
11298         pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
11299                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11300                              0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
11301         # 2222/5A80, 90/128
11302         pkt = NCP(0x5A80, "Move File Data To DM", 'file')
11303         pkt.Request(27, [
11304                 rec( 10, 4, VolumeNumberLong ),
11305                 rec( 14, 4, DirectoryEntryNumber ),
11306                 rec( 18, 1, NameSpace ),
11307                 rec( 19, 3, Reserved ),
11308                 rec( 22, 4, SupportModuleID ),
11309                 rec( 26, 1, DMFlags ),
11310         ])
11311         pkt.Reply(8)
11312         pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
11313                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11314                              0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
11315         # 2222/5A81, 90/129
11316         pkt = NCP(0x5A81, "DM File Information", 'file')
11317         pkt.Request(19, [
11318                 rec( 10, 4, VolumeNumberLong ),
11319                 rec( 14, 4, DirectoryEntryNumber ),
11320                 rec( 18, 1, NameSpace ),
11321         ])
11322         pkt.Reply(24, [
11323                 rec( 8, 4, SupportModuleID ),
11324                 rec( 12, 4, RestoreTime ),
11325                 rec( 16, 4, DMInfoEntries, var="x" ),
11326                 rec( 20, 4, DataSize, repeat="x" ),
11327         ])
11328         pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
11329                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11330                              0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
11331         # 2222/5A82, 90/130
11332         pkt = NCP(0x5A82, "Volume DM Status", 'file')
11333         pkt.Request(18, [
11334                 rec( 10, 4, VolumeNumberLong ),
11335                 rec( 14, 4, SupportModuleID ),
11336         ])
11337         pkt.Reply(32, [
11338                 rec( 8, 4, NumOfFilesMigrated ),
11339                 rec( 12, 4, TtlMigratedSize ),
11340                 rec( 16, 4, SpaceUsed ),
11341                 rec( 20, 4, LimboUsed ),
11342                 rec( 24, 4, SpaceMigrated ),
11343                 rec( 28, 4, FileLimbo ),
11344         ])
11345         pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
11346                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11347                              0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
11348         # 2222/5A83, 90/131
11349         pkt = NCP(0x5A83, "Migrator Status Info", 'file')
11350         pkt.Request(10)
11351         pkt.Reply(20, [
11352                 rec( 8, 1, DMPresentFlag ),
11353                 rec( 9, 3, Reserved3 ),
11354                 rec( 12, 4, DMmajorVersion ),
11355                 rec( 16, 4, DMminorVersion ),
11356         ])
11357         pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
11358                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11359                              0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
11360         # 2222/5A84, 90/132
11361         pkt = NCP(0x5A84, "DM Support Module Information", 'file')
11362         pkt.Request(18, [
11363                 rec( 10, 1, DMInfoLevel ),
11364                 rec( 11, 3, Reserved3),
11365                 rec( 14, 4, SupportModuleID ),
11366         ])
11367         pkt.Reply(NO_LENGTH_CHECK, [
11368                 srec( DMInfoLevel0, req_cond="ncp.dm_info_level == 0x00" ),
11369                 srec( DMInfoLevel1, req_cond="ncp.dm_info_level == 0x01" ),
11370                 srec( DMInfoLevel2, req_cond="ncp.dm_info_level == 0x02" ),
11371         ])
11372         pkt.ReqCondSizeVariable()
11373         pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
11374                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11375                              0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
11376         # 2222/5A85, 90/133
11377         pkt = NCP(0x5A85, "Move File Data From DM", 'file')
11378         pkt.Request(19, [
11379                 rec( 10, 4, VolumeNumberLong ),
11380                 rec( 14, 4, DirectoryEntryNumber ),
11381                 rec( 18, 1, NameSpace ),
11382         ])
11383         pkt.Reply(8)
11384         pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
11385                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11386                              0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
11387         # 2222/5A86, 90/134
11388         pkt = NCP(0x5A86, "Get/Set Default Read-Write Support Module ID", 'file')
11389         pkt.Request(18, [
11390                 rec( 10, 1, GetSetFlag ),
11391                 rec( 11, 3, Reserved3 ),
11392                 rec( 14, 4, SupportModuleID ),
11393         ])
11394         pkt.Reply(12, [
11395                 rec( 8, 4, SupportModuleID ),
11396         ])
11397         pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
11398                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11399                              0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
11400         # 2222/5A87, 90/135
11401         pkt = NCP(0x5A87, "DM Support Module Capacity Request", 'file')
11402         pkt.Request(22, [
11403                 rec( 10, 4, SupportModuleID ),
11404                 rec( 14, 4, VolumeNumberLong ),
11405                 rec( 18, 4, DirectoryBase ),
11406         ])
11407         pkt.Reply(20, [
11408                 rec( 8, 4, BlockSizeInSectors ),
11409                 rec( 12, 4, TotalBlocks ),
11410                 rec( 16, 4, UsedBlocks ),
11411         ])
11412         pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
11413                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11414                              0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
11415         # 2222/5A88, 90/136
11416         pkt = NCP(0x5A88, "RTDM Request", 'file')
11417         pkt.Request(15, [
11418                 rec( 10, 4, Verb ),
11419                 rec( 14, 1, VerbData ),
11420         ])
11421         pkt.Reply(8)
11422         pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
11423                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11424                              0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
11425         # 2222/5C, 92
11426         pkt = NCP(0x5C, "SecretStore Services", 'file')
11427         #Need info on this packet structure and SecretStore Verbs
11428         pkt.Request(7)
11429         pkt.Reply(8)
11430         pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
11431                              0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
11432                              0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
11433         # 2222/61, 97
11434         pkt = NCP(0x61, "Get Big Packet NCP Max Packet Size", 'comm')
11435         pkt.Request(10, [
11436                 rec( 7, 2, ProposedMaxSize, BE ),
11437                 rec( 9, 1, SecurityFlag ),
11438         ])
11439         pkt.Reply(13, [
11440                 rec( 8, 2, AcceptedMaxSize, BE ),
11441                 rec( 10, 2, EchoSocket, BE ),
11442                 rec( 12, 1, SecurityFlag ),
11443         ])
11444         pkt.CompletionCodes([0x0000])
11445         # 2222/63, 99
11446         pkt = NCP(0x63, "Undocumented Packet Burst", 'comm')
11447         pkt.Request(7)
11448         pkt.Reply(8)
11449         pkt.CompletionCodes([0x0000])
11450         # 2222/64, 100
11451         pkt = NCP(0x64, "Undocumented Packet Burst", 'comm')
11452         pkt.Request(7)
11453         pkt.Reply(8)
11454         pkt.CompletionCodes([0x0000])
11455         # 2222/65, 101
11456         pkt = NCP(0x65, "Packet Burst Connection Request", 'comm')
11457         pkt.Request(25, [
11458                 rec( 7, 4, LocalConnectionID ),
11459                 rec( 11, 4, LocalMaxPacketSize ),
11460                 rec( 15, 2, LocalTargetSocket ),
11461                 rec( 17, 4, LocalMaxSendSize ),
11462                 rec( 21, 4, LocalMaxRecvSize ),
11463         ])
11464         pkt.Reply(16, [
11465                 rec( 8, 4, RemoteTargetID ),
11466                 rec( 12, 4, RemoteMaxPacketSize ),
11467         ])
11468         pkt.CompletionCodes([0x0000])
11469         # 2222/66, 102
11470         pkt = NCP(0x66, "Undocumented Packet Burst", 'comm')
11471         pkt.Request(7)
11472         pkt.Reply(8)
11473         pkt.CompletionCodes([0x0000])
11474         # 2222/67, 103
11475         pkt = NCP(0x67, "Undocumented Packet Burst", 'comm')
11476         pkt.Request(7)
11477         pkt.Reply(8)
11478         pkt.CompletionCodes([0x0000])
11479         # 2222/6801, 104/01
11480         pkt = NCP(0x6801, "Ping for NDS NCP", "nds", has_length=0)
11481         pkt.Request(8)
11482         pkt.Reply( 10, [
11483                 rec( 8, 2, PingVersion ),
11484         ])
11485         pkt.CompletionCodes([0x0000, 0x8100, 0xfb04, 0xfe0c])
11486         # 2222/6802, 104/02
11487         #
11488         # XXX - if FraggerHandle is not 0xffffffff, this is not the
11489         # first fragment, so we can only dissect this by reassembling;
11490         # the fields after "Fragment Handle" are bogus for non-0xffffffff
11491         # fragments, so we shouldn't dissect them.
11492         #
11493         # XXX - are there TotalRequest requests in the packet, and
11494         # does each of them have NDSFlags and NDSVerb fields, or
11495         # does only the first one have it?
11496         #
11497         pkt = NCP(0x6802, "Send NDS Fragmented Request/Reply", "nds", has_length=0)
11498         pkt.Request(26, [
11499                 rec( 8, 4, FraggerHandle ),
11500                 rec( 12, 4, FragSize ),
11501                 rec( 16, 4, TotalRequest ),
11502                 rec( 20, 4, NDSFlags ),
11503                 rec( 24, 2, NDSVerb, LE ),
11504 #                rec( 26, 2, Reserved2),
11505 #                srec(NDS8Struct, req_cond="ncp.nds_verb==0x00fe"),
11506 #                srec(NDS7Struct, req_cond="ncp.nds_verb!=0x00fe"),
11507         ])
11508         pkt.Reply(8)
11509         pkt.ReqCondSizeVariable()
11510         pkt.CompletionCodes([0x0000])
11511         # 2222/6803, 104/03
11512         pkt = NCP(0x6803, "Fragment Close", "nds", has_length=0)
11513         pkt.Request(12, [
11514                 rec( 8, 4, FraggerHandle ),
11515         ])
11516         pkt.Reply(8)
11517         pkt.CompletionCodes([0x0000, 0xff00])
11518         # 2222/6804, 104/04
11519         pkt = NCP(0x6804, "Return Bindery Context", "nds", has_length=0)
11520         pkt.Request(8)
11521         pkt.Reply((9, 263), [
11522                 rec( 8, (1,255), binderyContext ),
11523         ])
11524         pkt.CompletionCodes([0x0000, 0xfe0c, 0xff00])
11525         # 2222/6805, 104/05
11526         pkt = NCP(0x6805, "Monitor NDS Connection", "nds", has_length=0)
11527         pkt.Request(8)
11528         pkt.Reply(8)
11529         pkt.CompletionCodes([0x0000, 0xfb00, 0xfe0c, 0xff00])
11530         # 2222/6806, 104/06
11531         pkt = NCP(0x6806, "Return NDS Statistics", "nds", has_length=0)
11532         pkt.Request(10, [
11533                 rec( 8, 2, NDSRequestFlags ),
11534         ])
11535         pkt.Reply(8)
11536         #Need to investigate how to decode Statistics Return Value
11537         pkt.CompletionCodes([0x0000, 0xfb00, 0xfe0c, 0xff00])
11538         # 2222/6807, 104/07
11539         pkt = NCP(0x6807, "Clear NDS Statistics", "nds", has_length=0)
11540         pkt.Request(8)
11541         pkt.Reply(8)
11542         pkt.CompletionCodes([0x0000, 0xfb00, 0xfe0c, 0xff00])
11543         # 2222/6808, 104/08
11544         pkt = NCP(0x6808, "Reload NDS Software", "nds", has_length=0)
11545         pkt.Request(8)
11546         pkt.Reply(12, [
11547                 rec( 8, 4, NDSStatus ),
11548         ])
11549         pkt.CompletionCodes([0x0000, 0xfb00, 0xfe0c, 0xff00])
11550         # 2222/68C8, 104/200
11551         pkt = NCP(0x68C8, "Query Container Audit Status", "auditing", has_length=0)
11552         pkt.Request(12, [
11553                 rec( 8, 4, ConnectionNumber ),
11554 #               rec( 12, 4, AuditIDType, LE ),
11555 #               rec( 16, 4, AuditID ),
11556 #               rec( 20, 2, BufferSize ),
11557         ])
11558         pkt.Reply(40, [
11559                 rec(8, 32, NWAuditStatus ),
11560         ])
11561         pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
11562         # 2222/68CA, 104/202
11563         pkt = NCP(0x68CA, "Add Auditor Access", "auditing", has_length=0)
11564         pkt.Request(8)
11565         pkt.Reply(8)
11566         pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
11567         # 2222/68CB, 104/203
11568         pkt = NCP(0x68CB, "Change Auditor Container Password", "auditing", has_length=0)
11569         pkt.Request(8)
11570         pkt.Reply(8)
11571         pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
11572         # 2222/68CC, 104/204
11573         pkt = NCP(0x68CC, "Check Auditor Access", "auditing", has_length=0)
11574         pkt.Request(8)
11575         pkt.Reply(8)
11576         pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
11577         # 2222/68CE, 104/206
11578         pkt = NCP(0x680CE, "Disable Container Auditing", "auditing", has_length=0)
11579         pkt.Request(8)
11580         pkt.Reply(8)
11581         pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
11582         # 2222/68CF, 104/207
11583         pkt = NCP(0x68CF, "Enable Container Auditing", "auditing", has_length=0)
11584         pkt.Request(8)
11585         pkt.Reply(8)
11586         pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
11587         # 2222/68D1, 104/209
11588         pkt = NCP(0x68D1, "Read Audit File Header", "auditing", has_length=0)
11589         pkt.Request(8)
11590         pkt.Reply(8)
11591         pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
11592         # 2222/68D3, 104/211
11593         pkt = NCP(0x68D3, "Remove Auditor Access", "auditing", has_length=0)
11594         pkt.Request(8)
11595         pkt.Reply(8)
11596         pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
11597         # 2222/68D4, 104/212
11598         pkt = NCP(0x68D4, "Reset Audit File", "auditing", has_length=0)
11599         pkt.Request(8)
11600         pkt.Reply(8)
11601         pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
11602         # 2222/68D6, 104/214
11603         pkt = NCP(0x68D6, "Write Audit File Configuration Header", "auditing", has_length=0)
11604         pkt.Request(8)
11605         pkt.Reply(8)
11606         pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
11607         # 2222/68D7, 104/215
11608         pkt = NCP(0x68D7, "Change Auditor Container Password2", "auditing", has_length=0)
11609         pkt.Request(8)
11610         pkt.Reply(8)
11611         pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
11612         # 2222/68D8, 104/216
11613         pkt = NCP(0x68D8, "Return Audit Flags", "auditing", has_length=0)
11614         pkt.Request(8)
11615         pkt.Reply(8)
11616         pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
11617         # 2222/68D9, 104/217
11618         pkt = NCP(0x68D9, "Close Old Audit File", "auditing", has_length=0)
11619         pkt.Request(8)
11620         pkt.Reply(8)
11621         pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
11622         # 2222/68DB, 104/219
11623         pkt = NCP(0x68DB, "Check Level Two Access", "auditing", has_length=0)
11624         pkt.Request(8)
11625         pkt.Reply(8)
11626         pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
11627         # 2222/68DC, 104/220
11628         pkt = NCP(0x68DC, "Check Object Audited", "auditing", has_length=0)
11629         pkt.Request(8)
11630         pkt.Reply(8)
11631         pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
11632         # 2222/68DD, 104/221
11633         pkt = NCP(0x68DD, "Change Object Audited", "auditing", has_length=0)
11634         pkt.Request(8)
11635         pkt.Reply(8)
11636         pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
11637         # 2222/68DE, 104/222
11638         pkt = NCP(0x68DE, "Return Old Audit File List", "auditing", has_length=0)
11639         pkt.Request(8)
11640         pkt.Reply(8)
11641         pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
11642         # 2222/68DF, 104/223
11643         pkt = NCP(0x68DF, "Init Audit File Reads", "auditing", has_length=0)
11644         pkt.Request(8)
11645         pkt.Reply(8)
11646         pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
11647         # 2222/68E0, 104/224
11648         pkt = NCP(0x68E0, "Read Auditing File", "auditing", has_length=0)
11649         pkt.Request(8)
11650         pkt.Reply(8)
11651         pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
11652         # 2222/68E1, 104/225
11653         pkt = NCP(0x68E1, "Delete Old Audit File", "auditing", has_length=0)
11654         pkt.Request(8)
11655         pkt.Reply(8)
11656         pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
11657         # 2222/68E5, 104/229
11658         pkt = NCP(0x68E5, "Set Audit Password", "auditing", has_length=0)
11659         pkt.Request(8)
11660         pkt.Reply(8)
11661         pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
11662         # 2222/68E7, 104/231
11663         pkt = NCP(0x68E7, "External Audit Append To File", "auditing", has_length=0)
11664         pkt.Request(8)
11665         pkt.Reply(8)
11666         pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
11667         # 2222/69, 105
11668         pkt = NCP(0x69, "Log File", 'file')
11669         pkt.Request( (12, 267), [
11670                 rec( 7, 1, DirHandle ),
11671                 rec( 8, 1, LockFlag ),
11672                 rec( 9, 2, TimeoutLimit ),
11673                 rec( 11, (1, 256), FilePath ),
11674         ], info_str=(FilePath, "Log File: %s", "/%s"))
11675         pkt.Reply(8)
11676         pkt.CompletionCodes([0x0000, 0x7f00, 0x8200, 0x9600, 0xfe0d, 0xff01])
11677         # 2222/6A, 106
11678         pkt = NCP(0x6A, "Lock File Set", 'file')
11679         pkt.Request( 9, [
11680                 rec( 7, 2, TimeoutLimit ),
11681         ])
11682         pkt.Reply(8)
11683         pkt.CompletionCodes([0x0000, 0x7f00, 0x8200, 0x9600, 0xfe0d, 0xff01])
11684         # 2222/6B, 107
11685         pkt = NCP(0x6B, "Log Logical Record", 'file')
11686         pkt.Request( (11, 266), [
11687                 rec( 7, 1, LockFlag ),
11688                 rec( 8, 2, TimeoutLimit ),
11689                 rec( 10, (1, 256), SynchName ),
11690         ], info_str=(SynchName, "Log Logical Record: %s", ", %s"))
11691         pkt.Reply(8)
11692         pkt.CompletionCodes([0x0000, 0x7f00, 0x9600, 0xfe0d, 0xff01])
11693         # 2222/6C, 108
11694         pkt = NCP(0x6C, "Log Logical Record", 'file')
11695         pkt.Request( 10, [
11696                 rec( 7, 1, LockFlag ),
11697                 rec( 8, 2, TimeoutLimit ),
11698         ])
11699         pkt.Reply(8)
11700         pkt.CompletionCodes([0x0000, 0x7f00, 0x9600, 0xfe0d, 0xff01])
11701         # 2222/6D, 109
11702         pkt = NCP(0x6D, "Log Physical Record", 'file')
11703         pkt.Request(24, [
11704                 rec( 7, 1, LockFlag ),
11705                 rec( 8, 6, FileHandle ),
11706                 rec( 14, 4, LockAreasStartOffset ),
11707                 rec( 18, 4, LockAreaLen ),
11708                 rec( 22, 2, LockTimeout ),
11709         ])
11710         pkt.Reply(8)
11711         pkt.CompletionCodes([0x0000, 0x7f00, 0x8200, 0x8800, 0x9600, 0xfd02, 0xfe04, 0xff01])
11712         # 2222/6E, 110
11713         pkt = NCP(0x6E, "Lock Physical Record Set", 'file')
11714         pkt.Request(10, [
11715                 rec( 7, 1, LockFlag ),
11716                 rec( 8, 2, LockTimeout ),
11717         ])
11718         pkt.Reply(8)
11719         pkt.CompletionCodes([0x0000, 0x7f00, 0x8200, 0x8800, 0x9600, 0xfd02, 0xfe04, 0xff01])
11720         # 2222/6F00, 111/00
11721         pkt = NCP(0x6F00, "Open/Create a Semaphore", 'file', has_length=0)
11722         pkt.Request((10,521), [
11723                 rec( 8, 1, InitialSemaphoreValue ),
11724                 rec( 9, (1, 512), SemaphoreName ),
11725         ], info_str=(SemaphoreName, "Open/Create Semaphore: %s", ", %s"))
11726         pkt.Reply(13, [
11727                   rec( 8, 4, SemaphoreHandle ),
11728                   rec( 12, 1, SemaphoreOpenCount ),
11729         ])
11730         pkt.CompletionCodes([0x0000, 0x9600, 0xff01])
11731         # 2222/6F01, 111/01
11732         pkt = NCP(0x6F01, "Examine Semaphore", 'file', has_length=0)
11733         pkt.Request(12, [
11734                 rec( 8, 4, SemaphoreHandle ),
11735         ])
11736         pkt.Reply(10, [
11737                   rec( 8, 1, SemaphoreValue ),
11738                   rec( 9, 1, SemaphoreOpenCount ),
11739         ])
11740         pkt.CompletionCodes([0x0000, 0x9600, 0xff01])
11741         # 2222/6F02, 111/02
11742         pkt = NCP(0x6F02, "Wait On (P) Semaphore", 'file', has_length=0)
11743         pkt.Request(14, [
11744                 rec( 8, 4, SemaphoreHandle ),
11745                 rec( 12, 2, LockTimeout ),
11746         ])
11747         pkt.Reply(8)
11748         pkt.CompletionCodes([0x0000, 0x9600, 0xfe04, 0xff01])
11749         # 2222/6F03, 111/03
11750         pkt = NCP(0x6F03, "Signal (V) Semaphore", 'file', has_length=0)
11751         pkt.Request(12, [
11752                 rec( 8, 4, SemaphoreHandle ),
11753         ])
11754         pkt.Reply(8)
11755         pkt.CompletionCodes([0x0000, 0x9600, 0xfe04, 0xff01])
11756         # 2222/6F04, 111/04
11757         pkt = NCP(0x6F04, "Close Semaphore", 'file', has_length=0)
11758         pkt.Request(12, [
11759                 rec( 8, 4, SemaphoreHandle ),
11760         ])
11761         pkt.Reply(10, [
11762                 rec( 8, 1, SemaphoreOpenCount ),
11763                 rec( 9, 1, SemaphoreShareCount ),
11764         ])
11765         pkt.CompletionCodes([0x0000, 0x9600, 0xfe04, 0xff01])
11766         # 2222/7201, 114/01
11767         pkt = NCP(0x7201, "Timesync Get Time", 'file')
11768         pkt.Request(10)
11769         pkt.Reply(32,[
11770                 rec( 8, 12, theTimeStruct ),
11771                 rec(20, 8, eventOffset ),
11772                 rec(28, 4, eventTime ),
11773         ])                
11774         pkt.CompletionCodes([0x0000, 0x7e00, 0xfb06, 0xff00])
11775         # 2222/7202, 114/02
11776         pkt = NCP(0x7202, "Timesync Exchange Time", 'file')
11777         pkt.Request((63,112), [
11778                 rec( 10, 4, protocolFlags ),
11779                 rec( 14, 4, nodeFlags ),
11780                 rec( 18, 8, sourceOriginateTime ),
11781                 rec( 26, 8, targetReceiveTime ),
11782                 rec( 34, 8, targetTransmitTime ),
11783                 rec( 42, 8, sourceReturnTime ),
11784                 rec( 50, 8, eventOffset ),
11785                 rec( 58, 4, eventTime ),
11786                 rec( 62, (1,50), ServerNameLen ),
11787         ], info_str=(ServerNameLen, "Timesync Exchange Time: %s", ", %s"))
11788         pkt.Reply((64,113), [
11789                 rec( 8, 3, Reserved3 ),
11790                 rec( 11, 4, protocolFlags ),
11791                 rec( 15, 4, nodeFlags ),
11792                 rec( 19, 8, sourceOriginateTime ),
11793                 rec( 27, 8, targetReceiveTime ),
11794                 rec( 35, 8, targetTransmitTime ),
11795                 rec( 43, 8, sourceReturnTime ),
11796                 rec( 51, 8, eventOffset ),
11797                 rec( 59, 4, eventTime ),
11798                 rec( 63, (1,50), ServerNameLen ),
11799         ])
11800         pkt.CompletionCodes([0x0000, 0x7e00, 0xfb06, 0xff00])
11801         # 2222/7205, 114/05
11802         pkt = NCP(0x7205, "Timesync Get Server List", 'file')
11803         pkt.Request(14, [
11804                 rec( 10, 4, StartNumber ),
11805         ])
11806         pkt.Reply(66, [
11807                 rec( 8, 4, nameType ),
11808                 rec( 12, 48, ServerName ),
11809                 rec( 60, 4, serverListFlags ),
11810                 rec( 64, 2, startNumberFlag ),
11811         ])
11812         pkt.CompletionCodes([0x0000, 0x7e00, 0xfb06, 0xff00])
11813         # 2222/7206, 114/06
11814         pkt = NCP(0x7206, "Timesync Set Server List", 'file')
11815         pkt.Request(14, [
11816                 rec( 10, 4, StartNumber ),
11817         ])
11818         pkt.Reply(66, [
11819                 rec( 8, 4, nameType ),
11820                 rec( 12, 48, ServerName ),
11821                 rec( 60, 4, serverListFlags ),
11822                 rec( 64, 2, startNumberFlag ),
11823         ])
11824         pkt.CompletionCodes([0x0000, 0x7e00, 0xfb06, 0xff00])
11825         # 2222/720C, 114/12
11826         pkt = NCP(0x720C, "Timesync Get Version", 'file')
11827         pkt.Request(10)
11828         pkt.Reply(12, [
11829                 rec( 8, 4, version ),
11830         ])
11831         pkt.CompletionCodes([0x0000, 0x7e00, 0xfb06, 0xff00])
11832         # 2222/7B01, 123/01
11833         pkt = NCP(0x7B01, "Get Cache Information", 'stats')
11834         pkt.Request(12, [
11835                 rec(10, 1, VersionNumber),
11836                 rec(11, 1, RevisionNumber),
11837         ])
11838         pkt.Reply(288, [
11839                 rec(8, 4, CurrentServerTime, LE),
11840                 rec(12, 1, VConsoleVersion ),
11841                 rec(13, 1, VConsoleRevision ),
11842                 rec(14, 2, Reserved2 ),
11843                 rec(16, 104, Counters ),
11844                 rec(120, 40, ExtraCacheCntrs ),
11845                 rec(160, 40, MemoryCounters ),
11846                 rec(200, 48, TrendCounters ),
11847                 rec(248, 40, CacheInfo ),
11848         ])
11849         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xff00])
11850         # 2222/7B02, 123/02
11851         pkt = NCP(0x7B02, "Get File Server Information", 'stats')
11852         pkt.Request(10)
11853         pkt.Reply(150, [
11854                 rec(8, 4, CurrentServerTime ),
11855                 rec(12, 1, VConsoleVersion ),
11856                 rec(13, 1, VConsoleRevision ),
11857                 rec(14, 2, Reserved2 ),
11858                 rec(16, 4, NCPStaInUseCnt ),
11859                 rec(20, 4, NCPPeakStaInUse ),
11860                 rec(24, 4, NumOfNCPReqs ),
11861                 rec(28, 4, ServerUtilization ),
11862                 rec(32, 96, ServerInfo ),
11863                 rec(128, 22, FileServerCounters ),
11864         ])
11865         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
11866         # 2222/7B03, 123/03
11867         pkt = NCP(0x7B03, "NetWare File Systems Information", 'stats')
11868         pkt.Request(11, [
11869                 rec(10, 1, FileSystemID ),
11870         ])
11871         pkt.Reply(68, [
11872                 rec(8, 4, CurrentServerTime ),
11873                 rec(12, 1, VConsoleVersion ),
11874                 rec(13, 1, VConsoleRevision ),
11875                 rec(14, 2, Reserved2 ),
11876                 rec(16, 52, FileSystemInfo ),
11877         ])
11878         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
11879         # 2222/7B04, 123/04
11880         pkt = NCP(0x7B04, "User Information", 'stats')
11881         pkt.Request(14, [
11882                 rec(10, 4, ConnectionNumber ),
11883         ])
11884         pkt.Reply((85, 132), [
11885                 rec(8, 4, CurrentServerTime ),
11886                 rec(12, 1, VConsoleVersion ),
11887                 rec(13, 1, VConsoleRevision ),
11888                 rec(14, 2, Reserved2 ),
11889                 rec(16, 68, UserInformation ),
11890                 rec(84, (1, 48), UserName ),
11891         ])
11892         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
11893         # 2222/7B05, 123/05
11894         pkt = NCP(0x7B05, "Packet Burst Information", 'stats')
11895         pkt.Request(10)
11896         pkt.Reply(216, [
11897                 rec(8, 4, CurrentServerTime ),
11898                 rec(12, 1, VConsoleVersion ),
11899                 rec(13, 1, VConsoleRevision ),
11900                 rec(14, 2, Reserved2 ),
11901                 rec(16, 200, PacketBurstInformation ),
11902         ])
11903         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
11904         # 2222/7B06, 123/06
11905         pkt = NCP(0x7B06, "IPX SPX Information", 'stats')
11906         pkt.Request(10)
11907         pkt.Reply(94, [
11908                 rec(8, 4, CurrentServerTime ),
11909                 rec(12, 1, VConsoleVersion ),
11910                 rec(13, 1, VConsoleRevision ),
11911                 rec(14, 2, Reserved2 ),
11912                 rec(16, 34, IPXInformation ),
11913                 rec(50, 44, SPXInformation ),
11914         ])
11915         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
11916         # 2222/7B07, 123/07
11917         pkt = NCP(0x7B07, "Garbage Collection Information", 'stats')
11918         pkt.Request(10)
11919         pkt.Reply(40, [
11920                 rec(8, 4, CurrentServerTime ),
11921                 rec(12, 1, VConsoleVersion ),
11922                 rec(13, 1, VConsoleRevision ),
11923                 rec(14, 2, Reserved2 ),
11924                 rec(16, 4, FailedAllocReqCnt ),
11925                 rec(20, 4, NumberOfAllocs ),
11926                 rec(24, 4, NoMoreMemAvlCnt ),
11927                 rec(28, 4, NumOfGarbageColl ),
11928                 rec(32, 4, FoundSomeMem ),
11929                 rec(36, 4, NumOfChecks ),
11930         ])
11931         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
11932         # 2222/7B08, 123/08
11933         pkt = NCP(0x7B08, "CPU Information", 'stats')
11934         pkt.Request(14, [
11935                 rec(10, 4, CPUNumber ),
11936         ])
11937         pkt.Reply(51, [
11938                 rec(8, 4, CurrentServerTime ),
11939                 rec(12, 1, VConsoleVersion ),
11940                 rec(13, 1, VConsoleRevision ),
11941                 rec(14, 2, Reserved2 ),
11942                 rec(16, 4, NumberOfCPUs ),
11943                 rec(20, 31, CPUInformation ),
11944         ])      
11945         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
11946         # 2222/7B09, 123/09
11947         pkt = NCP(0x7B09, "Volume Switch Information", 'stats')
11948         pkt.Request(14, [
11949                 rec(10, 4, StartNumber )
11950         ])
11951         pkt.Reply(28, [
11952                 rec(8, 4, CurrentServerTime ),
11953                 rec(12, 1, VConsoleVersion ),
11954                 rec(13, 1, VConsoleRevision ),
11955                 rec(14, 2, Reserved2 ),
11956                 rec(16, 4, TotalLFSCounters ),
11957                 rec(20, 4, CurrentLFSCounters, var="x"),
11958                 rec(24, 4, LFSCounters, repeat="x"),
11959         ])
11960         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
11961         # 2222/7B0A, 123/10
11962         pkt = NCP(0x7B0A, "Get NLM Loaded List", 'stats')
11963         pkt.Request(14, [
11964                 rec(10, 4, StartNumber )
11965         ])
11966         pkt.Reply(28, [
11967                 rec(8, 4, CurrentServerTime ),
11968                 rec(12, 1, VConsoleVersion ),
11969                 rec(13, 1, VConsoleRevision ),
11970                 rec(14, 2, Reserved2 ),
11971                 rec(16, 4, NLMcount ),
11972                 rec(20, 4, NLMsInList, var="x" ),
11973                 rec(24, 4, NLMNumbers, repeat="x" ),
11974         ])
11975         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
11976         # 2222/7B0B, 123/11
11977         pkt = NCP(0x7B0B, "NLM Information", 'stats')
11978         pkt.Request(14, [
11979                 rec(10, 4, NLMNumber ),
11980         ])
11981         pkt.Reply((79,841), [
11982                 rec(8, 4, CurrentServerTime ),
11983                 rec(12, 1, VConsoleVersion ),
11984                 rec(13, 1, VConsoleRevision ),
11985                 rec(14, 2, Reserved2 ),
11986                 rec(16, 60, NLMInformation ),
11987                 rec(76, (1,255), FileName ),
11988                 rec(-1, (1,255), Name ),
11989                 rec(-1, (1,255), Copyright ),
11990         ])
11991         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
11992         # 2222/7B0C, 123/12
11993         pkt = NCP(0x7B0C, "Get Directory Cache Information", 'stats')
11994         pkt.Request(10)
11995         pkt.Reply(72, [
11996                 rec(8, 4, CurrentServerTime ),
11997                 rec(12, 1, VConsoleVersion ),
11998                 rec(13, 1, VConsoleRevision ),
11999                 rec(14, 2, Reserved2 ),
12000                 rec(16, 56, DirCacheInfo ),
12001         ])
12002         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
12003         # 2222/7B0D, 123/13
12004         pkt = NCP(0x7B0D, "Get Operating System Version Information", 'stats')
12005         pkt.Request(10)
12006         pkt.Reply(70, [
12007                 rec(8, 4, CurrentServerTime ),
12008                 rec(12, 1, VConsoleVersion ),
12009                 rec(13, 1, VConsoleRevision ),
12010                 rec(14, 2, Reserved2 ),
12011                 rec(16, 1, OSMajorVersion ),
12012                 rec(17, 1, OSMinorVersion ),
12013                 rec(18, 1, OSRevision ),
12014                 rec(19, 1, AccountVersion ),
12015                 rec(20, 1, VAPVersion ),
12016                 rec(21, 1, QueueingVersion ),
12017                 rec(22, 1, SecurityRestrictionVersion ),
12018                 rec(23, 1, InternetBridgeVersion ),
12019                 rec(24, 4, MaxNumOfVol ),
12020                 rec(28, 4, MaxNumOfConn ),
12021                 rec(32, 4, MaxNumOfUsers ),
12022                 rec(36, 4, MaxNumOfNmeSps ),
12023                 rec(40, 4, MaxNumOfLANS ),
12024                 rec(44, 4, MaxNumOfMedias ),
12025                 rec(48, 4, MaxNumOfStacks ),
12026                 rec(52, 4, MaxDirDepth ),
12027                 rec(56, 4, MaxDataStreams ),
12028                 rec(60, 4, MaxNumOfSpoolPr ),
12029                 rec(64, 4, ServerSerialNumber ),
12030                 rec(68, 2, ServerAppNumber ),
12031         ])
12032         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
12033         # 2222/7B0E, 123/14
12034         pkt = NCP(0x7B0E, "Get Active Connection List by Type", 'stats')
12035         pkt.Request(15, [
12036                 rec(10, 4, StartConnNumber ),
12037                 rec(14, 1, ConnectionType ),
12038         ])
12039         pkt.Reply(528, [
12040                 rec(8, 4, CurrentServerTime ),
12041                 rec(12, 1, VConsoleVersion ),
12042                 rec(13, 1, VConsoleRevision ),
12043                 rec(14, 2, Reserved2 ),
12044                 rec(16, 512, ActiveConnBitList ),
12045         ])
12046         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfd01, 0xff00])
12047         # 2222/7B0F, 123/15
12048         pkt = NCP(0x7B0F, "Get NLM Resource Tag List", 'stats')
12049         pkt.Request(18, [
12050                 rec(10, 4, NLMNumber ),
12051                 rec(14, 4, NLMStartNumber ),
12052         ])
12053         pkt.Reply(37, [
12054                 rec(8, 4, CurrentServerTime ),
12055                 rec(12, 1, VConsoleVersion ),
12056                 rec(13, 1, VConsoleRevision ),
12057                 rec(14, 2, Reserved2 ),
12058                 rec(16, 4, TtlNumOfRTags ),
12059                 rec(20, 4, CurNumOfRTags ),
12060                 rec(24, 13, RTagStructure ),
12061         ])
12062         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
12063         # 2222/7B10, 123/16
12064         pkt = NCP(0x7B10, "Enumerate Connection Information from Connection List", 'stats')
12065         pkt.Request(22, [
12066                 rec(10, 1, EnumInfoMask),
12067                 rec(11, 3, Reserved3),
12068                 rec(14, 4, itemsInList, var="x"),
12069                 rec(18, 4, connList, repeat="x"),
12070         ])
12071         pkt.Reply(NO_LENGTH_CHECK, [
12072                 rec(8, 4, CurrentServerTime ),
12073                 rec(12, 1, VConsoleVersion ),
12074                 rec(13, 1, VConsoleRevision ),
12075                 rec(14, 2, Reserved2 ),
12076                 rec(16, 4, ItemsInPacket ),
12077                 srec(netAddr, req_cond="ncp.enum_info_transport==TRUE"),
12078                 srec(timeInfo, req_cond="ncp.enum_info_time==TRUE"),
12079                 srec(nameInfo, req_cond="ncp.enum_info_name==TRUE"),
12080                 srec(lockInfo, req_cond="ncp.enum_info_lock==TRUE"),
12081                 srec(printInfo, req_cond="ncp.enum_info_print==TRUE"),
12082                 srec(statsInfo, req_cond="ncp.enum_info_stats==TRUE"),
12083                 srec(acctngInfo, req_cond="ncp.enum_info_account==TRUE"),
12084                 srec(authInfo, req_cond="ncp.enum_info_auth==TRUE"),
12085         ])                
12086         pkt.ReqCondSizeVariable()
12087         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
12088         # 2222/7B11, 123/17
12089         pkt = NCP(0x7B11, "Enumerate NCP Service Network Addresses", 'stats')
12090         pkt.Request(14, [
12091                 rec(10, 4, SearchNumber ),
12092         ])                
12093         pkt.Reply(60, [
12094                 rec(8, 4, CurrentServerTime ),
12095                 rec(12, 1, VConsoleVersion ),
12096                 rec(13, 1, VConsoleRevision ),
12097                 rec(14, 2, ServerInfoFlags ),
12098                 rec(16, 16, GUID ),
12099                 rec(32, 4, NextSearchNum ),
12100                 rec(36, 4, ItemsInPacket, var="x"), 
12101                 rec(40, 20, NCPNetworkAddress, repeat="x" ),
12102         ])
12103         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
12104         # 2222/7B14, 123/20
12105         pkt = NCP(0x7B14, "Active LAN Board List", 'stats')
12106         pkt.Request(14, [
12107                 rec(10, 4, StartNumber ),
12108         ])               
12109         pkt.Reply(28, [
12110                 rec(8, 4, CurrentServerTime ),
12111                 rec(12, 1, VConsoleVersion ),
12112                 rec(13, 1, VConsoleRevision ),
12113                 rec(14, 2, Reserved2 ),
12114                 rec(16, 4, MaxNumOfLANS ),
12115                 rec(20, 4, ItemsInPacket, var="x"),
12116                 rec(24, 4, BoardNumbers, repeat="x"),
12117         ])                
12118         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
12119         # 2222/7B15, 123/21
12120         pkt = NCP(0x7B15, "LAN Configuration Information", 'stats')
12121         pkt.Request(14, [
12122                 rec(10, 4, BoardNumber ),
12123         ])                
12124         pkt.Reply(152, [
12125                 rec(8, 4, CurrentServerTime ),
12126                 rec(12, 1, VConsoleVersion ),
12127                 rec(13, 1, VConsoleRevision ),
12128                 rec(14, 2, Reserved2 ),
12129                 rec(16,136, LANConfigInfo ),
12130         ])                
12131         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
12132         # 2222/7B16, 123/22
12133         pkt = NCP(0x7B16, "LAN Common Counters Information", 'stats')
12134         pkt.Request(18, [
12135                 rec(10, 4, BoardNumber ),
12136                 rec(14, 4, BlockNumber ),
12137         ])                
12138         pkt.Reply(86, [
12139                 rec(8, 4, CurrentServerTime ),
12140                 rec(12, 1, VConsoleVersion ),
12141                 rec(13, 1, VConsoleRevision ),
12142                 rec(14, 1, StatMajorVersion ),
12143                 rec(15, 1, StatMinorVersion ),
12144                 rec(16, 4, TotalCommonCnts ),
12145                 rec(20, 4, TotalCntBlocks ),
12146                 rec(24, 4, CustomCounters ),
12147                 rec(28, 4, NextCntBlock ),
12148                 rec(32, 54, CommonLanStruc ),
12149         ])                
12150         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
12151         # 2222/7B17, 123/23
12152         pkt = NCP(0x7B17, "LAN Custom Counters Information", 'stats')
12153         pkt.Request(18, [
12154                 rec(10, 4, BoardNumber ),
12155                 rec(14, 4, StartNumber ),
12156         ])                
12157         pkt.Reply(25, [
12158                 rec(8, 4, CurrentServerTime ),
12159                 rec(12, 1, VConsoleVersion ),
12160                 rec(13, 1, VConsoleRevision ),
12161                 rec(14, 2, Reserved2 ),
12162                 rec(16, 4, NumOfCCinPkt, var="x"),
12163                 rec(20, 5, CustomCntsInfo, repeat="x"),
12164         ])                
12165         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
12166         # 2222/7B18, 123/24
12167         pkt = NCP(0x7B18, "LAN Name Information", 'stats')
12168         pkt.Request(14, [
12169                 rec(10, 4, BoardNumber ),
12170         ])                
12171         pkt.Reply(19, [
12172                 rec(8, 4, CurrentServerTime ),
12173                 rec(12, 1, VConsoleVersion ),
12174                 rec(13, 1, VConsoleRevision ),
12175                 rec(14, 2, Reserved2 ),
12176                 rec(16, 3, BoardNameStruct ),
12177         ])
12178         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
12179         # 2222/7B19, 123/25
12180         pkt = NCP(0x7B19, "LSL Information", 'stats')
12181         pkt.Request(10)
12182         pkt.Reply(90, [
12183                 rec(8, 4, CurrentServerTime ),
12184                 rec(12, 1, VConsoleVersion ),
12185                 rec(13, 1, VConsoleRevision ),
12186                 rec(14, 2, Reserved2 ),
12187                 rec(16, 74, LSLInformation ),
12188         ])                
12189         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
12190         # 2222/7B1A, 123/26
12191         pkt = NCP(0x7B1A, "LSL Logical Board Statistics", 'stats')
12192         pkt.Request(14, [
12193                 rec(10, 4, BoardNumber ),
12194         ])                
12195         pkt.Reply(28, [
12196                 rec(8, 4, CurrentServerTime ),
12197                 rec(12, 1, VConsoleVersion ),
12198                 rec(13, 1, VConsoleRevision ),
12199                 rec(14, 2, Reserved2 ),
12200                 rec(16, 4, LogTtlTxPkts ),
12201                 rec(20, 4, LogTtlRxPkts ),
12202                 rec(24, 4, UnclaimedPkts ),
12203         ])                
12204         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
12205         # 2222/7B1B, 123/27
12206         pkt = NCP(0x7B1B, "MLID Board Information", 'stats')
12207         pkt.Request(14, [
12208                 rec(10, 4, BoardNumber ),
12209         ])                
12210         pkt.Reply(44, [
12211                 rec(8, 4, CurrentServerTime ),
12212                 rec(12, 1, VConsoleVersion ),
12213                 rec(13, 1, VConsoleRevision ),
12214                 rec(14, 1, Reserved ),
12215                 rec(15, 1, NumberOfProtocols ),
12216                 rec(16, 28, MLIDBoardInfo ),
12217         ])                        
12218         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
12219         # 2222/7B1E, 123/30
12220         pkt = NCP(0x7B1E, "Get Media Manager Object Information", 'stats')
12221         pkt.Request(14, [
12222                 rec(10, 4, ObjectNumber ),
12223         ])                
12224         pkt.Reply(212, [
12225                 rec(8, 4, CurrentServerTime ),
12226                 rec(12, 1, VConsoleVersion ),
12227                 rec(13, 1, VConsoleRevision ),
12228                 rec(14, 2, Reserved2 ),
12229                 rec(16, 196, GenericInfoDef ),
12230         ])                
12231         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
12232         # 2222/7B1F, 123/31
12233         pkt = NCP(0x7B1F, "Get Media Manager Objects List", 'stats')
12234         pkt.Request(15, [
12235                 rec(10, 4, StartNumber ),
12236                 rec(14, 1, MediaObjectType ),
12237         ])                
12238         pkt.Reply(28, [
12239                 rec(8, 4, CurrentServerTime ),
12240                 rec(12, 1, VConsoleVersion ),
12241                 rec(13, 1, VConsoleRevision ),
12242                 rec(14, 2, Reserved2 ),
12243                 rec(16, 4, nextStartingNumber ),
12244                 rec(20, 4, ObjectCount, var="x"),
12245                 rec(24, 4, ObjectID, repeat="x"),
12246         ])                
12247         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
12248         # 2222/7B20, 123/32
12249         pkt = NCP(0x7B20, "Get Media Manager Object Childrens List", 'stats')
12250         pkt.Request(22, [
12251                 rec(10, 4, StartNumber ),
12252                 rec(14, 1, MediaObjectType ),
12253                 rec(15, 3, Reserved3 ),
12254                 rec(18, 4, ParentObjectNumber ),
12255         ])                
12256         pkt.Reply(28, [
12257                 rec(8, 4, CurrentServerTime ),
12258                 rec(12, 1, VConsoleVersion ),
12259                 rec(13, 1, VConsoleRevision ),
12260                 rec(14, 2, Reserved2 ),
12261                 rec(16, 4, nextStartingNumber ),
12262                 rec(20, 4, ObjectCount, var="x" ),
12263                 rec(24, 4, ObjectID, repeat="x" ),
12264         ])                
12265         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
12266         # 2222/7B21, 123/33
12267         pkt = NCP(0x7B21, "Get Volume Segment List", 'stats')
12268         pkt.Request(14, [
12269                 rec(10, 4, VolumeNumberLong ),
12270         ])                
12271         pkt.Reply(32, [
12272                 rec(8, 4, CurrentServerTime ),
12273                 rec(12, 1, VConsoleVersion ),
12274                 rec(13, 1, VConsoleRevision ),
12275                 rec(14, 2, Reserved2 ),
12276                 rec(16, 4, NumOfSegments, var="x" ),
12277                 rec(20, 12, Segments, repeat="x" ),
12278         ])                
12279         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
12280         # 2222/7B22, 123/34
12281         pkt = NCP(0x7B22, "Get Volume Information by Level", 'stats')
12282         pkt.Request(15, [
12283                 rec(10, 4, VolumeNumberLong ),
12284                 rec(14, 1, InfoLevelNumber ),
12285         ])                
12286         pkt.Reply(NO_LENGTH_CHECK, [
12287                 rec(8, 4, CurrentServerTime ),
12288                 rec(12, 1, VConsoleVersion ),
12289                 rec(13, 1, VConsoleRevision ),
12290                 rec(14, 2, Reserved2 ),
12291                 rec(16, 1, InfoLevelNumber ),
12292                 rec(17, 3, Reserved3 ),
12293                 srec(VolInfoStructure, req_cond="ncp.info_level_num==0x01"),
12294                 srec(VolInfo2Struct, req_cond="ncp.info_level_num==0x02"),
12295         ])                
12296         pkt.ReqCondSizeVariable()
12297         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
12298         # 2222/7B28, 123/40
12299         pkt = NCP(0x7B28, "Active Protocol Stacks", 'stats')
12300         pkt.Request(14, [
12301                 rec(10, 4, StartNumber ),
12302         ])                
12303         pkt.Reply(48, [
12304                 rec(8, 4, CurrentServerTime ),
12305                 rec(12, 1, VConsoleVersion ),
12306                 rec(13, 1, VConsoleRevision ),
12307                 rec(14, 2, Reserved2 ),
12308                 rec(16, 4, MaxNumOfLANS ),
12309                 rec(20, 4, StackCount, var="x" ),
12310                 rec(24, 4, nextStartingNumber ),
12311                 rec(28, 20, StackInfo, repeat="x" ),
12312         ])                
12313         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
12314         # 2222/7B29, 123/41
12315         pkt = NCP(0x7B29, "Get Protocol Stack Configuration Information", 'stats')
12316         pkt.Request(14, [
12317                 rec(10, 4, StackNumber ),
12318         ])                
12319         pkt.Reply((37,164), [
12320                 rec(8, 4, CurrentServerTime ),
12321                 rec(12, 1, VConsoleVersion ),
12322                 rec(13, 1, VConsoleRevision ),
12323                 rec(14, 2, Reserved2 ),
12324                 rec(16, 1, ConfigMajorVN ),
12325                 rec(17, 1, ConfigMinorVN ),
12326                 rec(18, 1, StackMajorVN ),
12327                 rec(19, 1, StackMinorVN ),
12328                 rec(20, 16, ShortStkName ),
12329                 rec(36, (1,128), StackFullNameStr ),
12330         ])                
12331         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
12332         # 2222/7B2A, 123/42
12333         pkt = NCP(0x7B2A, "Get Protocol Stack Statistics Information", 'stats')
12334         pkt.Request(14, [
12335                 rec(10, 4, StackNumber ),
12336         ])                
12337         pkt.Reply(38, [
12338                 rec(8, 4, CurrentServerTime ),
12339                 rec(12, 1, VConsoleVersion ),
12340                 rec(13, 1, VConsoleRevision ),
12341                 rec(14, 2, Reserved2 ),
12342                 rec(16, 1, StatMajorVersion ),
12343                 rec(17, 1, StatMinorVersion ),
12344                 rec(18, 2, ComCnts ),
12345                 rec(20, 4, CounterMask ),
12346                 rec(24, 4, TotalTxPkts ),
12347                 rec(28, 4, TotalRxPkts ),
12348                 rec(32, 4, IgnoredRxPkts ),
12349                 rec(36, 2, CustomCnts ),
12350         ])                
12351         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
12352         # 2222/7B2B, 123/43
12353         pkt = NCP(0x7B2B, "Get Protocol Stack Custom Information", 'stats')
12354         pkt.Request(18, [
12355                 rec(10, 4, StackNumber ),
12356                 rec(14, 4, StartNumber ),
12357         ])                
12358         pkt.Reply(25, [
12359                 rec(8, 4, CurrentServerTime ),
12360                 rec(12, 1, VConsoleVersion ),
12361                 rec(13, 1, VConsoleRevision ),
12362                 rec(14, 2, Reserved2 ),
12363                 rec(16, 4, CustomCount, var="x" ),
12364                 rec(20, 5, CustomCntsInfo, repeat="x" ),
12365         ])                
12366         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
12367         # 2222/7B2C, 123/44
12368         pkt = NCP(0x7B2C, "Get Protocol Stack Numbers by Media Number", 'stats')
12369         pkt.Request(14, [
12370                 rec(10, 4, MediaNumber ),
12371         ])                
12372         pkt.Reply(24, [
12373                 rec(8, 4, CurrentServerTime ),
12374                 rec(12, 1, VConsoleVersion ),
12375                 rec(13, 1, VConsoleRevision ),
12376                 rec(14, 2, Reserved2 ),
12377                 rec(16, 4, StackCount, var="x" ),
12378                 rec(20, 4, StackNumber, repeat="x" ),
12379         ])                
12380         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
12381         # 2222/7B2D, 123/45
12382         pkt = NCP(0x7B2D, "Get Protocol Stack Numbers by LAN Board Number", 'stats')
12383         pkt.Request(14, [
12384                 rec(10, 4, BoardNumber ),
12385         ])                
12386         pkt.Reply(24, [
12387                 rec(8, 4, CurrentServerTime ),
12388                 rec(12, 1, VConsoleVersion ),
12389                 rec(13, 1, VConsoleRevision ),
12390                 rec(14, 2, Reserved2 ),
12391                 rec(16, 4, StackCount, var="x" ),
12392                 rec(20, 4, StackNumber, repeat="x" ),
12393         ])                
12394         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
12395         # 2222/7B2E, 123/46
12396         pkt = NCP(0x7B2E, "Get Media Name by Media Number", 'stats')
12397         pkt.Request(14, [
12398                 rec(10, 4, MediaNumber ),
12399         ])                
12400         pkt.Reply((17,144), [
12401                 rec(8, 4, CurrentServerTime ),
12402                 rec(12, 1, VConsoleVersion ),
12403                 rec(13, 1, VConsoleRevision ),
12404                 rec(14, 2, Reserved2 ),
12405                 rec(16, (1,128), MediaName ),
12406         ])                
12407         pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
12408         # 2222/7B2F, 123/47
12409         pkt = NCP(0x7B2F, "Get Loaded Media Number", 'stats')
12410         pkt.Request(10)
12411         pkt.Reply(28, [
12412                 rec(8, 4, CurrentServerTime ),
12413                 rec(12, 1, VConsoleVersion ),
12414                 rec(13, 1, VConsoleRevision ),
12415                 rec(14, 2, Reserved2 ),
12416                 rec(16, 4, MaxNumOfMedias ),
12417                 rec(20, 4, MediaListCount, var="x" ),
12418                 rec(24, 4, MediaList, repeat="x" ),
12419         ])                
12420         pkt.CompletionCodes([0x0000, 0x7e01, 0xfb06, 0xff00])
12421         # 2222/7B32, 123/50
12422         pkt = NCP(0x7B32, "Get General Router and SAP Information", 'stats')
12423         pkt.Request(10)
12424         pkt.Reply(37, [
12425                 rec(8, 4, CurrentServerTime ),
12426                 rec(12, 1, VConsoleVersion ),
12427                 rec(13, 1, VConsoleRevision ),
12428                 rec(14, 2, Reserved2 ),
12429                 rec(16, 2, RIPSocketNumber ),
12430                 rec(18, 2, Reserved2 ),
12431                 rec(20, 1, RouterDownFlag ),
12432                 rec(21, 3, Reserved3 ),
12433                 rec(24, 1, TrackOnFlag ),
12434                 rec(25, 3, Reserved3 ),
12435                 rec(28, 1, ExtRouterActiveFlag ),
12436                 rec(29, 3, Reserved3 ),
12437                 rec(32, 2, SAPSocketNumber ),
12438                 rec(34, 2, Reserved2 ),
12439                 rec(36, 1, RpyNearestSrvFlag ),
12440         ])                
12441         pkt.CompletionCodes([0x0000, 0x7e01, 0xfb06, 0xff00])
12442         # 2222/7B33, 123/51
12443         pkt = NCP(0x7B33, "Get Network Router Information", 'stats')
12444         pkt.Request(14, [
12445                 rec(10, 4, NetworkNumber ),
12446         ])                
12447         pkt.Reply(26, [
12448                 rec(8, 4, CurrentServerTime ),
12449                 rec(12, 1, VConsoleVersion ),
12450                 rec(13, 1, VConsoleRevision ),
12451                 rec(14, 2, Reserved2 ),
12452                 rec(16, 10, KnownRoutes ),
12453         ])                
12454         pkt.CompletionCodes([0x0000, 0x0108, 0x7e01, 0xfb06, 0xff00])
12455         # 2222/7B34, 123/52
12456         pkt = NCP(0x7B34, "Get Network Routers Information", 'stats')
12457         pkt.Request(18, [
12458                 rec(10, 4, NetworkNumber),
12459                 rec(14, 4, StartNumber ),
12460         ])                
12461         pkt.Reply(34, [
12462                 rec(8, 4, CurrentServerTime ),
12463                 rec(12, 1, VConsoleVersion ),
12464                 rec(13, 1, VConsoleRevision ),
12465                 rec(14, 2, Reserved2 ),
12466                 rec(16, 4, NumOfEntries, var="x" ),
12467                 rec(20, 14, RoutersInfo, repeat="x" ),
12468         ])                
12469         pkt.CompletionCodes([0x0000, 0x0108, 0x7e01, 0xfb06, 0xff00])
12470         # 2222/7B35, 123/53
12471         pkt = NCP(0x7B35, "Get Known Networks Information", 'stats')
12472         pkt.Request(14, [
12473                 rec(10, 4, StartNumber ),
12474         ])                
12475         pkt.Reply(30, [
12476                 rec(8, 4, CurrentServerTime ),
12477                 rec(12, 1, VConsoleVersion ),
12478                 rec(13, 1, VConsoleRevision ),
12479                 rec(14, 2, Reserved2 ),
12480                 rec(16, 4, NumOfEntries, var="x" ),
12481                 rec(20, 10, KnownRoutes, repeat="x" ),
12482         ])                
12483         pkt.CompletionCodes([0x0000, 0x7e01, 0xfb06, 0xff00])
12484         # 2222/7B36, 123/54
12485         pkt = NCP(0x7B36, "Get Server Information", 'stats')
12486         pkt.Request((15,64), [
12487                 rec(10, 2, ServerType ),
12488                 rec(12, 2, Reserved2 ),
12489                 rec(14, (1,50), ServerNameLen ),
12490         ], info_str=(ServerNameLen, "Get Server Information: %s", ", %s"))
12491         pkt.Reply(30, [
12492                 rec(8, 4, CurrentServerTime ),
12493                 rec(12, 1, VConsoleVersion ),
12494                 rec(13, 1, VConsoleRevision ),
12495                 rec(14, 2, Reserved2 ),
12496                 rec(16, 12, ServerAddress ),
12497                 rec(28, 2, HopsToNet ),
12498         ])                
12499         pkt.CompletionCodes([0x0000, 0x7e01, 0xfb06, 0xff00])
12500         # 2222/7B37, 123/55
12501         pkt = NCP(0x7B37, "Get Server Sources Information", 'stats')
12502         pkt.Request((19,68), [
12503                 rec(10, 4, StartNumber ),
12504                 rec(14, 2, ServerType ),
12505                 rec(16, 2, Reserved2 ),
12506                 rec(18, (1,50), ServerNameLen ),
12507         ], info_str=(ServerNameLen, "Get Server Sources Info: %s", ", %s"))                
12508         pkt.Reply(32, [
12509                 rec(8, 4, CurrentServerTime ),
12510                 rec(12, 1, VConsoleVersion ),
12511                 rec(13, 1, VConsoleRevision ),
12512                 rec(14, 2, Reserved2 ),
12513                 rec(16, 4, NumOfEntries, var="x" ),
12514                 rec(20, 12, ServersSrcInfo, repeat="x" ),
12515         ])                
12516         pkt.CompletionCodes([0x0000, 0x0108, 0x7e01, 0xfb06, 0xff00])
12517         # 2222/7B38, 123/56
12518         pkt = NCP(0x7B38, "Get Known Servers Information", 'stats')
12519         pkt.Request(16, [
12520                 rec(10, 4, StartNumber ),
12521                 rec(14, 2, ServerType ),
12522         ])                
12523         pkt.Reply(35, [
12524                 rec(8, 4, CurrentServerTime ),
12525                 rec(12, 1, VConsoleVersion ),
12526                 rec(13, 1, VConsoleRevision ),
12527                 rec(14, 2, Reserved2 ),
12528                 rec(16, 4, NumOfEntries, var="x" ),
12529                 rec(20, 15, KnownServStruc, repeat="x" ),
12530         ])                
12531         pkt.CompletionCodes([0x0000, 0x0108, 0x7e01, 0xfb06, 0xff00])
12532         # 2222/7B3C, 123/60
12533         pkt = NCP(0x7B3C, "Get Server Set Commands Information", 'stats')
12534         pkt.Request(14, [
12535                 rec(10, 4, StartNumber ),
12536         ])                
12537         pkt.Reply(NO_LENGTH_CHECK, [
12538                 rec(8, 4, CurrentServerTime ),
12539                 rec(12, 1, VConsoleVersion ),
12540                 rec(13, 1, VConsoleRevision ),
12541                 rec(14, 2, Reserved2 ),
12542                 rec(16, 4, TtlNumOfSetCmds ),
12543                 rec(20, 4, nextStartingNumber ),
12544                 rec(24, 1, SetCmdType ),
12545                 rec(25, 3, Reserved3 ),
12546                 rec(28, 1, SetCmdCategory ),
12547                 rec(29, 3, Reserved3 ),
12548                 rec(32, 1, SetCmdFlags ),
12549                 rec(33, 3, Reserved3 ),
12550                 rec(36, 100, SetCmdName ),
12551                 srec(SetCmdValueNum, req_cond="ncp.set_cmd_type==0x00"),
12552                 srec(SetCmdValueNum, req_cond="ncp.set_cmd_type==0x01"),
12553                 srec(SetCmdValueNum, req_cond="ncp.set_cmd_type==0x02"),
12554                 srec(SetCmdValueNum, req_cond="ncp.set_cmd_type==0x04"),
12555                 srec(SetCmdValueString, req_cond="ncp.set_cmd_type==0x05"),
12556                 srec(SetCmdValueNum, req_cond="ncp.set_cmd_type==0x06"),
12557                 srec(SetCmdValueNum, req_cond="ncp.set_cmd_type==0x07"),
12558         ])                
12559         pkt.ReqCondSizeVariable()
12560         pkt.CompletionCodes([0x0000, 0x7e01, 0xfb06, 0xff00])
12561         # 2222/7B3D, 123/61
12562         pkt = NCP(0x7B3D, "Get Server Set Categories", 'stats')
12563         pkt.Request(14, [
12564                 rec(10, 4, StartNumber ),
12565         ])                
12566         pkt.Reply(124, [
12567                 rec(8, 4, CurrentServerTime ),
12568                 rec(12, 1, VConsoleVersion ),
12569                 rec(13, 1, VConsoleRevision ),
12570                 rec(14, 2, Reserved2 ),
12571                 rec(16, 4, NumberOfSetCategories ),
12572                 rec(20, 4, nextStartingNumber ),
12573                 rec(24, 100, CategoryName ),
12574         ])                
12575         pkt.CompletionCodes([0x0000, 0x7e01, 0xfb06, 0xff00])
12576         # 2222/7B3E, 123/62
12577         pkt = NCP(0x7B3E, "Get Server Set Commands Information By Name", 'stats')
12578         pkt.Request(110, [
12579                 rec(10, 100, SetParmName ),
12580         ], info_str=(SetParmName, "Get Server Set Command Info for: %s", ", %s"))                
12581         pkt.Reply(NO_LENGTH_CHECK, [
12582                 rec(8, 4, CurrentServerTime ),
12583                 rec(12, 1, VConsoleVersion ),
12584                 rec(13, 1, VConsoleRevision ),
12585                 rec(14, 2, Reserved2 ),
12586                 rec(16, 4, TtlNumOfSetCmds ),
12587                 rec(20, 4, nextStartingNumber ),
12588                 rec(24, 1, SetCmdType ),
12589                 rec(25, 3, Reserved3 ),
12590                 rec(28, 1, SetCmdCategory ),
12591                 rec(29, 3, Reserved3 ),
12592                 rec(32, 1, SetCmdFlags ),
12593                 rec(33, 3, Reserved3 ),
12594                 rec(36, 100, SetCmdName ),
12595                 srec(SetCmdValueNum, req_cond="ncp.set_cmd_type==0x00"),
12596                 srec(SetCmdValueNum, req_cond="ncp.set_cmd_type==0x01"),
12597                 srec(SetCmdValueNum, req_cond="ncp.set_cmd_type==0x02"),
12598                 srec(SetCmdValueNum, req_cond="ncp.set_cmd_type==0x04"),
12599                 srec(SetCmdValueString, req_cond="ncp.set_cmd_type==0x05"),
12600                 srec(SetCmdValueNum, req_cond="ncp.set_cmd_type==0x06"),
12601                 srec(SetCmdValueNum, req_cond="ncp.set_cmd_type==0x07"),
12602         ])                
12603         pkt.ReqCondSizeVariable()
12604         pkt.CompletionCodes([0x0000, 0x7e01, 0xfb06, 0xff00])
12605         # 2222/7B46, 123/70
12606         pkt = NCP(0x7B46, "Get Current Compressing File", 'stats')
12607         pkt.Request(14, [
12608                 rec(10, 4, VolumeNumberLong ),
12609         ])                
12610         pkt.Reply(56, [
12611                 rec(8, 4, ParentID ),
12612                 rec(12, 4, DirectoryEntryNumber ),
12613                 rec(16, 4, compressionStage ),
12614                 rec(20, 4, ttlIntermediateBlks ),
12615                 rec(24, 4, ttlCompBlks ),
12616                 rec(28, 4, curIntermediateBlks ),
12617                 rec(32, 4, curCompBlks ),
12618                 rec(36, 4, curInitialBlks ),
12619                 rec(40, 4, fileFlags ),
12620                 rec(44, 4, projectedCompSize ),
12621                 rec(48, 4, originalSize ),
12622                 rec(52, 4, compressVolume ),
12623         ])                
12624         pkt.CompletionCodes([0x0000, 0x7e00, 0xfb06, 0xff00])
12625         # 2222/7B47, 123/71
12626         pkt = NCP(0x7B47, "Get Current DeCompressing File Info List", 'stats')
12627         pkt.Request(14, [
12628                 rec(10, 4, VolumeNumberLong ),
12629         ])                
12630         pkt.Reply(28, [
12631                 rec(8, 4, FileListCount ),
12632                 rec(12, 16, FileInfoStruct ),
12633         ])                
12634         pkt.CompletionCodes([0x0000, 0x7e00, 0xfb06, 0xff00])
12635         # 2222/7B48, 123/72
12636         pkt = NCP(0x7B48, "Get Compression and Decompression Time and Counts", 'stats')
12637         pkt.Request(14, [
12638                 rec(10, 4, VolumeNumberLong ),
12639         ])                
12640         pkt.Reply(64, [
12641                 rec(8, 56, CompDeCompStat ),
12642         ])
12643         pkt.CompletionCodes([0x0000, 0x7e00, 0xfb06, 0xff00])
12644         # 2222/8301, 131/01
12645         pkt = NCP(0x8301, "RPC Load an NLM", 'fileserver')
12646         pkt.Request(285, [
12647                 rec(10, 4, NLMLoadOptions ),
12648                 rec(14, 16, Reserved16 ),
12649                 rec(30, 255, PathAndName ),
12650         ], info_str=(PathAndName, "RPC Load NLM: %s", ", %s"))                
12651         pkt.Reply(12, [
12652                 rec(8, 4, RPCccode ),
12653         ])                
12654         pkt.CompletionCodes([0x0000, 0x7e00, 0xfb07, 0xff00])
12655         # 2222/8302, 131/02
12656         pkt = NCP(0x8302, "RPC Unload an NLM", 'fileserver')
12657         pkt.Request(100, [
12658                 rec(10, 20, Reserved20 ),
12659                 rec(30, 70, NLMName ),
12660         ], info_str=(NLMName, "RPC Unload NLM: %s", ", %s"))                
12661         pkt.Reply(12, [
12662                 rec(8, 4, RPCccode ),
12663         ])                
12664         pkt.CompletionCodes([0x0000, 0x7e00, 0xfb07, 0xff00])
12665         # 2222/8303, 131/03
12666         pkt = NCP(0x8303, "RPC Mount Volume", 'fileserver')
12667         pkt.Request(100, [
12668                 rec(10, 20, Reserved20 ),
12669                 rec(30, 70, VolumeNameStringz ),
12670         ], info_str=(VolumeNameStringz, "RPC Mount Volume: %s", ", %s"))                
12671         pkt.Reply(32, [
12672                 rec(8, 4, RPCccode),
12673                 rec(12, 16, Reserved16 ),
12674                 rec(28, 4, VolumeNumberLong ),
12675         ])                
12676         pkt.CompletionCodes([0x0000, 0x7e00, 0xfb07, 0xff00])
12677         # 2222/8304, 131/04
12678         pkt = NCP(0x8304, "RPC Dismount Volume", 'fileserver')
12679         pkt.Request(100, [
12680                 rec(10, 20, Reserved20 ),
12681                 rec(30, 70, VolumeNameStringz ),
12682         ], info_str=(VolumeNameStringz, "RPC Dismount Volume: %s", ", %s"))                
12683         pkt.Reply(12, [
12684                 rec(8, 4, RPCccode ), 
12685         ])                
12686         pkt.CompletionCodes([0x0000, 0x7e00, 0xfb07, 0xff00])
12687         # 2222/8305, 131/05
12688         pkt = NCP(0x8305, "RPC Add Name Space To Volume", 'fileserver')
12689         pkt.Request(100, [
12690                 rec(10, 20, Reserved20 ),
12691                 rec(30, 70, AddNameSpaceAndVol ),
12692         ], info_str=(AddNameSpaceAndVol, "RPC Add Name Space to Volume: %s", ", %s"))                
12693         pkt.Reply(12, [
12694                 rec(8, 4, RPCccode ),
12695         ])                
12696         pkt.CompletionCodes([0x0000, 0x7e00, 0xfb07, 0xff00])
12697         # 2222/8306, 131/06
12698         pkt = NCP(0x8306, "RPC Set Command Value", 'fileserver')
12699         pkt.Request(100, [
12700                 rec(10, 1, SetCmdType ),
12701                 rec(11, 3, Reserved3 ),
12702                 rec(14, 4, SetCmdValueNum ),
12703                 rec(18, 12, Reserved12 ),
12704                 rec(30, 70, SetCmdName ),
12705         ], info_str=(SetCmdName, "RPC Set Command Value: %s", ", %s"))                
12706         pkt.Reply(12, [
12707                 rec(8, 4, RPCccode ),
12708         ])                
12709         pkt.CompletionCodes([0x0000, 0x7e00, 0xfb07, 0xff00])
12710         # 2222/8307, 131/07
12711         pkt = NCP(0x8307, "RPC Execute NCF File", 'fileserver')
12712         pkt.Request(285, [
12713                 rec(10, 20, Reserved20 ),
12714                 rec(30, 255, PathAndName ),
12715         ], info_str=(PathAndName, "RPC Execute NCF File: %s", ", %s"))                
12716         pkt.Reply(12, [
12717                 rec(8, 4, RPCccode ),
12718         ])                
12719         pkt.CompletionCodes([0x0000, 0x7e00, 0xfb07, 0xff00])
12720 if __name__ == '__main__':
12721 #       import profile
12722 #       filename = "ncp.pstats"
12723 #       profile.run("main()", filename)
12724 #
12725 #       import pstats
12726 #       sys.stdout = msg
12727 #       p = pstats.Stats(filename)
12728 #
12729 #       print "Stats sorted by cumulative time"
12730 #       p.strip_dirs().sort_stats('cumulative').print_stats()
12731 #
12732 #       print "Function callees"
12733 #       p.print_callees()
12734         main()