1#!/usr/bin/env python3
2
3"""
4Creates C code from a table of NCP type 0x2222 packet types.
5(And 0x3333, which are the replies, but the packets are more commonly
6refered to as type 0x2222; the 0x3333 replies are understood to be
7part of the 0x2222 "family")
8
9The data-munging code was written by Gilbert Ramirez.
10The NCP data comes from Greg Morris <GMORRIS@novell.com>.
11Many thanks to Novell for letting him work on this.
12
13Additional data sources:
14"Programmer's Guide to the NetWare Core Protocol" by Steve Conner and Dianne Conner.
15
16At one time, Novell provided a list of NCPs by number at:
17
18http://developer.novell.com/ndk/ncp.htm  (where you could download an
19*.exe file which installs a PDF, although you may have to create a login
20to do this)
21
22or
23
24http://developer.novell.com/ndk/doc/ncp/
25for a badly-formatted HTML version of the same PDF.
26
27Currently, NCP documentation can be found at:
28
29https://www.microfocus.com/documentation/open-enterprise-server-developer-documentation/ncp/
30
31with a list of NCPs by number at
32
33https://www.microfocus.com/documentation/open-enterprise-server-developer-documentation/ncp/ncpdocs/main.htm
34
35and some additional NCPs to support volumes > 16TB at
36
37https://www.microfocus.com/documentation/open-enterprise-server-developer-documentation/ncp/ncpdocs/16tb+.htm
38
39NDS information can be found at:
40
41https://www.microfocus.com/documentation/edirectory-developer-documentation/edirectory-libraries-for-c/
42
43and PDFs linked from there, and from
44
45https://www.novell.com/documentation/developer/ndslib/
46
47and HTML versions linked from there.
48
49The Novell eDirectory Schema Reference gives a "Transfer Format" for
50some types, which may be the way they're sent over the wire.
51
52Portions Copyright (c) 2000-2002 by Gilbert Ramirez <gram@alumni.rice.edu>.
53Portions Copyright (c) Novell, Inc. 2000-2003.
54
55This program is free software; you can redistribute it and/or
56modify it under the terms of the GNU General Public License
57as published by the Free Software Foundation; either version 2
58of the License, or (at your option) any later version.
59
60This program is distributed in the hope that it will be useful,
61but WITHOUT ANY WARRANTY; without even the implied warranty of
62MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
63GNU General Public License for more details.
64
65You should have received a copy of the GNU General Public License
66along with this program; if not, write to the Free Software
67Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
68"""
69
70import os
71import sys
72import string
73import getopt
74import traceback
75
76errors          = {}
77groups          = {}
78packets         = []
79compcode_lists  = None
80ptvc_lists      = None
81msg             = None
82reply_var = None
83#ensure unique expert function declarations
84expert_hash     = {}
85
86REC_START       = 0
87REC_LENGTH      = 1
88REC_FIELD       = 2
89REC_ENDIANNESS  = 3
90REC_VAR         = 4
91REC_REPEAT      = 5
92REC_REQ_COND    = 6
93REC_INFO_STR    = 7
94
95NO_VAR          = -1
96NO_REPEAT       = -1
97NO_REQ_COND     = -1
98NO_LENGTH_CHECK = -2
99
100
101PROTO_LENGTH_UNKNOWN    = -1
102
103global_highest_var = -1
104global_req_cond = {}
105
106
107REQ_COND_SIZE_VARIABLE = "REQ_COND_SIZE_VARIABLE"
108REQ_COND_SIZE_CONSTANT = "REQ_COND_SIZE_CONSTANT"
109
110##############################################################################
111# Global containers
112##############################################################################
113
114class UniqueCollection:
115    """The UniqueCollection class stores objects which can be compared to other
116    objects of the same class. If two objects in the collection are equivalent,
117    only one is stored."""
118
119    def __init__(self, name):
120        "Constructor"
121        self.name = name
122        self.members = []
123        self.member_reprs = {}
124
125    def Add(self, object):
126        """Add an object to the members lists, if a comparable object
127        doesn't already exist. The object that is in the member list, that is
128        either the object that was added or the comparable object that was
129        already in the member list, is returned."""
130
131        r = repr(object)
132        # Is 'object' a duplicate of some other member?
133        if r in self.member_reprs:
134            return self.member_reprs[r]
135        else:
136            self.member_reprs[r] = object
137            self.members.append(object)
138            return object
139
140    def Members(self):
141        "Returns the list of members."
142        return self.members
143
144    def HasMember(self, object):
145        "Does the list of members contain the object?"
146        if repr(object) in self.member_reprs:
147            return 1
148        else:
149            return 0
150
151# This list needs to be defined before the NCP types are defined,
152# because the NCP types are defined in the global scope, not inside
153# a function's scope.
154ptvc_lists      = UniqueCollection('PTVC Lists')
155
156##############################################################################
157
158class NamedList:
159    "NamedList's keep track of PTVC's and Completion Codes"
160    def __init__(self, name, list):
161        "Constructor"
162        self.name = name
163        self.list = list
164
165    def __cmp__(self, other):
166        "Compare this NamedList to another"
167
168        if isinstance(other, NamedList):
169            return cmp(self.list, other.list)
170        else:
171            return 0
172
173
174    def Name(self, new_name = None):
175        "Get/Set name of list"
176        if new_name is not None:
177            self.name = new_name
178        return self.name
179
180    def Records(self):
181        "Returns record lists"
182        return self.list
183
184    def Null(self):
185        "Is there no list (different from an empty list)?"
186        return self.list is None
187
188    def Empty(self):
189        "It the list empty (different from a null list)?"
190        assert(not self.Null())
191
192        if self.list:
193            return 0
194        else:
195            return 1
196
197    def __repr__(self):
198        return repr(self.list)
199
200class PTVC(NamedList):
201    """ProtoTree TVBuff Cursor List ("PTVC List") Class"""
202
203    def __init__(self, name, records, code):
204        "Constructor"
205        NamedList.__init__(self, name, [])
206
207        global global_highest_var
208
209        expected_offset = None
210        highest_var = -1
211
212        named_vars = {}
213
214        # Make a PTVCRecord object for each list in 'records'
215        for record in records:
216            offset = record[REC_START]
217            length = record[REC_LENGTH]
218            field = record[REC_FIELD]
219            endianness = record[REC_ENDIANNESS]
220            info_str = record[REC_INFO_STR]
221
222            # Variable
223            var_name = record[REC_VAR]
224            if var_name:
225                # Did we already define this var?
226                if var_name in named_vars:
227                    sys.exit("%s has multiple %s vars." % \
228                            (name, var_name))
229
230                highest_var = highest_var + 1
231                var = highest_var
232                if highest_var > global_highest_var:
233                    global_highest_var = highest_var
234                named_vars[var_name] = var
235            else:
236                var = NO_VAR
237
238            # Repeat
239            repeat_name = record[REC_REPEAT]
240            if repeat_name:
241                # Do we have this var?
242                if repeat_name not in named_vars:
243                    sys.exit("%s does not have %s var defined." % \
244                            (name, repeat_name))
245                repeat = named_vars[repeat_name]
246            else:
247                repeat = NO_REPEAT
248
249            # Request Condition
250            req_cond = record[REC_REQ_COND]
251            if req_cond != NO_REQ_COND:
252                global_req_cond[req_cond] = None
253
254            ptvc_rec = PTVCRecord(field, length, endianness, var, repeat, req_cond, info_str, code)
255
256            if expected_offset is None:
257                expected_offset = offset
258
259            elif expected_offset == -1:
260                pass
261
262            elif expected_offset != offset and offset != -1:
263                msg.write("Expected offset in %s for %s to be %d\n" % \
264                        (name, field.HFName(), expected_offset))
265                sys.exit(1)
266
267            # We can't make a PTVC list from a variable-length
268            # packet, unless the fields can tell us at run time
269            # how long the packet is. That is, nstring8 is fine, since
270            # the field has an integer telling us how long the string is.
271            # Fields that don't have a length determinable at run-time
272            # cannot be variable-length.
273            if type(ptvc_rec.Length()) == type(()):
274                if isinstance(ptvc_rec.Field(), nstring):
275                    expected_offset = -1
276                    pass
277                elif isinstance(ptvc_rec.Field(), nbytes):
278                    expected_offset = -1
279                    pass
280                elif isinstance(ptvc_rec.Field(), struct):
281                    expected_offset = -1
282                    pass
283                else:
284                    field = ptvc_rec.Field()
285                    assert 0, "Cannot make PTVC from %s, type %s" % \
286                            (field.HFName(), field)
287
288            elif expected_offset > -1:
289                if ptvc_rec.Length() < 0:
290                    expected_offset = -1
291                else:
292                    expected_offset = expected_offset + ptvc_rec.Length()
293
294
295            self.list.append(ptvc_rec)
296
297    def ETTName(self):
298        return "ett_%s" % (self.Name(),)
299
300
301    def Code(self):
302        x =  "static const ptvc_record %s[] = {\n" % (self.Name())
303        for ptvc_rec in self.list:
304            x = x +  "    %s,\n" % (ptvc_rec.Code())
305        x = x + "    { NULL, 0, NULL, NULL, NO_ENDIANNESS, NO_VAR, NO_REPEAT, NO_REQ_COND }\n"
306        x = x + "};\n"
307        return x
308
309    def __repr__(self):
310        x = ""
311        for ptvc_rec in self.list:
312            x = x + repr(ptvc_rec)
313        return x
314
315
316class PTVCBitfield(PTVC):
317    def __init__(self, name, vars):
318        NamedList.__init__(self, name, [])
319
320        for var in vars:
321            ptvc_rec = PTVCRecord(var, var.Length(), var.Endianness(),
322                    NO_VAR, NO_REPEAT, NO_REQ_COND, None, 0)
323            self.list.append(ptvc_rec)
324
325    def Code(self):
326        ett_name = self.ETTName()
327        x = "static gint %s = -1;\n" % (ett_name,)
328
329        x = x + "static const ptvc_record ptvc_%s[] = {\n" % (self.Name())
330        for ptvc_rec in self.list:
331            x = x +  "    %s,\n" % (ptvc_rec.Code())
332        x = x + "    { NULL, 0, NULL, NULL, NO_ENDIANNESS, NO_VAR, NO_REPEAT, NO_REQ_COND }\n"
333        x = x + "};\n"
334
335        x = x + "static const sub_ptvc_record %s = {\n" % (self.Name(),)
336        x = x + "    &%s,\n" % (ett_name,)
337        x = x + "    NULL,\n"
338        x = x + "    ptvc_%s,\n" % (self.Name(),)
339        x = x + "};\n"
340        return x
341
342
343class PTVCRecord:
344    def __init__(self, field, length, endianness, var, repeat, req_cond, info_str, code):
345        "Constructor"
346        self.field      = field
347        self.length     = length
348        self.endianness = endianness
349        self.var        = var
350        self.repeat     = repeat
351        self.req_cond   = req_cond
352        self.req_info_str  = info_str
353        self.__code__  = code
354
355    def __cmp__(self, other):
356        "Comparison operator"
357        if self.field != other.field:
358            return 1
359        elif self.length < other.length:
360            return -1
361        elif self.length > other.length:
362            return 1
363        elif self.endianness != other.endianness:
364            return 1
365        else:
366            return 0
367
368    def Code(self):
369        # Nice textual representations
370        if self.var == NO_VAR:
371            var = "NO_VAR"
372        else:
373            var = self.var
374
375        if self.repeat == NO_REPEAT:
376            repeat = "NO_REPEAT"
377        else:
378            repeat = self.repeat
379
380        if self.req_cond == NO_REQ_COND:
381            req_cond = "NO_REQ_COND"
382        else:
383            req_cond = global_req_cond[self.req_cond]
384            assert req_cond is not None
385
386        if isinstance(self.field, struct):
387            return self.field.ReferenceString(var, repeat, req_cond)
388        else:
389            return self.RegularCode(var, repeat, req_cond)
390
391    def InfoStrName(self):
392        "Returns a C symbol based on the NCP function code, for the info_str"
393        return "info_str_0x%x" % (self.__code__)
394
395    def RegularCode(self, var, repeat, req_cond):
396        "String representation"
397        endianness = 'ENC_BIG_ENDIAN'
398        if self.endianness == ENC_LITTLE_ENDIAN:
399            endianness = 'ENC_LITTLE_ENDIAN'
400
401        length = None
402
403        if type(self.length) == type(0):
404            length = self.length
405        else:
406            # This is for cases where a length is needed
407            # in order to determine a following variable-length,
408            # like nstring8, where 1 byte is needed in order
409            # to determine the variable length.
410            var_length = self.field.Length()
411            if var_length > 0:
412                length = var_length
413
414        if length == PROTO_LENGTH_UNKNOWN:
415            # XXX length = "PROTO_LENGTH_UNKNOWN"
416            pass
417
418        assert length, "Length not handled for %s" % (self.field.HFName(),)
419
420        sub_ptvc_name = self.field.PTVCName()
421        if sub_ptvc_name != "NULL":
422            sub_ptvc_name = "&%s" % (sub_ptvc_name,)
423
424        if self.req_info_str:
425            req_info_str = "&" + self.InfoStrName() + "_req"
426        else:
427            req_info_str = "NULL"
428
429        return "{ &%s, %s, %s, %s, %s, %s, %s, %s }" % \
430                (self.field.HFName(), length, sub_ptvc_name,
431                req_info_str, endianness, var, repeat, req_cond)
432
433    def Offset(self):
434        return self.offset
435
436    def Length(self):
437        return self.length
438
439    def Field(self):
440        return self.field
441
442    def __repr__(self):
443        if self.req_info_str:
444            return "{%s len=%s end=%s var=%s rpt=%s rqc=%s info=%s}" % \
445                (self.field.HFName(), self.length,
446                self.endianness, self.var, self.repeat, self.req_cond, self.req_info_str[1])
447        else:
448            return "{%s len=%s end=%s var=%s rpt=%s rqc=%s}" % \
449                (self.field.HFName(), self.length,
450                self.endianness, self.var, self.repeat, self.req_cond)
451
452##############################################################################
453
454class NCP:
455    "NCP Packet class"
456    def __init__(self, func_code, description, group, has_length=1):
457        "Constructor"
458        self.__code__          = func_code
459        self.description        = description
460        self.group              = group
461        self.codes              = None
462        self.request_records    = None
463        self.reply_records      = None
464        self.has_length         = has_length
465        self.req_cond_size      = None
466        self.req_info_str       = None
467        self.expert_func        = None
468
469        if group not in groups:
470            msg.write("NCP 0x%x has invalid group '%s'\n" % \
471                    (self.__code__, group))
472            sys.exit(1)
473
474        if self.HasSubFunction():
475            # NCP Function with SubFunction
476            self.start_offset = 10
477        else:
478            # Simple NCP Function
479            self.start_offset = 7
480
481    def ReqCondSize(self):
482        return self.req_cond_size
483
484    def ReqCondSizeVariable(self):
485        self.req_cond_size = REQ_COND_SIZE_VARIABLE
486
487    def ReqCondSizeConstant(self):
488        self.req_cond_size = REQ_COND_SIZE_CONSTANT
489
490    def FunctionCode(self, part=None):
491        "Returns the function code for this NCP packet."
492        if part is None:
493            return self.__code__
494        elif part == 'high':
495            if self.HasSubFunction():
496                return (self.__code__ & 0xff00) >> 8
497            else:
498                return self.__code__
499        elif part == 'low':
500            if self.HasSubFunction():
501                return self.__code__ & 0x00ff
502            else:
503                return 0x00
504        else:
505            msg.write("Unknown directive '%s' for function_code()\n" % (part))
506            sys.exit(1)
507
508    def HasSubFunction(self):
509        "Does this NPC packet require a subfunction field?"
510        if self.__code__ <= 0xff:
511            return 0
512        else:
513            return 1
514
515    def HasLength(self):
516        return self.has_length
517
518    def Description(self):
519        return self.description
520
521    def Group(self):
522        return self.group
523
524    def PTVCRequest(self):
525        return self.ptvc_request
526
527    def PTVCReply(self):
528        return self.ptvc_reply
529
530    def Request(self, size, records=[], **kwargs):
531        self.request_size = size
532        self.request_records = records
533        if self.HasSubFunction():
534            if self.HasLength():
535                self.CheckRecords(size, records, "Request", 10)
536            else:
537                self.CheckRecords(size, records, "Request", 8)
538        else:
539            self.CheckRecords(size, records, "Request", 7)
540        self.ptvc_request = self.MakePTVC(records, "request", self.__code__)
541
542        if "info_str" in kwargs:
543            self.req_info_str = kwargs["info_str"]
544
545    def Reply(self, size, records=[]):
546        self.reply_size = size
547        self.reply_records = records
548        self.CheckRecords(size, records, "Reply", 8)
549        self.ptvc_reply = self.MakePTVC(records, "reply", self.__code__)
550
551    def CheckRecords(self, size, records, descr, min_hdr_length):
552        "Simple sanity check"
553        if size == NO_LENGTH_CHECK:
554            return
555        min = size
556        max = size
557        if type(size) == type(()):
558            min = size[0]
559            max = size[1]
560
561        lower = min_hdr_length
562        upper = min_hdr_length
563
564        for record in records:
565            rec_size = record[REC_LENGTH]
566            rec_lower = rec_size
567            rec_upper = rec_size
568            if type(rec_size) == type(()):
569                rec_lower = rec_size[0]
570                rec_upper = rec_size[1]
571
572            lower = lower + rec_lower
573            upper = upper + rec_upper
574
575        error = 0
576        if min != lower:
577            msg.write("%s records for 2222/0x%x sum to %d bytes minimum, but param1 shows %d\n" \
578                    % (descr, self.FunctionCode(), lower, min))
579            error = 1
580        if max != upper:
581            msg.write("%s records for 2222/0x%x sum to %d bytes maximum, but param1 shows %d\n" \
582                    % (descr, self.FunctionCode(), upper, max))
583            error = 1
584
585        if error == 1:
586            sys.exit(1)
587
588
589    def MakePTVC(self, records, name_suffix, code):
590        """Makes a PTVC out of a request or reply record list. Possibly adds
591        it to the global list of PTVCs (the global list is a UniqueCollection,
592        so an equivalent PTVC may already be in the global list)."""
593
594        name = "%s_%s" % (self.CName(), name_suffix)
595        #if any individual record has an info_str, bubble it up to the top
596        #so an info_string_t can be created for it
597        for record in records:
598            if record[REC_INFO_STR]:
599                self.req_info_str = record[REC_INFO_STR]
600
601        ptvc = PTVC(name, records, code)
602
603        #if the record is a duplicate, remove the req_info_str so
604        #that an unused info_string isn't generated
605        remove_info = 0
606        if ptvc_lists.HasMember(ptvc):
607            if 'info' in repr(ptvc):
608                remove_info = 1
609
610        ptvc_test = ptvc_lists.Add(ptvc)
611
612        if remove_info:
613            self.req_info_str = None
614
615        return ptvc_test
616
617    def CName(self):
618        "Returns a C symbol based on the NCP function code"
619        return "ncp_0x%x" % (self.__code__)
620
621    def InfoStrName(self):
622        "Returns a C symbol based on the NCP function code, for the info_str"
623        return "info_str_0x%x" % (self.__code__)
624
625    def MakeExpert(self, func):
626        self.expert_func = func
627        expert_hash[func] = func
628
629    def Variables(self):
630        """Returns a list of variables used in the request and reply records.
631        A variable is listed only once, even if it is used twice (once in
632        the request, once in the reply)."""
633
634        variables = {}
635        if self.request_records:
636            for record in self.request_records:
637                var = record[REC_FIELD]
638                variables[var.HFName()] = var
639
640                sub_vars = var.SubVariables()
641                for sv in sub_vars:
642                    variables[sv.HFName()] = sv
643
644        if self.reply_records:
645            for record in self.reply_records:
646                var = record[REC_FIELD]
647                variables[var.HFName()] = var
648
649                sub_vars = var.SubVariables()
650                for sv in sub_vars:
651                    variables[sv.HFName()] = sv
652
653        return list(variables.values())
654
655    def CalculateReqConds(self):
656        """Returns a list of request conditions (dfilter text) used
657        in the reply records. A request condition is listed only once,"""
658        texts = {}
659        if self.reply_records:
660            for record in self.reply_records:
661                text = record[REC_REQ_COND]
662                if text != NO_REQ_COND:
663                    texts[text] = None
664
665        if len(texts) == 0:
666            self.req_conds = None
667            return None
668
669        dfilter_texts = list(texts.keys())
670        dfilter_texts.sort()
671        name = "%s_req_cond_indexes" % (self.CName(),)
672        return NamedList(name, dfilter_texts)
673
674    def GetReqConds(self):
675        return self.req_conds
676
677    def SetReqConds(self, new_val):
678        self.req_conds = new_val
679
680
681    def CompletionCodes(self, codes=None):
682        """Sets or returns the list of completion
683        codes. Internally, a NamedList is used to store the
684        completion codes, but the caller of this function never
685        realizes that because Python lists are the input and
686        output."""
687
688        if codes is None:
689            return self.codes
690
691        # Sanity check
692        okay = 1
693        for code in codes:
694            if code not in errors:
695                msg.write("Errors table does not have key 0x%04x for NCP=0x%x\n" % (code,
696                        self.__code__))
697                okay = 0
698
699        # Delay the exit until here so that the programmer can get
700        # the complete list of missing error codes
701        if not okay:
702            sys.exit(1)
703
704        # Create CompletionCode (NamedList) object and possible
705        # add it to  the global list of completion code lists.
706        name = "%s_errors" % (self.CName(),)
707        codes.sort()
708        codes_list = NamedList(name, codes)
709        self.codes = compcode_lists.Add(codes_list)
710
711        self.Finalize()
712
713    def Finalize(self):
714        """Adds the NCP object to the global collection of NCP
715        objects. This is done automatically after setting the
716        CompletionCode list. Yes, this is a shortcut, but it makes
717        our list of NCP packet definitions look neater, since an
718        explicit "add to global list of packets" is not needed."""
719
720        # Add packet to global collection of packets
721        packets.append(self)
722
723def rec(start, length, field, endianness=None, **kw):
724    return _rec(start, length, field, endianness, kw)
725
726def srec(field, endianness=None, **kw):
727    return _rec(-1, -1, field, endianness, kw)
728
729def _rec(start, length, field, endianness, kw):
730    # If endianness not explicitly given, use the field's
731    # default endiannes.
732    if endianness is None:
733        endianness = field.Endianness()
734
735    # Setting a var?
736    if "var" in kw:
737        # Is the field an INT ?
738        if not isinstance(field, CountingNumber):
739            sys.exit("Field %s used as count variable, but not integer." \
740                    % (field.HFName()))
741        var = kw["var"]
742    else:
743        var = None
744
745    # If 'var' not used, 'repeat' can be used.
746    if not var and "repeat" in kw:
747        repeat = kw["repeat"]
748    else:
749        repeat = None
750
751    # Request-condition ?
752    if "req_cond" in kw:
753        req_cond = kw["req_cond"]
754    else:
755        req_cond = NO_REQ_COND
756
757    if "info_str" in kw:
758        req_info_str = kw["info_str"]
759    else:
760        req_info_str = None
761
762    return [start, length, field, endianness, var, repeat, req_cond, req_info_str]
763
764
765
766##############################################################################
767
768ENC_LITTLE_ENDIAN              = 1             # Little-Endian
769ENC_BIG_ENDIAN              = 0             # Big-Endian
770NA              = -1            # Not Applicable
771
772class Type:
773    " Virtual class for NCP field types"
774    type            = "Type"
775    ftype           = None
776    disp            = "BASE_DEC"
777    custom_func     = None
778    endianness      = NA
779    values          = []
780
781    def __init__(self, abbrev, descr, bytes, endianness = NA):
782        self.abbrev = abbrev
783        self.descr = descr
784        self.bytes = bytes
785        self.endianness = endianness
786        self.hfname = "hf_ncp_" + self.abbrev
787
788    def Length(self):
789        return self.bytes
790
791    def Abbreviation(self):
792        return self.abbrev
793
794    def Description(self):
795        return self.descr
796
797    def HFName(self):
798        return self.hfname
799
800    def DFilter(self):
801        return "ncp." + self.abbrev
802
803    def WiresharkFType(self):
804        return self.ftype
805
806    def Display(self, newval=None):
807        if newval is not None:
808            self.disp = newval
809        return self.disp
810
811    def ValuesName(self):
812        if self.custom_func:
813            return "CF_FUNC(" + self.custom_func + ")"
814        else:
815            return "NULL"
816
817    def Mask(self):
818        return 0
819
820    def Endianness(self):
821        return self.endianness
822
823    def SubVariables(self):
824        return []
825
826    def PTVCName(self):
827        return "NULL"
828
829    def NWDate(self):
830        self.disp = "BASE_CUSTOM"
831        self.custom_func = "padd_date"
832
833    def NWTime(self):
834        self.disp = "BASE_CUSTOM"
835        self.custom_func = "padd_time"
836
837    #def __cmp__(self, other):
838    #    return cmp(self.hfname, other.hfname)
839
840    def __lt__(self, other):
841        return (self.hfname < other.hfname)
842
843class struct(PTVC, Type):
844    def __init__(self, name, items, descr=None):
845        name = "struct_%s" % (name,)
846        NamedList.__init__(self, name, [])
847
848        self.bytes = 0
849        self.descr = descr
850        for item in items:
851            if isinstance(item, Type):
852                field = item
853                length = field.Length()
854                endianness = field.Endianness()
855                var = NO_VAR
856                repeat = NO_REPEAT
857                req_cond = NO_REQ_COND
858            elif type(item) == type([]):
859                field = item[REC_FIELD]
860                length = item[REC_LENGTH]
861                endianness = item[REC_ENDIANNESS]
862                var = item[REC_VAR]
863                repeat = item[REC_REPEAT]
864                req_cond = item[REC_REQ_COND]
865            else:
866                assert 0, "Item %s item not handled." % (item,)
867
868            ptvc_rec = PTVCRecord(field, length, endianness, var,
869                    repeat, req_cond, None, 0)
870            self.list.append(ptvc_rec)
871            self.bytes = self.bytes + field.Length()
872
873        self.hfname = self.name
874
875    def Variables(self):
876        vars = []
877        for ptvc_rec in self.list:
878            vars.append(ptvc_rec.Field())
879        return vars
880
881    def ReferenceString(self, var, repeat, req_cond):
882        return "{ PTVC_STRUCT, NO_LENGTH, &%s, NULL, NO_ENDIANNESS, %s, %s, %s }" % \
883                (self.name, var, repeat, req_cond)
884
885    def Code(self):
886        ett_name = self.ETTName()
887        x = "static gint %s = -1;\n" % (ett_name,)
888        x = x + "static const ptvc_record ptvc_%s[] = {\n" % (self.name,)
889        for ptvc_rec in self.list:
890            x = x +  "    %s,\n" % (ptvc_rec.Code())
891        x = x + "    { NULL, NO_LENGTH, NULL, NULL, NO_ENDIANNESS, NO_VAR, NO_REPEAT, NO_REQ_COND }\n"
892        x = x + "};\n"
893
894        x = x + "static const sub_ptvc_record %s = {\n" % (self.name,)
895        x = x + "    &%s,\n" % (ett_name,)
896        if self.descr:
897            x = x + '    "%s",\n' % (self.descr,)
898        else:
899            x = x + "    NULL,\n"
900        x = x + "    ptvc_%s,\n" % (self.Name(),)
901        x = x + "};\n"
902        return x
903
904    def __cmp__(self, other):
905        return cmp(self.HFName(), other.HFName())
906
907
908class byte(Type):
909    type    = "byte"
910    ftype   = "FT_UINT8"
911    def __init__(self, abbrev, descr):
912        Type.__init__(self, abbrev, descr, 1)
913
914class CountingNumber:
915    pass
916
917# Same as above. Both are provided for convenience
918class uint8(Type, CountingNumber):
919    type    = "uint8"
920    ftype   = "FT_UINT8"
921    bytes   = 1
922    def __init__(self, abbrev, descr):
923        Type.__init__(self, abbrev, descr, 1)
924
925class uint16(Type, CountingNumber):
926    type    = "uint16"
927    ftype   = "FT_UINT16"
928    def __init__(self, abbrev, descr, endianness = ENC_LITTLE_ENDIAN):
929        Type.__init__(self, abbrev, descr, 2, endianness)
930
931class uint24(Type, CountingNumber):
932    type    = "uint24"
933    ftype   = "FT_UINT24"
934    def __init__(self, abbrev, descr, endianness = ENC_LITTLE_ENDIAN):
935        Type.__init__(self, abbrev, descr, 3, endianness)
936
937class uint32(Type, CountingNumber):
938    type    = "uint32"
939    ftype   = "FT_UINT32"
940    def __init__(self, abbrev, descr, endianness = ENC_LITTLE_ENDIAN):
941        Type.__init__(self, abbrev, descr, 4, endianness)
942
943class uint64(Type, CountingNumber):
944    type    = "uint64"
945    ftype   = "FT_UINT64"
946    def __init__(self, abbrev, descr, endianness = ENC_LITTLE_ENDIAN):
947        Type.__init__(self, abbrev, descr, 8, endianness)
948
949class eptime(Type, CountingNumber):
950    type    = "eptime"
951    ftype   = "FT_ABSOLUTE_TIME"
952    disp    = "ABSOLUTE_TIME_LOCAL"
953    def __init__(self, abbrev, descr, endianness = ENC_LITTLE_ENDIAN):
954        Type.__init__(self, abbrev, descr, 4, endianness)
955
956class boolean8(uint8):
957    type    = "boolean8"
958    ftype   = "FT_BOOLEAN"
959    disp    = "BASE_NONE"
960
961class boolean16(uint16):
962    type    = "boolean16"
963    ftype   = "FT_BOOLEAN"
964    disp    = "BASE_NONE"
965
966class boolean24(uint24):
967    type    = "boolean24"
968    ftype   = "FT_BOOLEAN"
969    disp    = "BASE_NONE"
970
971class boolean32(uint32):
972    type    = "boolean32"
973    ftype   = "FT_BOOLEAN"
974    disp    = "BASE_NONE"
975
976class nstring:
977    pass
978
979class nstring8(Type, nstring):
980    """A string of up to (2^8)-1 characters. The first byte
981    gives the string length."""
982
983    type    = "nstring8"
984    ftype   = "FT_UINT_STRING"
985    disp    = "BASE_NONE"
986    def __init__(self, abbrev, descr):
987        Type.__init__(self, abbrev, descr, 1)
988
989class nstring16(Type, nstring):
990    """A string of up to (2^16)-2 characters. The first 2 bytes
991    gives the string length."""
992
993    type    = "nstring16"
994    ftype   = "FT_UINT_STRING"
995    disp    = "BASE_NONE"
996    def __init__(self, abbrev, descr, endianness = ENC_LITTLE_ENDIAN):
997        Type.__init__(self, abbrev, descr, 2, endianness)
998
999class nstring32(Type, nstring):
1000    """A string of up to (2^32)-4 characters. The first 4 bytes
1001    gives the string length."""
1002
1003    type    = "nstring32"
1004    ftype   = "FT_UINT_STRING"
1005    disp    = "BASE_NONE"
1006    def __init__(self, abbrev, descr, endianness = ENC_LITTLE_ENDIAN):
1007        Type.__init__(self, abbrev, descr, 4, endianness)
1008
1009class fw_string(Type):
1010    """A fixed-width string of n bytes."""
1011
1012    type    = "fw_string"
1013    disp    = "BASE_NONE"
1014    ftype   = "FT_STRING"
1015
1016    def __init__(self, abbrev, descr, bytes):
1017        Type.__init__(self, abbrev, descr, bytes)
1018
1019
1020class stringz(Type):
1021    "NUL-terminated string, with a maximum length"
1022
1023    type    = "stringz"
1024    disp    = "BASE_NONE"
1025    ftype   = "FT_STRINGZ"
1026    def __init__(self, abbrev, descr):
1027        Type.__init__(self, abbrev, descr, PROTO_LENGTH_UNKNOWN)
1028
1029class val_string(Type):
1030    """Abstract class for val_stringN, where N is number
1031    of bits that key takes up."""
1032
1033    type    = "val_string"
1034    disp    = 'BASE_HEX'
1035
1036    def __init__(self, abbrev, descr, val_string_array, endianness = ENC_LITTLE_ENDIAN):
1037        Type.__init__(self, abbrev, descr, self.bytes, endianness)
1038        self.values = val_string_array
1039
1040    def Code(self):
1041        result = "static const value_string %s[] = {\n" \
1042                        % (self.ValuesCName())
1043        for val_record in self.values:
1044            value   = val_record[0]
1045            text    = val_record[1]
1046            value_repr = self.value_format % value
1047            result = result + '    { %s, "%s" },\n' \
1048                            % (value_repr, text)
1049
1050        value_repr = self.value_format % 0
1051        result = result + "    { %s, NULL },\n" % (value_repr)
1052        result = result + "};\n"
1053        REC_VAL_STRING_RES = self.value_format % value
1054        return result
1055
1056    def ValuesCName(self):
1057        return "ncp_%s_vals" % (self.abbrev)
1058
1059    def ValuesName(self):
1060        return "VALS(%s)" % (self.ValuesCName())
1061
1062class val_string8(val_string):
1063    type            = "val_string8"
1064    ftype           = "FT_UINT8"
1065    bytes           = 1
1066    value_format    = "0x%02x"
1067
1068class val_string16(val_string):
1069    type            = "val_string16"
1070    ftype           = "FT_UINT16"
1071    bytes           = 2
1072    value_format    = "0x%04x"
1073
1074class val_string32(val_string):
1075    type            = "val_string32"
1076    ftype           = "FT_UINT32"
1077    bytes           = 4
1078    value_format    = "0x%08x"
1079
1080class bytes(Type):
1081    type    = 'bytes'
1082    disp    = "BASE_NONE"
1083    ftype   = 'FT_BYTES'
1084
1085    def __init__(self, abbrev, descr, bytes):
1086        Type.__init__(self, abbrev, descr, bytes, NA)
1087
1088class nbytes:
1089    pass
1090
1091class nbytes8(Type, nbytes):
1092    """A series of up to (2^8)-1 bytes. The first byte
1093    gives the byte-string length."""
1094
1095    type    = "nbytes8"
1096    ftype   = "FT_UINT_BYTES"
1097    disp    = "BASE_NONE"
1098    def __init__(self, abbrev, descr, endianness = ENC_LITTLE_ENDIAN):
1099        Type.__init__(self, abbrev, descr, 1, endianness)
1100
1101class nbytes16(Type, nbytes):
1102    """A series of up to (2^16)-2 bytes. The first 2 bytes
1103    gives the byte-string length."""
1104
1105    type    = "nbytes16"
1106    ftype   = "FT_UINT_BYTES"
1107    disp    = "BASE_NONE"
1108    def __init__(self, abbrev, descr, endianness = ENC_LITTLE_ENDIAN):
1109        Type.__init__(self, abbrev, descr, 2, endianness)
1110
1111class nbytes32(Type, nbytes):
1112    """A series of up to (2^32)-4 bytes. The first 4 bytes
1113    gives the byte-string length."""
1114
1115    type    = "nbytes32"
1116    ftype   = "FT_UINT_BYTES"
1117    disp    = "BASE_NONE"
1118    def __init__(self, abbrev, descr, endianness = ENC_LITTLE_ENDIAN):
1119        Type.__init__(self, abbrev, descr, 4, endianness)
1120
1121class bf_uint(Type):
1122    type    = "bf_uint"
1123    disp    = None
1124
1125    def __init__(self, bitmask, abbrev, descr, endianness=ENC_LITTLE_ENDIAN):
1126        Type.__init__(self, abbrev, descr, self.bytes, endianness)
1127        self.bitmask = bitmask
1128
1129    def Mask(self):
1130        return self.bitmask
1131
1132class bf_val_str(bf_uint):
1133    type    = "bf_uint"
1134    disp    = None
1135
1136    def __init__(self, bitmask, abbrev, descr, val_string_array, endiannes=ENC_LITTLE_ENDIAN):
1137        bf_uint.__init__(self, bitmask, abbrev, descr, endiannes)
1138        self.values = val_string_array
1139
1140    def ValuesName(self):
1141        return "VALS(%s)" % (self.ValuesCName())
1142
1143class bf_val_str8(bf_val_str, val_string8):
1144    type    = "bf_val_str8"
1145    ftype   = "FT_UINT8"
1146    disp    = "BASE_HEX"
1147    bytes   = 1
1148
1149class bf_val_str16(bf_val_str, val_string16):
1150    type    = "bf_val_str16"
1151    ftype   = "FT_UINT16"
1152    disp    = "BASE_HEX"
1153    bytes   = 2
1154
1155class bf_val_str32(bf_val_str, val_string32):
1156    type    = "bf_val_str32"
1157    ftype   = "FT_UINT32"
1158    disp    = "BASE_HEX"
1159    bytes   = 4
1160
1161class bf_boolean:
1162    disp    = "BASE_NONE"
1163
1164class bf_boolean8(bf_uint, boolean8, bf_boolean):
1165    type    = "bf_boolean8"
1166    ftype   = "FT_BOOLEAN"
1167    disp    = "8"
1168    bytes   = 1
1169
1170class bf_boolean16(bf_uint, boolean16, bf_boolean):
1171    type    = "bf_boolean16"
1172    ftype   = "FT_BOOLEAN"
1173    disp    = "16"
1174    bytes   = 2
1175
1176class bf_boolean24(bf_uint, boolean24, bf_boolean):
1177    type    = "bf_boolean24"
1178    ftype   = "FT_BOOLEAN"
1179    disp    = "24"
1180    bytes   = 3
1181
1182class bf_boolean32(bf_uint, boolean32, bf_boolean):
1183    type    = "bf_boolean32"
1184    ftype   = "FT_BOOLEAN"
1185    disp    = "32"
1186    bytes   = 4
1187
1188class bitfield(Type):
1189    type    = "bitfield"
1190    disp    = 'BASE_HEX'
1191
1192    def __init__(self, vars):
1193        var_hash = {}
1194        for var in vars:
1195            if isinstance(var, bf_boolean):
1196                if not isinstance(var, self.bf_type):
1197                    print("%s must be of type %s" % \
1198                            (var.Abbreviation(),
1199                            self.bf_type))
1200                    sys.exit(1)
1201            var_hash[var.bitmask] = var
1202
1203        bitmasks = list(var_hash.keys())
1204        bitmasks.sort()
1205        bitmasks.reverse()
1206
1207        ordered_vars = []
1208        for bitmask in bitmasks:
1209            var = var_hash[bitmask]
1210            ordered_vars.append(var)
1211
1212        self.vars = ordered_vars
1213        self.ptvcname = "ncp_%s_bitfield" % (self.abbrev,)
1214        self.hfname = "hf_ncp_%s" % (self.abbrev,)
1215        self.sub_ptvc = PTVCBitfield(self.PTVCName(), self.vars)
1216
1217    def SubVariables(self):
1218        return self.vars
1219
1220    def SubVariablesPTVC(self):
1221        return self.sub_ptvc
1222
1223    def PTVCName(self):
1224        return self.ptvcname
1225
1226
1227class bitfield8(bitfield, uint8):
1228    type    = "bitfield8"
1229    ftype   = "FT_UINT8"
1230    bf_type = bf_boolean8
1231
1232    def __init__(self, abbrev, descr, vars):
1233        uint8.__init__(self, abbrev, descr)
1234        bitfield.__init__(self, vars)
1235
1236class bitfield16(bitfield, uint16):
1237    type    = "bitfield16"
1238    ftype   = "FT_UINT16"
1239    bf_type = bf_boolean16
1240
1241    def __init__(self, abbrev, descr, vars, endianness=ENC_LITTLE_ENDIAN):
1242        uint16.__init__(self, abbrev, descr, endianness)
1243        bitfield.__init__(self, vars)
1244
1245class bitfield24(bitfield, uint24):
1246    type    = "bitfield24"
1247    ftype   = "FT_UINT24"
1248    bf_type = bf_boolean24
1249
1250    def __init__(self, abbrev, descr, vars, endianness=ENC_LITTLE_ENDIAN):
1251        uint24.__init__(self, abbrev, descr, endianness)
1252        bitfield.__init__(self, vars)
1253
1254class bitfield32(bitfield, uint32):
1255    type    = "bitfield32"
1256    ftype   = "FT_UINT32"
1257    bf_type = bf_boolean32
1258
1259    def __init__(self, abbrev, descr, vars, endianness=ENC_LITTLE_ENDIAN):
1260        uint32.__init__(self, abbrev, descr, endianness)
1261        bitfield.__init__(self, vars)
1262
1263#
1264# Force the endianness of a field to a non-default value; used in
1265# the list of fields of a structure.
1266#
1267def endian(field, endianness):
1268    return [-1, field.Length(), field, endianness, NO_VAR, NO_REPEAT, NO_REQ_COND]
1269
1270##############################################################################
1271# NCP Field Types. Defined in Appendix A of "Programmer's Guide..."
1272##############################################################################
1273
1274AbortQueueFlag                  = val_string8("abort_q_flag", "Abort Queue Flag", [
1275        [ 0x00, "Place at End of Queue" ],
1276        [ 0x01, "Do Not Place Spool File, Examine Flags" ],
1277])
1278AcceptedMaxSize                 = uint16("accepted_max_size", "Accepted Max Size")
1279AcceptedMaxSize64               = uint64("accepted_max_size64", "Accepted Max Size")
1280AccessControl                   = val_string8("access_control", "Access Control", [
1281        [ 0x00, "Open for read by this client" ],
1282        [ 0x01, "Open for write by this client" ],
1283        [ 0x02, "Deny read requests from other stations" ],
1284        [ 0x03, "Deny write requests from other stations" ],
1285        [ 0x04, "File detached" ],
1286        [ 0x05, "TTS holding detach" ],
1287        [ 0x06, "TTS holding open" ],
1288])
1289AccessDate                      = uint16("access_date", "Access Date")
1290AccessDate.NWDate()
1291AccessMode                      = bitfield8("access_mode", "Access Mode", [
1292        bf_boolean8(0x01, "acc_mode_read", "Read Access"),
1293        bf_boolean8(0x02, "acc_mode_write", "Write Access"),
1294        bf_boolean8(0x04, "acc_mode_deny_read", "Deny Read Access"),
1295        bf_boolean8(0x08, "acc_mode_deny_write", "Deny Write Access"),
1296        bf_boolean8(0x10, "acc_mode_comp", "Compatibility Mode"),
1297])
1298AccessPrivileges                = bitfield8("access_privileges", "Access Privileges", [
1299        bf_boolean8(0x01, "acc_priv_read", "Read Privileges (files only)"),
1300        bf_boolean8(0x02, "acc_priv_write", "Write Privileges (files only)"),
1301        bf_boolean8(0x04, "acc_priv_open", "Open Privileges (files only)"),
1302        bf_boolean8(0x08, "acc_priv_create", "Create Privileges (files only)"),
1303        bf_boolean8(0x10, "acc_priv_delete", "Delete Privileges (files only)"),
1304        bf_boolean8(0x20, "acc_priv_parent", "Parental Privileges (directories only for creating, deleting, and renaming)"),
1305        bf_boolean8(0x40, "acc_priv_search", "Search Privileges (directories only)"),
1306        bf_boolean8(0x80, "acc_priv_modify", "Modify File Status Flags Privileges (files and directories)"),
1307])
1308AccessRightsMask                = bitfield8("access_rights_mask", "Access Rights", [
1309        bf_boolean8(0x0001, "acc_rights_read", "Read Rights"),
1310        bf_boolean8(0x0002, "acc_rights_write", "Write Rights"),
1311        bf_boolean8(0x0004, "acc_rights_open", "Open Rights"),
1312        bf_boolean8(0x0008, "acc_rights_create", "Create Rights"),
1313        bf_boolean8(0x0010, "acc_rights_delete", "Delete Rights"),
1314        bf_boolean8(0x0020, "acc_rights_parent", "Parental Rights"),
1315        bf_boolean8(0x0040, "acc_rights_search", "Search Rights"),
1316        bf_boolean8(0x0080, "acc_rights_modify", "Modify Rights"),
1317])
1318AccessRightsMaskWord            = bitfield16("access_rights_mask_word", "Access Rights", [
1319        bf_boolean16(0x0001, "acc_rights1_read", "Read Rights"),
1320        bf_boolean16(0x0002, "acc_rights1_write", "Write Rights"),
1321        bf_boolean16(0x0004, "acc_rights1_open", "Open Rights"),
1322        bf_boolean16(0x0008, "acc_rights1_create", "Create Rights"),
1323        bf_boolean16(0x0010, "acc_rights1_delete", "Delete Rights"),
1324        bf_boolean16(0x0020, "acc_rights1_parent", "Parental Rights"),
1325        bf_boolean16(0x0040, "acc_rights1_search", "Search Rights"),
1326        bf_boolean16(0x0080, "acc_rights1_modify", "Modify Rights"),
1327        bf_boolean16(0x0100, "acc_rights1_supervisor", "Supervisor Access Rights"),
1328])
1329AccountBalance                  = uint32("account_balance", "Account Balance")
1330AccountVersion                  = uint8("acct_version", "Acct Version")
1331ActionFlag                      = bitfield8("action_flag", "Action Flag", [
1332        bf_boolean8(0x01, "act_flag_open", "Open"),
1333        bf_boolean8(0x02, "act_flag_replace", "Replace"),
1334        bf_boolean8(0x10, "act_flag_create", "Create"),
1335])
1336ActiveConnBitList               = fw_string("active_conn_bit_list", "Active Connection List", 512)
1337ActiveIndexedFiles              = uint16("active_indexed_files", "Active Indexed Files")
1338ActualMaxBinderyObjects         = uint16("actual_max_bindery_objects", "Actual Max Bindery Objects")
1339ActualMaxIndexedFiles           = uint16("actual_max_indexed_files", "Actual Max Indexed Files")
1340ActualMaxOpenFiles              = uint16("actual_max_open_files", "Actual Max Open Files")
1341ActualMaxSimultaneousTransactions = uint16("actual_max_sim_trans", "Actual Max Simultaneous Transactions")
1342ActualMaxUsedDirectoryEntries   = uint16("actual_max_used_directory_entries", "Actual Max Used Directory Entries")
1343ActualMaxUsedRoutingBuffers     = uint16("actual_max_used_routing_buffers", "Actual Max Used Routing Buffers")
1344ActualResponseCount             = uint16("actual_response_count", "Actual Response Count")
1345AddNameSpaceAndVol              = stringz("add_nm_spc_and_vol", "Add Name Space and Volume")
1346AFPEntryID                      = uint32("afp_entry_id", "AFP Entry ID", ENC_BIG_ENDIAN)
1347AFPEntryID.Display("BASE_HEX")
1348AllocAvailByte                  = uint32("alloc_avail_byte", "Bytes Available for Allocation")
1349AllocateMode                    = bitfield16("alloc_mode", "Allocate Mode", [
1350    bf_val_str16(0x0001, "alloc_dir_hdl", "Dir Handle Type",[
1351            [0x00, "Permanent"],
1352            [0x01, "Temporary"],
1353    ]),
1354    bf_boolean16(0x0002, "alloc_spec_temp_dir_hdl","Special Temporary Directory Handle"),
1355    bf_boolean16(0x4000, "alloc_reply_lvl2","Reply Level 2"),
1356    bf_boolean16(0x8000, "alloc_dst_name_spc","Destination Name Space Input Parameter"),
1357])
1358AllocationBlockSize             = uint32("allocation_block_size", "Allocation Block Size")
1359AllocFreeCount                  = uint32("alloc_free_count", "Reclaimable Free Bytes")
1360ApplicationNumber               = uint16("application_number", "Application Number")
1361ArchivedTime                    = uint16("archived_time", "Archived Time")
1362ArchivedTime.NWTime()
1363ArchivedDate                    = uint16("archived_date", "Archived Date")
1364ArchivedDate.NWDate()
1365ArchiverID                      = uint32("archiver_id", "Archiver ID", ENC_BIG_ENDIAN)
1366ArchiverID.Display("BASE_HEX")
1367AssociatedNameSpace             = uint8("associated_name_space", "Associated Name Space")
1368AttachDuringProcessing          = uint16("attach_during_processing", "Attach During Processing")
1369AttachedIndexedFiles            = uint8("attached_indexed_files", "Attached Indexed Files")
1370AttachWhileProcessingAttach     = uint16("attach_while_processing_attach", "Attach While Processing Attach")
1371Attributes                      = uint32("attributes", "Attributes")
1372AttributesDef                   = bitfield8("attr_def", "Attributes", [
1373        bf_boolean8(0x01, "att_def_ro", "Read Only"),
1374        bf_boolean8(0x02, "att_def_hidden", "Hidden"),
1375        bf_boolean8(0x04, "att_def_system", "System"),
1376        bf_boolean8(0x08, "att_def_execute", "Execute"),
1377        bf_boolean8(0x10, "att_def_sub_only", "Subdirectory"),
1378        bf_boolean8(0x20, "att_def_archive", "Archive"),
1379        bf_boolean8(0x80, "att_def_shareable", "Shareable"),
1380])
1381AttributesDef16                 = bitfield16("attr_def_16", "Attributes", [
1382        bf_boolean16(0x0001, "att_def16_ro", "Read Only"),
1383        bf_boolean16(0x0002, "att_def16_hidden", "Hidden"),
1384        bf_boolean16(0x0004, "att_def16_system", "System"),
1385        bf_boolean16(0x0008, "att_def16_execute", "Execute"),
1386        bf_boolean16(0x0010, "att_def16_sub_only", "Subdirectory"),
1387        bf_boolean16(0x0020, "att_def16_archive", "Archive"),
1388        bf_boolean16(0x0080, "att_def16_shareable", "Shareable"),
1389        bf_boolean16(0x1000, "att_def16_transaction", "Transactional"),
1390        bf_boolean16(0x4000, "att_def16_read_audit", "Read Audit"),
1391        bf_boolean16(0x8000, "att_def16_write_audit", "Write Audit"),
1392])
1393AttributesDef32                 = bitfield32("attr_def_32", "Attributes", [
1394        bf_boolean32(0x00000001, "att_def32_ro", "Read Only"),
1395        bf_boolean32(0x00000002, "att_def32_hidden", "Hidden"),
1396        bf_boolean32(0x00000004, "att_def32_system", "System"),
1397        bf_boolean32(0x00000008, "att_def32_execute", "Execute"),
1398        bf_boolean32(0x00000010, "att_def32_sub_only", "Subdirectory"),
1399        bf_boolean32(0x00000020, "att_def32_archive", "Archive"),
1400        bf_boolean32(0x00000040, "att_def32_execute_confirm", "Execute Confirm"),
1401        bf_boolean32(0x00000080, "att_def32_shareable", "Shareable"),
1402        bf_val_str32(0x00000700, "att_def32_search", "Search Mode",[
1403            [0, "Search on all Read Only Opens"],
1404            [1, "Search on Read Only Opens with no Path"],
1405            [2, "Shell Default Search Mode"],
1406            [3, "Search on all Opens with no Path"],
1407            [4, "Do not Search"],
1408            [5, "Reserved - Do not Use"],
1409            [6, "Search on All Opens"],
1410            [7, "Reserved - Do not Use"],
1411    ]),
1412        bf_boolean32(0x00000800, "att_def32_no_suballoc", "No Suballoc"),
1413        bf_boolean32(0x00001000, "att_def32_transaction", "Transactional"),
1414        bf_boolean32(0x00004000, "att_def32_read_audit", "Read Audit"),
1415        bf_boolean32(0x00008000, "att_def32_write_audit", "Write Audit"),
1416        bf_boolean32(0x00010000, "att_def32_purge", "Immediate Purge"),
1417        bf_boolean32(0x00020000, "att_def32_reninhibit", "Rename Inhibit"),
1418        bf_boolean32(0x00040000, "att_def32_delinhibit", "Delete Inhibit"),
1419        bf_boolean32(0x00080000, "att_def32_cpyinhibit", "Copy Inhibit"),
1420        bf_boolean32(0x00100000, "att_def32_file_audit", "File Audit"),
1421        bf_boolean32(0x00200000, "att_def32_reserved", "Reserved"),
1422        bf_boolean32(0x00400000, "att_def32_data_migrate", "Data Migrated"),
1423        bf_boolean32(0x00800000, "att_def32_inhibit_dm", "Inhibit Data Migration"),
1424        bf_boolean32(0x01000000, "att_def32_dm_save_key", "Data Migration Save Key"),
1425        bf_boolean32(0x02000000, "att_def32_im_comp", "Immediate Compress"),
1426        bf_boolean32(0x04000000, "att_def32_comp", "Compressed"),
1427        bf_boolean32(0x08000000, "att_def32_comp_inhibit", "Inhibit Compression"),
1428        bf_boolean32(0x10000000, "att_def32_reserved2", "Reserved"),
1429        bf_boolean32(0x20000000, "att_def32_cant_compress", "Can't Compress"),
1430        bf_boolean32(0x40000000, "att_def32_attr_archive", "Archive Attributes"),
1431        bf_boolean32(0x80000000, "att_def32_reserved3", "Reserved"),
1432])
1433AttributeValidFlag              = uint32("attribute_valid_flag", "Attribute Valid Flag")
1434AuditFileVersionDate            = uint16("audit_file_ver_date", "Audit File Version Date")
1435AuditFileVersionDate.NWDate()
1436AuditFlag                       = val_string8("audit_flag", "Audit Flag", [
1437        [ 0x00, "Do NOT audit object" ],
1438        [ 0x01, "Audit object" ],
1439])
1440AuditHandle                     = uint32("audit_handle", "Audit File Handle")
1441AuditHandle.Display("BASE_HEX")
1442AuditID                         = uint32("audit_id", "Audit ID", ENC_BIG_ENDIAN)
1443AuditID.Display("BASE_HEX")
1444AuditIDType                     = val_string16("audit_id_type", "Audit ID Type", [
1445        [ 0x0000, "Volume" ],
1446        [ 0x0001, "Container" ],
1447])
1448AuditVersionDate                = uint16("audit_ver_date", "Auditing Version Date")
1449AuditVersionDate.NWDate()
1450AvailableBlocks                 = uint32("available_blocks", "Available Blocks")
1451AvailableBlocks64               = uint64("available_blocks64", "Available Blocks")
1452AvailableClusters               = uint16("available_clusters", "Available Clusters")
1453AvailableDirectorySlots         = uint16("available_directory_slots", "Available Directory Slots")
1454AvailableDirEntries             = uint32("available_dir_entries", "Available Directory Entries")
1455AvailableDirEntries64           = uint64("available_dir_entries64", "Available Directory Entries")
1456AvailableIndexedFiles           = uint16("available_indexed_files", "Available Indexed Files")
1457
1458BackgroundAgedWrites            = uint32("background_aged_writes", "Background Aged Writes")
1459BackgroundDirtyWrites           = uint32("background_dirty_writes", "Background Dirty Writes")
1460BadLogicalConnectionCount       = uint16("bad_logical_connection_count", "Bad Logical Connection Count")
1461BannerName                      = fw_string("banner_name", "Banner Name", 14)
1462BaseDirectoryID                 = uint32("base_directory_id", "Base Directory ID", ENC_BIG_ENDIAN)
1463BaseDirectoryID.Display("BASE_HEX")
1464binderyContext                  = nstring8("bindery_context", "Bindery Context")
1465BitMap                          = bytes("bit_map", "Bit Map", 512)
1466BlockNumber                     = uint32("block_number", "Block Number")
1467BlockSize                       = uint16("block_size", "Block Size")
1468BlockSizeInSectors              = uint32("block_size_in_sectors", "Block Size in Sectors")
1469BoardInstalled                  = uint8("board_installed", "Board Installed")
1470BoardNumber                     = uint32("board_number", "Board Number")
1471BoardNumbers                    = uint32("board_numbers", "Board Numbers")
1472BufferSize                      = uint16("buffer_size", "Buffer Size")
1473BusString                       = stringz("bus_string", "Bus String")
1474BusType                         = val_string8("bus_type", "Bus Type", [
1475        [0x00, "ISA"],
1476        [0x01, "Micro Channel" ],
1477        [0x02, "EISA"],
1478        [0x04, "PCI"],
1479        [0x08, "PCMCIA"],
1480        [0x10, "ISA"],
1481        [0x14, "ISA/PCI"],
1482])
1483BytesActuallyTransferred        = uint32("bytes_actually_transferred", "Bytes Actually Transferred")
1484BytesActuallyTransferred64bit   = uint64("bytes_actually_transferred_64", "Bytes Actually Transferred", ENC_LITTLE_ENDIAN)
1485BytesActuallyTransferred64bit.Display("BASE_DEC")
1486BytesRead                       = fw_string("bytes_read", "Bytes Read", 6)
1487BytesToCopy                     = uint32("bytes_to_copy", "Bytes to Copy")
1488BytesToCopy64bit                = uint64("bytes_to_copy_64", "Bytes to Copy")
1489BytesToCopy64bit.Display("BASE_DEC")
1490BytesWritten                    = fw_string("bytes_written", "Bytes Written", 6)
1491
1492CacheAllocations                = uint32("cache_allocations", "Cache Allocations")
1493CacheBlockScrapped              = uint16("cache_block_scrapped", "Cache Block Scrapped")
1494CacheBufferCount                = uint16("cache_buffer_count", "Cache Buffer Count")
1495CacheBufferSize                 = uint16("cache_buffer_size", "Cache Buffer Size")
1496CacheFullWriteRequests          = uint32("cache_full_write_requests", "Cache Full Write Requests")
1497CacheGetRequests                = uint32("cache_get_requests", "Cache Get Requests")
1498CacheHitOnUnavailableBlock      = uint16("cache_hit_on_unavailable_block", "Cache Hit On Unavailable Block")
1499CacheHits                       = uint32("cache_hits", "Cache Hits")
1500CacheMisses                     = uint32("cache_misses", "Cache Misses")
1501CachePartialWriteRequests       = uint32("cache_partial_write_requests", "Cache Partial Write Requests")
1502CacheReadRequests               = uint32("cache_read_requests", "Cache Read Requests")
1503CacheWriteRequests              = uint32("cache_write_requests", "Cache Write Requests")
1504CategoryName                    = stringz("category_name", "Category Name")
1505CCFileHandle                    = uint32("cc_file_handle", "File Handle")
1506CCFileHandle.Display("BASE_HEX")
1507CCFunction                      = val_string8("cc_function", "OP-Lock Flag", [
1508        [ 0x01, "Clear OP-Lock" ],
1509        [ 0x02, "Acknowledge Callback" ],
1510        [ 0x03, "Decline Callback" ],
1511        [ 0x04, "Level 2" ],
1512])
1513ChangeBits                      = bitfield16("change_bits", "Change Bits", [
1514        bf_boolean16(0x0001, "change_bits_modify", "Modify Name"),
1515        bf_boolean16(0x0002, "change_bits_fatt", "File Attributes"),
1516        bf_boolean16(0x0004, "change_bits_cdate", "Creation Date"),
1517        bf_boolean16(0x0008, "change_bits_ctime", "Creation Time"),
1518        bf_boolean16(0x0010, "change_bits_owner", "Owner ID"),
1519        bf_boolean16(0x0020, "change_bits_adate", "Archive Date"),
1520        bf_boolean16(0x0040, "change_bits_atime", "Archive Time"),
1521        bf_boolean16(0x0080, "change_bits_aid", "Archiver ID"),
1522        bf_boolean16(0x0100, "change_bits_udate", "Update Date"),
1523        bf_boolean16(0x0200, "change_bits_utime", "Update Time"),
1524        bf_boolean16(0x0400, "change_bits_uid", "Update ID"),
1525        bf_boolean16(0x0800, "change_bits_acc_date", "Access Date"),
1526        bf_boolean16(0x1000, "change_bits_max_acc_mask", "Maximum Access Mask"),
1527        bf_boolean16(0x2000, "change_bits_max_space", "Maximum Space"),
1528])
1529ChannelState                    = val_string8("channel_state", "Channel State", [
1530        [ 0x00, "Channel is running" ],
1531        [ 0x01, "Channel is stopping" ],
1532        [ 0x02, "Channel is stopped" ],
1533        [ 0x03, "Channel is not functional" ],
1534])
1535ChannelSynchronizationState     = val_string8("channel_synchronization_state", "Channel Synchronization State", [
1536        [ 0x00, "Channel is not being used" ],
1537        [ 0x02, "NetWare is using the channel; no one else wants it" ],
1538        [ 0x04, "NetWare is using the channel; someone else wants it" ],
1539        [ 0x06, "Someone else is using the channel; NetWare does not need it" ],
1540        [ 0x08, "Someone else is using the channel; NetWare needs it" ],
1541        [ 0x0A, "Someone else has released the channel; NetWare should use it" ],
1542])
1543ChargeAmount                    = uint32("charge_amount", "Charge Amount")
1544ChargeInformation               = uint32("charge_information", "Charge Information")
1545ClientCompFlag                  = val_string16("client_comp_flag", "Completion Flag", [
1546        [ 0x0000, "Successful" ],
1547        [ 0x0001, "Illegal Station Number" ],
1548        [ 0x0002, "Client Not Logged In" ],
1549        [ 0x0003, "Client Not Accepting Messages" ],
1550        [ 0x0004, "Client Already has a Message" ],
1551        [ 0x0096, "No Alloc Space for the Message" ],
1552        [ 0x00fd, "Bad Station Number" ],
1553        [ 0x00ff, "Failure" ],
1554])
1555ClientIDNumber                  = uint32("client_id_number", "Client ID Number", ENC_BIG_ENDIAN)
1556ClientIDNumber.Display("BASE_HEX")
1557ClientList                      = uint32("client_list", "Client List")
1558ClientListCount                 = uint16("client_list_cnt", "Client List Count")
1559ClientListLen                   = uint8("client_list_len", "Client List Length")
1560ClientName                      = nstring8("client_name", "Client Name")
1561ClientRecordArea                = fw_string("client_record_area", "Client Record Area", 152)
1562ClientStation                   = uint8("client_station", "Client Station")
1563ClientStationLong               = uint32("client_station_long", "Client Station")
1564ClientTaskNumber                = uint8("client_task_number", "Client Task Number")
1565ClientTaskNumberLong            = uint32("client_task_number_long", "Client Task Number")
1566ClusterCount                    = uint16("cluster_count", "Cluster Count")
1567ClustersUsedByDirectories       = uint32("clusters_used_by_directories", "Clusters Used by Directories")
1568ClustersUsedByExtendedDirectories = uint32("clusters_used_by_extended_dirs", "Clusters Used by Extended Directories")
1569ClustersUsedByFAT               = uint32("clusters_used_by_fat", "Clusters Used by FAT")
1570CodePage                        = uint32("code_page", "Code Page")
1571ComCnts                         = uint16("com_cnts", "Communication Counters")
1572Comment                         = nstring8("comment", "Comment")
1573CommentType                     = uint16("comment_type", "Comment Type")
1574CompletionCode                  = uint32("ncompletion_code", "Completion Code")
1575CompressedDataStreamsCount      = uint32("compressed_data_streams_count", "Compressed Data Streams Count")
1576CompressedLimboDataStreamsCount = uint32("compressed_limbo_data_streams_count", "Compressed Limbo Data Streams Count")
1577CompressedSectors               = uint32("compressed_sectors", "Compressed Sectors")
1578compressionStage                = uint32("compression_stage", "Compression Stage")
1579compressVolume                  = uint32("compress_volume", "Volume Compression")
1580ConfigMajorVN                   = uint8("config_major_vn", "Configuration Major Version Number")
1581ConfigMinorVN                   = uint8("config_minor_vn", "Configuration Minor Version Number")
1582ConfigurationDescription        = fw_string("configuration_description", "Configuration Description", 80)
1583ConfigurationText               = fw_string("configuration_text", "Configuration Text", 160)
1584ConfiguredMaxBinderyObjects     = uint16("configured_max_bindery_objects", "Configured Max Bindery Objects")
1585ConfiguredMaxOpenFiles          = uint16("configured_max_open_files", "Configured Max Open Files")
1586ConfiguredMaxRoutingBuffers     = uint16("configured_max_routing_buffers", "Configured Max Routing Buffers")
1587ConfiguredMaxSimultaneousTransactions = uint16("cfg_max_simultaneous_transactions", "Configured Max Simultaneous Transactions")
1588ConnectedLAN                    = uint32("connected_lan", "LAN Adapter")
1589ConnectionControlBits           = bitfield8("conn_ctrl_bits", "Connection Control", [
1590        bf_boolean8(0x01, "enable_brdcasts", "Enable Broadcasts"),
1591        bf_boolean8(0x02, "enable_personal_brdcasts", "Enable Personal Broadcasts"),
1592        bf_boolean8(0x04, "enable_wdog_messages", "Enable Watchdog Message"),
1593        bf_boolean8(0x10, "disable_brdcasts", "Disable Broadcasts"),
1594        bf_boolean8(0x20, "disable_personal_brdcasts", "Disable Personal Broadcasts"),
1595        bf_boolean8(0x40, "disable_wdog_messages", "Disable Watchdog Message"),
1596])
1597ConnectionListCount             = uint32("conn_list_count", "Connection List Count")
1598ConnectionList                  = uint32("connection_list", "Connection List")
1599ConnectionNumber                = uint32("connection_number", "Connection Number", ENC_BIG_ENDIAN)
1600ConnectionNumberList            = nstring8("connection_number_list", "Connection Number List")
1601ConnectionNumberWord            = uint16("conn_number_word", "Connection Number")
1602ConnectionNumberByte            = uint8("conn_number_byte", "Connection Number")
1603ConnectionServiceType           = val_string8("connection_service_type","Connection Service Type",[
1604        [ 0x01, "CLIB backward Compatibility" ],
1605        [ 0x02, "NCP Connection" ],
1606        [ 0x03, "NLM Connection" ],
1607        [ 0x04, "AFP Connection" ],
1608        [ 0x05, "FTAM Connection" ],
1609        [ 0x06, "ANCP Connection" ],
1610        [ 0x07, "ACP Connection" ],
1611        [ 0x08, "SMB Connection" ],
1612        [ 0x09, "Winsock Connection" ],
1613])
1614ConnectionsInUse                = uint16("connections_in_use", "Connections In Use")
1615ConnectionsMaxUsed              = uint16("connections_max_used", "Connections Max Used")
1616ConnectionsSupportedMax         = uint16("connections_supported_max", "Connections Supported Max")
1617ConnectionType                  = val_string8("connection_type", "Connection Type", [
1618        [ 0x00, "Not in use" ],
1619        [ 0x02, "NCP" ],
1620        [ 0x0b, "UDP (for IP)" ],
1621])
1622ConnListLen                     = uint8("conn_list_len", "Connection List Length")
1623connList                        = uint32("conn_list", "Connection List")
1624ControlFlags                    = val_string8("control_flags", "Control Flags", [
1625        [ 0x00, "Forced Record Locking is Off" ],
1626        [ 0x01, "Forced Record Locking is On" ],
1627])
1628ControllerDriveNumber           = uint8("controller_drive_number", "Controller Drive Number")
1629ControllerNumber                = uint8("controller_number", "Controller Number")
1630ControllerType                  = uint8("controller_type", "Controller Type")
1631Cookie1                         = uint32("cookie_1", "Cookie 1")
1632Cookie2                         = uint32("cookie_2", "Cookie 2")
1633Copies                          = uint8( "copies", "Copies" )
1634CoprocessorFlag                 = uint32("co_processor_flag", "CoProcessor Present Flag")
1635CoProcessorString               = stringz("co_proc_string", "CoProcessor String")
1636CounterMask                     = val_string8("counter_mask", "Counter Mask", [
1637        [ 0x00, "Counter is Valid" ],
1638        [ 0x01, "Counter is not Valid" ],
1639])
1640CPUNumber                       = uint32("cpu_number", "CPU Number")
1641CPUString                       = stringz("cpu_string", "CPU String")
1642CPUType                         = val_string8("cpu_type", "CPU Type", [
1643        [ 0x00, "80386" ],
1644        [ 0x01, "80486" ],
1645        [ 0x02, "Pentium" ],
1646        [ 0x03, "Pentium Pro" ],
1647])
1648CreationDate                    = uint16("creation_date", "Creation Date")
1649CreationDate.NWDate()
1650CreationTime                    = uint16("creation_time", "Creation Time")
1651CreationTime.NWTime()
1652CreatorID                       = uint32("creator_id", "Creator ID", ENC_BIG_ENDIAN)
1653CreatorID.Display("BASE_HEX")
1654CreatorNameSpaceNumber          = val_string8("creator_name_space_number", "Creator Name Space Number", [
1655        [ 0x00, "DOS Name Space" ],
1656        [ 0x01, "MAC Name Space" ],
1657        [ 0x02, "NFS Name Space" ],
1658        [ 0x04, "Long Name Space" ],
1659])
1660CreditLimit                     = uint32("credit_limit", "Credit Limit")
1661CtrlFlags                       = val_string16("ctrl_flags", "Control Flags", [
1662        [ 0x0000, "Do Not Return File Name" ],
1663        [ 0x0001, "Return File Name" ],
1664])
1665curCompBlks                     = uint32("cur_comp_blks", "Current Compression Blocks")
1666curInitialBlks                  = uint32("cur_initial_blks", "Current Initial Blocks")
1667curIntermediateBlks             = uint32("cur_inter_blks", "Current Intermediate Blocks")
1668CurNumOfRTags                   = uint32("cur_num_of_r_tags", "Current Number of Resource Tags")
1669CurrentBlockBeingDecompressed   = uint32("cur_blk_being_dcompress", "Current Block Being Decompressed")
1670CurrentChangedFATs              = uint16("current_changed_fats", "Current Changed FAT Entries")
1671CurrentEntries                  = uint32("current_entries", "Current Entries")
1672CurrentFormType                 = uint8( "current_form_type", "Current Form Type" )
1673CurrentLFSCounters              = uint32("current_lfs_counters", "Current LFS Counters")
1674CurrentlyUsedRoutingBuffers     = uint16("currently_used_routing_buffers", "Currently Used Routing Buffers")
1675CurrentOpenFiles                = uint16("current_open_files", "Current Open Files")
1676CurrentReferenceID              = uint16("curr_ref_id", "Current Reference ID")
1677CurrentServers                  = uint32("current_servers", "Current Servers")
1678CurrentServerTime               = uint32("current_server_time", "Time Elapsed Since Server Was Brought Up")
1679CurrentSpace                    = uint32("current_space", "Current Space")
1680CurrentTransactionCount         = uint32("current_trans_count", "Current Transaction Count")
1681CurrentUsedBinderyObjects       = uint16("current_used_bindery_objects", "Current Used Bindery Objects")
1682CurrentUsedDynamicSpace         = uint32("current_used_dynamic_space", "Current Used Dynamic Space")
1683CustomCnts                      = uint32("custom_cnts", "Custom Counters")
1684CustomCount                     = uint32("custom_count", "Custom Count")
1685CustomCounters                  = uint32("custom_counters", "Custom Counters")
1686CustomString                    = nstring8("custom_string", "Custom String")
1687CustomVariableValue             = uint32("custom_var_value", "Custom Variable Value")
1688
1689Data                            = nstring8("data", "Data")
1690Data64                          = stringz("data64", "Data")
1691DataForkFirstFAT                = uint32("data_fork_first_fat", "Data Fork First FAT Entry")
1692DataForkLen                     = uint32("data_fork_len", "Data Fork Len")
1693DataForkSize                    = uint32("data_fork_size", "Data Fork Size")
1694DataSize                        = uint32("data_size", "Data Size")
1695DataStream                      = val_string8("data_stream", "Data Stream", [
1696        [ 0x00, "Resource Fork or DOS" ],
1697        [ 0x01, "Data Fork" ],
1698])
1699DataStreamFATBlocks             = uint32("data_stream_fat_blks", "Data Stream FAT Blocks")
1700DataStreamName                  = nstring8("data_stream_name", "Data Stream Name")
1701DataStreamNumber                = uint8("data_stream_number", "Data Stream Number")
1702DataStreamNumberLong            = uint32("data_stream_num_long", "Data Stream Number")
1703DataStreamsCount                = uint32("data_streams_count", "Data Streams Count")
1704DataStreamSize                  = uint32("data_stream_size", "Size")
1705DataStreamSize64                = uint64("data_stream_size_64", "Size")
1706DataStreamSpaceAlloc            = uint32( "data_stream_space_alloc", "Space Allocated for Data Stream" )
1707DataTypeFlag                    = val_string8("data_type_flag", "Data Type Flag", [
1708    [ 0x00, "ASCII Data" ],
1709    [ 0x01, "UTF8 Data" ],
1710])
1711Day                     = uint8("s_day", "Day")
1712DayOfWeek               = val_string8("s_day_of_week", "Day of Week", [
1713        [ 0x00, "Sunday" ],
1714        [ 0x01, "Monday" ],
1715        [ 0x02, "Tuesday" ],
1716        [ 0x03, "Wednesday" ],
1717        [ 0x04, "Thursday" ],
1718        [ 0x05, "Friday" ],
1719        [ 0x06, "Saturday" ],
1720])
1721DeadMirrorTable                 = bytes("dead_mirror_table", "Dead Mirror Table", 32)
1722DefinedDataStreams              = uint8("defined_data_streams", "Defined Data Streams")
1723DefinedNameSpaces               = uint8("defined_name_spaces", "Defined Name Spaces")
1724DeletedDate                     = uint16("deleted_date", "Deleted Date")
1725DeletedDate.NWDate()
1726DeletedFileTime                 = uint32( "deleted_file_time", "Deleted File Time")
1727DeletedFileTime.Display("BASE_HEX")
1728DeletedTime                     = uint16("deleted_time", "Deleted Time")
1729DeletedTime.NWTime()
1730DeletedID                       = uint32( "delete_id", "Deleted ID", ENC_BIG_ENDIAN)
1731DeletedID.Display("BASE_HEX")
1732DeleteExistingFileFlag          = val_string8("delete_existing_file_flag", "Delete Existing File Flag", [
1733        [ 0x00, "Do Not Delete Existing File" ],
1734        [ 0x01, "Delete Existing File" ],
1735])
1736DenyReadCount                   = uint16("deny_read_count", "Deny Read Count")
1737DenyWriteCount                  = uint16("deny_write_count", "Deny Write Count")
1738DescriptionStrings              = fw_string("description_string", "Description", 100)
1739DesiredAccessRights             = bitfield16("desired_access_rights", "Desired Access Rights", [
1740    bf_boolean16(0x0001, "dsired_acc_rights_read_o", "Read Only"),
1741        bf_boolean16(0x0002, "dsired_acc_rights_write_o", "Write Only"),
1742        bf_boolean16(0x0004, "dsired_acc_rights_deny_r", "Deny Read"),
1743        bf_boolean16(0x0008, "dsired_acc_rights_deny_w", "Deny Write"),
1744        bf_boolean16(0x0010, "dsired_acc_rights_compat", "Compatibility"),
1745        bf_boolean16(0x0040, "dsired_acc_rights_w_thru", "File Write Through"),
1746        bf_boolean16(0x0400, "dsired_acc_rights_del_file_cls", "Delete File Close"),
1747])
1748DesiredResponseCount            = uint16("desired_response_count", "Desired Response Count")
1749DestDirHandle                   = uint8("dest_dir_handle", "Destination Directory Handle")
1750DestNameSpace                   = val_string8("dest_name_space", "Destination Name Space", [
1751        [ 0x00, "DOS Name Space" ],
1752        [ 0x01, "MAC Name Space" ],
1753        [ 0x02, "NFS Name Space" ],
1754        [ 0x04, "Long Name Space" ],
1755])
1756DestPathComponentCount          = uint8("dest_component_count", "Destination Path Component Count")
1757DestPath                        = nstring8("dest_path", "Destination Path")
1758DestPath16                      = nstring16("dest_path_16", "Destination Path")
1759DetachDuringProcessing          = uint16("detach_during_processing", "Detach During Processing")
1760DetachForBadConnectionNumber    = uint16("detach_for_bad_connection_number", "Detach For Bad Connection Number")
1761DirHandle                       = uint8("dir_handle", "Directory Handle")
1762DirHandleName                   = uint8("dir_handle_name", "Handle Name")
1763DirHandleLong                   = uint32("dir_handle_long", "Directory Handle")
1764DirHandle64                     = uint64("dir_handle64", "Directory Handle")
1765DirectoryAccessRights           = uint8("directory_access_rights", "Directory Access Rights")
1766#
1767# XXX - what do the bits mean here?
1768#
1769DirectoryAttributes             = uint8("directory_attributes", "Directory Attributes")
1770DirectoryBase                   = uint32("dir_base", "Directory Base")
1771DirectoryBase.Display("BASE_HEX")
1772DirectoryCount                  = uint16("dir_count", "Directory Count")
1773DirectoryEntryNumber            = uint32("directory_entry_number", "Directory Entry Number")
1774DirectoryEntryNumber.Display('BASE_HEX')
1775DirectoryEntryNumberWord        = uint16("directory_entry_number_word", "Directory Entry Number")
1776DirectoryID                     = uint16("directory_id", "Directory ID", ENC_BIG_ENDIAN)
1777DirectoryID.Display("BASE_HEX")
1778DirectoryName                   = fw_string("directory_name", "Directory Name",12)
1779DirectoryName14                 = fw_string("directory_name_14", "Directory Name", 14)
1780DirectoryNameLen                = uint8("directory_name_len", "Directory Name Length")
1781DirectoryNumber                 = uint32("directory_number", "Directory Number")
1782DirectoryNumber.Display("BASE_HEX")
1783DirectoryPath                   = fw_string("directory_path", "Directory Path", 16)
1784DirectoryServicesObjectID       = uint32("directory_services_object_id", "Directory Services Object ID")
1785DirectoryServicesObjectID.Display("BASE_HEX")
1786DirectoryStamp                  = uint16("directory_stamp", "Directory Stamp (0xD1D1)")
1787DirtyCacheBuffers               = uint16("dirty_cache_buffers", "Dirty Cache Buffers")
1788DiskChannelNumber               = uint8("disk_channel_number", "Disk Channel Number")
1789DiskChannelTable                = val_string8("disk_channel_table", "Disk Channel Table", [
1790        [ 0x01, "XT" ],
1791        [ 0x02, "AT" ],
1792        [ 0x03, "SCSI" ],
1793        [ 0x04, "Disk Coprocessor" ],
1794])
1795DiskSpaceLimit                  = uint32("disk_space_limit", "Disk Space Limit")
1796DiskSpaceLimit64                = uint64("data_stream_size_64", "Size")
1797DMAChannelsUsed                 = uint32("dma_channels_used", "DMA Channels Used")
1798DMInfoEntries                   = uint32("dm_info_entries", "DM Info Entries")
1799DMInfoLevel                     = val_string8("dm_info_level", "DM Info Level", [
1800        [ 0x00, "Return Detailed DM Support Module Information" ],
1801        [ 0x01, "Return Number of DM Support Modules" ],
1802        [ 0x02, "Return DM Support Modules Names" ],
1803])
1804DMFlags                         = val_string8("dm_flags", "DM Flags", [
1805        [ 0x00, "OnLine Media" ],
1806        [ 0x01, "OffLine Media" ],
1807])
1808DMmajorVersion                  = uint32("dm_major_version", "DM Major Version")
1809DMminorVersion                  = uint32("dm_minor_version", "DM Minor Version")
1810DMPresentFlag                   = val_string8("dm_present_flag", "Data Migration Present Flag", [
1811        [ 0x00, "Data Migration NLM is not loaded" ],
1812        [ 0x01, "Data Migration NLM has been loaded and is running" ],
1813])
1814DOSDirectoryBase                = uint32("dos_directory_base", "DOS Directory Base")
1815DOSDirectoryBase.Display("BASE_HEX")
1816DOSDirectoryEntry               = uint32("dos_directory_entry", "DOS Directory Entry")
1817DOSDirectoryEntry.Display("BASE_HEX")
1818DOSDirectoryEntryNumber         = uint32("dos_directory_entry_number", "DOS Directory Entry Number")
1819DOSDirectoryEntryNumber.Display('BASE_HEX')
1820DOSFileAttributes               = uint8("dos_file_attributes", "DOS File Attributes")
1821DOSParentDirectoryEntry         = uint32("dos_parent_directory_entry", "DOS Parent Directory Entry")
1822DOSParentDirectoryEntry.Display('BASE_HEX')
1823DOSSequence                     = uint32("dos_sequence", "DOS Sequence")
1824DriveCylinders                  = uint16("drive_cylinders", "Drive Cylinders")
1825DriveDefinitionString           = fw_string("drive_definition_string", "Drive Definition", 64)
1826DriveHeads                      = uint8("drive_heads", "Drive Heads")
1827DriveMappingTable               = bytes("drive_mapping_table", "Drive Mapping Table", 32)
1828DriveMirrorTable                = bytes("drive_mirror_table", "Drive Mirror Table", 32)
1829DriverBoardName         = stringz("driver_board_name", "Driver Board Name")
1830DriveRemovableFlag              = val_string8("drive_removable_flag", "Drive Removable Flag", [
1831        [ 0x00, "Nonremovable" ],
1832        [ 0xff, "Removable" ],
1833])
1834DriverLogicalName       = stringz("driver_log_name", "Driver Logical Name")
1835DriverShortName         = stringz("driver_short_name", "Driver Short Name")
1836DriveSize                       = uint32("drive_size", "Drive Size")
1837DstEAFlags                      = val_string16("dst_ea_flags", "Destination EA Flags", [
1838        [ 0x0000, "Return EAHandle,Information Level 0" ],
1839        [ 0x0001, "Return NetWareHandle,Information Level 0" ],
1840        [ 0x0002, "Return Volume/Directory Number,Information Level 0" ],
1841        [ 0x0004, "Return EAHandle,Close Handle on Error,Information Level 0" ],
1842        [ 0x0005, "Return NetWareHandle,Close Handle on Error,Information Level 0" ],
1843        [ 0x0006, "Return Volume/Directory Number,Close Handle on Error,Information Level 0" ],
1844        [ 0x0010, "Return EAHandle,Information Level 1" ],
1845        [ 0x0011, "Return NetWareHandle,Information Level 1" ],
1846        [ 0x0012, "Return Volume/Directory Number,Information Level 1" ],
1847        [ 0x0014, "Return EAHandle,Close Handle on Error,Information Level 1" ],
1848        [ 0x0015, "Return NetWareHandle,Close Handle on Error,Information Level 1" ],
1849        [ 0x0016, "Return Volume/Directory Number,Close Handle on Error,Information Level 1" ],
1850        [ 0x0020, "Return EAHandle,Information Level 2" ],
1851        [ 0x0021, "Return NetWareHandle,Information Level 2" ],
1852        [ 0x0022, "Return Volume/Directory Number,Information Level 2" ],
1853        [ 0x0024, "Return EAHandle,Close Handle on Error,Information Level 2" ],
1854        [ 0x0025, "Return NetWareHandle,Close Handle on Error,Information Level 2" ],
1855        [ 0x0026, "Return Volume/Directory Number,Close Handle on Error,Information Level 2" ],
1856        [ 0x0030, "Return EAHandle,Information Level 3" ],
1857        [ 0x0031, "Return NetWareHandle,Information Level 3" ],
1858        [ 0x0032, "Return Volume/Directory Number,Information Level 3" ],
1859        [ 0x0034, "Return EAHandle,Close Handle on Error,Information Level 3" ],
1860        [ 0x0035, "Return NetWareHandle,Close Handle on Error,Information Level 3" ],
1861        [ 0x0036, "Return Volume/Directory Number,Close Handle on Error,Information Level 3" ],
1862        [ 0x0040, "Return EAHandle,Information Level 4" ],
1863        [ 0x0041, "Return NetWareHandle,Information Level 4" ],
1864        [ 0x0042, "Return Volume/Directory Number,Information Level 4" ],
1865        [ 0x0044, "Return EAHandle,Close Handle on Error,Information Level 4" ],
1866        [ 0x0045, "Return NetWareHandle,Close Handle on Error,Information Level 4" ],
1867        [ 0x0046, "Return Volume/Directory Number,Close Handle on Error,Information Level 4" ],
1868        [ 0x0050, "Return EAHandle,Information Level 5" ],
1869        [ 0x0051, "Return NetWareHandle,Information Level 5" ],
1870        [ 0x0052, "Return Volume/Directory Number,Information Level 5" ],
1871        [ 0x0054, "Return EAHandle,Close Handle on Error,Information Level 5" ],
1872        [ 0x0055, "Return NetWareHandle,Close Handle on Error,Information Level 5" ],
1873        [ 0x0056, "Return Volume/Directory Number,Close Handle on Error,Information Level 5" ],
1874        [ 0x0060, "Return EAHandle,Information Level 6" ],
1875        [ 0x0061, "Return NetWareHandle,Information Level 6" ],
1876        [ 0x0062, "Return Volume/Directory Number,Information Level 6" ],
1877        [ 0x0064, "Return EAHandle,Close Handle on Error,Information Level 6" ],
1878        [ 0x0065, "Return NetWareHandle,Close Handle on Error,Information Level 6" ],
1879        [ 0x0066, "Return Volume/Directory Number,Close Handle on Error,Information Level 6" ],
1880        [ 0x0070, "Return EAHandle,Information Level 7" ],
1881        [ 0x0071, "Return NetWareHandle,Information Level 7" ],
1882        [ 0x0072, "Return Volume/Directory Number,Information Level 7" ],
1883        [ 0x0074, "Return EAHandle,Close Handle on Error,Information Level 7" ],
1884        [ 0x0075, "Return NetWareHandle,Close Handle on Error,Information Level 7" ],
1885        [ 0x0076, "Return Volume/Directory Number,Close Handle on Error,Information Level 7" ],
1886        [ 0x0080, "Return EAHandle,Information Level 0,Immediate Close Handle" ],
1887        [ 0x0081, "Return NetWareHandle,Information Level 0,Immediate Close Handle" ],
1888        [ 0x0082, "Return Volume/Directory Number,Information Level 0,Immediate Close Handle" ],
1889        [ 0x0084, "Return EAHandle,Close Handle on Error,Information Level 0,Immediate Close Handle" ],
1890        [ 0x0085, "Return NetWareHandle,Close Handle on Error,Information Level 0,Immediate Close Handle" ],
1891        [ 0x0086, "Return Volume/Directory Number,Close Handle on Error,Information Level 0,Immediate Close Handle" ],
1892        [ 0x0090, "Return EAHandle,Information Level 1,Immediate Close Handle" ],
1893        [ 0x0091, "Return NetWareHandle,Information Level 1,Immediate Close Handle" ],
1894        [ 0x0092, "Return Volume/Directory Number,Information Level 1,Immediate Close Handle" ],
1895        [ 0x0094, "Return EAHandle,Close Handle on Error,Information Level 1,Immediate Close Handle" ],
1896        [ 0x0095, "Return NetWareHandle,Close Handle on Error,Information Level 1,Immediate Close Handle" ],
1897        [ 0x0096, "Return Volume/Directory Number,Close Handle on Error,Information Level 1,Immediate Close Handle" ],
1898        [ 0x00a0, "Return EAHandle,Information Level 2,Immediate Close Handle" ],
1899        [ 0x00a1, "Return NetWareHandle,Information Level 2,Immediate Close Handle" ],
1900        [ 0x00a2, "Return Volume/Directory Number,Information Level 2,Immediate Close Handle" ],
1901        [ 0x00a4, "Return EAHandle,Close Handle on Error,Information Level 2,Immediate Close Handle" ],
1902        [ 0x00a5, "Return NetWareHandle,Close Handle on Error,Information Level 2,Immediate Close Handle" ],
1903        [ 0x00a6, "Return Volume/Directory Number,Close Handle on Error,Information Level 2,Immediate Close Handle" ],
1904        [ 0x00b0, "Return EAHandle,Information Level 3,Immediate Close Handle" ],
1905        [ 0x00b1, "Return NetWareHandle,Information Level 3,Immediate Close Handle" ],
1906        [ 0x00b2, "Return Volume/Directory Number,Information Level 3,Immediate Close Handle" ],
1907        [ 0x00b4, "Return EAHandle,Close Handle on Error,Information Level 3,Immediate Close Handle" ],
1908        [ 0x00b5, "Return NetWareHandle,Close Handle on Error,Information Level 3,Immediate Close Handle" ],
1909        [ 0x00b6, "Return Volume/Directory Number,Close Handle on Error,Information Level 3,Immediate Close Handle" ],
1910        [ 0x00c0, "Return EAHandle,Information Level 4,Immediate Close Handle" ],
1911        [ 0x00c1, "Return NetWareHandle,Information Level 4,Immediate Close Handle" ],
1912        [ 0x00c2, "Return Volume/Directory Number,Information Level 4,Immediate Close Handle" ],
1913        [ 0x00c4, "Return EAHandle,Close Handle on Error,Information Level 4,Immediate Close Handle" ],
1914        [ 0x00c5, "Return NetWareHandle,Close Handle on Error,Information Level 4,Immediate Close Handle" ],
1915        [ 0x00c6, "Return Volume/Directory Number,Close Handle on Error,Information Level 4,Immediate Close Handle" ],
1916        [ 0x00d0, "Return EAHandle,Information Level 5,Immediate Close Handle" ],
1917        [ 0x00d1, "Return NetWareHandle,Information Level 5,Immediate Close Handle" ],
1918        [ 0x00d2, "Return Volume/Directory Number,Information Level 5,Immediate Close Handle" ],
1919        [ 0x00d4, "Return EAHandle,Close Handle on Error,Information Level 5,Immediate Close Handle" ],
1920        [ 0x00d5, "Return NetWareHandle,Close Handle on Error,Information Level 5,Immediate Close Handle" ],
1921        [ 0x00d6, "Return Volume/Directory Number,Close Handle on Error,Information Level 5,Immediate Close Handle" ],
1922        [ 0x00e0, "Return EAHandle,Information Level 6,Immediate Close Handle" ],
1923        [ 0x00e1, "Return NetWareHandle,Information Level 6,Immediate Close Handle" ],
1924        [ 0x00e2, "Return Volume/Directory Number,Information Level 6,Immediate Close Handle" ],
1925        [ 0x00e4, "Return EAHandle,Close Handle on Error,Information Level 6,Immediate Close Handle" ],
1926        [ 0x00e5, "Return NetWareHandle,Close Handle on Error,Information Level 6,Immediate Close Handle" ],
1927        [ 0x00e6, "Return Volume/Directory Number,Close Handle on Error,Information Level 6,Immediate Close Handle" ],
1928        [ 0x00f0, "Return EAHandle,Information Level 7,Immediate Close Handle" ],
1929        [ 0x00f1, "Return NetWareHandle,Information Level 7,Immediate Close Handle" ],
1930        [ 0x00f2, "Return Volume/Directory Number,Information Level 7,Immediate Close Handle" ],
1931        [ 0x00f4, "Return EAHandle,Close Handle on Error,Information Level 7,Immediate Close Handle" ],
1932        [ 0x00f5, "Return NetWareHandle,Close Handle on Error,Information Level 7,Immediate Close Handle" ],
1933        [ 0x00f6, "Return Volume/Directory Number,Close Handle on Error,Information Level 7,Immediate Close Handle" ],
1934])
1935dstNSIndicator                  = val_string16("dst_ns_indicator", "Destination Name Space Indicator", [
1936        [ 0x0000, "Return Source Name Space Information" ],
1937        [ 0x0001, "Return Destination Name Space Information" ],
1938])
1939DstQueueID                      = uint32("dst_queue_id", "Destination Queue ID")
1940DuplicateRepliesSent            = uint16("duplicate_replies_sent", "Duplicate Replies Sent")
1941
1942EAAccessFlag                    = bitfield16("ea_access_flag", "EA Access Flag", [
1943        bf_boolean16(0x0001, "ea_permanent_memory", "Permanent Memory"),
1944        bf_boolean16(0x0002, "ea_deep_freeze", "Deep Freeze"),
1945        bf_boolean16(0x0004, "ea_in_progress", "In Progress"),
1946        bf_boolean16(0x0008, "ea_header_being_enlarged", "Header Being Enlarged"),
1947        bf_boolean16(0x0010, "ea_new_tally_used", "New Tally Used"),
1948        bf_boolean16(0x0020, "ea_tally_need_update", "Tally Need Update"),
1949        bf_boolean16(0x0040, "ea_score_card_present", "Score Card Present"),
1950        bf_boolean16(0x0080, "ea_need_bit_flag", "EA Need Bit Flag"),
1951        bf_boolean16(0x0100, "ea_write_privileges", "Write Privileges"),
1952        bf_boolean16(0x0200, "ea_read_privileges", "Read Privileges"),
1953        bf_boolean16(0x0400, "ea_delete_privileges", "Delete Privileges"),
1954        bf_boolean16(0x0800, "ea_system_ea_only", "System EA Only"),
1955        bf_boolean16(0x1000, "ea_write_in_progress", "Write In Progress"),
1956])
1957EABytesWritten                  = uint32("ea_bytes_written", "Bytes Written")
1958EACount                         = uint32("ea_count", "Count")
1959EADataSize                      = uint32("ea_data_size", "Data Size")
1960EADataSizeDuplicated            = uint32("ea_data_size_duplicated", "Data Size Duplicated")
1961EADuplicateCount                = uint32("ea_duplicate_count", "Duplicate Count")
1962EAErrorCodes                    = val_string16("ea_error_codes", "EA Error Codes", [
1963        [ 0x0000, "SUCCESSFUL" ],
1964        [ 0x00c8, "ERR_MISSING_EA_KEY" ],
1965        [ 0x00c9, "ERR_EA_NOT_FOUND" ],
1966        [ 0x00ca, "ERR_INVALID_EA_HANDLE_TYPE" ],
1967        [ 0x00cb, "ERR_EA_NO_KEY_NO_DATA" ],
1968        [ 0x00cc, "ERR_EA_NUMBER_MISMATCH" ],
1969        [ 0x00cd, "ERR_EXTENT_NUMBER_OUT_OF_RANGE" ],
1970        [ 0x00ce, "ERR_EA_BAD_DIR_NUM" ],
1971        [ 0x00cf, "ERR_INVALID_EA_HANDLE" ],
1972        [ 0x00d0, "ERR_EA_POSITION_OUT_OF_RANGE" ],
1973        [ 0x00d1, "ERR_EA_ACCESS_DENIED" ],
1974        [ 0x00d2, "ERR_DATA_PAGE_ODD_SIZE" ],
1975        [ 0x00d3, "ERR_EA_VOLUME_NOT_MOUNTED" ],
1976        [ 0x00d4, "ERR_BAD_PAGE_BOUNDARY" ],
1977        [ 0x00d5, "ERR_INSPECT_FAILURE" ],
1978        [ 0x00d6, "ERR_EA_ALREADY_CLAIMED" ],
1979        [ 0x00d7, "ERR_ODD_BUFFER_SIZE" ],
1980        [ 0x00d8, "ERR_NO_SCORECARDS" ],
1981        [ 0x00d9, "ERR_BAD_EDS_SIGNATURE" ],
1982        [ 0x00da, "ERR_EA_SPACE_LIMIT" ],
1983        [ 0x00db, "ERR_EA_KEY_CORRUPT" ],
1984        [ 0x00dc, "ERR_EA_KEY_LIMIT" ],
1985        [ 0x00dd, "ERR_TALLY_CORRUPT" ],
1986])
1987EAFlags                         = val_string16("ea_flags", "EA Flags", [
1988        [ 0x0000, "Return EAHandle,Information Level 0" ],
1989        [ 0x0001, "Return NetWareHandle,Information Level 0" ],
1990        [ 0x0002, "Return Volume/Directory Number,Information Level 0" ],
1991        [ 0x0004, "Return EAHandle,Close Handle on Error,Information Level 0" ],
1992        [ 0x0005, "Return NetWareHandle,Close Handle on Error,Information Level 0" ],
1993        [ 0x0006, "Return Volume/Directory Number,Close Handle on Error,Information Level 0" ],
1994        [ 0x0010, "Return EAHandle,Information Level 1" ],
1995        [ 0x0011, "Return NetWareHandle,Information Level 1" ],
1996        [ 0x0012, "Return Volume/Directory Number,Information Level 1" ],
1997        [ 0x0014, "Return EAHandle,Close Handle on Error,Information Level 1" ],
1998        [ 0x0015, "Return NetWareHandle,Close Handle on Error,Information Level 1" ],
1999        [ 0x0016, "Return Volume/Directory Number,Close Handle on Error,Information Level 1" ],
2000        [ 0x0020, "Return EAHandle,Information Level 2" ],
2001        [ 0x0021, "Return NetWareHandle,Information Level 2" ],
2002        [ 0x0022, "Return Volume/Directory Number,Information Level 2" ],
2003        [ 0x0024, "Return EAHandle,Close Handle on Error,Information Level 2" ],
2004        [ 0x0025, "Return NetWareHandle,Close Handle on Error,Information Level 2" ],
2005        [ 0x0026, "Return Volume/Directory Number,Close Handle on Error,Information Level 2" ],
2006        [ 0x0030, "Return EAHandle,Information Level 3" ],
2007        [ 0x0031, "Return NetWareHandle,Information Level 3" ],
2008        [ 0x0032, "Return Volume/Directory Number,Information Level 3" ],
2009        [ 0x0034, "Return EAHandle,Close Handle on Error,Information Level 3" ],
2010        [ 0x0035, "Return NetWareHandle,Close Handle on Error,Information Level 3" ],
2011        [ 0x0036, "Return Volume/Directory Number,Close Handle on Error,Information Level 3" ],
2012        [ 0x0040, "Return EAHandle,Information Level 4" ],
2013        [ 0x0041, "Return NetWareHandle,Information Level 4" ],
2014        [ 0x0042, "Return Volume/Directory Number,Information Level 4" ],
2015        [ 0x0044, "Return EAHandle,Close Handle on Error,Information Level 4" ],
2016        [ 0x0045, "Return NetWareHandle,Close Handle on Error,Information Level 4" ],
2017        [ 0x0046, "Return Volume/Directory Number,Close Handle on Error,Information Level 4" ],
2018        [ 0x0050, "Return EAHandle,Information Level 5" ],
2019        [ 0x0051, "Return NetWareHandle,Information Level 5" ],
2020        [ 0x0052, "Return Volume/Directory Number,Information Level 5" ],
2021        [ 0x0054, "Return EAHandle,Close Handle on Error,Information Level 5" ],
2022        [ 0x0055, "Return NetWareHandle,Close Handle on Error,Information Level 5" ],
2023        [ 0x0056, "Return Volume/Directory Number,Close Handle on Error,Information Level 5" ],
2024        [ 0x0060, "Return EAHandle,Information Level 6" ],
2025        [ 0x0061, "Return NetWareHandle,Information Level 6" ],
2026        [ 0x0062, "Return Volume/Directory Number,Information Level 6" ],
2027        [ 0x0064, "Return EAHandle,Close Handle on Error,Information Level 6" ],
2028        [ 0x0065, "Return NetWareHandle,Close Handle on Error,Information Level 6" ],
2029        [ 0x0066, "Return Volume/Directory Number,Close Handle on Error,Information Level 6" ],
2030        [ 0x0070, "Return EAHandle,Information Level 7" ],
2031        [ 0x0071, "Return NetWareHandle,Information Level 7" ],
2032        [ 0x0072, "Return Volume/Directory Number,Information Level 7" ],
2033        [ 0x0074, "Return EAHandle,Close Handle on Error,Information Level 7" ],
2034        [ 0x0075, "Return NetWareHandle,Close Handle on Error,Information Level 7" ],
2035        [ 0x0076, "Return Volume/Directory Number,Close Handle on Error,Information Level 7" ],
2036        [ 0x0080, "Return EAHandle,Information Level 0,Immediate Close Handle" ],
2037        [ 0x0081, "Return NetWareHandle,Information Level 0,Immediate Close Handle" ],
2038        [ 0x0082, "Return Volume/Directory Number,Information Level 0,Immediate Close Handle" ],
2039        [ 0x0084, "Return EAHandle,Close Handle on Error,Information Level 0,Immediate Close Handle" ],
2040        [ 0x0085, "Return NetWareHandle,Close Handle on Error,Information Level 0,Immediate Close Handle" ],
2041        [ 0x0086, "Return Volume/Directory Number,Close Handle on Error,Information Level 0,Immediate Close Handle" ],
2042        [ 0x0090, "Return EAHandle,Information Level 1,Immediate Close Handle" ],
2043        [ 0x0091, "Return NetWareHandle,Information Level 1,Immediate Close Handle" ],
2044        [ 0x0092, "Return Volume/Directory Number,Information Level 1,Immediate Close Handle" ],
2045        [ 0x0094, "Return EAHandle,Close Handle on Error,Information Level 1,Immediate Close Handle" ],
2046        [ 0x0095, "Return NetWareHandle,Close Handle on Error,Information Level 1,Immediate Close Handle" ],
2047        [ 0x0096, "Return Volume/Directory Number,Close Handle on Error,Information Level 1,Immediate Close Handle" ],
2048        [ 0x00a0, "Return EAHandle,Information Level 2,Immediate Close Handle" ],
2049        [ 0x00a1, "Return NetWareHandle,Information Level 2,Immediate Close Handle" ],
2050        [ 0x00a2, "Return Volume/Directory Number,Information Level 2,Immediate Close Handle" ],
2051        [ 0x00a4, "Return EAHandle,Close Handle on Error,Information Level 2,Immediate Close Handle" ],
2052        [ 0x00a5, "Return NetWareHandle,Close Handle on Error,Information Level 2,Immediate Close Handle" ],
2053        [ 0x00a6, "Return Volume/Directory Number,Close Handle on Error,Information Level 2,Immediate Close Handle" ],
2054        [ 0x00b0, "Return EAHandle,Information Level 3,Immediate Close Handle" ],
2055        [ 0x00b1, "Return NetWareHandle,Information Level 3,Immediate Close Handle" ],
2056        [ 0x00b2, "Return Volume/Directory Number,Information Level 3,Immediate Close Handle" ],
2057        [ 0x00b4, "Return EAHandle,Close Handle on Error,Information Level 3,Immediate Close Handle" ],
2058        [ 0x00b5, "Return NetWareHandle,Close Handle on Error,Information Level 3,Immediate Close Handle" ],
2059        [ 0x00b6, "Return Volume/Directory Number,Close Handle on Error,Information Level 3,Immediate Close Handle" ],
2060        [ 0x00c0, "Return EAHandle,Information Level 4,Immediate Close Handle" ],
2061        [ 0x00c1, "Return NetWareHandle,Information Level 4,Immediate Close Handle" ],
2062        [ 0x00c2, "Return Volume/Directory Number,Information Level 4,Immediate Close Handle" ],
2063        [ 0x00c4, "Return EAHandle,Close Handle on Error,Information Level 4,Immediate Close Handle" ],
2064        [ 0x00c5, "Return NetWareHandle,Close Handle on Error,Information Level 4,Immediate Close Handle" ],
2065        [ 0x00c6, "Return Volume/Directory Number,Close Handle on Error,Information Level 4,Immediate Close Handle" ],
2066        [ 0x00d0, "Return EAHandle,Information Level 5,Immediate Close Handle" ],
2067        [ 0x00d1, "Return NetWareHandle,Information Level 5,Immediate Close Handle" ],
2068        [ 0x00d2, "Return Volume/Directory Number,Information Level 5,Immediate Close Handle" ],
2069        [ 0x00d4, "Return EAHandle,Close Handle on Error,Information Level 5,Immediate Close Handle" ],
2070        [ 0x00d5, "Return NetWareHandle,Close Handle on Error,Information Level 5,Immediate Close Handle" ],
2071        [ 0x00d6, "Return Volume/Directory Number,Close Handle on Error,Information Level 5,Immediate Close Handle" ],
2072        [ 0x00e0, "Return EAHandle,Information Level 6,Immediate Close Handle" ],
2073        [ 0x00e1, "Return NetWareHandle,Information Level 6,Immediate Close Handle" ],
2074        [ 0x00e2, "Return Volume/Directory Number,Information Level 6,Immediate Close Handle" ],
2075        [ 0x00e4, "Return EAHandle,Close Handle on Error,Information Level 6,Immediate Close Handle" ],
2076        [ 0x00e5, "Return NetWareHandle,Close Handle on Error,Information Level 6,Immediate Close Handle" ],
2077        [ 0x00e6, "Return Volume/Directory Number,Close Handle on Error,Information Level 6,Immediate Close Handle" ],
2078        [ 0x00f0, "Return EAHandle,Information Level 7,Immediate Close Handle" ],
2079        [ 0x00f1, "Return NetWareHandle,Information Level 7,Immediate Close Handle" ],
2080        [ 0x00f2, "Return Volume/Directory Number,Information Level 7,Immediate Close Handle" ],
2081        [ 0x00f4, "Return EAHandle,Close Handle on Error,Information Level 7,Immediate Close Handle" ],
2082        [ 0x00f5, "Return NetWareHandle,Close Handle on Error,Information Level 7,Immediate Close Handle" ],
2083        [ 0x00f6, "Return Volume/Directory Number,Close Handle on Error,Information Level 7,Immediate Close Handle" ],
2084])
2085EAHandle                        = uint32("ea_handle", "EA Handle")
2086EAHandle.Display("BASE_HEX")
2087EAHandleOrNetWareHandleOrVolume = uint32("ea_handle_or_netware_handle_or_volume", "EAHandle or NetWare Handle or Volume (see EAFlags)")
2088EAHandleOrNetWareHandleOrVolume.Display("BASE_HEX")
2089EAKey                           = nstring16("ea_key", "EA Key")
2090EAKeySize                       = uint32("ea_key_size", "Key Size")
2091EAKeySizeDuplicated             = uint32("ea_key_size_duplicated", "Key Size Duplicated")
2092EAValue                         = nstring16("ea_value", "EA Value")
2093EAValueRep                      = fw_string("ea_value_rep", "EA Value", 1)
2094EAValueLength                   = uint16("ea_value_length", "Value Length")
2095EchoSocket                      = uint16("echo_socket", "Echo Socket")
2096EchoSocket.Display('BASE_HEX')
2097EffectiveRights                 = bitfield8("effective_rights", "Effective Rights", [
2098        bf_boolean8(0x01, "effective_rights_read", "Read Rights"),
2099        bf_boolean8(0x02, "effective_rights_write", "Write Rights"),
2100        bf_boolean8(0x04, "effective_rights_open", "Open Rights"),
2101        bf_boolean8(0x08, "effective_rights_create", "Create Rights"),
2102        bf_boolean8(0x10, "effective_rights_delete", "Delete Rights"),
2103        bf_boolean8(0x20, "effective_rights_parental", "Parental Rights"),
2104        bf_boolean8(0x40, "effective_rights_search", "Search Rights"),
2105        bf_boolean8(0x80, "effective_rights_modify", "Modify Rights"),
2106])
2107EnumInfoMask                    = bitfield8("enum_info_mask", "Return Information Mask", [
2108        bf_boolean8(0x01, "enum_info_transport", "Transport Information"),
2109        bf_boolean8(0x02, "enum_info_time", "Time Information"),
2110        bf_boolean8(0x04, "enum_info_name", "Name Information"),
2111        bf_boolean8(0x08, "enum_info_lock", "Lock Information"),
2112        bf_boolean8(0x10, "enum_info_print", "Print Information"),
2113        bf_boolean8(0x20, "enum_info_stats", "Statistical Information"),
2114        bf_boolean8(0x40, "enum_info_account", "Accounting Information"),
2115        bf_boolean8(0x80, "enum_info_auth", "Authentication Information"),
2116])
2117
2118eventOffset                     = bytes("event_offset", "Event Offset", 8)
2119eventTime                       = uint32("event_time", "Event Time")
2120eventTime.Display("BASE_HEX")
2121ExpirationTime                  = uint32("expiration_time", "Expiration Time")
2122ExpirationTime.Display('BASE_HEX')
2123ExtAttrDataSize                 = uint32("ext_attr_data_size", "Extended Attributes Data Size")
2124ExtAttrCount                    = uint32("ext_attr_count", "Extended Attributes Count")
2125ExtAttrKeySize                  = uint32("ext_attr_key_size", "Extended Attributes Key Size")
2126ExtendedAttributesDefined       = uint32("extended_attributes_defined", "Extended Attributes Defined")
2127ExtendedAttributeExtentsUsed    = uint32("extended_attribute_extents_used", "Extended Attribute Extents Used")
2128ExtendedInfo                    = bitfield16("ext_info", "Extended Return Information", [
2129        bf_boolean16(0x0001, "ext_info_update", "Last Update"),
2130        bf_boolean16(0x0002, "ext_info_dos_name", "DOS Name"),
2131        bf_boolean16(0x0004, "ext_info_flush", "Flush Time"),
2132        bf_boolean16(0x0008, "ext_info_parental", "Parental"),
2133        bf_boolean16(0x0010, "ext_info_mac_finder", "MAC Finder"),
2134        bf_boolean16(0x0020, "ext_info_sibling", "Sibling"),
2135        bf_boolean16(0x0040, "ext_info_effective", "Effective"),
2136        bf_boolean16(0x0080, "ext_info_mac_date", "MAC Date"),
2137        bf_boolean16(0x0100, "ext_info_access", "Last Access"),
2138        bf_boolean16(0x0400, "ext_info_64_bit_fs", "64 Bit File Sizes"),
2139        bf_boolean16(0x8000, "ext_info_newstyle", "New Style"),
2140])
2141
2142ExtentListFormat                = uint8("ext_lst_format", "Extent List Format")
2143RetExtentListCount              = uint8("ret_ext_lst_count", "Extent List Count")
2144EndingOffset                    = bytes("end_offset", "Ending Offset", 8)
2145#ExtentLength                    = bytes("extent_length", "Length", 8),
2146ExtentList                      = bytes("ext_lst", "Extent List", 512)
2147ExtRouterActiveFlag             = boolean8("ext_router_active_flag", "External Router Active Flag")
2148
2149FailedAllocReqCnt               = uint32("failed_alloc_req", "Failed Alloc Request Count")
2150FatalFATWriteErrors             = uint16("fatal_fat_write_errors", "Fatal FAT Write Errors")
2151FATScanErrors                   = uint16("fat_scan_errors", "FAT Scan Errors")
2152FATWriteErrors                  = uint16("fat_write_errors", "FAT Write Errors")
2153FieldsLenTable                  = bytes("fields_len_table", "Fields Len Table", 32)
2154FileCount                       = uint16("file_count", "File Count")
2155FileDate                        = uint16("file_date", "File Date")
2156FileDate.NWDate()
2157FileDirWindow                   = uint16("file_dir_win", "File/Dir Window")
2158FileDirWindow.Display("BASE_HEX")
2159FileExecuteType                 = uint8("file_execute_type", "File Execute Type")
2160FileExtendedAttributes          = val_string8("file_ext_attr", "File Extended Attributes", [
2161        [ 0x00, "Search On All Read Only Opens" ],
2162        [ 0x01, "Search On Read Only Opens With No Path" ],
2163        [ 0x02, "Shell Default Search Mode" ],
2164        [ 0x03, "Search On All Opens With No Path" ],
2165        [ 0x04, "Do Not Search" ],
2166        [ 0x05, "Reserved" ],
2167        [ 0x06, "Search On All Opens" ],
2168        [ 0x07, "Reserved" ],
2169        [ 0x08, "Search On All Read Only Opens/Indexed" ],
2170        [ 0x09, "Search On Read Only Opens With No Path/Indexed" ],
2171        [ 0x0a, "Shell Default Search Mode/Indexed" ],
2172        [ 0x0b, "Search On All Opens With No Path/Indexed" ],
2173        [ 0x0c, "Do Not Search/Indexed" ],
2174        [ 0x0d, "Indexed" ],
2175        [ 0x0e, "Search On All Opens/Indexed" ],
2176        [ 0x0f, "Indexed" ],
2177        [ 0x10, "Search On All Read Only Opens/Transactional" ],
2178        [ 0x11, "Search On Read Only Opens With No Path/Transactional" ],
2179        [ 0x12, "Shell Default Search Mode/Transactional" ],
2180        [ 0x13, "Search On All Opens With No Path/Transactional" ],
2181        [ 0x14, "Do Not Search/Transactional" ],
2182        [ 0x15, "Transactional" ],
2183        [ 0x16, "Search On All Opens/Transactional" ],
2184        [ 0x17, "Transactional" ],
2185        [ 0x18, "Search On All Read Only Opens/Indexed/Transactional" ],
2186        [ 0x19, "Search On Read Only Opens With No Path/Indexed/Transactional" ],
2187        [ 0x1a, "Shell Default Search Mode/Indexed/Transactional" ],
2188        [ 0x1b, "Search On All Opens With No Path/Indexed/Transactional" ],
2189        [ 0x1c, "Do Not Search/Indexed/Transactional" ],
2190        [ 0x1d, "Indexed/Transactional" ],
2191        [ 0x1e, "Search On All Opens/Indexed/Transactional" ],
2192        [ 0x1f, "Indexed/Transactional" ],
2193        [ 0x40, "Search On All Read Only Opens/Read Audit" ],
2194        [ 0x41, "Search On Read Only Opens With No Path/Read Audit" ],
2195        [ 0x42, "Shell Default Search Mode/Read Audit" ],
2196        [ 0x43, "Search On All Opens With No Path/Read Audit" ],
2197        [ 0x44, "Do Not Search/Read Audit" ],
2198        [ 0x45, "Read Audit" ],
2199        [ 0x46, "Search On All Opens/Read Audit" ],
2200        [ 0x47, "Read Audit" ],
2201        [ 0x48, "Search On All Read Only Opens/Indexed/Read Audit" ],
2202        [ 0x49, "Search On Read Only Opens With No Path/Indexed/Read Audit" ],
2203        [ 0x4a, "Shell Default Search Mode/Indexed/Read Audit" ],
2204        [ 0x4b, "Search On All Opens With No Path/Indexed/Read Audit" ],
2205        [ 0x4c, "Do Not Search/Indexed/Read Audit" ],
2206        [ 0x4d, "Indexed/Read Audit" ],
2207        [ 0x4e, "Search On All Opens/Indexed/Read Audit" ],
2208        [ 0x4f, "Indexed/Read Audit" ],
2209        [ 0x50, "Search On All Read Only Opens/Transactional/Read Audit" ],
2210        [ 0x51, "Search On Read Only Opens With No Path/Transactional/Read Audit" ],
2211        [ 0x52, "Shell Default Search Mode/Transactional/Read Audit" ],
2212        [ 0x53, "Search On All Opens With No Path/Transactional/Read Audit" ],
2213        [ 0x54, "Do Not Search/Transactional/Read Audit" ],
2214        [ 0x55, "Transactional/Read Audit" ],
2215        [ 0x56, "Search On All Opens/Transactional/Read Audit" ],
2216        [ 0x57, "Transactional/Read Audit" ],
2217        [ 0x58, "Search On All Read Only Opens/Indexed/Transactional/Read Audit" ],
2218        [ 0x59, "Search On Read Only Opens With No Path/Indexed/Transactional/Read Audit" ],
2219        [ 0x5a, "Shell Default Search Mode/Indexed/Transactional/Read Audit" ],
2220        [ 0x5b, "Search On All Opens With No Path/Indexed/Transactional/Read Audit" ],
2221        [ 0x5c, "Do Not Search/Indexed/Transactional/Read Audit" ],
2222        [ 0x5d, "Indexed/Transactional/Read Audit" ],
2223        [ 0x5e, "Search On All Opens/Indexed/Transactional/Read Audit" ],
2224        [ 0x5f, "Indexed/Transactional/Read Audit" ],
2225        [ 0x80, "Search On All Read Only Opens/Write Audit" ],
2226        [ 0x81, "Search On Read Only Opens With No Path/Write Audit" ],
2227        [ 0x82, "Shell Default Search Mode/Write Audit" ],
2228        [ 0x83, "Search On All Opens With No Path/Write Audit" ],
2229        [ 0x84, "Do Not Search/Write Audit" ],
2230        [ 0x85, "Write Audit" ],
2231        [ 0x86, "Search On All Opens/Write Audit" ],
2232        [ 0x87, "Write Audit" ],
2233        [ 0x88, "Search On All Read Only Opens/Indexed/Write Audit" ],
2234        [ 0x89, "Search On Read Only Opens With No Path/Indexed/Write Audit" ],
2235        [ 0x8a, "Shell Default Search Mode/Indexed/Write Audit" ],
2236        [ 0x8b, "Search On All Opens With No Path/Indexed/Write Audit" ],
2237        [ 0x8c, "Do Not Search/Indexed/Write Audit" ],
2238        [ 0x8d, "Indexed/Write Audit" ],
2239        [ 0x8e, "Search On All Opens/Indexed/Write Audit" ],
2240        [ 0x8f, "Indexed/Write Audit" ],
2241        [ 0x90, "Search On All Read Only Opens/Transactional/Write Audit" ],
2242        [ 0x91, "Search On Read Only Opens With No Path/Transactional/Write Audit" ],
2243        [ 0x92, "Shell Default Search Mode/Transactional/Write Audit" ],
2244        [ 0x93, "Search On All Opens With No Path/Transactional/Write Audit" ],
2245        [ 0x94, "Do Not Search/Transactional/Write Audit" ],
2246        [ 0x95, "Transactional/Write Audit" ],
2247        [ 0x96, "Search On All Opens/Transactional/Write Audit" ],
2248        [ 0x97, "Transactional/Write Audit" ],
2249        [ 0x98, "Search On All Read Only Opens/Indexed/Transactional/Write Audit" ],
2250        [ 0x99, "Search On Read Only Opens With No Path/Indexed/Transactional/Write Audit" ],
2251        [ 0x9a, "Shell Default Search Mode/Indexed/Transactional/Write Audit" ],
2252        [ 0x9b, "Search On All Opens With No Path/Indexed/Transactional/Write Audit" ],
2253        [ 0x9c, "Do Not Search/Indexed/Transactional/Write Audit" ],
2254        [ 0x9d, "Indexed/Transactional/Write Audit" ],
2255        [ 0x9e, "Search On All Opens/Indexed/Transactional/Write Audit" ],
2256        [ 0x9f, "Indexed/Transactional/Write Audit" ],
2257        [ 0xa0, "Search On All Read Only Opens/Read Audit/Write Audit" ],
2258        [ 0xa1, "Search On Read Only Opens With No Path/Read Audit/Write Audit" ],
2259        [ 0xa2, "Shell Default Search Mode/Read Audit/Write Audit" ],
2260        [ 0xa3, "Search On All Opens With No Path/Read Audit/Write Audit" ],
2261        [ 0xa4, "Do Not Search/Read Audit/Write Audit" ],
2262        [ 0xa5, "Read Audit/Write Audit" ],
2263        [ 0xa6, "Search On All Opens/Read Audit/Write Audit" ],
2264        [ 0xa7, "Read Audit/Write Audit" ],
2265        [ 0xa8, "Search On All Read Only Opens/Indexed/Read Audit/Write Audit" ],
2266        [ 0xa9, "Search On Read Only Opens With No Path/Indexed/Read Audit/Write Audit" ],
2267        [ 0xaa, "Shell Default Search Mode/Indexed/Read Audit/Write Audit" ],
2268        [ 0xab, "Search On All Opens With No Path/Indexed/Read Audit/Write Audit" ],
2269        [ 0xac, "Do Not Search/Indexed/Read Audit/Write Audit" ],
2270        [ 0xad, "Indexed/Read Audit/Write Audit" ],
2271        [ 0xae, "Search On All Opens/Indexed/Read Audit/Write Audit" ],
2272        [ 0xaf, "Indexed/Read Audit/Write Audit" ],
2273        [ 0xb0, "Search On All Read Only Opens/Transactional/Read Audit/Write Audit" ],
2274        [ 0xb1, "Search On Read Only Opens With No Path/Transactional/Read Audit/Write Audit" ],
2275        [ 0xb2, "Shell Default Search Mode/Transactional/Read Audit/Write Audit" ],
2276        [ 0xb3, "Search On All Opens With No Path/Transactional/Read Audit/Write Audit" ],
2277        [ 0xb4, "Do Not Search/Transactional/Read Audit/Write Audit" ],
2278        [ 0xb5, "Transactional/Read Audit/Write Audit" ],
2279        [ 0xb6, "Search On All Opens/Transactional/Read Audit/Write Audit" ],
2280        [ 0xb7, "Transactional/Read Audit/Write Audit" ],
2281        [ 0xb8, "Search On All Read Only Opens/Indexed/Transactional/Read Audit/Write Audit" ],
2282        [ 0xb9, "Search On Read Only Opens With No Path/Indexed/Transactional/Read Audit/Write Audit" ],
2283        [ 0xba, "Shell Default Search Mode/Indexed/Transactional/Read Audit/Write Audit" ],
2284        [ 0xbb, "Search On All Opens With No Path/Indexed/Transactional/Read Audit/Write Audit" ],
2285        [ 0xbc, "Do Not Search/Indexed/Transactional/Read Audit/Write Audit" ],
2286        [ 0xbd, "Indexed/Transactional/Read Audit/Write Audit" ],
2287        [ 0xbe, "Search On All Opens/Indexed/Transactional/Read Audit/Write Audit" ],
2288        [ 0xbf, "Indexed/Transactional/Read Audit/Write Audit" ],
2289])
2290fileFlags                       = uint32("file_flags", "File Flags")
2291FileHandle                      = bytes("file_handle", "File Handle", 6)
2292FileLimbo                       = uint32("file_limbo", "File Limbo")
2293FileListCount                   = uint32("file_list_count", "File List Count")
2294FileLock                        = val_string8("file_lock", "File Lock", [
2295        [ 0x00, "Not Locked" ],
2296        [ 0xfe, "Locked by file lock" ],
2297        [ 0xff, "Unknown" ],
2298])
2299FileLockCount                   = uint16("file_lock_count", "File Lock Count")
2300FileMigrationState  = val_string8("file_mig_state", "File Migration State", [
2301    [ 0x00, "Mark file ineligible for file migration" ],
2302    [ 0x01, "Mark file eligible for file migration" ],
2303    [ 0x02, "Mark file as migrated and delete fat chains" ],
2304    [ 0x03, "Reset file status back to normal" ],
2305    [ 0x04, "Get file data back and reset file status back to normal" ],
2306])
2307FileMode                        = uint8("file_mode", "File Mode")
2308FileName                        = nstring8("file_name", "Filename")
2309FileName12                      = fw_string("file_name_12", "Filename", 12)
2310FileName14                      = fw_string("file_name_14", "Filename", 14)
2311FileName16          = nstring16("file_name_16", "Filename")
2312FileNameLen                     = uint8("file_name_len", "Filename Length")
2313FileOffset                      = uint32("file_offset", "File Offset")
2314FilePath                        = nstring8("file_path", "File Path")
2315FileSize                        = uint32("file_size", "File Size", ENC_BIG_ENDIAN)
2316FileSize64bit       = uint64("f_size_64bit", "64bit File Size")
2317FileSystemID                    = uint8("file_system_id", "File System ID")
2318FileTime                        = uint16("file_time", "File Time")
2319FileTime.NWTime()
2320FileUseCount        = uint16("file_use_count", "File Use Count")
2321FileWriteFlags                  = val_string8("file_write_flags", "File Write Flags", [
2322        [ 0x01, "Writing" ],
2323        [ 0x02, "Write aborted" ],
2324])
2325FileWriteState                  = val_string8("file_write_state", "File Write State", [
2326        [ 0x00, "Not Writing" ],
2327        [ 0x01, "Write in Progress" ],
2328        [ 0x02, "Write Being Stopped" ],
2329])
2330Filler                          = uint8("filler", "Filler")
2331FinderAttr                      = bitfield16("finder_attr", "Finder Info Attributes", [
2332        bf_boolean16(0x0001, "finder_attr_desktop", "Object on Desktop"),
2333        bf_boolean16(0x2000, "finder_attr_invisible", "Object is Invisible"),
2334        bf_boolean16(0x4000, "finder_attr_bundle", "Object Has Bundle"),
2335])
2336FixedBitMask                    = uint32("fixed_bit_mask", "Fixed Bit Mask")
2337FixedBitsDefined                = uint16("fixed_bits_defined", "Fixed Bits Defined")
2338FlagBits                        = uint8("flag_bits", "Flag Bits")
2339Flags                           = uint8("flags", "Flags")
2340FlagsDef                        = uint16("flags_def", "Flags")
2341FlushTime                       = uint32("flush_time", "Flush Time")
2342FolderFlag                      = val_string8("folder_flag", "Folder Flag", [
2343        [ 0x00, "Not a Folder" ],
2344        [ 0x01, "Folder" ],
2345])
2346ForkCount                       = uint8("fork_count", "Fork Count")
2347ForkIndicator                   = val_string8("fork_indicator", "Fork Indicator", [
2348        [ 0x00, "Data Fork" ],
2349        [ 0x01, "Resource Fork" ],
2350])
2351ForceFlag                       = val_string8("force_flag", "Force Server Down Flag", [
2352        [ 0x00, "Down Server if No Files Are Open" ],
2353        [ 0xff, "Down Server Immediately, Auto-Close Open Files" ],
2354])
2355ForgedDetachedRequests          = uint16("forged_detached_requests", "Forged Detached Requests")
2356FormType                        = uint16( "form_type", "Form Type" )
2357FormTypeCnt                     = uint32("form_type_count", "Form Types Count")
2358FoundSomeMem                    = uint32("found_some_mem", "Found Some Memory")
2359FractionalSeconds               = eptime("fractional_time", "Fractional Time in Seconds")
2360FraggerHandle                   = uint32("fragger_handle", "Fragment Handle")
2361FraggerHandle.Display('BASE_HEX')
2362FragmentWriteOccurred           = uint16("fragment_write_occurred", "Fragment Write Occurred")
2363FragSize                        = uint32("frag_size", "Fragment Size")
2364FreeableLimboSectors            = uint32("freeable_limbo_sectors", "Freeable Limbo Sectors")
2365FreeBlocks                      = uint32("free_blocks", "Free Blocks")
2366FreedClusters                   = uint32("freed_clusters", "Freed Clusters")
2367FreeDirectoryEntries            = uint16("free_directory_entries", "Free Directory Entries")
2368FSEngineFlag                    = boolean8("fs_engine_flag", "FS Engine Flag")
2369FullName                        = fw_string("full_name", "Full Name", 39)
2370
2371GetSetFlag                      = val_string8("get_set_flag", "Get Set Flag", [
2372        [ 0x00, "Get the default support module ID" ],
2373        [ 0x01, "Set the default support module ID" ],
2374])
2375GUID                            = bytes("guid", "GUID", 16)
2376
2377HandleFlag                      = val_string8("handle_flag", "Handle Flag", [
2378        [ 0x00, "Short Directory Handle" ],
2379        [ 0x01, "Directory Base" ],
2380        [ 0xFF, "No Handle Present" ],
2381])
2382HandleInfoLevel                 = val_string8("handle_info_level", "Handle Info Level", [
2383        [ 0x00, "Get Limited Information from a File Handle" ],
2384        [ 0x01, "Get Limited Information from a File Handle Using a Name Space" ],
2385        [ 0x02, "Get Information from a File Handle" ],
2386        [ 0x03, "Get Information from a Directory Handle" ],
2387        [ 0x04, "Get Complete Information from a Directory Handle" ],
2388        [ 0x05, "Get Complete Information from a File Handle" ],
2389])
2390HeldBytesRead                   = bytes("held_bytes_read", "Held Bytes Read", 6)
2391HeldBytesWritten                = bytes("held_bytes_write", "Held Bytes Written", 6)
2392HeldConnectTimeInMinutes        = uint32("held_conn_time", "Held Connect Time in Minutes")
2393HeldRequests                    = uint32("user_info_held_req", "Held Requests")
2394HoldAmount                      = uint32("hold_amount", "Hold Amount")
2395HoldCancelAmount                = uint32("hold_cancel_amount", "Hold Cancel Amount")
2396HolderID                        = uint32("holder_id", "Holder ID")
2397HolderID.Display("BASE_HEX")
2398HoldTime                        = uint32("hold_time", "Hold Time")
2399HopsToNet                       = uint16("hops_to_net", "Hop Count")
2400HorizLocation                   = uint16("horiz_location", "Horizontal Location")
2401HostAddress                     = bytes("host_address", "Host Address", 6)
2402HotFixBlocksAvailable           = uint16("hot_fix_blocks_available", "Hot Fix Blocks Available")
2403HotFixDisabled                  = val_string8("hot_fix_disabled", "Hot Fix Disabled", [
2404        [ 0x00, "Enabled" ],
2405        [ 0x01, "Disabled" ],
2406])
2407HotFixTableSize                 = uint16("hot_fix_table_size", "Hot Fix Table Size")
2408HotFixTableStart                = uint32("hot_fix_table_start", "Hot Fix Table Start")
2409Hour                            = uint8("s_hour", "Hour")
2410HugeBitMask                     = uint32("huge_bit_mask", "Huge Bit Mask")
2411HugeBitsDefined                 = uint16("huge_bits_defined", "Huge Bits Defined")
2412HugeData                        = nstring8("huge_data", "Huge Data")
2413HugeDataUsed                    = uint32("huge_data_used", "Huge Data Used")
2414HugeStateInfo                   = bytes("huge_state_info", "Huge State Info", 16)
2415
2416IdentificationNumber            = uint32("identification_number", "Identification Number")
2417IgnoredRxPkts                   = uint32("ignored_rx_pkts", "Ignored Receive Packets")
2418IncomingPacketDiscardedNoDGroup = uint16("incoming_packet_discarded_no_dgroup", "Incoming Packet Discarded No DGroup")
2419IndexNumber                     = uint8("index_number", "Index Number")
2420InfoCount                       = uint16("info_count", "Info Count")
2421InfoFlags                       = bitfield32("info_flags", "Info Flags", [
2422        bf_boolean32(0x10000000, "info_flags_security", "Return Object Security"),
2423        bf_boolean32(0x20000000, "info_flags_flags", "Return Object Flags"),
2424        bf_boolean32(0x40000000, "info_flags_type", "Return Object Type"),
2425        bf_boolean32(0x80000000, "info_flags_name", "Return Object Name"),
2426])
2427InfoLevelNumber                 = val_string8("info_level_num", "Information Level Number", [
2428        [ 0x0, "Single Directory Quota Information" ],
2429        [ 0x1, "Multi-Level Directory Quota Information" ],
2430])
2431InfoMask                        = bitfield32("info_mask", "Information Mask", [
2432        bf_boolean32(0x00000001, "info_flags_dos_time", "DOS Time"),
2433        bf_boolean32(0x00000002, "info_flags_ref_count", "Reference Count"),
2434        bf_boolean32(0x00000004, "info_flags_dos_attr", "DOS Attributes"),
2435        bf_boolean32(0x00000008, "info_flags_ids", "ID's"),
2436        bf_boolean32(0x00000010, "info_flags_ds_sizes", "Data Stream Sizes"),
2437        bf_boolean32(0x00000020, "info_flags_ns_attr", "Name Space Attributes"),
2438        bf_boolean32(0x00000040, "info_flags_ea_present", "EA Present Flag"),
2439        bf_boolean32(0x00000080, "info_flags_all_attr", "All Attributes"),
2440        bf_boolean32(0x00000100, "info_flags_all_dirbase_num", "All Directory Base Numbers"),
2441        bf_boolean32(0x00000200, "info_flags_max_access_mask", "Maximum Access Mask"),
2442        bf_boolean32(0x00000400, "info_flags_flush_time", "Flush Time"),
2443        bf_boolean32(0x00000800, "info_flags_prnt_base_id", "Parent Base ID"),
2444        bf_boolean32(0x00001000, "info_flags_mac_finder", "Mac Finder Information"),
2445        bf_boolean32(0x00002000, "info_flags_sibling_cnt", "Sibling Count"),
2446        bf_boolean32(0x00004000, "info_flags_effect_rights", "Effective Rights"),
2447        bf_boolean32(0x00008000, "info_flags_mac_time", "Mac Time"),
2448        bf_boolean32(0x20000000, "info_mask_dosname", "DOS Name"),
2449        bf_boolean32(0x40000000, "info_mask_c_name_space", "Creator Name Space & Name"),
2450        bf_boolean32(0x80000000, "info_mask_name", "Name"),
2451])
2452InheritedRightsMask             = bitfield16("inherited_rights_mask", "Inherited Rights Mask", [
2453    bf_boolean16(0x0001, "inh_rights_read", "Read Rights"),
2454        bf_boolean16(0x0002, "inh_rights_write", "Write Rights"),
2455        bf_boolean16(0x0004, "inh_rights_open", "Open Rights"),
2456        bf_boolean16(0x0008, "inh_rights_create", "Create Rights"),
2457        bf_boolean16(0x0010, "inh_rights_delete", "Delete Rights"),
2458        bf_boolean16(0x0020, "inh_rights_parent", "Change Access"),
2459        bf_boolean16(0x0040, "inh_rights_search", "See Files Flag"),
2460        bf_boolean16(0x0080, "inh_rights_modify", "Modify Rights"),
2461        bf_boolean16(0x0100, "inh_rights_supervisor", "Supervisor"),
2462])
2463InheritanceRevokeMask           = bitfield16("inheritance_revoke_mask", "Revoke Rights Mask", [
2464        bf_boolean16(0x0001, "inh_revoke_read", "Read Rights"),
2465        bf_boolean16(0x0002, "inh_revoke_write", "Write Rights"),
2466        bf_boolean16(0x0004, "inh_revoke_open", "Open Rights"),
2467        bf_boolean16(0x0008, "inh_revoke_create", "Create Rights"),
2468        bf_boolean16(0x0010, "inh_revoke_delete", "Delete Rights"),
2469        bf_boolean16(0x0020, "inh_revoke_parent", "Change Access"),
2470        bf_boolean16(0x0040, "inh_revoke_search", "See Files Flag"),
2471        bf_boolean16(0x0080, "inh_revoke_modify", "Modify Rights"),
2472        bf_boolean16(0x0100, "inh_revoke_supervisor", "Supervisor"),
2473])
2474InitialSemaphoreValue           = uint8("initial_semaphore_value", "Initial Semaphore Value")
2475InpInfotype                     = uint32("inp_infotype", "Information Type")
2476Inpld                           = uint32("inp_ld", "Volume Number or Directory Handle")
2477InspectSize                     = uint32("inspect_size", "Inspect Size")
2478InternetBridgeVersion           = uint8("internet_bridge_version", "Internet Bridge Version")
2479InterruptNumbersUsed            = uint32("interrupt_numbers_used", "Interrupt Numbers Used")
2480InUse                           = uint32("in_use", "Blocks in Use")
2481InUse64                         = uint64("in_use64", "Blocks in Use")
2482IOAddressesUsed                 = bytes("io_addresses_used", "IO Addresses Used", 8)
2483IOErrorCount                    = uint16("io_error_count", "IO Error Count")
2484IOEngineFlag                    = boolean8("io_engine_flag", "IO Engine Flag")
2485IPXNotMyNetwork                 = uint16("ipx_not_my_network", "IPX Not My Network")
2486ItemsChanged                    = uint32("items_changed", "Items Changed")
2487ItemsChecked                    = uint32("items_checked", "Items Checked")
2488ItemsCount                      = uint32("items_count", "Items Count")
2489itemsInList                     = uint32("items_in_list", "Items in List")
2490ItemsInPacket                   = uint32("items_in_packet", "Items in Packet")
2491
2492JobControlFlags                 = bitfield8("job_control_flags", "Job Control Flags", [
2493        bf_boolean8(0x08, "job_control_job_recovery", "Job Recovery"),
2494        bf_boolean8(0x10, "job_control_reservice", "ReService Job"),
2495        bf_boolean8(0x20, "job_control_file_open", "File Open"),
2496        bf_boolean8(0x40, "job_control_user_hold", "User Hold"),
2497        bf_boolean8(0x80, "job_control_operator_hold", "Operator Hold"),
2498
2499])
2500JobControlFlagsWord             = bitfield16("job_control_flags_word", "Job Control Flags", [
2501        bf_boolean16(0x0008, "job_control1_job_recovery", "Job Recovery"),
2502        bf_boolean16(0x0010, "job_control1_reservice", "ReService Job"),
2503        bf_boolean16(0x0020, "job_control1_file_open", "File Open"),
2504        bf_boolean16(0x0040, "job_control1_user_hold", "User Hold"),
2505        bf_boolean16(0x0080, "job_control1_operator_hold", "Operator Hold"),
2506
2507])
2508JobCount                        = uint32("job_count", "Job Count")
2509JobFileHandle                   = bytes("job_file_handle", "Job File Handle", 6)
2510JobFileHandleLong               = uint32("job_file_handle_long", "Job File Handle", ENC_BIG_ENDIAN)
2511JobFileHandleLong.Display("BASE_HEX")
2512JobFileName                     = fw_string("job_file_name", "Job File Name", 14)
2513JobPosition                     = uint8("job_position", "Job Position")
2514JobPositionWord                 = uint16("job_position_word", "Job Position")
2515JobNumber                       = uint16("job_number", "Job Number", ENC_BIG_ENDIAN )
2516JobNumberLong                   = uint32("job_number_long", "Job Number", ENC_BIG_ENDIAN )
2517JobNumberLong.Display("BASE_HEX")
2518JobType                         = uint16("job_type", "Job Type", ENC_BIG_ENDIAN )
2519
2520LANCustomVariablesCount         = uint32("lan_cust_var_count", "LAN Custom Variables Count")
2521LANdriverBoardInstance          = uint16("lan_drv_bd_inst", "LAN Driver Board Instance")
2522LANdriverBoardNumber            = uint16("lan_drv_bd_num", "LAN Driver Board Number")
2523LANdriverCardID                 = uint16("lan_drv_card_id", "LAN Driver Card ID")
2524LANdriverCardName               = fw_string("lan_drv_card_name", "LAN Driver Card Name", 28)
2525LANdriverCFG_MajorVersion       = uint8("lan_dvr_cfg_major_vrs", "LAN Driver Config - Major Version")
2526LANdriverCFG_MinorVersion       = uint8("lan_dvr_cfg_minor_vrs", "LAN Driver Config - Minor Version")
2527LANdriverDMAUsage1              = uint8("lan_drv_dma_usage1", "Primary DMA Channel")
2528LANdriverDMAUsage2              = uint8("lan_drv_dma_usage2", "Secondary DMA Channel")
2529LANdriverFlags                  = uint16("lan_drv_flags", "LAN Driver Flags")
2530LANdriverFlags.Display("BASE_HEX")
2531LANdriverInterrupt1             = uint8("lan_drv_interrupt1", "Primary Interrupt Vector")
2532LANdriverInterrupt2             = uint8("lan_drv_interrupt2", "Secondary Interrupt Vector")
2533LANdriverIOPortsAndRanges1      = uint16("lan_drv_io_ports_and_ranges_1", "Primary Base I/O Port")
2534LANdriverIOPortsAndRanges2      = uint16("lan_drv_io_ports_and_ranges_2", "Number of I/O Ports")
2535LANdriverIOPortsAndRanges3      = uint16("lan_drv_io_ports_and_ranges_3", "Secondary Base I/O Port")
2536LANdriverIOPortsAndRanges4      = uint16("lan_drv_io_ports_and_ranges_4", "Number of I/O Ports")
2537LANdriverIOReserved             = bytes("lan_drv_io_reserved", "LAN Driver IO Reserved", 14)
2538LANdriverLineSpeed              = uint16("lan_drv_line_speed", "LAN Driver Line Speed")
2539LANdriverLink                   = uint32("lan_drv_link", "LAN Driver Link")
2540LANdriverLogicalName            = bytes("lan_drv_log_name", "LAN Driver Logical Name", 18)
2541LANdriverMajorVersion           = uint8("lan_drv_major_ver", "LAN Driver Major Version")
2542LANdriverMaximumSize            = uint32("lan_drv_max_size", "LAN Driver Maximum Size")
2543LANdriverMaxRecvSize            = uint32("lan_drv_max_rcv_size", "LAN Driver Maximum Receive Size")
2544LANdriverMediaID                = uint16("lan_drv_media_id", "LAN Driver Media ID")
2545LANdriverMediaType              = fw_string("lan_drv_media_type", "LAN Driver Media Type", 40)
2546LANdriverMemoryDecode0          = uint32("lan_drv_mem_decode_0", "LAN Driver Memory Decode 0")
2547LANdriverMemoryDecode1          = uint32("lan_drv_mem_decode_1", "LAN Driver Memory Decode 1")
2548LANdriverMemoryLength0          = uint16("lan_drv_mem_length_0", "LAN Driver Memory Length 0")
2549LANdriverMemoryLength1          = uint16("lan_drv_mem_length_1", "LAN Driver Memory Length 1")
2550LANdriverMinorVersion           = uint8("lan_drv_minor_ver", "LAN Driver Minor Version")
2551LANdriverModeFlags              = val_string8("lan_dvr_mode_flags", "LAN Driver Mode Flags", [
2552        [0x80, "Canonical Address" ],
2553        [0x81, "Canonical Address" ],
2554        [0x82, "Canonical Address" ],
2555        [0x83, "Canonical Address" ],
2556        [0x84, "Canonical Address" ],
2557        [0x85, "Canonical Address" ],
2558        [0x86, "Canonical Address" ],
2559        [0x87, "Canonical Address" ],
2560        [0x88, "Canonical Address" ],
2561        [0x89, "Canonical Address" ],
2562        [0x8a, "Canonical Address" ],
2563        [0x8b, "Canonical Address" ],
2564        [0x8c, "Canonical Address" ],
2565        [0x8d, "Canonical Address" ],
2566        [0x8e, "Canonical Address" ],
2567        [0x8f, "Canonical Address" ],
2568        [0x90, "Canonical Address" ],
2569        [0x91, "Canonical Address" ],
2570        [0x92, "Canonical Address" ],
2571        [0x93, "Canonical Address" ],
2572        [0x94, "Canonical Address" ],
2573        [0x95, "Canonical Address" ],
2574        [0x96, "Canonical Address" ],
2575        [0x97, "Canonical Address" ],
2576        [0x98, "Canonical Address" ],
2577        [0x99, "Canonical Address" ],
2578        [0x9a, "Canonical Address" ],
2579        [0x9b, "Canonical Address" ],
2580        [0x9c, "Canonical Address" ],
2581        [0x9d, "Canonical Address" ],
2582        [0x9e, "Canonical Address" ],
2583        [0x9f, "Canonical Address" ],
2584        [0xa0, "Canonical Address" ],
2585        [0xa1, "Canonical Address" ],
2586        [0xa2, "Canonical Address" ],
2587        [0xa3, "Canonical Address" ],
2588        [0xa4, "Canonical Address" ],
2589        [0xa5, "Canonical Address" ],
2590        [0xa6, "Canonical Address" ],
2591        [0xa7, "Canonical Address" ],
2592        [0xa8, "Canonical Address" ],
2593        [0xa9, "Canonical Address" ],
2594        [0xaa, "Canonical Address" ],
2595        [0xab, "Canonical Address" ],
2596        [0xac, "Canonical Address" ],
2597        [0xad, "Canonical Address" ],
2598        [0xae, "Canonical Address" ],
2599        [0xaf, "Canonical Address" ],
2600        [0xb0, "Canonical Address" ],
2601        [0xb1, "Canonical Address" ],
2602        [0xb2, "Canonical Address" ],
2603        [0xb3, "Canonical Address" ],
2604        [0xb4, "Canonical Address" ],
2605        [0xb5, "Canonical Address" ],
2606        [0xb6, "Canonical Address" ],
2607        [0xb7, "Canonical Address" ],
2608        [0xb8, "Canonical Address" ],
2609        [0xb9, "Canonical Address" ],
2610        [0xba, "Canonical Address" ],
2611        [0xbb, "Canonical Address" ],
2612        [0xbc, "Canonical Address" ],
2613        [0xbd, "Canonical Address" ],
2614        [0xbe, "Canonical Address" ],
2615        [0xbf, "Canonical Address" ],
2616        [0xc0, "Non-Canonical Address" ],
2617        [0xc1, "Non-Canonical Address" ],
2618        [0xc2, "Non-Canonical Address" ],
2619        [0xc3, "Non-Canonical Address" ],
2620        [0xc4, "Non-Canonical Address" ],
2621        [0xc5, "Non-Canonical Address" ],
2622        [0xc6, "Non-Canonical Address" ],
2623        [0xc7, "Non-Canonical Address" ],
2624        [0xc8, "Non-Canonical Address" ],
2625        [0xc9, "Non-Canonical Address" ],
2626        [0xca, "Non-Canonical Address" ],
2627        [0xcb, "Non-Canonical Address" ],
2628        [0xcc, "Non-Canonical Address" ],
2629        [0xcd, "Non-Canonical Address" ],
2630        [0xce, "Non-Canonical Address" ],
2631        [0xcf, "Non-Canonical Address" ],
2632        [0xd0, "Non-Canonical Address" ],
2633        [0xd1, "Non-Canonical Address" ],
2634        [0xd2, "Non-Canonical Address" ],
2635        [0xd3, "Non-Canonical Address" ],
2636        [0xd4, "Non-Canonical Address" ],
2637        [0xd5, "Non-Canonical Address" ],
2638        [0xd6, "Non-Canonical Address" ],
2639        [0xd7, "Non-Canonical Address" ],
2640        [0xd8, "Non-Canonical Address" ],
2641        [0xd9, "Non-Canonical Address" ],
2642        [0xda, "Non-Canonical Address" ],
2643        [0xdb, "Non-Canonical Address" ],
2644        [0xdc, "Non-Canonical Address" ],
2645        [0xdd, "Non-Canonical Address" ],
2646        [0xde, "Non-Canonical Address" ],
2647        [0xdf, "Non-Canonical Address" ],
2648        [0xe0, "Non-Canonical Address" ],
2649        [0xe1, "Non-Canonical Address" ],
2650        [0xe2, "Non-Canonical Address" ],
2651        [0xe3, "Non-Canonical Address" ],
2652        [0xe4, "Non-Canonical Address" ],
2653        [0xe5, "Non-Canonical Address" ],
2654        [0xe6, "Non-Canonical Address" ],
2655        [0xe7, "Non-Canonical Address" ],
2656        [0xe8, "Non-Canonical Address" ],
2657        [0xe9, "Non-Canonical Address" ],
2658        [0xea, "Non-Canonical Address" ],
2659        [0xeb, "Non-Canonical Address" ],
2660        [0xec, "Non-Canonical Address" ],
2661        [0xed, "Non-Canonical Address" ],
2662        [0xee, "Non-Canonical Address" ],
2663        [0xef, "Non-Canonical Address" ],
2664        [0xf0, "Non-Canonical Address" ],
2665        [0xf1, "Non-Canonical Address" ],
2666        [0xf2, "Non-Canonical Address" ],
2667        [0xf3, "Non-Canonical Address" ],
2668        [0xf4, "Non-Canonical Address" ],
2669        [0xf5, "Non-Canonical Address" ],
2670        [0xf6, "Non-Canonical Address" ],
2671        [0xf7, "Non-Canonical Address" ],
2672        [0xf8, "Non-Canonical Address" ],
2673        [0xf9, "Non-Canonical Address" ],
2674        [0xfa, "Non-Canonical Address" ],
2675        [0xfb, "Non-Canonical Address" ],
2676        [0xfc, "Non-Canonical Address" ],
2677        [0xfd, "Non-Canonical Address" ],
2678        [0xfe, "Non-Canonical Address" ],
2679        [0xff, "Non-Canonical Address" ],
2680])
2681LANDriverNumber                 = uint8("lan_driver_number", "LAN Driver Number")
2682LANdriverNodeAddress            = bytes("lan_dvr_node_addr", "LAN Driver Node Address", 6)
2683LANdriverRecvSize               = uint32("lan_drv_rcv_size", "LAN Driver Receive Size")
2684LANdriverReserved               = uint16("lan_drv_reserved", "LAN Driver Reserved")
2685LANdriverSendRetries            = uint16("lan_drv_snd_retries", "LAN Driver Send Retries")
2686LANdriverSharingFlags           = uint16("lan_drv_share", "LAN Driver Sharing Flags")
2687LANdriverShortName              = fw_string("lan_drv_short_name", "LAN Driver Short Name", 40)
2688LANdriverSlot                   = uint16("lan_drv_slot", "LAN Driver Slot")
2689LANdriverSrcRouting             = uint32("lan_drv_src_route", "LAN Driver Source Routing")
2690LANdriverTransportTime          = uint16("lan_drv_trans_time", "LAN Driver Transport Time")
2691LastAccessedDate                = uint16("last_access_date", "Last Accessed Date")
2692LastAccessedDate.NWDate()
2693LastAccessedTime                = uint16("last_access_time", "Last Accessed Time")
2694LastAccessedTime.NWTime()
2695LastGarbCollect                 = uint32("last_garbage_collect", "Last Garbage Collection")
2696LastInstance                    = uint32("last_instance", "Last Instance")
2697LastRecordSeen                  = uint16("last_record_seen", "Last Record Seen")
2698LastSearchIndex                 = uint16("last_search_index", "Search Index")
2699LastSeen                        = uint32("last_seen", "Last Seen")
2700LastSequenceNumber              = uint16("last_sequence_number", "Sequence Number")
2701Length64bit         = bytes("length_64bit", "64bit Length", 64)
2702Level                           = uint8("level", "Level")
2703LFSCounters                     = uint32("lfs_counters", "LFS Counters")
2704LimboDataStreamsCount           = uint32("limbo_data_streams_count", "Limbo Data Streams Count")
2705limbCount                       = uint32("limb_count", "Limb Count")
2706limbFlags           = bitfield32("limb_flags", "Limb Flags", [
2707        bf_boolean32(0x00000002, "scan_entire_folder", "Wild Search"),
2708        bf_boolean32(0x00000004, "scan_files_only", "Scan Files Only"),
2709        bf_boolean32(0x00000008, "scan_folders_only", "Scan Folders Only"),
2710        bf_boolean32(0x00000010, "allow_system", "Allow System Files and Folders"),
2711        bf_boolean32(0x00000020, "allow_hidden", "Allow Hidden Files and Folders"),
2712])
2713
2714limbScanNum                     = uint32("limb_scan_num", "Limb Scan Number")
2715LimboUsed                       = uint32("limbo_used", "Limbo Used")
2716LoadedNameSpaces                = uint8("loaded_name_spaces", "Loaded Name Spaces")
2717LocalConnectionID               = uint32("local_connection_id", "Local Connection ID")
2718LocalConnectionID.Display("BASE_HEX")
2719LocalMaxPacketSize              = uint32("local_max_packet_size", "Local Max Packet Size")
2720LocalMaxSendSize                = uint32("local_max_send_size", "Local Max Send Size")
2721LocalMaxRecvSize                = uint32("local_max_recv_size", "Local Max Recv Size")
2722LocalLoginInfoCcode             = uint8("local_login_info_ccode", "Local Login Info C Code")
2723LocalTargetSocket               = uint32("local_target_socket", "Local Target Socket")
2724LocalTargetSocket.Display("BASE_HEX")
2725LockAreaLen                     = uint32("lock_area_len", "Lock Area Length")
2726LockAreasStartOffset            = uint32("lock_areas_start_offset", "Lock Areas Start Offset")
2727LockTimeout                     = uint16("lock_timeout", "Lock Timeout")
2728Locked                          = val_string8("locked", "Locked Flag", [
2729        [ 0x00, "Not Locked Exclusively" ],
2730        [ 0x01, "Locked Exclusively" ],
2731])
2732LockFlag                        = val_string8("lock_flag", "Lock Flag", [
2733        [ 0x00, "Not Locked, Log for Future Exclusive Lock" ],
2734        [ 0x01, "Exclusive Lock (Read/Write)" ],
2735        [ 0x02, "Log for Future Shared Lock"],
2736        [ 0x03, "Shareable Lock (Read-Only)" ],
2737        [ 0xfe, "Locked by a File Lock" ],
2738        [ 0xff, "Locked by Begin Share File Set" ],
2739])
2740LockName                        = nstring8("lock_name", "Lock Name")
2741LockStatus                      = val_string8("lock_status", "Lock Status", [
2742        [ 0x00, "Locked Exclusive" ],
2743        [ 0x01, "Locked Shareable" ],
2744        [ 0x02, "Logged" ],
2745        [ 0x06, "Lock is Held by TTS"],
2746])
2747ConnLockStatus                  = val_string8("conn_lock_status", "Lock Status", [
2748        [ 0x00, "Normal (connection free to run)" ],
2749        [ 0x01, "Waiting on physical record lock" ],
2750        [ 0x02, "Waiting on a file lock" ],
2751        [ 0x03, "Waiting on a logical record lock"],
2752        [ 0x04, "Waiting on a semaphore"],
2753])
2754LockType                        = val_string8("lock_type", "Lock Type", [
2755        [ 0x00, "Locked" ],
2756        [ 0x01, "Open Shareable" ],
2757        [ 0x02, "Logged" ],
2758        [ 0x03, "Open Normal" ],
2759        [ 0x06, "TTS Holding Lock" ],
2760        [ 0x07, "Transaction Flag Set on This File" ],
2761])
2762LogFileFlagHigh                 = bitfield8("log_file_flag_high", "Log File Flag (byte 2)", [
2763        bf_boolean8(0x80, "log_flag_call_back", "Call Back Requested" ),
2764])
2765LogFileFlagLow                  = bitfield8("log_file_flag_low", "Log File Flag", [
2766        bf_boolean8(0x01, "log_flag_lock_file", "Lock File Immediately" ),
2767])
2768LoggedObjectID                  = uint32("logged_object_id", "Logged in Object ID")
2769LoggedObjectID.Display("BASE_HEX")
2770LoggedCount                     = uint16("logged_count", "Logged Count")
2771LogicalConnectionNumber         = uint16("logical_connection_number", "Logical Connection Number", ENC_BIG_ENDIAN)
2772LogicalDriveCount               = uint8("logical_drive_count", "Logical Drive Count")
2773LogicalDriveNumber              = uint8("logical_drive_number", "Logical Drive Number")
2774LogicalLockThreshold            = uint8("logical_lock_threshold", "LogicalLockThreshold")
2775LogicalRecordName               = nstring8("logical_record_name", "Logical Record Name")
2776LoginKey                        = bytes("login_key", "Login Key", 8)
2777LogLockType                     = uint8("log_lock_type", "Log Lock Type")
2778LogTtlRxPkts                    = uint32("log_ttl_rx_pkts", "Total Received Packets")
2779LogTtlTxPkts                    = uint32("log_ttl_tx_pkts", "Total Transmitted Packets")
2780LongName                        = fw_string("long_name", "Long Name", 32)
2781LRUBlockWasDirty                = uint16("lru_block_was_dirty", "LRU Block Was Dirty")
2782
2783MacAttr                         = bitfield16("mac_attr", "Attributes", [
2784        bf_boolean16(0x0001, "mac_attr_smode1", "Search Mode"),
2785        bf_boolean16(0x0002, "mac_attr_smode2", "Search Mode"),
2786        bf_boolean16(0x0004, "mac_attr_smode3", "Search Mode"),
2787        bf_boolean16(0x0010, "mac_attr_transaction", "Transaction"),
2788        bf_boolean16(0x0020, "mac_attr_index", "Index"),
2789        bf_boolean16(0x0040, "mac_attr_r_audit", "Read Audit"),
2790        bf_boolean16(0x0080, "mac_attr_w_audit", "Write Audit"),
2791        bf_boolean16(0x0100, "mac_attr_r_only", "Read Only"),
2792        bf_boolean16(0x0200, "mac_attr_hidden", "Hidden"),
2793        bf_boolean16(0x0400, "mac_attr_system", "System"),
2794        bf_boolean16(0x0800, "mac_attr_execute_only", "Execute Only"),
2795        bf_boolean16(0x1000, "mac_attr_subdirectory", "Subdirectory"),
2796        bf_boolean16(0x2000, "mac_attr_archive", "Archive"),
2797        bf_boolean16(0x8000, "mac_attr_share", "Shareable File"),
2798])
2799MACBackupDate                   = uint16("mac_backup_date", "Mac Backup Date")
2800MACBackupDate.NWDate()
2801MACBackupTime                   = uint16("mac_backup_time", "Mac Backup Time")
2802MACBackupTime.NWTime()
2803MacBaseDirectoryID              = uint32("mac_base_directory_id", "Mac Base Directory ID", ENC_BIG_ENDIAN)
2804MacBaseDirectoryID.Display("BASE_HEX")
2805MACCreateDate                   = uint16("mac_create_date", "Mac Create Date")
2806MACCreateDate.NWDate()
2807MACCreateTime                   = uint16("mac_create_time", "Mac Create Time")
2808MACCreateTime.NWTime()
2809MacDestinationBaseID            = uint32("mac_destination_base_id", "Mac Destination Base ID")
2810MacDestinationBaseID.Display("BASE_HEX")
2811MacFinderInfo                   = bytes("mac_finder_info", "Mac Finder Information", 32)
2812MacLastSeenID                   = uint32("mac_last_seen_id", "Mac Last Seen ID")
2813MacLastSeenID.Display("BASE_HEX")
2814MacSourceBaseID                 = uint32("mac_source_base_id", "Mac Source Base ID")
2815MacSourceBaseID.Display("BASE_HEX")
2816MajorVersion                    = uint32("major_version", "Major Version")
2817MaxBytes                        = uint16("max_bytes", "Maximum Number of Bytes")
2818MaxDataStreams                  = uint32("max_data_streams", "Maximum Data Streams")
2819MaxDirDepth                     = uint32("max_dir_depth", "Maximum Directory Depth")
2820MaximumSpace                    = uint16("max_space", "Maximum Space")
2821MaxNumOfConn                    = uint32("max_num_of_conn", "Maximum Number of Connections")
2822MaxNumOfLANS                    = uint32("max_num_of_lans", "Maximum Number Of LAN's")
2823MaxNumOfMedias                  = uint32("max_num_of_medias", "Maximum Number Of Media's")
2824MaxNumOfNmeSps                  = uint32("max_num_of_nme_sps", "Maximum Number Of Name Spaces")
2825MaxNumOfSpoolPr                 = uint32("max_num_of_spool_pr", "Maximum Number Of Spool Printers")
2826MaxNumOfStacks                  = uint32("max_num_of_stacks", "Maximum Number Of Stacks")
2827MaxNumOfUsers                   = uint32("max_num_of_users", "Maximum Number Of Users")
2828MaxNumOfVol                     = uint32("max_num_of_vol", "Maximum Number of Volumes")
2829MaxReadDataReplySize    = uint16("max_read_data_reply_size", "Max Read Data Reply Size")
2830MaxSpace                        = uint32("maxspace", "Maximum Space")
2831MaxSpace64                      = uint64("maxspace64", "Maximum Space")
2832MaxUsedDynamicSpace             = uint32("max_used_dynamic_space", "Max Used Dynamic Space")
2833MediaList                       = uint32("media_list", "Media List")
2834MediaListCount                  = uint32("media_list_count", "Media List Count")
2835MediaName                       = nstring8("media_name", "Media Name")
2836MediaNumber                     = uint32("media_number", "Media Number")
2837MaxReplyObjectIDCount           = uint8("max_reply_obj_id_count", "Max Reply Object ID Count")
2838MediaObjectType                 = val_string8("media_object_type", "Object Type", [
2839        [ 0x00, "Adapter" ],
2840        [ 0x01, "Changer" ],
2841        [ 0x02, "Removable Device" ],
2842        [ 0x03, "Device" ],
2843        [ 0x04, "Removable Media" ],
2844        [ 0x05, "Partition" ],
2845        [ 0x06, "Slot" ],
2846        [ 0x07, "Hotfix" ],
2847        [ 0x08, "Mirror" ],
2848        [ 0x09, "Parity" ],
2849        [ 0x0a, "Volume Segment" ],
2850        [ 0x0b, "Volume" ],
2851        [ 0x0c, "Clone" ],
2852        [ 0x0d, "Fixed Media" ],
2853        [ 0x0e, "Unknown" ],
2854])
2855MemberName                      = nstring8("member_name", "Member Name")
2856MemberType                      = val_string16("member_type", "Member Type", [
2857        [ 0x0000,       "Unknown" ],
2858        [ 0x0001,       "User" ],
2859        [ 0x0002,       "User group" ],
2860        [ 0x0003,       "Print queue" ],
2861        [ 0x0004,       "NetWare file server" ],
2862        [ 0x0005,       "Job server" ],
2863        [ 0x0006,       "Gateway" ],
2864        [ 0x0007,       "Print server" ],
2865        [ 0x0008,       "Archive queue" ],
2866        [ 0x0009,       "Archive server" ],
2867        [ 0x000a,       "Job queue" ],
2868        [ 0x000b,       "Administration" ],
2869        [ 0x0021,       "NAS SNA gateway" ],
2870        [ 0x0026,       "Remote bridge server" ],
2871        [ 0x0027,       "TCP/IP gateway" ],
2872])
2873MessageLanguage                 = uint32("message_language", "NLM Language")
2874MigratedFiles                   = uint32("migrated_files", "Migrated Files")
2875MigratedSectors                 = uint32("migrated_sectors", "Migrated Sectors")
2876MinorVersion                    = uint32("minor_version", "Minor Version")
2877MinSpaceLeft64                  = uint64("min_space_left64", "Minimum Space Left")
2878Minute                          = uint8("s_minute", "Minutes")
2879MixedModePathFlag               = val_string8("mixed_mode_path_flag", "Mixed Mode Path Flag", [
2880    [ 0x00, "Mixed mode path handling is not available"],
2881    [ 0x01, "Mixed mode path handling is available"],
2882])
2883ModifiedDate                    = uint16("modified_date", "Modified Date")
2884ModifiedDate.NWDate()
2885ModifiedTime                    = uint16("modified_time", "Modified Time")
2886ModifiedTime.NWTime()
2887ModifierID                      = uint32("modifier_id", "Modifier ID", ENC_BIG_ENDIAN)
2888ModifierID.Display("BASE_HEX")
2889ModifyDOSInfoMask               = bitfield16("modify_dos_info_mask", "Modify DOS Info Mask", [
2890        bf_boolean16(0x0002, "modify_dos_read", "Attributes"),
2891        bf_boolean16(0x0004, "modify_dos_write", "Creation Date"),
2892        bf_boolean16(0x0008, "modify_dos_open", "Creation Time"),
2893        bf_boolean16(0x0010, "modify_dos_create", "Creator ID"),
2894        bf_boolean16(0x0020, "modify_dos_delete", "Archive Date"),
2895        bf_boolean16(0x0040, "modify_dos_parent", "Archive Time"),
2896        bf_boolean16(0x0080, "modify_dos_search", "Archiver ID"),
2897        bf_boolean16(0x0100, "modify_dos_mdate", "Modify Date"),
2898        bf_boolean16(0x0200, "modify_dos_mtime", "Modify Time"),
2899        bf_boolean16(0x0400, "modify_dos_mid", "Modifier ID"),
2900        bf_boolean16(0x0800, "modify_dos_laccess", "Last Access"),
2901        bf_boolean16(0x1000, "modify_dos_inheritance", "Inheritance"),
2902        bf_boolean16(0x2000, "modify_dos_max_space", "Maximum Space"),
2903])
2904Month                           = val_string8("s_month", "Month", [
2905        [ 0x01, "January"],
2906        [ 0x02, "February"],
2907        [ 0x03, "March"],
2908        [ 0x04, "April"],
2909        [ 0x05, "May"],
2910        [ 0x06, "June"],
2911        [ 0x07, "July"],
2912        [ 0x08, "August"],
2913        [ 0x09, "September"],
2914        [ 0x0a, "October"],
2915        [ 0x0b, "November"],
2916        [ 0x0c, "December"],
2917])
2918
2919MoreFlag                        = val_string8("more_flag", "More Flag", [
2920        [ 0x00, "No More Segments/Entries Available" ],
2921        [ 0x01, "More Segments/Entries Available" ],
2922        [ 0xff, "More Segments/Entries Available" ],
2923])
2924MoreProperties                  = val_string8("more_properties", "More Properties", [
2925        [ 0x00, "No More Properties Available" ],
2926        [ 0x01, "No More Properties Available" ],
2927        [ 0xff, "More Properties Available" ],
2928])
2929
2930Name                            = nstring8("name", "Name")
2931Name12                          = fw_string("name12", "Name", 12)
2932NameLen                         = uint8("name_len", "Name Space Length")
2933NameLength                      = uint8("name_length", "Name Length")
2934NameList                        = uint32("name_list", "Name List")
2935#
2936# XXX - should this value be used to interpret the characters in names,
2937# search patterns, and the like?
2938#
2939# We need to handle character sets better, e.g. translating strings
2940# from whatever character set they are in the packet (DOS/Windows code
2941# pages, ISO character sets, UNIX EUC character sets, UTF-8, UCS-2/Unicode,
2942# Mac character sets, etc.) into UCS-4 or UTF-8 and storing them as such
2943# in the protocol tree, and displaying them as best we can.
2944#
2945NameSpace                       = val_string8("name_space", "Name Space", [
2946        [ 0x00, "DOS" ],
2947        [ 0x01, "MAC" ],
2948        [ 0x02, "NFS" ],
2949        [ 0x03, "FTAM" ],
2950        [ 0x04, "OS/2, Long" ],
2951])
2952NamesSpaceInfoMask                      = bitfield16("ns_info_mask", "Names Space Info Mask", [
2953        bf_boolean16(0x0001, "ns_info_mask_modify", "Modify Name"),
2954        bf_boolean16(0x0002, "ns_info_mask_fatt", "File Attributes"),
2955        bf_boolean16(0x0004, "ns_info_mask_cdate", "Creation Date"),
2956        bf_boolean16(0x0008, "ns_info_mask_ctime", "Creation Time"),
2957        bf_boolean16(0x0010, "ns_info_mask_owner", "Owner ID"),
2958        bf_boolean16(0x0020, "ns_info_mask_adate", "Archive Date"),
2959        bf_boolean16(0x0040, "ns_info_mask_atime", "Archive Time"),
2960        bf_boolean16(0x0080, "ns_info_mask_aid", "Archiver ID"),
2961        bf_boolean16(0x0100, "ns_info_mask_udate", "Update Date"),
2962        bf_boolean16(0x0200, "ns_info_mask_utime", "Update Time"),
2963        bf_boolean16(0x0400, "ns_info_mask_uid", "Update ID"),
2964        bf_boolean16(0x0800, "ns_info_mask_acc_date", "Access Date"),
2965        bf_boolean16(0x1000, "ns_info_mask_max_acc_mask", "Inheritance"),
2966        bf_boolean16(0x2000, "ns_info_mask_max_space", "Maximum Space"),
2967])
2968NameSpaceName                   = nstring8("name_space_name", "Name Space Name")
2969nameType                        = uint32("name_type", "nameType")
2970NCPdataSize                     = uint32("ncp_data_size", "NCP Data Size")
2971NCPEncodedStringsBits   = uint32("ncp_encoded_strings_bits", "NCP Encoded Strings Bits")
2972NCPextensionMajorVersion        = uint8("ncp_extension_major_version", "NCP Extension Major Version")
2973NCPextensionMinorVersion        = uint8("ncp_extension_minor_version", "NCP Extension Minor Version")
2974NCPextensionName                = nstring8("ncp_extension_name", "NCP Extension Name")
2975NCPextensionNumber              = uint32("ncp_extension_number", "NCP Extension Number")
2976NCPextensionNumber.Display("BASE_HEX")
2977NCPExtensionNumbers             = uint32("ncp_extension_numbers", "NCP Extension Numbers")
2978NCPextensionRevisionNumber      = uint8("ncp_extension_revision_number", "NCP Extension Revision Number")
2979NCPPeakStaInUse                 = uint32("ncp_peak_sta_in_use", "Peak Number of Connections since Server was brought up")
2980NCPStaInUseCnt                  = uint32("ncp_sta_in_use", "Number of Workstations Connected to Server")
2981NDSRequestFlags                 = bitfield16("nds_request_flags", "NDS Request Flags", [
2982        bf_boolean16(0x0001, "nds_request_flags_output", "Output Fields"),
2983        bf_boolean16(0x0002, "nds_request_flags_no_such_entry", "No Such Entry"),
2984        bf_boolean16(0x0004, "nds_request_flags_local_entry", "Local Entry"),
2985        bf_boolean16(0x0008, "nds_request_flags_type_ref", "Type Referral"),
2986        bf_boolean16(0x0010, "nds_request_flags_alias_ref", "Alias Referral"),
2987        bf_boolean16(0x0020, "nds_request_flags_req_cnt", "Request Count"),
2988        bf_boolean16(0x0040, "nds_request_flags_req_data_size", "Request Data Size"),
2989        bf_boolean16(0x0080, "nds_request_flags_reply_data_size", "Reply Data Size"),
2990        bf_boolean16(0x0100, "nds_request_flags_trans_ref", "Transport Referral"),
2991        bf_boolean16(0x0200, "nds_request_flags_trans_ref2", "Transport Referral"),
2992        bf_boolean16(0x0400, "nds_request_flags_up_ref", "Up Referral"),
2993        bf_boolean16(0x0800, "nds_request_flags_dn_ref", "Down Referral"),
2994])
2995NDSStatus                       = uint32("nds_status", "NDS Status")
2996NetBIOSBroadcastWasPropagated   = uint32("netbios_broadcast_was_propagated", "NetBIOS Broadcast Was Propagated")
2997NetIDNumber                     = uint32("net_id_number", "Net ID Number")
2998NetIDNumber.Display("BASE_HEX")
2999NetAddress                      = nbytes32("address", "Address")
3000NetStatus                       = uint16("net_status", "Network Status")
3001NetWareAccessHandle             = bytes("netware_access_handle", "NetWare Access Handle", 6)
3002NetworkAddress                  = uint32("network_address", "Network Address")
3003NetworkAddress.Display("BASE_HEX")
3004NetworkNodeAddress              = bytes("network_node_address", "Network Node Address", 6)
3005NetworkNumber                   = uint32("network_number", "Network Number")
3006NetworkNumber.Display("BASE_HEX")
3007#
3008# XXX - this should have the "ipx_socket_vals" value_string table
3009# from "packet-ipx.c".
3010#
3011NetworkSocket                   = uint16("network_socket", "Network Socket")
3012NetworkSocket.Display("BASE_HEX")
3013NewAccessRights                 = bitfield16("new_access_rights_mask", "New Access Rights", [
3014        bf_boolean16(0x0001, "new_access_rights_read", "Read"),
3015        bf_boolean16(0x0002, "new_access_rights_write", "Write"),
3016        bf_boolean16(0x0004, "new_access_rights_open", "Open"),
3017        bf_boolean16(0x0008, "new_access_rights_create", "Create"),
3018        bf_boolean16(0x0010, "new_access_rights_delete", "Delete"),
3019        bf_boolean16(0x0020, "new_access_rights_parental", "Parental"),
3020        bf_boolean16(0x0040, "new_access_rights_search", "Search"),
3021        bf_boolean16(0x0080, "new_access_rights_modify", "Modify"),
3022        bf_boolean16(0x0100, "new_access_rights_supervisor", "Supervisor"),
3023])
3024NewDirectoryID                  = uint32("new_directory_id", "New Directory ID", ENC_BIG_ENDIAN)
3025NewDirectoryID.Display("BASE_HEX")
3026NewEAHandle                     = uint32("new_ea_handle", "New EA Handle")
3027NewEAHandle.Display("BASE_HEX")
3028NewFileName                     = fw_string("new_file_name", "New File Name", 14)
3029NewFileNameLen                  = nstring8("new_file_name_len", "New File Name")
3030NewFileSize                     = uint32("new_file_size", "New File Size")
3031NewPassword                     = nstring8("new_password", "New Password")
3032NewPath                         = nstring8("new_path", "New Path")
3033NewPosition                     = uint8("new_position", "New Position")
3034NewObjectName                   = nstring8("new_object_name", "New Object Name")
3035NextCntBlock                    = uint32("next_cnt_block", "Next Count Block")
3036NextHugeStateInfo               = bytes("next_huge_state_info", "Next Huge State Info", 16)
3037nextLimbScanNum                 = uint32("next_limb_scan_num", "Next Limb Scan Number")
3038NextObjectID                    = uint32("next_object_id", "Next Object ID", ENC_BIG_ENDIAN)
3039NextObjectID.Display("BASE_HEX")
3040NextRecord                      = uint32("next_record", "Next Record")
3041NextRequestRecord               = uint16("next_request_record", "Next Request Record")
3042NextSearchIndex                 = uint16("next_search_index", "Next Search Index")
3043NextSearchNumber                = uint16("next_search_number", "Next Search Number")
3044NextSearchNum                   = uint32("nxt_search_num", "Next Search Number")
3045nextStartingNumber              = uint32("next_starting_number", "Next Starting Number")
3046NextTrusteeEntry                = uint32("next_trustee_entry", "Next Trustee Entry")
3047NextVolumeNumber                = uint32("next_volume_number", "Next Volume Number")
3048NLMBuffer                       = nstring8("nlm_buffer", "Buffer")
3049NLMcount                        = uint32("nlm_count", "NLM Count")
3050NLMFlags                        = bitfield8("nlm_flags", "Flags", [
3051        bf_boolean8(0x01, "nlm_flags_reentrant", "ReEntrant"),
3052        bf_boolean8(0x02, "nlm_flags_multiple", "Can Load Multiple Times"),
3053        bf_boolean8(0x04, "nlm_flags_synchronize", "Synchronize Start"),
3054        bf_boolean8(0x08, "nlm_flags_pseudo", "PseudoPreemption"),
3055])
3056NLMLoadOptions                  = uint32("nlm_load_options", "NLM Load Options")
3057NLMName                         = stringz("nlm_name_stringz", "NLM Name")
3058NLMNumber                       = uint32("nlm_number", "NLM Number")
3059NLMNumbers                      = uint32("nlm_numbers", "NLM Numbers")
3060NLMsInList                      = uint32("nlms_in_list", "NLM's in List")
3061NLMStartNumber                  = uint32("nlm_start_num", "NLM Start Number")
3062NLMType                         = val_string8("nlm_type", "NLM Type", [
3063        [ 0x00, "Generic NLM (.NLM)" ],
3064        [ 0x01, "LAN Driver (.LAN)" ],
3065        [ 0x02, "Disk Driver (.DSK)" ],
3066        [ 0x03, "Name Space Support Module (.NAM)" ],
3067        [ 0x04, "Utility or Support Program (.NLM)" ],
3068        [ 0x05, "Mirrored Server Link (.MSL)" ],
3069        [ 0x06, "OS NLM (.NLM)" ],
3070        [ 0x07, "Paged High OS NLM (.NLM)" ],
3071        [ 0x08, "Host Adapter Module (.HAM)" ],
3072        [ 0x09, "Custom Device Module (.CDM)" ],
3073        [ 0x0a, "File System Engine (.NLM)" ],
3074        [ 0x0b, "Real Mode NLM (.NLM)" ],
3075        [ 0x0c, "Hidden NLM (.NLM)" ],
3076        [ 0x15, "NICI Support (.NLM)" ],
3077        [ 0x16, "NICI Support (.NLM)" ],
3078        [ 0x17, "Cryptography (.NLM)" ],
3079        [ 0x18, "Encryption (.NLM)" ],
3080        [ 0x19, "NICI Support (.NLM)" ],
3081        [ 0x1c, "NICI Support (.NLM)" ],
3082])
3083nodeFlags                       = uint32("node_flags", "Node Flags")
3084nodeFlags.Display("BASE_HEX")
3085NoMoreMemAvlCnt                 = uint32("no_more_mem_avail", "No More Memory Available Count")
3086NonDedFlag                      = boolean8("non_ded_flag", "Non Dedicated Flag")
3087NonFreeableAvailableSubAllocSectors = uint32("non_freeable_avail_sub_alloc_sectors", "Non Freeable Available Sub Alloc Sectors")
3088NonFreeableLimboSectors         = uint32("non_freeable_limbo_sectors", "Non Freeable Limbo Sectors")
3089NotUsableSubAllocSectors        = uint32("not_usable_sub_alloc_sectors", "Not Usable Sub Alloc Sectors")
3090NotYetPurgeableBlocks           = uint32("not_yet_purgeable_blocks", "Not Yet Purgeable Blocks")
3091NSInfoBitMask                   = uint32("ns_info_bit_mask", "Name Space Info Bit Mask")
3092NSSOAllInFlags                  = bitfield32("nsso_all_in_flags", "SecretStore All Input Flags",[
3093        bf_boolean32(0x00000010, "nsso_all_unicode", "Unicode Data"),
3094        bf_boolean32(0x00000080, "nsso_set_tree", "Set Tree"),
3095        bf_boolean32(0x00000200, "nsso_destroy_ctx", "Destroy Context"),
3096])
3097NSSOGetServiceInFlags           = bitfield32("nsso_get_svc_in_flags", "SecretStore Get Service Flags",[
3098        bf_boolean32(0x00000100, "nsso_get_ctx", "Get Context"),
3099])
3100NSSOReadInFlags                 = bitfield32("nsso_read_in_flags", "SecretStore Read Flags",[
3101        bf_boolean32(0x00000001, "nsso_rw_enh_prot", "Read/Write Enhanced Protection"),
3102        bf_boolean32(0x00000008, "nsso_repair", "Repair SecretStore"),
3103])
3104NSSOReadOrUnlockInFlags         = bitfield32("nsso_read_or_unlock_in_flags", "SecretStore Read or Unlock Flags",[
3105        bf_boolean32(0x00000004, "nsso_ep_master_pwd", "Master Password used instead of ENH Password"),
3106])
3107NSSOUnlockInFlags               = bitfield32("nsso_unlock_in_flags", "SecretStore Unlock Flags",[
3108        bf_boolean32(0x00000004, "nsso_rmv_lock", "Remove Lock from Store"),
3109])
3110NSSOWriteInFlags                = bitfield32("nsso_write_in_flags", "SecretStore Write Flags",[
3111        bf_boolean32(0x00000001, "nsso_enh_prot", "Enhanced Protection"),
3112        bf_boolean32(0x00000002, "nsso_create_id", "Create ID"),
3113        bf_boolean32(0x00000040, "nsso_ep_pwd_used", "Enhanced Protection Password Used"),
3114])
3115NSSOContextOutFlags             = bitfield32("nsso_cts_out_flags", "Type of Context",[
3116        bf_boolean32(0x00000001, "nsso_ds_ctx", "DSAPI Context"),
3117        bf_boolean32(0x00000080, "nsso_ldap_ctx", "LDAP Context"),
3118        bf_boolean32(0x00000200, "nsso_dc_ctx", "Reserved"),
3119])
3120NSSOGetServiceOutFlags          = bitfield32("nsso_get_svc_out_flags", "SecretStore Status Flags",[
3121        bf_boolean32(0x00400000, "nsso_mstr_pwd", "Master Password Present"),
3122])
3123NSSOGetServiceReadOutFlags      = bitfield32("nsso_get_svc_read_out_flags", "SecretStore Status Flags",[
3124        bf_boolean32(0x00800000, "nsso_mp_disabled", "Master Password Disabled"),
3125])
3126NSSOReadOutFlags                = bitfield32("nsso_read_out_flags", "SecretStore Read Flags",[
3127        bf_boolean32(0x00010000, "nsso_secret_locked", "Enhanced Protection Lock on Secret"),
3128        bf_boolean32(0x00020000, "nsso_secret_not_init", "Secret Not Yet Initialized"),
3129        bf_boolean32(0x00040000, "nsso_secret_marked", "Secret Marked for Enhanced Protection"),
3130        bf_boolean32(0x00080000, "nsso_secret_not_sync", "Secret Not Yet Synchronized in NDS"),
3131        bf_boolean32(0x00200000, "nsso_secret_enh_pwd", "Enhanced Protection Password on Secret"),
3132])
3133NSSOReadOutStatFlags            = bitfield32("nsso_read_out_stat_flags", "SecretStore Read Status Flags",[
3134        bf_boolean32(0x00100000, "nsso_admin_mod", "Admin Modified Secret Last"),
3135])
3136NSSOVerb                        = val_string8("nsso_verb", "SecretStore Verb", [
3137        [ 0x00, "Query Server" ],
3138        [ 0x01, "Read App Secrets" ],
3139        [ 0x02, "Write App Secrets" ],
3140        [ 0x03, "Add Secret ID" ],
3141        [ 0x04, "Remove Secret ID" ],
3142        [ 0x05, "Remove SecretStore" ],
3143        [ 0x06, "Enumerate SecretID's" ],
3144        [ 0x07, "Unlock Store" ],
3145        [ 0x08, "Set Master Password" ],
3146        [ 0x09, "Get Service Information" ],
3147])
3148NSSpecificInfo                  = fw_string("ns_specific_info", "Name Space Specific Info", 512)
3149NumberOfActiveTasks             = uint8("num_of_active_tasks", "Number of Active Tasks")
3150NumberOfAllocs                  = uint32("num_of_allocs", "Number of Allocations")
3151NumberOfCPUs                    = uint32("number_of_cpus", "Number of CPU's")
3152NumberOfDataStreams             = uint16("number_of_data_streams", "Number of Data Streams")
3153NumberOfDataStreamsLong     = uint32("number_of_data_streams_long", "Number of Data Streams")
3154NumberOfDynamicMemoryAreas      = uint16("number_of_dynamic_memory_areas", "Number Of Dynamic Memory Areas")
3155NumberOfEntries                 = uint8("number_of_entries", "Number of Entries")
3156NumberOfEntriesLong             = uint32("number_of_entries_long", "Number of Entries")
3157NumberOfLocks                   = uint8("number_of_locks", "Number of Locks")
3158NumberOfMinutesToDelay          = uint32("number_of_minutes_to_delay", "Number of Minutes to Delay")
3159NumberOfNCPExtensions           = uint32("number_of_ncp_extensions", "Number Of NCP Extensions")
3160NumberOfNSLoaded                = uint16("number_of_ns_loaded", "Number Of Name Spaces Loaded")
3161NumberOfProtocols               = uint8("number_of_protocols", "Number of Protocols")
3162NumberOfRecords                 = uint16("number_of_records", "Number of Records")
3163NumberOfReferencedPublics       = uint32("num_of_ref_publics", "Number of Referenced Public Symbols")
3164NumberOfSemaphores              = uint16("number_of_semaphores", "Number Of Semaphores")
3165NumberOfServiceProcesses        = uint8("number_of_service_processes", "Number Of Service Processes")
3166NumberOfSetCategories           = uint32("number_of_set_categories", "Number Of Set Categories")
3167NumberOfSMs                     = uint32("number_of_sms", "Number Of Storage Medias")
3168NumberOfStations                = uint8("number_of_stations", "Number of Stations")
3169NumBytes                        = uint16("num_bytes", "Number of Bytes")
3170NumBytesLong                    = uint32("num_bytes_long", "Number of Bytes")
3171NumOfCCinPkt                    = uint32("num_of_cc_in_pkt", "Number of Custom Counters in Packet")
3172NumOfChecks                     = uint32("num_of_checks", "Number of Checks")
3173NumOfEntries                    = uint32("num_of_entries", "Number of Entries")
3174NumOfFilesMigrated              = uint32("num_of_files_migrated", "Number Of Files Migrated")
3175NumOfGarbageColl                = uint32("num_of_garb_coll", "Number of Garbage Collections")
3176NumOfNCPReqs                    = uint32("num_of_ncp_reqs", "Number of NCP Requests since Server was brought up")
3177NumOfSegments                   = uint32("num_of_segments", "Number of Segments")
3178
3179ObjectCount                     = uint32("object_count", "Object Count")
3180ObjectFlags                     = val_string8("object_flags", "Object Flags", [
3181        [ 0x00, "Dynamic object" ],
3182        [ 0x01, "Static object" ],
3183])
3184ObjectHasProperties             = val_string8("object_has_properites", "Object Has Properties", [
3185        [ 0x00, "No properties" ],
3186        [ 0xff, "One or more properties" ],
3187])
3188ObjectID                        = uint32("object_id", "Object ID", ENC_BIG_ENDIAN)
3189ObjectID.Display('BASE_HEX')
3190ObjectIDCount                   = uint16("object_id_count", "Object ID Count")
3191ObjectIDInfo                    = uint32("object_id_info", "Object Information")
3192ObjectInfoReturnCount           = uint32("object_info_rtn_count", "Object Information Count")
3193ObjectName                      = nstring8("object_name", "Object Name")
3194ObjectNameLen                   = fw_string("object_name_len", "Object Name", 48)
3195ObjectNameStringz               = stringz("object_name_stringz", "Object Name")
3196ObjectNumber                    = uint32("object_number", "Object Number")
3197ObjectSecurity                  = val_string8("object_security", "Object Security", [
3198        [ 0x00, "Object Read (Anyone) / Object Write (Anyone)" ],
3199        [ 0x01, "Object Read (Logged in) / Object Write (Anyone)" ],
3200        [ 0x02, "Object Read (Logged in as Object) / Object Write (Anyone)" ],
3201        [ 0x03, "Object Read (Supervisor) / Object Write (Anyone)" ],
3202        [ 0x04, "Object Read (Operating System Only) / Object Write (Anyone)" ],
3203        [ 0x10, "Object Read (Anyone) / Object Write (Logged in)" ],
3204        [ 0x11, "Object Read (Logged in) / Object Write (Logged in)" ],
3205        [ 0x12, "Object Read (Logged in as Object) / Object Write (Logged in)" ],
3206        [ 0x13, "Object Read (Supervisor) / Object Write (Logged in)" ],
3207        [ 0x14, "Object Read (Operating System Only) / Object Write (Logged in)" ],
3208        [ 0x20, "Object Read (Anyone) / Object Write (Logged in as Object)" ],
3209        [ 0x21, "Object Read (Logged in) / Object Write (Logged in as Object)" ],
3210        [ 0x22, "Object Read (Logged in as Object) / Object Write (Logged in as Object)" ],
3211        [ 0x23, "Object Read (Supervisor) / Object Write (Logged in as Object)" ],
3212        [ 0x24, "Object Read (Operating System Only) / Object Write (Logged in as Object)" ],
3213        [ 0x30, "Object Read (Anyone) / Object Write (Supervisor)" ],
3214        [ 0x31, "Object Read (Logged in) / Object Write (Supervisor)" ],
3215        [ 0x32, "Object Read (Logged in as Object) / Object Write (Supervisor)" ],
3216        [ 0x33, "Object Read (Supervisor) / Object Write (Supervisor)" ],
3217        [ 0x34, "Object Read (Operating System Only) / Object Write (Supervisor)" ],
3218        [ 0x40, "Object Read (Anyone) / Object Write (Operating System Only)" ],
3219        [ 0x41, "Object Read (Logged in) / Object Write (Operating System Only)" ],
3220        [ 0x42, "Object Read (Logged in as Object) / Object Write (Operating System Only)" ],
3221        [ 0x43, "Object Read (Supervisor) / Object Write (Operating System Only)" ],
3222        [ 0x44, "Object Read (Operating System Only) / Object Write (Operating System Only)" ],
3223])
3224#
3225# XXX - should this use the "server_vals[]" value_string array from
3226# "packet-ipx.c"?
3227#
3228# XXX - should this list be merged with that list?  There are some
3229# oddities, e.g. this list has 0x03f5 for "Microsoft SQL Server", but
3230# the list from "packet-ipx.c" has 0xf503 for that - is that just
3231# byte-order confusion?
3232#
3233ObjectType                      = val_string16("object_type", "Object Type", [
3234        [ 0x0000,       "Unknown" ],
3235        [ 0x0001,       "User" ],
3236        [ 0x0002,       "User group" ],
3237        [ 0x0003,       "Print queue" ],
3238        [ 0x0004,       "NetWare file server" ],
3239        [ 0x0005,       "Job server" ],
3240        [ 0x0006,       "Gateway" ],
3241        [ 0x0007,       "Print server" ],
3242        [ 0x0008,       "Archive queue" ],
3243        [ 0x0009,       "Archive server" ],
3244        [ 0x000a,       "Job queue" ],
3245        [ 0x000b,       "Administration" ],
3246        [ 0x0021,       "NAS SNA gateway" ],
3247        [ 0x0026,       "Remote bridge server" ],
3248        [ 0x0027,       "TCP/IP gateway" ],
3249        [ 0x0047,       "Novell Print Server" ],
3250        [ 0x004b,       "Btrieve Server" ],
3251        [ 0x004c,       "NetWare SQL Server" ],
3252        [ 0x0064,       "ARCserve" ],
3253        [ 0x0066,       "ARCserve 3.0" ],
3254        [ 0x0076,       "NetWare SQL" ],
3255        [ 0x00a0,       "Gupta SQL Base Server" ],
3256        [ 0x00a1,       "Powerchute" ],
3257        [ 0x0107,       "NetWare Remote Console" ],
3258        [ 0x01cb,       "Shiva NetModem/E" ],
3259        [ 0x01cc,       "Shiva LanRover/E" ],
3260        [ 0x01cd,       "Shiva LanRover/T" ],
3261        [ 0x01d8,       "Castelle FAXPress Server" ],
3262        [ 0x01da,       "Castelle Print Server" ],
3263        [ 0x01dc,       "Castelle Fax Server" ],
3264        [ 0x0200,       "Novell SQL Server" ],
3265        [ 0x023a,       "NetWare Lanalyzer Agent" ],
3266        [ 0x023c,       "DOS Target Service Agent" ],
3267        [ 0x023f,       "NetWare Server Target Service Agent" ],
3268        [ 0x024f,       "Appletalk Remote Access Service" ],
3269        [ 0x0263,       "NetWare Management Agent" ],
3270        [ 0x0264,       "Global MHS" ],
3271        [ 0x0265,       "SNMP" ],
3272        [ 0x026a,       "NetWare Management/NMS Console" ],
3273        [ 0x026b,       "NetWare Time Synchronization" ],
3274        [ 0x0273,       "Nest Device" ],
3275        [ 0x0274,       "GroupWise Message Multiple Servers" ],
3276        [ 0x0278,       "NDS Replica Server" ],
3277        [ 0x0282,       "NDPS Service Registry Service" ],
3278        [ 0x028a,       "MPR/IPX Address Mapping Gateway" ],
3279        [ 0x028b,       "ManageWise" ],
3280        [ 0x0293,       "NetWare 6" ],
3281        [ 0x030c,       "HP JetDirect" ],
3282        [ 0x0328,       "Watcom SQL Server" ],
3283        [ 0x0355,       "Backup Exec" ],
3284        [ 0x039b,       "Lotus Notes" ],
3285        [ 0x03e1,       "Univel Server" ],
3286        [ 0x03f5,       "Microsoft SQL Server" ],
3287        [ 0x055e,       "Lexmark Print Server" ],
3288        [ 0x0640,       "Microsoft Gateway Services for NetWare" ],
3289        [ 0x064e,       "Microsoft Internet Information Server" ],
3290        [ 0x077b,       "Advantage Database Server" ],
3291        [ 0x07a7,       "Backup Exec Job Queue" ],
3292        [ 0x07a8,       "Backup Exec Job Manager" ],
3293        [ 0x07a9,       "Backup Exec Job Service" ],
3294        [ 0x5555,       "Site Lock" ],
3295        [ 0x8202,       "NDPS Broker" ],
3296])
3297OCRetFlags                      = val_string8("o_c_ret_flags", "Open Create Return Flags", [
3298        [ 0x00, "No CallBack has been registered (No Op-Lock)" ],
3299        [ 0x01, "Request has been registered for CallBack (Op-Lock)" ],
3300])
3301OESServer                       = val_string8("oes_server", "Type of Novell Server", [
3302        [ 0x00, "NetWare" ],
3303        [ 0x01, "OES" ],
3304        [ 0x02, "OES 64bit" ],
3305])
3306
3307OESLinuxOrNetWare                       = val_string8("oeslinux_or_netware", "Kernel Type", [
3308        [ 0x00, "NetWare" ],
3309        [ 0x01, "Linux" ],
3310])
3311
3312OldestDeletedFileAgeInTicks     = uint32("oldest_deleted_file_age_in_ticks", "Oldest Deleted File Age in Ticks")
3313OldFileName                     = bytes("old_file_name", "Old File Name", 15)
3314OldFileSize                     = uint32("old_file_size", "Old File Size")
3315OpenCount                       = uint16("open_count", "Open Count")
3316OpenCreateAction                = bitfield8("open_create_action", "Open Create Action", [
3317        bf_boolean8(0x01, "open_create_action_opened", "Opened"),
3318        bf_boolean8(0x02, "open_create_action_created", "Created"),
3319        bf_boolean8(0x04, "open_create_action_replaced", "Replaced"),
3320        bf_boolean8(0x08, "open_create_action_compressed", "Compressed"),
3321        bf_boolean8(0x80, "open_create_action_read_only", "Read Only"),
3322])
3323OpenCreateMode                  = bitfield8("open_create_mode", "Open Create Mode", [
3324        bf_boolean8(0x01, "open_create_mode_open", "Open existing file (file must exist)"),
3325        bf_boolean8(0x02, "open_create_mode_replace", "Replace existing file"),
3326        bf_boolean8(0x08, "open_create_mode_create", "Create new file or subdirectory (file or subdirectory cannot exist)"),
3327    bf_boolean8(0x20, "open_create_mode_64bit", "Open 64-bit Access"),
3328    bf_boolean8(0x40, "open_create_mode_ro", "Open with Read Only Access"),
3329        bf_boolean8(0x80, "open_create_mode_oplock", "Open Callback (Op-Lock)"),
3330])
3331OpenForReadCount                = uint16("open_for_read_count", "Open For Read Count")
3332OpenForWriteCount               = uint16("open_for_write_count", "Open For Write Count")
3333OpenRights                      = bitfield8("open_rights", "Open Rights", [
3334        bf_boolean8(0x01, "open_rights_read_only", "Read Only"),
3335        bf_boolean8(0x02, "open_rights_write_only", "Write Only"),
3336        bf_boolean8(0x04, "open_rights_deny_read", "Deny Read"),
3337        bf_boolean8(0x08, "open_rights_deny_write", "Deny Write"),
3338        bf_boolean8(0x10, "open_rights_compat", "Compatibility"),
3339        bf_boolean8(0x40, "open_rights_write_thru", "File Write Through"),
3340])
3341OptionNumber                    = uint8("option_number", "Option Number")
3342originalSize            = uint32("original_size", "Original Size")
3343OSLanguageID                    = uint8("os_language_id", "OS Language ID")
3344OSMajorVersion                  = uint8("os_major_version", "OS Major Version")
3345OSMinorVersion                  = uint8("os_minor_version", "OS Minor Version")
3346OSRevision                          = uint32("os_revision", "OS Revision")
3347OtherFileForkSize               = uint32("other_file_fork_size", "Other File Fork Size")
3348OtherFileForkFAT                = uint32("other_file_fork_fat", "Other File Fork FAT Entry")
3349OutgoingPacketDiscardedNoTurboBuffer = uint16("outgoing_packet_discarded_no_turbo_buffer", "Outgoing Packet Discarded No Turbo Buffer")
3350
3351PacketsDiscardedByHopCount      = uint16("packets_discarded_by_hop_count", "Packets Discarded By Hop Count")
3352PacketsDiscardedUnknownNet      = uint16("packets_discarded_unknown_net", "Packets Discarded Unknown Net")
3353PacketsFromInvalidConnection    = uint16("packets_from_invalid_connection", "Packets From Invalid Connection")
3354PacketsReceivedDuringProcessing = uint16("packets_received_during_processing", "Packets Received During Processing")
3355PacketsWithBadRequestType       = uint16("packets_with_bad_request_type", "Packets With Bad Request Type")
3356PacketsWithBadSequenceNumber    = uint16("packets_with_bad_sequence_number", "Packets With Bad Sequence Number")
3357PageTableOwnerFlag              = uint32("page_table_owner_flag", "Page Table Owner")
3358ParentID                        = uint32("parent_id", "Parent ID")
3359ParentID.Display("BASE_HEX")
3360ParentBaseID                    = uint32("parent_base_id", "Parent Base ID")
3361ParentBaseID.Display("BASE_HEX")
3362ParentDirectoryBase             = uint32("parent_directory_base", "Parent Directory Base")
3363ParentDOSDirectoryBase          = uint32("parent_dos_directory_base", "Parent DOS Directory Base")
3364ParentObjectNumber              = uint32("parent_object_number", "Parent Object Number")
3365ParentObjectNumber.Display("BASE_HEX")
3366Password                        = nstring8("password", "Password")
3367PathBase                        = uint8("path_base", "Path Base")
3368PathComponentCount              = uint16("path_component_count", "Path Component Count")
3369PathComponentSize               = uint16("path_component_size", "Path Component Size")
3370PathCookieFlags                 = val_string16("path_cookie_flags", "Path Cookie Flags", [
3371        [ 0x0000, "Last component is Not a File Name" ],
3372        [ 0x0001, "Last component is a File Name" ],
3373])
3374PathCount                       = uint8("path_count", "Path Count")
3375#
3376# XXX - in at least some File Search Continue requests, the string
3377# length value is longer than the string, and there's a NUL, followed
3378# by other non-zero cruft, in the string.  Should this be an
3379# "nstringz8", with FT_UINT_STRINGZPAD added to support it?  And
3380# does that apply to any other values?
3381#
3382Path                            = nstring8("path", "Path")
3383Path16              = nstring16("path16", "Path")
3384PathAndName                     = stringz("path_and_name", "Path and Name")
3385PendingIOCommands               = uint16("pending_io_commands", "Pending IO Commands")
3386PhysicalDiskNumber              = uint8("physical_disk_number", "Physical Disk Number")
3387PhysicalDriveCount              = uint8("physical_drive_count", "Physical Drive Count")
3388PhysicalLockThreshold           = uint8("physical_lock_threshold", "Physical Lock Threshold")
3389PingVersion                     = uint16("ping_version", "Ping Version")
3390PoolName            = stringz("pool_name", "Pool Name")
3391PositiveAcknowledgesSent        = uint16("positive_acknowledges_sent", "Positive Acknowledges Sent")
3392PreCompressedSectors            = uint32("pre_compressed_sectors", "Precompressed Sectors")
3393PreviousRecord                  = uint32("previous_record", "Previous Record")
3394PrimaryEntry                    = uint32("primary_entry", "Primary Entry")
3395PrintFlags                      = bitfield8("print_flags", "Print Flags", [
3396        bf_boolean8(0x08, "print_flags_ff", "Suppress Form Feeds"),
3397    bf_boolean8(0x10, "print_flags_cr", "Create"),
3398        bf_boolean8(0x20, "print_flags_del_spool", "Delete Spool File after Printing"),
3399        bf_boolean8(0x40, "print_flags_exp_tabs", "Expand Tabs in the File"),
3400        bf_boolean8(0x80, "print_flags_banner", "Print Banner Page"),
3401])
3402PrinterHalted                   = val_string8("printer_halted", "Printer Halted", [
3403        [ 0x00, "Printer is not Halted" ],
3404        [ 0xff, "Printer is Halted" ],
3405])
3406PrinterOffLine                  = val_string8( "printer_offline", "Printer Off-Line", [
3407        [ 0x00, "Printer is On-Line" ],
3408        [ 0xff, "Printer is Off-Line" ],
3409])
3410PrintServerVersion              = uint8("print_server_version", "Print Server Version")
3411Priority                        = uint32("priority", "Priority")
3412Privileges                      = uint32("privileges", "Login Privileges")
3413ProcessorType                   = val_string8("processor_type", "Processor Type", [
3414        [ 0x00, "Motorola 68000" ],
3415        [ 0x01, "Intel 8088 or 8086" ],
3416        [ 0x02, "Intel 80286" ],
3417])
3418ProDOSInfo                      = bytes("pro_dos_info", "Pro DOS Info", 6)
3419ProductMajorVersion             = uint16("product_major_version", "Product Major Version")
3420ProductMinorVersion             = uint16("product_minor_version", "Product Minor Version")
3421ProductRevisionVersion          = uint8("product_revision_version", "Product Revision Version")
3422projectedCompSize               = uint32("projected_comp_size", "Projected Compression Size")
3423PropertyHasMoreSegments         = val_string8("property_has_more_segments",
3424        "Property Has More Segments", [
3425        [ 0x00, "Is last segment" ],
3426        [ 0xff, "More segments are available" ],
3427])
3428PropertyName                    = nstring8("property_name", "Property Name")
3429PropertyName16                  = fw_string("property_name_16", "Property Name", 16)
3430PropertyData                    = bytes("property_data", "Property Data", 128)
3431PropertySegment                 = uint8("property_segment", "Property Segment")
3432PropertyType                    = val_string8("property_type", "Property Type", [
3433        [ 0x00, "Display Static property" ],
3434        [ 0x01, "Display Dynamic property" ],
3435        [ 0x02, "Set Static property" ],
3436        [ 0x03, "Set Dynamic property" ],
3437])
3438PropertyValue                   = fw_string("property_value", "Property Value", 128)
3439ProposedMaxSize                 = uint16("proposed_max_size", "Proposed Max Size")
3440ProposedMaxSize64               = uint64("proposed_max_size64", "Proposed Max Size")
3441protocolFlags                   = uint32("protocol_flags", "Protocol Flags")
3442protocolFlags.Display("BASE_HEX")
3443PurgeableBlocks                 = uint32("purgeable_blocks", "Purgeable Blocks")
3444PurgeCcode                      = uint32("purge_c_code", "Purge Completion Code")
3445PurgeCount                      = uint32("purge_count", "Purge Count")
3446PurgeFlags                      = val_string16("purge_flags", "Purge Flags", [
3447        [ 0x0000, "Do not Purge All" ],
3448        [ 0x0001, "Purge All" ],
3449    [ 0xffff, "Do not Purge All" ],
3450])
3451PurgeList                       = uint32("purge_list", "Purge List")
3452PhysicalDiskChannel             = uint8("physical_disk_channel", "Physical Disk Channel")
3453PhysicalDriveType               = val_string8("physical_drive_type", "Physical Drive Type", [
3454        [ 0x01, "XT" ],
3455        [ 0x02, "AT" ],
3456        [ 0x03, "SCSI" ],
3457        [ 0x04, "Disk Coprocessor" ],
3458        [ 0x05, "PS/2 with MFM Controller" ],
3459        [ 0x06, "PS/2 with ESDI Controller" ],
3460        [ 0x07, "Convergent Technology SBIC" ],
3461])
3462PhysicalReadErrors              = uint16("physical_read_errors", "Physical Read Errors")
3463PhysicalReadRequests            = uint32("physical_read_requests", "Physical Read Requests")
3464PhysicalWriteErrors             = uint16("physical_write_errors", "Physical Write Errors")
3465PhysicalWriteRequests           = uint32("physical_write_requests", "Physical Write Requests")
3466PrintToFileFlag                 = boolean8("print_to_file_flag", "Print to File Flag")
3467
3468QueueID                         = uint32("queue_id", "Queue ID")
3469QueueID.Display("BASE_HEX")
3470QueueName                       = nstring8("queue_name", "Queue Name")
3471QueueStartPosition              = uint32("queue_start_position", "Queue Start Position")
3472QueueStatus                     = bitfield8("queue_status", "Queue Status", [
3473        bf_boolean8(0x01, "queue_status_new_jobs", "Operator does not want to add jobs to the queue"),
3474        bf_boolean8(0x02, "queue_status_pserver", "Operator does not want additional servers attaching"),
3475        bf_boolean8(0x04, "queue_status_svc_jobs", "Operator does not want servers to service jobs"),
3476])
3477QueueType                       = uint16("queue_type", "Queue Type")
3478QueueingVersion                 = uint8("qms_version", "QMS Version")
3479
3480ReadBeyondWrite                 = uint16("read_beyond_write", "Read Beyond Write")
3481RecordLockCount                 = uint16("rec_lock_count", "Record Lock Count")
3482RecordStart                     = uint32("record_start", "Record Start")
3483RecordEnd                       = uint32("record_end", "Record End")
3484RecordInUseFlag                 = val_string16("record_in_use", "Record in Use", [
3485        [ 0x0000, "Record In Use" ],
3486        [ 0xffff, "Record Not In Use" ],
3487])
3488RedirectedPrinter               = uint8( "redirected_printer", "Redirected Printer" )
3489ReferenceCount                  = uint32("reference_count", "Reference Count")
3490RelationsCount                  = uint16("relations_count", "Relations Count")
3491ReMirrorCurrentOffset           = uint32("re_mirror_current_offset", "ReMirror Current Offset")
3492ReMirrorDriveNumber             = uint8("re_mirror_drive_number", "ReMirror Drive Number")
3493RemoteMaxPacketSize             = uint32("remote_max_packet_size", "Remote Max Packet Size")
3494RemoteTargetID                  = uint32("remote_target_id", "Remote Target ID")
3495RemoteTargetID.Display("BASE_HEX")
3496RemovableFlag                   = uint16("removable_flag", "Removable Flag")
3497RemoveOpenRights                = bitfield8("remove_open_rights", "Remove Open Rights", [
3498        bf_boolean8(0x01, "remove_open_rights_ro", "Read Only"),
3499        bf_boolean8(0x02, "remove_open_rights_wo", "Write Only"),
3500        bf_boolean8(0x04, "remove_open_rights_dr", "Deny Read"),
3501        bf_boolean8(0x08, "remove_open_rights_dw", "Deny Write"),
3502        bf_boolean8(0x10, "remove_open_rights_comp", "Compatibility"),
3503        bf_boolean8(0x40, "remove_open_rights_write_thru", "Write Through"),
3504])
3505RenameFlag                      = bitfield8("rename_flag", "Rename Flag", [
3506        bf_boolean8(0x01, "rename_flag_ren", "Rename to Myself allows file to be renamed to its original name"),
3507        bf_boolean8(0x02, "rename_flag_comp", "Compatibility allows files that are marked read only to be opened with read/write access"),
3508        bf_boolean8(0x04, "rename_flag_no", "Name Only renames only the specified name space entry name"),
3509])
3510RepliesCancelled                = uint16("replies_cancelled", "Replies Cancelled")
3511ReplyBuffer                     = nstring8("reply_buffer", "Reply Buffer")
3512ReplyBufferSize                 = uint32("reply_buffer_size", "Reply Buffer Size")
3513ReplyQueueJobNumbers            = uint32("reply_queue_job_numbers", "Reply Queue Job Numbers")
3514RequestBitMap                   = bitfield16("request_bit_map", "Request Bit Map", [
3515        bf_boolean16(0x0001, "request_bit_map_ret_afp_ent", "AFP Entry ID"),
3516        bf_boolean16(0x0002, "request_bit_map_ret_data_fork", "Data Fork Length"),
3517        bf_boolean16(0x0004, "request_bit_map_ret_res_fork", "Resource Fork Length"),
3518        bf_boolean16(0x0008, "request_bit_map_ret_num_off", "Number of Offspring"),
3519        bf_boolean16(0x0010, "request_bit_map_ret_owner", "Owner ID"),
3520        bf_boolean16(0x0020, "request_bit_map_ret_short", "Short Name"),
3521        bf_boolean16(0x0040, "request_bit_map_ret_acc_priv", "Access Privileges"),
3522        bf_boolean16(0x0100, "request_bit_map_ratt", "Return Attributes"),
3523        bf_boolean16(0x0200, "request_bit_map_ret_afp_parent", "AFP Parent Entry ID"),
3524        bf_boolean16(0x0400, "request_bit_map_ret_cr_date", "Creation Date"),
3525        bf_boolean16(0x0800, "request_bit_map_ret_acc_date", "Access Date"),
3526        bf_boolean16(0x1000, "request_bit_map_ret_mod_date", "Modify Date&Time"),
3527        bf_boolean16(0x2000, "request_bit_map_ret_bak_date", "Backup Date&Time"),
3528        bf_boolean16(0x4000, "request_bit_map_ret_finder", "Finder Info"),
3529        bf_boolean16(0x8000, "request_bit_map_ret_long_nm", "Long Name"),
3530])
3531ResourceForkLen                 = uint32("resource_fork_len", "Resource Fork Len")
3532RequestCode                     = val_string8("request_code", "Request Code", [
3533        [ 0x00, "Change Logged in to Temporary Authenticated" ],
3534        [ 0x01, "Change Temporary Authenticated to Logged in" ],
3535])
3536RequestData                     = nstring8("request_data", "Request Data")
3537RequestsReprocessed = uint16("requests_reprocessed", "Requests Reprocessed")
3538Reserved                        = uint8( "reserved", "Reserved" )
3539Reserved2                       = bytes("reserved2", "Reserved", 2)
3540Reserved3                       = bytes("reserved3", "Reserved", 3)
3541Reserved4                       = bytes("reserved4", "Reserved", 4)
3542Reserved5                       = bytes("reserved5", "Reserved", 5)
3543Reserved6           = bytes("reserved6", "Reserved", 6)
3544Reserved8                       = bytes("reserved8", "Reserved", 8)
3545Reserved10          = bytes("reserved10", "Reserved", 10)
3546Reserved12                      = bytes("reserved12", "Reserved", 12)
3547Reserved16                      = bytes("reserved16", "Reserved", 16)
3548Reserved20                      = bytes("reserved20", "Reserved", 20)
3549Reserved28                      = bytes("reserved28", "Reserved", 28)
3550Reserved36                      = bytes("reserved36", "Reserved", 36)
3551Reserved44                      = bytes("reserved44", "Reserved", 44)
3552Reserved48                      = bytes("reserved48", "Reserved", 48)
3553Reserved50                      = bytes("reserved50", "Reserved", 50)
3554Reserved56                      = bytes("reserved56", "Reserved", 56)
3555Reserved64                      = bytes("reserved64", "Reserved", 64)
3556Reserved120                     = bytes("reserved120", "Reserved", 120)
3557ReservedOrDirectoryNumber       = uint32("reserved_or_directory_number", "Reserved or Directory Number (see EAFlags)")
3558ReservedOrDirectoryNumber.Display("BASE_HEX")
3559ResourceCount                   = uint32("resource_count", "Resource Count")
3560ResourceForkSize                = uint32("resource_fork_size", "Resource Fork Size")
3561ResourceName                    = stringz("resource_name", "Resource Name")
3562ResourceSignature               = fw_string("resource_sig", "Resource Signature", 4)
3563RestoreTime                     = eptime("restore_time", "Restore Time")
3564Restriction                     = uint32("restriction", "Disk Space Restriction")
3565RestrictionQuad                 = uint64("restriction_quad", "Restriction")
3566RestrictionsEnforced            = val_string8("restrictions_enforced", "Disk Restrictions Enforce Flag", [
3567        [ 0x00, "Enforced" ],
3568        [ 0xff, "Not Enforced" ],
3569])
3570ReturnInfoCount                 = uint32("return_info_count", "Return Information Count")
3571ReturnInfoMask                  = bitfield16("ret_info_mask", "Return Information", [
3572    bf_boolean16(0x0001, "ret_info_mask_fname", "Return File Name Information"),
3573        bf_boolean16(0x0002, "ret_info_mask_alloc", "Return Allocation Space Information"),
3574        bf_boolean16(0x0004, "ret_info_mask_attr", "Return Attribute Information"),
3575        bf_boolean16(0x0008, "ret_info_mask_size", "Return Size Information"),
3576        bf_boolean16(0x0010, "ret_info_mask_tspace", "Return Total Space Information"),
3577        bf_boolean16(0x0020, "ret_info_mask_eattr", "Return Extended Attributes Information"),
3578        bf_boolean16(0x0040, "ret_info_mask_arch", "Return Archive Information"),
3579        bf_boolean16(0x0080, "ret_info_mask_mod", "Return Modify Information"),
3580    bf_boolean16(0x0100, "ret_info_mask_create", "Return Creation Information"),
3581        bf_boolean16(0x0200, "ret_info_mask_ns", "Return Name Space Information"),
3582        bf_boolean16(0x0400, "ret_info_mask_dir", "Return Directory Information"),
3583        bf_boolean16(0x0800, "ret_info_mask_rights", "Return Rights Information"),
3584        bf_boolean16(0x1000, "ret_info_mask_id", "Return ID Information"),
3585        bf_boolean16(0x2000, "ret_info_mask_ns_attr", "Return Name Space Attributes Information"),
3586        bf_boolean16(0x4000, "ret_info_mask_actual", "Return Actual Information"),
3587        bf_boolean16(0x8000, "ret_info_mask_logical", "Return Logical Information"),
3588])
3589ReturnedListCount               = uint32("returned_list_count", "Returned List Count")
3590Revision                        = uint32("revision", "Revision")
3591RevisionNumber                  = uint8("revision_number", "Revision")
3592RevQueryFlag                    = val_string8("rev_query_flag", "Revoke Rights Query Flag", [
3593        [ 0x00, "Do not query the locks engine for access rights" ],
3594        [ 0x01, "Query the locks engine and return the access rights" ],
3595])
3596RightsGrantMask                 = bitfield8("rights_grant_mask", "Grant Rights", [
3597        bf_boolean8(0x01, "rights_grant_mask_read", "Read"),
3598        bf_boolean8(0x02, "rights_grant_mask_write", "Write"),
3599        bf_boolean8(0x04, "rights_grant_mask_open", "Open"),
3600        bf_boolean8(0x08, "rights_grant_mask_create", "Create"),
3601        bf_boolean8(0x10, "rights_grant_mask_del", "Delete"),
3602        bf_boolean8(0x20, "rights_grant_mask_parent", "Parental"),
3603        bf_boolean8(0x40, "rights_grant_mask_search", "Search"),
3604        bf_boolean8(0x80, "rights_grant_mask_mod", "Modify"),
3605])
3606RightsRevokeMask                = bitfield8("rights_revoke_mask", "Revoke Rights", [
3607        bf_boolean8(0x01, "rights_revoke_mask_read", "Read"),
3608        bf_boolean8(0x02, "rights_revoke_mask_write", "Write"),
3609        bf_boolean8(0x04, "rights_revoke_mask_open", "Open"),
3610        bf_boolean8(0x08, "rights_revoke_mask_create", "Create"),
3611        bf_boolean8(0x10, "rights_revoke_mask_del", "Delete"),
3612        bf_boolean8(0x20, "rights_revoke_mask_parent", "Parental"),
3613        bf_boolean8(0x40, "rights_revoke_mask_search", "Search"),
3614        bf_boolean8(0x80, "rights_revoke_mask_mod", "Modify"),
3615])
3616RIPSocketNumber                 = uint16("rip_socket_num", "RIP Socket Number")
3617RIPSocketNumber.Display("BASE_HEX")
3618RouterDownFlag                  = boolean8("router_dn_flag", "Router Down Flag")
3619RPCccode                        = val_string16("rpc_c_code", "RPC Completion Code", [
3620        [ 0x0000, "Successful" ],
3621])
3622RTagNumber                      = uint32("r_tag_num", "Resource Tag Number")
3623RTagNumber.Display("BASE_HEX")
3624RpyNearestSrvFlag               = boolean8("rpy_nearest_srv_flag", "Reply to Nearest Server Flag")
3625
3626SalvageableFileEntryNumber      = uint32("salvageable_file_entry_number", "Salvageable File Entry Number")
3627SalvageableFileEntryNumber.Display("BASE_HEX")
3628SAPSocketNumber                 = uint16("sap_socket_number", "SAP Socket Number")
3629SAPSocketNumber.Display("BASE_HEX")
3630ScanItems                       = uint32("scan_items", "Number of Items returned from Scan")
3631SearchAttributes                = bitfield8("sattr", "Search Attributes", [
3632        bf_boolean8(0x01, "sattr_ronly", "Read-Only Files Allowed"),
3633        bf_boolean8(0x02, "sattr_hid", "Hidden Files Allowed"),
3634        bf_boolean8(0x04, "sattr_sys", "System Files Allowed"),
3635        bf_boolean8(0x08, "sattr_exonly", "Execute-Only Files Allowed"),
3636        bf_boolean8(0x10, "sattr_sub", "Subdirectories Only"),
3637        bf_boolean8(0x20, "sattr_archive", "Archive"),
3638        bf_boolean8(0x40, "sattr_execute_confirm", "Execute Confirm"),
3639        bf_boolean8(0x80, "sattr_shareable", "Shareable"),
3640])
3641SearchAttributesLow             = bitfield16("search_att_low", "Search Attributes", [
3642        bf_boolean16(0x0001, "search_att_read_only", "Read-Only"),
3643        bf_boolean16(0x0002, "search_att_hidden", "Hidden Files Allowed"),
3644        bf_boolean16(0x0004, "search_att_system", "System"),
3645        bf_boolean16(0x0008, "search_att_execute_only", "Execute-Only"),
3646        bf_boolean16(0x0010, "search_att_sub", "Subdirectories Only"),
3647        bf_boolean16(0x0020, "search_att_archive", "Archive"),
3648        bf_boolean16(0x0040, "search_att_execute_confirm", "Execute Confirm"),
3649        bf_boolean16(0x0080, "search_att_shareable", "Shareable"),
3650        bf_boolean16(0x8000, "search_attr_all_files", "All Files and Directories"),
3651])
3652SearchBitMap                            = bitfield8("search_bit_map", "Search Bit Map", [
3653        bf_boolean8(0x01, "search_bit_map_hidden", "Hidden"),
3654        bf_boolean8(0x02, "search_bit_map_sys", "System"),
3655        bf_boolean8(0x04, "search_bit_map_sub", "Subdirectory"),
3656        bf_boolean8(0x08, "search_bit_map_files", "Files"),
3657])
3658SearchConnNumber                        = uint32("search_conn_number", "Search Connection Number")
3659SearchInstance                          = uint32("search_instance", "Search Instance")
3660SearchNumber                = uint32("search_number", "Search Number")
3661SearchPattern                           = nstring8("search_pattern", "Search Pattern")
3662SearchPattern16                         = nstring16("search_pattern_16", "Search Pattern")
3663SearchSequence                          = bytes("search_sequence", "Search Sequence", 9)
3664SearchSequenceWord          = uint16("search_sequence_word", "Search Sequence", ENC_BIG_ENDIAN)
3665Second                                      = uint8("s_second", "Seconds")
3666SecondsRelativeToTheYear2000            = uint32("sec_rel_to_y2k", "Seconds Relative to the Year 2000")
3667SecretStoreVerb                         = val_string8("ss_verb", "Secret Store Verb",[
3668        [ 0x00, "Query Server" ],
3669        [ 0x01, "Read App Secrets" ],
3670        [ 0x02, "Write App Secrets" ],
3671        [ 0x03, "Add Secret ID" ],
3672        [ 0x04, "Remove Secret ID" ],
3673        [ 0x05, "Remove SecretStore" ],
3674        [ 0x06, "Enumerate Secret IDs" ],
3675        [ 0x07, "Unlock Store" ],
3676        [ 0x08, "Set Master Password" ],
3677        [ 0x09, "Get Service Information" ],
3678])
3679SecurityEquivalentList                  = fw_string("security_equiv_list", "Security Equivalent List", 128)
3680SecurityFlag                            = bitfield8("security_flag", "Security Flag", [
3681        bf_boolean8(0x01, "checksumming", "Checksumming"),
3682        bf_boolean8(0x02, "signature", "Signature"),
3683        bf_boolean8(0x04, "complete_signatures", "Complete Signatures"),
3684        bf_boolean8(0x08, "encryption", "Encryption"),
3685        bf_boolean8(0x80, "large_internet_packets", "Large Internet Packets (LIP) Disabled"),
3686])
3687SecurityRestrictionVersion              = uint8("security_restriction_version", "Security Restriction Version")
3688SectorsPerBlock                         = uint8("sectors_per_block", "Sectors Per Block")
3689SectorsPerBlockLong                     = uint32("sectors_per_block_long", "Sectors Per Block")
3690SectorsPerCluster                       = uint16("sectors_per_cluster", "Sectors Per Cluster" )
3691SectorsPerClusterLong                   = uint32("sectors_per_cluster_long", "Sectors Per Cluster" )
3692SectorsPerTrack                         = uint8("sectors_per_track", "Sectors Per Track")
3693SectorSize                              = uint32("sector_size", "Sector Size")
3694SemaphoreHandle                         = uint32("semaphore_handle", "Semaphore Handle")
3695SemaphoreName                           = nstring8("semaphore_name", "Semaphore Name")
3696SemaphoreOpenCount                      = uint8("semaphore_open_count", "Semaphore Open Count")
3697SemaphoreShareCount                     = uint8("semaphore_share_count", "Semaphore Share Count")
3698SemaphoreTimeOut                        = uint16("semaphore_time_out", "Semaphore Time Out")
3699SemaphoreValue                          = uint16("semaphore_value", "Semaphore Value")
3700SendStatus                              = val_string8("send_status", "Send Status", [
3701        [ 0x00, "Successful" ],
3702        [ 0x01, "Illegal Station Number" ],
3703        [ 0x02, "Client Not Logged In" ],
3704        [ 0x03, "Client Not Accepting Messages" ],
3705        [ 0x04, "Client Already has a Message" ],
3706        [ 0x96, "No Alloc Space for the Message" ],
3707        [ 0xfd, "Bad Station Number" ],
3708        [ 0xff, "Failure" ],
3709])
3710SequenceByte                    = uint8("sequence_byte", "Sequence")
3711SequenceNumber                  = uint32("sequence_number", "Sequence Number")
3712SequenceNumber.Display("BASE_HEX")
3713SequenceNumberLong              = uint64("sequence_number64", "Sequence Number")
3714SequenceNumberLong.Display("BASE_HEX")
3715ServerAddress                   = bytes("server_address", "Server Address", 12)
3716ServerAppNumber                 = uint16("server_app_num", "Server App Number")
3717ServerID                        = uint32("server_id_number", "Server ID", ENC_BIG_ENDIAN )
3718ServerID.Display("BASE_HEX")
3719ServerInfoFlags                 = val_string16("server_info_flags", "Server Information Flags", [
3720        [ 0x0000, "This server is not a member of a Cluster" ],
3721        [ 0x0001, "This server is a member of a Cluster" ],
3722])
3723serverListFlags                 = uint32("server_list_flags", "Server List Flags")
3724ServerName                      = fw_string("server_name", "Server Name", 48)
3725serverName50                    = fw_string("server_name50", "Server Name", 50)
3726ServerNameLen                   = nstring8("server_name_len", "Server Name")
3727ServerNameStringz               = stringz("server_name_stringz", "Server Name")
3728ServerNetworkAddress            = bytes("server_network_address", "Server Network Address", 10)
3729ServerNode                      = bytes("server_node", "Server Node", 6)
3730ServerSerialNumber              = uint32("server_serial_number", "Server Serial Number")
3731ServerStation                   = uint8("server_station", "Server Station")
3732ServerStationLong               = uint32("server_station_long", "Server Station")
3733ServerStationList               = uint8("server_station_list", "Server Station List")
3734ServerStatusRecord              = fw_string("server_status_record", "Server Status Record", 64)
3735ServerTaskNumber                = uint8("server_task_number", "Server Task Number")
3736ServerTaskNumberLong            = uint32("server_task_number_long", "Server Task Number")
3737ServerType                      = uint16("server_type", "Server Type")
3738ServerType.Display("BASE_HEX")
3739ServerUtilization               = uint32("server_utilization", "Server Utilization")
3740ServerUtilizationPercentage     = uint8("server_utilization_percentage", "Server Utilization Percentage")
3741ServiceType                     = val_string16("Service_type", "Service Type", [
3742        [ 0x0000,       "Unknown" ],
3743        [ 0x0001,       "User" ],
3744        [ 0x0002,       "User group" ],
3745        [ 0x0003,       "Print queue" ],
3746        [ 0x0004,       "NetWare file server" ],
3747        [ 0x0005,       "Job server" ],
3748        [ 0x0006,       "Gateway" ],
3749        [ 0x0007,       "Print server" ],
3750        [ 0x0008,       "Archive queue" ],
3751        [ 0x0009,       "Archive server" ],
3752        [ 0x000a,       "Job queue" ],
3753        [ 0x000b,       "Administration" ],
3754        [ 0x0021,       "NAS SNA gateway" ],
3755        [ 0x0026,       "Remote bridge server" ],
3756        [ 0x0027,       "TCP/IP gateway" ],
3757    [ 0xffff,   "All Types" ],
3758])
3759SetCmdCategory                  = val_string8("set_cmd_category", "Set Command Category", [
3760        [ 0x00, "Communications" ],
3761        [ 0x01, "Memory" ],
3762        [ 0x02, "File Cache" ],
3763        [ 0x03, "Directory Cache" ],
3764        [ 0x04, "File System" ],
3765        [ 0x05, "Locks" ],
3766        [ 0x06, "Transaction Tracking" ],
3767        [ 0x07, "Disk" ],
3768        [ 0x08, "Time" ],
3769        [ 0x09, "NCP" ],
3770        [ 0x0a, "Miscellaneous" ],
3771        [ 0x0b, "Error Handling" ],
3772        [ 0x0c, "Directory Services" ],
3773        [ 0x0d, "MultiProcessor" ],
3774        [ 0x0e, "Service Location Protocol" ],
3775        [ 0x0f, "Licensing Services" ],
3776])
3777SetCmdFlags                             = bitfield8("set_cmd_flags", "Set Command Flags", [
3778        bf_boolean8(0x01, "cmd_flags_startup_only", "Startup.ncf Only"),
3779        bf_boolean8(0x02, "cmd_flags_hidden", "Hidden"),
3780        bf_boolean8(0x04, "cmd_flags_advanced", "Advanced"),
3781        bf_boolean8(0x08, "cmd_flags_later", "Restart Server Required to Take Effect"),
3782        bf_boolean8(0x80, "cmd_flags_secure", "Console Secured"),
3783])
3784SetCmdName                      = stringz("set_cmd_name", "Set Command Name")
3785SetCmdType                      = val_string8("set_cmd_type", "Set Command Type", [
3786        [ 0x00, "Numeric Value" ],
3787        [ 0x01, "Boolean Value" ],
3788        [ 0x02, "Ticks Value" ],
3789        [ 0x04, "Time Value" ],
3790        [ 0x05, "String Value" ],
3791        [ 0x06, "Trigger Value" ],
3792        [ 0x07, "Numeric Value" ],
3793])
3794SetCmdValueNum                  = uint32("set_cmd_value_num", "Set Command Value")
3795SetCmdValueString               = stringz("set_cmd_value_string", "Set Command Value")
3796SetMask                         = bitfield32("set_mask", "Set Mask", [
3797                bf_boolean32(0x00000001, "ncp_encoded_strings", "NCP Encoded Strings"),
3798                bf_boolean32(0x00000002, "connection_code_page", "Connection Code Page"),
3799])
3800SetParmName                     = stringz("set_parm_name", "Set Parameter Name")
3801SFTErrorTable                   = bytes("sft_error_table", "SFT Error Table", 60)
3802SFTSupportLevel                 = val_string8("sft_support_level", "SFT Support Level", [
3803        [ 0x01, "Server Offers Hot Disk Error Fixing" ],
3804        [ 0x02, "Server Offers Disk Mirroring and Transaction Tracking" ],
3805        [ 0x03, "Server Offers Physical Server Mirroring" ],
3806])
3807ShareableLockCount              = uint16("shareable_lock_count", "Shareable Lock Count")
3808SharedMemoryAddresses           = bytes("shared_memory_addresses", "Shared Memory Addresses", 10)
3809ShortName                       = fw_string("short_name", "Short Name", 12)
3810ShortStkName                    = fw_string("short_stack_name", "Short Stack Name", 16)
3811SiblingCount                    = uint32("sibling_count", "Sibling Count")
3812SixtyFourBitOffsetsSupportedFlag = val_string8("64_bit_flag", "64 Bit Support", [
3813    [ 0x00, "No support for 64 bit offsets" ],
3814    [ 0x01, "64 bit offsets supported" ],
3815    [ 0x02, "Use 64 bit file transfer NCP's" ],
3816])
3817SMIDs                           = uint32("smids", "Storage Media ID's")
3818SoftwareDescription             = fw_string("software_description", "Software Description", 65)
3819SoftwareDriverType              = uint8("software_driver_type", "Software Driver Type")
3820SoftwareMajorVersionNumber      = uint8("software_major_version_number", "Software Major Version Number")
3821SoftwareMinorVersionNumber      = uint8("software_minor_version_number", "Software Minor Version Number")
3822SourceDirHandle                 = uint8("source_dir_handle", "Source Directory Handle")
3823SourceFileHandle                = bytes("s_fhandle_64bit", "Source File Handle", 6)
3824SourceFileOffset                = bytes("s_foffset", "Source File Offset", 8)
3825sourceOriginateTime             = bytes("source_originate_time", "Source Originate Time", 8)
3826SourcePath                      = nstring8("source_path", "Source Path")
3827SourcePathComponentCount        = uint8("source_component_count", "Source Path Component Count")
3828sourceReturnTime                = bytes("source_return_time", "Source Return Time", 8)
3829SpaceUsed                       = uint32("space_used", "Space Used")
3830SpaceMigrated                   = uint32("space_migrated", "Space Migrated")
3831SrcNameSpace                    = val_string8("src_name_space", "Source Name Space", [
3832        [ 0x00, "DOS Name Space" ],
3833        [ 0x01, "MAC Name Space" ],
3834        [ 0x02, "NFS Name Space" ],
3835        [ 0x04, "Long Name Space" ],
3836])
3837SubFuncStrucLen                 = uint16("sub_func_struc_len", "Structure Length")
3838SupModID                        = uint32("sup_mod_id", "Sup Mod ID")
3839StackCount                      = uint32("stack_count", "Stack Count")
3840StackFullNameStr                = nstring8("stack_full_name_str", "Stack Full Name")
3841StackMajorVN                    = uint8("stack_major_vn", "Stack Major Version Number")
3842StackMinorVN                    = uint8("stack_minor_vn", "Stack Minor Version Number")
3843StackNumber                     = uint32("stack_number", "Stack Number")
3844StartConnNumber                 = uint32("start_conn_num", "Starting Connection Number")
3845StartingBlock                   = uint16("starting_block", "Starting Block")
3846StartingNumber                  = uint32("starting_number", "Starting Number")
3847StartingSearchNumber            = uint16("start_search_number", "Start Search Number")
3848StartNumber                     = uint32("start_number", "Start Number")
3849startNumberFlag                 = uint16("start_number_flag", "Start Number Flag")
3850StartOffset64bit    = bytes("s_offset_64bit", "64bit Starting Offset", 64)
3851StartVolumeNumber               = uint32("start_volume_number", "Starting Volume Number")
3852StationList                     = uint32("station_list", "Station List")
3853StationNumber                   = bytes("station_number", "Station Number", 3)
3854StatMajorVersion                = uint8("stat_major_version", "Statistics Table Major Version")
3855StatMinorVersion                = uint8("stat_minor_version", "Statistics Table Minor Version")
3856Status                          = bitfield16("status", "Status", [
3857        bf_boolean16(0x0001, "user_info_logged_in", "Logged In"),
3858        bf_boolean16(0x0002, "user_info_being_abort", "Being Aborted"),
3859        bf_boolean16(0x0004, "user_info_audited", "Audited"),
3860        bf_boolean16(0x0008, "user_info_need_sec", "Needs Security Change"),
3861        bf_boolean16(0x0010, "user_info_mac_station", "MAC Station"),
3862        bf_boolean16(0x0020, "user_info_temp_authen", "Temporary Authenticated"),
3863        bf_boolean16(0x0040, "user_info_audit_conn", "Audit Connection Recorded"),
3864        bf_boolean16(0x0080, "user_info_dsaudit_conn", "DS Audit Connection Recorded"),
3865        bf_boolean16(0x0100, "user_info_logout", "Logout in Progress"),
3866        bf_boolean16(0x0200, "user_info_int_login", "Internal Login"),
3867        bf_boolean16(0x0400, "user_info_bindery", "Bindery Connection"),
3868])
3869StatusFlagBits                  = bitfield32("status_flag_bits", "Status Flag", [
3870        bf_boolean32(0x00000001, "status_flag_bits_suballoc", "Sub Allocation"),
3871        bf_boolean32(0x00000002, "status_flag_bits_comp", "Compression"),
3872        bf_boolean32(0x00000004, "status_flag_bits_migrate", "Migration"),
3873        bf_boolean32(0x00000008, "status_flag_bits_audit", "Audit"),
3874        bf_boolean32(0x00000010, "status_flag_bits_ro", "Read Only"),
3875        bf_boolean32(0x00000020, "status_flag_bits_im_purge", "Immediate Purge"),
3876    bf_boolean32(0x00000040, "status_flag_bits_64bit", "64Bit File Offsets"),
3877    bf_boolean32(0x00000080, "status_flag_bits_utf8", "UTF8 NCP Strings"),
3878    bf_boolean32(0x80000000, "status_flag_bits_nss", "NSS Volume"),
3879])
3880SubAllocClusters                = uint32("sub_alloc_clusters", "Sub Alloc Clusters")
3881SubAllocFreeableClusters        = uint32("sub_alloc_freeable_clusters", "Sub Alloc Freeable Clusters")
3882Subdirectory                    = uint32("sub_directory", "Subdirectory")
3883Subdirectory.Display("BASE_HEX")
3884SuggestedFileSize               = uint32("suggested_file_size", "Suggested File Size")
3885SupportModuleID                 = uint32("support_module_id", "Support Module ID")
3886SynchName                       = nstring8("synch_name", "Synch Name")
3887SystemIntervalMarker            = uint32("system_interval_marker", "System Interval Marker")
3888
3889TabSize                         = uint8( "tab_size", "Tab Size" )
3890TargetClientList                = uint8("target_client_list", "Target Client List")
3891TargetConnectionNumber          = uint16("target_connection_number", "Target Connection Number")
3892TargetDirectoryBase             = uint32("target_directory_base", "Target Directory Base")
3893TargetDirHandle                 = uint8("target_dir_handle", "Target Directory Handle")
3894TargetEntryID                   = uint32("target_entry_id", "Target Entry ID")
3895TargetEntryID.Display("BASE_HEX")
3896TargetExecutionTime             = bytes("target_execution_time", "Target Execution Time", 6)
3897TargetFileHandle                = bytes("target_file_handle", "Target File Handle", 6)
3898TargetFileOffset                = uint32("target_file_offset", "Target File Offset")
3899TargetFileOffset64bit           = bytes("t_foffset", "Target File Offset", 8)
3900TargetMessage                   = nstring8("target_message", "Message")
3901TargetPrinter                   = uint8( "target_ptr", "Target Printer" )
3902targetReceiveTime               = bytes("target_receive_time", "Target Receive Time", 8)
3903TargetServerIDNumber            = uint32("target_server_id_number", "Target Server ID Number", ENC_BIG_ENDIAN )
3904TargetServerIDNumber.Display("BASE_HEX")
3905targetTransmitTime              = bytes("target_transmit_time", "Target Transmit Time", 8)
3906TaskNumByte                     = uint8("task_num_byte", "Task Number")
3907TaskNumber                      = uint32("task_number", "Task Number")
3908TaskNumberWord                  = uint16("task_number_word", "Task Number")
3909TaskState           = val_string8("task_state", "Task State", [
3910        [ 0x00, "Normal" ],
3911        [ 0x01, "TTS explicit transaction in progress" ],
3912        [ 0x02, "TTS implicit transaction in progress" ],
3913        [ 0x04, "Shared file set lock in progress" ],
3914])
3915TextJobDescription              = fw_string("text_job_description", "Text Job Description", 50)
3916ThrashingCount                  = uint16("thrashing_count", "Thrashing Count")
3917TimeoutLimit                    = uint16("timeout_limit", "Timeout Limit")
3918TimesyncStatus                  = bitfield32("timesync_status_flags", "Timesync Status", [
3919        bf_boolean32(0x00000001, "timesync_status_sync", "Time is Synchronized"),
3920        bf_boolean32(0x00000002, "timesync_status_net_sync", "Time is Synchronized to the Network"),
3921    bf_boolean32(0x00000004, "timesync_status_active", "Time Synchronization is Active"),
3922        bf_boolean32(0x00000008, "timesync_status_external", "External Time Synchronization Active"),
3923        bf_val_str32(0x00000700, "timesync_status_server_type", "Time Server Type", [
3924                [ 0x01, "Client Time Server" ],
3925                [ 0x02, "Secondary Time Server" ],
3926                [ 0x03, "Primary Time Server" ],
3927                [ 0x04, "Reference Time Server" ],
3928                [ 0x05, "Single Reference Time Server" ],
3929        ]),
3930        bf_boolean32(0x000f0000, "timesync_status_ext_sync", "External Clock Status"),
3931])
3932TimeToNet                       = uint16("time_to_net", "Time To Net")
3933TotalBlocks                     = uint32("total_blocks", "Total Blocks")
3934TotalBlocks64                   = uint64("total_blocks64", "Total Blocks")
3935TotalBlocksToDecompress         = uint32("total_blks_to_dcompress", "Total Blocks To Decompress")
3936TotalBytesRead                  = bytes("user_info_ttl_bytes_rd", "Total Bytes Read", 6)
3937TotalBytesWritten               = bytes("user_info_ttl_bytes_wrt", "Total Bytes Written", 6)
3938TotalCacheWrites                = uint32("total_cache_writes", "Total Cache Writes")
3939TotalChangedFATs                = uint32("total_changed_fats", "Total Changed FAT Entries")
3940TotalCommonCnts                 = uint32("total_common_cnts", "Total Common Counts")
3941TotalCntBlocks                  = uint32("total_cnt_blocks", "Total Count Blocks")
3942TotalDataStreamDiskSpaceAlloc   = uint32("ttl_data_str_size_space_alloc", "Total Data Stream Disk Space Alloc")
3943TotalDirectorySlots             = uint16("total_directory_slots", "Total Directory Slots")
3944TotalDirectoryEntries           = uint32("total_dir_entries", "Total Directory Entries")
3945TotalDirEntries64               = uint64("total_dir_entries64", "Total Directory Entries")
3946TotalDynamicSpace               = uint32("total_dynamic_space", "Total Dynamic Space")
3947TotalExtendedDirectoryExtents   = uint32("total_extended_directory_extents", "Total Extended Directory Extents")
3948TotalFileServicePackets         = uint32("total_file_service_packets", "Total File Service Packets")
3949TotalFilesOpened                = uint32("total_files_opened", "Total Files Opened")
3950TotalLFSCounters                = uint32("total_lfs_counters", "Total LFS Counters")
3951TotalOffspring                  = uint16("total_offspring", "Total Offspring")
3952TotalOtherPackets               = uint32("total_other_packets", "Total Other Packets")
3953TotalQueueJobs                  = uint32("total_queue_jobs", "Total Queue Jobs")
3954TotalReadRequests               = uint32("total_read_requests", "Total Read Requests")
3955TotalRequest                    = uint32("total_request", "Total Requests")
3956TotalRequestPackets             = uint32("total_request_packets", "Total Request Packets")
3957TotalRoutedPackets              = uint32("total_routed_packets", "Total Routed Packets")
3958TotalRxPkts                     = uint32("total_rx_pkts", "Total Receive Packets")
3959TotalServerMemory               = uint16("total_server_memory", "Total Server Memory", ENC_BIG_ENDIAN)
3960TotalTransactionsBackedOut      = uint32("total_trans_backed_out", "Total Transactions Backed Out")
3961TotalTransactionsPerformed      = uint32("total_trans_performed", "Total Transactions Performed")
3962TotalTxPkts                     = uint32("total_tx_pkts", "Total Transmit Packets")
3963TotalUnfilledBackoutRequests    = uint16("total_unfilled_backout_requests", "Total Unfilled Backout Requests")
3964TotalVolumeClusters             = uint16("total_volume_clusters", "Total Volume Clusters")
3965TotalWriteRequests              = uint32("total_write_requests", "Total Write Requests")
3966TotalWriteTransactionsPerformed = uint32("total_write_trans_performed", "Total Write Transactions Performed")
3967TrackOnFlag                     = boolean8("track_on_flag", "Track On Flag")
3968TransactionDiskSpace            = uint16("transaction_disk_space", "Transaction Disk Space")
3969TransactionFATAllocations       = uint32("transaction_fat_allocations", "Transaction FAT Allocations")
3970TransactionFileSizeChanges      = uint32("transaction_file_size_changes", "Transaction File Size Changes")
3971TransactionFilesTruncated       = uint32("transaction_files_truncated", "Transaction Files Truncated")
3972TransactionNumber               = uint32("transaction_number", "Transaction Number")
3973TransactionTrackingEnabled      = uint8("transaction_tracking_enabled", "Transaction Tracking Enabled")
3974TransactionTrackingFlag         = uint16("tts_flag", "Transaction Tracking Flag")
3975TransactionTrackingSupported    = uint8("transaction_tracking_supported", "Transaction Tracking Supported")
3976TransactionVolumeNumber         = uint16("transaction_volume_number", "Transaction Volume Number")
3977TransportType                   = val_string8("transport_type", "Communications Type", [
3978        [ 0x01, "Internet Packet Exchange (IPX)" ],
3979        [ 0x05, "User Datagram Protocol (UDP)" ],
3980        [ 0x06, "Transmission Control Protocol (TCP)" ],
3981])
3982TreeLength                      = uint32("tree_length", "Tree Length")
3983TreeName                        = nstring32("tree_name", "Tree Name")
3984TrusteeAccessMask           = uint8("trustee_acc_mask", "Trustee Access Mask")
3985TrusteeRights                   = bitfield16("trustee_rights_low", "Trustee Rights", [
3986        bf_boolean16(0x0001, "trustee_rights_read", "Read"),
3987        bf_boolean16(0x0002, "trustee_rights_write", "Write"),
3988        bf_boolean16(0x0004, "trustee_rights_open", "Open"),
3989        bf_boolean16(0x0008, "trustee_rights_create", "Create"),
3990        bf_boolean16(0x0010, "trustee_rights_del", "Delete"),
3991        bf_boolean16(0x0020, "trustee_rights_parent", "Parental"),
3992        bf_boolean16(0x0040, "trustee_rights_search", "Search"),
3993        bf_boolean16(0x0080, "trustee_rights_modify", "Modify"),
3994        bf_boolean16(0x0100, "trustee_rights_super", "Supervisor"),
3995])
3996TTSLevel                        = uint8("tts_level", "TTS Level")
3997TrusteeSetNumber                = uint8("trustee_set_number", "Trustee Set Number")
3998TrusteeID                       = uint32("trustee_id_set", "Trustee ID")
3999TrusteeID.Display("BASE_HEX")
4000ttlCompBlks                     = uint32("ttl_comp_blks", "Total Compression Blocks")
4001TtlDSDskSpaceAlloc              = uint32("ttl_ds_disk_space_alloc", "Total Streams Space Allocated")
4002TtlEAs                          = uint32("ttl_eas", "Total EA's")
4003TtlEAsDataSize                  = uint32("ttl_eas_data_size", "Total EA's Data Size")
4004TtlEAsKeySize                   = uint32("ttl_eas_key_size", "Total EA's Key Size")
4005ttlIntermediateBlks             = uint32("ttl_inter_blks", "Total Intermediate Blocks")
4006TtlMigratedSize                 = uint32("ttl_migrated_size", "Total Migrated Size")
4007TtlNumOfRTags                   = uint32("ttl_num_of_r_tags", "Total Number of Resource Tags")
4008TtlNumOfSetCmds                 = uint32("ttl_num_of_set_cmds", "Total Number of Set Commands")
4009TtlValuesLength                 = uint32("ttl_values_length", "Total Values Length")
4010TtlWriteDataSize                = uint32("ttl_write_data_size", "Total Write Data Size")
4011TurboUsedForFileService         = uint16("turbo_used_for_file_service", "Turbo Used For File Service")
4012
4013UnclaimedPkts                   = uint32("un_claimed_packets", "Unclaimed Packets")
4014UnCompressableDataStreamsCount  = uint32("un_compressable_data_streams_count", "Uncompressable Data Streams Count")
4015Undefined8                      = bytes("undefined_8", "Undefined", 8)
4016Undefined28                     = bytes("undefined_28", "Undefined", 28)
4017UndefinedWord                   = uint16("undefined_word", "Undefined")
4018UniqueID                        = uint8("unique_id", "Unique ID")
4019UnknownByte                     = uint8("unknown_byte", "Unknown Byte")
4020Unused                          = uint8("un_used", "Unused")
4021UnusedBlocks                    = uint32("unused_blocks", "Unused Blocks")
4022UnUsedDirectoryEntries          = uint32("un_used_directory_entries", "Unused Directory Entries")
4023UnusedDiskBlocks                = uint32("unused_disk_blocks", "Unused Disk Blocks")
4024UnUsedExtendedDirectoryExtents  = uint32("un_used_extended_directory_extents", "Unused Extended Directory Extents")
4025UpdateDate                      = uint16("update_date", "Update Date")
4026UpdateDate.NWDate()
4027UpdateID                        = uint32("update_id", "Update ID", ENC_BIG_ENDIAN)
4028UpdateID.Display("BASE_HEX")
4029UpdateTime                      = uint16("update_time", "Update Time")
4030UpdateTime.NWTime()
4031UseCount                        = val_string16("user_info_use_count", "Use Count", [
4032        [ 0x0000, "Connection is not in use" ],
4033        [ 0x0001, "Connection is in use" ],
4034])
4035UsedBlocks                      = uint32("used_blocks", "Used Blocks")
4036UserID                          = uint32("user_id", "User ID", ENC_BIG_ENDIAN)
4037UserID.Display("BASE_HEX")
4038UserLoginAllowed                = val_string8("user_login_allowed", "Login Status", [
4039        [ 0x00, "Client Login Disabled" ],
4040        [ 0x01, "Client Login Enabled" ],
4041])
4042
4043UserName                        = nstring8("user_name", "User Name")
4044UserName16                      = fw_string("user_name_16", "User Name", 16)
4045UserName48                      = fw_string("user_name_48", "User Name", 48)
4046UserType                        = uint16("user_type", "User Type")
4047UTCTimeInSeconds                = eptime("uts_time_in_seconds", "UTC Time in Seconds")
4048
4049ValueAvailable                  = val_string8("value_available", "Value Available", [
4050        [ 0x00, "Has No Value" ],
4051        [ 0xff, "Has Value" ],
4052])
4053VAPVersion                      = uint8("vap_version", "VAP Version")
4054VariableBitMask                 = uint32("variable_bit_mask", "Variable Bit Mask")
4055VariableBitsDefined             = uint16("variable_bits_defined", "Variable Bits Defined")
4056VConsoleRevision                = uint8("vconsole_rev", "Console Revision")
4057VConsoleVersion                 = uint8("vconsole_ver", "Console Version")
4058Verb                            = uint32("verb", "Verb")
4059VerbData                        = uint8("verb_data", "Verb Data")
4060version                         = uint32("version", "Version")
4061VersionNumber                   = uint8("version_number", "Version")
4062VersionNumberLong       = uint32("version_num_long", "Version")
4063VertLocation                    = uint16("vert_location", "Vertical Location")
4064VirtualConsoleVersion           = uint8("virtual_console_version", "Virtual Console Version")
4065VolumeID                        = uint32("volume_id", "Volume ID")
4066VolumeID.Display("BASE_HEX")
4067VolInfoReplyLen                 = uint16("vol_info_reply_len", "Volume Information Reply Length")
4068VolInfoReturnInfoMask           = bitfield32("vol_info_ret_info_mask", "Return Information Mask", [
4069        bf_boolean32(0x00000001, "vinfo_info64", "Return 64 bit Volume Information"),
4070        bf_boolean32(0x00000002, "vinfo_volname", "Return Volume Name Details"),
4071])
4072VolumeCapabilities                      = bitfield32("volume_capabilities", "Volume Capabilities", [
4073        bf_boolean32(0x00000001, "vol_cap_user_space", "NetWare User Space Restrictions Supported"),
4074        bf_boolean32(0x00000002, "vol_cap_dir_quota", "NetWare Directory Quotas Supported"),
4075        bf_boolean32(0x00000004, "vol_cap_dfs", "DFS is Active on Volume"),
4076        bf_boolean32(0x00000008, "vol_cap_sal_purge", "NetWare Salvage and Purge Operations Supported"),
4077        bf_boolean32(0x00000010, "vol_cap_comp", "NetWare Compression Supported"),
4078        bf_boolean32(0x00000020, "vol_cap_cluster", "Volume is a Cluster Resource"),
4079    bf_boolean32(0x00000040, "vol_cap_nss_admin", "Volume is the NSS Admin Volume"),
4080    bf_boolean32(0x00000080, "vol_cap_nss", "Volume is Mounted by NSS"),
4081        bf_boolean32(0x00000100, "vol_cap_ea", "OS2 style EA's Supported"),
4082        bf_boolean32(0x00000200, "vol_cap_archive", "NetWare Archive bit Supported"),
4083    bf_boolean32(0x00000400, "vol_cap_file_attr", "Full NetWare file Attributes Supported"),
4084])
4085VolumeCachedFlag                = val_string8("volume_cached_flag", "Volume Cached Flag", [
4086        [ 0x00, "Volume is Not Cached" ],
4087        [ 0xff, "Volume is Cached" ],
4088])
4089VolumeDataStreams               = uint8("volume_data_streams", "Volume Data Streams")
4090VolumeEpochTime         = eptime("epoch_time", "Last Modified Timestamp")
4091VolumeGUID              = stringz("volume_guid", "Volume GUID")
4092VolumeHashedFlag                = val_string8("volume_hashed_flag", "Volume Hashed Flag", [
4093        [ 0x00, "Volume is Not Hashed" ],
4094        [ 0xff, "Volume is Hashed" ],
4095])
4096VolumeMountedFlag               = val_string8("volume_mounted_flag", "Volume Mounted Flag", [
4097        [ 0x00, "Volume is Not Mounted" ],
4098        [ 0xff, "Volume is Mounted" ],
4099])
4100VolumeMountPoint = stringz("volume_mnt_point", "Volume Mount Point")
4101VolumeName                      = fw_string("volume_name", "Volume Name", 16)
4102VolumeNameLen                   = nstring8("volume_name_len", "Volume Name")
4103VolumeNameSpaces                = uint8("volume_name_spaces", "Volume Name Spaces")
4104VolumeNameStringz       = stringz("vol_name_stringz", "Volume Name")
4105VolumeNumber                    = uint8("volume_number", "Volume Number")
4106VolumeNumberLong                = uint32("volume_number_long", "Volume Number")
4107VolumeRemovableFlag             = val_string8("volume_removable_flag", "Volume Removable Flag", [
4108        [ 0x00, "Disk Cannot be Removed from Server" ],
4109        [ 0xff, "Disk Can be Removed from Server" ],
4110])
4111VolumeRequestFlags              = val_string16("volume_request_flags", "Volume Request Flags", [
4112        [ 0x0000, "Do not return name with volume number" ],
4113        [ 0x0001, "Return name with volume number" ],
4114])
4115VolumeSizeInClusters            = uint32("volume_size_in_clusters", "Volume Size in Clusters")
4116VolumesSupportedMax             = uint16("volumes_supported_max", "Volumes Supported Max")
4117VolumeType                      = val_string16("volume_type", "Volume Type", [
4118        [ 0x0000, "NetWare 386" ],
4119        [ 0x0001, "NetWare 286" ],
4120        [ 0x0002, "NetWare 386 Version 30" ],
4121        [ 0x0003, "NetWare 386 Version 31" ],
4122])
4123VolumeTypeLong                   = val_string32("volume_type_long", "Volume Type", [
4124        [ 0x00000000, "NetWare 386" ],
4125        [ 0x00000001, "NetWare 286" ],
4126        [ 0x00000002, "NetWare 386 Version 30" ],
4127        [ 0x00000003, "NetWare 386 Version 31" ],
4128])
4129WastedServerMemory              = uint16("wasted_server_memory", "Wasted Server Memory", ENC_BIG_ENDIAN)
4130WaitTime                        = uint32("wait_time", "Wait Time")
4131
4132Year                            = val_string8("year", "Year",[
4133        [ 0x50, "1980" ],
4134        [ 0x51, "1981" ],
4135        [ 0x52, "1982" ],
4136        [ 0x53, "1983" ],
4137        [ 0x54, "1984" ],
4138        [ 0x55, "1985" ],
4139        [ 0x56, "1986" ],
4140        [ 0x57, "1987" ],
4141        [ 0x58, "1988" ],
4142        [ 0x59, "1989" ],
4143        [ 0x5a, "1990" ],
4144        [ 0x5b, "1991" ],
4145        [ 0x5c, "1992" ],
4146        [ 0x5d, "1993" ],
4147        [ 0x5e, "1994" ],
4148        [ 0x5f, "1995" ],
4149        [ 0x60, "1996" ],
4150        [ 0x61, "1997" ],
4151        [ 0x62, "1998" ],
4152        [ 0x63, "1999" ],
4153        [ 0x64, "2000" ],
4154        [ 0x65, "2001" ],
4155        [ 0x66, "2002" ],
4156        [ 0x67, "2003" ],
4157        [ 0x68, "2004" ],
4158        [ 0x69, "2005" ],
4159        [ 0x6a, "2006" ],
4160        [ 0x6b, "2007" ],
4161        [ 0x6c, "2008" ],
4162        [ 0x6d, "2009" ],
4163        [ 0x6e, "2010" ],
4164        [ 0x6f, "2011" ],
4165        [ 0x70, "2012" ],
4166        [ 0x71, "2013" ],
4167        [ 0x72, "2014" ],
4168        [ 0x73, "2015" ],
4169        [ 0x74, "2016" ],
4170        [ 0x75, "2017" ],
4171        [ 0x76, "2018" ],
4172        [ 0x77, "2019" ],
4173        [ 0x78, "2020" ],
4174        [ 0x79, "2021" ],
4175        [ 0x7a, "2022" ],
4176        [ 0x7b, "2023" ],
4177        [ 0x7c, "2024" ],
4178        [ 0x7d, "2025" ],
4179        [ 0x7e, "2026" ],
4180        [ 0x7f, "2027" ],
4181        [ 0xc0, "1984" ],
4182        [ 0xc1, "1985" ],
4183        [ 0xc2, "1986" ],
4184        [ 0xc3, "1987" ],
4185        [ 0xc4, "1988" ],
4186        [ 0xc5, "1989" ],
4187        [ 0xc6, "1990" ],
4188        [ 0xc7, "1991" ],
4189        [ 0xc8, "1992" ],
4190        [ 0xc9, "1993" ],
4191        [ 0xca, "1994" ],
4192        [ 0xcb, "1995" ],
4193        [ 0xcc, "1996" ],
4194        [ 0xcd, "1997" ],
4195        [ 0xce, "1998" ],
4196        [ 0xcf, "1999" ],
4197        [ 0xd0, "2000" ],
4198        [ 0xd1, "2001" ],
4199        [ 0xd2, "2002" ],
4200        [ 0xd3, "2003" ],
4201        [ 0xd4, "2004" ],
4202        [ 0xd5, "2005" ],
4203        [ 0xd6, "2006" ],
4204        [ 0xd7, "2007" ],
4205        [ 0xd8, "2008" ],
4206        [ 0xd9, "2009" ],
4207        [ 0xda, "2010" ],
4208        [ 0xdb, "2011" ],
4209        [ 0xdc, "2012" ],
4210        [ 0xdd, "2013" ],
4211        [ 0xde, "2014" ],
4212        [ 0xdf, "2015" ],
4213])
4214##############################################################################
4215# Structs
4216##############################################################################
4217
4218
4219acctngInfo                      = struct("acctng_info_struct", [
4220        HoldTime,
4221        HoldAmount,
4222        ChargeAmount,
4223        HeldConnectTimeInMinutes,
4224        HeldRequests,
4225        HeldBytesRead,
4226        HeldBytesWritten,
4227],"Accounting Information")
4228AFP10Struct                       = struct("afp_10_struct", [
4229        AFPEntryID,
4230        ParentID,
4231        AttributesDef16,
4232        DataForkLen,
4233        ResourceForkLen,
4234        TotalOffspring,
4235        CreationDate,
4236        LastAccessedDate,
4237        ModifiedDate,
4238        ModifiedTime,
4239        ArchivedDate,
4240        ArchivedTime,
4241        CreatorID,
4242        Reserved4,
4243        FinderAttr,
4244        HorizLocation,
4245        VertLocation,
4246        FileDirWindow,
4247        Reserved16,
4248        LongName,
4249        CreatorID,
4250        ShortName,
4251        AccessPrivileges,
4252], "AFP Information" )
4253AFP20Struct                       = struct("afp_20_struct", [
4254        AFPEntryID,
4255        ParentID,
4256        AttributesDef16,
4257        DataForkLen,
4258        ResourceForkLen,
4259        TotalOffspring,
4260        CreationDate,
4261        LastAccessedDate,
4262        ModifiedDate,
4263        ModifiedTime,
4264        ArchivedDate,
4265        ArchivedTime,
4266        CreatorID,
4267        Reserved4,
4268        FinderAttr,
4269        HorizLocation,
4270        VertLocation,
4271        FileDirWindow,
4272        Reserved16,
4273        LongName,
4274        CreatorID,
4275        ShortName,
4276        AccessPrivileges,
4277        Reserved,
4278        ProDOSInfo,
4279], "AFP Information" )
4280ArchiveDateStruct               = struct("archive_date_struct", [
4281        ArchivedDate,
4282])
4283ArchiveIdStruct                 = struct("archive_id_struct", [
4284        ArchiverID,
4285])
4286ArchiveInfoStruct               = struct("archive_info_struct", [
4287        ArchivedTime,
4288        ArchivedDate,
4289        ArchiverID,
4290], "Archive Information")
4291ArchiveTimeStruct               = struct("archive_time_struct", [
4292        ArchivedTime,
4293])
4294AttributesStruct                = struct("attributes_struct", [
4295        AttributesDef32,
4296        FlagsDef,
4297], "Attributes")
4298authInfo                        = struct("auth_info_struct", [
4299        Status,
4300        Reserved2,
4301        Privileges,
4302])
4303BoardNameStruct                 = struct("board_name_struct", [
4304        DriverBoardName,
4305        DriverShortName,
4306        DriverLogicalName,
4307], "Board Name")
4308CacheInfo                       = struct("cache_info", [
4309        uint32("max_byte_cnt", "Maximum Byte Count"),
4310        uint32("min_num_of_cache_buff", "Minimum Number Of Cache Buffers"),
4311        uint32("min_cache_report_thresh", "Minimum Cache Report Threshold"),
4312        uint32("alloc_waiting", "Allocate Waiting Count"),
4313        uint32("ndirty_blocks", "Number of Dirty Blocks"),
4314        uint32("cache_dirty_wait_time", "Cache Dirty Wait Time"),
4315        uint32("cache_max_concur_writes", "Cache Maximum Concurrent Writes"),
4316        uint32("max_dirty_time", "Maximum Dirty Time"),
4317        uint32("num_dir_cache_buff", "Number Of Directory Cache Buffers"),
4318        uint32("cache_byte_to_block", "Cache Byte To Block Shift Factor"),
4319], "Cache Information")
4320CommonLanStruc                  = struct("common_lan_struct", [
4321        boolean8("not_supported_mask", "Bit Counter Supported"),
4322        Reserved3,
4323        uint32("total_tx_packet_count", "Total Transmit Packet Count"),
4324        uint32("total_rx_packet_count", "Total Receive Packet Count"),
4325        uint32("no_ecb_available_count", "No ECB Available Count"),
4326        uint32("packet_tx_too_big_count", "Transmit Packet Too Big Count"),
4327        uint32("packet_tx_too_small_count", "Transmit Packet Too Small Count"),
4328        uint32("packet_rx_overflow_count", "Receive Packet Overflow Count"),
4329        uint32("packet_rx_too_big_count", "Receive Packet Too Big Count"),
4330        uint32("packet_rs_too_small_count", "Receive Packet Too Small Count"),
4331        uint32("packet_tx_misc_error_count", "Transmit Packet Misc Error Count"),
4332        uint32("packet_rx_misc_error_count", "Receive Packet Misc Error Count"),
4333        uint32("retry_tx_count", "Transmit Retry Count"),
4334        uint32("checksum_error_count", "Checksum Error Count"),
4335        uint32("hardware_rx_mismatch_count", "Hardware Receive Mismatch Count"),
4336], "Common LAN Information")
4337CompDeCompStat                  = struct("comp_d_comp_stat", [
4338        uint32("cmphitickhigh", "Compress High Tick"),
4339        uint32("cmphitickcnt", "Compress High Tick Count"),
4340        uint32("cmpbyteincount", "Compress Byte In Count"),
4341        uint32("cmpbyteoutcnt", "Compress Byte Out Count"),
4342        uint32("cmphibyteincnt", "Compress High Byte In Count"),
4343        uint32("cmphibyteoutcnt", "Compress High Byte Out Count"),
4344        uint32("decphitickhigh", "DeCompress High Tick"),
4345        uint32("decphitickcnt", "DeCompress High Tick Count"),
4346        uint32("decpbyteincount", "DeCompress Byte In Count"),
4347        uint32("decpbyteoutcnt", "DeCompress Byte Out Count"),
4348        uint32("decphibyteincnt", "DeCompress High Byte In Count"),
4349        uint32("decphibyteoutcnt", "DeCompress High Byte Out Count"),
4350], "Compression/Decompression Information")
4351ConnFileStruct                  = struct("conn_file_struct", [
4352        ConnectionNumberWord,
4353        TaskNumberWord,
4354        LockType,
4355        AccessControl,
4356        LockFlag,
4357], "File Connection Information")
4358ConnStruct                      = struct("conn_struct", [
4359        TaskNumByte,
4360        LockType,
4361        AccessControl,
4362        LockFlag,
4363        VolumeNumber,
4364        DirectoryEntryNumberWord,
4365        FileName14,
4366], "Connection Information")
4367ConnTaskStruct                  = struct("conn_task_struct", [
4368        ConnectionNumberByte,
4369        TaskNumByte,
4370], "Task Information")
4371Counters                        = struct("counters_struct", [
4372        uint32("read_exist_blck", "Read Existing Block Count"),
4373        uint32("read_exist_write_wait", "Read Existing Write Wait Count"),
4374        uint32("read_exist_part_read", "Read Existing Partial Read Count"),
4375        uint32("read_exist_read_err", "Read Existing Read Error Count"),
4376        uint32("wrt_blck_cnt", "Write Block Count"),
4377        uint32("wrt_entire_blck", "Write Entire Block Count"),
4378        uint32("internl_dsk_get", "Internal Disk Get Count"),
4379        uint32("internl_dsk_get_need_to_alloc", "Internal Disk Get Need To Allocate Count"),
4380        uint32("internl_dsk_get_someone_beat", "Internal Disk Get Someone Beat My Count"),
4381        uint32("internl_dsk_get_part_read", "Internal Disk Get Partial Read Count"),
4382        uint32("internl_dsk_get_read_err", "Internal Disk Get Read Error Count"),
4383        uint32("async_internl_dsk_get", "Async Internal Disk Get Count"),
4384        uint32("async_internl_dsk_get_need_to_alloc", "Async Internal Disk Get Need To Alloc"),
4385        uint32("async_internl_dsk_get_someone_beat", "Async Internal Disk Get Someone Beat Me"),
4386        uint32("err_doing_async_read", "Error Doing Async Read Count"),
4387        uint32("internl_dsk_get_no_read", "Internal Disk Get No Read Count"),
4388        uint32("internl_dsk_get_no_read_alloc", "Internal Disk Get No Read Allocate Count"),
4389        uint32("internl_dsk_get_no_read_someone_beat", "Internal Disk Get No Read Someone Beat Me Count"),
4390        uint32("internl_dsk_write", "Internal Disk Write Count"),
4391        uint32("internl_dsk_write_alloc", "Internal Disk Write Allocate Count"),
4392        uint32("internl_dsk_write_someone_beat", "Internal Disk Write Someone Beat Me Count"),
4393        uint32("write_err", "Write Error Count"),
4394        uint32("wait_on_sema", "Wait On Semaphore Count"),
4395        uint32("alloc_blck_i_had_to_wait_for", "Allocate Block I Had To Wait For Someone Count"),
4396        uint32("alloc_blck", "Allocate Block Count"),
4397        uint32("alloc_blck_i_had_to_wait", "Allocate Block I Had To Wait Count"),
4398], "Disk Counter Information")
4399CPUInformation                  = struct("cpu_information", [
4400        PageTableOwnerFlag,
4401        CPUType,
4402        Reserved3,
4403        CoprocessorFlag,
4404        BusType,
4405        Reserved3,
4406        IOEngineFlag,
4407        Reserved3,
4408        FSEngineFlag,
4409        Reserved3,
4410        NonDedFlag,
4411        Reserved3,
4412        CPUString,
4413        CoProcessorString,
4414        BusString,
4415], "CPU Information")
4416CreationDateStruct              = struct("creation_date_struct", [
4417        CreationDate,
4418])
4419CreationInfoStruct              = struct("creation_info_struct", [
4420        CreationTime,
4421        CreationDate,
4422        endian(CreatorID, ENC_LITTLE_ENDIAN),
4423], "Creation Information")
4424CreationTimeStruct              = struct("creation_time_struct", [
4425        CreationTime,
4426])
4427CustomCntsInfo                  = struct("custom_cnts_info", [
4428        CustomVariableValue,
4429        CustomString,
4430], "Custom Counters" )
4431DataStreamInfo                  = struct("data_stream_info", [
4432        AssociatedNameSpace,
4433        DataStreamName
4434])
4435DataStreamSizeStruct            = struct("data_stream_size_struct", [
4436        DataStreamSize,
4437])
4438DirCacheInfo                    = struct("dir_cache_info", [
4439        uint32("min_time_since_file_delete", "Minimum Time Since File Delete"),
4440        uint32("abs_min_time_since_file_delete", "Absolute Minimum Time Since File Delete"),
4441        uint32("min_num_of_dir_cache_buff", "Minimum Number Of Directory Cache Buffers"),
4442        uint32("max_num_of_dir_cache_buff", "Maximum Number Of Directory Cache Buffers"),
4443        uint32("num_of_dir_cache_buff", "Number Of Directory Cache Buffers"),
4444        uint32("dc_min_non_ref_time", "DC Minimum Non-Referenced Time"),
4445        uint32("dc_wait_time_before_new_buff", "DC Wait Time Before New Buffer"),
4446        uint32("dc_max_concurrent_writes", "DC Maximum Concurrent Writes"),
4447        uint32("dc_dirty_wait_time", "DC Dirty Wait Time"),
4448        uint32("dc_double_read_flag", "DC Double Read Flag"),
4449        uint32("map_hash_node_count", "Map Hash Node Count"),
4450        uint32("space_restriction_node_count", "Space Restriction Node Count"),
4451        uint32("trustee_list_node_count", "Trustee List Node Count"),
4452        uint32("percent_of_vol_used_by_dirs", "Percent Of Volume Used By Directories"),
4453], "Directory Cache Information")
4454DirDiskSpaceRest64bit           = struct("dir_disk_space_rest_64bit", [
4455        Level,
4456        MaxSpace64,
4457        MinSpaceLeft64
4458], "Directory Disk Space Restriction 64 bit")
4459DirEntryStruct                  = struct("dir_entry_struct", [
4460        DirectoryEntryNumber,
4461        DOSDirectoryEntryNumber,
4462        VolumeNumberLong,
4463], "Directory Entry Information")
4464DirectoryInstance               = struct("directory_instance", [
4465        SearchSequenceWord,
4466        DirectoryID,
4467        DirectoryName14,
4468        DirectoryAttributes,
4469        DirectoryAccessRights,
4470        endian(CreationDate, ENC_BIG_ENDIAN),
4471        endian(AccessDate, ENC_BIG_ENDIAN),
4472        CreatorID,
4473        Reserved2,
4474        DirectoryStamp,
4475], "Directory Information")
4476DMInfoLevel0                    = struct("dm_info_level_0", [
4477        uint32("io_flag", "IO Flag"),
4478        uint32("sm_info_size", "Storage Module Information Size"),
4479        uint32("avail_space", "Available Space"),
4480        uint32("used_space", "Used Space"),
4481        stringz("s_module_name", "Storage Module Name"),
4482        uint8("s_m_info", "Storage Media Information"),
4483])
4484DMInfoLevel1                    = struct("dm_info_level_1", [
4485        NumberOfSMs,
4486        SMIDs,
4487])
4488DMInfoLevel2                    = struct("dm_info_level_2", [
4489        Name,
4490])
4491DOSDirectoryEntryStruct         = struct("dos_directory_entry_struct", [
4492        AttributesDef32,
4493        UniqueID,
4494        PurgeFlags,
4495        DestNameSpace,
4496        DirectoryNameLen,
4497        DirectoryName,
4498        CreationTime,
4499        CreationDate,
4500        CreatorID,
4501        ArchivedTime,
4502        ArchivedDate,
4503        ArchiverID,
4504        UpdateTime,
4505        UpdateDate,
4506        NextTrusteeEntry,
4507        Reserved48,
4508        InheritedRightsMask,
4509], "DOS Directory Information")
4510DOSFileEntryStruct              = struct("dos_file_entry_struct", [
4511        AttributesDef32,
4512        UniqueID,
4513        PurgeFlags,
4514        DestNameSpace,
4515        NameLen,
4516        Name12,
4517        CreationTime,
4518        CreationDate,
4519        CreatorID,
4520        ArchivedTime,
4521        ArchivedDate,
4522        ArchiverID,
4523        UpdateTime,
4524        UpdateDate,
4525        UpdateID,
4526        FileSize,
4527        DataForkFirstFAT,
4528        NextTrusteeEntry,
4529        Reserved36,
4530        InheritedRightsMask,
4531        LastAccessedDate,
4532        Reserved20,
4533        PrimaryEntry,
4534        NameList,
4535], "DOS File Information")
4536DSSpaceAllocateStruct           = struct("ds_space_alloc_struct", [
4537        DataStreamSpaceAlloc,
4538])
4539DynMemStruct                    = struct("dyn_mem_struct", [
4540        uint32("dyn_mem_struct_total", "Total Dynamic Space" ),
4541        uint32("dyn_mem_struct_max", "Max Used Dynamic Space" ),
4542        uint32("dyn_mem_struct_cur", "Current Used Dynamic Space" ),
4543], "Dynamic Memory Information")
4544EAInfoStruct                    = struct("ea_info_struct", [
4545        EADataSize,
4546        EACount,
4547        EAKeySize,
4548], "Extended Attribute Information")
4549ExtraCacheCntrs                 = struct("extra_cache_cntrs", [
4550        uint32("internl_dsk_get_no_wait", "Internal Disk Get No Wait Count"),
4551        uint32("internl_dsk_get_no_wait_need", "Internal Disk Get No Wait Need To Allocate Count"),
4552        uint32("internl_dsk_get_no_wait_no_blk", "Internal Disk Get No Wait No Block Count"),
4553        uint32("id_get_no_read_no_wait", "ID Get No Read No Wait Count"),
4554        uint32("id_get_no_read_no_wait_sema", "ID Get No Read No Wait Semaphored Count"),
4555        uint32("id_get_no_read_no_wait_buffer", "ID Get No Read No Wait No Buffer Count"),
4556        uint32("id_get_no_read_no_wait_alloc", "ID Get No Read No Wait Allocate Count"),
4557        uint32("id_get_no_read_no_wait_no_alloc", "ID Get No Read No Wait No Alloc Count"),
4558        uint32("id_get_no_read_no_wait_no_alloc_sema", "ID Get No Read No Wait No Alloc Semaphored Count"),
4559        uint32("id_get_no_read_no_wait_no_alloc_alloc", "ID Get No Read No Wait No Alloc Allocate Count"),
4560], "Extra Cache Counters Information")
4561
4562FileSize64bitStruct             = struct("file_sz_64bit_struct", [
4563        FileSize64bit,
4564])
4565
4566ReferenceIDStruct               = struct("ref_id_struct", [
4567        CurrentReferenceID,
4568])
4569NSAttributeStruct               = struct("ns_attrib_struct", [
4570        AttributesDef32,
4571])
4572DStreamActual                   = struct("d_stream_actual", [
4573        DataStreamNumberLong,
4574        DataStreamFATBlocks,
4575], "Actual Stream")
4576DStreamLogical                  = struct("d_string_logical", [
4577        DataStreamNumberLong,
4578        DataStreamSize,
4579], "Logical Stream")
4580LastUpdatedInSecondsStruct      = struct("last_update_in_seconds_struct", [
4581        SecondsRelativeToTheYear2000,
4582])
4583DOSNameStruct                   = struct("dos_name_struct", [
4584        FileName,
4585], "DOS File Name")
4586DOSName16Struct                   = struct("dos_name_16_struct", [
4587        FileName16,
4588], "DOS File Name")
4589FlushTimeStruct                 = struct("flush_time_struct", [
4590        FlushTime,
4591])
4592ParentBaseIDStruct              = struct("parent_base_id_struct", [
4593        ParentBaseID,
4594])
4595MacFinderInfoStruct             = struct("mac_finder_info_struct", [
4596        MacFinderInfo,
4597])
4598SiblingCountStruct              = struct("sibling_count_struct", [
4599        SiblingCount,
4600])
4601EffectiveRightsStruct           = struct("eff_rights_struct", [
4602        EffectiveRights,
4603        Reserved3,
4604])
4605MacTimeStruct                   = struct("mac_time_struct", [
4606        MACCreateDate,
4607        MACCreateTime,
4608        MACBackupDate,
4609        MACBackupTime,
4610])
4611LastAccessedTimeStruct          = struct("last_access_time_struct", [
4612        LastAccessedTime,
4613])
4614FileAttributesStruct            = struct("file_attributes_struct", [
4615        AttributesDef32,
4616])
4617FileInfoStruct                  = struct("file_info_struct", [
4618        ParentID,
4619        DirectoryEntryNumber,
4620        TotalBlocksToDecompress,
4621        #CurrentBlockBeingDecompressed,
4622], "File Information")
4623FileInstance                    = struct("file_instance", [
4624        SearchSequenceWord,
4625        DirectoryID,
4626        FileName14,
4627        AttributesDef,
4628        FileMode,
4629        FileSize,
4630        endian(CreationDate, ENC_BIG_ENDIAN),
4631        endian(AccessDate, ENC_BIG_ENDIAN),
4632        endian(UpdateDate, ENC_BIG_ENDIAN),
4633        endian(UpdateTime, ENC_BIG_ENDIAN),
4634], "File Instance")
4635FileNameStruct                  = struct("file_name_struct", [
4636        FileName,
4637], "File Name")
4638FileName16Struct                  = struct("file_name16_struct", [
4639        FileName16,
4640], "File Name")
4641FileServerCounters              = struct("file_server_counters", [
4642        uint16("too_many_hops", "Too Many Hops"),
4643        uint16("unknown_network", "Unknown Network"),
4644        uint16("no_space_for_service", "No Space For Service"),
4645        uint16("no_receive_buff", "No Receive Buffers"),
4646        uint16("not_my_network", "Not My Network"),
4647        uint32("netbios_progated", "NetBIOS Propagated Count"),
4648        uint32("ttl_pckts_srvcd", "Total Packets Serviced"),
4649        uint32("ttl_pckts_routed", "Total Packets Routed"),
4650], "File Server Counters")
4651FileSystemInfo                  = struct("file_system_info", [
4652        uint32("fat_moved", "Number of times the OS has move the location of FAT"),
4653        uint32("fat_write_err", "Number of write errors in both original and mirrored copies of FAT"),
4654        uint32("someone_else_did_it_0", "Someone Else Did It Count 0"),
4655        uint32("someone_else_did_it_1", "Someone Else Did It Count 1"),
4656        uint32("someone_else_did_it_2", "Someone Else Did It Count 2"),
4657        uint32("i_ran_out_someone_else_did_it_0", "I Ran Out Someone Else Did It Count 0"),
4658        uint32("i_ran_out_someone_else_did_it_1", "I Ran Out Someone Else Did It Count 1"),
4659        uint32("i_ran_out_someone_else_did_it_2", "I Ran Out Someone Else Did It Count 2"),
4660        uint32("turbo_fat_build_failed", "Turbo FAT Build Failed Count"),
4661        uint32("extra_use_count_node_count", "Errors allocating a use count node for TTS"),
4662        uint32("extra_extra_use_count_node_count", "Errors allocating an additional use count node for TTS"),
4663        uint32("error_read_last_fat", "Error Reading Last FAT Count"),
4664        uint32("someone_else_using_this_file", "Someone Else Using This File Count"),
4665], "File System Information")
4666GenericInfoDef                  = struct("generic_info_def", [
4667        fw_string("generic_label", "Label", 64),
4668        uint32("generic_ident_type", "Identification Type"),
4669        uint32("generic_ident_time", "Identification Time"),
4670        uint32("generic_media_type", "Media Type"),
4671        uint32("generic_cartridge_type", "Cartridge Type"),
4672        uint32("generic_unit_size", "Unit Size"),
4673        uint32("generic_block_size", "Block Size"),
4674        uint32("generic_capacity", "Capacity"),
4675        uint32("generic_pref_unit_size", "Preferred Unit Size"),
4676        fw_string("generic_name", "Name",64),
4677        uint32("generic_type", "Type"),
4678        uint32("generic_status", "Status"),
4679        uint32("generic_func_mask", "Function Mask"),
4680        uint32("generic_ctl_mask", "Control Mask"),
4681        uint32("generic_parent_count", "Parent Count"),
4682        uint32("generic_sib_count", "Sibling Count"),
4683        uint32("generic_child_count", "Child Count"),
4684        uint32("generic_spec_info_sz", "Specific Information Size"),
4685        uint32("generic_object_uniq_id", "Unique Object ID"),
4686        uint32("generic_media_slot", "Media Slot"),
4687], "Generic Information")
4688HandleInfoLevel0                = struct("handle_info_level_0", [
4689#        DataStream,
4690])
4691HandleInfoLevel1                = struct("handle_info_level_1", [
4692        DataStream,
4693])
4694HandleInfoLevel2                = struct("handle_info_level_2", [
4695        DOSDirectoryBase,
4696        NameSpace,
4697        DataStream,
4698])
4699HandleInfoLevel3                = struct("handle_info_level_3", [
4700        DOSDirectoryBase,
4701        NameSpace,
4702])
4703HandleInfoLevel4                = struct("handle_info_level_4", [
4704        DOSDirectoryBase,
4705        NameSpace,
4706        ParentDirectoryBase,
4707        ParentDOSDirectoryBase,
4708])
4709HandleInfoLevel5                = struct("handle_info_level_5", [
4710        DOSDirectoryBase,
4711        NameSpace,
4712        DataStream,
4713        ParentDirectoryBase,
4714        ParentDOSDirectoryBase,
4715])
4716IPXInformation                  = struct("ipx_information", [
4717        uint32("ipx_send_pkt", "IPX Send Packet Count"),
4718        uint16("ipx_malform_pkt", "IPX Malformed Packet Count"),
4719        uint32("ipx_get_ecb_req", "IPX Get ECB Request Count"),
4720        uint32("ipx_get_ecb_fail", "IPX Get ECB Fail Count"),
4721        uint32("ipx_aes_event", "IPX AES Event Count"),
4722        uint16("ipx_postponed_aes", "IPX Postponed AES Count"),
4723        uint16("ipx_max_conf_sock", "IPX Max Configured Socket Count"),
4724        uint16("ipx_max_open_sock", "IPX Max Open Socket Count"),
4725        uint16("ipx_open_sock_fail", "IPX Open Socket Fail Count"),
4726        uint32("ipx_listen_ecb", "IPX Listen ECB Count"),
4727        uint16("ipx_ecb_cancel_fail", "IPX ECB Cancel Fail Count"),
4728        uint16("ipx_get_lcl_targ_fail", "IPX Get Local Target Fail Count"),
4729], "IPX Information")
4730JobEntryTime                    = struct("job_entry_time", [
4731        Year,
4732        Month,
4733        Day,
4734        Hour,
4735        Minute,
4736        Second,
4737], "Job Entry Time")
4738JobStruct3x                       = struct("job_struct_3x", [
4739    RecordInUseFlag,
4740    PreviousRecord,
4741    NextRecord,
4742        ClientStationLong,
4743        ClientTaskNumberLong,
4744        ClientIDNumber,
4745        TargetServerIDNumber,
4746        TargetExecutionTime,
4747        JobEntryTime,
4748        JobNumberLong,
4749        JobType,
4750        JobPositionWord,
4751        JobControlFlagsWord,
4752        JobFileName,
4753        JobFileHandleLong,
4754        ServerStationLong,
4755        ServerTaskNumberLong,
4756        ServerID,
4757        TextJobDescription,
4758        ClientRecordArea,
4759], "Job Information")
4760JobStruct                       = struct("job_struct", [
4761        ClientStation,
4762        ClientTaskNumber,
4763        ClientIDNumber,
4764        TargetServerIDNumber,
4765        TargetExecutionTime,
4766        JobEntryTime,
4767        JobNumber,
4768        JobType,
4769        JobPosition,
4770        JobControlFlags,
4771        JobFileName,
4772        JobFileHandle,
4773        ServerStation,
4774        ServerTaskNumber,
4775        ServerID,
4776        TextJobDescription,
4777        ClientRecordArea,
4778], "Job Information")
4779JobStructNew                    = struct("job_struct_new", [
4780        RecordInUseFlag,
4781        PreviousRecord,
4782        NextRecord,
4783        ClientStationLong,
4784        ClientTaskNumberLong,
4785        ClientIDNumber,
4786        TargetServerIDNumber,
4787        TargetExecutionTime,
4788        JobEntryTime,
4789        JobNumberLong,
4790        JobType,
4791        JobPositionWord,
4792        JobControlFlagsWord,
4793        JobFileName,
4794        JobFileHandleLong,
4795        ServerStationLong,
4796        ServerTaskNumberLong,
4797        ServerID,
4798], "Job Information")
4799KnownRoutes                     = struct("known_routes", [
4800        NetIDNumber,
4801        HopsToNet,
4802        NetStatus,
4803        TimeToNet,
4804], "Known Routes")
4805SrcEnhNWHandlePathS1                 = struct("source_nwhandle", [
4806                DirectoryBase,
4807                VolumeNumber,
4808                HandleFlag,
4809        DataTypeFlag,
4810        Reserved5,
4811], "Source Information")
4812DstEnhNWHandlePathS1                 = struct("destination_nwhandle", [
4813                DirectoryBase,
4814                VolumeNumber,
4815                HandleFlag,
4816        DataTypeFlag,
4817        Reserved5,
4818], "Destination Information")
4819KnownServStruc                  = struct("known_server_struct", [
4820        ServerAddress,
4821        HopsToNet,
4822        ServerNameStringz,
4823], "Known Servers")
4824LANConfigInfo                   = struct("lan_cfg_info", [
4825        LANdriverCFG_MajorVersion,
4826        LANdriverCFG_MinorVersion,
4827        LANdriverNodeAddress,
4828        Reserved,
4829        LANdriverModeFlags,
4830        LANdriverBoardNumber,
4831        LANdriverBoardInstance,
4832        LANdriverMaximumSize,
4833        LANdriverMaxRecvSize,
4834        LANdriverRecvSize,
4835        LANdriverCardID,
4836        LANdriverMediaID,
4837        LANdriverTransportTime,
4838        LANdriverSrcRouting,
4839        LANdriverLineSpeed,
4840        LANdriverReserved,
4841        LANdriverMajorVersion,
4842        LANdriverMinorVersion,
4843        LANdriverFlags,
4844        LANdriverSendRetries,
4845        LANdriverLink,
4846        LANdriverSharingFlags,
4847        LANdriverSlot,
4848        LANdriverIOPortsAndRanges1,
4849        LANdriverIOPortsAndRanges2,
4850        LANdriverIOPortsAndRanges3,
4851        LANdriverIOPortsAndRanges4,
4852        LANdriverMemoryDecode0,
4853        LANdriverMemoryLength0,
4854        LANdriverMemoryDecode1,
4855        LANdriverMemoryLength1,
4856        LANdriverInterrupt1,
4857        LANdriverInterrupt2,
4858        LANdriverDMAUsage1,
4859        LANdriverDMAUsage2,
4860        LANdriverLogicalName,
4861        LANdriverIOReserved,
4862        LANdriverCardName,
4863], "LAN Configuration Information")
4864LastAccessStruct                = struct("last_access_struct", [
4865        LastAccessedDate,
4866])
4867lockInfo                        = struct("lock_info_struct", [
4868        LogicalLockThreshold,
4869        PhysicalLockThreshold,
4870        FileLockCount,
4871        RecordLockCount,
4872], "Lock Information")
4873LockStruct                      = struct("lock_struct", [
4874        TaskNumByte,
4875        LockType,
4876        RecordStart,
4877        RecordEnd,
4878], "Locks")
4879LoginTime                       = struct("login_time", [
4880        Year,
4881        Month,
4882        Day,
4883        Hour,
4884        Minute,
4885        Second,
4886        DayOfWeek,
4887], "Login Time")
4888LogLockStruct                   = struct("log_lock_struct", [
4889        TaskNumberWord,
4890        LockStatus,
4891        LockName,
4892], "Logical Locks")
4893LogRecStruct                    = struct("log_rec_struct", [
4894        ConnectionNumberWord,
4895        TaskNumByte,
4896        LockStatus,
4897], "Logical Record Locks")
4898LSLInformation                  = struct("lsl_information", [
4899        uint32("rx_buffers", "Receive Buffers"),
4900        uint32("rx_buffers_75", "Receive Buffers Warning Level"),
4901        uint32("rx_buffers_checked_out", "Receive Buffers Checked Out Count"),
4902        uint32("rx_buffer_size", "Receive Buffer Size"),
4903        uint32("max_phy_packet_size", "Maximum Physical Packet Size"),
4904        uint32("last_time_rx_buff_was_alloc", "Last Time a Receive Buffer was Allocated"),
4905        uint32("max_num_of_protocols", "Maximum Number of Protocols"),
4906        uint32("max_num_of_media_types", "Maximum Number of Media Types"),
4907        uint32("total_tx_packets", "Total Transmit Packets"),
4908        uint32("get_ecb_buf", "Get ECB Buffers"),
4909        uint32("get_ecb_fails", "Get ECB Failures"),
4910        uint32("aes_event_count", "AES Event Count"),
4911        uint32("post_poned_events", "Postponed Events"),
4912        uint32("ecb_cxl_fails", "ECB Cancel Failures"),
4913        uint32("valid_bfrs_reused", "Valid Buffers Reused"),
4914        uint32("enqueued_send_cnt", "Enqueued Send Count"),
4915        uint32("total_rx_packets", "Total Receive Packets"),
4916        uint32("unclaimed_packets", "Unclaimed Packets"),
4917        uint8("stat_table_major_version", "Statistics Table Major Version"),
4918        uint8("stat_table_minor_version", "Statistics Table Minor Version"),
4919], "LSL Information")
4920MaximumSpaceStruct              = struct("max_space_struct", [
4921        MaxSpace,
4922])
4923MemoryCounters                  = struct("memory_counters", [
4924        uint32("orig_num_cache_buff", "Original Number Of Cache Buffers"),
4925        uint32("curr_num_cache_buff", "Current Number Of Cache Buffers"),
4926        uint32("cache_dirty_block_thresh", "Cache Dirty Block Threshold"),
4927        uint32("wait_node", "Wait Node Count"),
4928        uint32("wait_node_alloc_fail", "Wait Node Alloc Failure Count"),
4929        uint32("move_cache_node", "Move Cache Node Count"),
4930        uint32("move_cache_node_from_avai", "Move Cache Node From Avail Count"),
4931        uint32("accel_cache_node_write", "Accelerate Cache Node Write Count"),
4932        uint32("rem_cache_node", "Remove Cache Node Count"),
4933        uint32("rem_cache_node_from_avail", "Remove Cache Node From Avail Count"),
4934], "Memory Counters")
4935MLIDBoardInfo                   = struct("mlid_board_info", [
4936        uint32("protocol_board_num", "Protocol Board Number"),
4937        uint16("protocol_number", "Protocol Number"),
4938        bytes("protocol_id", "Protocol ID", 6),
4939        nstring8("protocol_name", "Protocol Name"),
4940], "MLID Board Information")
4941ModifyInfoStruct                = struct("modify_info_struct", [
4942        ModifiedTime,
4943        ModifiedDate,
4944        endian(ModifierID, ENC_LITTLE_ENDIAN),
4945        LastAccessedDate,
4946], "Modification Information")
4947nameInfo                        = struct("name_info_struct", [
4948        ObjectType,
4949        nstring8("login_name", "Login Name"),
4950], "Name Information")
4951NCPNetworkAddress               = struct("ncp_network_address_struct", [
4952        TransportType,
4953        Reserved3,
4954        NetAddress,
4955], "Network Address")
4956
4957netAddr                         = struct("net_addr_struct", [
4958        TransportType,
4959        nbytes32("transport_addr", "Transport Address"),
4960], "Network Address")
4961
4962NetWareInformationStruct        = struct("netware_information_struct", [
4963        DataStreamSpaceAlloc,           # (Data Stream Alloc Bit)
4964        AttributesDef32,                # (Attributes Bit)
4965        FlagsDef,
4966        DataStreamSize,                 # (Data Stream Size Bit)
4967        TotalDataStreamDiskSpaceAlloc,  # (Total Stream Size Bit)
4968        NumberOfDataStreams,
4969        CreationTime,                   # (Creation Bit)
4970        CreationDate,
4971        CreatorID,
4972        ModifiedTime,                   # (Modify Bit)
4973        ModifiedDate,
4974        ModifierID,
4975        LastAccessedDate,
4976        ArchivedTime,                   # (Archive Bit)
4977        ArchivedDate,
4978        ArchiverID,
4979        InheritedRightsMask,            # (Rights Bit)
4980        DirectoryEntryNumber,           # (Directory Entry Bit)
4981        DOSDirectoryEntryNumber,
4982        VolumeNumberLong,
4983        EADataSize,                     # (Extended Attribute Bit)
4984        EACount,
4985        EAKeySize,
4986        CreatorNameSpaceNumber,         # (Name Space Bit)
4987        Reserved3,
4988], "NetWare Information")
4989NLMInformation                  = struct("nlm_information", [
4990        IdentificationNumber,
4991        NLMFlags,
4992        Reserved3,
4993        NLMType,
4994        Reserved3,
4995        ParentID,
4996        MajorVersion,
4997        MinorVersion,
4998        Revision,
4999        Year,
5000        Reserved3,
5001        Month,
5002        Reserved3,
5003        Day,
5004        Reserved3,
5005        AllocAvailByte,
5006        AllocFreeCount,
5007        LastGarbCollect,
5008        MessageLanguage,
5009        NumberOfReferencedPublics,
5010], "NLM Information")
5011NSInfoStruct                    = struct("ns_info_struct", [
5012        CreatorNameSpaceNumber,
5013    Reserved3,
5014])
5015NWAuditStatus                   = struct("nw_audit_status", [
5016        AuditVersionDate,
5017        AuditFileVersionDate,
5018        val_string16("audit_enable_flag", "Auditing Enabled Flag", [
5019                [ 0x0000, "Auditing Disabled" ],
5020                [ 0x0001, "Auditing Enabled" ],
5021        ]),
5022        Reserved2,
5023        uint32("audit_file_size", "Audit File Size"),
5024        uint32("modified_counter", "Modified Counter"),
5025        uint32("audit_file_max_size", "Audit File Maximum Size"),
5026        uint32("audit_file_size_threshold", "Audit File Size Threshold"),
5027        uint32("audit_record_count", "Audit Record Count"),
5028        uint32("auditing_flags", "Auditing Flags"),
5029], "NetWare Audit Status")
5030ObjectSecurityStruct            = struct("object_security_struct", [
5031        ObjectSecurity,
5032])
5033ObjectFlagsStruct               = struct("object_flags_struct", [
5034        ObjectFlags,
5035])
5036ObjectTypeStruct                = struct("object_type_struct", [
5037        endian(ObjectType, ENC_BIG_ENDIAN),
5038        Reserved2,
5039])
5040ObjectNameStruct                = struct("object_name_struct", [
5041        ObjectNameStringz,
5042])
5043ObjectIDStruct                  = struct("object_id_struct", [
5044        ObjectID,
5045        Restriction,
5046])
5047ObjectIDStruct64                = struct("object_id_struct64", [
5048        endian(ObjectID, ENC_LITTLE_ENDIAN),
5049        endian(RestrictionQuad, ENC_LITTLE_ENDIAN),
5050])
5051OpnFilesStruct                  = struct("opn_files_struct", [
5052        TaskNumberWord,
5053        LockType,
5054        AccessControl,
5055        LockFlag,
5056        VolumeNumber,
5057        DOSParentDirectoryEntry,
5058        DOSDirectoryEntry,
5059        ForkCount,
5060        NameSpace,
5061        FileName,
5062], "Open Files Information")
5063OwnerIDStruct                   = struct("owner_id_struct", [
5064        CreatorID,
5065])
5066PacketBurstInformation          = struct("packet_burst_information", [
5067        uint32("big_invalid_slot", "Big Invalid Slot Count"),
5068        uint32("big_forged_packet", "Big Forged Packet Count"),
5069        uint32("big_invalid_packet", "Big Invalid Packet Count"),
5070        uint32("big_still_transmitting", "Big Still Transmitting Count"),
5071        uint32("still_doing_the_last_req", "Still Doing The Last Request Count"),
5072        uint32("invalid_control_req", "Invalid Control Request Count"),
5073        uint32("control_invalid_message_number", "Control Invalid Message Number Count"),
5074        uint32("control_being_torn_down", "Control Being Torn Down Count"),
5075        uint32("big_repeat_the_file_read", "Big Repeat the File Read Count"),
5076        uint32("big_send_extra_cc_count", "Big Send Extra CC Count"),
5077        uint32("big_return_abort_mess", "Big Return Abort Message Count"),
5078        uint32("big_read_invalid_mess", "Big Read Invalid Message Number Count"),
5079        uint32("big_read_do_it_over", "Big Read Do It Over Count"),
5080        uint32("big_read_being_torn_down", "Big Read Being Torn Down Count"),
5081        uint32("previous_control_packet", "Previous Control Packet Count"),
5082        uint32("send_hold_off_message", "Send Hold Off Message Count"),
5083        uint32("big_read_no_data_avail", "Big Read No Data Available Count"),
5084        uint32("big_read_trying_to_read", "Big Read Trying To Read Too Much Count"),
5085        uint32("async_read_error", "Async Read Error Count"),
5086        uint32("big_read_phy_read_err", "Big Read Physical Read Error Count"),
5087        uint32("ctl_bad_ack_frag_list", "Control Bad ACK Fragment List Count"),
5088        uint32("ctl_no_data_read", "Control No Data Read Count"),
5089        uint32("write_dup_req", "Write Duplicate Request Count"),
5090        uint32("shouldnt_be_ack_here", "Shouldn't Be ACKing Here Count"),
5091        uint32("write_incon_packet_len", "Write Inconsistent Packet Lengths Count"),
5092        uint32("first_packet_isnt_a_write", "First Packet Isn't A Write Count"),
5093        uint32("write_trash_dup_req", "Write Trashed Duplicate Request Count"),
5094        uint32("big_write_inv_message_num", "Big Write Invalid Message Number Count"),
5095        uint32("big_write_being_torn_down", "Big Write Being Torn Down Count"),
5096        uint32("big_write_being_abort", "Big Write Being Aborted Count"),
5097        uint32("zero_ack_frag", "Zero ACK Fragment Count"),
5098        uint32("write_curr_trans", "Write Currently Transmitting Count"),
5099        uint32("try_to_write_too_much", "Trying To Write Too Much Count"),
5100        uint32("write_out_of_mem_for_ctl_nodes", "Write Out Of Memory For Control Nodes Count"),
5101        uint32("write_didnt_need_this_frag", "Write Didn't Need This Fragment Count"),
5102        uint32("write_too_many_buf_check", "Write Too Many Buffers Checked Out Count"),
5103        uint32("write_timeout", "Write Time Out Count"),
5104        uint32("write_got_an_ack0", "Write Got An ACK Count 0"),
5105        uint32("write_got_an_ack1", "Write Got An ACK Count 1"),
5106        uint32("poll_abort_conn", "Poller Aborted The Connection Count"),
5107        uint32("may_had_out_of_order", "Maybe Had Out Of Order Writes Count"),
5108        uint32("had_an_out_of_order", "Had An Out Of Order Write Count"),
5109        uint32("moved_the_ack_bit_dn", "Moved The ACK Bit Down Count"),
5110        uint32("bumped_out_of_order", "Bumped Out Of Order Write Count"),
5111        uint32("poll_rem_old_out_of_order", "Poller Removed Old Out Of Order Count"),
5112        uint32("write_didnt_need_but_req_ack", "Write Didn't Need But Requested ACK Count"),
5113        uint32("write_trash_packet", "Write Trashed Packet Count"),
5114        uint32("too_many_ack_frag", "Too Many ACK Fragments Count"),
5115        uint32("saved_an_out_of_order_packet", "Saved An Out Of Order Packet Count"),
5116        uint32("conn_being_aborted", "Connection Being Aborted Count"),
5117], "Packet Burst Information")
5118
5119PadDSSpaceAllocate              = struct("pad_ds_space_alloc", [
5120    Reserved4,
5121])
5122PadAttributes                   = struct("pad_attributes", [
5123    Reserved6,
5124])
5125PadDataStreamSize               = struct("pad_data_stream_size", [
5126    Reserved4,
5127])
5128PadTotalStreamSize              = struct("pad_total_stream_size", [
5129    Reserved6,
5130])
5131PadCreationInfo                 = struct("pad_creation_info", [
5132    Reserved8,
5133])
5134PadModifyInfo                   = struct("pad_modify_info", [
5135    Reserved10,
5136])
5137PadArchiveInfo                  = struct("pad_archive_info", [
5138    Reserved8,
5139])
5140PadRightsInfo                   = struct("pad_rights_info", [
5141    Reserved2,
5142])
5143PadDirEntry                     = struct("pad_dir_entry", [
5144    Reserved12,
5145])
5146PadEAInfo                       = struct("pad_ea_info", [
5147    Reserved12,
5148])
5149PadNSInfo                       = struct("pad_ns_info", [
5150    Reserved4,
5151])
5152PhyLockStruct                   = struct("phy_lock_struct", [
5153        LoggedCount,
5154        ShareableLockCount,
5155        RecordStart,
5156        RecordEnd,
5157        LogicalConnectionNumber,
5158        TaskNumByte,
5159        LockType,
5160], "Physical Locks")
5161printInfo                       = struct("print_info_struct", [
5162        PrintFlags,
5163        TabSize,
5164        Copies,
5165        PrintToFileFlag,
5166        BannerName,
5167        TargetPrinter,
5168        FormType,
5169], "Print Information")
5170ReplyLevel1Struct       = struct("reply_lvl_1_struct", [
5171    DirHandle,
5172    VolumeNumber,
5173    Reserved4,
5174], "Reply Level 1")
5175ReplyLevel2Struct       = struct("reply_lvl_2_struct", [
5176    VolumeNumberLong,
5177    DirectoryBase,
5178    DOSDirectoryBase,
5179    NameSpace,
5180    DirHandle,
5181], "Reply Level 2")
5182RightsInfoStruct                = struct("rights_info_struct", [
5183        InheritedRightsMask,
5184])
5185RoutersInfo                     = struct("routers_info", [
5186        bytes("node", "Node", 6),
5187        ConnectedLAN,
5188        uint16("route_hops", "Hop Count"),
5189        uint16("route_time", "Route Time"),
5190], "Router Information")
5191RTagStructure                   = struct("r_tag_struct", [
5192        RTagNumber,
5193        ResourceSignature,
5194        ResourceCount,
5195        ResourceName,
5196], "Resource Tag")
5197ScanInfoFileName                = struct("scan_info_file_name", [
5198        SalvageableFileEntryNumber,
5199        FileName,
5200])
5201ScanInfoFileNoName              = struct("scan_info_file_no_name", [
5202        SalvageableFileEntryNumber,
5203])
5204SeachSequenceStruct             = struct("search_seq", [
5205        VolumeNumber,
5206        DirectoryEntryNumber,
5207        SequenceNumber,
5208], "Search Sequence")
5209Segments                        = struct("segments", [
5210        uint32("volume_segment_dev_num", "Volume Segment Device Number"),
5211        uint32("volume_segment_offset", "Volume Segment Offset"),
5212        uint32("volume_segment_size", "Volume Segment Size"),
5213], "Volume Segment Information")
5214SemaInfoStruct                  = struct("sema_info_struct", [
5215        LogicalConnectionNumber,
5216        TaskNumByte,
5217])
5218SemaStruct                      = struct("sema_struct", [
5219        OpenCount,
5220        SemaphoreValue,
5221        TaskNumberWord,
5222        SemaphoreName,
5223], "Semaphore Information")
5224ServerInfo                      = struct("server_info", [
5225        uint32("reply_canceled", "Reply Canceled Count"),
5226        uint32("write_held_off", "Write Held Off Count"),
5227        uint32("write_held_off_with_dup", "Write Held Off With Duplicate Request"),
5228        uint32("invalid_req_type", "Invalid Request Type Count"),
5229        uint32("being_aborted", "Being Aborted Count"),
5230        uint32("already_doing_realloc", "Already Doing Re-Allocate Count"),
5231        uint32("dealloc_invalid_slot", "De-Allocate Invalid Slot Count"),
5232        uint32("dealloc_being_proc", "De-Allocate Being Processed Count"),
5233        uint32("dealloc_forged_packet", "De-Allocate Forged Packet Count"),
5234        uint32("dealloc_still_transmit", "De-Allocate Still Transmitting Count"),
5235        uint32("start_station_error", "Start Station Error Count"),
5236        uint32("invalid_slot", "Invalid Slot Count"),
5237        uint32("being_processed", "Being Processed Count"),
5238        uint32("forged_packet", "Forged Packet Count"),
5239        uint32("still_transmitting", "Still Transmitting Count"),
5240        uint32("reexecute_request", "Re-Execute Request Count"),
5241        uint32("invalid_sequence_number", "Invalid Sequence Number Count"),
5242        uint32("dup_is_being_sent", "Duplicate Is Being Sent Already Count"),
5243        uint32("sent_pos_ack", "Sent Positive Acknowledge Count"),
5244        uint32("sent_a_dup_reply", "Sent A Duplicate Reply Count"),
5245        uint32("no_mem_for_station", "No Memory For Station Control Count"),
5246        uint32("no_avail_conns", "No Available Connections Count"),
5247        uint32("realloc_slot", "Re-Allocate Slot Count"),
5248        uint32("realloc_slot_came_too_soon", "Re-Allocate Slot Came Too Soon Count"),
5249], "Server Information")
5250ServersSrcInfo                  = struct("servers_src_info", [
5251        ServerNode,
5252        ConnectedLAN,
5253        HopsToNet,
5254], "Source Server Information")
5255SpaceStruct                     = struct("space_struct", [
5256        Level,
5257        MaxSpace,
5258        CurrentSpace,
5259], "Space Information")
5260SPXInformation                  = struct("spx_information", [
5261        uint16("spx_max_conn", "SPX Max Connections Count"),
5262        uint16("spx_max_used_conn", "SPX Max Used Connections"),
5263        uint16("spx_est_conn_req", "SPX Establish Connection Requests"),
5264        uint16("spx_est_conn_fail", "SPX Establish Connection Fail"),
5265        uint16("spx_listen_con_req", "SPX Listen Connect Request"),
5266        uint16("spx_listen_con_fail", "SPX Listen Connect Fail"),
5267        uint32("spx_send", "SPX Send Count"),
5268        uint32("spx_window_choke", "SPX Window Choke Count"),
5269        uint16("spx_bad_send", "SPX Bad Send Count"),
5270        uint16("spx_send_fail", "SPX Send Fail Count"),
5271        uint16("spx_abort_conn", "SPX Aborted Connection"),
5272        uint32("spx_listen_pkt", "SPX Listen Packet Count"),
5273        uint16("spx_bad_listen", "SPX Bad Listen Count"),
5274        uint32("spx_incoming_pkt", "SPX Incoming Packet Count"),
5275        uint16("spx_bad_in_pkt", "SPX Bad In Packet Count"),
5276        uint16("spx_supp_pkt", "SPX Suppressed Packet Count"),
5277        uint16("spx_no_ses_listen", "SPX No Session Listen ECB Count"),
5278        uint16("spx_watch_dog", "SPX Watch Dog Destination Session Count"),
5279], "SPX Information")
5280StackInfo                       = struct("stack_info", [
5281        StackNumber,
5282        fw_string("stack_short_name", "Stack Short Name", 16),
5283], "Stack Information")
5284statsInfo                       = struct("stats_info_struct", [
5285        TotalBytesRead,
5286        TotalBytesWritten,
5287        TotalRequest,
5288], "Statistics")
5289TaskStruct                       = struct("task_struct", [
5290        TaskNumberWord,
5291        TaskState,
5292], "Task Information")
5293theTimeStruct                   = struct("the_time_struct", [
5294        UTCTimeInSeconds,
5295        FractionalSeconds,
5296        TimesyncStatus,
5297])
5298timeInfo                        = struct("time_info", [
5299        Year,
5300        Month,
5301        Day,
5302        Hour,
5303        Minute,
5304        Second,
5305        DayOfWeek,
5306        uint32("login_expiration_time", "Login Expiration Time"),
5307])
5308TotalStreamSizeStruct           = struct("total_stream_size_struct", [
5309    TtlDSDskSpaceAlloc,
5310        NumberOfDataStreams,
5311])
5312TrendCounters                   = struct("trend_counters", [
5313        uint32("num_of_cache_checks", "Number Of Cache Checks"),
5314        uint32("num_of_cache_hits", "Number Of Cache Hits"),
5315        uint32("num_of_dirty_cache_checks", "Number Of Dirty Cache Checks"),
5316        uint32("num_of_cache_dirty_checks", "Number Of Cache Dirty Checks"),
5317        uint32("cache_used_while_check", "Cache Used While Checking"),
5318        uint32("wait_till_dirty_blcks_dec", "Wait Till Dirty Blocks Decrease Count"),
5319        uint32("alloc_blck_frm_avail", "Allocate Block From Available Count"),
5320        uint32("alloc_blck_frm_lru", "Allocate Block From LRU Count"),
5321        uint32("alloc_blck_already_wait", "Allocate Block Already Waiting"),
5322        uint32("lru_sit_time", "LRU Sitting Time"),
5323        uint32("num_of_cache_check_no_wait", "Number Of Cache Check No Wait"),
5324        uint32("num_of_cache_hits_no_wait", "Number Of Cache Hits No Wait"),
5325], "Trend Counters")
5326TrusteeStruct                   = struct("trustee_struct", [
5327        endian(ObjectID, ENC_LITTLE_ENDIAN),
5328        AccessRightsMaskWord,
5329])
5330UpdateDateStruct                = struct("update_date_struct", [
5331        UpdateDate,
5332])
5333UpdateIDStruct                  = struct("update_id_struct", [
5334        UpdateID,
5335])
5336UpdateTimeStruct                = struct("update_time_struct", [
5337        UpdateTime,
5338])
5339UserInformation                 = struct("user_info", [
5340        endian(ConnectionNumber, ENC_LITTLE_ENDIAN),
5341        UseCount,
5342        Reserved2,
5343        ConnectionServiceType,
5344        Year,
5345        Month,
5346        Day,
5347        Hour,
5348        Minute,
5349        Second,
5350        DayOfWeek,
5351        Status,
5352        Reserved2,
5353        ExpirationTime,
5354        ObjectType,
5355        Reserved2,
5356        TransactionTrackingFlag,
5357        LogicalLockThreshold,
5358        FileWriteFlags,
5359        FileWriteState,
5360        Reserved,
5361        FileLockCount,
5362        RecordLockCount,
5363        TotalBytesRead,
5364        TotalBytesWritten,
5365        TotalRequest,
5366        HeldRequests,
5367        HeldBytesRead,
5368        HeldBytesWritten,
5369], "User Information")
5370VolInfoStructure                = struct("vol_info_struct", [
5371        VolumeType,
5372        Reserved2,
5373        StatusFlagBits,
5374        SectorSize,
5375        SectorsPerClusterLong,
5376        VolumeSizeInClusters,
5377        FreedClusters,
5378        SubAllocFreeableClusters,
5379        FreeableLimboSectors,
5380        NonFreeableLimboSectors,
5381        NonFreeableAvailableSubAllocSectors,
5382        NotUsableSubAllocSectors,
5383        SubAllocClusters,
5384        DataStreamsCount,
5385        LimboDataStreamsCount,
5386        OldestDeletedFileAgeInTicks,
5387        CompressedDataStreamsCount,
5388        CompressedLimboDataStreamsCount,
5389        UnCompressableDataStreamsCount,
5390        PreCompressedSectors,
5391        CompressedSectors,
5392        MigratedFiles,
5393        MigratedSectors,
5394        ClustersUsedByFAT,
5395        ClustersUsedByDirectories,
5396        ClustersUsedByExtendedDirectories,
5397        TotalDirectoryEntries,
5398        UnUsedDirectoryEntries,
5399        TotalExtendedDirectoryExtents,
5400        UnUsedExtendedDirectoryExtents,
5401        ExtendedAttributesDefined,
5402        ExtendedAttributeExtentsUsed,
5403        DirectoryServicesObjectID,
5404        VolumeEpochTime,
5405
5406], "Volume Information")
5407VolInfoStructure64              = struct("vol_info_struct64", [
5408        VolumeTypeLong,
5409        StatusFlagBits,
5410        uint64("sectoresize64", "Sector Size"),
5411        uint64("sectorspercluster64", "Sectors Per Cluster"),
5412        uint64("volumesizeinclusters64", "Volume Size in Clusters"),
5413        uint64("freedclusters64", "Freed Clusters"),
5414        uint64("suballocfreeableclusters64", "Sub Alloc Freeable Clusters"),
5415        uint64("freeablelimbosectors64", "Freeable Limbo Sectors"),
5416        uint64("nonfreeablelimbosectors64", "Non-Freeable Limbo Sectors"),
5417        uint64("nonfreeableavailalesuballocsectors64", "Non-Freeable Available Sub Alloc Sectors"),
5418        uint64("notusablesuballocsectors64", "Not Usable Sub Alloc Sectors"),
5419        uint64("suballocclusters64", "Sub Alloc Clusters"),
5420        uint64("datastreamscount64", "Data Streams Count"),
5421        uint64("limbodatastreamscount64", "Limbo Data Streams Count"),
5422        uint64("oldestdeletedfileageinticks64", "Oldest Deleted File Age in Ticks"),
5423        uint64("compressdatastreamscount64", "Compressed Data Streams Count"),
5424        uint64("compressedlimbodatastreamscount64", "Compressed Limbo Data Streams Count"),
5425        uint64("uncompressabledatastreamscount64", "Uncompressable Data Streams Count"),
5426        uint64("precompressedsectors64", "Precompressed Sectors"),
5427        uint64("compressedsectors64", "Compressed Sectors"),
5428        uint64("migratedfiles64", "Migrated Files"),
5429        uint64("migratedsectors64", "Migrated Sectors"),
5430        uint64("clustersusedbyfat64", "Clusters Used by FAT"),
5431        uint64("clustersusedbydirectories64", "Clusters Used by Directories"),
5432        uint64("clustersusedbyextendeddirectories64", "Clusters Used by Extended Directories"),
5433        uint64("totaldirectoryentries64", "Total Directory Entries"),
5434        uint64("unuseddirectoryentries64", "Unused Directory Entries"),
5435        uint64("totalextendeddirectoryextents64", "Total Extended Directory Extents"),
5436        uint64("unusedextendeddirectoryextents64", "Unused Total Extended Directory Extents"),
5437        uint64("extendedattributesdefined64", "Extended Attributes Defined"),
5438        uint64("extendedattributeextentsused64", "Extended Attribute Extents Used"),
5439        uint64("directoryservicesobjectid64", "Directory Services Object ID"),
5440        VolumeEpochTime,
5441
5442], "Volume Information")
5443VolInfo2Struct                  = struct("vol_info_struct_2", [
5444        uint32("volume_active_count", "Volume Active Count"),
5445        uint32("volume_use_count", "Volume Use Count"),
5446        uint32("mac_root_ids", "MAC Root IDs"),
5447        VolumeEpochTime,
5448        uint32("volume_reference_count", "Volume Reference Count"),
5449        uint32("compression_lower_limit", "Compression Lower Limit"),
5450        uint32("outstanding_ios", "Outstanding IOs"),
5451        uint32("outstanding_compression_ios", "Outstanding Compression IOs"),
5452        uint32("compression_ios_limit", "Compression IOs Limit"),
5453], "Extended Volume Information")
5454VolumeWithNameStruct                    = struct("volume_with_name_struct", [
5455        VolumeNumberLong,
5456        VolumeNameLen,
5457])
5458VolumeStruct                    = struct("volume_struct", [
5459        VolumeNumberLong,
5460])
5461
5462zFileMap_Allocation             = struct("zfilemap_allocation_struct", [
5463    uint64("extent_byte_offset", "Byte Offset"),
5464    endian(uint64("extent_length_alloc", "Length"), ENC_LITTLE_ENDIAN),
5465    #ExtentLength,
5466], "File Map Allocation")
5467zFileMap_Logical             = struct("zfilemap_logical_struct", [
5468    uint64("extent_block_number", "Block Number"),
5469    uint64("extent_number_of_blocks", "Number of Blocks"),
5470], "File Map Logical")
5471zFileMap_Physical             = struct("zfilemap_physical_struct", [
5472    uint64("extent_length_physical", "Length"),
5473    uint64("extent_logical_offset", "Logical Offset"),
5474    uint64("extent_pool_offset", "Pool Offset"),
5475    uint64("extent_physical_offset", "Physical Offset"),
5476    fw_string("extent_device_id", "Device ID", 8),
5477], "File Map Physical")
5478
5479##############################################################################
5480# NCP Groups
5481##############################################################################
5482def define_groups():
5483    groups['accounting']    = "Accounting"
5484    groups['afp']           = "AFP"
5485    groups['auditing']      = "Auditing"
5486    groups['bindery']       = "Bindery"
5487    groups['connection']    = "Connection"
5488    groups['enhanced']      = "Enhanced File System"
5489    groups['extended']      = "Extended Attribute"
5490    groups['extension']     = "NCP Extension"
5491    groups['file']          = "File System"
5492    groups['fileserver']    = "File Server Environment"
5493    groups['message']       = "Message"
5494    groups['migration']     = "Data Migration"
5495    groups['nds']           = "Novell Directory Services"
5496    groups['pburst']        = "Packet Burst"
5497    groups['print']         = "Print"
5498    groups['remote']        = "Remote"
5499    groups['sync']          = "Synchronization"
5500    groups['tsync']         = "Time Synchronization"
5501    groups['tts']           = "Transaction Tracking"
5502    groups['qms']           = "Queue Management System (QMS)"
5503    groups['stats']         = "Server Statistics"
5504    groups['nmas']          = "Novell Modular Authentication Service"
5505    groups['sss']           = "SecretStore Services"
5506
5507##############################################################################
5508# NCP Errors
5509##############################################################################
5510def define_errors():
5511    errors[0x0000] = "Ok"
5512    errors[0x0001] = "Transaction tracking is available"
5513    errors[0x0002] = "Ok. The data has been written"
5514    errors[0x0003] = "Calling Station is a Manager"
5515
5516    errors[0x0100] = "One or more of the Connection Numbers in the send list are invalid"
5517    errors[0x0101] = "Invalid space limit"
5518    errors[0x0102] = "Insufficient disk space"
5519    errors[0x0103] = "Queue server cannot add jobs"
5520    errors[0x0104] = "Out of disk space"
5521    errors[0x0105] = "Semaphore overflow"
5522    errors[0x0106] = "Invalid Parameter"
5523    errors[0x0107] = "Invalid Number of Minutes to Delay"
5524    errors[0x0108] = "Invalid Start or Network Number"
5525    errors[0x0109] = "Cannot Obtain License"
5526    errors[0x010a] = "No Purgeable Files Available"
5527
5528    errors[0x0200] = "One or more clients in the send list are not logged in"
5529    errors[0x0201] = "Queue server cannot attach"
5530
5531    errors[0x0300] = "One or more clients in the send list are not accepting messages"
5532
5533    errors[0x0400] = "Client already has message"
5534    errors[0x0401] = "Queue server cannot service job"
5535
5536    errors[0x7300] = "Revoke Handle Rights Not Found"
5537    errors[0x7700] = "Buffer Too Small"
5538    errors[0x7900] = "Invalid Parameter in Request Packet"
5539    errors[0x7901] = "Nothing being Compressed"
5540    errors[0x7902] = "No Items Found"
5541    errors[0x7a00] = "Connection Already Temporary"
5542    errors[0x7b00] = "Connection Already Logged in"
5543    errors[0x7c00] = "Connection Not Authenticated"
5544    errors[0x7d00] = "Connection Not Logged In"
5545
5546    errors[0x7e00] = "NCP failed boundary check"
5547    errors[0x7e01] = "Invalid Length"
5548
5549    errors[0x7f00] = "Lock Waiting"
5550    errors[0x8000] = "Lock fail"
5551    errors[0x8001] = "File in Use"
5552
5553    errors[0x8100] = "A file handle could not be allocated by the file server"
5554    errors[0x8101] = "Out of File Handles"
5555
5556    errors[0x8200] = "Unauthorized to open the file"
5557    errors[0x8300] = "Unable to read/write the volume. Possible bad sector on the file server"
5558    errors[0x8301] = "Hard I/O Error"
5559
5560    errors[0x8400] = "Unauthorized to create the directory"
5561    errors[0x8401] = "Unauthorized to create the file"
5562
5563    errors[0x8500] = "Unauthorized to delete the specified file"
5564    errors[0x8501] = "Unauthorized to overwrite an existing file in this directory"
5565
5566    errors[0x8700] = "An unexpected character was encountered in the filename"
5567    errors[0x8701] = "Create Filename Error"
5568
5569    errors[0x8800] = "Invalid file handle"
5570    errors[0x8900] = "Unauthorized to search this file/directory"
5571    errors[0x8a00] = "Unauthorized to delete this file/directory"
5572    errors[0x8b00] = "Unauthorized to rename a file in this directory"
5573
5574    errors[0x8c00] = "No set privileges"
5575    errors[0x8c01] = "Unauthorized to modify a file in this directory"
5576    errors[0x8c02] = "Unauthorized to change the restriction on this volume"
5577
5578    errors[0x8d00] = "Some of the affected files are in use by another client"
5579    errors[0x8d01] = "The affected file is in use"
5580
5581    errors[0x8e00] = "All of the affected files are in use by another client"
5582    errors[0x8f00] = "Some of the affected files are read-only"
5583
5584    errors[0x9000] = "An attempt to modify a read-only volume occurred"
5585    errors[0x9001] = "All of the affected files are read-only"
5586    errors[0x9002] = "Read Only Access to Volume"
5587
5588    errors[0x9100] = "Some of the affected files already exist"
5589    errors[0x9101] = "Some Names Exist"
5590
5591    errors[0x9200] = "Directory with the new name already exists"
5592    errors[0x9201] = "All of the affected files already exist"
5593
5594    errors[0x9300] = "Unauthorized to read from this file"
5595    errors[0x9400] = "Unauthorized to write to this file"
5596    errors[0x9500] = "The affected file is detached"
5597
5598    errors[0x9600] = "The file server has run out of memory to service this request"
5599    errors[0x9601] = "No alloc space for message"
5600    errors[0x9602] = "Server Out of Space"
5601
5602    errors[0x9800] = "The affected volume is not mounted"
5603    errors[0x9801] = "The volume associated with Volume Number is not mounted"
5604    errors[0x9802] = "The resulting volume does not exist"
5605    errors[0x9803] = "The destination volume is not mounted"
5606    errors[0x9804] = "Disk Map Error"
5607
5608    errors[0x9900] = "The file server has run out of directory space on the affected volume"
5609    errors[0x9a00] = "Invalid request to rename the affected file to another volume"
5610
5611    errors[0x9b00] = "DirHandle is not associated with a valid directory path"
5612    errors[0x9b01] = "A resulting directory handle is not associated with a valid directory path"
5613    errors[0x9b02] = "The directory associated with DirHandle does not exist"
5614    errors[0x9b03] = "Bad directory handle"
5615
5616    errors[0x9c00] = "The resulting path is not valid"
5617    errors[0x9c01] = "The resulting file path is not valid"
5618    errors[0x9c02] = "The resulting directory path is not valid"
5619    errors[0x9c03] = "Invalid path"
5620    errors[0x9c04] = "No more trustees found, based on requested search sequence number"
5621
5622    errors[0x9d00] = "A directory handle was not available for allocation"
5623
5624    errors[0x9e00] = "The name of the directory does not conform to a legal name for this name space"
5625    errors[0x9e01] = "The new directory name does not conform to a legal name for this name space"
5626    errors[0x9e02] = "Bad File Name"
5627
5628    errors[0x9f00] = "The request attempted to delete a directory that is in use by another client"
5629
5630    errors[0xa000] = "The request attempted to delete a directory that is not empty"
5631    errors[0xa100] = "An unrecoverable error occurred on the affected directory"
5632
5633    errors[0xa200] = "The request attempted to read from a file region that is physically locked"
5634    errors[0xa201] = "I/O Lock Error"
5635
5636    errors[0xa400] = "Invalid directory rename attempted"
5637    errors[0xa500] = "Invalid open create mode"
5638    errors[0xa600] = "Auditor Access has been Removed"
5639    errors[0xa700] = "Error Auditing Version"
5640
5641    errors[0xa800] = "Invalid Support Module ID"
5642    errors[0xa801] = "No Auditing Access Rights"
5643    errors[0xa802] = "No Access Rights"
5644
5645    errors[0xa900] = "Error Link in Path"
5646    errors[0xa901] = "Invalid Path With Junction Present"
5647
5648    errors[0xaa00] = "Invalid Data Type Flag"
5649
5650    errors[0xac00] = "Packet Signature Required"
5651
5652    errors[0xbe00] = "Invalid Data Stream"
5653    errors[0xbf00] = "Requests for this name space are not valid on this volume"
5654
5655    errors[0xc000] = "Unauthorized to retrieve accounting data"
5656
5657    errors[0xc100] = "The ACCOUNT_BALANCE property does not exist"
5658    errors[0xc101] = "No Account Balance"
5659
5660    errors[0xc200] = "The object has exceeded its credit limit"
5661    errors[0xc300] = "Too many holds have been placed against this account"
5662    errors[0xc400] = "The client account has been disabled"
5663
5664    errors[0xc500] = "Access to the account has been denied because of intruder detection"
5665    errors[0xc501] = "Login lockout"
5666    errors[0xc502] = "Server Login Locked"
5667
5668    errors[0xc600] = "The caller does not have operator privileges"
5669    errors[0xc601] = "The client does not have operator privileges"
5670
5671    errors[0xc800] = "Missing EA Key"
5672    errors[0xc900] = "EA Not Found"
5673    errors[0xca00] = "Invalid EA Handle Type"
5674    errors[0xcb00] = "EA No Key No Data"
5675    errors[0xcc00] = "EA Number Mismatch"
5676    errors[0xcd00] = "Extent Number Out of Range"
5677    errors[0xce00] = "EA Bad Directory Number"
5678    errors[0xcf00] = "Invalid EA Handle"
5679
5680    errors[0xd000] = "Queue error"
5681    errors[0xd001] = "EA Position Out of Range"
5682
5683    errors[0xd100] = "The queue does not exist"
5684    errors[0xd101] = "EA Access Denied"
5685
5686    errors[0xd200] = "A queue server is not associated with this queue"
5687    errors[0xd201] = "A queue server is not associated with the selected queue"
5688    errors[0xd202] = "No queue server"
5689    errors[0xd203] = "Data Page Odd Size"
5690
5691    errors[0xd300] = "No queue rights"
5692    errors[0xd301] = "EA Volume Not Mounted"
5693
5694    errors[0xd400] = "The queue is full and cannot accept another request"
5695    errors[0xd401] = "The queue associated with ObjectId is full and cannot accept another request"
5696    errors[0xd402] = "Bad Page Boundary"
5697
5698    errors[0xd500] = "A job does not exist in this queue"
5699    errors[0xd501] = "No queue job"
5700    errors[0xd502] = "The job associated with JobNumber does not exist in this queue"
5701    errors[0xd503] = "Inspect Failure"
5702    errors[0xd504] = "Unknown NCP Extension Number"
5703
5704    errors[0xd600] = "The file server does not allow unencrypted passwords"
5705    errors[0xd601] = "No job right"
5706    errors[0xd602] = "EA Already Claimed"
5707
5708    errors[0xd700] = "Bad account"
5709    errors[0xd701] = "The old and new password strings are identical"
5710    errors[0xd702] = "The job is currently being serviced"
5711    errors[0xd703] = "The queue is currently servicing a job"
5712    errors[0xd704] = "Queue servicing"
5713    errors[0xd705] = "Odd Buffer Size"
5714
5715    errors[0xd800] = "Queue not active"
5716    errors[0xd801] = "No Scorecards"
5717
5718    errors[0xd900] = "The file server cannot accept another connection as it has reached its limit"
5719    errors[0xd901] = "The client is not security equivalent to one of the objects in the Q_SERVERS group property of the target queue"
5720    errors[0xd902] = "Queue Station is not a server"
5721    errors[0xd903] = "Bad EDS Signature"
5722    errors[0xd904] = "Attempt to log in using an account which has limits on the number of concurrent connections and that number has been reached."
5723
5724    errors[0xda00] = "Attempted to login to the file server during a restricted time period"
5725    errors[0xda01] = "Queue halted"
5726    errors[0xda02] = "EA Space Limit"
5727
5728    errors[0xdb00] = "Attempted to login to the file server from an unauthorized workstation or network"
5729    errors[0xdb01] = "The queue cannot attach another queue server"
5730    errors[0xdb02] = "Maximum queue servers"
5731    errors[0xdb03] = "EA Key Corrupt"
5732
5733    errors[0xdc00] = "Account Expired"
5734    errors[0xdc01] = "EA Key Limit"
5735
5736    errors[0xdd00] = "Tally Corrupt"
5737    errors[0xde00] = "Attempted to login to the file server with an incorrect password"
5738    errors[0xdf00] = "Attempted to login to the file server with a password that has expired"
5739
5740    errors[0xe000] = "No Login Connections Available"
5741    errors[0xe700] = "No disk track"
5742    errors[0xe800] = "Write to group"
5743    errors[0xe900] = "The object is already a member of the group property"
5744
5745    errors[0xea00] = "No such member"
5746    errors[0xea01] = "The bindery object is not a member of the set"
5747    errors[0xea02] = "Non-existent member"
5748
5749    errors[0xeb00] = "The property is not a set property"
5750
5751    errors[0xec00] = "No such set"
5752    errors[0xec01] = "The set property does not exist"
5753
5754    errors[0xed00] = "Property exists"
5755    errors[0xed01] = "The property already exists"
5756    errors[0xed02] = "An attempt was made to create a bindery object property that already exists"
5757
5758    errors[0xee00] = "The object already exists"
5759    errors[0xee01] = "The bindery object already exists"
5760
5761    errors[0xef00] = "Illegal name"
5762    errors[0xef01] = "Illegal characters in ObjectName field"
5763    errors[0xef02] = "Invalid name"
5764
5765    errors[0xf000] = "A wildcard was detected in a field that does not support wildcards"
5766    errors[0xf001] = "An illegal wildcard was detected in ObjectName"
5767
5768    errors[0xf100] = "The client does not have the rights to access this bindery object"
5769    errors[0xf101] = "Bindery security"
5770    errors[0xf102] = "Invalid bindery security"
5771
5772    errors[0xf200] = "Unauthorized to read from this object"
5773    errors[0xf300] = "Unauthorized to rename this object"
5774
5775    errors[0xf400] = "Unauthorized to delete this object"
5776    errors[0xf401] = "No object delete privileges"
5777    errors[0xf402] = "Unauthorized to delete this queue"
5778
5779    errors[0xf500] = "Unauthorized to create this object"
5780    errors[0xf501] = "No object create"
5781
5782    errors[0xf600] = "No property delete"
5783    errors[0xf601] = "Unauthorized to delete the property of this object"
5784    errors[0xf602] = "Unauthorized to delete this property"
5785
5786    errors[0xf700] = "Unauthorized to create this property"
5787    errors[0xf701] = "No property create privilege"
5788
5789    errors[0xf800] = "Unauthorized to write to this property"
5790    errors[0xf900] = "Unauthorized to read this property"
5791    errors[0xfa00] = "Temporary remap error"
5792
5793    errors[0xfb00] = "No such property"
5794    errors[0xfb01] = "The file server does not support this request"
5795    errors[0xfb02] = "The specified property does not exist"
5796    errors[0xfb03] = "The PASSWORD property does not exist for this bindery object"
5797    errors[0xfb04] = "NDS NCP not available"
5798    errors[0xfb05] = "Bad Directory Handle"
5799    errors[0xfb06] = "Unknown Request"
5800    errors[0xfb07] = "Invalid Subfunction Request"
5801    errors[0xfb08] = "Attempt to use an invalid parameter (drive number, path, or flag value) during a set drive path call"
5802    errors[0xfb09] = "NMAS not running on this server, NCP NOT Supported"
5803    errors[0xfb0a] = "Station Not Logged In"
5804    errors[0xfb0b] = "Secret Store not running on this server, NCP Not supported"
5805
5806    errors[0xfc00] = "The message queue cannot accept another message"
5807    errors[0xfc01] = "The trustee associated with ObjectId does not exist"
5808    errors[0xfc02] = "The specified bindery object does not exist"
5809    errors[0xfc03] = "The bindery object associated with ObjectID does not exist"
5810    errors[0xfc04] = "A bindery object does not exist that matches"
5811    errors[0xfc05] = "The specified queue does not exist"
5812    errors[0xfc06] = "No such object"
5813    errors[0xfc07] = "The queue associated with ObjectID does not exist"
5814
5815    errors[0xfd00] = "Bad station number"
5816    errors[0xfd01] = "The connection associated with ConnectionNumber is not active"
5817    errors[0xfd02] = "Lock collision"
5818    errors[0xfd03] = "Transaction tracking is disabled"
5819
5820    errors[0xfe00] = "I/O failure"
5821    errors[0xfe01] = "The files containing the bindery on the file server are locked"
5822    errors[0xfe02] = "A file with the specified name already exists in this directory"
5823    errors[0xfe03] = "No more restrictions were found"
5824    errors[0xfe04] = "The file server was unable to lock the file within the specified time limit"
5825    errors[0xfe05] = "The file server was unable to lock all files within the specified time limit"
5826    errors[0xfe06] = "The bindery object associated with ObjectID is not a valid trustee"
5827    errors[0xfe07] = "Directory locked"
5828    errors[0xfe08] = "Bindery locked"
5829    errors[0xfe09] = "Invalid semaphore name length"
5830    errors[0xfe0a] = "The file server was unable to complete the operation within the specified time limit"
5831    errors[0xfe0b] = "Transaction restart"
5832    errors[0xfe0c] = "Bad packet"
5833    errors[0xfe0d] = "Timeout"
5834    errors[0xfe0e] = "User Not Found"
5835    errors[0xfe0f] = "Trustee Not Found"
5836
5837    errors[0xff00] = "Failure"
5838    errors[0xff01] = "Lock error"
5839    errors[0xff02] = "File not found"
5840    errors[0xff03] = "The file not found or cannot be unlocked"
5841    errors[0xff04] = "Record not found"
5842    errors[0xff05] = "The logical record was not found"
5843    errors[0xff06] = "The printer associated with Printer Number does not exist"
5844    errors[0xff07] = "No such printer"
5845    errors[0xff08] = "Unable to complete the request"
5846    errors[0xff09] = "Unauthorized to change privileges of this trustee"
5847    errors[0xff0a] = "No files matching the search criteria were found"
5848    errors[0xff0b] = "A file matching the search criteria was not found"
5849    errors[0xff0c] = "Verification failed"
5850    errors[0xff0d] = "Object associated with ObjectID is not a manager"
5851    errors[0xff0e] = "Invalid initial semaphore value"
5852    errors[0xff0f] = "The semaphore handle is not valid"
5853    errors[0xff10] = "SemaphoreHandle is not associated with a valid sempahore"
5854    errors[0xff11] = "Invalid semaphore handle"
5855    errors[0xff12] = "Transaction tracking is not available"
5856    errors[0xff13] = "The transaction has not yet been written to disk"
5857    errors[0xff14] = "Directory already exists"
5858    errors[0xff15] = "The file already exists and the deletion flag was not set"
5859    errors[0xff16] = "No matching files or directories were found"
5860    errors[0xff17] = "A file or directory matching the search criteria was not found"
5861    errors[0xff18] = "The file already exists"
5862    errors[0xff19] = "Failure, No files found"
5863    errors[0xff1a] = "Unlock Error"
5864    errors[0xff1b] = "I/O Bound Error"
5865    errors[0xff1c] = "Not Accepting Messages"
5866    errors[0xff1d] = "No More Salvageable Files in Directory"
5867    errors[0xff1e] = "Calling Station is Not a Manager"
5868    errors[0xff1f] = "Bindery Failure"
5869    errors[0xff20] = "NCP Extension Not Found"
5870    errors[0xff21] = "Audit Property Not Found"
5871    errors[0xff22] = "Server Set Parameter Not Found"
5872
5873##############################################################################
5874# Produce C code
5875##############################################################################
5876def ExamineVars(vars, structs_hash, vars_hash):
5877    for var in vars:
5878        if isinstance(var, struct):
5879            structs_hash[var.HFName()] = var
5880            struct_vars = var.Variables()
5881            ExamineVars(struct_vars, structs_hash, vars_hash)
5882        else:
5883            vars_hash[repr(var)] = var
5884            if isinstance(var, bitfield):
5885                sub_vars = var.SubVariables()
5886                ExamineVars(sub_vars, structs_hash, vars_hash)
5887
5888def produce_code():
5889
5890    global errors
5891
5892    print("/*")
5893    print(" * Do not modify this file. Changes will be overwritten.")
5894    print(" * Generated automatically from %s" % (sys.argv[0]))
5895    print(" */\n")
5896
5897    print("""
5898/*
5899 * Portions Copyright (c) Gilbert Ramirez 2000-2002
5900 * Portions Copyright (c) Novell, Inc. 2000-2005
5901 *
5902 * SPDX-License-Identifier: GPL-2.0-or-later
5903 */
5904
5905#include "config.h"
5906
5907#include <string.h>
5908#include <glib.h>
5909#include <epan/packet.h>
5910#include <epan/dfilter/dfilter.h>
5911#include <epan/exceptions.h>
5912#include <ftypes/ftypes-int.h>
5913#include <epan/to_str.h>
5914#include <epan/conversation.h>
5915#include <epan/ptvcursor.h>
5916#include <epan/strutil.h>
5917#include <epan/reassemble.h>
5918#include <epan/tap.h>
5919#include <epan/proto_data.h>
5920#include "packet-ncp-int.h"
5921#include "packet-ncp-nmas.h"
5922#include "packet-ncp-sss.h"
5923
5924/* Function declarations for functions used in proto_register_ncp2222() */
5925void proto_register_ncp2222(void);
5926
5927/* Endianness macros */
5928#define NO_ENDIANNESS   0
5929
5930#define NO_LENGTH       -1
5931
5932/* We use this int-pointer as a special flag in ptvc_record's */
5933static int ptvc_struct_int_storage;
5934#define PTVC_STRUCT     (&ptvc_struct_int_storage)
5935
5936/* Values used in the count-variable ("var"/"repeat") logic. */""")
5937
5938
5939    if global_highest_var > -1:
5940        print("#define NUM_REPEAT_VARS    %d" % (global_highest_var + 1))
5941        print("static guint repeat_vars[NUM_REPEAT_VARS];")
5942    else:
5943        print("#define NUM_REPEAT_VARS    0")
5944        print("static guint *repeat_vars = NULL;")
5945
5946    print("""
5947#define NO_VAR          NUM_REPEAT_VARS
5948#define NO_REPEAT       NUM_REPEAT_VARS
5949
5950#define REQ_COND_SIZE_CONSTANT  0
5951#define REQ_COND_SIZE_VARIABLE  1
5952#define NO_REQ_COND_SIZE        0
5953
5954
5955#define NTREE   0x00020000
5956#define NDEPTH  0x00000002
5957#define NREV    0x00000004
5958#define NFLAGS  0x00000008
5959
5960static int hf_ncp_number_of_data_streams_long = -1;
5961static int hf_ncp_func = -1;
5962static int hf_ncp_length = -1;
5963static int hf_ncp_subfunc = -1;
5964static int hf_ncp_group = -1;
5965static int hf_ncp_fragment_handle = -1;
5966static int hf_ncp_completion_code = -1;
5967static int hf_ncp_connection_status = -1;
5968static int hf_ncp_req_frame_num = -1;
5969static int hf_ncp_req_frame_time = -1;
5970static int hf_ncp_fragment_size = -1;
5971static int hf_ncp_message_size = -1;
5972static int hf_ncp_nds_flag = -1;
5973static int hf_ncp_nds_verb = -1;
5974static int hf_ping_version = -1;
5975/* static int hf_nds_version = -1; */
5976/* static int hf_nds_flags = -1; */
5977static int hf_nds_reply_depth = -1;
5978static int hf_nds_reply_rev = -1;
5979static int hf_nds_reply_flags = -1;
5980static int hf_nds_p1type = -1;
5981static int hf_nds_uint32value = -1;
5982static int hf_nds_bit1 = -1;
5983static int hf_nds_bit2 = -1;
5984static int hf_nds_bit3 = -1;
5985static int hf_nds_bit4 = -1;
5986static int hf_nds_bit5 = -1;
5987static int hf_nds_bit6 = -1;
5988static int hf_nds_bit7 = -1;
5989static int hf_nds_bit8 = -1;
5990static int hf_nds_bit9 = -1;
5991static int hf_nds_bit10 = -1;
5992static int hf_nds_bit11 = -1;
5993static int hf_nds_bit12 = -1;
5994static int hf_nds_bit13 = -1;
5995static int hf_nds_bit14 = -1;
5996static int hf_nds_bit15 = -1;
5997static int hf_nds_bit16 = -1;
5998static int hf_outflags = -1;
5999static int hf_bit1outflags = -1;
6000static int hf_bit2outflags = -1;
6001static int hf_bit3outflags = -1;
6002static int hf_bit4outflags = -1;
6003static int hf_bit5outflags = -1;
6004static int hf_bit6outflags = -1;
6005static int hf_bit7outflags = -1;
6006static int hf_bit8outflags = -1;
6007static int hf_bit9outflags = -1;
6008static int hf_bit10outflags = -1;
6009static int hf_bit11outflags = -1;
6010static int hf_bit12outflags = -1;
6011static int hf_bit13outflags = -1;
6012static int hf_bit14outflags = -1;
6013static int hf_bit15outflags = -1;
6014static int hf_bit16outflags = -1;
6015static int hf_bit1nflags = -1;
6016static int hf_bit2nflags = -1;
6017static int hf_bit3nflags = -1;
6018static int hf_bit4nflags = -1;
6019static int hf_bit5nflags = -1;
6020static int hf_bit6nflags = -1;
6021static int hf_bit7nflags = -1;
6022static int hf_bit8nflags = -1;
6023static int hf_bit9nflags = -1;
6024static int hf_bit10nflags = -1;
6025static int hf_bit11nflags = -1;
6026static int hf_bit12nflags = -1;
6027static int hf_bit13nflags = -1;
6028static int hf_bit14nflags = -1;
6029static int hf_bit15nflags = -1;
6030static int hf_bit16nflags = -1;
6031static int hf_bit1rflags = -1;
6032static int hf_bit2rflags = -1;
6033static int hf_bit3rflags = -1;
6034static int hf_bit4rflags = -1;
6035static int hf_bit5rflags = -1;
6036static int hf_bit6rflags = -1;
6037static int hf_bit7rflags = -1;
6038static int hf_bit8rflags = -1;
6039static int hf_bit9rflags = -1;
6040static int hf_bit10rflags = -1;
6041static int hf_bit11rflags = -1;
6042static int hf_bit12rflags = -1;
6043static int hf_bit13rflags = -1;
6044static int hf_bit14rflags = -1;
6045static int hf_bit15rflags = -1;
6046static int hf_bit16rflags = -1;
6047static int hf_cflags = -1;
6048static int hf_bit1cflags = -1;
6049static int hf_bit2cflags = -1;
6050static int hf_bit3cflags = -1;
6051static int hf_bit4cflags = -1;
6052static int hf_bit5cflags = -1;
6053static int hf_bit6cflags = -1;
6054static int hf_bit7cflags = -1;
6055static int hf_bit8cflags = -1;
6056static int hf_bit9cflags = -1;
6057static int hf_bit10cflags = -1;
6058static int hf_bit11cflags = -1;
6059static int hf_bit12cflags = -1;
6060static int hf_bit13cflags = -1;
6061static int hf_bit14cflags = -1;
6062static int hf_bit15cflags = -1;
6063static int hf_bit16cflags = -1;
6064static int hf_bit1acflags = -1;
6065static int hf_bit2acflags = -1;
6066static int hf_bit3acflags = -1;
6067static int hf_bit4acflags = -1;
6068static int hf_bit5acflags = -1;
6069static int hf_bit6acflags = -1;
6070static int hf_bit7acflags = -1;
6071static int hf_bit8acflags = -1;
6072static int hf_bit9acflags = -1;
6073static int hf_bit10acflags = -1;
6074static int hf_bit11acflags = -1;
6075static int hf_bit12acflags = -1;
6076static int hf_bit13acflags = -1;
6077static int hf_bit14acflags = -1;
6078static int hf_bit15acflags = -1;
6079static int hf_bit16acflags = -1;
6080static int hf_vflags = -1;
6081static int hf_bit1vflags = -1;
6082static int hf_bit2vflags = -1;
6083static int hf_bit3vflags = -1;
6084static int hf_bit4vflags = -1;
6085static int hf_bit5vflags = -1;
6086static int hf_bit6vflags = -1;
6087static int hf_bit7vflags = -1;
6088static int hf_bit8vflags = -1;
6089static int hf_bit9vflags = -1;
6090static int hf_bit10vflags = -1;
6091static int hf_bit11vflags = -1;
6092static int hf_bit12vflags = -1;
6093static int hf_bit13vflags = -1;
6094static int hf_bit14vflags = -1;
6095static int hf_bit15vflags = -1;
6096static int hf_bit16vflags = -1;
6097static int hf_eflags = -1;
6098static int hf_bit1eflags = -1;
6099static int hf_bit2eflags = -1;
6100static int hf_bit3eflags = -1;
6101static int hf_bit4eflags = -1;
6102static int hf_bit5eflags = -1;
6103static int hf_bit6eflags = -1;
6104static int hf_bit7eflags = -1;
6105static int hf_bit8eflags = -1;
6106static int hf_bit9eflags = -1;
6107static int hf_bit10eflags = -1;
6108static int hf_bit11eflags = -1;
6109static int hf_bit12eflags = -1;
6110static int hf_bit13eflags = -1;
6111static int hf_bit14eflags = -1;
6112static int hf_bit15eflags = -1;
6113static int hf_bit16eflags = -1;
6114static int hf_infoflagsl = -1;
6115static int hf_retinfoflagsl = -1;
6116static int hf_bit1infoflagsl = -1;
6117static int hf_bit2infoflagsl = -1;
6118static int hf_bit3infoflagsl = -1;
6119static int hf_bit4infoflagsl = -1;
6120static int hf_bit5infoflagsl = -1;
6121static int hf_bit6infoflagsl = -1;
6122static int hf_bit7infoflagsl = -1;
6123static int hf_bit8infoflagsl = -1;
6124static int hf_bit9infoflagsl = -1;
6125static int hf_bit10infoflagsl = -1;
6126static int hf_bit11infoflagsl = -1;
6127static int hf_bit12infoflagsl = -1;
6128static int hf_bit13infoflagsl = -1;
6129static int hf_bit14infoflagsl = -1;
6130static int hf_bit15infoflagsl = -1;
6131static int hf_bit16infoflagsl = -1;
6132static int hf_infoflagsh = -1;
6133static int hf_bit1infoflagsh = -1;
6134static int hf_bit2infoflagsh = -1;
6135static int hf_bit3infoflagsh = -1;
6136static int hf_bit4infoflagsh = -1;
6137static int hf_bit5infoflagsh = -1;
6138static int hf_bit6infoflagsh = -1;
6139static int hf_bit7infoflagsh = -1;
6140static int hf_bit8infoflagsh = -1;
6141static int hf_bit9infoflagsh = -1;
6142static int hf_bit10infoflagsh = -1;
6143static int hf_bit11infoflagsh = -1;
6144static int hf_bit12infoflagsh = -1;
6145static int hf_bit13infoflagsh = -1;
6146static int hf_bit14infoflagsh = -1;
6147static int hf_bit15infoflagsh = -1;
6148static int hf_bit16infoflagsh = -1;
6149static int hf_retinfoflagsh = -1;
6150static int hf_bit1retinfoflagsh = -1;
6151static int hf_bit2retinfoflagsh = -1;
6152static int hf_bit3retinfoflagsh = -1;
6153static int hf_bit4retinfoflagsh = -1;
6154static int hf_bit5retinfoflagsh = -1;
6155static int hf_bit6retinfoflagsh = -1;
6156static int hf_bit7retinfoflagsh = -1;
6157static int hf_bit8retinfoflagsh = -1;
6158static int hf_bit9retinfoflagsh = -1;
6159static int hf_bit10retinfoflagsh = -1;
6160static int hf_bit11retinfoflagsh = -1;
6161static int hf_bit12retinfoflagsh = -1;
6162static int hf_bit13retinfoflagsh = -1;
6163static int hf_bit14retinfoflagsh = -1;
6164static int hf_bit15retinfoflagsh = -1;
6165static int hf_bit16retinfoflagsh = -1;
6166static int hf_bit1lflags = -1;
6167static int hf_bit2lflags = -1;
6168static int hf_bit3lflags = -1;
6169static int hf_bit4lflags = -1;
6170static int hf_bit5lflags = -1;
6171static int hf_bit6lflags = -1;
6172static int hf_bit7lflags = -1;
6173static int hf_bit8lflags = -1;
6174static int hf_bit9lflags = -1;
6175static int hf_bit10lflags = -1;
6176static int hf_bit11lflags = -1;
6177static int hf_bit12lflags = -1;
6178static int hf_bit13lflags = -1;
6179static int hf_bit14lflags = -1;
6180static int hf_bit15lflags = -1;
6181static int hf_bit16lflags = -1;
6182static int hf_l1flagsl = -1;
6183static int hf_l1flagsh = -1;
6184static int hf_bit1l1flagsl = -1;
6185static int hf_bit2l1flagsl = -1;
6186static int hf_bit3l1flagsl = -1;
6187static int hf_bit4l1flagsl = -1;
6188static int hf_bit5l1flagsl = -1;
6189static int hf_bit6l1flagsl = -1;
6190static int hf_bit7l1flagsl = -1;
6191static int hf_bit8l1flagsl = -1;
6192static int hf_bit9l1flagsl = -1;
6193static int hf_bit10l1flagsl = -1;
6194static int hf_bit11l1flagsl = -1;
6195static int hf_bit12l1flagsl = -1;
6196static int hf_bit13l1flagsl = -1;
6197static int hf_bit14l1flagsl = -1;
6198static int hf_bit15l1flagsl = -1;
6199static int hf_bit16l1flagsl = -1;
6200static int hf_bit1l1flagsh = -1;
6201static int hf_bit2l1flagsh = -1;
6202static int hf_bit3l1flagsh = -1;
6203static int hf_bit4l1flagsh = -1;
6204static int hf_bit5l1flagsh = -1;
6205static int hf_bit6l1flagsh = -1;
6206static int hf_bit7l1flagsh = -1;
6207static int hf_bit8l1flagsh = -1;
6208static int hf_bit9l1flagsh = -1;
6209static int hf_bit10l1flagsh = -1;
6210static int hf_bit11l1flagsh = -1;
6211static int hf_bit12l1flagsh = -1;
6212static int hf_bit13l1flagsh = -1;
6213static int hf_bit14l1flagsh = -1;
6214static int hf_bit15l1flagsh = -1;
6215static int hf_bit16l1flagsh = -1;
6216static int hf_nds_tree_name = -1;
6217static int hf_nds_reply_error = -1;
6218static int hf_nds_net = -1;
6219static int hf_nds_node = -1;
6220static int hf_nds_socket = -1;
6221static int hf_add_ref_ip = -1;
6222static int hf_add_ref_udp = -1;
6223static int hf_add_ref_tcp = -1;
6224static int hf_referral_record = -1;
6225static int hf_referral_addcount = -1;
6226static int hf_nds_port = -1;
6227static int hf_mv_string = -1;
6228static int hf_nds_syntax = -1;
6229static int hf_value_string = -1;
6230static int hf_nds_buffer_size = -1;
6231static int hf_nds_ver = -1;
6232static int hf_nds_nflags = -1;
6233static int hf_nds_scope = -1;
6234static int hf_nds_name = -1;
6235static int hf_nds_comm_trans = -1;
6236static int hf_nds_tree_trans = -1;
6237static int hf_nds_iteration = -1;
6238static int hf_nds_eid = -1;
6239static int hf_nds_info_type = -1;
6240static int hf_nds_all_attr = -1;
6241static int hf_nds_req_flags = -1;
6242static int hf_nds_attr = -1;
6243static int hf_nds_crc = -1;
6244static int hf_nds_referrals = -1;
6245static int hf_nds_result_flags = -1;
6246static int hf_nds_tag_string = -1;
6247static int hf_value_bytes = -1;
6248static int hf_replica_type = -1;
6249static int hf_replica_state = -1;
6250static int hf_replica_number = -1;
6251static int hf_min_nds_ver = -1;
6252static int hf_nds_ver_include = -1;
6253static int hf_nds_ver_exclude = -1;
6254/* static int hf_nds_es = -1; */
6255static int hf_es_type = -1;
6256/* static int hf_delim_string = -1; */
6257static int hf_rdn_string = -1;
6258static int hf_nds_revent = -1;
6259static int hf_nds_rnum = -1;
6260static int hf_nds_name_type = -1;
6261static int hf_nds_rflags = -1;
6262static int hf_nds_eflags = -1;
6263static int hf_nds_depth = -1;
6264static int hf_nds_class_def_type = -1;
6265static int hf_nds_classes = -1;
6266static int hf_nds_return_all_classes = -1;
6267static int hf_nds_stream_flags = -1;
6268static int hf_nds_stream_name = -1;
6269static int hf_nds_file_handle = -1;
6270static int hf_nds_file_size = -1;
6271static int hf_nds_dn_output_type = -1;
6272static int hf_nds_nested_output_type = -1;
6273static int hf_nds_output_delimiter = -1;
6274static int hf_nds_output_entry_specifier = -1;
6275static int hf_es_value = -1;
6276static int hf_es_rdn_count = -1;
6277static int hf_nds_replica_num = -1;
6278static int hf_nds_event_num = -1;
6279static int hf_es_seconds = -1;
6280static int hf_nds_compare_results = -1;
6281static int hf_nds_parent = -1;
6282static int hf_nds_name_filter = -1;
6283static int hf_nds_class_filter = -1;
6284static int hf_nds_time_filter = -1;
6285static int hf_nds_partition_root_id = -1;
6286static int hf_nds_replicas = -1;
6287static int hf_nds_purge = -1;
6288static int hf_nds_local_partition = -1;
6289static int hf_partition_busy = -1;
6290static int hf_nds_number_of_changes = -1;
6291static int hf_sub_count = -1;
6292static int hf_nds_revision = -1;
6293static int hf_nds_base_class = -1;
6294static int hf_nds_relative_dn = -1;
6295/* static int hf_nds_root_dn = -1; */
6296/* static int hf_nds_parent_dn = -1; */
6297static int hf_deref_base = -1;
6298/* static int hf_nds_entry_info = -1; */
6299static int hf_nds_base = -1;
6300static int hf_nds_privileges = -1;
6301static int hf_nds_vflags = -1;
6302static int hf_nds_value_len = -1;
6303static int hf_nds_cflags = -1;
6304static int hf_nds_acflags = -1;
6305static int hf_nds_asn1 = -1;
6306static int hf_nds_upper = -1;
6307static int hf_nds_lower = -1;
6308static int hf_nds_trustee_dn = -1;
6309static int hf_nds_attribute_dn = -1;
6310static int hf_nds_acl_add = -1;
6311static int hf_nds_acl_del = -1;
6312static int hf_nds_att_add = -1;
6313static int hf_nds_att_del = -1;
6314static int hf_nds_keep = -1;
6315static int hf_nds_new_rdn = -1;
6316static int hf_nds_time_delay = -1;
6317static int hf_nds_root_name = -1;
6318static int hf_nds_new_part_id = -1;
6319static int hf_nds_child_part_id = -1;
6320static int hf_nds_master_part_id = -1;
6321static int hf_nds_target_name = -1;
6322static int hf_nds_super = -1;
6323static int hf_pingflags2 = -1;
6324static int hf_bit1pingflags2 = -1;
6325static int hf_bit2pingflags2 = -1;
6326static int hf_bit3pingflags2 = -1;
6327static int hf_bit4pingflags2 = -1;
6328static int hf_bit5pingflags2 = -1;
6329static int hf_bit6pingflags2 = -1;
6330static int hf_bit7pingflags2 = -1;
6331static int hf_bit8pingflags2 = -1;
6332static int hf_bit9pingflags2 = -1;
6333static int hf_bit10pingflags2 = -1;
6334static int hf_bit11pingflags2 = -1;
6335static int hf_bit12pingflags2 = -1;
6336static int hf_bit13pingflags2 = -1;
6337static int hf_bit14pingflags2 = -1;
6338static int hf_bit15pingflags2 = -1;
6339static int hf_bit16pingflags2 = -1;
6340static int hf_pingflags1 = -1;
6341static int hf_bit1pingflags1 = -1;
6342static int hf_bit2pingflags1 = -1;
6343static int hf_bit3pingflags1 = -1;
6344static int hf_bit4pingflags1 = -1;
6345static int hf_bit5pingflags1 = -1;
6346static int hf_bit6pingflags1 = -1;
6347static int hf_bit7pingflags1 = -1;
6348static int hf_bit8pingflags1 = -1;
6349static int hf_bit9pingflags1 = -1;
6350static int hf_bit10pingflags1 = -1;
6351static int hf_bit11pingflags1 = -1;
6352static int hf_bit12pingflags1 = -1;
6353static int hf_bit13pingflags1 = -1;
6354static int hf_bit14pingflags1 = -1;
6355static int hf_bit15pingflags1 = -1;
6356static int hf_bit16pingflags1 = -1;
6357static int hf_pingpflags1 = -1;
6358static int hf_bit1pingpflags1 = -1;
6359static int hf_bit2pingpflags1 = -1;
6360static int hf_bit3pingpflags1 = -1;
6361static int hf_bit4pingpflags1 = -1;
6362static int hf_bit5pingpflags1 = -1;
6363static int hf_bit6pingpflags1 = -1;
6364static int hf_bit7pingpflags1 = -1;
6365static int hf_bit8pingpflags1 = -1;
6366static int hf_bit9pingpflags1 = -1;
6367static int hf_bit10pingpflags1 = -1;
6368static int hf_bit11pingpflags1 = -1;
6369static int hf_bit12pingpflags1 = -1;
6370static int hf_bit13pingpflags1 = -1;
6371static int hf_bit14pingpflags1 = -1;
6372static int hf_bit15pingpflags1 = -1;
6373static int hf_bit16pingpflags1 = -1;
6374static int hf_pingvflags1 = -1;
6375static int hf_bit1pingvflags1 = -1;
6376static int hf_bit2pingvflags1 = -1;
6377static int hf_bit3pingvflags1 = -1;
6378static int hf_bit4pingvflags1 = -1;
6379static int hf_bit5pingvflags1 = -1;
6380static int hf_bit6pingvflags1 = -1;
6381static int hf_bit7pingvflags1 = -1;
6382static int hf_bit8pingvflags1 = -1;
6383static int hf_bit9pingvflags1 = -1;
6384static int hf_bit10pingvflags1 = -1;
6385static int hf_bit11pingvflags1 = -1;
6386static int hf_bit12pingvflags1 = -1;
6387static int hf_bit13pingvflags1 = -1;
6388static int hf_bit14pingvflags1 = -1;
6389static int hf_bit15pingvflags1 = -1;
6390static int hf_bit16pingvflags1 = -1;
6391static int hf_nds_letter_ver = -1;
6392static int hf_nds_os_majver = -1;
6393static int hf_nds_os_minver = -1;
6394static int hf_nds_lic_flags = -1;
6395static int hf_nds_ds_time = -1;
6396static int hf_nds_ping_version = -1;
6397static int hf_nds_search_scope = -1;
6398static int hf_nds_num_objects = -1;
6399static int hf_siflags = -1;
6400static int hf_bit1siflags = -1;
6401static int hf_bit2siflags = -1;
6402static int hf_bit3siflags = -1;
6403static int hf_bit4siflags = -1;
6404static int hf_bit5siflags = -1;
6405static int hf_bit6siflags = -1;
6406static int hf_bit7siflags = -1;
6407static int hf_bit8siflags = -1;
6408static int hf_bit9siflags = -1;
6409static int hf_bit10siflags = -1;
6410static int hf_bit11siflags = -1;
6411static int hf_bit12siflags = -1;
6412static int hf_bit13siflags = -1;
6413static int hf_bit14siflags = -1;
6414static int hf_bit15siflags = -1;
6415static int hf_bit16siflags = -1;
6416static int hf_nds_segments = -1;
6417static int hf_nds_segment = -1;
6418static int hf_nds_segment_overlap = -1;
6419static int hf_nds_segment_overlap_conflict = -1;
6420static int hf_nds_segment_multiple_tails = -1;
6421static int hf_nds_segment_too_long_segment = -1;
6422static int hf_nds_segment_error = -1;
6423static int hf_nds_segment_count = -1;
6424static int hf_nds_reassembled_length = -1;
6425static int hf_nds_verb2b_req_flags = -1;
6426static int hf_ncp_ip_address = -1;
6427static int hf_ncp_copyright = -1;
6428static int hf_ndsprot1flag = -1;
6429static int hf_ndsprot2flag = -1;
6430static int hf_ndsprot3flag = -1;
6431static int hf_ndsprot4flag = -1;
6432static int hf_ndsprot5flag = -1;
6433static int hf_ndsprot6flag = -1;
6434static int hf_ndsprot7flag = -1;
6435static int hf_ndsprot8flag = -1;
6436static int hf_ndsprot9flag = -1;
6437static int hf_ndsprot10flag = -1;
6438static int hf_ndsprot11flag = -1;
6439static int hf_ndsprot12flag = -1;
6440static int hf_ndsprot13flag = -1;
6441static int hf_ndsprot14flag = -1;
6442static int hf_ndsprot15flag = -1;
6443static int hf_ndsprot16flag = -1;
6444static int hf_nds_svr_dst_name = -1;
6445static int hf_nds_tune_mark = -1;
6446/* static int hf_nds_create_time = -1; */
6447static int hf_srvr_param_number = -1;
6448static int hf_srvr_param_boolean = -1;
6449static int hf_srvr_param_string = -1;
6450static int hf_nds_svr_time = -1;
6451static int hf_nds_crt_time = -1;
6452static int hf_nds_number_of_items = -1;
6453static int hf_nds_compare_attributes = -1;
6454static int hf_nds_read_attribute = -1;
6455static int hf_nds_write_add_delete_attribute = -1;
6456static int hf_nds_add_delete_self = -1;
6457static int hf_nds_privilege_not_defined = -1;
6458static int hf_nds_supervisor = -1;
6459static int hf_nds_inheritance_control = -1;
6460static int hf_nds_browse_entry = -1;
6461static int hf_nds_add_entry = -1;
6462static int hf_nds_delete_entry = -1;
6463static int hf_nds_rename_entry = -1;
6464static int hf_nds_supervisor_entry = -1;
6465static int hf_nds_entry_privilege_not_defined = -1;
6466static int hf_nds_iterator = -1;
6467static int hf_ncp_nds_iterverb = -1;
6468static int hf_iter_completion_code = -1;
6469/* static int hf_nds_iterobj = -1; */
6470static int hf_iter_verb_completion_code = -1;
6471static int hf_iter_ans = -1;
6472static int hf_positionable = -1;
6473static int hf_num_skipped = -1;
6474static int hf_num_to_skip = -1;
6475static int hf_timelimit = -1;
6476static int hf_iter_index = -1;
6477static int hf_num_to_get = -1;
6478/* static int hf_ret_info_type = -1; */
6479static int hf_data_size = -1;
6480static int hf_this_count = -1;
6481static int hf_max_entries = -1;
6482static int hf_move_position = -1;
6483static int hf_iter_copy = -1;
6484static int hf_iter_position = -1;
6485static int hf_iter_search = -1;
6486static int hf_iter_other = -1;
6487static int hf_nds_oid = -1;
6488static int hf_ncp_bytes_actually_trans_64 = -1;
6489static int hf_sap_name = -1;
6490static int hf_os_name = -1;
6491static int hf_vendor_name = -1;
6492static int hf_hardware_name = -1;
6493static int hf_no_request_record_found = -1;
6494static int hf_search_modifier = -1;
6495static int hf_search_pattern = -1;
6496static int hf_nds_acl_protected_attribute = -1;
6497static int hf_nds_acl_subject = -1;
6498static int hf_nds_acl_privileges = -1;
6499
6500static expert_field ei_ncp_file_rights_change = EI_INIT;
6501static expert_field ei_ncp_completion_code = EI_INIT;
6502static expert_field ei_nds_reply_error = EI_INIT;
6503static expert_field ei_ncp_destroy_connection = EI_INIT;
6504static expert_field ei_nds_iteration = EI_INIT;
6505static expert_field ei_ncp_eid = EI_INIT;
6506static expert_field ei_ncp_file_handle = EI_INIT;
6507static expert_field ei_ncp_connection_destroyed = EI_INIT;
6508static expert_field ei_ncp_no_request_record_found = EI_INIT;
6509static expert_field ei_ncp_file_rights = EI_INIT;
6510static expert_field ei_iter_verb_completion_code = EI_INIT;
6511static expert_field ei_ncp_connection_request = EI_INIT;
6512static expert_field ei_ncp_connection_status = EI_INIT;
6513static expert_field ei_ncp_op_lock_handle = EI_INIT;
6514static expert_field ei_ncp_effective_rights = EI_INIT;
6515static expert_field ei_ncp_server = EI_INIT;
6516static expert_field ei_ncp_invalid_offset = EI_INIT;
6517static expert_field ei_ncp_address_type = EI_INIT;
6518""")
6519
6520    # Look at all packet types in the packets collection, and cull information
6521    # from them.
6522    errors_used_list = []
6523    errors_used_hash = {}
6524    groups_used_list = []
6525    groups_used_hash = {}
6526    variables_used_hash = {}
6527    structs_used_hash = {}
6528
6529    for pkt in packets:
6530        # Determine which error codes are used.
6531        codes = pkt.CompletionCodes()
6532        for code in codes.Records():
6533            if code not in errors_used_hash:
6534                errors_used_hash[code] = len(errors_used_list)
6535                errors_used_list.append(code)
6536
6537        # Determine which groups are used.
6538        group = pkt.Group()
6539        if group not in groups_used_hash:
6540            groups_used_hash[group] = len(groups_used_list)
6541            groups_used_list.append(group)
6542
6543
6544
6545
6546        # Determine which variables are used.
6547        vars = pkt.Variables()
6548        ExamineVars(vars, structs_used_hash, variables_used_hash)
6549
6550
6551    # Print the hf variable declarations
6552    sorted_vars = list(variables_used_hash.values())
6553    sorted_vars.sort()
6554    for var in sorted_vars:
6555        print("static int " + var.HFName() + " = -1;")
6556
6557
6558    # Print the value_string's
6559    for var in sorted_vars:
6560        if isinstance(var, val_string):
6561            print("")
6562            print(var.Code())
6563
6564    # Determine which error codes are not used
6565    errors_not_used = {}
6566    # Copy the keys from the error list...
6567    for code in list(errors.keys()):
6568        errors_not_used[code] = 1
6569    # ... and remove the ones that *were* used.
6570    for code in errors_used_list:
6571        del errors_not_used[code]
6572
6573    # Print a remark showing errors not used
6574    list_errors_not_used = list(errors_not_used.keys())
6575    list_errors_not_used.sort()
6576    for code in list_errors_not_used:
6577        print("/* Error 0x%04x not used: %s */" % (code, errors[code]))
6578    print("\n")
6579
6580    # Print the errors table
6581    print("/* Error strings. */")
6582    print("static const char *ncp_errors[] = {")
6583    for code in errors_used_list:
6584        print('    /* %02d (0x%04x) */ "%s",' % (errors_used_hash[code], code, errors[code]))
6585    print("};\n")
6586
6587
6588
6589
6590    # Determine which groups are not used
6591    groups_not_used = {}
6592    # Copy the keys from the group list...
6593    for group in list(groups.keys()):
6594        groups_not_used[group] = 1
6595    # ... and remove the ones that *were* used.
6596    for group in groups_used_list:
6597        del groups_not_used[group]
6598
6599    # Print a remark showing groups not used
6600    list_groups_not_used = list(groups_not_used.keys())
6601    list_groups_not_used.sort()
6602    for group in list_groups_not_used:
6603        print("/* Group not used: %s = %s */" % (group, groups[group]))
6604    print("\n")
6605
6606    # Print the groups table
6607    print("/* Group strings. */")
6608    print("static const char *ncp_groups[] = {")
6609    for group in groups_used_list:
6610        print('    /* %02d (%s) */ "%s",' % (groups_used_hash[group], group, groups[group]))
6611    print("};\n")
6612
6613    # Print the group macros
6614    for group in groups_used_list:
6615        name = str.upper(group)
6616        print("#define NCP_GROUP_%s    %d" % (name, groups_used_hash[group]))
6617    print("\n")
6618
6619
6620    # Print the conditional_records for all Request Conditions.
6621    num = 0
6622    print("/* Request-Condition dfilter records. The NULL pointer")
6623    print("   is replaced by a pointer to the created dfilter_t. */")
6624    if len(global_req_cond) == 0:
6625        print("static conditional_record req_conds = NULL;")
6626    else:
6627        print("static conditional_record req_conds[] = {")
6628        req_cond_l = list(global_req_cond.keys())
6629        req_cond_l.sort()
6630        for req_cond in req_cond_l:
6631            print("    { \"%s\", NULL }," % (req_cond,))
6632            global_req_cond[req_cond] = num
6633            num = num + 1
6634        print("};")
6635    print("#define NUM_REQ_CONDS %d" % (num,))
6636    print("#define NO_REQ_COND   NUM_REQ_CONDS\n\n")
6637
6638
6639
6640    # Print PTVC's for bitfields
6641    ett_list = []
6642    print("/* PTVC records for bit-fields. */")
6643    for var in sorted_vars:
6644        if isinstance(var, bitfield):
6645            sub_vars_ptvc = var.SubVariablesPTVC()
6646            print("/* %s */" % (sub_vars_ptvc.Name()))
6647            print(sub_vars_ptvc.Code())
6648            ett_list.append(sub_vars_ptvc.ETTName())
6649
6650
6651    # Print the PTVC's for structures
6652    print("/* PTVC records for structs. */")
6653    # Sort them
6654    svhash = {}
6655    for svar in list(structs_used_hash.values()):
6656        svhash[svar.HFName()] = svar
6657        if svar.descr:
6658            ett_list.append(svar.ETTName())
6659
6660    struct_vars = list(svhash.keys())
6661    struct_vars.sort()
6662    for varname in struct_vars:
6663        var = svhash[varname]
6664        print(var.Code())
6665
6666    ett_list.sort()
6667
6668    # Print info string structures
6669    print("/* Info Strings */")
6670    for pkt in packets:
6671        if pkt.req_info_str:
6672            name = pkt.InfoStrName() + "_req"
6673            var = pkt.req_info_str[0]
6674            print("static const info_string_t %s = {" % (name,))
6675            print("    &%s," % (var.HFName(),))
6676            print('    "%s",' % (pkt.req_info_str[1],))
6677            print('    "%s"' % (pkt.req_info_str[2],))
6678            print("};\n")
6679
6680    # Print regular PTVC's
6681    print("/* PTVC records. These are re-used to save space. */")
6682    for ptvc in ptvc_lists.Members():
6683        if not ptvc.Null() and not ptvc.Empty():
6684            print(ptvc.Code())
6685
6686    # Print error_equivalency tables
6687    print("/* Error-Equivalency Tables. These are re-used to save space. */")
6688    for compcodes in compcode_lists.Members():
6689        errors = compcodes.Records()
6690        # Make sure the record for error = 0x00 comes last.
6691        print("static const error_equivalency %s[] = {" % (compcodes.Name()))
6692        for error in errors:
6693            error_in_packet = error >> 8;
6694            ncp_error_index = errors_used_hash[error]
6695            print("    { 0x%02x, %d }, /* 0x%04x */" % (error_in_packet,
6696                    ncp_error_index, error))
6697        print("    { 0x00, -1 }\n};\n")
6698
6699
6700
6701    # Print integer arrays for all ncp_records that need
6702    # a list of req_cond_indexes. Do it "uniquely" to save space;
6703    # if multiple packets share the same set of req_cond's,
6704    # then they'll share the same integer array
6705    print("/* Request Condition Indexes */")
6706    # First, make them unique
6707    req_cond_collection = UniqueCollection("req_cond_collection")
6708    for pkt in packets:
6709        req_conds = pkt.CalculateReqConds()
6710        if req_conds:
6711            unique_list = req_cond_collection.Add(req_conds)
6712            pkt.SetReqConds(unique_list)
6713        else:
6714            pkt.SetReqConds(None)
6715
6716    # Print them
6717    for req_cond in req_cond_collection.Members():
6718        sys.stdout.write("static const int %s[] = {" % (req_cond.Name()))
6719        sys.stdout.write(" ")
6720        vals = []
6721        for text in req_cond.Records():
6722            vals.append(global_req_cond[text])
6723        vals.sort()
6724        for val in vals:
6725            sys.stdout.write("%s, " % (val,))
6726
6727        print("-1 };")
6728        print("")
6729
6730
6731
6732    # Functions without length parameter
6733    funcs_without_length = {}
6734
6735    print("/* Forward declaration of expert info functions defined in ncp2222.inc */")
6736    for expert in expert_hash:
6737        print("static void %s_expert_func(ptvcursor_t *ptvc, packet_info *pinfo, const ncp_record *ncp_rec, gboolean request);" % expert)
6738
6739    # Print ncp_record packet records
6740    print("#define SUBFUNC_WITH_LENGTH      0x02")
6741    print("#define SUBFUNC_NO_LENGTH        0x01")
6742    print("#define NO_SUBFUNC               0x00")
6743
6744    print("/* ncp_record structs for packets */")
6745    print("static const ncp_record ncp_packets[] = {")
6746    for pkt in packets:
6747        if pkt.HasSubFunction():
6748            func = pkt.FunctionCode('high')
6749            if pkt.HasLength():
6750                subfunc_string = "SUBFUNC_WITH_LENGTH"
6751                # Ensure that the function either has a length param or not
6752                if func in funcs_without_length:
6753                    sys.exit("Function 0x%04x sometimes has length param, sometimes not." \
6754                            % (pkt.FunctionCode(),))
6755            else:
6756                subfunc_string = "SUBFUNC_NO_LENGTH"
6757                funcs_without_length[func] = 1
6758        else:
6759            subfunc_string = "NO_SUBFUNC"
6760        sys.stdout.write('    { 0x%02x, 0x%02x, %s, "%s",' % (pkt.FunctionCode('high'),
6761                pkt.FunctionCode('low'), subfunc_string, pkt.Description()))
6762
6763        print(' %d /* %s */,' % (groups_used_hash[pkt.Group()], pkt.Group()))
6764
6765        ptvc = pkt.PTVCRequest()
6766        if not ptvc.Null() and not ptvc.Empty():
6767            ptvc_request = ptvc.Name()
6768        else:
6769            ptvc_request = 'NULL'
6770
6771        ptvc = pkt.PTVCReply()
6772        if not ptvc.Null() and not ptvc.Empty():
6773            ptvc_reply = ptvc.Name()
6774        else:
6775            ptvc_reply = 'NULL'
6776
6777        errors = pkt.CompletionCodes()
6778
6779        req_conds_obj = pkt.GetReqConds()
6780        if req_conds_obj:
6781            req_conds = req_conds_obj.Name()
6782        else:
6783            req_conds = "NULL"
6784
6785        if not req_conds_obj:
6786            req_cond_size = "NO_REQ_COND_SIZE"
6787        else:
6788            req_cond_size = pkt.ReqCondSize()
6789            if req_cond_size is None:
6790                msg.write("NCP packet %s needs a ReqCondSize*() call\n" \
6791                        % (pkt.CName(),))
6792                sys.exit(1)
6793
6794        if pkt.expert_func:
6795            expert_func = "&" + pkt.expert_func + "_expert_func"
6796        else:
6797            expert_func = "NULL"
6798
6799        print('        %s, %s, %s, %s, %s, %s },\n' % \
6800                (ptvc_request, ptvc_reply, errors.Name(), req_conds,
6801                req_cond_size, expert_func))
6802
6803    print('    { 0, 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NO_REQ_COND_SIZE, NULL }')
6804    print("};\n")
6805
6806    print("/* ncp funcs that require a subfunc */")
6807    print("static const guint8 ncp_func_requires_subfunc[] = {")
6808    hi_seen = {}
6809    for pkt in packets:
6810        if pkt.HasSubFunction():
6811            hi_func = pkt.FunctionCode('high')
6812            if hi_func not in hi_seen:
6813                print("    0x%02x," % (hi_func))
6814                hi_seen[hi_func] = 1
6815    print("    0")
6816    print("};\n")
6817
6818
6819    print("/* ncp funcs that have no length parameter */")
6820    print("static const guint8 ncp_func_has_no_length_parameter[] = {")
6821    funcs = list(funcs_without_length.keys())
6822    funcs.sort()
6823    for func in funcs:
6824        print("    0x%02x," % (func,))
6825    print("    0")
6826    print("};\n")
6827
6828    print("")
6829
6830    # proto_register_ncp2222()
6831    print("""
6832static const value_string connection_status_vals[] = {
6833    { 0x00, "Ok" },
6834    { 0x01, "Bad Service Connection" },
6835    { 0x10, "File Server is Down" },
6836    { 0x40, "Broadcast Message Pending" },
6837    { 0,    NULL }
6838};
6839
6840#include "packet-ncp2222.inc"
6841
6842void
6843proto_register_ncp2222(void)
6844{
6845
6846    static hf_register_info hf[] = {
6847    { &hf_ncp_number_of_data_streams_long,
6848    { "Number of Data Streams", "ncp.number_of_data_streams_long", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
6849
6850    { &hf_ncp_func,
6851    { "Function", "ncp.func", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
6852
6853    { &hf_ncp_length,
6854    { "Packet Length", "ncp.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
6855
6856    { &hf_ncp_subfunc,
6857    { "SubFunction", "ncp.subfunc", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL }},
6858
6859    { &hf_ncp_completion_code,
6860    { "Completion Code", "ncp.completion_code", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
6861
6862    { &hf_ncp_group,
6863    { "NCP Group Type", "ncp.group", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
6864
6865    { &hf_ncp_fragment_handle,
6866    { "NDS Fragment Handle", "ncp.ndsfrag", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
6867
6868    { &hf_ncp_fragment_size,
6869    { "NDS Fragment Size", "ncp.ndsfragsize", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
6870
6871    { &hf_ncp_message_size,
6872    { "Message Size", "ncp.ndsmessagesize", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
6873
6874    { &hf_ncp_nds_flag,
6875    { "NDS Protocol Flags", "ncp.ndsflag", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
6876
6877    { &hf_ncp_nds_verb,
6878    { "NDS Verb", "ncp.ndsverb", FT_UINT8, BASE_HEX, VALS(ncp_nds_verb_vals), 0x0, NULL, HFILL }},
6879
6880    { &hf_ping_version,
6881    { "NDS Version", "ncp.ping_version", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
6882
6883#if 0 /* Unused ? */
6884    { &hf_nds_version,
6885    { "NDS Version", "ncp.nds_version", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
6886#endif
6887
6888    { &hf_nds_tree_name,
6889    { "NDS Tree Name", "ncp.nds_tree_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
6890
6891    /*
6892     * XXX - the page at
6893     *
6894     *      https://web.archive.org/web/20030629082113/http://www.odyssea.com/whats_new/tcpipnet/tcpipnet.html
6895     *
6896     * says of the connection status "The Connection Code field may
6897     * contain values that indicate the status of the client host to
6898     * server connection.  A value of 1 in the fourth bit of this data
6899     * byte indicates that the server is unavailable (server was
6900     * downed).
6901     *
6902     * The page at
6903     *
6904     *      https://web.archive.org/web/20090809191415/http://www.unm.edu/~network/presentations/course/appendix/appendix_f/tsld088.htm
6905     *
6906     * says that bit 0 is "bad service", bit 2 is "no connection
6907     * available", bit 4 is "service down", and bit 6 is "server
6908     * has a broadcast message waiting for the client".
6909     *
6910     * Should it be displayed in hex, and should those bits (and any
6911     * other bits with significance) be displayed as bitfields
6912     * underneath it?
6913     */
6914    { &hf_ncp_connection_status,
6915    { "Connection Status", "ncp.connection_status", FT_UINT8, BASE_DEC, VALS(connection_status_vals), 0x0, NULL, HFILL }},
6916
6917    { &hf_ncp_req_frame_num,
6918    { "Response to Request in Frame Number", "ncp.req_frame_num", FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL }},
6919
6920    { &hf_ncp_req_frame_time,
6921    { "Time from Request", "ncp.time", FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0, "Time between request and response in seconds", HFILL }},
6922
6923#if 0 /* Unused ? */
6924    { &hf_nds_flags,
6925    { "NDS Return Flags", "ncp.nds_flags", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
6926#endif
6927
6928    { &hf_nds_reply_depth,
6929    { "Distance from Root", "ncp.ndsdepth", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
6930
6931    { &hf_nds_reply_rev,
6932    { "NDS Revision", "ncp.ndsrev", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
6933
6934    { &hf_nds_reply_flags,
6935    { "Flags", "ncp.ndsflags", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
6936
6937    { &hf_nds_p1type,
6938    { "NDS Parameter Type", "ncp.p1type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
6939
6940    { &hf_nds_uint32value,
6941    { "NDS Value", "ncp.uint32value", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
6942
6943    { &hf_nds_bit1,
6944    { "Typeless", "ncp.nds_bit1", FT_BOOLEAN, 16, NULL, 0x00000001, NULL, HFILL }},
6945
6946    { &hf_nds_bit2,
6947    { "All Containers", "ncp.nds_bit2", FT_BOOLEAN, 16, NULL, 0x00000002, NULL, HFILL }},
6948
6949    { &hf_nds_bit3,
6950    { "Slashed", "ncp.nds_bit3", FT_BOOLEAN, 16, NULL, 0x00000004, NULL, HFILL }},
6951
6952    { &hf_nds_bit4,
6953    { "Dotted", "ncp.nds_bit4", FT_BOOLEAN, 16, NULL, 0x00000008, NULL, HFILL }},
6954
6955    { &hf_nds_bit5,
6956    { "Tuned", "ncp.nds_bit5", FT_BOOLEAN, 16, NULL, 0x00000010, NULL, HFILL }},
6957
6958    { &hf_nds_bit6,
6959    { "Not Defined", "ncp.nds_bit6", FT_BOOLEAN, 16, NULL, 0x00000020, NULL, HFILL }},
6960
6961    { &hf_nds_bit7,
6962    { "Not Defined", "ncp.nds_bit7", FT_BOOLEAN, 16, NULL, 0x00000040, NULL, HFILL }},
6963
6964    { &hf_nds_bit8,
6965    { "Not Defined", "ncp.nds_bit8", FT_BOOLEAN, 16, NULL, 0x00000080, NULL, HFILL }},
6966
6967    { &hf_nds_bit9,
6968    { "Not Defined", "ncp.nds_bit9", FT_BOOLEAN, 16, NULL, 0x00000100, NULL, HFILL }},
6969
6970    { &hf_nds_bit10,
6971    { "Not Defined", "ncp.nds_bit10", FT_BOOLEAN, 16, NULL, 0x00000200, NULL, HFILL }},
6972
6973    { &hf_nds_bit11,
6974    { "Not Defined", "ncp.nds_bit11", FT_BOOLEAN, 16, NULL, 0x00000400, NULL, HFILL }},
6975
6976    { &hf_nds_bit12,
6977    { "Not Defined", "ncp.nds_bit12", FT_BOOLEAN, 16, NULL, 0x00000800, NULL, HFILL }},
6978
6979    { &hf_nds_bit13,
6980    { "Not Defined", "ncp.nds_bit13", FT_BOOLEAN, 16, NULL, 0x00001000, NULL, HFILL }},
6981
6982    { &hf_nds_bit14,
6983    { "Not Defined", "ncp.nds_bit14", FT_BOOLEAN, 16, NULL, 0x00002000, NULL, HFILL }},
6984
6985    { &hf_nds_bit15,
6986    { "Not Defined", "ncp.nds_bit15", FT_BOOLEAN, 16, NULL, 0x00004000, NULL, HFILL }},
6987
6988    { &hf_nds_bit16,
6989    { "Not Defined", "ncp.nds_bit16", FT_BOOLEAN, 16, NULL, 0x00008000, NULL, HFILL }},
6990
6991    { &hf_outflags,
6992    { "Output Flags", "ncp.outflags", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
6993
6994    { &hf_bit1outflags,
6995    { "Output Flags", "ncp.bit1outflags", FT_BOOLEAN, 16, NULL, 0x00000001, NULL, HFILL }},
6996
6997    { &hf_bit2outflags,
6998    { "Entry ID", "ncp.bit2outflags", FT_BOOLEAN, 16, NULL, 0x00000002, NULL, HFILL }},
6999
7000    { &hf_bit3outflags,
7001    { "Replica State", "ncp.bit3outflags", FT_BOOLEAN, 16, NULL, 0x00000004, NULL, HFILL }},
7002
7003    { &hf_bit4outflags,
7004    { "Modification Timestamp", "ncp.bit4outflags", FT_BOOLEAN, 16, NULL, 0x00000008, NULL, HFILL }},
7005
7006    { &hf_bit5outflags,
7007    { "Purge Time", "ncp.bit5outflags", FT_BOOLEAN, 16, NULL, 0x00000010, NULL, HFILL }},
7008
7009    { &hf_bit6outflags,
7010    { "Local Partition ID", "ncp.bit6outflags", FT_BOOLEAN, 16, NULL, 0x00000020, NULL, HFILL }},
7011
7012    { &hf_bit7outflags,
7013    { "Distinguished Name", "ncp.bit7outflags", FT_BOOLEAN, 16, NULL, 0x00000040, NULL, HFILL }},
7014
7015    { &hf_bit8outflags,
7016    { "Replica Type", "ncp.bit8outflags", FT_BOOLEAN, 16, NULL, 0x00000080, NULL, HFILL }},
7017
7018    { &hf_bit9outflags,
7019    { "Partition Busy", "ncp.bit9outflags", FT_BOOLEAN, 16, NULL, 0x00000100, NULL, HFILL }},
7020
7021    { &hf_bit10outflags,
7022    { "Not Defined", "ncp.bit10outflags", FT_BOOLEAN, 16, NULL, 0x00000200, NULL, HFILL }},
7023
7024    { &hf_bit11outflags,
7025    { "Not Defined", "ncp.bit11outflags", FT_BOOLEAN, 16, NULL, 0x00000400, NULL, HFILL }},
7026
7027    { &hf_bit12outflags,
7028    { "Not Defined", "ncp.bit12outflags", FT_BOOLEAN, 16, NULL, 0x00000800, NULL, HFILL }},
7029
7030    { &hf_bit13outflags,
7031    { "Not Defined", "ncp.bit13outflags", FT_BOOLEAN, 16, NULL, 0x00001000, NULL, HFILL }},
7032
7033    { &hf_bit14outflags,
7034    { "Not Defined", "ncp.bit14outflags", FT_BOOLEAN, 16, NULL, 0x00002000, NULL, HFILL }},
7035
7036    { &hf_bit15outflags,
7037    { "Not Defined", "ncp.bit15outflags", FT_BOOLEAN, 16, NULL, 0x00004000, NULL, HFILL }},
7038
7039    { &hf_bit16outflags,
7040    { "Not Defined", "ncp.bit16outflags", FT_BOOLEAN, 16, NULL, 0x00008000, NULL, HFILL }},
7041
7042    { &hf_bit1nflags,
7043    { "Entry ID", "ncp.bit1nflags", FT_BOOLEAN, 16, NULL, 0x00000001, NULL, HFILL }},
7044
7045    { &hf_bit2nflags,
7046    { "Readable", "ncp.bit2nflags", FT_BOOLEAN, 16, NULL, 0x00000002, NULL, HFILL }},
7047
7048    { &hf_bit3nflags,
7049    { "Writeable", "ncp.bit3nflags", FT_BOOLEAN, 16, NULL, 0x00000004, NULL, HFILL }},
7050
7051    { &hf_bit4nflags,
7052    { "Master", "ncp.bit4nflags", FT_BOOLEAN, 16, NULL, 0x00000008, NULL, HFILL }},
7053
7054    { &hf_bit5nflags,
7055    { "Create ID", "ncp.bit5nflags", FT_BOOLEAN, 16, NULL, 0x00000010, NULL, HFILL }},
7056
7057    { &hf_bit6nflags,
7058    { "Walk Tree", "ncp.bit6nflags", FT_BOOLEAN, 16, NULL, 0x00000020, NULL, HFILL }},
7059
7060    { &hf_bit7nflags,
7061    { "Dereference Alias", "ncp.bit7nflags", FT_BOOLEAN, 16, NULL, 0x00000040, NULL, HFILL }},
7062
7063    { &hf_bit8nflags,
7064    { "Not Defined", "ncp.bit8nflags", FT_BOOLEAN, 16, NULL, 0x00000080, NULL, HFILL }},
7065
7066    { &hf_bit9nflags,
7067    { "Not Defined", "ncp.bit9nflags", FT_BOOLEAN, 16, NULL, 0x00000100, NULL, HFILL }},
7068
7069    { &hf_bit10nflags,
7070    { "Not Defined", "ncp.bit10nflags", FT_BOOLEAN, 16, NULL, 0x00000200, NULL, HFILL }},
7071
7072    { &hf_bit11nflags,
7073    { "Not Defined", "ncp.bit11nflags", FT_BOOLEAN, 16, NULL, 0x00000400, NULL, HFILL }},
7074
7075    { &hf_bit12nflags,
7076    { "Not Defined", "ncp.bit12nflags", FT_BOOLEAN, 16, NULL, 0x00000800, NULL, HFILL }},
7077
7078    { &hf_bit13nflags,
7079    { "Not Defined", "ncp.bit13nflags", FT_BOOLEAN, 16, NULL, 0x00001000, NULL, HFILL }},
7080
7081    { &hf_bit14nflags,
7082    { "Prefer Referrals", "ncp.bit14nflags", FT_BOOLEAN, 16, NULL, 0x00002000, NULL, HFILL }},
7083
7084    { &hf_bit15nflags,
7085    { "Prefer Only Referrals", "ncp.bit15nflags", FT_BOOLEAN, 16, NULL, 0x00004000, NULL, HFILL }},
7086
7087    { &hf_bit16nflags,
7088    { "Not Defined", "ncp.bit16nflags", FT_BOOLEAN, 16, NULL, 0x00008000, NULL, HFILL }},
7089
7090    { &hf_bit1rflags,
7091    { "Typeless", "ncp.bit1rflags", FT_BOOLEAN, 16, NULL, 0x00000001, NULL, HFILL }},
7092
7093    { &hf_bit2rflags,
7094    { "Slashed", "ncp.bit2rflags", FT_BOOLEAN, 16, NULL, 0x00000002, NULL, HFILL }},
7095
7096    { &hf_bit3rflags,
7097    { "Dotted", "ncp.bit3rflags", FT_BOOLEAN, 16, NULL, 0x00000004, NULL, HFILL }},
7098
7099    { &hf_bit4rflags,
7100    { "Tuned", "ncp.bit4rflags", FT_BOOLEAN, 16, NULL, 0x00000008, NULL, HFILL }},
7101
7102    { &hf_bit5rflags,
7103    { "Not Defined", "ncp.bit5rflags", FT_BOOLEAN, 16, NULL, 0x00000010, NULL, HFILL }},
7104
7105    { &hf_bit6rflags,
7106    { "Not Defined", "ncp.bit6rflags", FT_BOOLEAN, 16, NULL, 0x00000020, NULL, HFILL }},
7107
7108    { &hf_bit7rflags,
7109    { "Not Defined", "ncp.bit7rflags", FT_BOOLEAN, 16, NULL, 0x00000040, NULL, HFILL }},
7110
7111    { &hf_bit8rflags,
7112    { "Not Defined", "ncp.bit8rflags", FT_BOOLEAN, 16, NULL, 0x00000080, NULL, HFILL }},
7113
7114    { &hf_bit9rflags,
7115    { "Not Defined", "ncp.bit9rflags", FT_BOOLEAN, 16, NULL, 0x00000100, NULL, HFILL }},
7116
7117    { &hf_bit10rflags,
7118    { "Not Defined", "ncp.bit10rflags", FT_BOOLEAN, 16, NULL, 0x00000200, NULL, HFILL }},
7119
7120    { &hf_bit11rflags,
7121    { "Not Defined", "ncp.bit11rflags", FT_BOOLEAN, 16, NULL, 0x00000400, NULL, HFILL }},
7122
7123    { &hf_bit12rflags,
7124    { "Not Defined", "ncp.bit12rflags", FT_BOOLEAN, 16, NULL, 0x00000800, NULL, HFILL }},
7125
7126    { &hf_bit13rflags,
7127    { "Not Defined", "ncp.bit13rflags", FT_BOOLEAN, 16, NULL, 0x00001000, NULL, HFILL }},
7128
7129    { &hf_bit14rflags,
7130    { "Not Defined", "ncp.bit14rflags", FT_BOOLEAN, 16, NULL, 0x00002000, NULL, HFILL }},
7131
7132    { &hf_bit15rflags,
7133    { "Not Defined", "ncp.bit15rflags", FT_BOOLEAN, 16, NULL, 0x00004000, NULL, HFILL }},
7134
7135    { &hf_bit16rflags,
7136    { "Not Defined", "ncp.bit16rflags", FT_BOOLEAN, 16, NULL, 0x00008000, NULL, HFILL }},
7137
7138    { &hf_eflags,
7139    { "Entry Flags", "ncp.eflags", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7140
7141    { &hf_bit1eflags,
7142    { "Alias Entry", "ncp.bit1eflags", FT_BOOLEAN, 16, NULL, 0x00000001, NULL, HFILL }},
7143
7144    { &hf_bit2eflags,
7145    { "Partition Root", "ncp.bit2eflags", FT_BOOLEAN, 16, NULL, 0x00000002, NULL, HFILL }},
7146
7147    { &hf_bit3eflags,
7148    { "Container Entry", "ncp.bit3eflags", FT_BOOLEAN, 16, NULL, 0x00000004, NULL, HFILL }},
7149
7150    { &hf_bit4eflags,
7151    { "Container Alias", "ncp.bit4eflags", FT_BOOLEAN, 16, NULL, 0x00000008, NULL, HFILL }},
7152
7153    { &hf_bit5eflags,
7154    { "Matches List Filter", "ncp.bit5eflags", FT_BOOLEAN, 16, NULL, 0x00000010, NULL, HFILL }},
7155
7156    { &hf_bit6eflags,
7157    { "Reference Entry", "ncp.bit6eflags", FT_BOOLEAN, 16, NULL, 0x00000020, NULL, HFILL }},
7158
7159    { &hf_bit7eflags,
7160    { "40x Reference Entry", "ncp.bit7eflags", FT_BOOLEAN, 16, NULL, 0x00000040, NULL, HFILL }},
7161
7162    { &hf_bit8eflags,
7163    { "Back Linked", "ncp.bit8eflags", FT_BOOLEAN, 16, NULL, 0x00000080, NULL, HFILL }},
7164
7165    { &hf_bit9eflags,
7166    { "New Entry", "ncp.bit9eflags", FT_BOOLEAN, 16, NULL, 0x00000100, NULL, HFILL }},
7167
7168    { &hf_bit10eflags,
7169    { "Temporary Reference", "ncp.bit10eflags", FT_BOOLEAN, 16, NULL, 0x00000200, NULL, HFILL }},
7170
7171    { &hf_bit11eflags,
7172    { "Audited", "ncp.bit11eflags", FT_BOOLEAN, 16, NULL, 0x00000400, NULL, HFILL }},
7173
7174    { &hf_bit12eflags,
7175    { "Entry Not Present", "ncp.bit12eflags", FT_BOOLEAN, 16, NULL, 0x00000800, NULL, HFILL }},
7176
7177    { &hf_bit13eflags,
7178    { "Entry Verify CTS", "ncp.bit13eflags", FT_BOOLEAN, 16, NULL, 0x00001000, NULL, HFILL }},
7179
7180    { &hf_bit14eflags,
7181    { "Entry Damaged", "ncp.bit14eflags", FT_BOOLEAN, 16, NULL, 0x00002000, NULL, HFILL }},
7182
7183    { &hf_bit15eflags,
7184    { "Not Defined", "ncp.bit15rflags", FT_BOOLEAN, 16, NULL, 0x00004000, NULL, HFILL }},
7185
7186    { &hf_bit16eflags,
7187    { "Not Defined", "ncp.bit16rflags", FT_BOOLEAN, 16, NULL, 0x00008000, NULL, HFILL }},
7188
7189    { &hf_infoflagsl,
7190    { "Information Flags (low) Byte", "ncp.infoflagsl", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7191
7192    { &hf_retinfoflagsl,
7193    { "Return Information Flags (low) Byte", "ncp.retinfoflagsl", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7194
7195    { &hf_bit1infoflagsl,
7196    { "Output Flags", "ncp.bit1infoflagsl", FT_BOOLEAN, 16, NULL, 0x00000001, NULL, HFILL }},
7197
7198    { &hf_bit2infoflagsl,
7199    { "Entry ID", "ncp.bit2infoflagsl", FT_BOOLEAN, 16, NULL, 0x00000002, NULL, HFILL }},
7200
7201    { &hf_bit3infoflagsl,
7202    { "Entry Flags", "ncp.bit3infoflagsl", FT_BOOLEAN, 16, NULL, 0x00000004, NULL, HFILL }},
7203
7204    { &hf_bit4infoflagsl,
7205    { "Subordinate Count", "ncp.bit4infoflagsl", FT_BOOLEAN, 16, NULL, 0x00000008, NULL, HFILL }},
7206
7207    { &hf_bit5infoflagsl,
7208    { "Modification Time", "ncp.bit5infoflagsl", FT_BOOLEAN, 16, NULL, 0x00000010, NULL, HFILL }},
7209
7210    { &hf_bit6infoflagsl,
7211    { "Modification Timestamp", "ncp.bit6infoflagsl", FT_BOOLEAN, 16, NULL, 0x00000020, NULL, HFILL }},
7212
7213    { &hf_bit7infoflagsl,
7214    { "Creation Timestamp", "ncp.bit7infoflagsl", FT_BOOLEAN, 16, NULL, 0x00000040, NULL, HFILL }},
7215
7216    { &hf_bit8infoflagsl,
7217    { "Partition Root ID", "ncp.bit8infoflagsl", FT_BOOLEAN, 16, NULL, 0x00000080, NULL, HFILL }},
7218
7219    { &hf_bit9infoflagsl,
7220    { "Parent ID", "ncp.bit9infoflagsl", FT_BOOLEAN, 16, NULL, 0x00000100, NULL, HFILL }},
7221
7222    { &hf_bit10infoflagsl,
7223    { "Revision Count", "ncp.bit10infoflagsl", FT_BOOLEAN, 16, NULL, 0x00000200, NULL, HFILL }},
7224
7225    { &hf_bit11infoflagsl,
7226    { "Replica Type", "ncp.bit11infoflagsl", FT_BOOLEAN, 16, NULL, 0x00000400, NULL, HFILL }},
7227
7228    { &hf_bit12infoflagsl,
7229    { "Base Class", "ncp.bit12infoflagsl", FT_BOOLEAN, 16, NULL, 0x00000800, NULL, HFILL }},
7230
7231    { &hf_bit13infoflagsl,
7232    { "Relative Distinguished Name", "ncp.bit13infoflagsl", FT_BOOLEAN, 16, NULL, 0x00001000, NULL, HFILL }},
7233
7234    { &hf_bit14infoflagsl,
7235    { "Distinguished Name", "ncp.bit14infoflagsl", FT_BOOLEAN, 16, NULL, 0x00002000, NULL, HFILL }},
7236
7237    { &hf_bit15infoflagsl,
7238    { "Root Distinguished Name", "ncp.bit15infoflagsl", FT_BOOLEAN, 16, NULL, 0x00004000, NULL, HFILL }},
7239
7240    { &hf_bit16infoflagsl,
7241    { "Parent Distinguished Name", "ncp.bit16infoflagsl", FT_BOOLEAN, 16, NULL, 0x00008000, NULL, HFILL }},
7242
7243    { &hf_infoflagsh,
7244    { "Information Flags (high) Byte", "ncp.infoflagsh", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7245
7246    { &hf_bit1infoflagsh,
7247    { "Purge Time", "ncp.bit1infoflagsh", FT_BOOLEAN, 16, NULL, 0x00000001, NULL, HFILL }},
7248
7249    { &hf_bit2infoflagsh,
7250    { "Dereference Base Class", "ncp.bit2infoflagsh", FT_BOOLEAN, 16, NULL, 0x00000002, NULL, HFILL }},
7251
7252    { &hf_bit3infoflagsh,
7253    { "Not Defined", "ncp.bit3infoflagsh", FT_BOOLEAN, 16, NULL, 0x00000004, NULL, HFILL }},
7254
7255    { &hf_bit4infoflagsh,
7256    { "Not Defined", "ncp.bit4infoflagsh", FT_BOOLEAN, 16, NULL, 0x00000008, NULL, HFILL }},
7257
7258    { &hf_bit5infoflagsh,
7259    { "Not Defined", "ncp.bit5infoflagsh", FT_BOOLEAN, 16, NULL, 0x00000010, NULL, HFILL }},
7260
7261    { &hf_bit6infoflagsh,
7262    { "Not Defined", "ncp.bit6infoflagsh", FT_BOOLEAN, 16, NULL, 0x00000020, NULL, HFILL }},
7263
7264    { &hf_bit7infoflagsh,
7265    { "Not Defined", "ncp.bit7infoflagsh", FT_BOOLEAN, 16, NULL, 0x00000040, NULL, HFILL }},
7266
7267    { &hf_bit8infoflagsh,
7268    { "Not Defined", "ncp.bit8infoflagsh", FT_BOOLEAN, 16, NULL, 0x00000080, NULL, HFILL }},
7269
7270    { &hf_bit9infoflagsh,
7271    { "Not Defined", "ncp.bit9infoflagsh", FT_BOOLEAN, 16, NULL, 0x00000100, NULL, HFILL }},
7272
7273    { &hf_bit10infoflagsh,
7274    { "Not Defined", "ncp.bit10infoflagsh", FT_BOOLEAN, 16, NULL, 0x00000200, NULL, HFILL }},
7275
7276    { &hf_bit11infoflagsh,
7277    { "Not Defined", "ncp.bit11infoflagsh", FT_BOOLEAN, 16, NULL, 0x00000400, NULL, HFILL }},
7278
7279    { &hf_bit12infoflagsh,
7280    { "Not Defined", "ncp.bit12infoflagshs", FT_BOOLEAN, 16, NULL, 0x00000800, NULL, HFILL }},
7281
7282    { &hf_bit13infoflagsh,
7283    { "Not Defined", "ncp.bit13infoflagsh", FT_BOOLEAN, 16, NULL, 0x00001000, NULL, HFILL }},
7284
7285    { &hf_bit14infoflagsh,
7286    { "Not Defined", "ncp.bit14infoflagsh", FT_BOOLEAN, 16, NULL, 0x00002000, NULL, HFILL }},
7287
7288    { &hf_bit15infoflagsh,
7289    { "Not Defined", "ncp.bit15infoflagsh", FT_BOOLEAN, 16, NULL, 0x00004000, NULL, HFILL }},
7290
7291    { &hf_bit16infoflagsh,
7292    { "Not Defined", "ncp.bit16infoflagsh", FT_BOOLEAN, 16, NULL, 0x00008000, NULL, HFILL }},
7293
7294    { &hf_retinfoflagsh,
7295    { "Return Information Flags (high) Byte", "ncp.retinfoflagsh", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7296
7297    { &hf_bit1retinfoflagsh,
7298    { "Purge Time", "ncp.bit1retinfoflagsh", FT_BOOLEAN, 16, NULL, 0x00000001, NULL, HFILL }},
7299
7300    { &hf_bit2retinfoflagsh,
7301    { "Dereference Base Class", "ncp.bit2retinfoflagsh", FT_BOOLEAN, 16, NULL, 0x00000002, NULL, HFILL }},
7302
7303    { &hf_bit3retinfoflagsh,
7304    { "Replica Number", "ncp.bit3retinfoflagsh", FT_BOOLEAN, 16, NULL, 0x00000004, NULL, HFILL }},
7305
7306    { &hf_bit4retinfoflagsh,
7307    { "Replica State", "ncp.bit4retinfoflagsh", FT_BOOLEAN, 16, NULL, 0x00000008, NULL, HFILL }},
7308
7309    { &hf_bit5retinfoflagsh,
7310    { "Federation Boundary", "ncp.bit5retinfoflagsh", FT_BOOLEAN, 16, NULL, 0x00000010, NULL, HFILL }},
7311
7312    { &hf_bit6retinfoflagsh,
7313    { "Schema Boundary", "ncp.bit6retinfoflagsh", FT_BOOLEAN, 16, NULL, 0x00000020, NULL, HFILL }},
7314
7315    { &hf_bit7retinfoflagsh,
7316    { "Federation Boundary ID", "ncp.bit7retinfoflagsh", FT_BOOLEAN, 16, NULL, 0x00000040, NULL, HFILL }},
7317
7318    { &hf_bit8retinfoflagsh,
7319    { "Schema Boundary ID", "ncp.bit8retinfoflagsh", FT_BOOLEAN, 16, NULL, 0x00000080, NULL, HFILL }},
7320
7321    { &hf_bit9retinfoflagsh,
7322    { "Current Subcount", "ncp.bit9retinfoflagsh", FT_BOOLEAN, 16, NULL, 0x00000100, NULL, HFILL }},
7323
7324    { &hf_bit10retinfoflagsh,
7325    { "Local Entry Flags", "ncp.bit10retinfoflagsh", FT_BOOLEAN, 16, NULL, 0x00000200, NULL, HFILL }},
7326
7327    { &hf_bit11retinfoflagsh,
7328    { "Not Defined", "ncp.bit11retinfoflagsh", FT_BOOLEAN, 16, NULL, 0x00000400, NULL, HFILL }},
7329
7330    { &hf_bit12retinfoflagsh,
7331    { "Not Defined", "ncp.bit12retinfoflagshs", FT_BOOLEAN, 16, NULL, 0x00000800, NULL, HFILL }},
7332
7333    { &hf_bit13retinfoflagsh,
7334    { "Not Defined", "ncp.bit13retinfoflagsh", FT_BOOLEAN, 16, NULL, 0x00001000, NULL, HFILL }},
7335
7336    { &hf_bit14retinfoflagsh,
7337    { "Not Defined", "ncp.bit14retinfoflagsh", FT_BOOLEAN, 16, NULL, 0x00002000, NULL, HFILL }},
7338
7339    { &hf_bit15retinfoflagsh,
7340    { "Not Defined", "ncp.bit15retinfoflagsh", FT_BOOLEAN, 16, NULL, 0x00004000, NULL, HFILL }},
7341
7342    { &hf_bit16retinfoflagsh,
7343    { "Not Defined", "ncp.bit16retinfoflagsh", FT_BOOLEAN, 16, NULL, 0x00008000, NULL, HFILL }},
7344
7345    { &hf_bit1lflags,
7346    { "List Typeless", "ncp.bit1lflags", FT_BOOLEAN, 16, NULL, 0x00000001, NULL, HFILL }},
7347
7348    { &hf_bit2lflags,
7349    { "List Containers", "ncp.bit2lflags", FT_BOOLEAN, 16, NULL, 0x00000002, NULL, HFILL }},
7350
7351    { &hf_bit3lflags,
7352    { "List Slashed", "ncp.bit3lflags", FT_BOOLEAN, 16, NULL, 0x00000004, NULL, HFILL }},
7353
7354    { &hf_bit4lflags,
7355    { "List Dotted", "ncp.bit4lflags", FT_BOOLEAN, 16, NULL, 0x00000008, NULL, HFILL }},
7356
7357    { &hf_bit5lflags,
7358    { "Dereference Alias", "ncp.bit5lflags", FT_BOOLEAN, 16, NULL, 0x00000010, NULL, HFILL }},
7359
7360    { &hf_bit6lflags,
7361    { "List All Containers", "ncp.bit6lflags", FT_BOOLEAN, 16, NULL, 0x00000020, NULL, HFILL }},
7362
7363    { &hf_bit7lflags,
7364    { "List Obsolete", "ncp.bit7lflags", FT_BOOLEAN, 16, NULL, 0x00000040, NULL, HFILL }},
7365
7366    { &hf_bit8lflags,
7367    { "List Tuned Output", "ncp.bit8lflags", FT_BOOLEAN, 16, NULL, 0x00000080, NULL, HFILL }},
7368
7369    { &hf_bit9lflags,
7370    { "List External Reference", "ncp.bit9lflags", FT_BOOLEAN, 16, NULL, 0x00000100, NULL, HFILL }},
7371
7372    { &hf_bit10lflags,
7373    { "Not Defined", "ncp.bit10lflags", FT_BOOLEAN, 16, NULL, 0x00000200, NULL, HFILL }},
7374
7375    { &hf_bit11lflags,
7376    { "Not Defined", "ncp.bit11lflags", FT_BOOLEAN, 16, NULL, 0x00000400, NULL, HFILL }},
7377
7378    { &hf_bit12lflags,
7379    { "Not Defined", "ncp.bit12lflags", FT_BOOLEAN, 16, NULL, 0x00000800, NULL, HFILL }},
7380
7381    { &hf_bit13lflags,
7382    { "Not Defined", "ncp.bit13lflags", FT_BOOLEAN, 16, NULL, 0x00001000, NULL, HFILL }},
7383
7384    { &hf_bit14lflags,
7385    { "Not Defined", "ncp.bit14lflags", FT_BOOLEAN, 16, NULL, 0x00002000, NULL, HFILL }},
7386
7387    { &hf_bit15lflags,
7388    { "Not Defined", "ncp.bit15lflags", FT_BOOLEAN, 16, NULL, 0x00004000, NULL, HFILL }},
7389
7390    { &hf_bit16lflags,
7391    { "Not Defined", "ncp.bit16lflags", FT_BOOLEAN, 16, NULL, 0x00008000, NULL, HFILL }},
7392
7393    { &hf_l1flagsl,
7394    { "Information Flags (low) Byte", "ncp.l1flagsl", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7395
7396    { &hf_l1flagsh,
7397    { "Information Flags (high) Byte", "ncp.l1flagsh", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7398
7399    { &hf_bit1l1flagsl,
7400    { "Output Flags", "ncp.bit1l1flagsl", FT_BOOLEAN, 16, NULL, 0x00000001, NULL, HFILL }},
7401
7402    { &hf_bit2l1flagsl,
7403    { "Entry ID", "ncp.bit2l1flagsl", FT_BOOLEAN, 16, NULL, 0x00000002, NULL, HFILL }},
7404
7405    { &hf_bit3l1flagsl,
7406    { "Replica State", "ncp.bit3l1flagsl", FT_BOOLEAN, 16, NULL, 0x00000004, NULL, HFILL }},
7407
7408    { &hf_bit4l1flagsl,
7409    { "Modification Timestamp", "ncp.bit4l1flagsl", FT_BOOLEAN, 16, NULL, 0x00000008, NULL, HFILL }},
7410
7411    { &hf_bit5l1flagsl,
7412    { "Purge Time", "ncp.bit5l1flagsl", FT_BOOLEAN, 16, NULL, 0x00000010, NULL, HFILL }},
7413
7414    { &hf_bit6l1flagsl,
7415    { "Local Partition ID", "ncp.bit6l1flagsl", FT_BOOLEAN, 16, NULL, 0x00000020, NULL, HFILL }},
7416
7417    { &hf_bit7l1flagsl,
7418    { "Distinguished Name", "ncp.bit7l1flagsl", FT_BOOLEAN, 16, NULL, 0x00000040, NULL, HFILL }},
7419
7420    { &hf_bit8l1flagsl,
7421    { "Replica Type", "ncp.bit8l1flagsl", FT_BOOLEAN, 16, NULL, 0x00000080, NULL, HFILL }},
7422
7423    { &hf_bit9l1flagsl,
7424    { "Partition Busy", "ncp.bit9l1flagsl", FT_BOOLEAN, 16, NULL, 0x00000100, NULL, HFILL }},
7425
7426    { &hf_bit10l1flagsl,
7427    { "Not Defined", "ncp.bit10l1flagsl", FT_BOOLEAN, 16, NULL, 0x00000200, NULL, HFILL }},
7428
7429    { &hf_bit11l1flagsl,
7430    { "Not Defined", "ncp.bit11l1flagsl", FT_BOOLEAN, 16, NULL, 0x00000400, NULL, HFILL }},
7431
7432    { &hf_bit12l1flagsl,
7433    { "Not Defined", "ncp.bit12l1flagsl", FT_BOOLEAN, 16, NULL, 0x00000800, NULL, HFILL }},
7434
7435    { &hf_bit13l1flagsl,
7436    { "Not Defined", "ncp.bit13l1flagsl", FT_BOOLEAN, 16, NULL, 0x00001000, NULL, HFILL }},
7437
7438    { &hf_bit14l1flagsl,
7439    { "Not Defined", "ncp.bit14l1flagsl", FT_BOOLEAN, 16, NULL, 0x00002000, NULL, HFILL }},
7440
7441    { &hf_bit15l1flagsl,
7442    { "Not Defined", "ncp.bit15l1flagsl", FT_BOOLEAN, 16, NULL, 0x00004000, NULL, HFILL }},
7443
7444    { &hf_bit16l1flagsl,
7445    { "Not Defined", "ncp.bit16l1flagsl", FT_BOOLEAN, 16, NULL, 0x00008000, NULL, HFILL }},
7446
7447    { &hf_bit1l1flagsh,
7448    { "Not Defined", "ncp.bit1l1flagsh", FT_BOOLEAN, 16, NULL, 0x00000001, NULL, HFILL }},
7449
7450    { &hf_bit2l1flagsh,
7451    { "Not Defined", "ncp.bit2l1flagsh", FT_BOOLEAN, 16, NULL, 0x00000002, NULL, HFILL }},
7452
7453    { &hf_bit3l1flagsh,
7454    { "Not Defined", "ncp.bit3l1flagsh", FT_BOOLEAN, 16, NULL, 0x00000004, NULL, HFILL }},
7455
7456    { &hf_bit4l1flagsh,
7457    { "Not Defined", "ncp.bit4l1flagsh", FT_BOOLEAN, 16, NULL, 0x00000008, NULL, HFILL }},
7458
7459    { &hf_bit5l1flagsh,
7460    { "Not Defined", "ncp.bit5l1flagsh", FT_BOOLEAN, 16, NULL, 0x00000010, NULL, HFILL }},
7461
7462    { &hf_bit6l1flagsh,
7463    { "Not Defined", "ncp.bit6l1flagsh", FT_BOOLEAN, 16, NULL, 0x00000020, NULL, HFILL }},
7464
7465    { &hf_bit7l1flagsh,
7466    { "Not Defined", "ncp.bit7l1flagsh", FT_BOOLEAN, 16, NULL, 0x00000040, NULL, HFILL }},
7467
7468    { &hf_bit8l1flagsh,
7469    { "Not Defined", "ncp.bit8l1flagsh", FT_BOOLEAN, 16, NULL, 0x00000080, NULL, HFILL }},
7470
7471    { &hf_bit9l1flagsh,
7472    { "Not Defined", "ncp.bit9l1flagsh", FT_BOOLEAN, 16, NULL, 0x00000100, NULL, HFILL }},
7473
7474    { &hf_bit10l1flagsh,
7475    { "Not Defined", "ncp.bit10l1flagsh", FT_BOOLEAN, 16, NULL, 0x00000200, NULL, HFILL }},
7476
7477    { &hf_bit11l1flagsh,
7478    { "Not Defined", "ncp.bit11l1flagsh", FT_BOOLEAN, 16, NULL, 0x00000400, NULL, HFILL }},
7479
7480    { &hf_bit12l1flagsh,
7481    { "Not Defined", "ncp.bit12l1flagsh", FT_BOOLEAN, 16, NULL, 0x00000800, NULL, HFILL }},
7482
7483    { &hf_bit13l1flagsh,
7484    { "Not Defined", "ncp.bit13l1flagsh", FT_BOOLEAN, 16, NULL, 0x00001000, NULL, HFILL }},
7485
7486    { &hf_bit14l1flagsh,
7487    { "Not Defined", "ncp.bit14l1flagsh", FT_BOOLEAN, 16, NULL, 0x00002000, NULL, HFILL }},
7488
7489    { &hf_bit15l1flagsh,
7490    { "Not Defined", "ncp.bit15l1flagsh", FT_BOOLEAN, 16, NULL, 0x00004000, NULL, HFILL }},
7491
7492    { &hf_bit16l1flagsh,
7493    { "Not Defined", "ncp.bit16l1flagsh", FT_BOOLEAN, 16, NULL, 0x00008000, NULL, HFILL }},
7494
7495    { &hf_vflags,
7496    { "Value Flags", "ncp.vflags", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7497
7498    { &hf_bit1vflags,
7499    { "Naming", "ncp.bit1vflags", FT_BOOLEAN, 16, NULL, 0x00000001, NULL, HFILL }},
7500
7501    { &hf_bit2vflags,
7502    { "Base Class", "ncp.bit2vflags", FT_BOOLEAN, 16, NULL, 0x00000002, NULL, HFILL }},
7503
7504    { &hf_bit3vflags,
7505    { "Present", "ncp.bit3vflags", FT_BOOLEAN, 16, NULL, 0x00000004, NULL, HFILL }},
7506
7507    { &hf_bit4vflags,
7508    { "Value Damaged", "ncp.bit4vflags", FT_BOOLEAN, 16, NULL, 0x00000008, NULL, HFILL }},
7509
7510    { &hf_bit5vflags,
7511    { "Not Defined", "ncp.bit5vflags", FT_BOOLEAN, 16, NULL, 0x00000010, NULL, HFILL }},
7512
7513    { &hf_bit6vflags,
7514    { "Not Defined", "ncp.bit6vflags", FT_BOOLEAN, 16, NULL, 0x00000020, NULL, HFILL }},
7515
7516    { &hf_bit7vflags,
7517    { "Not Defined", "ncp.bit7vflags", FT_BOOLEAN, 16, NULL, 0x00000040, NULL, HFILL }},
7518
7519    { &hf_bit8vflags,
7520    { "Not Defined", "ncp.bit8vflags", FT_BOOLEAN, 16, NULL, 0x00000080, NULL, HFILL }},
7521
7522    { &hf_bit9vflags,
7523    { "Not Defined", "ncp.bit9vflags", FT_BOOLEAN, 16, NULL, 0x00000100, NULL, HFILL }},
7524
7525    { &hf_bit10vflags,
7526    { "Not Defined", "ncp.bit10vflags", FT_BOOLEAN, 16, NULL, 0x00000200, NULL, HFILL }},
7527
7528    { &hf_bit11vflags,
7529    { "Not Defined", "ncp.bit11vflags", FT_BOOLEAN, 16, NULL, 0x00000400, NULL, HFILL }},
7530
7531    { &hf_bit12vflags,
7532    { "Not Defined", "ncp.bit12vflags", FT_BOOLEAN, 16, NULL, 0x00000800, NULL, HFILL }},
7533
7534    { &hf_bit13vflags,
7535    { "Not Defined", "ncp.bit13vflags", FT_BOOLEAN, 16, NULL, 0x00001000, NULL, HFILL }},
7536
7537    { &hf_bit14vflags,
7538    { "Not Defined", "ncp.bit14vflags", FT_BOOLEAN, 16, NULL, 0x00002000, NULL, HFILL }},
7539
7540    { &hf_bit15vflags,
7541    { "Not Defined", "ncp.bit15vflags", FT_BOOLEAN, 16, NULL, 0x00004000, NULL, HFILL }},
7542
7543    { &hf_bit16vflags,
7544    { "Not Defined", "ncp.bit16vflags", FT_BOOLEAN, 16, NULL, 0x00008000, NULL, HFILL }},
7545
7546    { &hf_cflags,
7547    { "Class Flags", "ncp.cflags", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7548
7549    { &hf_bit1cflags,
7550    { "Container", "ncp.bit1cflags", FT_BOOLEAN, 16, NULL, 0x00000001, NULL, HFILL }},
7551
7552    { &hf_bit2cflags,
7553    { "Effective", "ncp.bit2cflags", FT_BOOLEAN, 16, NULL, 0x00000002, NULL, HFILL }},
7554
7555    { &hf_bit3cflags,
7556    { "Class Definition Cannot be Removed", "ncp.bit3cflags", FT_BOOLEAN, 16, NULL, 0x00000004, NULL, HFILL }},
7557
7558    { &hf_bit4cflags,
7559    { "Ambiguous Naming", "ncp.bit4cflags", FT_BOOLEAN, 16, NULL, 0x00000008, NULL, HFILL }},
7560
7561    { &hf_bit5cflags,
7562    { "Ambiguous Containment", "ncp.bit5cflags", FT_BOOLEAN, 16, NULL, 0x00000010, NULL, HFILL }},
7563
7564    { &hf_bit6cflags,
7565    { "Auxiliary", "ncp.bit6cflags", FT_BOOLEAN, 16, NULL, 0x00000020, NULL, HFILL }},
7566
7567    { &hf_bit7cflags,
7568    { "Operational", "ncp.bit7cflags", FT_BOOLEAN, 16, NULL, 0x00000040, NULL, HFILL }},
7569
7570    { &hf_bit8cflags,
7571    { "Sparse Required", "ncp.bit8cflags", FT_BOOLEAN, 16, NULL, 0x00000080, NULL, HFILL }},
7572
7573    { &hf_bit9cflags,
7574    { "Sparse Operational", "ncp.bit9cflags", FT_BOOLEAN, 16, NULL, 0x00000100, NULL, HFILL }},
7575
7576    { &hf_bit10cflags,
7577    { "Not Defined", "ncp.bit10cflags", FT_BOOLEAN, 16, NULL, 0x00000200, NULL, HFILL }},
7578
7579    { &hf_bit11cflags,
7580    { "Not Defined", "ncp.bit11cflags", FT_BOOLEAN, 16, NULL, 0x00000400, NULL, HFILL }},
7581
7582    { &hf_bit12cflags,
7583    { "Not Defined", "ncp.bit12cflags", FT_BOOLEAN, 16, NULL, 0x00000800, NULL, HFILL }},
7584
7585    { &hf_bit13cflags,
7586    { "Not Defined", "ncp.bit13cflags", FT_BOOLEAN, 16, NULL, 0x00001000, NULL, HFILL }},
7587
7588    { &hf_bit14cflags,
7589    { "Not Defined", "ncp.bit14cflags", FT_BOOLEAN, 16, NULL, 0x00002000, NULL, HFILL }},
7590
7591    { &hf_bit15cflags,
7592    { "Not Defined", "ncp.bit15cflags", FT_BOOLEAN, 16, NULL, 0x00004000, NULL, HFILL }},
7593
7594    { &hf_bit16cflags,
7595    { "Not Defined", "ncp.bit16cflags", FT_BOOLEAN, 16, NULL, 0x00008000, NULL, HFILL }},
7596
7597    { &hf_bit1acflags,
7598    { "Single Valued", "ncp.bit1acflags", FT_BOOLEAN, 16, NULL, 0x00000001, NULL, HFILL }},
7599
7600    { &hf_bit2acflags,
7601    { "Sized", "ncp.bit2acflags", FT_BOOLEAN, 16, NULL, 0x00000002, NULL, HFILL }},
7602
7603    { &hf_bit3acflags,
7604    { "Non-Removable", "ncp.bit3acflags", FT_BOOLEAN, 16, NULL, 0x00000004, NULL, HFILL }},
7605
7606    { &hf_bit4acflags,
7607    { "Read Only", "ncp.bit4acflags", FT_BOOLEAN, 16, NULL, 0x00000008, NULL, HFILL }},
7608
7609    { &hf_bit5acflags,
7610    { "Hidden", "ncp.bit5acflags", FT_BOOLEAN, 16, NULL, 0x00000010, NULL, HFILL }},
7611
7612    { &hf_bit6acflags,
7613    { "String", "ncp.bit6acflags", FT_BOOLEAN, 16, NULL, 0x00000020, NULL, HFILL }},
7614
7615    { &hf_bit7acflags,
7616    { "Synchronize Immediate", "ncp.bit7acflags", FT_BOOLEAN, 16, NULL, 0x00000040, NULL, HFILL }},
7617
7618    { &hf_bit8acflags,
7619    { "Public Read", "ncp.bit8acflags", FT_BOOLEAN, 16, NULL, 0x00000080, NULL, HFILL }},
7620
7621    { &hf_bit9acflags,
7622    { "Server Read", "ncp.bit9acflags", FT_BOOLEAN, 16, NULL, 0x00000100, NULL, HFILL }},
7623
7624    { &hf_bit10acflags,
7625    { "Write Managed", "ncp.bit10acflags", FT_BOOLEAN, 16, NULL, 0x00000200, NULL, HFILL }},
7626
7627    { &hf_bit11acflags,
7628    { "Per Replica", "ncp.bit11acflags", FT_BOOLEAN, 16, NULL, 0x00000400, NULL, HFILL }},
7629
7630    { &hf_bit12acflags,
7631    { "Never Schedule Synchronization", "ncp.bit12acflags", FT_BOOLEAN, 16, NULL, 0x00000800, NULL, HFILL }},
7632
7633    { &hf_bit13acflags,
7634    { "Operational", "ncp.bit13acflags", FT_BOOLEAN, 16, NULL, 0x00001000, NULL, HFILL }},
7635
7636    { &hf_bit14acflags,
7637    { "Not Defined", "ncp.bit14acflags", FT_BOOLEAN, 16, NULL, 0x00002000, NULL, HFILL }},
7638
7639    { &hf_bit15acflags,
7640    { "Not Defined", "ncp.bit15acflags", FT_BOOLEAN, 16, NULL, 0x00004000, NULL, HFILL }},
7641
7642    { &hf_bit16acflags,
7643    { "Not Defined", "ncp.bit16acflags", FT_BOOLEAN, 16, NULL, 0x00008000, NULL, HFILL }},
7644
7645
7646    { &hf_nds_reply_error,
7647    { "NDS Error", "ncp.ndsreplyerror", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7648
7649    { &hf_nds_net,
7650    { "Network","ncp.ndsnet", FT_IPXNET, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7651
7652    { &hf_nds_node,
7653    { "Node",       "ncp.ndsnode", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7654
7655    { &hf_nds_socket,
7656    { "Socket",     "ncp.ndssocket", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7657
7658    { &hf_add_ref_ip,
7659    { "Address Referral", "ncp.ipref", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7660
7661    { &hf_add_ref_udp,
7662    { "Address Referral", "ncp.udpref", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7663
7664    { &hf_add_ref_tcp,
7665    { "Address Referral", "ncp.tcpref", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7666
7667    { &hf_referral_record,
7668    { "Referral Record", "ncp.ref_rec", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7669
7670    { &hf_referral_addcount,
7671    { "Number of Addresses in Referral", "ncp.ref_addcount", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7672
7673    { &hf_nds_port,
7674    { "Port", "ncp.ndsport", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7675
7676    { &hf_mv_string,
7677    { "Attribute Name", "ncp.mv_string", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7678
7679    { &hf_nds_syntax,
7680    { "Attribute Syntax", "ncp.nds_syntax", FT_UINT32, BASE_DEC, VALS(nds_syntax), 0x0, NULL, HFILL }},
7681
7682    { &hf_value_string,
7683    { "Value", "ncp.value_string", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7684
7685    { &hf_nds_stream_name,
7686    { "Stream Name", "ncp.nds_stream_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7687
7688    { &hf_nds_buffer_size,
7689    { "NDS Reply Buffer Size", "ncp.nds_reply_buf", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7690
7691    { &hf_nds_ver,
7692    { "NDS Version", "ncp.nds_ver", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7693
7694    { &hf_nds_nflags,
7695    { "Flags", "ncp.nds_nflags", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7696
7697    { &hf_nds_rflags,
7698    { "Request Flags", "ncp.nds_rflags", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7699
7700    { &hf_nds_eflags,
7701    { "Entry Flags", "ncp.nds_eflags", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7702
7703    { &hf_nds_scope,
7704    { "Scope", "ncp.nds_scope", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7705
7706    { &hf_nds_name,
7707    { "Name", "ncp.nds_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7708
7709    { &hf_nds_name_type,
7710    { "Name Type", "ncp.nds_name_type", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7711
7712    { &hf_nds_comm_trans,
7713    { "Communications Transport", "ncp.nds_comm_trans", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7714
7715    { &hf_nds_tree_trans,
7716    { "Tree Walker Transport", "ncp.nds_tree_trans", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7717
7718    { &hf_nds_iteration,
7719    { "Iteration Handle", "ncp.nds_iteration", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7720
7721    { &hf_nds_iterator,
7722    { "Iterator", "ncp.nds_iterator", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7723
7724    { &hf_nds_file_handle,
7725    { "File Handle", "ncp.nds_file_handle", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7726
7727    { &hf_nds_file_size,
7728    { "File Size", "ncp.nds_file_size", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7729
7730    { &hf_nds_eid,
7731    { "NDS EID", "ncp.nds_eid", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7732
7733    { &hf_nds_depth,
7734    { "Distance object is from Root", "ncp.nds_depth", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7735
7736    { &hf_nds_info_type,
7737    { "Info Type", "ncp.nds_info_type", FT_UINT32, BASE_RANGE_STRING|BASE_DEC, RVALS(nds_info_type), 0x0, NULL, HFILL }},
7738
7739    { &hf_nds_class_def_type,
7740    { "Class Definition Type", "ncp.nds_class_def_type", FT_UINT32, BASE_DEC, VALS(class_def_type), 0x0, NULL, HFILL }},
7741
7742    { &hf_nds_all_attr,
7743    { "All Attributes", "ncp.nds_all_attr", FT_UINT32, BASE_DEC, NULL, 0x0, "Return all Attributes?", HFILL }},
7744
7745    { &hf_nds_return_all_classes,
7746    { "All Classes", "ncp.nds_return_all_classes", FT_UINT32, BASE_DEC, NULL, 0x0, "Return all Classes?", HFILL }},
7747
7748    { &hf_nds_req_flags,
7749    { "Request Flags", "ncp.nds_req_flags", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7750
7751    { &hf_nds_attr,
7752    { "Attributes", "ncp.nds_attributes", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7753
7754    { &hf_nds_classes,
7755    { "Classes", "ncp.nds_classes", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7756
7757    { &hf_nds_crc,
7758    { "CRC", "ncp.nds_crc", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7759
7760    { &hf_nds_referrals,
7761    { "Referrals", "ncp.nds_referrals", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7762
7763    { &hf_nds_result_flags,
7764    { "Result Flags", "ncp.nds_result_flags", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7765
7766    { &hf_nds_stream_flags,
7767    { "Streams Flags", "ncp.nds_stream_flags", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7768
7769    { &hf_nds_tag_string,
7770    { "Tags", "ncp.nds_tags", FT_UINT32, BASE_DEC, VALS(nds_tags), 0x0, NULL, HFILL }},
7771
7772    { &hf_value_bytes,
7773    { "Bytes", "ncp.value_bytes", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7774
7775    { &hf_replica_type,
7776    { "Replica Type", "ncp.rtype", FT_UINT32, BASE_DEC, VALS(nds_replica_type), 0x0, NULL, HFILL }},
7777
7778    { &hf_replica_state,
7779    { "Replica State", "ncp.rstate", FT_UINT16, BASE_DEC, VALS(nds_replica_state), 0x0, NULL, HFILL }},
7780
7781    { &hf_nds_rnum,
7782    { "Replica Number", "ncp.rnum", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7783
7784    { &hf_nds_revent,
7785    { "Event", "ncp.revent", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7786
7787    { &hf_replica_number,
7788    { "Replica Number", "ncp.rnum", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7789
7790    { &hf_min_nds_ver,
7791    { "Minimum NDS Version", "ncp.min_nds_version", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7792
7793    { &hf_nds_ver_include,
7794    { "Include NDS Version", "ncp.inc_nds_ver", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7795
7796    { &hf_nds_ver_exclude,
7797    { "Exclude NDS Version", "ncp.exc_nds_ver", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7798
7799#if 0 /* Unused ? */
7800    { &hf_nds_es,
7801    { "Input Entry Specifier", "ncp.nds_es", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7802#endif
7803
7804    { &hf_es_type,
7805    { "Entry Specifier Type", "ncp.nds_es_type", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7806
7807    { &hf_rdn_string,
7808    { "RDN", "ncp.nds_rdn", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7809
7810#if 0 /* Unused ? */
7811    { &hf_delim_string,
7812    { "Delimiter", "ncp.nds_delim", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7813#endif
7814
7815    { &hf_nds_dn_output_type,
7816    { "Output Entry Specifier Type", "ncp.nds_out_es_type", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7817
7818    { &hf_nds_nested_output_type,
7819    { "Nested Output Entry Specifier Type", "ncp.nds_nested_out_es", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7820
7821    { &hf_nds_output_delimiter,
7822    { "Output Delimiter", "ncp.nds_out_delimiter", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7823
7824    { &hf_nds_output_entry_specifier,
7825    { "Output Entry Specifier", "ncp.nds_out_es", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7826
7827    { &hf_es_value,
7828    { "Entry Specifier Value", "ncp.nds_es_value", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7829
7830    { &hf_es_rdn_count,
7831    { "RDN Count", "ncp.nds_es_rdn_count", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7832
7833    { &hf_nds_replica_num,
7834    { "Replica Number", "ncp.nds_replica_num", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7835
7836    { &hf_es_seconds,
7837    { "Seconds", "ncp.nds_es_seconds", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL }},
7838
7839    { &hf_nds_event_num,
7840    { "Event Number", "ncp.nds_event_num", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7841
7842    { &hf_nds_compare_results,
7843    { "Compare Values Returned", "ncp.nds_compare_results", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7844
7845    { &hf_nds_parent,
7846    { "Parent ID", "ncp.nds_parent", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7847
7848    { &hf_nds_name_filter,
7849    { "Name Filter", "ncp.nds_name_filter", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7850
7851    { &hf_nds_class_filter,
7852    { "Class Filter", "ncp.nds_class_filter", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7853
7854    { &hf_nds_time_filter,
7855    { "Time Filter", "ncp.nds_time_filter", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7856
7857    { &hf_nds_partition_root_id,
7858    { "Partition Root ID", "ncp.nds_partition_root_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7859
7860    { &hf_nds_replicas,
7861    { "Replicas", "ncp.nds_replicas", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7862
7863    { &hf_nds_purge,
7864    { "Purge Time", "ncp.nds_purge", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL }},
7865
7866    { &hf_nds_local_partition,
7867    { "Local Partition ID", "ncp.nds_local_partition", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7868
7869    { &hf_partition_busy,
7870    { "Partition Busy", "ncp.nds_partition_busy", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7871
7872    { &hf_nds_number_of_changes,
7873    { "Number of Attribute Changes", "ncp.nds_number_of_changes", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7874
7875    { &hf_sub_count,
7876    { "Subordinate Count", "ncp.sub_count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7877
7878    { &hf_nds_revision,
7879    { "Revision Count", "ncp.nds_rev_count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7880
7881    { &hf_nds_base_class,
7882    { "Base Class", "ncp.nds_base_class", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7883
7884    { &hf_nds_relative_dn,
7885    { "Relative Distinguished Name", "ncp.nds_relative_dn", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7886
7887#if 0 /* Unused ? */
7888    { &hf_nds_root_dn,
7889    { "Root Distinguished Name", "ncp.nds_root_dn", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7890#endif
7891
7892#if 0 /* Unused ? */
7893    { &hf_nds_parent_dn,
7894    { "Parent Distinguished Name", "ncp.nds_parent_dn", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7895#endif
7896
7897    { &hf_deref_base,
7898    { "Dereference Base Class", "ncp.nds_deref_base", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7899
7900    { &hf_nds_base,
7901    { "Base Class", "ncp.nds_base", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7902
7903    { &hf_nds_super,
7904    { "Super Class", "ncp.nds_super", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7905
7906#if 0 /* Unused ? */
7907    { &hf_nds_entry_info,
7908    { "Entry Information", "ncp.nds_entry_info", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7909#endif
7910
7911    { &hf_nds_privileges,
7912    { "Privileges", "ncp.nds_privileges", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7913
7914    { &hf_nds_compare_attributes,
7915    { "Compare Attributes?", "ncp.nds_compare_attributes", FT_BOOLEAN, 16, NULL, 0x00000001, NULL, HFILL }},
7916
7917    { &hf_nds_read_attribute,
7918    { "Read Attribute?", "ncp.nds_read_attribute", FT_BOOLEAN, 16, NULL, 0x00000002, NULL, HFILL }},
7919
7920    { &hf_nds_write_add_delete_attribute,
7921    { "Write, Add, Delete Attribute?", "ncp.nds_write_add_delete_attribute", FT_BOOLEAN, 16, NULL, 0x00000004, NULL, HFILL }},
7922
7923    { &hf_nds_add_delete_self,
7924    { "Add/Delete Self?", "ncp.nds_add_delete_self", FT_BOOLEAN, 16, NULL, 0x00000008, NULL, HFILL }},
7925
7926    { &hf_nds_privilege_not_defined,
7927    { "Privilege Not defined", "ncp.nds_privilege_not_defined", FT_BOOLEAN, 16, NULL, 0x00000010, NULL, HFILL }},
7928
7929    { &hf_nds_supervisor,
7930    { "Supervisor?", "ncp.nds_supervisor", FT_BOOLEAN, 16, NULL, 0x00000020, NULL, HFILL }},
7931
7932    { &hf_nds_inheritance_control,
7933    { "Inheritance?", "ncp.nds_inheritance_control", FT_BOOLEAN, 16, NULL, 0x00000040, NULL, HFILL }},
7934
7935    { &hf_nds_browse_entry,
7936    { "Browse Entry?", "ncp.nds_browse_entry", FT_BOOLEAN, 16, NULL, 0x00000001, NULL, HFILL }},
7937
7938    { &hf_nds_add_entry,
7939    { "Add Entry?", "ncp.nds_add_entry", FT_BOOLEAN, 16, NULL, 0x00000002, NULL, HFILL }},
7940
7941    { &hf_nds_delete_entry,
7942    { "Delete Entry?", "ncp.nds_delete_entry", FT_BOOLEAN, 16, NULL, 0x00000004, NULL, HFILL }},
7943
7944    { &hf_nds_rename_entry,
7945    { "Rename Entry?", "ncp.nds_rename_entry", FT_BOOLEAN, 16, NULL, 0x00000008, NULL, HFILL }},
7946
7947    { &hf_nds_supervisor_entry,
7948    { "Supervisor?", "ncp.nds_supervisor_entry", FT_BOOLEAN, 16, NULL, 0x00000010, NULL, HFILL }},
7949
7950    { &hf_nds_entry_privilege_not_defined,
7951    { "Privilege Not Defined", "ncp.nds_entry_privilege_not_defined", FT_BOOLEAN, 16, NULL, 0x00000020, NULL, HFILL }},
7952
7953    { &hf_nds_vflags,
7954    { "Value Flags", "ncp.nds_vflags", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7955
7956    { &hf_nds_value_len,
7957    { "Value Length", "ncp.nds_vlength", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7958
7959    { &hf_nds_cflags,
7960    { "Class Flags", "ncp.nds_cflags", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7961
7962    { &hf_nds_asn1,
7963    { "ASN.1 ID", "ncp.nds_asn1", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7964
7965    { &hf_nds_acflags,
7966    { "Attribute Constraint Flags", "ncp.nds_acflags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7967
7968    { &hf_nds_upper,
7969    { "Upper Limit Value", "ncp.nds_upper", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7970
7971    { &hf_nds_lower,
7972    { "Lower Limit Value", "ncp.nds_lower", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7973
7974    { &hf_nds_trustee_dn,
7975    { "Trustee Distinguished Name", "ncp.nds_trustee_dn", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7976
7977    { &hf_nds_attribute_dn,
7978    { "Attribute Name", "ncp.nds_attribute_dn", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7979
7980    { &hf_nds_acl_add,
7981    { "ACL Templates to Add", "ncp.nds_acl_add", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7982
7983    { &hf_nds_acl_del,
7984    { "Access Control Lists to Delete", "ncp.nds_acl_del", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7985
7986    { &hf_nds_att_add,
7987    { "Attribute to Add", "ncp.nds_att_add", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7988
7989    { &hf_nds_att_del,
7990    { "Attribute Names to Delete", "ncp.nds_att_del", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7991
7992    { &hf_nds_keep,
7993    { "Delete Original RDN", "ncp.nds_keep", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7994
7995    { &hf_nds_new_rdn,
7996    { "New Relative Distinguished Name", "ncp.nds_new_rdn", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7997
7998    { &hf_nds_time_delay,
7999    { "Time Delay", "ncp.nds_time_delay", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
8000
8001    { &hf_nds_root_name,
8002    { "Root Most Object Name", "ncp.nds_root_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
8003
8004    { &hf_nds_new_part_id,
8005    { "New Partition Root ID", "ncp.nds_new_part_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
8006
8007    { &hf_nds_child_part_id,
8008    { "Child Partition Root ID", "ncp.nds_child_part_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
8009
8010    { &hf_nds_master_part_id,
8011    { "Master Partition Root ID", "ncp.nds_master_part_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
8012
8013    { &hf_nds_target_name,
8014    { "Target Server Name", "ncp.nds_target_dn", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
8015
8016    { &hf_pingflags1,
8017    { "Ping (low) Request Flags", "ncp.pingflags1", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
8018
8019    { &hf_bit1pingflags1,
8020    { "Supported Fields", "ncp.bit1pingflags1", FT_BOOLEAN, 16, NULL, 0x00000001, NULL, HFILL }},
8021
8022    { &hf_bit2pingflags1,
8023    { "Depth", "ncp.bit2pingflags1", FT_BOOLEAN, 16, NULL, 0x00000002, NULL, HFILL }},
8024
8025    { &hf_bit3pingflags1,
8026    { "Build Number", "ncp.bit3pingflags1", FT_BOOLEAN, 16, NULL, 0x00000004, NULL, HFILL }},
8027
8028    { &hf_bit4pingflags1,
8029    { "Flags", "ncp.bit4pingflags1", FT_BOOLEAN, 16, NULL, 0x00000008, NULL, HFILL }},
8030
8031    { &hf_bit5pingflags1,
8032    { "Verification Flags", "ncp.bit5pingflags1", FT_BOOLEAN, 16, NULL, 0x00000010, NULL, HFILL }},
8033
8034    { &hf_bit6pingflags1,
8035    { "Letter Version", "ncp.bit6pingflags1", FT_BOOLEAN, 16, NULL, 0x00000020, NULL, HFILL }},
8036
8037    { &hf_bit7pingflags1,
8038    { "OS Version", "ncp.bit7pingflags1", FT_BOOLEAN, 16, NULL, 0x00000040, NULL, HFILL }},
8039
8040    { &hf_bit8pingflags1,
8041    { "Not Defined", "ncp.bit8pingflags1", FT_BOOLEAN, 16, NULL, 0x00000080, NULL, HFILL }},
8042
8043    { &hf_bit9pingflags1,
8044    { "License Flags", "ncp.bit9pingflags1", FT_BOOLEAN, 16, NULL, 0x00000100, NULL, HFILL }},
8045
8046    { &hf_bit10pingflags1,
8047    { "DS Time", "ncp.bit10pingflags1", FT_BOOLEAN, 16, NULL, 0x00000200, NULL, HFILL }},
8048
8049    { &hf_bit11pingflags1,
8050    { "Server Time", "ncp.bit11pingflags1", FT_BOOLEAN, 16, NULL, 0x00000400, NULL, HFILL }},
8051
8052    { &hf_bit12pingflags1,
8053    { "Create Time", "ncp.bit12pingflags1", FT_BOOLEAN, 16, NULL, 0x00000800, NULL, HFILL }},
8054
8055    { &hf_bit13pingflags1,
8056    { "Not Defined", "ncp.bit13pingflags1", FT_BOOLEAN, 16, NULL, 0x00001000, NULL, HFILL }},
8057
8058    { &hf_bit14pingflags1,
8059    { "Not Defined", "ncp.bit14pingflags1", FT_BOOLEAN, 16, NULL, 0x00002000, NULL, HFILL }},
8060
8061    { &hf_bit15pingflags1,
8062    { "Not Defined", "ncp.bit15pingflags1", FT_BOOLEAN, 16, NULL, 0x00004000, NULL, HFILL }},
8063
8064    { &hf_bit16pingflags1,
8065    { "Not Defined", "ncp.bit16pingflags1", FT_BOOLEAN, 16, NULL, 0x00008000, NULL, HFILL }},
8066
8067    { &hf_pingflags2,
8068    { "Ping (high) Request Flags", "ncp.pingflags2", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
8069
8070    { &hf_bit1pingflags2,
8071    { "Sap Name", "ncp.bit1pingflags2", FT_BOOLEAN, 16, NULL, 0x00000001, NULL, HFILL }},
8072
8073    { &hf_bit2pingflags2,
8074    { "Tree Name", "ncp.bit2pingflags2", FT_BOOLEAN, 16, NULL, 0x00000002, NULL, HFILL }},
8075
8076    { &hf_bit3pingflags2,
8077    { "OS Name", "ncp.bit3pingflags2", FT_BOOLEAN, 16, NULL, 0x00000004, NULL, HFILL }},
8078
8079    { &hf_bit4pingflags2,
8080    { "Hardware Name", "ncp.bit4pingflags2", FT_BOOLEAN, 16, NULL, 0x00000008, NULL, HFILL }},
8081
8082    { &hf_bit5pingflags2,
8083    { "Vendor Name", "ncp.bit5pingflags2", FT_BOOLEAN, 16, NULL, 0x00000010, NULL, HFILL }},
8084
8085    { &hf_bit6pingflags2,
8086    { "Not Defined", "ncp.bit6pingflags2", FT_BOOLEAN, 16, NULL, 0x00000020, NULL, HFILL }},
8087
8088    { &hf_bit7pingflags2,
8089    { "Not Defined", "ncp.bit7pingflags2", FT_BOOLEAN, 16, NULL, 0x00000040, NULL, HFILL }},
8090
8091    { &hf_bit8pingflags2,
8092    { "Not Defined", "ncp.bit8pingflags2", FT_BOOLEAN, 16, NULL, 0x00000080, NULL, HFILL }},
8093
8094    { &hf_bit9pingflags2,
8095    { "Not Defined", "ncp.bit9pingflags2", FT_BOOLEAN, 16, NULL, 0x00000100, NULL, HFILL }},
8096
8097    { &hf_bit10pingflags2,
8098    { "Not Defined", "ncp.bit10pingflags2", FT_BOOLEAN, 16, NULL, 0x00000200, NULL, HFILL }},
8099
8100    { &hf_bit11pingflags2,
8101    { "Not Defined", "ncp.bit11pingflags2", FT_BOOLEAN, 16, NULL, 0x00000400, NULL, HFILL }},
8102
8103    { &hf_bit12pingflags2,
8104    { "Not Defined", "ncp.bit12pingflags2", FT_BOOLEAN, 16, NULL, 0x00000800, NULL, HFILL }},
8105
8106    { &hf_bit13pingflags2,
8107    { "Not Defined", "ncp.bit13pingflags2", FT_BOOLEAN, 16, NULL, 0x00001000, NULL, HFILL }},
8108
8109    { &hf_bit14pingflags2,
8110    { "Not Defined", "ncp.bit14pingflags2", FT_BOOLEAN, 16, NULL, 0x00002000, NULL, HFILL }},
8111
8112    { &hf_bit15pingflags2,
8113    { "Not Defined", "ncp.bit15pingflags2", FT_BOOLEAN, 16, NULL, 0x00004000, NULL, HFILL }},
8114
8115    { &hf_bit16pingflags2,
8116    { "Not Defined", "ncp.bit16pingflags2", FT_BOOLEAN, 16, NULL, 0x00008000, NULL, HFILL }},
8117
8118    { &hf_pingpflags1,
8119    { "Ping Data Flags", "ncp.pingpflags1", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
8120
8121    { &hf_bit1pingpflags1,
8122    { "Root Most Master Replica", "ncp.bit1pingpflags1", FT_BOOLEAN, 16, NULL, 0x00000001, NULL, HFILL }},
8123
8124    { &hf_bit2pingpflags1,
8125    { "Is Time Synchronized?", "ncp.bit2pingpflags1", FT_BOOLEAN, 16, NULL, 0x00000002, NULL, HFILL }},
8126
8127    { &hf_bit3pingpflags1,
8128    { "Is Time Valid?", "ncp.bit3pingpflags1", FT_BOOLEAN, 16, NULL, 0x00000004, NULL, HFILL }},
8129
8130    { &hf_bit4pingpflags1,
8131    { "Is DS Time Synchronized?", "ncp.bit4pingpflags1", FT_BOOLEAN, 16, NULL, 0x00000008, NULL, HFILL }},
8132
8133    { &hf_bit5pingpflags1,
8134    { "Does Agent Have All Replicas?", "ncp.bit5pingpflags1", FT_BOOLEAN, 16, NULL, 0x00000010, NULL, HFILL }},
8135
8136    { &hf_bit6pingpflags1,
8137    { "Not Defined", "ncp.bit6pingpflags1", FT_BOOLEAN, 16, NULL, 0x00000020, NULL, HFILL }},
8138
8139    { &hf_bit7pingpflags1,
8140    { "Not Defined", "ncp.bit7pingpflags1", FT_BOOLEAN, 16, NULL, 0x00000040, NULL, HFILL }},
8141
8142    { &hf_bit8pingpflags1,
8143    { "Not Defined", "ncp.bit8pingpflags1", FT_BOOLEAN, 16, NULL, 0x00000080, NULL, HFILL }},
8144
8145    { &hf_bit9pingpflags1,
8146    { "Not Defined", "ncp.bit9pingpflags1", FT_BOOLEAN, 16, NULL, 0x00000100, NULL, HFILL }},
8147
8148    { &hf_bit10pingpflags1,
8149    { "Not Defined", "ncp.bit10pingpflags1", FT_BOOLEAN, 16, NULL, 0x00000200, NULL, HFILL }},
8150
8151    { &hf_bit11pingpflags1,
8152    { "Not Defined", "ncp.bit11pingpflags1", FT_BOOLEAN, 16, NULL, 0x00000400, NULL, HFILL }},
8153
8154    { &hf_bit12pingpflags1,
8155    { "Not Defined", "ncp.bit12pingpflags1", FT_BOOLEAN, 16, NULL, 0x00000800, NULL, HFILL }},
8156
8157    { &hf_bit13pingpflags1,
8158    { "Not Defined", "ncp.bit13pingpflags1", FT_BOOLEAN, 16, NULL, 0x00001000, NULL, HFILL }},
8159
8160    { &hf_bit14pingpflags1,
8161    { "Not Defined", "ncp.bit14pingpflags1", FT_BOOLEAN, 16, NULL, 0x00002000, NULL, HFILL }},
8162
8163    { &hf_bit15pingpflags1,
8164    { "Not Defined", "ncp.bit15pingpflags1", FT_BOOLEAN, 16, NULL, 0x00004000, NULL, HFILL }},
8165
8166    { &hf_bit16pingpflags1,
8167    { "Not Defined", "ncp.bit16pingpflags1", FT_BOOLEAN, 16, NULL, 0x00008000, NULL, HFILL }},
8168
8169    { &hf_pingvflags1,
8170    { "Verification Flags", "ncp.pingvflags1", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
8171
8172    { &hf_bit1pingvflags1,
8173    { "Checksum", "ncp.bit1pingvflags1", FT_BOOLEAN, 16, NULL, 0x00000001, NULL, HFILL }},
8174
8175    { &hf_bit2pingvflags1,
8176    { "CRC32", "ncp.bit2pingvflags1", FT_BOOLEAN, 16, NULL, 0x00000002, NULL, HFILL }},
8177
8178    { &hf_bit3pingvflags1,
8179    { "Not Defined", "ncp.bit3pingvflags1", FT_BOOLEAN, 16, NULL, 0x00000004, NULL, HFILL }},
8180
8181    { &hf_bit4pingvflags1,
8182    { "Not Defined", "ncp.bit4pingvflags1", FT_BOOLEAN, 16, NULL, 0x00000008, NULL, HFILL }},
8183
8184    { &hf_bit5pingvflags1,
8185    { "Not Defined", "ncp.bit5pingvflags1", FT_BOOLEAN, 16, NULL, 0x00000010, NULL, HFILL }},
8186
8187    { &hf_bit6pingvflags1,
8188    { "Not Defined", "ncp.bit6pingvflags1", FT_BOOLEAN, 16, NULL, 0x00000020, NULL, HFILL }},
8189
8190    { &hf_bit7pingvflags1,
8191    { "Not Defined", "ncp.bit7pingvflags1", FT_BOOLEAN, 16, NULL, 0x00000040, NULL, HFILL }},
8192
8193    { &hf_bit8pingvflags1,
8194    { "Not Defined", "ncp.bit8pingvflags1", FT_BOOLEAN, 16, NULL, 0x00000080, NULL, HFILL }},
8195
8196    { &hf_bit9pingvflags1,
8197    { "Not Defined", "ncp.bit9pingvflags1", FT_BOOLEAN, 16, NULL, 0x00000100, NULL, HFILL }},
8198
8199    { &hf_bit10pingvflags1,
8200    { "Not Defined", "ncp.bit10pingvflags1", FT_BOOLEAN, 16, NULL, 0x00000200, NULL, HFILL }},
8201
8202    { &hf_bit11pingvflags1,
8203    { "Not Defined", "ncp.bit11pingvflags1", FT_BOOLEAN, 16, NULL, 0x00000400, NULL, HFILL }},
8204
8205    { &hf_bit12pingvflags1,
8206    { "Not Defined", "ncp.bit12pingvflags1", FT_BOOLEAN, 16, NULL, 0x00000800, NULL, HFILL }},
8207
8208    { &hf_bit13pingvflags1,
8209    { "Not Defined", "ncp.bit13pingvflags1", FT_BOOLEAN, 16, NULL, 0x00001000, NULL, HFILL }},
8210
8211    { &hf_bit14pingvflags1,
8212    { "Not Defined", "ncp.bit14pingvflags1", FT_BOOLEAN, 16, NULL, 0x00002000, NULL, HFILL }},
8213
8214    { &hf_bit15pingvflags1,
8215    { "Not Defined", "ncp.bit15pingvflags1", FT_BOOLEAN, 16, NULL, 0x00004000, NULL, HFILL }},
8216
8217    { &hf_bit16pingvflags1,
8218    { "Not Defined", "ncp.bit16pingvflags1", FT_BOOLEAN, 16, NULL, 0x00008000, NULL, HFILL }},
8219
8220    { &hf_nds_letter_ver,
8221    { "Letter Version", "ncp.nds_letter_ver", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
8222
8223    { &hf_nds_os_majver,
8224    { "OS Major Version", "ncp.nds_os_majver", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
8225
8226    { &hf_nds_os_minver,
8227    { "OS Minor Version", "ncp.nds_os_minver", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
8228
8229    { &hf_nds_lic_flags,
8230    { "License Flags", "ncp.nds_lic_flags", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
8231
8232    { &hf_nds_ds_time,
8233    { "DS Time", "ncp.nds_ds_time", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL }},
8234
8235    { &hf_nds_svr_time,
8236    { "Server Time", "ncp.nds_svr_time", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL }},
8237
8238    { &hf_nds_crt_time,
8239    { "Agent Create Time", "ncp.nds_crt_time", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL }},
8240
8241    { &hf_nds_ping_version,
8242    { "Ping Version", "ncp.nds_ping_version", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
8243
8244    { &hf_nds_search_scope,
8245    { "Search Scope", "ncp.nds_search_scope", FT_UINT32, BASE_DEC|BASE_RANGE_STRING, RVALS(nds_search_scope), 0x0, NULL, HFILL }},
8246
8247    { &hf_nds_num_objects,
8248    { "Number of Objects to Search", "ncp.nds_num_objects", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
8249
8250    { &hf_siflags,
8251    { "Information Types", "ncp.siflags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
8252
8253    { &hf_bit1siflags,
8254    { "Names", "ncp.bit1siflags", FT_BOOLEAN, 16, NULL, 0x00000001, NULL, HFILL }},
8255
8256    { &hf_bit2siflags,
8257    { "Names and Values", "ncp.bit2siflags", FT_BOOLEAN, 16, NULL, 0x00000002, NULL, HFILL }},
8258
8259    { &hf_bit3siflags,
8260    { "Effective Privileges", "ncp.bit3siflags", FT_BOOLEAN, 16, NULL, 0x00000004, NULL, HFILL }},
8261
8262    { &hf_bit4siflags,
8263    { "Value Info", "ncp.bit4siflags", FT_BOOLEAN, 16, NULL, 0x00000008, NULL, HFILL }},
8264
8265    { &hf_bit5siflags,
8266    { "Abbreviated Value", "ncp.bit5siflags", FT_BOOLEAN, 16, NULL, 0x00000010, NULL, HFILL }},
8267
8268    { &hf_bit6siflags,
8269    { "Not Defined", "ncp.bit6siflags", FT_BOOLEAN, 16, NULL, 0x00000020, NULL, HFILL }},
8270
8271    { &hf_bit7siflags,
8272    { "Not Defined", "ncp.bit7siflags", FT_BOOLEAN, 16, NULL, 0x00000040, NULL, HFILL }},
8273
8274    { &hf_bit8siflags,
8275    { "Not Defined", "ncp.bit8siflags", FT_BOOLEAN, 16, NULL, 0x00000080, NULL, HFILL }},
8276
8277    { &hf_bit9siflags,
8278    { "Expanded Class", "ncp.bit9siflags", FT_BOOLEAN, 16, NULL, 0x00000100, NULL, HFILL }},
8279
8280    { &hf_bit10siflags,
8281    { "Not Defined", "ncp.bit10siflags", FT_BOOLEAN, 16, NULL, 0x00000200, NULL, HFILL }},
8282
8283    { &hf_bit11siflags,
8284    { "Not Defined", "ncp.bit11siflags", FT_BOOLEAN, 16, NULL, 0x00000400, NULL, HFILL }},
8285
8286    { &hf_bit12siflags,
8287    { "Not Defined", "ncp.bit12siflags", FT_BOOLEAN, 16, NULL, 0x00000800, NULL, HFILL }},
8288
8289    { &hf_bit13siflags,
8290    { "Not Defined", "ncp.bit13siflags", FT_BOOLEAN, 16, NULL, 0x00001000, NULL, HFILL }},
8291
8292    { &hf_bit14siflags,
8293    { "Not Defined", "ncp.bit14siflags", FT_BOOLEAN, 16, NULL, 0x00002000, NULL, HFILL }},
8294
8295    { &hf_bit15siflags,
8296    { "Not Defined", "ncp.bit15siflags", FT_BOOLEAN, 16, NULL, 0x00004000, NULL, HFILL }},
8297
8298    { &hf_bit16siflags,
8299    { "Not Defined", "ncp.bit16siflags", FT_BOOLEAN, 16, NULL, 0x00008000, NULL, HFILL }},
8300
8301    { &hf_nds_segment_overlap,
8302    { "Segment overlap", "nds.segment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Segment overlaps with other segments", HFILL }},
8303
8304    { &hf_nds_segment_overlap_conflict,
8305    { "Conflicting data in segment overlap", "nds.segment.overlap.conflict", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Overlapping segments contained conflicting data", HFILL }},
8306
8307    { &hf_nds_segment_multiple_tails,
8308    { "Multiple tail segments found", "nds.segment.multipletails", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Several tails were found when desegmenting the packet", HFILL }},
8309
8310    { &hf_nds_segment_too_long_segment,
8311    { "Segment too long", "nds.segment.toolongsegment", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Segment contained data past end of packet", HFILL }},
8312
8313    { &hf_nds_segment_error,
8314    { "Desegmentation error", "nds.segment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "Desegmentation error due to illegal segments", HFILL }},
8315
8316    { &hf_nds_segment_count,
8317    { "Segment count", "nds.segment.count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
8318
8319    { &hf_nds_reassembled_length,
8320    { "Reassembled NDS length", "nds.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x0, "The total length of the reassembled payload", HFILL }},
8321
8322    { &hf_nds_segment,
8323    { "NDS Fragment", "nds.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "NDPS Fragment", HFILL }},
8324
8325    { &hf_nds_segments,
8326    { "NDS Fragments", "nds.fragments", FT_NONE, BASE_NONE, NULL, 0x0, "NDPS Fragments", HFILL }},
8327
8328    { &hf_nds_verb2b_req_flags,
8329    { "Flags", "ncp.nds_verb2b_flags", FT_UINT32, BASE_HEX, VALS(nds_verb2b_flag_vals), 0x0, NULL, HFILL }},
8330
8331    { &hf_ncp_ip_address,
8332    { "IP Address", "ncp.ip_addr", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }},
8333
8334    { &hf_ncp_copyright,
8335    { "Copyright", "ncp.copyright", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
8336
8337    { &hf_ndsprot1flag,
8338    { "Not Defined", "ncp.nds_prot_bit1", FT_BOOLEAN, 16, NULL, 0x00000001, NULL, HFILL }},
8339
8340    { &hf_ndsprot2flag,
8341    { "Not Defined", "ncp.nds_prot_bit2", FT_BOOLEAN, 16, NULL, 0x00000002, NULL, HFILL }},
8342
8343    { &hf_ndsprot3flag,
8344    { "Not Defined", "ncp.nds_prot_bit3", FT_BOOLEAN, 16, NULL, 0x00000004, NULL, HFILL }},
8345
8346    { &hf_ndsprot4flag,
8347    { "Not Defined", "ncp.nds_prot_bit4", FT_BOOLEAN, 16, NULL, 0x00000008, NULL, HFILL }},
8348
8349    { &hf_ndsprot5flag,
8350    { "Not Defined", "ncp.nds_prot_bit5", FT_BOOLEAN, 16, NULL, 0x00000010, NULL, HFILL }},
8351
8352    { &hf_ndsprot6flag,
8353    { "Not Defined", "ncp.nds_prot_bit6", FT_BOOLEAN, 16, NULL, 0x00000020, NULL, HFILL }},
8354
8355    { &hf_ndsprot7flag,
8356    { "Not Defined", "ncp.nds_prot_bit7", FT_BOOLEAN, 16, NULL, 0x00000040, NULL, HFILL }},
8357
8358    { &hf_ndsprot8flag,
8359    { "Not Defined", "ncp.nds_prot_bit8", FT_BOOLEAN, 16, NULL, 0x00000080, NULL, HFILL }},
8360
8361    { &hf_ndsprot9flag,
8362    { "Not Defined", "ncp.nds_prot_bit9", FT_BOOLEAN, 16, NULL, 0x00000100, NULL, HFILL }},
8363
8364    { &hf_ndsprot10flag,
8365    { "Not Defined", "ncp.nds_prot_bit10", FT_BOOLEAN, 16, NULL, 0x00000200, NULL, HFILL }},
8366
8367    { &hf_ndsprot11flag,
8368    { "Not Defined", "ncp.nds_prot_bit11", FT_BOOLEAN, 16, NULL, 0x00000400, NULL, HFILL }},
8369
8370    { &hf_ndsprot12flag,
8371    { "Not Defined", "ncp.nds_prot_bit12", FT_BOOLEAN, 16, NULL, 0x00000800, NULL, HFILL }},
8372
8373    { &hf_ndsprot13flag,
8374    { "Not Defined", "ncp.nds_prot_bit13", FT_BOOLEAN, 16, NULL, 0x00001000, NULL, HFILL }},
8375
8376    { &hf_ndsprot14flag,
8377    { "Not Defined", "ncp.nds_prot_bit14", FT_BOOLEAN, 16, NULL, 0x00002000, NULL, HFILL }},
8378
8379    { &hf_ndsprot15flag,
8380    { "Include CRC in NDS Header", "ncp.nds_prot_bit15", FT_BOOLEAN, 16, NULL, 0x00004000, NULL, HFILL }},
8381
8382    { &hf_ndsprot16flag,
8383    { "Client is a Server", "ncp.nds_prot_bit16", FT_BOOLEAN, 16, NULL, 0x00008000, NULL, HFILL }},
8384
8385    { &hf_nds_svr_dst_name,
8386    { "Server Distinguished Name", "ncp.nds_svr_dist_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
8387
8388    { &hf_nds_tune_mark,
8389    { "Tune Mark",  "ncp.ndstunemark", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
8390
8391#if 0 /* Unused ? */
8392    { &hf_nds_create_time,
8393    { "NDS Creation Time",  "ncp.ndscreatetime", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL }},
8394#endif
8395
8396    { &hf_srvr_param_string,
8397    { "Set Parameter Value", "ncp.srvr_param_string", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
8398
8399    { &hf_srvr_param_number,
8400    { "Set Parameter Value", "ncp.srvr_param_number", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
8401
8402    { &hf_srvr_param_boolean,
8403    { "Set Parameter Value", "ncp.srvr_param_boolean", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL }},
8404
8405    { &hf_nds_number_of_items,
8406    { "Number of Items", "ncp.ndsitems", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
8407
8408    { &hf_ncp_nds_iterverb,
8409    { "NDS Iteration Verb", "ncp.ndsiterverb", FT_UINT32, BASE_DEC_HEX, VALS(iterator_subverbs), 0x0, NULL, HFILL }},
8410
8411    { &hf_iter_completion_code,
8412    { "Iteration Completion Code", "ncp.iter_completion_code", FT_UINT32, BASE_HEX, VALS(nds_reply_errors), 0x0, NULL, HFILL }},
8413
8414#if 0 /* Unused ? */
8415    { &hf_nds_iterobj,
8416    { "Iterator Object", "ncp.ndsiterobj", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
8417#endif
8418
8419    { &hf_iter_verb_completion_code,
8420    { "Completion Code", "ncp.iter_verb_completion_code", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
8421
8422    { &hf_iter_ans,
8423    { "Iterator Answer", "ncp.iter_answer", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL }},
8424
8425    { &hf_positionable,
8426    { "Positionable", "ncp.iterpositionable", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL }},
8427
8428    { &hf_num_skipped,
8429    { "Number Skipped", "ncp.iternumskipped", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
8430
8431    { &hf_num_to_skip,
8432    { "Number to Skip", "ncp.iternumtoskip", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
8433
8434    { &hf_timelimit,
8435    { "Time Limit", "ncp.itertimelimit", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
8436
8437    { &hf_iter_index,
8438    { "Iterator Index", "ncp.iterindex", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
8439
8440    { &hf_num_to_get,
8441    { "Number to Get", "ncp.iternumtoget", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
8442
8443#if 0 /* Unused ? */
8444    { &hf_ret_info_type,
8445    { "Return Information Type", "ncp.iterretinfotype", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
8446#endif
8447
8448    { &hf_data_size,
8449    { "Data Size", "ncp.iterdatasize", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
8450
8451    { &hf_this_count,
8452    { "Number of Items", "ncp.itercount", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
8453
8454    { &hf_max_entries,
8455    { "Maximum Entries", "ncp.itermaxentries", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
8456
8457    { &hf_move_position,
8458    { "Move Position", "ncp.itermoveposition", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
8459
8460    { &hf_iter_copy,
8461    { "Iterator Copy", "ncp.itercopy", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
8462
8463    { &hf_iter_position,
8464    { "Iteration Position", "ncp.iterposition", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
8465
8466    { &hf_iter_search,
8467    { "Search Filter", "ncp.iter_search", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
8468
8469    { &hf_iter_other,
8470    { "Other Iteration", "ncp.iterother", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
8471
8472    { &hf_nds_oid,
8473    { "Object ID", "ncp.nds_oid", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
8474
8475    { &hf_ncp_bytes_actually_trans_64,
8476    { "Bytes Actually Transferred", "ncp.bytes_actually_trans_64", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }},
8477
8478    { &hf_sap_name,
8479    { "SAP Name", "ncp.sap_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
8480
8481    { &hf_os_name,
8482    { "OS Name", "ncp.os_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
8483
8484    { &hf_vendor_name,
8485    { "Vendor Name", "ncp.vendor_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
8486
8487    { &hf_hardware_name,
8488    { "Hardware Name", "ncp.harware_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
8489
8490    { &hf_no_request_record_found,
8491    { "No request record found. Parsing is impossible.", "ncp.no_request_record_found", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
8492
8493    { &hf_search_modifier,
8494    { "Search Modifier", "ncp.search_modifier", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
8495
8496    { &hf_search_pattern,
8497    { "Search Pattern", "ncp.search_pattern", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
8498
8499    { &hf_nds_acl_protected_attribute,
8500    { "Protected Attribute", "ncp.nds_acl_protected_attribute", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
8501
8502    { &hf_nds_acl_subject,
8503    { "Subject", "ncp.nds_acl_subject", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
8504
8505    { &hf_nds_acl_privileges,
8506    { "Subject", "ncp.nds_acl_privileges", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
8507
8508""")
8509    # Print the registration code for the hf variables
8510    for var in sorted_vars:
8511        print("    { &%s," % (var.HFName()))
8512        print("    { \"%s\", \"%s\", %s, %s, %s, 0x%x, NULL, HFILL }},\n" % \
8513                (var.Description(), var.DFilter(),
8514                var.WiresharkFType(), var.Display(), var.ValuesName(),
8515                var.Mask()))
8516
8517    print("    };\n")
8518
8519    if ett_list:
8520        print("    static gint *ett[] = {")
8521
8522        for ett in ett_list:
8523            print("        &%s," % (ett,))
8524
8525        print("    };\n")
8526
8527    print("""
8528    static ei_register_info ei[] = {
8529        { &ei_ncp_file_handle, { "ncp.file_handle.expert", PI_REQUEST_CODE, PI_CHAT, "Close file handle", EXPFILL }},
8530        { &ei_ncp_file_rights, { "ncp.file_rights", PI_REQUEST_CODE, PI_CHAT, "File rights", EXPFILL }},
8531        { &ei_ncp_op_lock_handle, { "ncp.op_lock_handle", PI_REQUEST_CODE, PI_CHAT, "Op-lock on handle", EXPFILL }},
8532        { &ei_ncp_file_rights_change, { "ncp.file_rights.change", PI_REQUEST_CODE, PI_CHAT, "Change handle rights", EXPFILL }},
8533        { &ei_ncp_effective_rights, { "ncp.effective_rights.expert", PI_RESPONSE_CODE, PI_CHAT, "Handle effective rights", EXPFILL }},
8534        { &ei_ncp_server, { "ncp.server", PI_RESPONSE_CODE, PI_CHAT, "Server info", EXPFILL }},
8535        { &ei_iter_verb_completion_code, { "ncp.iter_verb_completion_code.expert", PI_RESPONSE_CODE, PI_ERROR, "Iteration Verb Error", EXPFILL }},
8536        { &ei_ncp_connection_request, { "ncp.connection_request", PI_RESPONSE_CODE, PI_CHAT, "Connection Request", EXPFILL }},
8537        { &ei_ncp_destroy_connection, { "ncp.destroy_connection", PI_RESPONSE_CODE, PI_CHAT, "Destroy Connection Request", EXPFILL }},
8538        { &ei_nds_reply_error, { "ncp.ndsreplyerror.expert", PI_RESPONSE_CODE, PI_ERROR, "NDS Error", EXPFILL }},
8539        { &ei_nds_iteration, { "ncp.nds_iteration.error", PI_RESPONSE_CODE, PI_ERROR, "NDS Iteration Error", EXPFILL }},
8540        { &ei_ncp_eid, { "ncp.eid", PI_RESPONSE_CODE, PI_CHAT, "EID", EXPFILL }},
8541        { &ei_ncp_completion_code, { "ncp.completion_code.expert", PI_RESPONSE_CODE, PI_ERROR, "Code Completion Error", EXPFILL }},
8542        { &ei_ncp_connection_status, { "ncp.connection_status.bad", PI_RESPONSE_CODE, PI_ERROR, "Error: Bad Connection Status", EXPFILL }},
8543        { &ei_ncp_connection_destroyed, { "ncp.connection_destroyed", PI_RESPONSE_CODE, PI_CHAT, "Connection Destroyed", EXPFILL }},
8544        { &ei_ncp_no_request_record_found, { "ncp.no_request_record_found", PI_SEQUENCE, PI_NOTE, "No request record found.", EXPFILL }},
8545        { &ei_ncp_invalid_offset, { "ncp.invalid_offset", PI_MALFORMED, PI_ERROR, "Invalid offset", EXPFILL }},
8546        { &ei_ncp_address_type, { "ncp.address_type.unknown", PI_PROTOCOL, PI_WARN, "Unknown Address Type", EXPFILL }},
8547    };
8548
8549    expert_module_t* expert_ncp;
8550
8551    proto_register_field_array(proto_ncp, hf, array_length(hf));""")
8552
8553    if ett_list:
8554        print("""
8555    proto_register_subtree_array(ett, array_length(ett));""")
8556
8557    print("""
8558    expert_ncp = expert_register_protocol(proto_ncp);
8559    expert_register_field_array(expert_ncp, ei, array_length(ei));
8560    register_init_routine(&ncp_init_protocol);
8561    /* fragment */
8562    reassembly_table_register(&nds_reassembly_table,
8563                          &addresses_reassembly_table_functions);
8564
8565    ncp_req_hash = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), ncp_hash, ncp_equal);
8566    ncp_req_eid_hash = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), ncp_eid_hash, ncp_eid_equal);
8567
8568    """)
8569
8570    # End of proto_register_ncp2222()
8571    print("}")
8572
8573def usage():
8574    print("Usage: ncp2222.py -o output_file")
8575    sys.exit(1)
8576
8577def main():
8578    global compcode_lists
8579    global ptvc_lists
8580    global msg
8581
8582    optstring = "o:"
8583    out_filename = None
8584
8585    try:
8586        opts, args = getopt.getopt(sys.argv[1:], optstring)
8587    except getopt.error:
8588        usage()
8589
8590    for opt, arg in opts:
8591        if opt == "-o":
8592            out_filename = arg
8593        else:
8594            usage()
8595
8596    if len(args) != 0:
8597        usage()
8598
8599    if not out_filename:
8600        usage()
8601
8602    # Create the output file
8603    try:
8604        out_file = open(out_filename, "w")
8605    except IOError:
8606        sys.exit("Could not open %s for writing: %s" % (out_filename,
8607                IOError))
8608
8609    # Set msg to current stdout
8610    msg = sys.stdout
8611
8612    # Set stdout to the output file
8613    sys.stdout = out_file
8614
8615    msg.write("Processing NCP definitions...\n")
8616    # Run the code, and if we catch any exception,
8617    # erase the output file.
8618    try:
8619        compcode_lists  = UniqueCollection('Completion Code Lists')
8620        ptvc_lists      = UniqueCollection('PTVC Lists')
8621
8622        define_errors()
8623        define_groups()
8624
8625        define_ncp2222()
8626
8627        msg.write("Defined %d NCP types.\n" % (len(packets),))
8628        produce_code()
8629    except Exception:
8630        traceback.print_exc(20, msg)
8631        try:
8632            out_file.close()
8633        except IOError:
8634            msg.write("Could not close %s: %s\n" % (out_filename, IOError))
8635
8636        try:
8637            if os.path.exists(out_filename):
8638                os.remove(out_filename)
8639        except OSError:
8640            msg.write("Could not remove %s: %s\n" % (out_filename, OSError))
8641
8642        sys.exit(1)
8643
8644
8645
8646def define_ncp2222():
8647    ##############################################################################
8648    # NCP Packets. Here I list functions and subfunctions in hexadecimal like the
8649    # NCP book (and I believe LanAlyzer does this too).
8650    # However, Novell lists these in decimal in their on-line documentation.
8651    ##############################################################################
8652    # 2222/01
8653    pkt = NCP(0x01, "File Set Lock", 'sync')
8654    pkt.Request(7)
8655    pkt.Reply(8)
8656    pkt.CompletionCodes([0x0000])
8657    # 2222/02
8658    pkt = NCP(0x02, "File Release Lock", 'sync')
8659    pkt.Request(7)
8660    pkt.Reply(8)
8661    pkt.CompletionCodes([0x0000, 0xff00])
8662    # 2222/03
8663    pkt = NCP(0x03, "Log File Exclusive", 'sync')
8664    pkt.Request( (12, 267), [
8665            rec( 7, 1, DirHandle ),
8666            rec( 8, 1, LockFlag ),
8667            rec( 9, 2, TimeoutLimit, ENC_BIG_ENDIAN ),
8668            rec( 11, (1, 256), FilePath ),
8669    ])
8670    pkt.Reply(8)
8671    pkt.CompletionCodes([0x0000, 0x8200, 0x9600, 0xfe0d, 0xff01])
8672    # 2222/04
8673    pkt = NCP(0x04, "Lock File Set", 'sync')
8674    pkt.Request( 9, [
8675            rec( 7, 2, TimeoutLimit ),
8676    ])
8677    pkt.Reply(8)
8678    pkt.CompletionCodes([0x0000, 0xfe0d, 0xff01])
8679    ## 2222/05
8680    pkt = NCP(0x05, "Release File", 'sync')
8681    pkt.Request( (9, 264), [
8682            rec( 7, 1, DirHandle ),
8683            rec( 8, (1, 256), FilePath ),
8684    ])
8685    pkt.Reply(8)
8686    pkt.CompletionCodes([0x0000, 0x9b00, 0x9c03, 0xff1a])
8687    # 2222/06
8688    pkt = NCP(0x06, "Release File Set", 'sync')
8689    pkt.Request( 8, [
8690            rec( 7, 1, LockFlag ),
8691    ])
8692    pkt.Reply(8)
8693    pkt.CompletionCodes([0x0000])
8694    # 2222/07
8695    pkt = NCP(0x07, "Clear File", 'sync')
8696    pkt.Request( (9, 264), [
8697            rec( 7, 1, DirHandle ),
8698            rec( 8, (1, 256), FilePath ),
8699    ])
8700    pkt.Reply(8)
8701    pkt.CompletionCodes([0x0000, 0x9600, 0x9804, 0x9b03, 0x9c03,
8702            0xa100, 0xfd00, 0xff1a])
8703    # 2222/08
8704    pkt = NCP(0x08, "Clear File Set", 'sync')
8705    pkt.Request( 8, [
8706            rec( 7, 1, LockFlag ),
8707    ])
8708    pkt.Reply(8)
8709    pkt.CompletionCodes([0x0000])
8710    # 2222/09
8711    pkt = NCP(0x09, "Log Logical Record", 'sync')
8712    pkt.Request( (11, 138), [
8713            rec( 7, 1, LockFlag ),
8714            rec( 8, 2, TimeoutLimit, ENC_BIG_ENDIAN ),
8715            rec( 10, (1, 128), LogicalRecordName, info_str=(LogicalRecordName, "Log Logical Record: %s", ", %s")),
8716    ])
8717    pkt.Reply(8)
8718    pkt.CompletionCodes([0x0000, 0x9600, 0xfe0d, 0xff1a])
8719    # 2222/0A, 10
8720    pkt = NCP(0x0A, "Lock Logical Record Set", 'sync')
8721    pkt.Request( 10, [
8722            rec( 7, 1, LockFlag ),
8723            rec( 8, 2, TimeoutLimit ),
8724    ])
8725    pkt.Reply(8)
8726    pkt.CompletionCodes([0x0000, 0xfe0d, 0xff1a])
8727    # 2222/0B, 11
8728    pkt = NCP(0x0B, "Clear Logical Record", 'sync')
8729    pkt.Request( (8, 135), [
8730            rec( 7, (1, 128), LogicalRecordName, info_str=(LogicalRecordName, "Clear Logical Record: %s", ", %s") ),
8731    ])
8732    pkt.Reply(8)
8733    pkt.CompletionCodes([0x0000, 0xff1a])
8734    # 2222/0C, 12
8735    pkt = NCP(0x0C, "Release Logical Record", 'sync')
8736    pkt.Request( (8, 135), [
8737            rec( 7, (1, 128), LogicalRecordName, info_str=(LogicalRecordName, "Release Logical Record: %s", ", %s") ),
8738    ])
8739    pkt.Reply(8)
8740    pkt.CompletionCodes([0x0000, 0xff1a])
8741    # 2222/0D, 13
8742    pkt = NCP(0x0D, "Release Logical Record Set", 'sync')
8743    pkt.Request( 8, [
8744            rec( 7, 1, LockFlag ),
8745    ])
8746    pkt.Reply(8)
8747    pkt.CompletionCodes([0x0000])
8748    # 2222/0E, 14
8749    pkt = NCP(0x0E, "Clear Logical Record Set", 'sync')
8750    pkt.Request( 8, [
8751            rec( 7, 1, LockFlag ),
8752    ])
8753    pkt.Reply(8)
8754    pkt.CompletionCodes([0x0000])
8755    # 2222/1100, 17/00
8756    pkt = NCP(0x1100, "Write to Spool File", 'print')
8757    pkt.Request( (11, 16), [
8758            rec( 10, ( 1, 6 ), Data, info_str=(Data, "Write to Spool File: %s", ", %s") ),
8759    ])
8760    pkt.Reply(8)
8761    pkt.CompletionCodes([0x0000, 0x0104, 0x8000, 0x8101, 0x8701, 0x8800,
8762                         0x8d00, 0x8e00, 0x8f00, 0x9001, 0x9400, 0x9500,
8763                         0x9600, 0x9804, 0x9900, 0xa100, 0xa201, 0xff19])
8764    # 2222/1101, 17/01
8765    pkt = NCP(0x1101, "Close Spool File", 'print')
8766    pkt.Request( 11, [
8767            rec( 10, 1, AbortQueueFlag ),
8768    ])
8769    pkt.Reply(8)
8770    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8701, 0x8800, 0x8d00,
8771                         0x8e00, 0x8f00, 0x9001, 0x9300, 0x9400, 0x9500,
8772                         0x9600, 0x9804, 0x9900, 0x9b03, 0x9c03, 0x9d00,
8773                         0xa100, 0xd000, 0xd100, 0xd202, 0xd300, 0xd400,
8774                         0xda01, 0xe800, 0xea00, 0xeb00, 0xec00, 0xfc06,
8775                         0xfd00, 0xfe07, 0xff06])
8776    # 2222/1102, 17/02
8777    pkt = NCP(0x1102, "Set Spool File Flags", 'print')
8778    pkt.Request( 30, [
8779            rec( 10, 1, PrintFlags ),
8780            rec( 11, 1, TabSize ),
8781            rec( 12, 1, TargetPrinter ),
8782            rec( 13, 1, Copies ),
8783            rec( 14, 1, FormType ),
8784            rec( 15, 1, Reserved ),
8785            rec( 16, 14, BannerName ),
8786    ])
8787    pkt.Reply(8)
8788    pkt.CompletionCodes([0x0000, 0x9600, 0xd202, 0xd300, 0xe800, 0xea00,
8789                         0xeb00, 0xec00, 0xfc06, 0xfe07, 0xff06])
8790
8791    # 2222/1103, 17/03
8792    pkt = NCP(0x1103, "Spool A Disk File", 'print')
8793    pkt.Request( (12, 23), [
8794            rec( 10, 1, DirHandle ),
8795            rec( 11, (1, 12), Data, info_str=(Data, "Spool a Disk File: %s", ", %s") ),
8796    ])
8797    pkt.Reply(8)
8798    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8701, 0x8800, 0x8d00,
8799                         0x8e00, 0x8f00, 0x9001, 0x9300, 0x9400, 0x9500,
8800                         0x9600, 0x9804, 0x9900, 0x9b03, 0x9c03, 0x9d00,
8801                         0xa100, 0xd000, 0xd100, 0xd202, 0xd300, 0xd400,
8802                         0xda01, 0xe800, 0xea00, 0xeb00, 0xec00, 0xfc06,
8803                         0xfd00, 0xfe07, 0xff06])
8804
8805    # 2222/1106, 17/06
8806    pkt = NCP(0x1106, "Get Printer Status", 'print')
8807    pkt.Request( 11, [
8808            rec( 10, 1, TargetPrinter ),
8809    ])
8810    pkt.Reply(12, [
8811            rec( 8, 1, PrinterHalted ),
8812            rec( 9, 1, PrinterOffLine ),
8813            rec( 10, 1, CurrentFormType ),
8814            rec( 11, 1, RedirectedPrinter ),
8815    ])
8816    pkt.CompletionCodes([0x0000, 0x9600, 0xfb05, 0xfd00, 0xff06])
8817
8818    # 2222/1109, 17/09
8819    pkt = NCP(0x1109, "Create Spool File", 'print')
8820    pkt.Request( (12, 23), [
8821            rec( 10, 1, DirHandle ),
8822            rec( 11, (1, 12), Data, info_str=(Data, "Create Spool File: %s", ", %s") ),
8823    ])
8824    pkt.Reply(8)
8825    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8400, 0x8701, 0x8d00,
8826                         0x8f00, 0x9001, 0x9400, 0x9600, 0x9804, 0x9900,
8827                         0x9b03, 0x9c03, 0xa100, 0xd000, 0xd100, 0xd202,
8828                         0xd300, 0xd400, 0xda01, 0xe800, 0xea00, 0xeb00,
8829                         0xec00, 0xfc06, 0xfd00, 0xfe07, 0xff06])
8830
8831    # 2222/110A, 17/10
8832    pkt = NCP(0x110A, "Get Printer's Queue", 'print')
8833    pkt.Request( 11, [
8834            rec( 10, 1, TargetPrinter ),
8835    ])
8836    pkt.Reply( 12, [
8837            rec( 8, 4, ObjectID, ENC_BIG_ENDIAN ),
8838    ])
8839    pkt.CompletionCodes([0x0000, 0x9600, 0xff06])
8840
8841    # 2222/12, 18
8842    pkt = NCP(0x12, "Get Volume Info with Number", 'file')
8843    pkt.Request( 8, [
8844            rec( 7, 1, VolumeNumber,info_str=(VolumeNumber, "Get Volume Information for Volume %d", ", %d") )
8845    ])
8846    pkt.Reply( 36, [
8847            rec( 8, 2, SectorsPerCluster, ENC_BIG_ENDIAN ),
8848            rec( 10, 2, TotalVolumeClusters, ENC_BIG_ENDIAN ),
8849            rec( 12, 2, AvailableClusters, ENC_BIG_ENDIAN ),
8850            rec( 14, 2, TotalDirectorySlots, ENC_BIG_ENDIAN ),
8851            rec( 16, 2, AvailableDirectorySlots, ENC_BIG_ENDIAN ),
8852            rec( 18, 16, VolumeName ),
8853            rec( 34, 2, RemovableFlag, ENC_BIG_ENDIAN ),
8854    ])
8855    pkt.CompletionCodes([0x0000, 0x9804])
8856
8857    # 2222/13, 19
8858    pkt = NCP(0x13, "Get Station Number", 'connection')
8859    pkt.Request(7)
8860    pkt.Reply(11, [
8861            rec( 8, 3, StationNumber )
8862    ])
8863    pkt.CompletionCodes([0x0000, 0xff00])
8864
8865    # 2222/14, 20
8866    pkt = NCP(0x14, "Get File Server Date And Time", 'fileserver')
8867    pkt.Request(7)
8868    pkt.Reply(15, [
8869            rec( 8, 1, Year ),
8870            rec( 9, 1, Month ),
8871            rec( 10, 1, Day ),
8872            rec( 11, 1, Hour ),
8873            rec( 12, 1, Minute ),
8874            rec( 13, 1, Second ),
8875            rec( 14, 1, DayOfWeek ),
8876    ])
8877    pkt.CompletionCodes([0x0000])
8878
8879    # 2222/1500, 21/00
8880    pkt = NCP(0x1500, "Send Broadcast Message", 'message')
8881    pkt.Request((13, 70), [
8882            rec( 10, 1, ClientListLen, var="x" ),
8883            rec( 11, 1, TargetClientList, repeat="x" ),
8884            rec( 12, (1, 58), TargetMessage, info_str=(TargetMessage, "Send Broadcast Message: %s", ", %s") ),
8885    ])
8886    pkt.Reply(10, [
8887            rec( 8, 1, ClientListLen, var="x" ),
8888            rec( 9, 1, SendStatus, repeat="x" )
8889    ])
8890    pkt.CompletionCodes([0x0000, 0xfd00])
8891
8892    # 2222/1501, 21/01
8893    pkt = NCP(0x1501, "Get Broadcast Message", 'message')
8894    pkt.Request(10)
8895    pkt.Reply((9,66), [
8896            rec( 8, (1, 58), TargetMessage )
8897    ])
8898    pkt.CompletionCodes([0x0000, 0xfd00])
8899
8900    # 2222/1502, 21/02
8901    pkt = NCP(0x1502, "Disable Broadcasts", 'message')
8902    pkt.Request(10)
8903    pkt.Reply(8)
8904    pkt.CompletionCodes([0x0000, 0xfb0a])
8905
8906    # 2222/1503, 21/03
8907    pkt = NCP(0x1503, "Enable Broadcasts", 'message')
8908    pkt.Request(10)
8909    pkt.Reply(8)
8910    pkt.CompletionCodes([0x0000])
8911
8912    # 2222/1509, 21/09
8913    pkt = NCP(0x1509, "Broadcast To Console", 'message')
8914    pkt.Request((11, 68), [
8915            rec( 10, (1, 58), TargetMessage, info_str=(TargetMessage, "Broadcast to Console: %s", ", %s") )
8916    ])
8917    pkt.Reply(8)
8918    pkt.CompletionCodes([0x0000])
8919
8920    # 2222/150A, 21/10
8921    pkt = NCP(0x150A, "Send Broadcast Message", 'message')
8922    pkt.Request((17, 74), [
8923            rec( 10, 2, ClientListCount, ENC_LITTLE_ENDIAN, var="x" ),
8924            rec( 12, 4, ClientList, ENC_LITTLE_ENDIAN, repeat="x" ),
8925            rec( 16, (1, 58), TargetMessage, info_str=(TargetMessage, "Send Broadcast Message: %s", ", %s") ),
8926    ])
8927    pkt.Reply(14, [
8928            rec( 8, 2, ClientListCount, ENC_LITTLE_ENDIAN, var="x" ),
8929            rec( 10, 4, ClientCompFlag, ENC_LITTLE_ENDIAN, repeat="x" ),
8930    ])
8931    pkt.CompletionCodes([0x0000, 0xfd00])
8932
8933    # 2222/150B, 21/11
8934    pkt = NCP(0x150B, "Get Broadcast Message", 'message')
8935    pkt.Request(10)
8936    pkt.Reply((9,66), [
8937            rec( 8, (1, 58), TargetMessage )
8938    ])
8939    pkt.CompletionCodes([0x0000, 0xfd00])
8940
8941    # 2222/150C, 21/12
8942    pkt = NCP(0x150C, "Connection Message Control", 'message')
8943    pkt.Request(22, [
8944            rec( 10, 1, ConnectionControlBits ),
8945            rec( 11, 3, Reserved3 ),
8946            rec( 14, 4, ConnectionListCount, ENC_LITTLE_ENDIAN, var="x" ),
8947            rec( 18, 4, ConnectionList, ENC_LITTLE_ENDIAN, repeat="x" ),
8948    ])
8949    pkt.Reply(8)
8950    pkt.CompletionCodes([0x0000, 0xff00])
8951
8952    # 2222/1600, 22/0
8953    pkt = NCP(0x1600, "Set Directory Handle", 'file')
8954    pkt.Request((13,267), [
8955            rec( 10, 1, TargetDirHandle ),
8956            rec( 11, 1, DirHandle ),
8957            rec( 12, (1, 255), Path, info_str=(Path, "Set Directory Handle to: %s", ", %s") ),
8958    ])
8959    pkt.Reply(8)
8960    pkt.CompletionCodes([0x0000, 0x9600, 0x9804, 0x9b03, 0x9c03, 0xa100, 0xfa00,
8961                         0xfd00, 0xff00])
8962
8963
8964    # 2222/1601, 22/1
8965    pkt = NCP(0x1601, "Get Directory Path", 'file')
8966    pkt.Request(11, [
8967            rec( 10, 1, DirHandle,info_str=(DirHandle, "Get Directory Path for Directory Handle %d", ", %d") ),
8968    ])
8969    pkt.Reply((9,263), [
8970            rec( 8, (1,255), Path ),
8971    ])
8972    pkt.CompletionCodes([0x0000, 0x9600, 0x9b00, 0x9c00, 0xa100])
8973
8974    # 2222/1602, 22/2
8975    pkt = NCP(0x1602, "Scan Directory Information", 'file')
8976    pkt.Request((14,268), [
8977            rec( 10, 1, DirHandle ),
8978            rec( 11, 2, StartingSearchNumber, ENC_BIG_ENDIAN ),
8979            rec( 13, (1, 255), Path, info_str=(Path, "Scan Directory Information: %s", ", %s") ),
8980    ])
8981    pkt.Reply(36, [
8982            rec( 8, 16, DirectoryPath ),
8983            rec( 24, 2, CreationDate, ENC_BIG_ENDIAN ),
8984            rec( 26, 2, CreationTime, ENC_BIG_ENDIAN ),
8985            rec( 28, 4, CreatorID, ENC_BIG_ENDIAN ),
8986            rec( 32, 1, AccessRightsMask ),
8987            rec( 33, 1, Reserved ),
8988            rec( 34, 2, NextSearchNumber, ENC_BIG_ENDIAN ),
8989    ])
8990    pkt.CompletionCodes([0x0000, 0x9600, 0x9804, 0x9b03, 0x9c03, 0xa100, 0xfa00,
8991                         0xfd00, 0xff00])
8992
8993    # 2222/1603, 22/3
8994    pkt = NCP(0x1603, "Get Effective Directory Rights", 'file')
8995    pkt.Request((12,266), [
8996            rec( 10, 1, DirHandle ),
8997            rec( 11, (1, 255), Path, info_str=(Path, "Get Effective Directory Rights: %s", ", %s") ),
8998    ])
8999    pkt.Reply(9, [
9000            rec( 8, 1, AccessRightsMask ),
9001    ])
9002    pkt.CompletionCodes([0x0000, 0x9600, 0x9804, 0x9b03, 0x9c03, 0xa100, 0xfa00,
9003                         0xfd00, 0xff00])
9004
9005    # 2222/1604, 22/4
9006    pkt = NCP(0x1604, "Modify Maximum Rights Mask", 'file')
9007    pkt.Request((14,268), [
9008            rec( 10, 1, DirHandle ),
9009            rec( 11, 1, RightsGrantMask ),
9010            rec( 12, 1, RightsRevokeMask ),
9011            rec( 13, (1, 255), Path, info_str=(Path, "Modify Maximum Rights Mask: %s", ", %s") ),
9012    ])
9013    pkt.Reply(8)
9014    pkt.CompletionCodes([0x0000, 0x8c00, 0x9600, 0x9804, 0x9b03, 0x9c03, 0xa100, 0xfa00,
9015                         0xfd00, 0xff00])
9016
9017    # 2222/1605, 22/5
9018    pkt = NCP(0x1605, "Get Volume Number", 'file')
9019    pkt.Request((11, 265), [
9020            rec( 10, (1,255), VolumeNameLen, info_str=(VolumeNameLen, "Get Volume Number for: %s", ", %s") ),
9021    ])
9022    pkt.Reply(9, [
9023            rec( 8, 1, VolumeNumber ),
9024    ])
9025    pkt.CompletionCodes([0x0000, 0x9600, 0x9804])
9026
9027    # 2222/1606, 22/6
9028    pkt = NCP(0x1606, "Get Volume Name", 'file')
9029    pkt.Request(11, [
9030            rec( 10, 1, VolumeNumber,info_str=(VolumeNumber, "Get Name for Volume %d", ", %d") ),
9031    ])
9032    pkt.Reply((9, 263), [
9033            rec( 8, (1,255), VolumeNameLen ),
9034    ])
9035    pkt.CompletionCodes([0x0000, 0x9600, 0x9804, 0xff00])
9036
9037    # 2222/160A, 22/10
9038    pkt = NCP(0x160A, "Create Directory", 'file')
9039    pkt.Request((13,267), [
9040            rec( 10, 1, DirHandle ),
9041            rec( 11, 1, AccessRightsMask ),
9042            rec( 12, (1, 255), Path, info_str=(Path, "Create Directory: %s", ", %s") ),
9043    ])
9044    pkt.Reply(8)
9045    pkt.CompletionCodes([0x0000, 0x8400, 0x9600, 0x9804, 0x9900, 0x9b03, 0x9c03,
9046                         0x9e00, 0xa100, 0xfd00, 0xff00])
9047
9048    # 2222/160B, 22/11
9049    pkt = NCP(0x160B, "Delete Directory", 'file')
9050    pkt.Request((13,267), [
9051            rec( 10, 1, DirHandle ),
9052            rec( 11, 1, Reserved ),
9053            rec( 12, (1, 255), Path, info_str=(Path, "Delete Directory: %s", ", %s") ),
9054    ])
9055    pkt.Reply(8)
9056    pkt.CompletionCodes([0x0000, 0x8a00, 0x9600, 0x9804, 0x9b03, 0x9c03,
9057                         0x9f00, 0xa000, 0xa100, 0xfd00, 0xff00])
9058
9059    # 2222/160C, 22/12
9060    pkt = NCP(0x160C, "Scan Directory for Trustees", 'file')
9061    pkt.Request((13,267), [
9062            rec( 10, 1, DirHandle ),
9063            rec( 11, 1, TrusteeSetNumber ),
9064            rec( 12, (1, 255), Path, info_str=(Path, "Scan Directory for Trustees: %s", ", %s") ),
9065    ])
9066    pkt.Reply(57, [
9067            rec( 8, 16, DirectoryPath ),
9068            rec( 24, 2, CreationDate, ENC_BIG_ENDIAN ),
9069            rec( 26, 2, CreationTime, ENC_BIG_ENDIAN ),
9070            rec( 28, 4, CreatorID ),
9071            rec( 32, 4, TrusteeID, ENC_BIG_ENDIAN ),
9072            rec( 36, 4, TrusteeID, ENC_BIG_ENDIAN ),
9073            rec( 40, 4, TrusteeID, ENC_BIG_ENDIAN ),
9074            rec( 44, 4, TrusteeID, ENC_BIG_ENDIAN ),
9075            rec( 48, 4, TrusteeID, ENC_BIG_ENDIAN ),
9076            rec( 52, 1, AccessRightsMask ),
9077            rec( 53, 1, AccessRightsMask ),
9078            rec( 54, 1, AccessRightsMask ),
9079            rec( 55, 1, AccessRightsMask ),
9080            rec( 56, 1, AccessRightsMask ),
9081    ])
9082    pkt.CompletionCodes([0x0000, 0x8c00, 0x9600, 0x9804, 0x9b03, 0x9c03,
9083                         0xa100, 0xfd00, 0xff00])
9084
9085    # 2222/160D, 22/13
9086    pkt = NCP(0x160D, "Add Trustee to Directory", 'file')
9087    pkt.Request((17,271), [
9088            rec( 10, 1, DirHandle ),
9089            rec( 11, 4, TrusteeID, ENC_BIG_ENDIAN ),
9090            rec( 15, 1, AccessRightsMask ),
9091            rec( 16, (1, 255), Path, info_str=(Path, "Add Trustee to Directory: %s", ", %s") ),
9092    ])
9093    pkt.Reply(8)
9094    pkt.CompletionCodes([0x0000, 0x8c00, 0x9600, 0x9804, 0x9900, 0x9b03, 0x9c03,
9095                         0xa100, 0xfc06, 0xfd00, 0xff00])
9096
9097    # 2222/160E, 22/14
9098    pkt = NCP(0x160E, "Delete Trustee from Directory", 'file')
9099    pkt.Request((17,271), [
9100            rec( 10, 1, DirHandle ),
9101            rec( 11, 4, TrusteeID, ENC_BIG_ENDIAN ),
9102            rec( 15, 1, Reserved ),
9103            rec( 16, (1, 255), Path, info_str=(Path, "Delete Trustee from Directory: %s", ", %s") ),
9104    ])
9105    pkt.Reply(8)
9106    pkt.CompletionCodes([0x0000, 0x8c00, 0x9600, 0x9804, 0x9900, 0x9b03, 0x9c03,
9107                         0xa100, 0xfc06, 0xfd00, 0xfe07, 0xff00])
9108
9109    # 2222/160F, 22/15
9110    pkt = NCP(0x160F, "Rename Directory", 'file')
9111    pkt.Request((13, 521), [
9112            rec( 10, 1, DirHandle ),
9113            rec( 11, (1, 255), Path, info_str=(Path, "Rename Directory: %s", ", %s") ),
9114            rec( -1, (1, 255), NewPath ),
9115    ])
9116    pkt.Reply(8)
9117    pkt.CompletionCodes([0x0000, 0x8b00, 0x9200, 0x9600, 0x9804, 0x9b03, 0x9c03,
9118                         0x9e00, 0xa100, 0xef00, 0xfd00, 0xff00])
9119
9120    # 2222/1610, 22/16
9121    pkt = NCP(0x1610, "Purge Erased Files", 'file')
9122    pkt.Request(10)
9123    pkt.Reply(8)
9124    pkt.CompletionCodes([0x0000, 0x8100, 0x9600, 0x9804, 0xa100, 0xff00])
9125
9126    # 2222/1611, 22/17
9127    pkt = NCP(0x1611, "Recover Erased File", 'file')
9128    pkt.Request(11, [
9129            rec( 10, 1, DirHandle,info_str=(DirHandle, "Recover Erased File from Directory Handle %d", ", %d") ),
9130    ])
9131    pkt.Reply(38, [
9132            rec( 8, 15, OldFileName ),
9133            rec( 23, 15, NewFileName ),
9134    ])
9135    pkt.CompletionCodes([0x0000, 0x9600, 0x9804, 0x9b03, 0x9c03,
9136                         0xa100, 0xfd00, 0xff00])
9137    # 2222/1612, 22/18
9138    pkt = NCP(0x1612, "Alloc Permanent Directory Handle", 'file')
9139    pkt.Request((13, 267), [
9140            rec( 10, 1, DirHandle ),
9141            rec( 11, 1, DirHandleName ),
9142            rec( 12, (1,255), Path, info_str=(Path, "Allocate Permanent Directory Handle: %s", ", %s") ),
9143    ])
9144    pkt.Reply(10, [
9145            rec( 8, 1, DirHandle ),
9146            rec( 9, 1, AccessRightsMask ),
9147    ])
9148    pkt.CompletionCodes([0x0000, 0x9600, 0x9804, 0x9900, 0x9b00, 0x9c03, 0x9d00,
9149                         0xa100, 0xfd00, 0xff00])
9150    # 2222/1613, 22/19
9151    pkt = NCP(0x1613, "Alloc Temporary Directory Handle", 'file')
9152    pkt.Request((13, 267), [
9153            rec( 10, 1, DirHandle ),
9154            rec( 11, 1, DirHandleName ),
9155            rec( 12, (1,255), Path, info_str=(Path, "Allocate Temporary Directory Handle: %s", ", %s") ),
9156    ])
9157    pkt.Reply(10, [
9158            rec( 8, 1, DirHandle ),
9159            rec( 9, 1, AccessRightsMask ),
9160    ])
9161    pkt.CompletionCodes([0x0000, 0x9600, 0x9804, 0x9900, 0x9c03, 0x9d00,
9162                         0xa100, 0xfd00, 0xff00])
9163    # 2222/1614, 22/20
9164    pkt = NCP(0x1614, "Deallocate Directory Handle", 'file')
9165    pkt.Request(11, [
9166            rec( 10, 1, DirHandle,info_str=(DirHandle, "Deallocate Directory Handle %d", ", %d") ),
9167    ])
9168    pkt.Reply(8)
9169    pkt.CompletionCodes([0x0000, 0x9b03])
9170    # 2222/1615, 22/21
9171    pkt = NCP(0x1615, "Get Volume Info with Handle", 'file')
9172    pkt.Request( 11, [
9173            rec( 10, 1, DirHandle,info_str=(DirHandle, "Get Volume Information with Handle %d", ", %d") )
9174    ])
9175    pkt.Reply( 36, [
9176            rec( 8, 2, SectorsPerCluster, ENC_BIG_ENDIAN ),
9177            rec( 10, 2, TotalVolumeClusters, ENC_BIG_ENDIAN ),
9178            rec( 12, 2, AvailableClusters, ENC_BIG_ENDIAN ),
9179            rec( 14, 2, TotalDirectorySlots, ENC_BIG_ENDIAN ),
9180            rec( 16, 2, AvailableDirectorySlots, ENC_BIG_ENDIAN ),
9181            rec( 18, 16, VolumeName ),
9182            rec( 34, 2, RemovableFlag, ENC_BIG_ENDIAN ),
9183    ])
9184    pkt.CompletionCodes([0x0000, 0xff00])
9185    # 2222/1616, 22/22
9186    pkt = NCP(0x1616, "Alloc Special Temporary Directory Handle", 'file')
9187    pkt.Request((13, 267), [
9188            rec( 10, 1, DirHandle ),
9189            rec( 11, 1, DirHandleName ),
9190            rec( 12, (1,255), Path, info_str=(Path, "Allocate Special Temporary Directory Handle: %s", ", %s") ),
9191    ])
9192    pkt.Reply(10, [
9193            rec( 8, 1, DirHandle ),
9194            rec( 9, 1, AccessRightsMask ),
9195    ])
9196    pkt.CompletionCodes([0x0000, 0x9600, 0x9804, 0x9900, 0x9b00, 0x9c03, 0x9d00,
9197                         0xa100, 0xfd00, 0xff00])
9198    # 2222/1617, 22/23
9199    pkt = NCP(0x1617, "Extract a Base Handle", 'file')
9200    pkt.Request(11, [
9201            rec( 10, 1, DirHandle, info_str=(DirHandle, "Extract a Base Handle from Directory Handle %d", ", %d") ),
9202    ])
9203    pkt.Reply(22, [
9204            rec( 8, 10, ServerNetworkAddress ),
9205            rec( 18, 4, DirHandleLong ),
9206    ])
9207    pkt.CompletionCodes([0x0000, 0x9600, 0x9b03])
9208    # 2222/1618, 22/24
9209    pkt = NCP(0x1618, "Restore an Extracted Base Handle", 'file')
9210    pkt.Request(24, [
9211            rec( 10, 10, ServerNetworkAddress ),
9212            rec( 20, 4, DirHandleLong ),
9213    ])
9214    pkt.Reply(10, [
9215            rec( 8, 1, DirHandle ),
9216            rec( 9, 1, AccessRightsMask ),
9217    ])
9218    pkt.CompletionCodes([0x0000, 0x9600, 0x9804, 0x9b03, 0x9c00, 0x9d00, 0xa100,
9219                         0xfd00, 0xff00])
9220    # 2222/1619, 22/25
9221    pkt = NCP(0x1619, "Set Directory Information", 'file')
9222    pkt.Request((21, 275), [
9223            rec( 10, 1, DirHandle ),
9224            rec( 11, 2, CreationDate ),
9225            rec( 13, 2, CreationTime ),
9226            rec( 15, 4, CreatorID, ENC_BIG_ENDIAN ),
9227            rec( 19, 1, AccessRightsMask ),
9228            rec( 20, (1,255), Path, info_str=(Path, "Set Directory Information: %s", ", %s") ),
9229    ])
9230    pkt.Reply(8)
9231    pkt.CompletionCodes([0x0000, 0x8c00, 0x9600, 0x9804, 0x9b03, 0x9c00, 0xa100,
9232                         0xff16])
9233    # 2222/161A, 22/26
9234    pkt = NCP(0x161A, "Get Path Name of a Volume-Directory Number Pair", 'file')
9235    pkt.Request(13, [
9236            rec( 10, 1, VolumeNumber ),
9237            rec( 11, 2, DirectoryEntryNumberWord ),
9238    ])
9239    pkt.Reply((9,263), [
9240            rec( 8, (1,255), Path ),
9241            ])
9242    pkt.CompletionCodes([0x0000, 0x9804, 0x9c00, 0xa100])
9243    # 2222/161B, 22/27
9244    pkt = NCP(0x161B, "Scan Salvageable Files", 'file')
9245    pkt.Request(15, [
9246            rec( 10, 1, DirHandle ),
9247            rec( 11, 4, SequenceNumber ),
9248    ])
9249    pkt.Reply(140, [
9250            rec( 8, 4, SequenceNumber ),
9251            rec( 12, 2, Subdirectory ),
9252            rec( 14, 2, Reserved2 ),
9253            rec( 16, 4, AttributesDef32 ),
9254            rec( 20, 1, UniqueID ),
9255            rec( 21, 1, FlagsDef ),
9256            rec( 22, 1, DestNameSpace ),
9257            rec( 23, 1, FileNameLen ),
9258            rec( 24, 12, FileName12 ),
9259            rec( 36, 2, CreationTime ),
9260            rec( 38, 2, CreationDate ),
9261            rec( 40, 4, CreatorID, ENC_BIG_ENDIAN ),
9262            rec( 44, 2, ArchivedTime ),
9263            rec( 46, 2, ArchivedDate ),
9264            rec( 48, 4, ArchiverID, ENC_BIG_ENDIAN ),
9265            rec( 52, 2, UpdateTime ),
9266            rec( 54, 2, UpdateDate ),
9267            rec( 56, 4, UpdateID, ENC_BIG_ENDIAN ),
9268            rec( 60, 4, FileSize, ENC_BIG_ENDIAN ),
9269            rec( 64, 44, Reserved44 ),
9270            rec( 108, 2, InheritedRightsMask ),
9271            rec( 110, 2, LastAccessedDate ),
9272            rec( 112, 4, DeletedFileTime ),
9273            rec( 116, 2, DeletedTime ),
9274            rec( 118, 2, DeletedDate ),
9275            rec( 120, 4, DeletedID, ENC_BIG_ENDIAN ),
9276            rec( 124, 16, Reserved16 ),
9277    ])
9278    pkt.CompletionCodes([0x0000, 0xfb01, 0x9801, 0xff1d])
9279    # 2222/161C, 22/28
9280    pkt = NCP(0x161C, "Recover Salvageable File", 'file')
9281    pkt.Request((17,525), [
9282            rec( 10, 1, DirHandle ),
9283            rec( 11, 4, SequenceNumber ),
9284            rec( 15, (1, 255), FileName, info_str=(FileName, "Recover File: %s", ", %s") ),
9285            rec( -1, (1, 255), NewFileNameLen ),
9286    ])
9287    pkt.Reply(8)
9288    pkt.CompletionCodes([0x0000, 0x8401, 0x9c03, 0xfe02])
9289    # 2222/161D, 22/29
9290    pkt = NCP(0x161D, "Purge Salvageable File", 'file')
9291    pkt.Request(15, [
9292            rec( 10, 1, DirHandle ),
9293            rec( 11, 4, SequenceNumber ),
9294    ])
9295    pkt.Reply(8)
9296    pkt.CompletionCodes([0x0000, 0x8500, 0x9c03])
9297    # 2222/161E, 22/30
9298    pkt = NCP(0x161E, "Scan a Directory", 'file')
9299    pkt.Request((17, 271), [
9300            rec( 10, 1, DirHandle ),
9301            rec( 11, 1, DOSFileAttributes ),
9302            rec( 12, 4, SequenceNumber ),
9303            rec( 16, (1, 255), SearchPattern, info_str=(SearchPattern, "Scan a Directory: %s", ", %s") ),
9304    ])
9305    pkt.Reply(140, [
9306            rec( 8, 4, SequenceNumber ),
9307            rec( 12, 4, Subdirectory ),
9308            rec( 16, 4, AttributesDef32 ),
9309            rec( 20, 1, UniqueID, ENC_LITTLE_ENDIAN ),
9310            rec( 21, 1, PurgeFlags ),
9311            rec( 22, 1, DestNameSpace ),
9312            rec( 23, 1, NameLen ),
9313            rec( 24, 12, Name12 ),
9314            rec( 36, 2, CreationTime ),
9315            rec( 38, 2, CreationDate ),
9316            rec( 40, 4, CreatorID, ENC_BIG_ENDIAN ),
9317            rec( 44, 2, ArchivedTime ),
9318            rec( 46, 2, ArchivedDate ),
9319            rec( 48, 4, ArchiverID, ENC_BIG_ENDIAN ),
9320            rec( 52, 2, UpdateTime ),
9321            rec( 54, 2, UpdateDate ),
9322            rec( 56, 4, UpdateID, ENC_BIG_ENDIAN ),
9323            rec( 60, 4, FileSize, ENC_BIG_ENDIAN ),
9324            rec( 64, 44, Reserved44 ),
9325            rec( 108, 2, InheritedRightsMask ),
9326            rec( 110, 2, LastAccessedDate ),
9327            rec( 112, 28, Reserved28 ),
9328    ])
9329    pkt.CompletionCodes([0x0000, 0x8500, 0x9c03])
9330    # 2222/161F, 22/31
9331    pkt = NCP(0x161F, "Get Directory Entry", 'file')
9332    pkt.Request(11, [
9333            rec( 10, 1, DirHandle ),
9334    ])
9335    pkt.Reply(136, [
9336            rec( 8, 4, Subdirectory ),
9337            rec( 12, 4, AttributesDef32 ),
9338            rec( 16, 1, UniqueID, ENC_LITTLE_ENDIAN ),
9339            rec( 17, 1, PurgeFlags ),
9340            rec( 18, 1, DestNameSpace ),
9341            rec( 19, 1, NameLen ),
9342            rec( 20, 12, Name12 ),
9343            rec( 32, 2, CreationTime ),
9344            rec( 34, 2, CreationDate ),
9345            rec( 36, 4, CreatorID, ENC_BIG_ENDIAN ),
9346            rec( 40, 2, ArchivedTime ),
9347            rec( 42, 2, ArchivedDate ),
9348            rec( 44, 4, ArchiverID, ENC_BIG_ENDIAN ),
9349            rec( 48, 2, UpdateTime ),
9350            rec( 50, 2, UpdateDate ),
9351            rec( 52, 4, NextTrusteeEntry, ENC_BIG_ENDIAN ),
9352            rec( 56, 48, Reserved48 ),
9353            rec( 104, 2, MaximumSpace ),
9354            rec( 106, 2, InheritedRightsMask ),
9355            rec( 108, 28, Undefined28 ),
9356    ])
9357    pkt.CompletionCodes([0x0000, 0x8900, 0xbf00, 0xfb00])
9358    # 2222/1620, 22/32
9359    pkt = NCP(0x1620, "Scan Volume's User Disk Restrictions", 'file')
9360    pkt.Request(15, [
9361            rec( 10, 1, VolumeNumber ),
9362            rec( 11, 4, SequenceNumber ),
9363    ])
9364    pkt.Reply(17, [
9365            rec( 8, 1, NumberOfEntries, var="x" ),
9366            rec( 9, 8, ObjectIDStruct, repeat="x" ),
9367    ])
9368    pkt.CompletionCodes([0x0000, 0x9800])
9369    # 2222/1621, 22/33
9370    pkt = NCP(0x1621, "Add User Disk Space Restriction", 'file')
9371    pkt.Request(19, [
9372            rec( 10, 1, VolumeNumber ),
9373            rec( 11, 4, ObjectID ),
9374            rec( 15, 4, DiskSpaceLimit ),
9375    ])
9376    pkt.Reply(8)
9377    pkt.CompletionCodes([0x0000, 0x8c00, 0x9600, 0x9800])
9378    # 2222/1622, 22/34
9379    pkt = NCP(0x1622, "Remove User Disk Space Restrictions", 'file')
9380    pkt.Request(15, [
9381            rec( 10, 1, VolumeNumber ),
9382            rec( 11, 4, ObjectID ),
9383    ])
9384    pkt.Reply(8)
9385    pkt.CompletionCodes([0x0000, 0x8c00, 0xfe0e])
9386    # 2222/1623, 22/35
9387    pkt = NCP(0x1623, "Get Directory Disk Space Restriction", 'file')
9388    pkt.Request(11, [
9389            rec( 10, 1, DirHandle ),
9390    ])
9391    pkt.Reply(18, [
9392            rec( 8, 1, NumberOfEntries ),
9393            rec( 9, 1, Level ),
9394            rec( 10, 4, MaxSpace ),
9395            rec( 14, 4, CurrentSpace ),
9396    ])
9397    pkt.CompletionCodes([0x0000])
9398    # 2222/1624, 22/36
9399    pkt = NCP(0x1624, "Set Directory Disk Space Restriction", 'file')
9400    pkt.Request(15, [
9401            rec( 10, 1, DirHandle ),
9402            rec( 11, 4, DiskSpaceLimit ),
9403    ])
9404    pkt.Reply(8)
9405    pkt.CompletionCodes([0x0000, 0x0101, 0x8c00, 0xbf00])
9406    # 2222/1625, 22/37
9407    pkt = NCP(0x1625, "Set Directory Entry Information", 'file')
9408    pkt.Request(NO_LENGTH_CHECK, [
9409            #
9410            # XXX - this didn't match what was in the spec for 22/37
9411            # on the Novell Web site.
9412            #
9413            rec( 10, 1, DirHandle ),
9414            rec( 11, 1, SearchAttributes ),
9415            rec( 12, 4, SequenceNumber ),
9416            rec( 16, 2, ChangeBits ),
9417            rec( 18, 2, Reserved2 ),
9418            rec( 20, 4, Subdirectory ),
9419            #srec(DOSDirectoryEntryStruct, req_cond="ncp.search_att_sub == TRUE"),
9420            srec(DOSFileEntryStruct, req_cond="ncp.search_att_sub == FALSE"),
9421    ])
9422    pkt.Reply(8)
9423    pkt.ReqCondSizeConstant()
9424    pkt.CompletionCodes([0x0000, 0x0106, 0x8c00, 0xbf00])
9425    # 2222/1626, 22/38
9426    pkt = NCP(0x1626, "Scan File or Directory for Extended Trustees", 'file')
9427    pkt.Request((13,267), [
9428            rec( 10, 1, DirHandle ),
9429            rec( 11, 1, SequenceByte ),
9430            rec( 12, (1, 255), Path, info_str=(Path, "Scan for Extended Trustees: %s", ", %s") ),
9431    ])
9432    pkt.Reply(91, [
9433            rec( 8, 1, NumberOfEntries, var="x" ),
9434            rec( 9, 4, ObjectID ),
9435            rec( 13, 4, ObjectID ),
9436            rec( 17, 4, ObjectID ),
9437            rec( 21, 4, ObjectID ),
9438            rec( 25, 4, ObjectID ),
9439            rec( 29, 4, ObjectID ),
9440            rec( 33, 4, ObjectID ),
9441            rec( 37, 4, ObjectID ),
9442            rec( 41, 4, ObjectID ),
9443            rec( 45, 4, ObjectID ),
9444            rec( 49, 4, ObjectID ),
9445            rec( 53, 4, ObjectID ),
9446            rec( 57, 4, ObjectID ),
9447            rec( 61, 4, ObjectID ),
9448            rec( 65, 4, ObjectID ),
9449            rec( 69, 4, ObjectID ),
9450            rec( 73, 4, ObjectID ),
9451            rec( 77, 4, ObjectID ),
9452            rec( 81, 4, ObjectID ),
9453            rec( 85, 4, ObjectID ),
9454            rec( 89, 2, AccessRightsMaskWord, repeat="x" ),
9455    ])
9456    pkt.CompletionCodes([0x0000, 0x9800, 0x9b00, 0x9c00])
9457    # 2222/1627, 22/39
9458    pkt = NCP(0x1627, "Add Extended Trustee to Directory or File", 'file')
9459    pkt.Request((18,272), [
9460            rec( 10, 1, DirHandle ),
9461            rec( 11, 4, ObjectID, ENC_BIG_ENDIAN ),
9462            rec( 15, 2, TrusteeRights ),
9463            rec( 17, (1, 255), Path, info_str=(Path, "Add Extended Trustee: %s", ", %s") ),
9464    ])
9465    pkt.Reply(8)
9466    pkt.CompletionCodes([0x0000, 0x9000])
9467    # 2222/1628, 22/40
9468    pkt = NCP(0x1628, "Scan Directory Disk Space", 'file')
9469    pkt.Request((17,271), [
9470            rec( 10, 1, DirHandle ),
9471            rec( 11, 1, SearchAttributes ),
9472            rec( 12, 4, SequenceNumber ),
9473            rec( 16, (1, 255), SearchPattern, info_str=(SearchPattern, "Scan Directory Disk Space: %s", ", %s") ),
9474    ])
9475    pkt.Reply((148), [
9476            rec( 8, 4, SequenceNumber ),
9477            rec( 12, 4, Subdirectory ),
9478            rec( 16, 4, AttributesDef32 ),
9479            rec( 20, 1, UniqueID ),
9480            rec( 21, 1, PurgeFlags ),
9481            rec( 22, 1, DestNameSpace ),
9482            rec( 23, 1, NameLen ),
9483            rec( 24, 12, Name12 ),
9484            rec( 36, 2, CreationTime ),
9485            rec( 38, 2, CreationDate ),
9486            rec( 40, 4, CreatorID, ENC_BIG_ENDIAN ),
9487            rec( 44, 2, ArchivedTime ),
9488            rec( 46, 2, ArchivedDate ),
9489            rec( 48, 4, ArchiverID, ENC_BIG_ENDIAN ),
9490            rec( 52, 2, UpdateTime ),
9491            rec( 54, 2, UpdateDate ),
9492            rec( 56, 4, UpdateID, ENC_BIG_ENDIAN ),
9493            rec( 60, 4, DataForkSize, ENC_BIG_ENDIAN ),
9494            rec( 64, 4, DataForkFirstFAT, ENC_BIG_ENDIAN ),
9495            rec( 68, 4, NextTrusteeEntry, ENC_BIG_ENDIAN ),
9496            rec( 72, 36, Reserved36 ),
9497            rec( 108, 2, InheritedRightsMask ),
9498            rec( 110, 2, LastAccessedDate ),
9499            rec( 112, 4, DeletedFileTime ),
9500            rec( 116, 2, DeletedTime ),
9501            rec( 118, 2, DeletedDate ),
9502            rec( 120, 4, DeletedID, ENC_BIG_ENDIAN ),
9503            rec( 124, 8, Undefined8 ),
9504            rec( 132, 4, PrimaryEntry, ENC_LITTLE_ENDIAN ),
9505            rec( 136, 4, NameList, ENC_LITTLE_ENDIAN ),
9506            rec( 140, 4, OtherFileForkSize, ENC_BIG_ENDIAN ),
9507            rec( 144, 4, OtherFileForkFAT, ENC_BIG_ENDIAN ),
9508    ])
9509    pkt.CompletionCodes([0x0000, 0x8900, 0x9c03, 0xfb01, 0xff00])
9510    # 2222/1629, 22/41
9511    pkt = NCP(0x1629, "Get Object Disk Usage and Restrictions", 'file')
9512    pkt.Request(15, [
9513            rec( 10, 1, VolumeNumber ),
9514            rec( 11, 4, ObjectID, ENC_LITTLE_ENDIAN ),
9515    ])
9516    pkt.Reply(16, [
9517            rec( 8, 4, Restriction ),
9518            rec( 12, 4, InUse ),
9519    ])
9520    pkt.CompletionCodes([0x0000, 0x9802])
9521    # 2222/162A, 22/42
9522    pkt = NCP(0x162A, "Get Effective Rights for Directory Entry", 'file')
9523    pkt.Request((12,266), [
9524            rec( 10, 1, DirHandle ),
9525            rec( 11, (1, 255), Path, info_str=(Path, "Get Effective Rights: %s", ", %s") ),
9526    ])
9527    pkt.Reply(10, [
9528            rec( 8, 2, AccessRightsMaskWord ),
9529    ])
9530    pkt.CompletionCodes([0x0000, 0x9804, 0x9c03])
9531    # 2222/162B, 22/43
9532    pkt = NCP(0x162B, "Remove Extended Trustee from Dir or File", 'file')
9533    pkt.Request((17,271), [
9534            rec( 10, 1, DirHandle ),
9535            rec( 11, 4, ObjectID, ENC_BIG_ENDIAN ),
9536            rec( 15, 1, Unused ),
9537            rec( 16, (1, 255), Path, info_str=(Path, "Remove Extended Trustee from %s", ", %s") ),
9538    ])
9539    pkt.Reply(8)
9540    pkt.CompletionCodes([0x0000, 0x9002, 0x9c03, 0xfe0f, 0xff09])
9541    # 2222/162C, 22/44
9542    pkt = NCP(0x162C, "Get Volume and Purge Information", 'file')
9543    pkt.Request( 11, [
9544            rec( 10, 1, VolumeNumber, info_str=(VolumeNumber, "Get Volume and Purge Information for Volume %d", ", %d") )
9545    ])
9546    pkt.Reply( (38,53), [
9547            rec( 8, 4, TotalBlocks ),
9548            rec( 12, 4, FreeBlocks ),
9549            rec( 16, 4, PurgeableBlocks ),
9550            rec( 20, 4, NotYetPurgeableBlocks ),
9551            rec( 24, 4, TotalDirectoryEntries ),
9552            rec( 28, 4, AvailableDirEntries ),
9553            rec( 32, 4, Reserved4 ),
9554            rec( 36, 1, SectorsPerBlock ),
9555            rec( 37, (1,16), VolumeNameLen ),
9556    ])
9557    pkt.CompletionCodes([0x0000])
9558    # 2222/162D, 22/45
9559    pkt = NCP(0x162D, "Get Directory Information", 'file')
9560    pkt.Request( 11, [
9561            rec( 10, 1, DirHandle )
9562    ])
9563    pkt.Reply( (30, 45), [
9564            rec( 8, 4, TotalBlocks ),
9565            rec( 12, 4, AvailableBlocks ),
9566            rec( 16, 4, TotalDirectoryEntries ),
9567            rec( 20, 4, AvailableDirEntries ),
9568            rec( 24, 4, Reserved4 ),
9569            rec( 28, 1, SectorsPerBlock ),
9570            rec( 29, (1,16), VolumeNameLen ),
9571    ])
9572    pkt.CompletionCodes([0x0000, 0x9b03])
9573    # 2222/162E, 22/46
9574    pkt = NCP(0x162E, "Rename Or Move", 'file')
9575    pkt.Request( (17,525), [
9576            rec( 10, 1, SourceDirHandle ),
9577            rec( 11, 1, SearchAttributes ),
9578            rec( 12, 1, SourcePathComponentCount ),
9579            rec( 13, (1,255), SourcePath, info_str=(SourcePath, "Rename or Move: %s", ", %s") ),
9580            rec( -1, 1, DestDirHandle ),
9581            rec( -1, 1, DestPathComponentCount ),
9582            rec( -1, (1,255), DestPath ),
9583    ])
9584    pkt.Reply(8)
9585    pkt.CompletionCodes([0x0000, 0x0102, 0x8701, 0x8b00, 0x8d00, 0x8e00,
9586                         0x8f00, 0x9001, 0x9101, 0x9201, 0x9a00, 0x9b03,
9587                         0x9c03, 0xa400, 0xff17])
9588    # 2222/162F, 22/47
9589    pkt = NCP(0x162F, "Get Name Space Information", 'file')
9590    pkt.Request( 11, [
9591            rec( 10, 1, VolumeNumber, info_str=(VolumeNumber, "Get Name Space Information for Volume %d", ", %d") )
9592    ])
9593    pkt.Reply( (15,523), [
9594            #
9595            # XXX - why does this not display anything at all
9596            # if the stuff after the first IndexNumber is
9597            # un-commented?  That stuff really is there....
9598            #
9599            rec( 8, 1, DefinedNameSpaces, var="v" ),
9600            rec( 9, (1,255), NameSpaceName, repeat="v" ),
9601            rec( -1, 1, DefinedDataStreams, var="w" ),
9602            rec( -1, (2,256), DataStreamInfo, repeat="w" ),
9603            rec( -1, 1, LoadedNameSpaces, var="x" ),
9604            rec( -1, 1, IndexNumber, repeat="x" ),
9605#               rec( -1, 1, VolumeNameSpaces, var="y" ),
9606#               rec( -1, 1, IndexNumber, repeat="y" ),
9607#               rec( -1, 1, VolumeDataStreams, var="z" ),
9608#               rec( -1, 1, IndexNumber, repeat="z" ),
9609    ])
9610    pkt.CompletionCodes([0x0000, 0x9802, 0xff00])
9611    # 2222/1630, 22/48
9612    pkt = NCP(0x1630, "Get Name Space Directory Entry", 'file')
9613    pkt.Request( 16, [
9614            rec( 10, 1, VolumeNumber ),
9615            rec( 11, 4, DOSSequence ),
9616            rec( 15, 1, SrcNameSpace ),
9617    ])
9618    pkt.Reply( 112, [
9619            rec( 8, 4, SequenceNumber ),
9620            rec( 12, 4, Subdirectory ),
9621            rec( 16, 4, AttributesDef32 ),
9622            rec( 20, 1, UniqueID ),
9623            rec( 21, 1, Flags ),
9624            rec( 22, 1, SrcNameSpace ),
9625            rec( 23, 1, NameLength ),
9626            rec( 24, 12, Name12 ),
9627            rec( 36, 2, CreationTime ),
9628            rec( 38, 2, CreationDate ),
9629            rec( 40, 4, CreatorID, ENC_BIG_ENDIAN ),
9630            rec( 44, 2, ArchivedTime ),
9631            rec( 46, 2, ArchivedDate ),
9632            rec( 48, 4, ArchiverID ),
9633            rec( 52, 2, UpdateTime ),
9634            rec( 54, 2, UpdateDate ),
9635            rec( 56, 4, UpdateID ),
9636            rec( 60, 4, FileSize ),
9637            rec( 64, 44, Reserved44 ),
9638            rec( 108, 2, InheritedRightsMask ),
9639            rec( 110, 2, LastAccessedDate ),
9640    ])
9641    pkt.CompletionCodes([0x0000, 0x8900, 0x9802, 0xbf00])
9642    # 2222/1631, 22/49
9643    pkt = NCP(0x1631, "Open Data Stream", 'file')
9644    pkt.Request( (15,269), [
9645            rec( 10, 1, DataStream ),
9646            rec( 11, 1, DirHandle ),
9647            rec( 12, 1, AttributesDef ),
9648            rec( 13, 1, OpenRights ),
9649            rec( 14, (1, 255), FileName, info_str=(FileName, "Open Data Stream: %s", ", %s") ),
9650    ])
9651    pkt.Reply( 12, [
9652            rec( 8, 4, CCFileHandle, ENC_BIG_ENDIAN ),
9653    ])
9654    pkt.CompletionCodes([0x0000, 0x8000, 0x8200, 0x9002, 0xbe00, 0xff00])
9655    # 2222/1632, 22/50
9656    pkt = NCP(0x1632, "Get Object Effective Rights for Directory Entry", 'file')
9657    pkt.Request( (16,270), [
9658            rec( 10, 4, ObjectID, ENC_BIG_ENDIAN ),
9659            rec( 14, 1, DirHandle ),
9660            rec( 15, (1, 255), Path, info_str=(Path, "Get Object Effective Rights: %s", ", %s") ),
9661    ])
9662    pkt.Reply( 10, [
9663            rec( 8, 2, TrusteeRights ),
9664    ])
9665    pkt.CompletionCodes([0x0000, 0x7e01, 0x9b00, 0x9c03, 0xfc06])
9666    # 2222/1633, 22/51
9667    pkt = NCP(0x1633, "Get Extended Volume Information", 'file')
9668    pkt.Request( 11, [
9669            rec( 10, 1, VolumeNumber, info_str=(VolumeNumber, "Get Extended Volume Information for Volume %d", ", %d") ),
9670    ])
9671    pkt.Reply( (139,266), [
9672            rec( 8, 2, VolInfoReplyLen ),
9673            rec( 10, 128, VolInfoStructure),
9674            rec( 138, (1,128), VolumeNameLen ),
9675    ])
9676    pkt.CompletionCodes([0x0000, 0x7e01, 0x9804, 0xfb08, 0xff00])
9677    pkt.MakeExpert("ncp1633_reply")
9678    # 2222/1634, 22/52
9679    pkt = NCP(0x1634, "Get Mount Volume List", 'file')
9680    pkt.Request( 22, [
9681            rec( 10, 4, StartVolumeNumber ),
9682            rec( 14, 4, VolumeRequestFlags, ENC_LITTLE_ENDIAN ),
9683            rec( 18, 4, SrcNameSpace ),
9684    ])
9685    pkt.Reply( NO_LENGTH_CHECK, [
9686            rec( 8, 4, ItemsInPacket, var="x" ),
9687            rec( 12, 4, NextVolumeNumber ),
9688    srec( VolumeStruct, req_cond="ncp.volume_request_flags==0x0000", repeat="x" ),
9689    srec( VolumeWithNameStruct, req_cond="ncp.volume_request_flags==0x0001", repeat="x" ),
9690    ])
9691    pkt.ReqCondSizeVariable()
9692    pkt.CompletionCodes([0x0000, 0x9802])
9693    # 2222/1635, 22/53
9694    pkt = NCP(0x1635, "Get Volume Capabilities", 'file')
9695    pkt.Request( 18, [
9696            rec( 10, 4, VolumeNumberLong ),
9697            rec( 14, 4, VersionNumberLong ),
9698    ])
9699    pkt.Reply( NO_LENGTH_CHECK, [
9700            rec( 8, 4, VolumeCapabilities ),
9701            rec( 12, 28, Reserved28 ),
9702    rec( 40, 64, VolumeNameStringz ),
9703    rec( 104, 128, VolumeGUID ),
9704            rec( 232, 256, PoolName ),
9705    rec( 488, PROTO_LENGTH_UNKNOWN, VolumeMountPoint ),
9706    ])
9707    pkt.CompletionCodes([0x0000, 0x7700, 0x9802, 0xfb01])
9708    # 2222/1636, 22/54
9709    pkt = NCP(0x1636, "Add User Disk Space Restriction 64 Bit Aware", 'file')
9710    pkt.Request(26, [
9711            rec( 10, 4, VolumeNumberLong ),
9712            rec( 14, 4, ObjectID, ENC_LITTLE_ENDIAN ),
9713            rec( 18, 8, DiskSpaceLimit64 ),
9714    ])
9715    pkt.Reply(8)
9716    pkt.CompletionCodes([0x0000, 0x8c00, 0x9600, 0x9800])
9717    # 2222/1637, 22/55
9718    pkt = NCP(0x1637, "Get Object Disk Usage and Restrictions 64 Bit Aware", 'file')
9719    pkt.Request(18, [
9720            rec( 10, 4, VolumeNumberLong ),
9721            rec( 14, 4, ObjectID, ENC_LITTLE_ENDIAN ),
9722    ])
9723    pkt.Reply(24, [
9724            rec( 8, 8, RestrictionQuad ),
9725            rec( 16, 8, InUse64 ),
9726    ])
9727    pkt.CompletionCodes([0x0000, 0x9802])
9728    # 2222/1638, 22/56
9729    pkt = NCP(0x1638, "Scan Volume's User Disk Restrictions 64 Bit Aware", 'file')
9730    pkt.Request(18, [
9731            rec( 10, 4, VolumeNumberLong ),
9732            rec( 14, 4, SequenceNumber ),
9733    ])
9734    pkt.Reply(24, [
9735            rec( 8, 4, NumberOfEntriesLong, var="x" ),
9736            rec( 12, 12, ObjectIDStruct64, repeat="x" ),
9737    ])
9738    pkt.CompletionCodes([0x0000, 0x9800])
9739    # 2222/1639, 22/57
9740    pkt = NCP(0x1639, "Set Directory Disk Space Restriction 64 Bit Aware", 'file')
9741    pkt.Request(26, [
9742            rec( 10, 8, DirHandle64 ),
9743            rec( 18, 8, DiskSpaceLimit64 ),
9744    ])
9745    pkt.Reply(8)
9746    pkt.CompletionCodes([0x0000, 0x0101, 0x8c00, 0xbf00])
9747    # 2222/163A, 22/58
9748    pkt = NCP(0x163A, "Get Directory Information 64 Bit Aware", 'file')
9749    pkt.Request( 18, [
9750            rec( 10, 8, DirHandle64 )
9751    ])
9752    pkt.Reply( (49, 64), [
9753            rec( 8, 8, TotalBlocks64 ),
9754            rec( 16, 8, AvailableBlocks64 ),
9755            rec( 24, 8, TotalDirEntries64 ),
9756            rec( 32, 8, AvailableDirEntries64 ),
9757            rec( 40, 4, Reserved4 ),
9758            rec( 44, 4, SectorsPerBlockLong ),
9759            rec( 48, (1,16), VolumeNameLen ),
9760    ])
9761    pkt.CompletionCodes([0x0000, 0x9b03])
9762   # 2222/1641, 22/59
9763#    pkt = NCP(0x1641, "Scan Volume's User Disk Restrictions 64-bit Aware", 'file')
9764#    pkt.Request(18, [
9765#            rec( 10, 4, VolumeNumberLong ),
9766#            rec( 14, 4, SequenceNumber ),
9767#    ])
9768#    pkt.Reply(24, [
9769#            rec( 8, 4, NumberOfEntriesLong, var="x" ),
9770#            rec( 12, 12, ObjectIDStruct64, repeat="x" ),
9771#    ])
9772#    pkt.CompletionCodes([0x0000, 0x9800])
9773    # 2222/1700, 23/00
9774    pkt = NCP(0x1700, "Login User", 'connection')
9775    pkt.Request( (12, 58), [
9776            rec( 10, (1,16), UserName, info_str=(UserName, "Login User: %s", ", %s") ),
9777            rec( -1, (1,32), Password ),
9778    ])
9779    pkt.Reply(8)
9780    pkt.CompletionCodes([0x0000, 0x9602, 0xc101, 0xc200, 0xc501, 0xd700,
9781                         0xd900, 0xda00, 0xdb00, 0xde00, 0xdf00, 0xe800,
9782                         0xec00, 0xed00, 0xef00, 0xf001, 0xf100, 0xf200,
9783                         0xf600, 0xfb00, 0xfc06, 0xfe07, 0xff00])
9784    # 2222/1701, 23/01
9785    pkt = NCP(0x1701, "Change User Password", 'bindery')
9786    pkt.Request( (13, 90), [
9787            rec( 10, (1,16), UserName, info_str=(UserName, "Change Password for User: %s", ", %s") ),
9788            rec( -1, (1,32), Password ),
9789            rec( -1, (1,32), NewPassword ),
9790    ])
9791    pkt.Reply(8)
9792    pkt.CompletionCodes([0x0000, 0x9600, 0xd600, 0xf001, 0xf101, 0xf501,
9793                         0xfc06, 0xfe07, 0xff00])
9794    # 2222/1702, 23/02
9795    pkt = NCP(0x1702, "Get User Connection List", 'connection')
9796    pkt.Request( (11, 26), [
9797            rec( 10, (1,16), UserName, info_str=(UserName, "Get User Connection: %s", ", %s") ),
9798    ])
9799    pkt.Reply( (9, 136), [
9800            rec( 8, (1, 128), ConnectionNumberList ),
9801    ])
9802    pkt.CompletionCodes([0x0000, 0x9600, 0xf001, 0xfc06, 0xfe07, 0xff00])
9803    # 2222/1703, 23/03
9804    pkt = NCP(0x1703, "Get User Number", 'bindery')
9805    pkt.Request( (11, 26), [
9806            rec( 10, (1,16), UserName, info_str=(UserName, "Get User Number: %s", ", %s") ),
9807    ])
9808    pkt.Reply( 12, [
9809            rec( 8, 4, ObjectID, ENC_BIG_ENDIAN ),
9810    ])
9811    pkt.CompletionCodes([0x0000, 0x9600, 0xf001, 0xfc06, 0xfe07, 0xff00])
9812    # 2222/1705, 23/05
9813    pkt = NCP(0x1705, "Get Station's Logged Info", 'connection')
9814    pkt.Request( 11, [
9815            rec( 10, 1, TargetConnectionNumber, info_str=(TargetConnectionNumber, "Get Station's Logged Information on Connection %d", ", %d") ),
9816    ])
9817    pkt.Reply( 266, [
9818            rec( 8, 16, UserName16 ),
9819            rec( 24, 7, LoginTime ),
9820            rec( 31, 39, FullName ),
9821            rec( 70, 4, UserID, ENC_BIG_ENDIAN ),
9822            rec( 74, 128, SecurityEquivalentList ),
9823            rec( 202, 64, Reserved64 ),
9824    ])
9825    pkt.CompletionCodes([0x0000, 0x9602, 0xfc06, 0xfd00, 0xfe07, 0xff00])
9826    # 2222/1707, 23/07
9827    pkt = NCP(0x1707, "Get Group Number", 'bindery')
9828    pkt.Request( 14, [
9829            rec( 10, 4, ObjectID, ENC_BIG_ENDIAN ),
9830    ])
9831    pkt.Reply( 62, [
9832            rec( 8, 4, ObjectID, ENC_BIG_ENDIAN ),
9833            rec( 12, 2, ObjectType, ENC_BIG_ENDIAN ),
9834            rec( 14, 48, ObjectNameLen ),
9835    ])
9836    pkt.CompletionCodes([0x0000, 0x9602, 0xf101, 0xfc06, 0xfe07, 0xff00])
9837    # 2222/170C, 23/12
9838    pkt = NCP(0x170C, "Verify Serialization", 'fileserver')
9839    pkt.Request( 14, [
9840            rec( 10, 4, ServerSerialNumber ),
9841    ])
9842    pkt.Reply(8)
9843    pkt.CompletionCodes([0x0000, 0xff00])
9844    # 2222/170D, 23/13
9845    pkt = NCP(0x170D, "Log Network Message", 'file')
9846    pkt.Request( (11, 68), [
9847            rec( 10, (1, 58), TargetMessage, info_str=(TargetMessage, "Log Network Message: %s", ", %s") ),
9848    ])
9849    pkt.Reply(8)
9850    pkt.CompletionCodes([0x0000, 0x8000, 0x8100, 0x8800, 0x8d00, 0x8e00, 0x8f00,
9851                         0x9001, 0x9400, 0x9600, 0x9804, 0x9900, 0x9b00, 0xa100,
9852                         0xa201, 0xff00])
9853    # 2222/170E, 23/14
9854    pkt = NCP(0x170E, "Get Disk Utilization", 'fileserver')
9855    pkt.Request( 15, [
9856            rec( 10, 1, VolumeNumber ),
9857            rec( 11, 4, TrusteeID, ENC_BIG_ENDIAN ),
9858    ])
9859    pkt.Reply( 19, [
9860            rec( 8, 1, VolumeNumber ),
9861            rec( 9, 4, TrusteeID, ENC_BIG_ENDIAN ),
9862            rec( 13, 2, DirectoryCount, ENC_BIG_ENDIAN ),
9863            rec( 15, 2, FileCount, ENC_BIG_ENDIAN ),
9864            rec( 17, 2, ClusterCount, ENC_BIG_ENDIAN ),
9865    ])
9866    pkt.CompletionCodes([0x0000, 0x9600, 0x9804, 0xa100, 0xf200])
9867    # 2222/170F, 23/15
9868    pkt = NCP(0x170F, "Scan File Information", 'file')
9869    pkt.Request((15,269), [
9870            rec( 10, 2, LastSearchIndex ),
9871            rec( 12, 1, DirHandle ),
9872            rec( 13, 1, SearchAttributes ),
9873            rec( 14, (1, 255), FileName, info_str=(FileName, "Scan File Information: %s", ", %s") ),
9874    ])
9875    pkt.Reply( 102, [
9876            rec( 8, 2, NextSearchIndex ),
9877            rec( 10, 14, FileName14 ),
9878            rec( 24, 2, AttributesDef16 ),
9879            rec( 26, 4, FileSize, ENC_BIG_ENDIAN ),
9880            rec( 30, 2, CreationDate, ENC_BIG_ENDIAN ),
9881            rec( 32, 2, LastAccessedDate, ENC_BIG_ENDIAN ),
9882            rec( 34, 2, ModifiedDate, ENC_BIG_ENDIAN ),
9883            rec( 36, 2, ModifiedTime, ENC_BIG_ENDIAN ),
9884            rec( 38, 4, CreatorID, ENC_BIG_ENDIAN ),
9885            rec( 42, 2, ArchivedDate, ENC_BIG_ENDIAN ),
9886            rec( 44, 2, ArchivedTime, ENC_BIG_ENDIAN ),
9887            rec( 46, 56, Reserved56 ),
9888    ])
9889    pkt.CompletionCodes([0x0000, 0x8800, 0x8900, 0x9300, 0x9400, 0x9804, 0x9b00, 0x9c00,
9890                         0xa100, 0xfd00, 0xff17])
9891    # 2222/1710, 23/16
9892    pkt = NCP(0x1710, "Set File Information", 'file')
9893    pkt.Request((91,345), [
9894            rec( 10, 2, AttributesDef16 ),
9895            rec( 12, 4, FileSize, ENC_BIG_ENDIAN ),
9896            rec( 16, 2, CreationDate, ENC_BIG_ENDIAN ),
9897            rec( 18, 2, LastAccessedDate, ENC_BIG_ENDIAN ),
9898            rec( 20, 2, ModifiedDate, ENC_BIG_ENDIAN ),
9899            rec( 22, 2, ModifiedTime, ENC_BIG_ENDIAN ),
9900            rec( 24, 4, CreatorID, ENC_BIG_ENDIAN ),
9901            rec( 28, 2, ArchivedDate, ENC_BIG_ENDIAN ),
9902            rec( 30, 2, ArchivedTime, ENC_BIG_ENDIAN ),
9903            rec( 32, 56, Reserved56 ),
9904            rec( 88, 1, DirHandle ),
9905            rec( 89, 1, SearchAttributes ),
9906            rec( 90, (1, 255), FileName, info_str=(FileName, "Set Information for File: %s", ", %s") ),
9907    ])
9908    pkt.Reply(8)
9909    pkt.CompletionCodes([0x0000, 0x8800, 0x8c00, 0x8e00, 0x9400, 0x9600, 0x9804,
9910                         0x9b03, 0x9c00, 0xa100, 0xa201, 0xfc06, 0xfd00, 0xfe07,
9911                         0xff17])
9912    # 2222/1711, 23/17
9913    pkt = NCP(0x1711, "Get File Server Information", 'fileserver')
9914    pkt.Request(10)
9915    pkt.Reply(136, [
9916            rec( 8, 48, ServerName ),
9917            rec( 56, 1, OSMajorVersion ),
9918            rec( 57, 1, OSMinorVersion ),
9919            rec( 58, 2, ConnectionsSupportedMax, ENC_BIG_ENDIAN ),
9920            rec( 60, 2, ConnectionsInUse, ENC_BIG_ENDIAN ),
9921            rec( 62, 2, VolumesSupportedMax, ENC_BIG_ENDIAN ),
9922            rec( 64, 1, OSRevision ),
9923            rec( 65, 1, SFTSupportLevel ),
9924            rec( 66, 1, TTSLevel ),
9925            rec( 67, 2, ConnectionsMaxUsed, ENC_BIG_ENDIAN ),
9926            rec( 69, 1, AccountVersion ),
9927            rec( 70, 1, VAPVersion ),
9928            rec( 71, 1, QueueingVersion ),
9929            rec( 72, 1, PrintServerVersion ),
9930            rec( 73, 1, VirtualConsoleVersion ),
9931            rec( 74, 1, SecurityRestrictionVersion ),
9932            rec( 75, 1, InternetBridgeVersion ),
9933            rec( 76, 1, MixedModePathFlag ),
9934            rec( 77, 1, LocalLoginInfoCcode ),
9935            rec( 78, 2, ProductMajorVersion, ENC_BIG_ENDIAN ),
9936            rec( 80, 2, ProductMinorVersion, ENC_BIG_ENDIAN ),
9937            rec( 82, 2, ProductRevisionVersion, ENC_BIG_ENDIAN ),
9938            rec( 84, 1, OSLanguageID, ENC_LITTLE_ENDIAN ),
9939            rec( 85, 1, SixtyFourBitOffsetsSupportedFlag ),
9940            rec( 86, 1, OESServer ),
9941            rec( 87, 1, OESLinuxOrNetWare ),
9942            rec( 88, 48, Reserved48 ),
9943    ])
9944    pkt.MakeExpert("ncp1711_reply")
9945    pkt.CompletionCodes([0x0000, 0x9600])
9946    # 2222/1712, 23/18
9947    pkt = NCP(0x1712, "Get Network Serial Number", 'fileserver')
9948    pkt.Request(10)
9949    pkt.Reply(14, [
9950            rec( 8, 4, ServerSerialNumber ),
9951            rec( 12, 2, ApplicationNumber ),
9952    ])
9953    pkt.CompletionCodes([0x0000, 0x9600])
9954    # 2222/1713, 23/19
9955    pkt = NCP(0x1713, "Get Internet Address", 'connection')
9956    pkt.Request(11, [
9957            rec( 10, 1, TargetConnectionNumber, info_str=(TargetConnectionNumber, "Get Internet Address for Connection %d", ", %d") ),
9958    ])
9959    pkt.Reply(20, [
9960            rec( 8, 4, NetworkAddress, ENC_BIG_ENDIAN ),
9961            rec( 12, 6, NetworkNodeAddress ),
9962            rec( 18, 2, NetworkSocket, ENC_BIG_ENDIAN ),
9963    ])
9964    pkt.CompletionCodes([0x0000, 0xff00])
9965    # 2222/1714, 23/20
9966    pkt = NCP(0x1714, "Login Object", 'connection')
9967    pkt.Request( (14, 60), [
9968            rec( 10, 2, ObjectType, ENC_BIG_ENDIAN ),
9969            rec( 12, (1,16), ClientName, info_str=(ClientName, "Login Object: %s", ", %s") ),
9970            rec( -1, (1,32), Password ),
9971    ])
9972    pkt.Reply(8)
9973    pkt.CompletionCodes([0x0000, 0x9602, 0xc101, 0xc200, 0xc501, 0xd600, 0xd700,
9974                         0xd900, 0xda00, 0xdb00, 0xde00, 0xdf00, 0xe800, 0xec00,
9975                         0xed00, 0xef00, 0xf001, 0xf100, 0xf200, 0xf600, 0xfb00,
9976                         0xfc06, 0xfe07, 0xff00])
9977    # 2222/1715, 23/21
9978    pkt = NCP(0x1715, "Get Object Connection List", 'connection')
9979    pkt.Request( (13, 28), [
9980            rec( 10, 2, ObjectType, ENC_BIG_ENDIAN ),
9981            rec( 12, (1,16), ObjectName, info_str=(ObjectName, "Get Object Connection List: %s", ", %s") ),
9982    ])
9983    pkt.Reply( (9, 136), [
9984            rec( 8, (1, 128), ConnectionNumberList ),
9985    ])
9986    pkt.CompletionCodes([0x0000, 0x9600, 0xf001, 0xfc06, 0xfe07, 0xff00])
9987    # 2222/1716, 23/22
9988    pkt = NCP(0x1716, "Get Station's Logged Info", 'connection')
9989    pkt.Request( 11, [
9990            rec( 10, 1, TargetConnectionNumber ),
9991    ])
9992    pkt.Reply( 70, [
9993            rec( 8, 4, UserID, ENC_BIG_ENDIAN ),
9994            rec( 12, 2, ObjectType, ENC_BIG_ENDIAN ),
9995            rec( 14, 48, ObjectNameLen ),
9996            rec( 62, 7, LoginTime ),
9997            rec( 69, 1, Reserved ),
9998    ])
9999    pkt.CompletionCodes([0x0000, 0x9602, 0xfb0a, 0xfc06, 0xfd00, 0xfe07, 0xff00])
10000    # 2222/1717, 23/23
10001    pkt = NCP(0x1717, "Get Login Key", 'connection')
10002    pkt.Request(10)
10003    pkt.Reply( 16, [
10004            rec( 8, 8, LoginKey ),
10005    ])
10006    pkt.CompletionCodes([0x0000, 0x9602])
10007    # 2222/1718, 23/24
10008    pkt = NCP(0x1718, "Keyed Object Login", 'connection')
10009    pkt.Request( (21, 68), [
10010            rec( 10, 8, LoginKey ),
10011            rec( 18, 2, ObjectType, ENC_BIG_ENDIAN ),
10012            rec( 20, (1,48), ObjectName, info_str=(ObjectName, "Keyed Object Login: %s", ", %s") ),
10013    ])
10014    pkt.Reply(8)
10015    pkt.CompletionCodes([0x0000, 0x9602, 0xc101, 0xc200, 0xc500, 0xd904, 0xda00,
10016                         0xdb00, 0xdc00, 0xde00, 0xff00])
10017    # 2222/171A, 23/26
10018    pkt = NCP(0x171A, "Get Internet Address", 'connection')
10019    pkt.Request(12, [
10020            rec( 10, 2, TargetConnectionNumber ),
10021    ])
10022# Dissect reply in packet-ncp2222.inc
10023    pkt.Reply(8)
10024    pkt.CompletionCodes([0x0000])
10025    # 2222/171B, 23/27
10026    pkt = NCP(0x171B, "Get Object Connection List", 'connection')
10027    pkt.Request( (17,64), [
10028            rec( 10, 4, SearchConnNumber ),
10029            rec( 14, 2, ObjectType, ENC_BIG_ENDIAN ),
10030            rec( 16, (1,48), ObjectName, info_str=(ObjectName, "Get Object Connection List: %s", ", %s") ),
10031    ])
10032    pkt.Reply( (13), [
10033            rec( 8, 1, ConnListLen, var="x" ),
10034            rec( 9, 4, ConnectionNumber, ENC_LITTLE_ENDIAN, repeat="x" ),
10035    ])
10036    pkt.CompletionCodes([0x0000, 0x9600, 0xf001, 0xfc06, 0xfe07, 0xff00])
10037    # 2222/171C, 23/28
10038    pkt = NCP(0x171C, "Get Station's Logged Info", 'connection')
10039    pkt.Request( 14, [
10040            rec( 10, 4, TargetConnectionNumber ),
10041    ])
10042    pkt.Reply( 70, [
10043            rec( 8, 4, UserID, ENC_BIG_ENDIAN ),
10044            rec( 12, 2, ObjectType, ENC_BIG_ENDIAN ),
10045            rec( 14, 48, ObjectNameLen ),
10046            rec( 62, 7, LoginTime ),
10047            rec( 69, 1, Reserved ),
10048    ])
10049    pkt.CompletionCodes([0x0000, 0x7d00, 0x9602, 0xfb02, 0xfc06, 0xfd00, 0xfe07, 0xff00])
10050    # 2222/171D, 23/29
10051    pkt = NCP(0x171D, "Change Connection State", 'connection')
10052    pkt.Request( 11, [
10053            rec( 10, 1, RequestCode ),
10054    ])
10055    pkt.Reply(8)
10056    pkt.CompletionCodes([0x0000, 0x0109, 0x7a00, 0x7b00, 0x7c00, 0xe000, 0xfb06, 0xfd00])
10057    # 2222/171E, 23/30
10058    pkt = NCP(0x171E, "Set Watchdog Delay Interval", 'connection')
10059    pkt.Request( 14, [
10060            rec( 10, 4, NumberOfMinutesToDelay ),
10061    ])
10062    pkt.Reply(8)
10063    pkt.CompletionCodes([0x0000, 0x0107])
10064    # 2222/171F, 23/31
10065    pkt = NCP(0x171F, "Get Connection List From Object", 'connection')
10066    pkt.Request( 18, [
10067            rec( 10, 4, ObjectID, ENC_BIG_ENDIAN ),
10068            rec( 14, 4, ConnectionNumber ),
10069    ])
10070    pkt.Reply( (9, 136), [
10071            rec( 8, (1, 128), ConnectionNumberList ),
10072    ])
10073    pkt.CompletionCodes([0x0000, 0x9600, 0xf001, 0xfc06, 0xfe07, 0xff00])
10074    # 2222/1720, 23/32
10075    pkt = NCP(0x1720, "Scan Bindery Object (List)", 'bindery')
10076    pkt.Request((23,70), [
10077            rec( 10, 4, NextObjectID, ENC_BIG_ENDIAN ),
10078            rec( 14, 2, ObjectType, ENC_BIG_ENDIAN ),
10079    rec( 16, 2, Reserved2 ),
10080            rec( 18, 4, InfoFlags ),
10081            rec( 22, (1,48), ObjectName, info_str=(ObjectName, "Scan Bindery Object: %s", ", %s") ),
10082    ])
10083    pkt.Reply(NO_LENGTH_CHECK, [
10084            rec( 8, 4, ObjectInfoReturnCount ),
10085            rec( 12, 4, NextObjectID, ENC_BIG_ENDIAN ),
10086            rec( 16, 4, ObjectID ),
10087            srec(ObjectTypeStruct, req_cond="ncp.info_flags_type == TRUE"),
10088            srec(ObjectSecurityStruct, req_cond="ncp.info_flags_security == TRUE"),
10089            srec(ObjectFlagsStruct, req_cond="ncp.info_flags_flags == TRUE"),
10090            srec(ObjectNameStruct, req_cond="ncp.info_flags_name == TRUE"),
10091    ])
10092    pkt.ReqCondSizeVariable()
10093    pkt.CompletionCodes([0x0000, 0x9600, 0xef01, 0xfc02, 0xfe01, 0xff00])
10094    # 2222/1721, 23/33
10095    pkt = NCP(0x1721, "Generate GUIDs", 'connection')
10096    pkt.Request( 14, [
10097            rec( 10, 4, ReturnInfoCount ),
10098    ])
10099    pkt.Reply(28, [
10100            rec( 8, 4, ReturnInfoCount, var="x" ),
10101            rec( 12, 16, GUID, repeat="x" ),
10102    ])
10103    pkt.CompletionCodes([0x0000, 0x7e01])
10104# 2222/1722, 23/34
10105    pkt = NCP(0x1722, "Set Connection Language Encoding", 'connection')
10106    pkt.Request( 22, [
10107            rec( 10, 4, SetMask ),
10108    rec( 14, 4, NCPEncodedStringsBits ),
10109    rec( 18, 4, CodePage ),
10110    ])
10111    pkt.Reply(8)
10112    pkt.CompletionCodes([0x0000])
10113    # 2222/1732, 23/50
10114    pkt = NCP(0x1732, "Create Bindery Object", 'bindery')
10115    pkt.Request( (15,62), [
10116            rec( 10, 1, ObjectFlags ),
10117            rec( 11, 1, ObjectSecurity ),
10118            rec( 12, 2, ObjectType, ENC_BIG_ENDIAN ),
10119            rec( 14, (1,48), ObjectName, info_str=(ObjectName, "Create Bindery Object: %s", ", %s") ),
10120    ])
10121    pkt.Reply(8)
10122    pkt.CompletionCodes([0x0000, 0x9600, 0xe700, 0xee00, 0xef00, 0xf101, 0xf501,
10123                         0xfc06, 0xfe07, 0xff00])
10124    # 2222/1733, 23/51
10125    pkt = NCP(0x1733, "Delete Bindery Object", 'bindery')
10126    pkt.Request( (13,60), [
10127            rec( 10, 2, ObjectType, ENC_BIG_ENDIAN ),
10128            rec( 12, (1,48), ObjectName, info_str=(ObjectName, "Delete Bindery Object: %s", ", %s") ),
10129    ])
10130    pkt.Reply(8)
10131    pkt.CompletionCodes([0x0000, 0x9600, 0xf000, 0xf200, 0xf400, 0xf600, 0xfb00,
10132                         0xfc06, 0xfe07, 0xff00])
10133    # 2222/1734, 23/52
10134    pkt = NCP(0x1734, "Rename Bindery Object", 'bindery')
10135    pkt.Request( (14,108), [
10136            rec( 10, 2, ObjectType, ENC_BIG_ENDIAN ),
10137            rec( 12, (1,48), ObjectName, info_str=(ObjectName, "Rename Bindery Object: %s", ", %s") ),
10138            rec( -1, (1,48), NewObjectName ),
10139    ])
10140    pkt.Reply(8)
10141    pkt.CompletionCodes([0x0000, 0x9600, 0xee00, 0xf000, 0xf300, 0xfc06, 0xfe07, 0xff00])
10142    # 2222/1735, 23/53
10143    pkt = NCP(0x1735, "Get Bindery Object ID", 'bindery')
10144    pkt.Request((13,60), [
10145            rec( 10, 2, ObjectType, ENC_BIG_ENDIAN ),
10146            rec( 12, (1,48), ObjectName, info_str=(ObjectName, "Get Bindery Object: %s", ", %s") ),
10147    ])
10148    pkt.Reply(62, [
10149            rec( 8, 4, ObjectID, ENC_LITTLE_ENDIAN ),
10150            rec( 12, 2, ObjectType, ENC_BIG_ENDIAN ),
10151            rec( 14, 48, ObjectNameLen ),
10152    ])
10153    pkt.CompletionCodes([0x0000, 0x9600, 0xef01, 0xf000, 0xfc02, 0xfe01, 0xff00])
10154    # 2222/1736, 23/54
10155    pkt = NCP(0x1736, "Get Bindery Object Name", 'bindery')
10156    pkt.Request( 14, [
10157            rec( 10, 4, ObjectID, ENC_BIG_ENDIAN ),
10158    ])
10159    pkt.Reply( 62, [
10160            rec( 8, 4, ObjectID, ENC_BIG_ENDIAN ),
10161            rec( 12, 2, ObjectType, ENC_BIG_ENDIAN ),
10162            rec( 14, 48, ObjectNameLen ),
10163    ])
10164    pkt.CompletionCodes([0x0000, 0x9600, 0xf101, 0xfc02, 0xfe01, 0xff00])
10165    # 2222/1737, 23/55
10166    pkt = NCP(0x1737, "Scan Bindery Object", 'bindery')
10167    pkt.Request((17,64), [
10168            rec( 10, 4, ObjectID, ENC_BIG_ENDIAN ),
10169            rec( 14, 2, ObjectType, ENC_BIG_ENDIAN ),
10170            rec( 16, (1,48), ObjectName, info_str=(ObjectName, "Scan Bindery Object: %s", ", %s") ),
10171    ])
10172    pkt.Reply(65, [
10173            rec( 8, 4, ObjectID, ENC_BIG_ENDIAN ),
10174            rec( 12, 2, ObjectType, ENC_BIG_ENDIAN ),
10175            rec( 14, 48, ObjectNameLen ),
10176            rec( 62, 1, ObjectFlags ),
10177            rec( 63, 1, ObjectSecurity ),
10178            rec( 64, 1, ObjectHasProperties ),
10179    ])
10180    pkt.CompletionCodes([0x0000, 0x9600, 0xef01, 0xfc02,
10181                         0xfe01, 0xff00])
10182    # 2222/1738, 23/56
10183    pkt = NCP(0x1738, "Change Bindery Object Security", 'bindery')
10184    pkt.Request((14,61), [
10185            rec( 10, 1, ObjectSecurity ),
10186            rec( 11, 2, ObjectType, ENC_BIG_ENDIAN ),
10187            rec( 13, (1,48), ObjectName, info_str=(ObjectName, "Change Bindery Object Security: %s", ", %s") ),
10188    ])
10189    pkt.Reply(8)
10190    pkt.CompletionCodes([0x0000, 0x9600, 0xf000, 0xf101, 0xf501, 0xfc02, 0xfe01, 0xff00])
10191    # 2222/1739, 23/57
10192    pkt = NCP(0x1739, "Create Property", 'bindery')
10193    pkt.Request((16,78), [
10194            rec( 10, 2, ObjectType, ENC_BIG_ENDIAN ),
10195            rec( 12, (1,48), ObjectName ),
10196            rec( -1, 1, PropertyType ),
10197            rec( -1, 1, ObjectSecurity ),
10198            rec( -1, (1,16), PropertyName, info_str=(PropertyName, "Create Property: %s", ", %s") ),
10199    ])
10200    pkt.Reply(8)
10201    pkt.CompletionCodes([0x0000, 0x9600, 0xed00, 0xef00, 0xf000, 0xf101,
10202                         0xf200, 0xf600, 0xf700, 0xfb00, 0xfc02, 0xfe01,
10203                         0xff00])
10204    # 2222/173A, 23/58
10205    pkt = NCP(0x173A, "Delete Property", 'bindery')
10206    pkt.Request((14,76), [
10207            rec( 10, 2, ObjectType, ENC_BIG_ENDIAN ),
10208            rec( 12, (1,48), ObjectName ),
10209            rec( -1, (1,16), PropertyName, info_str=(PropertyName, "Delete Property: %s", ", %s") ),
10210    ])
10211    pkt.Reply(8)
10212    pkt.CompletionCodes([0x0000, 0x9600, 0xf000, 0xf101, 0xf600, 0xfb00, 0xfc02,
10213                         0xfe01, 0xff00])
10214    # 2222/173B, 23/59
10215    pkt = NCP(0x173B, "Change Property Security", 'bindery')
10216    pkt.Request((15,77), [
10217            rec( 10, 2, ObjectType, ENC_BIG_ENDIAN ),
10218            rec( 12, (1,48), ObjectName ),
10219            rec( -1, 1, ObjectSecurity ),
10220            rec( -1, (1,16), PropertyName, info_str=(PropertyName, "Change Property Security: %s", ", %s") ),
10221    ])
10222    pkt.Reply(8)
10223    pkt.CompletionCodes([0x0000, 0x9600, 0xf000, 0xf101, 0xf200, 0xf600, 0xfb00,
10224                         0xfc02, 0xfe01, 0xff00])
10225    # 2222/173C, 23/60
10226    pkt = NCP(0x173C, "Scan Property", 'bindery')
10227    pkt.Request((18,80), [
10228            rec( 10, 2, ObjectType, ENC_BIG_ENDIAN ),
10229            rec( 12, (1,48), ObjectName ),
10230            rec( -1, 4, LastInstance, ENC_BIG_ENDIAN ),
10231            rec( -1, (1,16), PropertyName, info_str=(PropertyName, "Scan Property: %s", ", %s") ),
10232    ])
10233    pkt.Reply( 32, [
10234            rec( 8, 16, PropertyName16 ),
10235            rec( 24, 1, ObjectFlags ),
10236            rec( 25, 1, ObjectSecurity ),
10237            rec( 26, 4, SearchInstance, ENC_BIG_ENDIAN ),
10238            rec( 30, 1, ValueAvailable ),
10239            rec( 31, 1, MoreProperties ),
10240    ])
10241    pkt.CompletionCodes([0x0000, 0x9600, 0xf000, 0xf101, 0xf200, 0xf600, 0xfb00,
10242                         0xfc02, 0xfe01, 0xff00])
10243    # 2222/173D, 23/61
10244    pkt = NCP(0x173D, "Read Property Value", 'bindery')
10245    pkt.Request((15,77), [
10246            rec( 10, 2, ObjectType, ENC_BIG_ENDIAN ),
10247            rec( 12, (1,48), ObjectName ),
10248            rec( -1, 1, PropertySegment ),
10249            rec( -1, (1,16), PropertyName, info_str=(PropertyName, "Read Property Value: %s", ", %s") ),
10250    ])
10251    pkt.Reply(138, [
10252            rec( 8, 128, PropertyData ),
10253            rec( 136, 1, PropertyHasMoreSegments ),
10254            rec( 137, 1, PropertyType ),
10255    ])
10256    pkt.CompletionCodes([0x0000, 0x8800, 0x9300, 0x9600, 0xec01,
10257                         0xf000, 0xf100, 0xf900, 0xfb02, 0xfc02,
10258                         0xfe01, 0xff00])
10259    # 2222/173E, 23/62
10260    pkt = NCP(0x173E, "Write Property Value", 'bindery')
10261    pkt.Request((144,206), [
10262            rec( 10, 2, ObjectType, ENC_BIG_ENDIAN ),
10263            rec( 12, (1,48), ObjectName ),
10264            rec( -1, 1, PropertySegment ),
10265            rec( -1, 1, MoreFlag ),
10266            rec( -1, (1,16), PropertyName, info_str=(PropertyName, "Write Property Value: %s", ", %s") ),
10267            #
10268            # XXX - don't show this if MoreFlag isn't set?
10269            # In at least some packages where it's not set,
10270            # PropertyValue appears to be garbage.
10271            #
10272            rec( -1, 128, PropertyValue ),
10273    ])
10274    pkt.Reply(8)
10275    pkt.CompletionCodes([0x0000, 0x9600, 0xe800, 0xec01, 0xf000, 0xf800,
10276                         0xfb02, 0xfc03, 0xfe01, 0xff00 ])
10277    # 2222/173F, 23/63
10278    pkt = NCP(0x173F, "Verify Bindery Object Password", 'bindery')
10279    pkt.Request((14,92), [
10280            rec( 10, 2, ObjectType, ENC_BIG_ENDIAN ),
10281            rec( 12, (1,48), ObjectName, info_str=(ObjectName, "Verify Bindery Object Password: %s", ", %s") ),
10282            rec( -1, (1,32), Password ),
10283    ])
10284    pkt.Reply(8)
10285    pkt.CompletionCodes([0x0000, 0x9600, 0xe800, 0xec01, 0xf000, 0xf101,
10286                         0xfb02, 0xfc03, 0xfe01, 0xff00 ])
10287    # 2222/1740, 23/64
10288    pkt = NCP(0x1740, "Change Bindery Object Password", 'bindery')
10289    pkt.Request((15,124), [
10290            rec( 10, 2, ObjectType, ENC_BIG_ENDIAN ),
10291            rec( 12, (1,48), ObjectName, info_str=(ObjectName, "Change Bindery Object Password: %s", ", %s") ),
10292            rec( -1, (1,32), Password ),
10293            rec( -1, (1,32), NewPassword ),
10294    ])
10295    pkt.Reply(8)
10296    pkt.CompletionCodes([0x0000, 0x9600, 0xc501, 0xd701, 0xe800, 0xec01, 0xf001,
10297                         0xf100, 0xf800, 0xfb02, 0xfc03, 0xfe01, 0xff00])
10298    # 2222/1741, 23/65
10299    pkt = NCP(0x1741, "Add Bindery Object To Set", 'bindery')
10300    pkt.Request((17,126), [
10301            rec( 10, 2, ObjectType, ENC_BIG_ENDIAN ),
10302            rec( 12, (1,48), ObjectName ),
10303            rec( -1, (1,16), PropertyName ),
10304            rec( -1, 2, MemberType, ENC_BIG_ENDIAN ),
10305            rec( -1, (1,48), MemberName, info_str=(MemberName, "Add Bindery Object to Set: %s", ", %s") ),
10306    ])
10307    pkt.Reply(8)
10308    pkt.CompletionCodes([0x0000, 0x9600, 0xe800, 0xe900, 0xea00, 0xeb00,
10309                         0xec01, 0xf000, 0xf800, 0xfb02, 0xfc03, 0xfe01,
10310                         0xff00])
10311    # 2222/1742, 23/66
10312    pkt = NCP(0x1742, "Delete Bindery Object From Set", 'bindery')
10313    pkt.Request((17,126), [
10314            rec( 10, 2, ObjectType, ENC_BIG_ENDIAN ),
10315            rec( 12, (1,48), ObjectName ),
10316            rec( -1, (1,16), PropertyName ),
10317            rec( -1, 2, MemberType, ENC_BIG_ENDIAN ),
10318            rec( -1, (1,48), MemberName, info_str=(MemberName, "Delete Bindery Object from Set: %s", ", %s") ),
10319    ])
10320    pkt.Reply(8)
10321    pkt.CompletionCodes([0x0000, 0x9600, 0xeb00, 0xf000, 0xf800, 0xfb02,
10322                         0xfc03, 0xfe01, 0xff00])
10323    # 2222/1743, 23/67
10324    pkt = NCP(0x1743, "Is Bindery Object In Set", 'bindery')
10325    pkt.Request((17,126), [
10326            rec( 10, 2, ObjectType, ENC_BIG_ENDIAN ),
10327            rec( 12, (1,48), ObjectName ),
10328            rec( -1, (1,16), PropertyName ),
10329            rec( -1, 2, MemberType, ENC_BIG_ENDIAN ),
10330            rec( -1, (1,48), MemberName, info_str=(MemberName, "Is Bindery Object in Set: %s", ", %s") ),
10331    ])
10332    pkt.Reply(8)
10333    pkt.CompletionCodes([0x0000, 0x9600, 0xea00, 0xeb00, 0xec01, 0xf000,
10334                         0xfb02, 0xfc03, 0xfe01, 0xff00])
10335    # 2222/1744, 23/68
10336    pkt = NCP(0x1744, "Close Bindery", 'bindery')
10337    pkt.Request(10)
10338    pkt.Reply(8)
10339    pkt.CompletionCodes([0x0000, 0xff00])
10340    # 2222/1745, 23/69
10341    pkt = NCP(0x1745, "Open Bindery", 'bindery')
10342    pkt.Request(10)
10343    pkt.Reply(8)
10344    pkt.CompletionCodes([0x0000, 0xff00])
10345    # 2222/1746, 23/70
10346    pkt = NCP(0x1746, "Get Bindery Access Level", 'bindery')
10347    pkt.Request(10)
10348    pkt.Reply(13, [
10349            rec( 8, 1, ObjectSecurity ),
10350            rec( 9, 4, LoggedObjectID, ENC_BIG_ENDIAN ),
10351    ])
10352    pkt.CompletionCodes([0x0000, 0x9600])
10353    # 2222/1747, 23/71
10354    pkt = NCP(0x1747, "Scan Bindery Object Trustee Paths", 'bindery')
10355    pkt.Request(17, [
10356            rec( 10, 1, VolumeNumber ),
10357            rec( 11, 2, LastSequenceNumber, ENC_BIG_ENDIAN ),
10358            rec( 13, 4, ObjectID, ENC_BIG_ENDIAN ),
10359    ])
10360    pkt.Reply((16,270), [
10361            rec( 8, 2, LastSequenceNumber, ENC_BIG_ENDIAN),
10362            rec( 10, 4, ObjectID, ENC_BIG_ENDIAN ),
10363            rec( 14, 1, ObjectSecurity ),
10364            rec( 15, (1,255), Path ),
10365    ])
10366    pkt.CompletionCodes([0x0000, 0x9300, 0x9600, 0xa100, 0xf000, 0xf100,
10367                         0xf200, 0xfc02, 0xfe01, 0xff00])
10368    # 2222/1748, 23/72
10369    pkt = NCP(0x1748, "Get Bindery Object Access Level", 'bindery')
10370    pkt.Request(14, [
10371            rec( 10, 4, ObjectID, ENC_BIG_ENDIAN ),
10372    ])
10373    pkt.Reply(9, [
10374            rec( 8, 1, ObjectSecurity ),
10375    ])
10376    pkt.CompletionCodes([0x0000, 0x9600])
10377    # 2222/1749, 23/73
10378    pkt = NCP(0x1749, "Is Calling Station a Manager", 'bindery')
10379    pkt.Request(10)
10380    pkt.Reply(8)
10381    pkt.CompletionCodes([0x0003, 0xff1e])
10382    # 2222/174A, 23/74
10383    pkt = NCP(0x174A, "Keyed Verify Password", 'bindery')
10384    pkt.Request((21,68), [
10385            rec( 10, 8, LoginKey ),
10386            rec( 18, 2, ObjectType, ENC_BIG_ENDIAN ),
10387            rec( 20, (1,48), ObjectName, info_str=(ObjectName, "Keyed Verify Password: %s", ", %s") ),
10388    ])
10389    pkt.Reply(8)
10390    pkt.CompletionCodes([0x0000, 0xc500, 0xfe01, 0xff0c])
10391    # 2222/174B, 23/75
10392    pkt = NCP(0x174B, "Keyed Change Password", 'bindery')
10393    pkt.Request((22,100), [
10394            rec( 10, 8, LoginKey ),
10395            rec( 18, 2, ObjectType, ENC_BIG_ENDIAN ),
10396            rec( 20, (1,48), ObjectName, info_str=(ObjectName, "Keyed Change Password: %s", ", %s") ),
10397            rec( -1, (1,32), Password ),
10398    ])
10399    pkt.Reply(8)
10400    pkt.CompletionCodes([0x0000, 0xc500, 0xfe01, 0xff0c])
10401    # 2222/174C, 23/76
10402    pkt = NCP(0x174C, "List Relations Of an Object", 'bindery')
10403    pkt.Request((18,80), [
10404            rec( 10, 4, LastSeen, ENC_BIG_ENDIAN ),
10405            rec( 14, 2, ObjectType, ENC_BIG_ENDIAN ),
10406            rec( 16, (1,48), ObjectName, info_str=(ObjectName, "List Relations of an Object: %s", ", %s") ),
10407            rec( -1, (1,16), PropertyName ),
10408    ])
10409    pkt.Reply(14, [
10410            rec( 8, 2, RelationsCount, ENC_BIG_ENDIAN, var="x" ),
10411            rec( 10, 4, ObjectID, ENC_BIG_ENDIAN, repeat="x" ),
10412    ])
10413    pkt.CompletionCodes([0x0000, 0xf000, 0xf200, 0xfe01, 0xff00])
10414    # 2222/1764, 23/100
10415    pkt = NCP(0x1764, "Create Queue", 'qms')
10416    pkt.Request((15,316), [
10417            rec( 10, 2, QueueType, ENC_BIG_ENDIAN ),
10418            rec( 12, (1,48), QueueName, info_str=(QueueName, "Create Queue: %s", ", %s") ),
10419            rec( -1, 1, PathBase ),
10420            rec( -1, (1,255), Path ),
10421    ])
10422    pkt.Reply(12, [
10423            rec( 8, 4, QueueID ),
10424    ])
10425    pkt.CompletionCodes([0x0000, 0x9600, 0x9900, 0xd000, 0xd100,
10426                         0xd200, 0xd300, 0xd400, 0xd500, 0xd601,
10427                         0xd703, 0xd800, 0xd902, 0xda01, 0xdb02,
10428                         0xee00, 0xff00])
10429    # 2222/1765, 23/101
10430    pkt = NCP(0x1765, "Destroy Queue", 'qms')
10431    pkt.Request(14, [
10432            rec( 10, 4, QueueID ),
10433    ])
10434    pkt.Reply(8)
10435    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10436                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10437                         0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
10438    # 2222/1766, 23/102
10439    pkt = NCP(0x1766, "Read Queue Current Status", 'qms')
10440    pkt.Request(14, [
10441            rec( 10, 4, QueueID ),
10442    ])
10443    pkt.Reply(20, [
10444            rec( 8, 4, QueueID ),
10445            rec( 12, 1, QueueStatus ),
10446            rec( 13, 1, CurrentEntries ),
10447            rec( 14, 1, CurrentServers, var="x" ),
10448            rec( 15, 4, ServerID, repeat="x" ),
10449            rec( 19, 1, ServerStationList, repeat="x" ),
10450    ])
10451    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10452                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10453                         0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
10454    # 2222/1767, 23/103
10455    pkt = NCP(0x1767, "Set Queue Current Status", 'qms')
10456    pkt.Request(15, [
10457            rec( 10, 4, QueueID ),
10458            rec( 14, 1, QueueStatus ),
10459    ])
10460    pkt.Reply(8)
10461    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10462                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10463                         0xd800, 0xd902, 0xda01, 0xdb02, 0xfc07,
10464                         0xff00])
10465    # 2222/1768, 23/104
10466    pkt = NCP(0x1768, "Create Queue Job And File", 'qms')
10467    pkt.Request(264, [
10468            rec( 10, 4, QueueID ),
10469            rec( 14, 250, JobStruct ),
10470    ])
10471    pkt.Reply(62, [
10472            rec( 8, 1, ClientStation ),
10473            rec( 9, 1, ClientTaskNumber ),
10474            rec( 10, 4, ClientIDNumber, ENC_BIG_ENDIAN ),
10475            rec( 14, 4, TargetServerIDNumber, ENC_BIG_ENDIAN ),
10476            rec( 18, 6, TargetExecutionTime ),
10477            rec( 24, 6, JobEntryTime ),
10478            rec( 30, 2, JobNumber, ENC_BIG_ENDIAN ),
10479            rec( 32, 2, JobType, ENC_BIG_ENDIAN ),
10480            rec( 34, 1, JobPosition ),
10481            rec( 35, 1, JobControlFlags ),
10482            rec( 36, 14, JobFileName ),
10483            rec( 50, 6, JobFileHandle ),
10484            rec( 56, 1, ServerStation ),
10485            rec( 57, 1, ServerTaskNumber ),
10486            rec( 58, 4, ServerID, ENC_BIG_ENDIAN ),
10487    ])
10488    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10489                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10490                         0xd800, 0xd902, 0xda01, 0xdb02, 0xfc07,
10491                         0xff00])
10492    # 2222/1769, 23/105
10493    pkt = NCP(0x1769, "Close File And Start Queue Job", 'qms')
10494    pkt.Request(16, [
10495            rec( 10, 4, QueueID ),
10496            rec( 14, 2, JobNumber, ENC_BIG_ENDIAN ),
10497    ])
10498    pkt.Reply(8)
10499    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10500                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10501                         0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
10502    # 2222/176A, 23/106
10503    pkt = NCP(0x176A, "Remove Job From Queue", 'qms')
10504    pkt.Request(16, [
10505            rec( 10, 4, QueueID ),
10506            rec( 14, 2, JobNumber, ENC_BIG_ENDIAN ),
10507    ])
10508    pkt.Reply(8)
10509    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10510                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10511                         0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
10512    # 2222/176B, 23/107
10513    pkt = NCP(0x176B, "Get Queue Job List", 'qms')
10514    pkt.Request(14, [
10515            rec( 10, 4, QueueID ),
10516    ])
10517    pkt.Reply(12, [
10518            rec( 8, 2, JobCount, ENC_BIG_ENDIAN, var="x" ),
10519            rec( 10, 2, JobNumber, ENC_BIG_ENDIAN, repeat="x" ),
10520    ])
10521    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10522                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10523                         0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
10524    # 2222/176C, 23/108
10525    pkt = NCP(0x176C, "Read Queue Job Entry", 'qms')
10526    pkt.Request(16, [
10527            rec( 10, 4, QueueID ),
10528            rec( 14, 2, JobNumber, ENC_BIG_ENDIAN ),
10529    ])
10530    pkt.Reply(258, [
10531        rec( 8, 250, JobStruct ),
10532    ])
10533    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10534                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10535                         0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
10536    # 2222/176D, 23/109
10537    pkt = NCP(0x176D, "Change Queue Job Entry", 'qms')
10538    pkt.Request(260, [
10539        rec( 14, 250, JobStruct ),
10540    ])
10541    pkt.Reply(8)
10542    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10543                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10544                         0xd800, 0xd902, 0xda01, 0xdb02, 0xff18])
10545    # 2222/176E, 23/110
10546    pkt = NCP(0x176E, "Change Queue Job Position", 'qms')
10547    pkt.Request(17, [
10548            rec( 10, 4, QueueID ),
10549            rec( 14, 2, JobNumber, ENC_BIG_ENDIAN ),
10550            rec( 16, 1, NewPosition ),
10551    ])
10552    pkt.Reply(8)
10553    pkt.CompletionCodes([0x0000, 0x9600, 0xd000, 0xd100, 0xd300, 0xd500,
10554                         0xd601, 0xfe07, 0xff1f])
10555    # 2222/176F, 23/111
10556    pkt = NCP(0x176F, "Attach Queue Server To Queue", 'qms')
10557    pkt.Request(14, [
10558            rec( 10, 4, QueueID ),
10559    ])
10560    pkt.Reply(8)
10561    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10562                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10563                         0xd800, 0xd902, 0xda01, 0xdb02, 0xea00,
10564                         0xfc06, 0xff00])
10565    # 2222/1770, 23/112
10566    pkt = NCP(0x1770, "Detach Queue Server From Queue", 'qms')
10567    pkt.Request(14, [
10568            rec( 10, 4, QueueID ),
10569    ])
10570    pkt.Reply(8)
10571    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10572                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10573                         0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
10574    # 2222/1771, 23/113
10575    pkt = NCP(0x1771, "Service Queue Job", 'qms')
10576    pkt.Request(16, [
10577            rec( 10, 4, QueueID ),
10578            rec( 14, 2, ServiceType, ENC_BIG_ENDIAN ),
10579    ])
10580    pkt.Reply(62, [
10581            rec( 8, 1, ClientStation ),
10582            rec( 9, 1, ClientTaskNumber ),
10583            rec( 10, 4, ClientIDNumber, ENC_BIG_ENDIAN ),
10584            rec( 14, 4, TargetServerIDNumber, ENC_BIG_ENDIAN ),
10585            rec( 18, 6, TargetExecutionTime ),
10586            rec( 24, 6, JobEntryTime ),
10587            rec( 30, 2, JobNumber, ENC_BIG_ENDIAN ),
10588            rec( 32, 2, JobType, ENC_BIG_ENDIAN ),
10589            rec( 34, 1, JobPosition ),
10590            rec( 35, 1, JobControlFlags ),
10591            rec( 36, 14, JobFileName ),
10592            rec( 50, 6, JobFileHandle ),
10593            rec( 56, 1, ServerStation ),
10594            rec( 57, 1, ServerTaskNumber ),
10595            rec( 58, 4, ServerID, ENC_BIG_ENDIAN ),
10596    ])
10597    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10598                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10599                         0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
10600    # 2222/1772, 23/114
10601    pkt = NCP(0x1772, "Finish Servicing Queue Job", 'qms')
10602    pkt.Request(18, [
10603            rec( 10, 4, QueueID ),
10604            rec( 14, 2, JobNumber, ENC_BIG_ENDIAN ),
10605            rec( 16, 2, ChargeInformation, ENC_BIG_ENDIAN ),
10606    ])
10607    pkt.Reply(8)
10608    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10609                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10610                         0xd800, 0xd902, 0xda01, 0xdb02, 0xfc07, 0xff00])
10611    # 2222/1773, 23/115
10612    pkt = NCP(0x1773, "Abort Servicing Queue Job", 'qms')
10613    pkt.Request(16, [
10614            rec( 10, 4, QueueID ),
10615            rec( 14, 2, JobNumber, ENC_BIG_ENDIAN ),
10616    ])
10617    pkt.Reply(8)
10618    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10619                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10620                         0xd800, 0xd902, 0xda01, 0xdb02, 0xfc07, 0xff18])
10621    # 2222/1774, 23/116
10622    pkt = NCP(0x1774, "Change To Client Rights", 'qms')
10623    pkt.Request(16, [
10624            rec( 10, 4, QueueID ),
10625            rec( 14, 2, JobNumber, ENC_BIG_ENDIAN ),
10626    ])
10627    pkt.Reply(8)
10628    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10629                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10630                         0xd800, 0xd902, 0xda01, 0xdb02, 0xff18])
10631    # 2222/1775, 23/117
10632    pkt = NCP(0x1775, "Restore Queue Server Rights", 'qms')
10633    pkt.Request(10)
10634    pkt.Reply(8)
10635    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10636                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10637                         0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
10638    # 2222/1776, 23/118
10639    pkt = NCP(0x1776, "Read Queue Server Current Status", 'qms')
10640    pkt.Request(19, [
10641            rec( 10, 4, QueueID ),
10642            rec( 14, 4, ServerID, ENC_BIG_ENDIAN ),
10643            rec( 18, 1, ServerStation ),
10644    ])
10645    pkt.Reply(72, [
10646            rec( 8, 64, ServerStatusRecord ),
10647    ])
10648    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10649                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10650                         0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
10651    # 2222/1777, 23/119
10652    pkt = NCP(0x1777, "Set Queue Server Current Status", 'qms')
10653    pkt.Request(78, [
10654            rec( 10, 4, QueueID ),
10655            rec( 14, 64, ServerStatusRecord ),
10656    ])
10657    pkt.Reply(8)
10658    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10659                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10660                         0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
10661    # 2222/1778, 23/120
10662    pkt = NCP(0x1778, "Get Queue Job File Size", 'qms')
10663    pkt.Request(16, [
10664            rec( 10, 4, QueueID ),
10665            rec( 14, 2, JobNumber, ENC_BIG_ENDIAN ),
10666    ])
10667    pkt.Reply(18, [
10668            rec( 8, 4, QueueID ),
10669            rec( 12, 2, JobNumber, ENC_BIG_ENDIAN ),
10670            rec( 14, 4, FileSize, ENC_BIG_ENDIAN ),
10671    ])
10672    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10673                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10674                         0xd800, 0xd902, 0xda01, 0xdb02, 0xfc07, 0xff00])
10675    # 2222/1779, 23/121
10676    pkt = NCP(0x1779, "Create Queue Job And File", 'qms')
10677    pkt.Request(264, [
10678            rec( 10, 4, QueueID ),
10679            rec( 14, 250, JobStruct3x ),
10680    ])
10681    pkt.Reply(94, [
10682            rec( 8, 86, JobStructNew ),
10683    ])
10684    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10685                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10686                         0xd800, 0xd902, 0xda01, 0xdb02, 0xfc07, 0xff00])
10687    # 2222/177A, 23/122
10688    pkt = NCP(0x177A, "Read Queue Job Entry", 'qms')
10689    pkt.Request(18, [
10690            rec( 10, 4, QueueID ),
10691            rec( 14, 4, JobNumberLong ),
10692    ])
10693    pkt.Reply(258, [
10694        rec( 8, 250, JobStruct3x ),
10695    ])
10696    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10697                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10698                         0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
10699    # 2222/177B, 23/123
10700    pkt = NCP(0x177B, "Change Queue Job Entry", 'qms')
10701    pkt.Request(264, [
10702            rec( 10, 4, QueueID ),
10703            rec( 14, 250, JobStruct ),
10704    ])
10705    pkt.Reply(8)
10706    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10707                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10708                         0xd800, 0xd902, 0xda01, 0xdb02, 0xea02, 0xfc07, 0xff00])
10709    # 2222/177C, 23/124
10710    pkt = NCP(0x177C, "Service Queue Job", 'qms')
10711    pkt.Request(16, [
10712            rec( 10, 4, QueueID ),
10713            rec( 14, 2, ServiceType ),
10714    ])
10715    pkt.Reply(94, [
10716        rec( 8, 86, JobStructNew ),
10717    ])
10718    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10719                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10720                         0xd800, 0xd902, 0xda01, 0xdb02, 0xfc05, 0xff00])
10721    # 2222/177D, 23/125
10722    pkt = NCP(0x177D, "Read Queue Current Status", 'qms')
10723    pkt.Request(14, [
10724            rec( 10, 4, QueueID ),
10725    ])
10726    pkt.Reply(32, [
10727            rec( 8, 4, QueueID ),
10728            rec( 12, 1, QueueStatus ),
10729            rec( 13, 3, Reserved3 ),
10730            rec( 16, 4, CurrentEntries ),
10731            rec( 20, 4, CurrentServers, var="x" ),
10732            rec( 24, 4, ServerID, repeat="x" ),
10733            rec( 28, 4, ServerStationLong, ENC_LITTLE_ENDIAN, repeat="x" ),
10734    ])
10735    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10736                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10737                         0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
10738    # 2222/177E, 23/126
10739    pkt = NCP(0x177E, "Set Queue Current Status", 'qms')
10740    pkt.Request(15, [
10741            rec( 10, 4, QueueID ),
10742            rec( 14, 1, QueueStatus ),
10743    ])
10744    pkt.Reply(8)
10745    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10746                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10747                         0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
10748    # 2222/177F, 23/127
10749    pkt = NCP(0x177F, "Close File And Start Queue Job", 'qms')
10750    pkt.Request(18, [
10751            rec( 10, 4, QueueID ),
10752            rec( 14, 4, JobNumberLong ),
10753    ])
10754    pkt.Reply(8)
10755    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10756                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10757                         0xd800, 0xd902, 0xda01, 0xdb02, 0xfc07, 0xff00])
10758    # 2222/1780, 23/128
10759    pkt = NCP(0x1780, "Remove Job From Queue", 'qms')
10760    pkt.Request(18, [
10761            rec( 10, 4, QueueID ),
10762            rec( 14, 4, JobNumberLong ),
10763    ])
10764    pkt.Reply(8)
10765    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10766                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10767                         0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
10768    # 2222/1781, 23/129
10769    pkt = NCP(0x1781, "Get Queue Job List", 'qms')
10770    pkt.Request(18, [
10771            rec( 10, 4, QueueID ),
10772            rec( 14, 4, JobNumberLong ),
10773    ])
10774    pkt.Reply(20, [
10775            rec( 8, 4, TotalQueueJobs ),
10776            rec( 12, 4, ReplyQueueJobNumbers, var="x" ),
10777            rec( 16, 4, JobNumberLong, repeat="x" ),
10778    ])
10779    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10780                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10781                         0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
10782    # 2222/1782, 23/130
10783    pkt = NCP(0x1782, "Change Job Priority", 'qms')
10784    pkt.Request(22, [
10785            rec( 10, 4, QueueID ),
10786            rec( 14, 4, JobNumberLong ),
10787            rec( 18, 4, Priority ),
10788    ])
10789    pkt.Reply(8)
10790    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10791                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10792                         0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
10793    # 2222/1783, 23/131
10794    pkt = NCP(0x1783, "Finish Servicing Queue Job", 'qms')
10795    pkt.Request(22, [
10796            rec( 10, 4, QueueID ),
10797            rec( 14, 4, JobNumberLong ),
10798            rec( 18, 4, ChargeInformation ),
10799    ])
10800    pkt.Reply(8)
10801    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10802                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10803                         0xd800, 0xd902, 0xda01, 0xdb02, 0xfc05, 0xff00])
10804    # 2222/1784, 23/132
10805    pkt = NCP(0x1784, "Abort Servicing Queue Job", 'qms')
10806    pkt.Request(18, [
10807            rec( 10, 4, QueueID ),
10808            rec( 14, 4, JobNumberLong ),
10809    ])
10810    pkt.Reply(8)
10811    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10812                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10813                         0xd800, 0xd902, 0xda01, 0xdb02, 0xfc05, 0xff18])
10814    # 2222/1785, 23/133
10815    pkt = NCP(0x1785, "Change To Client Rights", 'qms')
10816    pkt.Request(18, [
10817            rec( 10, 4, QueueID ),
10818            rec( 14, 4, JobNumberLong ),
10819    ])
10820    pkt.Reply(8)
10821    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10822                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10823                         0xd800, 0xd902, 0xda01, 0xdb02, 0xff18])
10824    # 2222/1786, 23/134
10825    pkt = NCP(0x1786, "Read Queue Server Current Status", 'qms')
10826    pkt.Request(22, [
10827            rec( 10, 4, QueueID ),
10828            rec( 14, 4, ServerID, ENC_BIG_ENDIAN ),
10829            rec( 18, 4, ServerStation ),
10830    ])
10831    pkt.Reply(72, [
10832            rec( 8, 64, ServerStatusRecord ),
10833    ])
10834    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10835                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10836                         0xd800, 0xd902, 0xda01, 0xdb02, 0xff00])
10837    # 2222/1787, 23/135
10838    pkt = NCP(0x1787, "Get Queue Job File Size", 'qms')
10839    pkt.Request(18, [
10840            rec( 10, 4, QueueID ),
10841            rec( 14, 4, JobNumberLong ),
10842    ])
10843    pkt.Reply(20, [
10844            rec( 8, 4, QueueID ),
10845            rec( 12, 4, JobNumberLong ),
10846            rec( 16, 4, FileSize, ENC_BIG_ENDIAN ),
10847    ])
10848    pkt.CompletionCodes([0x0000, 0x9900, 0xd000, 0xd100, 0xd200,
10849                         0xd300, 0xd400, 0xd500, 0xd601, 0xd703,
10850                         0xd800, 0xd902, 0xda01, 0xdb02, 0xfc05, 0xff00])
10851    # 2222/1788, 23/136
10852    pkt = NCP(0x1788, "Move Queue Job From Src Q to Dst Q", 'qms')
10853    pkt.Request(22, [
10854            rec( 10, 4, QueueID ),
10855            rec( 14, 4, JobNumberLong ),
10856            rec( 18, 4, DstQueueID ),
10857    ])
10858    pkt.Reply(12, [
10859            rec( 8, 4, JobNumberLong ),
10860    ])
10861    pkt.CompletionCodes([0x0000, 0x7e01, 0xfc06])
10862    # 2222/1789, 23/137
10863    pkt = NCP(0x1789, "Get Queue Jobs From Form List", 'qms')
10864    pkt.Request(24, [
10865            rec( 10, 4, QueueID ),
10866            rec( 14, 4, QueueStartPosition ),
10867            rec( 18, 4, FormTypeCnt, ENC_LITTLE_ENDIAN, var="x" ),
10868            rec( 22, 2, FormType, repeat="x" ),
10869    ])
10870    pkt.Reply(20, [
10871            rec( 8, 4, TotalQueueJobs ),
10872            rec( 12, 4, JobCount, var="x" ),
10873            rec( 16, 4, JobNumberLong, repeat="x" ),
10874    ])
10875    pkt.CompletionCodes([0x0000, 0x7e01, 0xd300, 0xfc06])
10876    # 2222/178A, 23/138
10877    pkt = NCP(0x178A, "Service Queue Job By Form List", 'qms')
10878    pkt.Request(24, [
10879            rec( 10, 4, QueueID ),
10880            rec( 14, 4, QueueStartPosition ),
10881            rec( 18, 4, FormTypeCnt, ENC_LITTLE_ENDIAN, var= "x" ),
10882            rec( 22, 2, FormType, repeat="x" ),
10883    ])
10884    pkt.Reply(94, [
10885       rec( 8, 86, JobStructNew ),
10886    ])
10887    pkt.CompletionCodes([0x0000, 0x7e01, 0xd902, 0xfc06, 0xff00])
10888    # 2222/1796, 23/150
10889    pkt = NCP(0x1796, "Get Current Account Status", 'accounting')
10890    pkt.Request((13,60), [
10891            rec( 10, 2, ObjectType, ENC_BIG_ENDIAN ),
10892            rec( 12, (1,48), ObjectName, info_str=(ObjectName, "Get Current Account Status: %s", ", %s") ),
10893    ])
10894    pkt.Reply(264, [
10895            rec( 8, 4, AccountBalance, ENC_BIG_ENDIAN ),
10896            rec( 12, 4, CreditLimit, ENC_BIG_ENDIAN ),
10897            rec( 16, 120, Reserved120 ),
10898            rec( 136, 4, HolderID, ENC_BIG_ENDIAN ),
10899            rec( 140, 4, HoldAmount, ENC_BIG_ENDIAN ),
10900            rec( 144, 4, HolderID, ENC_BIG_ENDIAN ),
10901            rec( 148, 4, HoldAmount, ENC_BIG_ENDIAN ),
10902            rec( 152, 4, HolderID, ENC_BIG_ENDIAN ),
10903            rec( 156, 4, HoldAmount, ENC_BIG_ENDIAN ),
10904            rec( 160, 4, HolderID, ENC_BIG_ENDIAN ),
10905            rec( 164, 4, HoldAmount, ENC_BIG_ENDIAN ),
10906            rec( 168, 4, HolderID, ENC_BIG_ENDIAN ),
10907            rec( 172, 4, HoldAmount, ENC_BIG_ENDIAN ),
10908            rec( 176, 4, HolderID, ENC_BIG_ENDIAN ),
10909            rec( 180, 4, HoldAmount, ENC_BIG_ENDIAN ),
10910            rec( 184, 4, HolderID, ENC_BIG_ENDIAN ),
10911            rec( 188, 4, HoldAmount, ENC_BIG_ENDIAN ),
10912            rec( 192, 4, HolderID, ENC_BIG_ENDIAN ),
10913            rec( 196, 4, HoldAmount, ENC_BIG_ENDIAN ),
10914            rec( 200, 4, HolderID, ENC_BIG_ENDIAN ),
10915            rec( 204, 4, HoldAmount, ENC_BIG_ENDIAN ),
10916            rec( 208, 4, HolderID, ENC_BIG_ENDIAN ),
10917            rec( 212, 4, HoldAmount, ENC_BIG_ENDIAN ),
10918            rec( 216, 4, HolderID, ENC_BIG_ENDIAN ),
10919            rec( 220, 4, HoldAmount, ENC_BIG_ENDIAN ),
10920            rec( 224, 4, HolderID, ENC_BIG_ENDIAN ),
10921            rec( 228, 4, HoldAmount, ENC_BIG_ENDIAN ),
10922            rec( 232, 4, HolderID, ENC_BIG_ENDIAN ),
10923            rec( 236, 4, HoldAmount, ENC_BIG_ENDIAN ),
10924            rec( 240, 4, HolderID, ENC_BIG_ENDIAN ),
10925            rec( 244, 4, HoldAmount, ENC_BIG_ENDIAN ),
10926            rec( 248, 4, HolderID, ENC_BIG_ENDIAN ),
10927            rec( 252, 4, HoldAmount, ENC_BIG_ENDIAN ),
10928            rec( 256, 4, HolderID, ENC_BIG_ENDIAN ),
10929            rec( 260, 4, HoldAmount, ENC_BIG_ENDIAN ),
10930    ])
10931    pkt.CompletionCodes([0x0000, 0x9600, 0xc000, 0xc101, 0xc400, 0xe800,
10932                         0xea00, 0xeb00, 0xec00, 0xfc06, 0xfe07, 0xff00])
10933    # 2222/1797, 23/151
10934    pkt = NCP(0x1797, "Submit Account Charge", 'accounting')
10935    pkt.Request((26,327), [
10936            rec( 10, 2, ServiceType, ENC_BIG_ENDIAN ),
10937            rec( 12, 4, ChargeAmount, ENC_BIG_ENDIAN ),
10938            rec( 16, 4, HoldCancelAmount, ENC_BIG_ENDIAN ),
10939            rec( 20, 2, ObjectType, ENC_BIG_ENDIAN ),
10940            rec( 22, 2, CommentType, ENC_BIG_ENDIAN ),
10941            rec( 24, (1,48), ObjectName, info_str=(ObjectName, "Submit Account Charge: %s", ", %s") ),
10942            rec( -1, (1,255), Comment ),
10943    ])
10944    pkt.Reply(8)
10945    pkt.CompletionCodes([0x0000, 0x0102, 0x8800, 0x9400, 0x9600, 0xa201,
10946                         0xc000, 0xc101, 0xc200, 0xc400, 0xe800, 0xea00,
10947                         0xeb00, 0xec00, 0xfe07, 0xff00])
10948    # 2222/1798, 23/152
10949    pkt = NCP(0x1798, "Submit Account Hold", 'accounting')
10950    pkt.Request((17,64), [
10951            rec( 10, 4, HoldCancelAmount, ENC_BIG_ENDIAN ),
10952            rec( 14, 2, ObjectType, ENC_BIG_ENDIAN ),
10953            rec( 16, (1,48), ObjectName, info_str=(ObjectName, "Submit Account Hold: %s", ", %s") ),
10954    ])
10955    pkt.Reply(8)
10956    pkt.CompletionCodes([0x0000, 0x0102, 0x8800, 0x9400, 0x9600, 0xa201,
10957                         0xc000, 0xc101, 0xc200, 0xc400, 0xe800, 0xea00,
10958                         0xeb00, 0xec00, 0xfe07, 0xff00])
10959    # 2222/1799, 23/153
10960    pkt = NCP(0x1799, "Submit Account Note", 'accounting')
10961    pkt.Request((18,319), [
10962            rec( 10, 2, ServiceType, ENC_BIG_ENDIAN ),
10963            rec( 12, 2, ObjectType, ENC_BIG_ENDIAN ),
10964            rec( 14, 2, CommentType, ENC_BIG_ENDIAN ),
10965            rec( 16, (1,48), ObjectName, info_str=(ObjectName, "Submit Account Note: %s", ", %s") ),
10966            rec( -1, (1,255), Comment ),
10967    ])
10968    pkt.Reply(8)
10969    pkt.CompletionCodes([0x0000, 0x0102, 0x9600, 0xc000, 0xc101, 0xc400,
10970                         0xe800, 0xea00, 0xeb00, 0xec00, 0xf000, 0xfc06,
10971                         0xff00])
10972    # 2222/17c8, 23/200
10973    pkt = NCP(0x17c8, "Check Console Privileges", 'fileserver')
10974    pkt.Request(10)
10975    pkt.Reply(8)
10976    pkt.CompletionCodes([0x0000, 0xc601])
10977    # 2222/17c9, 23/201
10978    pkt = NCP(0x17c9, "Get File Server Description Strings", 'fileserver')
10979    pkt.Request(10)
10980    pkt.Reply(108, [
10981            rec( 8, 100, DescriptionStrings ),
10982    ])
10983    pkt.CompletionCodes([0x0000, 0x9600])
10984    # 2222/17CA, 23/202
10985    pkt = NCP(0x17CA, "Set File Server Date And Time", 'fileserver')
10986    pkt.Request(16, [
10987            rec( 10, 1, Year ),
10988            rec( 11, 1, Month ),
10989            rec( 12, 1, Day ),
10990            rec( 13, 1, Hour ),
10991            rec( 14, 1, Minute ),
10992            rec( 15, 1, Second ),
10993    ])
10994    pkt.Reply(8)
10995    pkt.CompletionCodes([0x0000, 0xc601])
10996    # 2222/17CB, 23/203
10997    pkt = NCP(0x17CB, "Disable File Server Login", 'fileserver')
10998    pkt.Request(10)
10999    pkt.Reply(8)
11000    pkt.CompletionCodes([0x0000, 0xc601])
11001    # 2222/17CC, 23/204
11002    pkt = NCP(0x17CC, "Enable File Server Login", 'fileserver')
11003    pkt.Request(10)
11004    pkt.Reply(8)
11005    pkt.CompletionCodes([0x0000, 0xc601])
11006    # 2222/17CD, 23/205
11007    pkt = NCP(0x17CD, "Get File Server Login Status", 'fileserver')
11008    pkt.Request(10)
11009    pkt.Reply(9, [
11010            rec( 8, 1, UserLoginAllowed ),
11011    ])
11012    pkt.CompletionCodes([0x0000, 0x9600, 0xfb01])
11013    # 2222/17CF, 23/207
11014    pkt = NCP(0x17CF, "Disable Transaction Tracking", 'fileserver')
11015    pkt.Request(10)
11016    pkt.Reply(8)
11017    pkt.CompletionCodes([0x0000, 0xc601])
11018    # 2222/17D0, 23/208
11019    pkt = NCP(0x17D0, "Enable Transaction Tracking", 'fileserver')
11020    pkt.Request(10)
11021    pkt.Reply(8)
11022    pkt.CompletionCodes([0x0000, 0xc601])
11023    # 2222/17D1, 23/209
11024    pkt = NCP(0x17D1, "Send Console Broadcast", 'fileserver')
11025    pkt.Request((13,267), [
11026            rec( 10, 1, NumberOfStations, var="x" ),
11027            rec( 11, 1, StationList, repeat="x" ),
11028            rec( 12, (1, 255), TargetMessage, info_str=(TargetMessage, "Send Console Broadcast: %s", ", %s") ),
11029    ])
11030    pkt.Reply(8)
11031    pkt.CompletionCodes([0x0000, 0xc601, 0xfd00])
11032    # 2222/17D2, 23/210
11033    pkt = NCP(0x17D2, "Clear Connection Number", 'fileserver')
11034    pkt.Request(11, [
11035            rec( 10, 1, ConnectionNumber, info_str=(ConnectionNumber, "Clear Connection Number %d", ", %d") ),
11036    ])
11037    pkt.Reply(8)
11038    pkt.CompletionCodes([0x0000, 0xc601, 0xfd00])
11039    # 2222/17D3, 23/211
11040    pkt = NCP(0x17D3, "Down File Server", 'fileserver')
11041    pkt.Request(11, [
11042            rec( 10, 1, ForceFlag ),
11043    ])
11044    pkt.Reply(8)
11045    pkt.CompletionCodes([0x0000, 0xc601, 0xff00])
11046    # 2222/17D4, 23/212
11047    pkt = NCP(0x17D4, "Get File System Statistics", 'fileserver')
11048    pkt.Request(10)
11049    pkt.Reply(50, [
11050            rec( 8, 4, SystemIntervalMarker, ENC_BIG_ENDIAN ),
11051            rec( 12, 2, ConfiguredMaxOpenFiles ),
11052            rec( 14, 2, ActualMaxOpenFiles ),
11053            rec( 16, 2, CurrentOpenFiles ),
11054            rec( 18, 4, TotalFilesOpened ),
11055            rec( 22, 4, TotalReadRequests ),
11056            rec( 26, 4, TotalWriteRequests ),
11057            rec( 30, 2, CurrentChangedFATs ),
11058            rec( 32, 4, TotalChangedFATs ),
11059            rec( 36, 2, FATWriteErrors ),
11060            rec( 38, 2, FatalFATWriteErrors ),
11061            rec( 40, 2, FATScanErrors ),
11062            rec( 42, 2, ActualMaxIndexedFiles ),
11063            rec( 44, 2, ActiveIndexedFiles ),
11064            rec( 46, 2, AttachedIndexedFiles ),
11065            rec( 48, 2, AvailableIndexedFiles ),
11066    ])
11067    pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xff00])
11068    # 2222/17D5, 23/213
11069    pkt = NCP(0x17D5, "Get Transaction Tracking Statistics", 'fileserver')
11070    pkt.Request((13,267), [
11071            rec( 10, 2, LastRecordSeen ),
11072            rec( 12, (1,255), SemaphoreName ),
11073    ])
11074    pkt.Reply(53, [
11075            rec( 8, 4, SystemIntervalMarker, ENC_BIG_ENDIAN ),
11076            rec( 12, 1, TransactionTrackingSupported ),
11077            rec( 13, 1, TransactionTrackingEnabled ),
11078            rec( 14, 2, TransactionVolumeNumber ),
11079            rec( 16, 2, ConfiguredMaxSimultaneousTransactions ),
11080            rec( 18, 2, ActualMaxSimultaneousTransactions ),
11081            rec( 20, 2, CurrentTransactionCount ),
11082            rec( 22, 4, TotalTransactionsPerformed ),
11083            rec( 26, 4, TotalWriteTransactionsPerformed ),
11084            rec( 30, 4, TotalTransactionsBackedOut ),
11085            rec( 34, 2, TotalUnfilledBackoutRequests ),
11086            rec( 36, 2, TransactionDiskSpace ),
11087            rec( 38, 4, TransactionFATAllocations ),
11088            rec( 42, 4, TransactionFileSizeChanges ),
11089            rec( 46, 4, TransactionFilesTruncated ),
11090            rec( 50, 1, NumberOfEntries, var="x" ),
11091            rec( 51, 2, ConnTaskStruct, repeat="x" ),
11092    ])
11093    pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xff00])
11094    # 2222/17D6, 23/214
11095    pkt = NCP(0x17D6, "Read Disk Cache Statistics", 'fileserver')
11096    pkt.Request(10)
11097    pkt.Reply(86, [
11098            rec( 8, 4, SystemIntervalMarker, ENC_BIG_ENDIAN ),
11099            rec( 12, 2, CacheBufferCount ),
11100            rec( 14, 2, CacheBufferSize ),
11101            rec( 16, 2, DirtyCacheBuffers ),
11102            rec( 18, 4, CacheReadRequests ),
11103            rec( 22, 4, CacheWriteRequests ),
11104            rec( 26, 4, CacheHits ),
11105            rec( 30, 4, CacheMisses ),
11106            rec( 34, 4, PhysicalReadRequests ),
11107            rec( 38, 4, PhysicalWriteRequests ),
11108            rec( 42, 2, PhysicalReadErrors ),
11109            rec( 44, 2, PhysicalWriteErrors ),
11110            rec( 46, 4, CacheGetRequests ),
11111            rec( 50, 4, CacheFullWriteRequests ),
11112            rec( 54, 4, CachePartialWriteRequests ),
11113            rec( 58, 4, BackgroundDirtyWrites ),
11114            rec( 62, 4, BackgroundAgedWrites ),
11115            rec( 66, 4, TotalCacheWrites ),
11116            rec( 70, 4, CacheAllocations ),
11117            rec( 74, 2, ThrashingCount ),
11118            rec( 76, 2, LRUBlockWasDirty ),
11119            rec( 78, 2, ReadBeyondWrite ),
11120            rec( 80, 2, FragmentWriteOccurred ),
11121            rec( 82, 2, CacheHitOnUnavailableBlock ),
11122            rec( 84, 2, CacheBlockScrapped ),
11123    ])
11124    pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xff00])
11125    # 2222/17D7, 23/215
11126    pkt = NCP(0x17D7, "Get Drive Mapping Table", 'fileserver')
11127    pkt.Request(10)
11128    pkt.Reply(184, [
11129            rec( 8, 4, SystemIntervalMarker, ENC_BIG_ENDIAN ),
11130            rec( 12, 1, SFTSupportLevel ),
11131            rec( 13, 1, LogicalDriveCount ),
11132            rec( 14, 1, PhysicalDriveCount ),
11133            rec( 15, 1, DiskChannelTable ),
11134            rec( 16, 4, Reserved4 ),
11135            rec( 20, 2, PendingIOCommands, ENC_BIG_ENDIAN ),
11136            rec( 22, 32, DriveMappingTable ),
11137            rec( 54, 32, DriveMirrorTable ),
11138            rec( 86, 32, DeadMirrorTable ),
11139            rec( 118, 1, ReMirrorDriveNumber ),
11140            rec( 119, 1, Filler ),
11141            rec( 120, 4, ReMirrorCurrentOffset, ENC_BIG_ENDIAN ),
11142            rec( 124, 60, SFTErrorTable ),
11143    ])
11144    pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xff00])
11145    # 2222/17D8, 23/216
11146    pkt = NCP(0x17D8, "Read Physical Disk Statistics", 'fileserver')
11147    pkt.Request(11, [
11148            rec( 10, 1, PhysicalDiskNumber ),
11149    ])
11150    pkt.Reply(101, [
11151            rec( 8, 4, SystemIntervalMarker, ENC_BIG_ENDIAN ),
11152            rec( 12, 1, PhysicalDiskChannel ),
11153            rec( 13, 1, DriveRemovableFlag ),
11154            rec( 14, 1, PhysicalDriveType ),
11155            rec( 15, 1, ControllerDriveNumber ),
11156            rec( 16, 1, ControllerNumber ),
11157            rec( 17, 1, ControllerType ),
11158            rec( 18, 4, DriveSize ),
11159            rec( 22, 2, DriveCylinders ),
11160            rec( 24, 1, DriveHeads ),
11161            rec( 25, 1, SectorsPerTrack ),
11162            rec( 26, 64, DriveDefinitionString ),
11163            rec( 90, 2, IOErrorCount ),
11164            rec( 92, 4, HotFixTableStart ),
11165            rec( 96, 2, HotFixTableSize ),
11166            rec( 98, 2, HotFixBlocksAvailable ),
11167            rec( 100, 1, HotFixDisabled ),
11168    ])
11169    pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xff00])
11170    # 2222/17D9, 23/217
11171    pkt = NCP(0x17D9, "Get Disk Channel Statistics", 'fileserver')
11172    pkt.Request(11, [
11173            rec( 10, 1, DiskChannelNumber ),
11174    ])
11175    pkt.Reply(192, [
11176            rec( 8, 4, SystemIntervalMarker, ENC_BIG_ENDIAN ),
11177            rec( 12, 2, ChannelState, ENC_BIG_ENDIAN ),
11178            rec( 14, 2, ChannelSynchronizationState, ENC_BIG_ENDIAN ),
11179            rec( 16, 1, SoftwareDriverType ),
11180            rec( 17, 1, SoftwareMajorVersionNumber ),
11181            rec( 18, 1, SoftwareMinorVersionNumber ),
11182            rec( 19, 65, SoftwareDescription ),
11183            rec( 84, 8, IOAddressesUsed ),
11184            rec( 92, 10, SharedMemoryAddresses ),
11185            rec( 102, 4, InterruptNumbersUsed ),
11186            rec( 106, 4, DMAChannelsUsed ),
11187            rec( 110, 1, FlagBits ),
11188            rec( 111, 1, Reserved ),
11189            rec( 112, 80, ConfigurationDescription ),
11190    ])
11191    pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xff00])
11192    # 2222/17DB, 23/219
11193    pkt = NCP(0x17DB, "Get Connection's Open Files", 'fileserver')
11194    pkt.Request(14, [
11195            rec( 10, 2, ConnectionNumber ),
11196            rec( 12, 2, LastRecordSeen, ENC_BIG_ENDIAN ),
11197    ])
11198    pkt.Reply(32, [
11199            rec( 8, 2, NextRequestRecord ),
11200            rec( 10, 1, NumberOfRecords, var="x" ),
11201            rec( 11, 21, ConnStruct, repeat="x" ),
11202    ])
11203    pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xff00])
11204    # 2222/17DC, 23/220
11205    pkt = NCP(0x17DC, "Get Connection Using A File", 'fileserver')
11206    pkt.Request((14,268), [
11207            rec( 10, 2, LastRecordSeen, ENC_BIG_ENDIAN ),
11208            rec( 12, 1, DirHandle ),
11209            rec( 13, (1,255), Path, info_str=(Path, "Get Connection Using File: %s", ", %s") ),
11210    ])
11211    pkt.Reply(30, [
11212            rec( 8, 2, UseCount, ENC_BIG_ENDIAN ),
11213            rec( 10, 2, OpenCount, ENC_BIG_ENDIAN ),
11214            rec( 12, 2, OpenForReadCount, ENC_BIG_ENDIAN ),
11215            rec( 14, 2, OpenForWriteCount, ENC_BIG_ENDIAN ),
11216            rec( 16, 2, DenyReadCount, ENC_BIG_ENDIAN ),
11217            rec( 18, 2, DenyWriteCount, ENC_BIG_ENDIAN ),
11218            rec( 20, 2, NextRequestRecord, ENC_BIG_ENDIAN ),
11219            rec( 22, 1, Locked ),
11220            rec( 23, 1, NumberOfRecords, var="x" ),
11221            rec( 24, 6, ConnFileStruct, repeat="x" ),
11222    ])
11223    pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xff00])
11224    # 2222/17DD, 23/221
11225    pkt = NCP(0x17DD, "Get Physical Record Locks By Connection And File", 'fileserver')
11226    pkt.Request(31, [
11227            rec( 10, 2, TargetConnectionNumber ),
11228            rec( 12, 2, LastRecordSeen, ENC_BIG_ENDIAN ),
11229            rec( 14, 1, VolumeNumber ),
11230            rec( 15, 2, DirectoryID ),
11231            rec( 17, 14, FileName14, info_str=(FileName14, "Get Physical Record Locks by Connection and File: %s", ", %s") ),
11232    ])
11233    pkt.Reply(22, [
11234            rec( 8, 2, NextRequestRecord ),
11235            rec( 10, 1, NumberOfLocks, var="x" ),
11236            rec( 11, 1, Reserved ),
11237            rec( 12, 10, LockStruct, repeat="x" ),
11238    ])
11239    pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
11240    # 2222/17DE, 23/222
11241    pkt = NCP(0x17DE, "Get Physical Record Locks By File", 'fileserver')
11242    pkt.Request((14,268), [
11243            rec( 10, 2, TargetConnectionNumber ),
11244            rec( 12, 1, DirHandle ),
11245            rec( 13, (1,255), Path, info_str=(Path, "Get Physical Record Locks by File: %s", ", %s") ),
11246    ])
11247    pkt.Reply(28, [
11248            rec( 8, 2, NextRequestRecord ),
11249            rec( 10, 1, NumberOfLocks, var="x" ),
11250            rec( 11, 1, Reserved ),
11251            rec( 12, 16, PhyLockStruct, repeat="x" ),
11252    ])
11253    pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
11254    # 2222/17DF, 23/223
11255    pkt = NCP(0x17DF, "Get Logical Records By Connection", 'fileserver')
11256    pkt.Request(14, [
11257            rec( 10, 2, TargetConnectionNumber ),
11258            rec( 12, 2, LastRecordSeen, ENC_BIG_ENDIAN ),
11259    ])
11260    pkt.Reply((14,268), [
11261            rec( 8, 2, NextRequestRecord ),
11262            rec( 10, 1, NumberOfRecords, var="x" ),
11263            rec( 11, (3, 257), LogLockStruct, repeat="x" ),
11264    ])
11265    pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
11266    # 2222/17E0, 23/224
11267    pkt = NCP(0x17E0, "Get Logical Record Information", 'fileserver')
11268    pkt.Request((13,267), [
11269            rec( 10, 2, LastRecordSeen ),
11270            rec( 12, (1,255), LogicalRecordName, info_str=(LogicalRecordName, "Get Logical Record Information: %s", ", %s") ),
11271    ])
11272    pkt.Reply(20, [
11273            rec( 8, 2, UseCount, ENC_BIG_ENDIAN ),
11274            rec( 10, 2, ShareableLockCount, ENC_BIG_ENDIAN ),
11275            rec( 12, 2, NextRequestRecord ),
11276            rec( 14, 1, Locked ),
11277            rec( 15, 1, NumberOfRecords, var="x" ),
11278            rec( 16, 4, LogRecStruct, repeat="x" ),
11279    ])
11280    pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
11281    # 2222/17E1, 23/225
11282    pkt = NCP(0x17E1, "Get Connection's Semaphores", 'fileserver')
11283    pkt.Request(14, [
11284            rec( 10, 2, ConnectionNumber ),
11285            rec( 12, 2, LastRecordSeen ),
11286    ])
11287    pkt.Reply((18,272), [
11288            rec( 8, 2, NextRequestRecord ),
11289            rec( 10, 2, NumberOfSemaphores, var="x" ),
11290            rec( 12, (6,260), SemaStruct, repeat="x" ),
11291    ])
11292    pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
11293    # 2222/17E2, 23/226
11294    pkt = NCP(0x17E2, "Get Semaphore Information", 'fileserver')
11295    pkt.Request((13,267), [
11296            rec( 10, 2, LastRecordSeen ),
11297            rec( 12, (1,255), SemaphoreName, info_str=(SemaphoreName, "Get Semaphore Information: %s", ", %s") ),
11298    ])
11299    pkt.Reply(17, [
11300            rec( 8, 2, NextRequestRecord, ENC_BIG_ENDIAN ),
11301            rec( 10, 2, OpenCount, ENC_BIG_ENDIAN ),
11302            rec( 12, 1, SemaphoreValue ),
11303            rec( 13, 1, NumberOfRecords, var="x" ),
11304            rec( 14, 3, SemaInfoStruct, repeat="x" ),
11305    ])
11306    pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
11307    # 2222/17E3, 23/227
11308    pkt = NCP(0x17E3, "Get LAN Driver Configuration Information", 'fileserver')
11309    pkt.Request(11, [
11310            rec( 10, 1, LANDriverNumber ),
11311    ])
11312    pkt.Reply(180, [
11313            rec( 8, 4, NetworkAddress, ENC_BIG_ENDIAN ),
11314            rec( 12, 6, HostAddress ),
11315            rec( 18, 1, BoardInstalled ),
11316            rec( 19, 1, OptionNumber ),
11317            rec( 20, 160, ConfigurationText ),
11318    ])
11319    pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
11320    # 2222/17E5, 23/229
11321    pkt = NCP(0x17E5, "Get Connection Usage Statistics", 'fileserver')
11322    pkt.Request(12, [
11323            rec( 10, 2, ConnectionNumber ),
11324    ])
11325    pkt.Reply(26, [
11326            rec( 8, 2, NextRequestRecord ),
11327            rec( 10, 6, BytesRead ),
11328            rec( 16, 6, BytesWritten ),
11329            rec( 22, 4, TotalRequestPackets ),
11330     ])
11331    pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
11332    # 2222/17E6, 23/230
11333    pkt = NCP(0x17E6, "Get Object's Remaining Disk Space", 'fileserver')
11334    pkt.Request(14, [
11335            rec( 10, 4, ObjectID, ENC_BIG_ENDIAN ),
11336    ])
11337    pkt.Reply(21, [
11338            rec( 8, 4, SystemIntervalMarker, ENC_BIG_ENDIAN ),
11339            rec( 12, 4, ObjectID ),
11340            rec( 16, 4, UnusedDiskBlocks, ENC_BIG_ENDIAN ),
11341            rec( 20, 1, RestrictionsEnforced ),
11342     ])
11343    pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
11344    # 2222/17E7, 23/231
11345    pkt = NCP(0x17E7, "Get File Server LAN I/O Statistics", 'fileserver')
11346    pkt.Request(10)
11347    pkt.Reply(74, [
11348            rec( 8, 4, SystemIntervalMarker, ENC_BIG_ENDIAN ),
11349            rec( 12, 2, ConfiguredMaxRoutingBuffers ),
11350            rec( 14, 2, ActualMaxUsedRoutingBuffers ),
11351            rec( 16, 2, CurrentlyUsedRoutingBuffers ),
11352            rec( 18, 4, TotalFileServicePackets ),
11353            rec( 22, 2, TurboUsedForFileService ),
11354            rec( 24, 2, PacketsFromInvalidConnection ),
11355            rec( 26, 2, BadLogicalConnectionCount ),
11356            rec( 28, 2, PacketsReceivedDuringProcessing ),
11357            rec( 30, 2, RequestsReprocessed ),
11358            rec( 32, 2, PacketsWithBadSequenceNumber ),
11359            rec( 34, 2, DuplicateRepliesSent ),
11360            rec( 36, 2, PositiveAcknowledgesSent ),
11361            rec( 38, 2, PacketsWithBadRequestType ),
11362            rec( 40, 2, AttachDuringProcessing ),
11363            rec( 42, 2, AttachWhileProcessingAttach ),
11364            rec( 44, 2, ForgedDetachedRequests ),
11365            rec( 46, 2, DetachForBadConnectionNumber ),
11366            rec( 48, 2, DetachDuringProcessing ),
11367            rec( 50, 2, RepliesCancelled ),
11368            rec( 52, 2, PacketsDiscardedByHopCount ),
11369            rec( 54, 2, PacketsDiscardedUnknownNet ),
11370            rec( 56, 2, IncomingPacketDiscardedNoDGroup ),
11371            rec( 58, 2, OutgoingPacketDiscardedNoTurboBuffer ),
11372            rec( 60, 2, IPXNotMyNetwork ),
11373            rec( 62, 4, NetBIOSBroadcastWasPropagated ),
11374            rec( 66, 4, TotalOtherPackets ),
11375            rec( 70, 4, TotalRoutedPackets ),
11376     ])
11377    pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
11378    # 2222/17E8, 23/232
11379    pkt = NCP(0x17E8, "Get File Server Misc Information", 'fileserver')
11380    pkt.Request(10)
11381    pkt.Reply(40, [
11382            rec( 8, 4, SystemIntervalMarker, ENC_BIG_ENDIAN ),
11383            rec( 12, 1, ProcessorType ),
11384            rec( 13, 1, Reserved ),
11385            rec( 14, 1, NumberOfServiceProcesses ),
11386            rec( 15, 1, ServerUtilizationPercentage ),
11387            rec( 16, 2, ConfiguredMaxBinderyObjects ),
11388            rec( 18, 2, ActualMaxBinderyObjects ),
11389            rec( 20, 2, CurrentUsedBinderyObjects ),
11390            rec( 22, 2, TotalServerMemory ),
11391            rec( 24, 2, WastedServerMemory ),
11392            rec( 26, 2, NumberOfDynamicMemoryAreas, var="x" ),
11393            rec( 28, 12, DynMemStruct, repeat="x" ),
11394     ])
11395    pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
11396    # 2222/17E9, 23/233
11397    pkt = NCP(0x17E9, "Get Volume Information", 'fileserver')
11398    pkt.Request(11, [
11399            rec( 10, 1, VolumeNumber, info_str=(VolumeNumber, "Get Information on Volume %d", ", %d") ),
11400    ])
11401    pkt.Reply(48, [
11402            rec( 8, 4, SystemIntervalMarker, ENC_BIG_ENDIAN ),
11403            rec( 12, 1, VolumeNumber ),
11404            rec( 13, 1, LogicalDriveNumber ),
11405            rec( 14, 2, BlockSize ),
11406            rec( 16, 2, StartingBlock ),
11407            rec( 18, 2, TotalBlocks ),
11408            rec( 20, 2, FreeBlocks ),
11409            rec( 22, 2, TotalDirectoryEntries ),
11410            rec( 24, 2, FreeDirectoryEntries ),
11411            rec( 26, 2, ActualMaxUsedDirectoryEntries ),
11412            rec( 28, 1, VolumeHashedFlag ),
11413            rec( 29, 1, VolumeCachedFlag ),
11414            rec( 30, 1, VolumeRemovableFlag ),
11415            rec( 31, 1, VolumeMountedFlag ),
11416            rec( 32, 16, VolumeName ),
11417     ])
11418    pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
11419    # 2222/17EA, 23/234
11420    pkt = NCP(0x17EA, "Get Connection's Task Information", 'fileserver')
11421    pkt.Request(12, [
11422            rec( 10, 2, ConnectionNumber ),
11423    ])
11424    pkt.Reply(13, [
11425            rec( 8, 1, ConnLockStatus ),
11426            rec( 9, 1, NumberOfActiveTasks, var="x" ),
11427            rec( 10, 3, TaskStruct, repeat="x" ),
11428     ])
11429    pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
11430    # 2222/17EB, 23/235
11431    pkt = NCP(0x17EB, "Get Connection's Open Files", 'fileserver')
11432    pkt.Request(14, [
11433            rec( 10, 2, ConnectionNumber ),
11434            rec( 12, 2, LastRecordSeen ),
11435    ])
11436    pkt.Reply((29,283), [
11437            rec( 8, 2, NextRequestRecord ),
11438            rec( 10, 2, NumberOfRecords, var="x" ),
11439            rec( 12, (17, 271), OpnFilesStruct, repeat="x" ),
11440    ])
11441    pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xff00])
11442    # 2222/17EC, 23/236
11443    pkt = NCP(0x17EC, "Get Connection Using A File", 'fileserver')
11444    pkt.Request(18, [
11445            rec( 10, 1, DataStreamNumber ),
11446            rec( 11, 1, VolumeNumber ),
11447            rec( 12, 4, DirectoryBase, ENC_LITTLE_ENDIAN ),
11448            rec( 16, 2, LastRecordSeen ),
11449    ])
11450    pkt.Reply(33, [
11451            rec( 8, 2, NextRequestRecord ),
11452            rec( 10, 2, FileUseCount ),
11453            rec( 12, 2, OpenCount ),
11454            rec( 14, 2, OpenForReadCount ),
11455            rec( 16, 2, OpenForWriteCount ),
11456            rec( 18, 2, DenyReadCount ),
11457            rec( 20, 2, DenyWriteCount ),
11458            rec( 22, 1, Locked ),
11459            rec( 23, 1, ForkCount ),
11460            rec( 24, 2, NumberOfRecords, var="x" ),
11461            rec( 26, 7, ConnFileStruct, repeat="x" ),
11462    ])
11463    pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xff00])
11464    # 2222/17ED, 23/237
11465    pkt = NCP(0x17ED, "Get Physical Record Locks By Connection And File", 'fileserver')
11466    pkt.Request(20, [
11467            rec( 10, 2, TargetConnectionNumber ),
11468            rec( 12, 1, DataStreamNumber ),
11469            rec( 13, 1, VolumeNumber ),
11470            rec( 14, 4, DirectoryBase, ENC_LITTLE_ENDIAN ),
11471            rec( 18, 2, LastRecordSeen ),
11472    ])
11473    pkt.Reply(23, [
11474            rec( 8, 2, NextRequestRecord ),
11475            rec( 10, 2, NumberOfLocks, ENC_LITTLE_ENDIAN, var="x" ),
11476            rec( 12, 11, LockStruct, repeat="x" ),
11477    ])
11478    pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
11479    # 2222/17EE, 23/238
11480    pkt = NCP(0x17EE, "Get Physical Record Locks By File", 'fileserver')
11481    pkt.Request(18, [
11482            rec( 10, 1, DataStreamNumber ),
11483            rec( 11, 1, VolumeNumber ),
11484            rec( 12, 4, DirectoryBase ),
11485            rec( 16, 2, LastRecordSeen ),
11486    ])
11487    pkt.Reply(30, [
11488            rec( 8, 2, NextRequestRecord ),
11489            rec( 10, 2, NumberOfLocks, ENC_LITTLE_ENDIAN, var="x" ),
11490            rec( 12, 18, PhyLockStruct, repeat="x" ),
11491    ])
11492    pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
11493    # 2222/17EF, 23/239
11494    pkt = NCP(0x17EF, "Get Logical Records By Connection", 'fileserver')
11495    pkt.Request(14, [
11496            rec( 10, 2, TargetConnectionNumber ),
11497            rec( 12, 2, LastRecordSeen ),
11498    ])
11499    pkt.Reply((16,270), [
11500            rec( 8, 2, NextRequestRecord ),
11501            rec( 10, 2, NumberOfRecords, var="x" ),
11502            rec( 12, (4, 258), LogLockStruct, repeat="x" ),
11503    ])
11504    pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
11505    # 2222/17F0, 23/240
11506    pkt = NCP(0x17F0, "Get Logical Record Information (old)", 'fileserver')
11507    pkt.Request((13,267), [
11508            rec( 10, 2, LastRecordSeen ),
11509            rec( 12, (1,255), LogicalRecordName ),
11510    ])
11511    pkt.Reply(22, [
11512            rec( 8, 2, ShareableLockCount ),
11513            rec( 10, 2, UseCount ),
11514            rec( 12, 1, Locked ),
11515            rec( 13, 2, NextRequestRecord ),
11516            rec( 15, 2, NumberOfRecords, var="x" ),
11517            rec( 17, 5, LogRecStruct, repeat="x" ),
11518    ])
11519    pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
11520    # 2222/17F1, 23/241
11521    pkt = NCP(0x17F1, "Get Connection's Semaphores", 'fileserver')
11522    pkt.Request(14, [
11523            rec( 10, 2, ConnectionNumber ),
11524            rec( 12, 2, LastRecordSeen ),
11525    ])
11526    pkt.Reply((19,273), [
11527            rec( 8, 2, NextRequestRecord ),
11528            rec( 10, 2, NumberOfSemaphores, var="x" ),
11529            rec( 12, (7, 261), SemaStruct, repeat="x" ),
11530    ])
11531    pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
11532    # 2222/17F2, 23/242
11533    pkt = NCP(0x17F2, "Get Semaphore Information", 'fileserver')
11534    pkt.Request((13,267), [
11535            rec( 10, 2, LastRecordSeen ),
11536            rec( 12, (1,255), SemaphoreName, info_str=(SemaphoreName, "Get Semaphore Information: %s", ", %s") ),
11537    ])
11538    pkt.Reply(20, [
11539            rec( 8, 2, NextRequestRecord ),
11540            rec( 10, 2, OpenCount ),
11541            rec( 12, 2, SemaphoreValue ),
11542            rec( 14, 2, NumberOfRecords, var="x" ),
11543            rec( 16, 4, SemaInfoStruct, repeat="x" ),
11544    ])
11545    pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
11546    # 2222/17F3, 23/243
11547    pkt = NCP(0x17F3, "Map Directory Number to Path", 'file')
11548    pkt.Request(16, [
11549            rec( 10, 1, VolumeNumber ),
11550            rec( 11, 4, DirectoryNumber ),
11551            rec( 15, 1, NameSpace ),
11552    ])
11553    pkt.Reply((9,263), [
11554            rec( 8, (1,255), Path ),
11555    ])
11556    pkt.CompletionCodes([0x0000, 0x9600, 0x9c00, 0xc601, 0xfd00, 0xff00])
11557    # 2222/17F4, 23/244
11558    pkt = NCP(0x17F4, "Convert Path to Dir Entry", 'file')
11559    pkt.Request((12,266), [
11560            rec( 10, 1, DirHandle ),
11561            rec( 11, (1,255), Path, info_str=(Path, "Convert Path to Directory Entry: %s", ", %s") ),
11562    ])
11563    pkt.Reply(13, [
11564            rec( 8, 1, VolumeNumber ),
11565            rec( 9, 4, DirectoryNumber ),
11566    ])
11567    pkt.CompletionCodes([0x0000, 0x9600, 0xc601, 0xfd00, 0xff00])
11568    # 2222/17FD, 23/253
11569    pkt = NCP(0x17FD, "Send Console Broadcast", 'fileserver')
11570    pkt.Request((16, 270), [
11571            rec( 10, 1, NumberOfStations, var="x" ),
11572            rec( 11, 4, StationList, repeat="x" ),
11573            rec( 15, (1, 255), TargetMessage, info_str=(TargetMessage, "Send Console Broadcast: %s", ", %s") ),
11574    ])
11575    pkt.Reply(8)
11576    pkt.CompletionCodes([0x0000, 0xc601, 0xfd00])
11577    # 2222/17FE, 23/254
11578    pkt = NCP(0x17FE, "Clear Connection Number", 'fileserver')
11579    pkt.Request(14, [
11580            rec( 10, 4, ConnectionNumber ),
11581    ])
11582    pkt.Reply(8)
11583    pkt.CompletionCodes([0x0000, 0xc601, 0xfd00])
11584    # 2222/18, 24
11585    pkt = NCP(0x18, "End of Job", 'connection')
11586    pkt.Request(7)
11587    pkt.Reply(8)
11588    pkt.CompletionCodes([0x0000])
11589    # 2222/19, 25
11590    pkt = NCP(0x19, "Logout", 'connection')
11591    pkt.Request(7)
11592    pkt.Reply(8)
11593    pkt.CompletionCodes([0x0000])
11594    # 2222/1A, 26
11595    pkt = NCP(0x1A, "Log Physical Record", 'sync')
11596    pkt.Request(24, [
11597            rec( 7, 1, LockFlag ),
11598            rec( 8, 6, FileHandle ),
11599            rec( 14, 4, LockAreasStartOffset, ENC_BIG_ENDIAN ),
11600            rec( 18, 4, LockAreaLen, ENC_BIG_ENDIAN, info_str=(LockAreaLen, "Lock Record - Length of %d", "%d") ),
11601            rec( 22, 2, LockTimeout ),
11602    ])
11603    pkt.Reply(8)
11604    pkt.CompletionCodes([0x0000, 0x8800, 0x9600, 0xfd02, 0xfe04, 0xff01])
11605    # 2222/1B, 27
11606    pkt = NCP(0x1B, "Lock Physical Record Set", 'sync')
11607    pkt.Request(10, [
11608            rec( 7, 1, LockFlag ),
11609            rec( 8, 2, LockTimeout ),
11610    ])
11611    pkt.Reply(8)
11612    pkt.CompletionCodes([0x0000, 0x8800, 0x9600, 0xfd02, 0xfe04, 0xff01])
11613    # 2222/1C, 28
11614    pkt = NCP(0x1C, "Release Physical Record", 'sync')
11615    pkt.Request(22, [
11616            rec( 7, 1, Reserved ),
11617            rec( 8, 6, FileHandle ),
11618            rec( 14, 4, LockAreasStartOffset ),
11619            rec( 18, 4, LockAreaLen, info_str=(LockAreaLen, "Release Lock Record - Length of %d", "%d") ),
11620    ])
11621    pkt.Reply(8)
11622    pkt.CompletionCodes([0x0000, 0x8800, 0x9600, 0xfd02, 0xfe04, 0xff03])
11623    # 2222/1D, 29
11624    pkt = NCP(0x1D, "Release Physical Record Set", 'sync')
11625    pkt.Request(8, [
11626            rec( 7, 1, LockFlag ),
11627    ])
11628    pkt.Reply(8)
11629    pkt.CompletionCodes([0x0000, 0x8800, 0x9600, 0xfd02, 0xfe04, 0xff03])
11630    # 2222/1E, 30   #Tested and fixed 6-14-02 GM
11631    pkt = NCP(0x1E, "Clear Physical Record", 'sync')
11632    pkt.Request(22, [
11633            rec( 7, 1, Reserved ),
11634            rec( 8, 6, FileHandle ),
11635            rec( 14, 4, LockAreasStartOffset, ENC_BIG_ENDIAN ),
11636            rec( 18, 4, LockAreaLen, ENC_BIG_ENDIAN, info_str=(LockAreaLen, "Clear Lock Record - Length of %d", "%d") ),
11637    ])
11638    pkt.Reply(8)
11639    pkt.CompletionCodes([0x0000, 0x8000, 0x8800, 0x9600, 0xfd02, 0xfe04, 0xff03])
11640    # 2222/1F, 31
11641    pkt = NCP(0x1F, "Clear Physical Record Set", 'sync')
11642    pkt.Request(8, [
11643            rec( 7, 1, LockFlag ),
11644    ])
11645    pkt.Reply(8)
11646    pkt.CompletionCodes([0x0000, 0x8800, 0x9600, 0xfd02, 0xfe04, 0xff03])
11647    # 2222/2000, 32/00
11648    pkt = NCP(0x2000, "Open Semaphore", 'sync', has_length=0)
11649    pkt.Request((10,264), [
11650            rec( 8, 1, InitialSemaphoreValue ),
11651            rec( 9, (1,255), SemaphoreName, info_str=(SemaphoreName, "Open Semaphore: %s", ", %s") ),
11652    ])
11653    pkt.Reply(13, [
11654              rec( 8, 4, SemaphoreHandle, ENC_BIG_ENDIAN ),
11655              rec( 12, 1, SemaphoreOpenCount ),
11656    ])
11657    pkt.CompletionCodes([0x0000, 0x9600, 0xff01])
11658    # 2222/2001, 32/01
11659    pkt = NCP(0x2001, "Examine Semaphore", 'sync', has_length=0)
11660    pkt.Request(12, [
11661            rec( 8, 4, SemaphoreHandle, ENC_BIG_ENDIAN ),
11662    ])
11663    pkt.Reply(10, [
11664              rec( 8, 1, SemaphoreValue ),
11665              rec( 9, 1, SemaphoreOpenCount ),
11666    ])
11667    pkt.CompletionCodes([0x0000, 0x9600, 0xff01])
11668    # 2222/2002, 32/02
11669    pkt = NCP(0x2002, "Wait On Semaphore", 'sync', has_length=0)
11670    pkt.Request(14, [
11671            rec( 8, 4, SemaphoreHandle, ENC_BIG_ENDIAN ),
11672            rec( 12, 2, SemaphoreTimeOut, ENC_BIG_ENDIAN ),
11673    ])
11674    pkt.Reply(8)
11675    pkt.CompletionCodes([0x0000, 0x9600, 0xff01])
11676    # 2222/2003, 32/03
11677    pkt = NCP(0x2003, "Signal Semaphore", 'sync', has_length=0)
11678    pkt.Request(12, [
11679            rec( 8, 4, SemaphoreHandle, ENC_BIG_ENDIAN ),
11680    ])
11681    pkt.Reply(8)
11682    pkt.CompletionCodes([0x0000, 0x9600, 0xff01])
11683    # 2222/2004, 32/04
11684    pkt = NCP(0x2004, "Close Semaphore", 'sync', has_length=0)
11685    pkt.Request(12, [
11686            rec( 8, 4, SemaphoreHandle, ENC_BIG_ENDIAN ),
11687    ])
11688    pkt.Reply(8)
11689    pkt.CompletionCodes([0x0000, 0x9600, 0xff01])
11690    # 2222/21, 33
11691    pkt = NCP(0x21, "Negotiate Buffer Size", 'connection')
11692    pkt.Request(9, [
11693            rec( 7, 2, BufferSize, ENC_BIG_ENDIAN ),
11694    ])
11695    pkt.Reply(10, [
11696            rec( 8, 2, BufferSize, ENC_BIG_ENDIAN ),
11697    ])
11698    pkt.CompletionCodes([0x0000])
11699    # 2222/2200, 34/00
11700    pkt = NCP(0x2200, "TTS Is Available", 'tts', has_length=0)
11701    pkt.Request(8)
11702    pkt.Reply(8)
11703    pkt.CompletionCodes([0x0001, 0xfd03, 0xff12])
11704    # 2222/2201, 34/01
11705    pkt = NCP(0x2201, "TTS Begin Transaction", 'tts', has_length=0)
11706    pkt.Request(8)
11707    pkt.Reply(8)
11708    pkt.CompletionCodes([0x0000])
11709    # 2222/2202, 34/02
11710    pkt = NCP(0x2202, "TTS End Transaction", 'tts', has_length=0)
11711    pkt.Request(8)
11712    pkt.Reply(12, [
11713              rec( 8, 4, TransactionNumber, ENC_BIG_ENDIAN ),
11714    ])
11715    pkt.CompletionCodes([0x0000, 0xff01])
11716    # 2222/2203, 34/03
11717    pkt = NCP(0x2203, "TTS Abort Transaction", 'tts', has_length=0)
11718    pkt.Request(8)
11719    pkt.Reply(8)
11720    pkt.CompletionCodes([0x0000, 0xfd03, 0xfe0b, 0xff01])
11721    # 2222/2204, 34/04
11722    pkt = NCP(0x2204, "TTS Transaction Status", 'tts', has_length=0)
11723    pkt.Request(12, [
11724              rec( 8, 4, TransactionNumber, ENC_BIG_ENDIAN ),
11725    ])
11726    pkt.Reply(8)
11727    pkt.CompletionCodes([0x0000])
11728    # 2222/2205, 34/05
11729    pkt = NCP(0x2205, "TTS Get Application Thresholds", 'tts', has_length=0)
11730    pkt.Request(8)
11731    pkt.Reply(10, [
11732              rec( 8, 1, LogicalLockThreshold ),
11733              rec( 9, 1, PhysicalLockThreshold ),
11734    ])
11735    pkt.CompletionCodes([0x0000])
11736    # 2222/2206, 34/06
11737    pkt = NCP(0x2206, "TTS Set Application Thresholds", 'tts', has_length=0)
11738    pkt.Request(10, [
11739              rec( 8, 1, LogicalLockThreshold ),
11740              rec( 9, 1, PhysicalLockThreshold ),
11741    ])
11742    pkt.Reply(8)
11743    pkt.CompletionCodes([0x0000, 0x9600])
11744    # 2222/2207, 34/07
11745    pkt = NCP(0x2207, "TTS Get Workstation Thresholds", 'tts', has_length=0)
11746    pkt.Request(8)
11747    pkt.Reply(10, [
11748              rec( 8, 1, LogicalLockThreshold ),
11749              rec( 9, 1, PhysicalLockThreshold ),
11750    ])
11751    pkt.CompletionCodes([0x0000])
11752    # 2222/2208, 34/08
11753    pkt = NCP(0x2208, "TTS Set Workstation Thresholds", 'tts', has_length=0)
11754    pkt.Request(10, [
11755              rec( 8, 1, LogicalLockThreshold ),
11756              rec( 9, 1, PhysicalLockThreshold ),
11757    ])
11758    pkt.Reply(8)
11759    pkt.CompletionCodes([0x0000])
11760    # 2222/2209, 34/09
11761    pkt = NCP(0x2209, "TTS Get Transaction Bits", 'tts', has_length=0)
11762    pkt.Request(8)
11763    pkt.Reply(9, [
11764            rec( 8, 1, ControlFlags ),
11765    ])
11766    pkt.CompletionCodes([0x0000])
11767    # 2222/220A, 34/10
11768    pkt = NCP(0x220A, "TTS Set Transaction Bits", 'tts', has_length=0)
11769    pkt.Request(9, [
11770            rec( 8, 1, ControlFlags ),
11771    ])
11772    pkt.Reply(8)
11773    pkt.CompletionCodes([0x0000])
11774    # 2222/2301, 35/01
11775    pkt = NCP(0x2301, "AFP Create Directory", 'afp')
11776    pkt.Request((49, 303), [
11777            rec( 10, 1, VolumeNumber ),
11778            rec( 11, 4, BaseDirectoryID ),
11779            rec( 15, 1, Reserved ),
11780            rec( 16, 4, CreatorID ),
11781            rec( 20, 4, Reserved4 ),
11782            rec( 24, 2, FinderAttr ),
11783            rec( 26, 2, HorizLocation ),
11784            rec( 28, 2, VertLocation ),
11785            rec( 30, 2, FileDirWindow ),
11786            rec( 32, 16, Reserved16 ),
11787            rec( 48, (1,255), Path, info_str=(Path, "AFP Create Directory: %s", ", %s") ),
11788    ])
11789    pkt.Reply(12, [
11790            rec( 8, 4, NewDirectoryID ),
11791    ])
11792    pkt.CompletionCodes([0x0000, 0x8301, 0x8400, 0x8800, 0x9300, 0x9600, 0x9804,
11793                         0x9900, 0x9c03, 0x9e02, 0xa100, 0xa201, 0xfd00, 0xff18])
11794    # 2222/2302, 35/02
11795    pkt = NCP(0x2302, "AFP Create File", 'afp')
11796    pkt.Request((49, 303), [
11797            rec( 10, 1, VolumeNumber ),
11798            rec( 11, 4, BaseDirectoryID ),
11799            rec( 15, 1, DeleteExistingFileFlag ),
11800            rec( 16, 4, CreatorID, ENC_BIG_ENDIAN ),
11801            rec( 20, 4, Reserved4 ),
11802            rec( 24, 2, FinderAttr ),
11803            rec( 26, 2, HorizLocation, ENC_BIG_ENDIAN ),
11804            rec( 28, 2, VertLocation, ENC_BIG_ENDIAN ),
11805            rec( 30, 2, FileDirWindow, ENC_BIG_ENDIAN ),
11806            rec( 32, 16, Reserved16 ),
11807            rec( 48, (1,255), Path, info_str=(Path, "AFP Create File: %s", ", %s") ),
11808    ])
11809    pkt.Reply(12, [
11810            rec( 8, 4, NewDirectoryID ),
11811    ])
11812    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8301, 0x8400, 0x8701, 0x8800,
11813                         0x8a00, 0x8d00, 0x8e00, 0x8f00, 0x9300, 0x9600, 0x9804,
11814                         0x9900, 0x9b03, 0x9c03, 0x9e02, 0xa100, 0xa201, 0xfd00,
11815                         0xff18])
11816    # 2222/2303, 35/03
11817    pkt = NCP(0x2303, "AFP Delete", 'afp')
11818    pkt.Request((16,270), [
11819            rec( 10, 1, VolumeNumber ),
11820            rec( 11, 4, BaseDirectoryID ),
11821            rec( 15, (1,255), Path, info_str=(Path, "AFP Delete: %s", ", %s") ),
11822    ])
11823    pkt.Reply(8)
11824    pkt.CompletionCodes([0x0000, 0x8301, 0x8800, 0x8a00, 0x8d00, 0x8e00, 0x8f00,
11825                         0x9000, 0x9300, 0x9600, 0x9804, 0x9b03, 0x9c03, 0x9e02,
11826                         0xa000, 0xa100, 0xa201, 0xfd00, 0xff19])
11827    # 2222/2304, 35/04
11828    pkt = NCP(0x2304, "AFP Get Entry ID From Name", 'afp')
11829    pkt.Request((16,270), [
11830            rec( 10, 1, VolumeNumber ),
11831            rec( 11, 4, BaseDirectoryID ),
11832            rec( 15, (1,255), Path, info_str=(Path, "AFP Get Entry from Name: %s", ", %s") ),
11833    ])
11834    pkt.Reply(12, [
11835            rec( 8, 4, TargetEntryID, ENC_BIG_ENDIAN ),
11836    ])
11837    pkt.CompletionCodes([0x0000, 0x8301, 0x8800, 0x9300, 0x9600, 0x9804, 0x9c03,
11838                         0xa100, 0xa201, 0xfd00, 0xff19])
11839    # 2222/2305, 35/05
11840    pkt = NCP(0x2305, "AFP Get File Information", 'afp')
11841    pkt.Request((18,272), [
11842            rec( 10, 1, VolumeNumber ),
11843            rec( 11, 4, BaseDirectoryID ),
11844            rec( 15, 2, RequestBitMap, ENC_BIG_ENDIAN ),
11845            rec( 17, (1,255), Path, info_str=(Path, "AFP Get File Information: %s", ", %s") ),
11846    ])
11847    pkt.Reply(121, [
11848            rec( 8, 4, AFPEntryID, ENC_BIG_ENDIAN ),
11849            rec( 12, 4, ParentID, ENC_BIG_ENDIAN ),
11850            rec( 16, 2, AttributesDef16, ENC_LITTLE_ENDIAN ),
11851            rec( 18, 4, DataForkLen, ENC_BIG_ENDIAN ),
11852            rec( 22, 4, ResourceForkLen, ENC_BIG_ENDIAN ),
11853            rec( 26, 2, TotalOffspring, ENC_BIG_ENDIAN  ),
11854            rec( 28, 2, CreationDate, ENC_BIG_ENDIAN ),
11855            rec( 30, 2, LastAccessedDate, ENC_BIG_ENDIAN ),
11856            rec( 32, 2, ModifiedDate, ENC_BIG_ENDIAN ),
11857            rec( 34, 2, ModifiedTime, ENC_BIG_ENDIAN ),
11858            rec( 36, 2, ArchivedDate, ENC_BIG_ENDIAN ),
11859            rec( 38, 2, ArchivedTime, ENC_BIG_ENDIAN ),
11860            rec( 40, 4, CreatorID, ENC_BIG_ENDIAN ),
11861            rec( 44, 4, Reserved4 ),
11862            rec( 48, 2, FinderAttr ),
11863            rec( 50, 2, HorizLocation ),
11864            rec( 52, 2, VertLocation ),
11865            rec( 54, 2, FileDirWindow ),
11866            rec( 56, 16, Reserved16 ),
11867            rec( 72, 32, LongName ),
11868            rec( 104, 4, CreatorID, ENC_BIG_ENDIAN ),
11869            rec( 108, 12, ShortName ),
11870            rec( 120, 1, AccessPrivileges ),
11871    ])
11872    pkt.CompletionCodes([0x0000, 0x8301, 0x8800, 0x9300, 0x9600, 0x9804, 0x9c03,
11873                         0xa100, 0xa201, 0xfd00, 0xff19])
11874    # 2222/2306, 35/06
11875    pkt = NCP(0x2306, "AFP Get Entry ID From NetWare Handle", 'afp')
11876    pkt.Request(16, [
11877            rec( 10, 6, FileHandle ),
11878    ])
11879    pkt.Reply(14, [
11880            rec( 8, 1, VolumeID ),
11881            rec( 9, 4, TargetEntryID, ENC_BIG_ENDIAN ),
11882            rec( 13, 1, ForkIndicator ),
11883    ])
11884    pkt.CompletionCodes([0x0000, 0x8301, 0x8800, 0x9300, 0x9600, 0xa201])
11885    # 2222/2307, 35/07
11886    pkt = NCP(0x2307, "AFP Rename", 'afp')
11887    pkt.Request((21, 529), [
11888            rec( 10, 1, VolumeNumber ),
11889            rec( 11, 4, MacSourceBaseID, ENC_BIG_ENDIAN ),
11890            rec( 15, 4, MacDestinationBaseID, ENC_BIG_ENDIAN ),
11891            rec( 19, (1,255), Path, info_str=(Path, "AFP Rename: %s", ", %s") ),
11892            rec( -1, (1,255), NewFileNameLen ),
11893    ])
11894    pkt.Reply(8)
11895    pkt.CompletionCodes([0x0000, 0x8301, 0x8401, 0x8800, 0x8b00, 0x8e00,
11896                         0x9001, 0x9201, 0x9300, 0x9600, 0x9804, 0x9900,
11897                         0x9c03, 0x9e00, 0xa100, 0xa201, 0xfd00, 0xff0a])
11898    # 2222/2308, 35/08
11899    pkt = NCP(0x2308, "AFP Open File Fork", 'afp')
11900    pkt.Request((18, 272), [
11901            rec( 10, 1, VolumeNumber ),
11902            rec( 11, 4, MacBaseDirectoryID ),
11903            rec( 15, 1, ForkIndicator ),
11904            rec( 16, 1, AccessMode ),
11905            rec( 17, (1,255), Path, info_str=(Path, "AFP Open File Fork: %s", ", %s") ),
11906    ])
11907    pkt.Reply(22, [
11908            rec( 8, 4, AFPEntryID, ENC_BIG_ENDIAN ),
11909            rec( 12, 4, DataForkLen, ENC_BIG_ENDIAN ),
11910            rec( 16, 6, NetWareAccessHandle ),
11911    ])
11912    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8301, 0x8800, 0x9300,
11913                         0x9400, 0x9600, 0x9804, 0x9900, 0x9c03, 0xa100,
11914                         0xa201, 0xfd00, 0xff16])
11915    # 2222/2309, 35/09
11916    pkt = NCP(0x2309, "AFP Set File Information", 'afp')
11917    pkt.Request((64, 318), [
11918            rec( 10, 1, VolumeNumber ),
11919            rec( 11, 4, MacBaseDirectoryID ),
11920            rec( 15, 2, RequestBitMap, ENC_BIG_ENDIAN ),
11921            rec( 17, 2, MacAttr, ENC_BIG_ENDIAN ),
11922            rec( 19, 2, CreationDate, ENC_BIG_ENDIAN ),
11923            rec( 21, 2, LastAccessedDate, ENC_BIG_ENDIAN ),
11924            rec( 23, 2, ModifiedDate, ENC_BIG_ENDIAN ),
11925            rec( 25, 2, ModifiedTime, ENC_BIG_ENDIAN ),
11926            rec( 27, 2, ArchivedDate, ENC_BIG_ENDIAN ),
11927            rec( 29, 2, ArchivedTime, ENC_BIG_ENDIAN ),
11928            rec( 31, 4, CreatorID, ENC_BIG_ENDIAN ),
11929            rec( 35, 4, Reserved4 ),
11930            rec( 39, 2, FinderAttr ),
11931            rec( 41, 2, HorizLocation ),
11932            rec( 43, 2, VertLocation ),
11933            rec( 45, 2, FileDirWindow ),
11934            rec( 47, 16, Reserved16 ),
11935            rec( 63, (1,255), Path, info_str=(Path, "AFP Set File Information: %s", ", %s") ),
11936    ])
11937    pkt.Reply(8)
11938    pkt.CompletionCodes([0x0000, 0x0104, 0x8301, 0x8800, 0x9300, 0x9400,
11939                         0x9500, 0x9600, 0x9804, 0x9c03, 0xa100, 0xa201,
11940                         0xfd00, 0xff16])
11941    # 2222/230A, 35/10
11942    pkt = NCP(0x230A, "AFP Scan File Information", 'afp')
11943    pkt.Request((26, 280), [
11944            rec( 10, 1, VolumeNumber ),
11945            rec( 11, 4, MacBaseDirectoryID ),
11946            rec( 15, 4, MacLastSeenID, ENC_BIG_ENDIAN ),
11947            rec( 19, 2, DesiredResponseCount, ENC_BIG_ENDIAN ),
11948            rec( 21, 2, SearchBitMap, ENC_BIG_ENDIAN ),
11949            rec( 23, 2, RequestBitMap, ENC_BIG_ENDIAN ),
11950            rec( 25, (1,255), Path, info_str=(Path, "AFP Scan File Information: %s", ", %s") ),
11951    ])
11952    pkt.Reply(123, [
11953            rec( 8, 2, ActualResponseCount, ENC_BIG_ENDIAN, var="x" ),
11954            rec( 10, 113, AFP10Struct, repeat="x" ),
11955    ])
11956    pkt.CompletionCodes([0x0000, 0x8301, 0x8800, 0x9300, 0x9600, 0x9804,
11957                         0x9c03, 0xa100, 0xa201, 0xfd00, 0xff16])
11958    # 2222/230B, 35/11
11959    pkt = NCP(0x230B, "AFP Alloc Temporary Directory Handle", 'afp')
11960    pkt.Request((16,270), [
11961            rec( 10, 1, VolumeNumber ),
11962            rec( 11, 4, MacBaseDirectoryID ),
11963            rec( 15, (1,255), Path, info_str=(Path, "AFP Allocate Temporary Directory Handle: %s", ", %s") ),
11964    ])
11965    pkt.Reply(10, [
11966            rec( 8, 1, DirHandle ),
11967            rec( 9, 1, AccessRightsMask ),
11968    ])
11969    pkt.CompletionCodes([0x0000, 0x8301, 0x8800, 0x9300, 0x9600,
11970                         0x9804, 0x9b03, 0x9c03, 0x9d00, 0xa100,
11971                         0xa201, 0xfd00, 0xff00])
11972    # 2222/230C, 35/12
11973    pkt = NCP(0x230C, "AFP Get Entry ID From Path Name", 'afp')
11974    pkt.Request((12,266), [
11975            rec( 10, 1, DirHandle ),
11976            rec( 11, (1,255), Path, info_str=(Path, "AFP Get Entry ID from Path Name: %s", ", %s") ),
11977    ])
11978    pkt.Reply(12, [
11979            rec( 8, 4, AFPEntryID, ENC_BIG_ENDIAN ),
11980    ])
11981    pkt.CompletionCodes([0x0000, 0x8301, 0x8800, 0x9300, 0x9600,
11982                         0x9804, 0x9b03, 0x9c03, 0xa100, 0xa201,
11983                         0xfd00, 0xff00])
11984    # 2222/230D, 35/13
11985    pkt = NCP(0x230D, "AFP 2.0 Create Directory", 'afp')
11986    pkt.Request((55,309), [
11987            rec( 10, 1, VolumeNumber ),
11988            rec( 11, 4, BaseDirectoryID ),
11989            rec( 15, 1, Reserved ),
11990            rec( 16, 4, CreatorID, ENC_BIG_ENDIAN ),
11991            rec( 20, 4, Reserved4 ),
11992            rec( 24, 2, FinderAttr ),
11993            rec( 26, 2, HorizLocation ),
11994            rec( 28, 2, VertLocation ),
11995            rec( 30, 2, FileDirWindow ),
11996            rec( 32, 16, Reserved16 ),
11997            rec( 48, 6, ProDOSInfo ),
11998            rec( 54, (1,255), Path, info_str=(Path, "AFP 2.0 Create Directory: %s", ", %s") ),
11999    ])
12000    pkt.Reply(12, [
12001            rec( 8, 4, NewDirectoryID ),
12002    ])
12003    pkt.CompletionCodes([0x0000, 0x8301, 0x8400, 0x8800, 0x9300,
12004                         0x9600, 0x9804, 0x9900, 0x9c03, 0x9e00,
12005                         0xa100, 0xa201, 0xfd00, 0xff00])
12006    # 2222/230E, 35/14
12007    pkt = NCP(0x230E, "AFP 2.0 Create File", 'afp')
12008    pkt.Request((55,309), [
12009            rec( 10, 1, VolumeNumber ),
12010            rec( 11, 4, BaseDirectoryID ),
12011            rec( 15, 1, DeleteExistingFileFlag ),
12012            rec( 16, 4, CreatorID, ENC_BIG_ENDIAN ),
12013            rec( 20, 4, Reserved4 ),
12014            rec( 24, 2, FinderAttr ),
12015            rec( 26, 2, HorizLocation ),
12016            rec( 28, 2, VertLocation ),
12017            rec( 30, 2, FileDirWindow ),
12018            rec( 32, 16, Reserved16 ),
12019            rec( 48, 6, ProDOSInfo ),
12020            rec( 54, (1,255), Path, info_str=(Path, "AFP 2.0 Create File: %s", ", %s") ),
12021    ])
12022    pkt.Reply(12, [
12023            rec( 8, 4, NewDirectoryID ),
12024    ])
12025    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8301, 0x8400,
12026                         0x8701, 0x8800, 0x8a00, 0x8d00, 0x8e00,
12027                         0x8f00, 0x9001, 0x9300, 0x9600, 0x9804,
12028                         0x9900, 0x9b03, 0x9c03, 0x9e00, 0xa100,
12029                         0xa201, 0xfd00, 0xff00])
12030    # 2222/230F, 35/15
12031    pkt = NCP(0x230F, "AFP 2.0 Get File Or Directory Information", 'afp')
12032    pkt.Request((18,272), [
12033            rec( 10, 1, VolumeNumber ),
12034            rec( 11, 4, BaseDirectoryID ),
12035            rec( 15, 2, RequestBitMap, ENC_BIG_ENDIAN ),
12036            rec( 17, (1,255), Path, info_str=(Path, "AFP 2.0 Get Information: %s", ", %s") ),
12037    ])
12038    pkt.Reply(128, [
12039            rec( 8, 4, AFPEntryID, ENC_BIG_ENDIAN ),
12040            rec( 12, 4, ParentID, ENC_BIG_ENDIAN ),
12041            rec( 16, 2, AttributesDef16 ),
12042            rec( 18, 4, DataForkLen, ENC_BIG_ENDIAN ),
12043            rec( 22, 4, ResourceForkLen, ENC_BIG_ENDIAN ),
12044            rec( 26, 2, TotalOffspring, ENC_BIG_ENDIAN ),
12045            rec( 28, 2, CreationDate, ENC_BIG_ENDIAN ),
12046            rec( 30, 2, LastAccessedDate, ENC_BIG_ENDIAN ),
12047            rec( 32, 2, ModifiedDate, ENC_BIG_ENDIAN ),
12048            rec( 34, 2, ModifiedTime, ENC_BIG_ENDIAN ),
12049            rec( 36, 2, ArchivedDate, ENC_BIG_ENDIAN ),
12050            rec( 38, 2, ArchivedTime, ENC_BIG_ENDIAN ),
12051            rec( 40, 4, CreatorID, ENC_BIG_ENDIAN ),
12052            rec( 44, 4, Reserved4 ),
12053            rec( 48, 2, FinderAttr ),
12054            rec( 50, 2, HorizLocation ),
12055            rec( 52, 2, VertLocation ),
12056            rec( 54, 2, FileDirWindow ),
12057            rec( 56, 16, Reserved16 ),
12058            rec( 72, 32, LongName ),
12059            rec( 104, 4, CreatorID, ENC_BIG_ENDIAN ),
12060            rec( 108, 12, ShortName ),
12061            rec( 120, 1, AccessPrivileges ),
12062            rec( 121, 1, Reserved ),
12063            rec( 122, 6, ProDOSInfo ),
12064    ])
12065    pkt.CompletionCodes([0x0000, 0x8301, 0x8800, 0x9300, 0x9600, 0x9804, 0x9c03,
12066                         0xa100, 0xa201, 0xfd00, 0xff19])
12067    # 2222/2310, 35/16
12068    pkt = NCP(0x2310, "AFP 2.0 Set File Information", 'afp')
12069    pkt.Request((70, 324), [
12070            rec( 10, 1, VolumeNumber ),
12071            rec( 11, 4, MacBaseDirectoryID ),
12072            rec( 15, 2, RequestBitMap, ENC_BIG_ENDIAN ),
12073            rec( 17, 2, AttributesDef16 ),
12074            rec( 19, 2, CreationDate, ENC_BIG_ENDIAN ),
12075            rec( 21, 2, LastAccessedDate, ENC_BIG_ENDIAN ),
12076            rec( 23, 2, ModifiedDate, ENC_BIG_ENDIAN ),
12077            rec( 25, 2, ModifiedTime, ENC_BIG_ENDIAN ),
12078            rec( 27, 2, ArchivedDate, ENC_BIG_ENDIAN ),
12079            rec( 29, 2, ArchivedTime, ENC_BIG_ENDIAN ),
12080            rec( 31, 4, CreatorID, ENC_BIG_ENDIAN ),
12081            rec( 35, 4, Reserved4 ),
12082            rec( 39, 2, FinderAttr ),
12083            rec( 41, 2, HorizLocation ),
12084            rec( 43, 2, VertLocation ),
12085            rec( 45, 2, FileDirWindow ),
12086            rec( 47, 16, Reserved16 ),
12087            rec( 63, 6, ProDOSInfo ),
12088            rec( 69, (1,255), Path, info_str=(Path, "AFP 2.0 Set File Information: %s", ", %s") ),
12089    ])
12090    pkt.Reply(8)
12091    pkt.CompletionCodes([0x0000, 0x0104, 0x8301, 0x8800, 0x9300, 0x9400,
12092                         0x9500, 0x9600, 0x9804, 0x9c03, 0xa100, 0xa201,
12093                         0xfd00, 0xff16])
12094    # 2222/2311, 35/17
12095    pkt = NCP(0x2311, "AFP 2.0 Scan File Information", 'afp')
12096    pkt.Request((26, 280), [
12097            rec( 10, 1, VolumeNumber ),
12098            rec( 11, 4, MacBaseDirectoryID ),
12099            rec( 15, 4, MacLastSeenID, ENC_BIG_ENDIAN ),
12100            rec( 19, 2, DesiredResponseCount, ENC_BIG_ENDIAN ),
12101            rec( 21, 2, SearchBitMap, ENC_BIG_ENDIAN ),
12102            rec( 23, 2, RequestBitMap, ENC_BIG_ENDIAN ),
12103            rec( 25, (1,255), Path, info_str=(Path, "AFP 2.0 Scan File Information: %s", ", %s") ),
12104    ])
12105    pkt.Reply(14, [
12106            rec( 8, 2, ActualResponseCount, var="x" ),
12107            rec( 10, 4, AFP20Struct, repeat="x" ),
12108    ])
12109    pkt.CompletionCodes([0x0000, 0x8301, 0x8800, 0x9300, 0x9600, 0x9804,
12110                         0x9c03, 0xa100, 0xa201, 0xfd00, 0xff16])
12111    # 2222/2312, 35/18
12112    pkt = NCP(0x2312, "AFP Get DOS Name From Entry ID", 'afp')
12113    pkt.Request(15, [
12114            rec( 10, 1, VolumeNumber ),
12115            rec( 11, 4, AFPEntryID, ENC_BIG_ENDIAN ),
12116    ])
12117    pkt.Reply((9,263), [
12118            rec( 8, (1,255), Path ),
12119    ])
12120    pkt.CompletionCodes([0x0000, 0x8900, 0x9600, 0xbf00])
12121    # 2222/2313, 35/19
12122    pkt = NCP(0x2313, "AFP Get Macintosh Info On Deleted File", 'afp')
12123    pkt.Request(15, [
12124            rec( 10, 1, VolumeNumber ),
12125            rec( 11, 4, DirectoryNumber, ENC_BIG_ENDIAN ),
12126    ])
12127    pkt.Reply((51,305), [
12128            rec( 8, 4, CreatorID, ENC_BIG_ENDIAN ),
12129            rec( 12, 4, Reserved4 ),
12130            rec( 16, 2, FinderAttr ),
12131            rec( 18, 2, HorizLocation ),
12132            rec( 20, 2, VertLocation ),
12133            rec( 22, 2, FileDirWindow ),
12134            rec( 24, 16, Reserved16 ),
12135            rec( 40, 6, ProDOSInfo ),
12136            rec( 46, 4, ResourceForkSize, ENC_BIG_ENDIAN ),
12137            rec( 50, (1,255), FileName ),
12138    ])
12139    pkt.CompletionCodes([0x0000, 0x9c03, 0xbf00])
12140    # 2222/2400, 36/00
12141    pkt = NCP(0x2400, "Get NCP Extension Information", 'extension')
12142    pkt.Request(14, [
12143            rec( 10, 4, NCPextensionNumber, ENC_LITTLE_ENDIAN ),
12144    ])
12145    pkt.Reply((16,270), [
12146            rec( 8, 4, NCPextensionNumber ),
12147            rec( 12, 1, NCPextensionMajorVersion ),
12148            rec( 13, 1, NCPextensionMinorVersion ),
12149            rec( 14, 1, NCPextensionRevisionNumber ),
12150            rec( 15, (1, 255), NCPextensionName ),
12151    ])
12152    pkt.CompletionCodes([0x0000, 0x7e01, 0xfe00, 0xff20])
12153    # 2222/2401, 36/01
12154    pkt = NCP(0x2401, "Get NCP Extension Maximum Data Size", 'extension')
12155    pkt.Request(10)
12156    pkt.Reply(10, [
12157            rec( 8, 2, NCPdataSize ),
12158    ])
12159    pkt.CompletionCodes([0x0000, 0x7e01, 0xfe00, 0xff20])
12160    # 2222/2402, 36/02
12161    pkt = NCP(0x2402, "Get NCP Extension Information by Name", 'extension')
12162    pkt.Request((11, 265), [
12163            rec( 10, (1,255), NCPextensionName, info_str=(NCPextensionName, "Get NCP Extension Information by Name: %s", ", %s") ),
12164    ])
12165    pkt.Reply((16,270), [
12166            rec( 8, 4, NCPextensionNumber ),
12167            rec( 12, 1, NCPextensionMajorVersion ),
12168            rec( 13, 1, NCPextensionMinorVersion ),
12169            rec( 14, 1, NCPextensionRevisionNumber ),
12170            rec( 15, (1, 255), NCPextensionName ),
12171    ])
12172    pkt.CompletionCodes([0x0000, 0x7e01, 0xfe00, 0xff20])
12173    # 2222/2403, 36/03
12174    pkt = NCP(0x2403, "Get Number of Registered NCP Extensions", 'extension')
12175    pkt.Request(10)
12176    pkt.Reply(12, [
12177            rec( 8, 4, NumberOfNCPExtensions ),
12178    ])
12179    pkt.CompletionCodes([0x0000, 0x7e01, 0xfe00, 0xff20])
12180    # 2222/2404, 36/04
12181    pkt = NCP(0x2404, "Get NCP Extension Registered Verbs List", 'extension')
12182    pkt.Request(14, [
12183            rec( 10, 4, StartingNumber ),
12184    ])
12185    pkt.Reply(20, [
12186            rec( 8, 4, ReturnedListCount, var="x" ),
12187            rec( 12, 4, nextStartingNumber ),
12188            rec( 16, 4, NCPExtensionNumbers, repeat="x" ),
12189    ])
12190    pkt.CompletionCodes([0x0000, 0x7e01, 0xfe00, 0xff20])
12191    # 2222/2405, 36/05
12192    pkt = NCP(0x2405, "Return NCP Extension Information", 'extension')
12193    pkt.Request(14, [
12194            rec( 10, 4, NCPextensionNumber ),
12195    ])
12196    pkt.Reply((16,270), [
12197            rec( 8, 4, NCPextensionNumber ),
12198            rec( 12, 1, NCPextensionMajorVersion ),
12199            rec( 13, 1, NCPextensionMinorVersion ),
12200            rec( 14, 1, NCPextensionRevisionNumber ),
12201            rec( 15, (1, 255), NCPextensionName ),
12202    ])
12203    pkt.CompletionCodes([0x0000, 0x7e01, 0xfe00, 0xff20])
12204    # 2222/2406, 36/06
12205    pkt = NCP(0x2406, "Return NCP Extension Maximum Data Size", 'extension')
12206    pkt.Request(10)
12207    pkt.Reply(12, [
12208            rec( 8, 4, NCPdataSize ),
12209    ])
12210    pkt.CompletionCodes([0x0000, 0x7e01, 0xfe00, 0xff20])
12211    # 2222/25, 37
12212    pkt = NCP(0x25, "Execute NCP Extension", 'extension')
12213    pkt.Request(11, [
12214            rec( 7, 4, NCPextensionNumber ),
12215            # The following value is Unicode
12216            #rec[ 13, (1,255), RequestData ],
12217    ])
12218    pkt.Reply(8)
12219        # The following value is Unicode
12220        #[ 8, (1, 255), ReplyBuffer ],
12221    pkt.CompletionCodes([0x0000, 0x7e01, 0xf000, 0x9c00, 0xd504, 0xee00, 0xfe00, 0xff20])
12222    # 2222/3B, 59
12223    pkt = NCP(0x3B, "Commit File", 'file', has_length=0 )
12224    pkt.Request(14, [
12225            rec( 7, 1, Reserved ),
12226            rec( 8, 6, FileHandle, info_str=(FileHandle, "Commit File - 0x%s", ", %s") ),
12227    ])
12228    pkt.Reply(8)
12229    pkt.CompletionCodes([0x0000, 0x8800, 0x9804, 0xff00])
12230    # 2222/3D, 61
12231    pkt = NCP(0x3D, "Commit File", 'file', has_length=0 )
12232    pkt.Request(14, [
12233            rec( 7, 1, Reserved ),
12234            rec( 8, 6, FileHandle, info_str=(FileHandle, "Commit File - 0x%s", ", %s") ),
12235    ])
12236    pkt.Reply(8)
12237    pkt.CompletionCodes([0x0000, 0x8800, 0x9804, 0xff00])
12238    # 2222/3E, 62
12239    pkt = NCP(0x3E, "File Search Initialize", 'file', has_length=0 )
12240    pkt.Request((9, 263), [
12241            rec( 7, 1, DirHandle ),
12242            rec( 8, (1,255), Path, info_str=(Path, "Initialize File Search: %s", ", %s") ),
12243    ])
12244    pkt.Reply(14, [
12245            rec( 8, 1, VolumeNumber ),
12246            rec( 9, 2, DirectoryID ),
12247            rec( 11, 2, SequenceNumber, ENC_BIG_ENDIAN ),
12248            rec( 13, 1, AccessRightsMask ),
12249    ])
12250    pkt.CompletionCodes([0x0000, 0x9600, 0x9804, 0x9b03, 0x9c03, 0xa100,
12251                         0xfd00, 0xff16])
12252    # 2222/3F, 63
12253    pkt = NCP(0x3F, "File Search Continue", 'file', has_length=0 )
12254    pkt.Request((14, 268), [
12255            rec( 7, 1, VolumeNumber ),
12256            rec( 8, 2, DirectoryID ),
12257            rec( 10, 2, SequenceNumber, ENC_BIG_ENDIAN ),
12258            rec( 12, 1, SearchAttributes ),
12259            rec( 13, (1,255), Path, info_str=(Path, "File Search Continue: %s", ", %s") ),
12260    ])
12261    pkt.Reply( NO_LENGTH_CHECK, [
12262            #
12263            # XXX - don't show this if we got back a non-zero
12264            # completion code?  For example, 255 means "No
12265            # matching files or directories were found", so
12266            # presumably it can't show you a matching file or
12267            # directory instance - it appears to just leave crap
12268            # there.
12269            #
12270            srec( DirectoryInstance, req_cond="ncp.sattr_sub==TRUE"),
12271            srec( FileInstance, req_cond="ncp.sattr_sub!=TRUE"),
12272    ])
12273    pkt.ReqCondSizeVariable()
12274    pkt.CompletionCodes([0x0000, 0xff16])
12275    # 2222/40, 64
12276    pkt = NCP(0x40, "Search for a File", 'file')
12277    pkt.Request((12, 266), [
12278            rec( 7, 2, SequenceNumber, ENC_BIG_ENDIAN ),
12279            rec( 9, 1, DirHandle ),
12280            rec( 10, 1, SearchAttributes ),
12281            rec( 11, (1,255), FileName, info_str=(FileName, "Search for File: %s", ", %s") ),
12282    ])
12283    pkt.Reply(40, [
12284            rec( 8, 2, SequenceNumber, ENC_BIG_ENDIAN ),
12285            rec( 10, 2, Reserved2 ),
12286            rec( 12, 14, FileName14 ),
12287            rec( 26, 1, AttributesDef ),
12288            rec( 27, 1, FileExecuteType ),
12289            rec( 28, 4, FileSize ),
12290            rec( 32, 2, CreationDate, ENC_BIG_ENDIAN ),
12291            rec( 34, 2, LastAccessedDate, ENC_BIG_ENDIAN ),
12292            rec( 36, 2, ModifiedDate, ENC_BIG_ENDIAN ),
12293            rec( 38, 2, ModifiedTime, ENC_BIG_ENDIAN ),
12294    ])
12295    pkt.CompletionCodes([0x0000, 0x8900, 0x9600, 0x9804, 0x9b03,
12296                         0x9c03, 0xa100, 0xfd00, 0xff16])
12297    # 2222/41, 65
12298    pkt = NCP(0x41, "Open File", 'file')
12299    pkt.Request((10, 264), [
12300            rec( 7, 1, DirHandle ),
12301            rec( 8, 1, SearchAttributes ),
12302            rec( 9, (1,255), FileName, info_str=(FileName, "Open File: %s", ", %s") ),
12303    ])
12304    pkt.Reply(44, [
12305            rec( 8, 6, FileHandle ),
12306            rec( 14, 2, Reserved2 ),
12307            rec( 16, 14, FileName14 ),
12308            rec( 30, 1, AttributesDef ),
12309            rec( 31, 1, FileExecuteType ),
12310            rec( 32, 4, FileSize, ENC_BIG_ENDIAN ),
12311            rec( 36, 2, CreationDate, ENC_BIG_ENDIAN ),
12312            rec( 38, 2, LastAccessedDate, ENC_BIG_ENDIAN ),
12313            rec( 40, 2, ModifiedDate, ENC_BIG_ENDIAN ),
12314            rec( 42, 2, ModifiedTime, ENC_BIG_ENDIAN ),
12315    ])
12316    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8200, 0x9400,
12317                         0x9600, 0x9804, 0x9c03, 0xa100, 0xfd00,
12318                         0xff16])
12319    # 2222/42, 66
12320    pkt = NCP(0x42, "Close File", 'file')
12321    pkt.Request(14, [
12322            rec( 7, 1, Reserved ),
12323            rec( 8, 6, FileHandle, info_str=(FileHandle, "Close File - 0x%s", ", %s") ),
12324    ])
12325    pkt.Reply(8)
12326    pkt.CompletionCodes([0x0000, 0x8800, 0xff1a])
12327    pkt.MakeExpert("ncp42_request")
12328    # 2222/43, 67
12329    pkt = NCP(0x43, "Create File", 'file')
12330    pkt.Request((10, 264), [
12331            rec( 7, 1, DirHandle ),
12332            rec( 8, 1, AttributesDef ),
12333            rec( 9, (1,255), FileName, info_str=(FileName, "Create File: %s", ", %s") ),
12334    ])
12335    pkt.Reply(44, [
12336            rec( 8, 6, FileHandle ),
12337            rec( 14, 2, Reserved2 ),
12338            rec( 16, 14, FileName14 ),
12339            rec( 30, 1, AttributesDef ),
12340            rec( 31, 1, FileExecuteType ),
12341            rec( 32, 4, FileSize, ENC_BIG_ENDIAN ),
12342            rec( 36, 2, CreationDate, ENC_BIG_ENDIAN ),
12343            rec( 38, 2, LastAccessedDate, ENC_BIG_ENDIAN ),
12344            rec( 40, 2, ModifiedDate, ENC_BIG_ENDIAN ),
12345            rec( 42, 2, ModifiedTime, ENC_BIG_ENDIAN ),
12346    ])
12347    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
12348                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
12349                         0x9804, 0x9900, 0x9b03, 0x9c03, 0xfd00,
12350                         0xff00])
12351    # 2222/44, 68
12352    pkt = NCP(0x44, "Erase File", 'file')
12353    pkt.Request((10, 264), [
12354            rec( 7, 1, DirHandle ),
12355            rec( 8, 1, SearchAttributes ),
12356            rec( 9, (1,255), FileName, info_str=(FileName, "Erase File: %s", ", %s") ),
12357    ])
12358    pkt.Reply(8)
12359    pkt.CompletionCodes([0x0000, 0x8a00, 0x8d00, 0x8e00, 0x8f00,
12360                         0x9001, 0x9600, 0x9804, 0x9b03, 0x9c03,
12361                         0xa100, 0xfd00, 0xff00])
12362    # 2222/45, 69
12363    pkt = NCP(0x45, "Rename File", 'file')
12364    pkt.Request((12, 520), [
12365            rec( 7, 1, DirHandle ),
12366            rec( 8, 1, SearchAttributes ),
12367            rec( 9, (1,255), FileName, info_str=(FileName, "Rename File: %s", ", %s") ),
12368            rec( -1, 1, TargetDirHandle ),
12369            rec( -1, (1, 255), NewFileNameLen ),
12370    ])
12371    pkt.Reply(8)
12372    pkt.CompletionCodes([0x0000, 0x8701, 0x8b00, 0x8d00, 0x8e00,
12373                         0x8f00, 0x9001, 0x9101, 0x9201, 0x9600,
12374                         0x9804, 0x9a00, 0x9b03, 0x9c03, 0xa100,
12375                         0xfd00, 0xff16])
12376    # 2222/46, 70
12377    pkt = NCP(0x46, "Set File Attributes", 'file')
12378    pkt.Request((11, 265), [
12379            rec( 7, 1, AttributesDef ),
12380            rec( 8, 1, DirHandle ),
12381            rec( 9, 1, SearchAttributes ),
12382            rec( 10, (1,255), FileName, info_str=(FileName, "Set File Attributes: %s", ", %s") ),
12383    ])
12384    pkt.Reply(8)
12385    pkt.CompletionCodes([0x0000, 0x8c00, 0x8d00, 0x8e00, 0x9600,
12386                         0x9804, 0x9b03, 0x9c03, 0xa100, 0xfd00,
12387                         0xff16])
12388    # 2222/47, 71
12389    pkt = NCP(0x47, "Get Current Size of File", 'file')
12390    pkt.Request(14, [
12391    rec(7, 1, Reserved ),
12392            rec( 8, 6, FileHandle, info_str=(FileHandle, "Get Current Size of File - 0x%s", ", %s") ),
12393    ])
12394    pkt.Reply(12, [
12395            rec( 8, 4, FileSize, ENC_BIG_ENDIAN ),
12396    ])
12397    pkt.CompletionCodes([0x0000, 0x8800])
12398    # 2222/48, 72
12399    pkt = NCP(0x48, "Read From A File", 'file')
12400    pkt.Request(20, [
12401            rec( 7, 1, Reserved ),
12402            rec( 8, 6, FileHandle, info_str=(FileHandle, "Read From File - 0x%s", ", %s") ),
12403            rec( 14, 4, FileOffset, ENC_BIG_ENDIAN ),
12404            rec( 18, 2, MaxBytes, ENC_BIG_ENDIAN ),
12405    ])
12406    pkt.Reply(10, [
12407            rec( 8, 2, NumBytes, ENC_BIG_ENDIAN ),
12408    ])
12409    pkt.CompletionCodes([0x0000, 0x8300, 0x8800, 0x9300, 0xff1b])
12410    # 2222/49, 73
12411    pkt = NCP(0x49, "Write to a File", 'file')
12412    pkt.Request(20, [
12413            rec( 7, 1, Reserved ),
12414            rec( 8, 6, FileHandle, info_str=(FileHandle, "Write to a File - 0x%s", ", %s") ),
12415            rec( 14, 4, FileOffset, ENC_BIG_ENDIAN ),
12416            rec( 18, 2, MaxBytes, ENC_BIG_ENDIAN ),
12417    ])
12418    pkt.Reply(8)
12419    pkt.CompletionCodes([0x0000, 0x0104, 0x8300, 0x8800, 0x9400, 0x9500, 0xa201, 0xff1b])
12420    # 2222/4A, 74
12421    pkt = NCP(0x4A, "Copy from One File to Another", 'file')
12422    pkt.Request(30, [
12423            rec( 7, 1, Reserved ),
12424            rec( 8, 6, FileHandle ),
12425            rec( 14, 6, TargetFileHandle ),
12426            rec( 20, 4, FileOffset, ENC_BIG_ENDIAN ),
12427            rec( 24, 4, TargetFileOffset, ENC_BIG_ENDIAN ),
12428            rec( 28, 2, BytesToCopy, ENC_BIG_ENDIAN ),
12429    ])
12430    pkt.Reply(12, [
12431            rec( 8, 4, BytesActuallyTransferred, ENC_BIG_ENDIAN ),
12432    ])
12433    pkt.CompletionCodes([0x0000, 0x0104, 0x8300, 0x8800, 0x9300, 0x9400,
12434                         0x9500, 0x9600, 0xa201, 0xff1b])
12435    # 2222/4B, 75
12436    pkt = NCP(0x4B, "Set File Time Date Stamp", 'file')
12437    pkt.Request(18, [
12438            rec( 7, 1, Reserved ),
12439            rec( 8, 6, FileHandle, info_str=(FileHandle, "Set Time and Date Stamp for File - 0x%s", ", %s") ),
12440            rec( 14, 2, FileTime, ENC_BIG_ENDIAN ),
12441            rec( 16, 2, FileDate, ENC_BIG_ENDIAN ),
12442    ])
12443    pkt.Reply(8)
12444    pkt.CompletionCodes([0x0000, 0x8800, 0x9400, 0x9600, 0xfb08])
12445    # 2222/4C, 76
12446    pkt = NCP(0x4C, "Open File", 'file')
12447    pkt.Request((11, 265), [
12448            rec( 7, 1, DirHandle ),
12449            rec( 8, 1, SearchAttributes ),
12450            rec( 9, 1, AccessRightsMask ),
12451            rec( 10, (1,255), FileName, info_str=(FileName, "Open File: %s", ", %s") ),
12452    ])
12453    pkt.Reply(44, [
12454            rec( 8, 6, FileHandle ),
12455            rec( 14, 2, Reserved2 ),
12456            rec( 16, 14, FileName14 ),
12457            rec( 30, 1, AttributesDef ),
12458            rec( 31, 1, FileExecuteType ),
12459            rec( 32, 4, FileSize, ENC_BIG_ENDIAN ),
12460            rec( 36, 2, CreationDate, ENC_BIG_ENDIAN ),
12461            rec( 38, 2, LastAccessedDate, ENC_BIG_ENDIAN ),
12462            rec( 40, 2, ModifiedDate, ENC_BIG_ENDIAN ),
12463            rec( 42, 2, ModifiedTime, ENC_BIG_ENDIAN ),
12464    ])
12465    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8200, 0x9400,
12466                         0x9600, 0x9804, 0x9c03, 0xa100, 0xfd00,
12467                         0xff16])
12468    # 2222/4D, 77
12469    pkt = NCP(0x4D, "Create File", 'file')
12470    pkt.Request((10, 264), [
12471            rec( 7, 1, DirHandle ),
12472            rec( 8, 1, AttributesDef ),
12473            rec( 9, (1,255), FileName, info_str=(FileName, "Create File: %s", ", %s") ),
12474    ])
12475    pkt.Reply(44, [
12476            rec( 8, 6, FileHandle ),
12477            rec( 14, 2, Reserved2 ),
12478            rec( 16, 14, FileName14 ),
12479            rec( 30, 1, AttributesDef ),
12480            rec( 31, 1, FileExecuteType ),
12481            rec( 32, 4, FileSize, ENC_BIG_ENDIAN ),
12482            rec( 36, 2, CreationDate, ENC_BIG_ENDIAN ),
12483            rec( 38, 2, LastAccessedDate, ENC_BIG_ENDIAN ),
12484            rec( 40, 2, ModifiedDate, ENC_BIG_ENDIAN ),
12485            rec( 42, 2, ModifiedTime, ENC_BIG_ENDIAN ),
12486    ])
12487    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
12488                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
12489                         0x9804, 0x9900, 0x9b03, 0x9c03, 0xfd00,
12490                         0xff00])
12491    # 2222/4F, 79
12492    pkt = NCP(0x4F, "Set File Extended Attributes", 'file')
12493    pkt.Request((11, 265), [
12494            rec( 7, 1, AttributesDef ),
12495            rec( 8, 1, DirHandle ),
12496            rec( 9, 1, AccessRightsMask ),
12497            rec( 10, (1,255), FileName, info_str=(FileName, "Set File Extended Attributes: %s", ", %s") ),
12498    ])
12499    pkt.Reply(8)
12500    pkt.CompletionCodes([0x0000, 0x8c00, 0x8d00, 0x8e00, 0x9600,
12501                         0x9804, 0x9b03, 0x9c03, 0xa100, 0xfd00,
12502                         0xff16])
12503    # 2222/54, 84
12504    pkt = NCP(0x54, "Open/Create File", 'file')
12505    pkt.Request((12, 266), [
12506            rec( 7, 1, DirHandle ),
12507            rec( 8, 1, AttributesDef ),
12508            rec( 9, 1, AccessRightsMask ),
12509            rec( 10, 1, ActionFlag ),
12510            rec( 11, (1,255), FileName, info_str=(FileName, "Open/Create File: %s", ", %s") ),
12511    ])
12512    pkt.Reply(44, [
12513            rec( 8, 6, FileHandle ),
12514            rec( 14, 2, Reserved2 ),
12515            rec( 16, 14, FileName14 ),
12516            rec( 30, 1, AttributesDef ),
12517            rec( 31, 1, FileExecuteType ),
12518            rec( 32, 4, FileSize, ENC_BIG_ENDIAN ),
12519            rec( 36, 2, CreationDate, ENC_BIG_ENDIAN ),
12520            rec( 38, 2, LastAccessedDate, ENC_BIG_ENDIAN ),
12521            rec( 40, 2, ModifiedDate, ENC_BIG_ENDIAN ),
12522            rec( 42, 2, ModifiedTime, ENC_BIG_ENDIAN ),
12523    ])
12524    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
12525                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
12526                         0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
12527    # 2222/55, 85
12528    pkt = NCP(0x55, "Get Sparse File Data Block Bit Map", 'file', has_length=1)
12529    pkt.Request(19, [
12530            rec( 7, 2, SubFuncStrucLen, ENC_BIG_ENDIAN ),
12531            rec( 9, 6, FileHandle, info_str=(FileHandle, "Get Sparse File Data Block Bitmap for File - 0x%s", ", %s") ),
12532            rec( 15, 4, FileOffset ),
12533    ])
12534    pkt.Reply(528, [
12535            rec( 8, 4, AllocationBlockSize ),
12536            rec( 12, 4, Reserved4 ),
12537            rec( 16, 512, BitMap ),
12538    ])
12539    pkt.CompletionCodes([0x0000, 0x8800])
12540    # 2222/5601, 86/01
12541    pkt = NCP(0x5601, "Close Extended Attribute Handle", 'extended', has_length=0 )
12542    pkt.Request(14, [
12543            rec( 8, 2, Reserved2 ),
12544            rec( 10, 4, EAHandle ),
12545    ])
12546    pkt.Reply(8)
12547    pkt.CompletionCodes([0x0000, 0xcf00, 0xd301])
12548    # 2222/5602, 86/02
12549    pkt = NCP(0x5602, "Write Extended Attribute", 'extended', has_length=0 )
12550    pkt.Request((35,97), [
12551            rec( 8, 2, EAFlags ),
12552            rec( 10, 4, EAHandleOrNetWareHandleOrVolume, ENC_BIG_ENDIAN ),
12553            rec( 14, 4, ReservedOrDirectoryNumber ),
12554            rec( 18, 4, TtlWriteDataSize ),
12555            rec( 22, 4, FileOffset ),
12556            rec( 26, 4, EAAccessFlag ),
12557            rec( 30, 2, EAValueLength, var='x' ),
12558            rec( 32, (2,64), EAKey, info_str=(EAKey, "Write Extended Attribute: %s", ", %s") ),
12559            rec( -1, 1, EAValueRep, repeat='x' ),
12560    ])
12561    pkt.Reply(20, [
12562            rec( 8, 4, EAErrorCodes ),
12563            rec( 12, 4, EABytesWritten ),
12564            rec( 16, 4, NewEAHandle ),
12565    ])
12566    pkt.CompletionCodes([0x0000, 0xc800, 0xc900, 0xcb00, 0xce00, 0xcf00, 0xd101,
12567                         0xd203, 0xd301, 0xd402, 0xda02, 0xdc01, 0xef00, 0xff00])
12568    # 2222/5603, 86/03
12569    pkt = NCP(0x5603, "Read Extended Attribute", 'extended', has_length=0 )
12570    pkt.Request((28,538), [
12571            rec( 8, 2, EAFlags ),
12572            rec( 10, 4, EAHandleOrNetWareHandleOrVolume ),
12573            rec( 14, 4, ReservedOrDirectoryNumber ),
12574            rec( 18, 4, FileOffset ),
12575            rec( 22, 4, InspectSize ),
12576            rec( 26, (2,512), EAKey, info_str=(EAKey, "Read Extended Attribute: %s", ", %s") ),
12577    ])
12578    pkt.Reply((26,536), [
12579            rec( 8, 4, EAErrorCodes ),
12580            rec( 12, 4, TtlValuesLength ),
12581            rec( 16, 4, NewEAHandle ),
12582            rec( 20, 4, EAAccessFlag ),
12583            rec( 24, (2,512), EAValue ),
12584    ])
12585    pkt.CompletionCodes([0x0000, 0x8800, 0x9c03, 0xc900, 0xce00, 0xcf00, 0xd101,
12586                         0xd301, 0xd503])
12587    # 2222/5604, 86/04
12588    pkt = NCP(0x5604, "Enumerate Extended Attribute", 'extended', has_length=0 )
12589    pkt.Request((26,536), [
12590            rec( 8, 2, EAFlags ),
12591            rec( 10, 4, EAHandleOrNetWareHandleOrVolume ),
12592            rec( 14, 4, ReservedOrDirectoryNumber ),
12593            rec( 18, 4, InspectSize ),
12594            rec( 22, 2, SequenceNumber ),
12595            rec( 24, (2,512), EAKey, info_str=(EAKey, "Enumerate Extended Attribute: %s", ", %s") ),
12596    ])
12597    pkt.Reply(28, [
12598            rec( 8, 4, EAErrorCodes ),
12599            rec( 12, 4, TtlEAs ),
12600            rec( 16, 4, TtlEAsDataSize ),
12601            rec( 20, 4, TtlEAsKeySize ),
12602            rec( 24, 4, NewEAHandle ),
12603    ])
12604    pkt.CompletionCodes([0x0000, 0x8800, 0x8c01, 0xc800, 0xc900, 0xce00, 0xcf00, 0xd101,
12605                         0xd301, 0xd503, 0xfb08, 0xff00])
12606    # 2222/5605, 86/05
12607    pkt = NCP(0x5605, "Duplicate Extended Attributes", 'extended', has_length=0 )
12608    pkt.Request(28, [
12609            rec( 8, 2, EAFlags ),
12610            rec( 10, 2, DstEAFlags ),
12611            rec( 12, 4, EAHandleOrNetWareHandleOrVolume ),
12612            rec( 16, 4, ReservedOrDirectoryNumber ),
12613            rec( 20, 4, EAHandleOrNetWareHandleOrVolume ),
12614            rec( 24, 4, ReservedOrDirectoryNumber ),
12615    ])
12616    pkt.Reply(20, [
12617            rec( 8, 4, EADuplicateCount ),
12618            rec( 12, 4, EADataSizeDuplicated ),
12619            rec( 16, 4, EAKeySizeDuplicated ),
12620    ])
12621    pkt.CompletionCodes([0x0000, 0x8800, 0xd101])
12622    # 2222/5701, 87/01
12623    pkt = NCP(0x5701, "Open/Create File or Subdirectory", 'file', has_length=0)
12624    pkt.Request((30, 284), [
12625            rec( 8, 1, NameSpace  ),
12626            rec( 9, 1, OpenCreateMode ),
12627            rec( 10, 2, SearchAttributesLow ),
12628            rec( 12, 2, ReturnInfoMask ),
12629            rec( 14, 2, ExtendedInfo ),
12630            rec( 16, 4, AttributesDef32 ),
12631            rec( 20, 2, DesiredAccessRights ),
12632            rec( 22, 1, VolumeNumber ),
12633            rec( 23, 4, DirectoryBase ),
12634            rec( 27, 1, HandleFlag ),
12635            rec( 28, 1, PathCount, var="x" ),
12636            rec( 29, (1,255), Path, repeat="x", info_str=(Path, "Open or Create: %s", "/%s") ),
12637    ])
12638    pkt.Reply( NO_LENGTH_CHECK, [
12639            rec( 8, 4, FileHandle ),
12640            rec( 12, 1, OpenCreateAction ),
12641            rec( 13, 1, Reserved ),
12642            srec( DSSpaceAllocateStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
12643            srec( PadDSSpaceAllocate, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
12644            srec( AttributesStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
12645            srec( PadAttributes, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
12646            srec( DataStreamSizeStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
12647            srec( PadDataStreamSize, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
12648            srec( TotalStreamSizeStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
12649            srec( PadTotalStreamSize, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
12650            srec( CreationInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
12651            srec( PadCreationInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
12652            srec( ModifyInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
12653            srec( PadModifyInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
12654            srec( ArchiveInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
12655            srec( PadArchiveInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
12656            srec( RightsInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
12657            srec( PadRightsInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
12658            srec( DirEntryStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
12659            srec( PadDirEntry, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
12660            srec( EAInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
12661            srec( PadEAInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
12662            srec( NSInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
12663            srec( PadNSInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
12664            srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc  == 1)" ),
12665            srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
12666            srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
12667            srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
12668            srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
12669            srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
12670            srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
12671            srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
12672            srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
12673            srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
12674            srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
12675            srec( ReferenceIDStruct, req_cond="ncp.ret_info_mask_id == 1" ),
12676            srec( NSAttributeStruct, req_cond="ncp.ret_info_mask_ns_attr == 1" ),
12677            rec( -1, 4, DataStreamsCount, var="x" , req_cond="ncp.ret_info_mask_actual == 1"  ),
12678            srec( DStreamActual, repeat = "x" , req_cond="ncp.ret_info_mask_actual == 1" ),
12679            rec( -1, 4, DataStreamsCount, var="y", req_cond="ncp.ret_info_mask_logical == 1" ),
12680            srec( DStreamLogical, repeat="y" , req_cond="ncp.ret_info_mask_logical == 1" ),
12681            srec( LastUpdatedInSecondsStruct, req_cond="ncp.ext_info_update == 1" ),
12682            srec( DOSNameStruct, req_cond="ncp.ext_info_dos_name == 1" ),
12683            srec( FlushTimeStruct, req_cond="ncp.ext_info_flush == 1" ),
12684            srec( ParentBaseIDStruct, req_cond="ncp.ext_info_parental == 1" ),
12685            srec( MacFinderInfoStruct, req_cond="ncp.ext_info_mac_finder == 1" ),
12686            srec( SiblingCountStruct, req_cond="ncp.ext_info_sibling == 1" ),
12687            srec( EffectiveRightsStruct, req_cond="ncp.ext_info_effective == 1" ),
12688            srec( MacTimeStruct, req_cond="ncp.ext_info_mac_date == 1" ),
12689            srec( LastAccessedTimeStruct, req_cond="ncp.ext_info_access == 1" ),
12690            srec( FileNameStruct, req_cond="ncp.ret_info_mask_fname == 1" ),
12691    ])
12692    pkt.ReqCondSizeVariable()
12693    pkt.CompletionCodes([0x0000, 0x0102, 0x7f00, 0x8001, 0x8101, 0x8401, 0x8501,
12694                         0x8701, 0x8900, 0x8d00, 0x8f00, 0x9001, 0x9400, 0x9600,
12695                         0x9804, 0x9900, 0x9b03, 0x9c03, 0xa500, 0xa802, 0xa901, 0xbf00, 0xfd00, 0xff16])
12696    pkt.MakeExpert("file_rights")
12697    # 2222/5702, 87/02
12698    pkt = NCP(0x5702, "Initialize Search", 'file', has_length=0)
12699    pkt.Request( (18,272), [
12700            rec( 8, 1, NameSpace  ),
12701            rec( 9, 1, Reserved ),
12702            rec( 10, 1, VolumeNumber ),
12703            rec( 11, 4, DirectoryBase ),
12704            rec( 15, 1, HandleFlag ),
12705            rec( 16, 1, PathCount, var="x" ),
12706            rec( 17, (1,255), Path, repeat="x", info_str=(Path, "Set Search Pointer to: %s", "/%s") ),
12707    ])
12708    pkt.Reply(17, [
12709            rec( 8, 1, VolumeNumber ),
12710            rec( 9, 4, DirectoryNumber ),
12711            rec( 13, 4, DirectoryEntryNumber ),
12712    ])
12713    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
12714                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
12715                         0x9804, 0x9b03, 0x9c03, 0xa901, 0xbf00, 0xfd00, 0xff16])
12716    # 2222/5703, 87/03
12717    pkt = NCP(0x5703, "Search for File or Subdirectory", 'file', has_length=0)
12718    pkt.Request((26, 280), [
12719            rec( 8, 1, NameSpace  ),
12720            rec( 9, 1, DataStream ),
12721            rec( 10, 2, SearchAttributesLow ),
12722            rec( 12, 2, ReturnInfoMask ),
12723            rec( 14, 2, ExtendedInfo ),
12724            rec( 16, 9, SeachSequenceStruct ),
12725            rec( 25, (1,255), SearchPattern, info_str=(SearchPattern, "Search for: %s", "/%s") ),
12726    ])
12727    pkt.Reply( NO_LENGTH_CHECK, [
12728            rec( 8, 9, SeachSequenceStruct ),
12729            rec( 17, 1, Reserved ),
12730            srec( DSSpaceAllocateStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
12731            srec( PadDSSpaceAllocate, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
12732            srec( AttributesStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
12733            srec( PadAttributes, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
12734            srec( DataStreamSizeStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
12735            srec( PadDataStreamSize, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
12736            srec( TotalStreamSizeStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
12737            srec( PadTotalStreamSize, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
12738            srec( CreationInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
12739            srec( PadCreationInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
12740            srec( ModifyInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
12741            srec( PadModifyInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
12742            srec( ArchiveInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
12743            srec( PadArchiveInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
12744            srec( RightsInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
12745            srec( PadRightsInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
12746            srec( DirEntryStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
12747            srec( PadDirEntry, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
12748            srec( EAInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
12749            srec( PadEAInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
12750            srec( NSInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
12751            srec( PadNSInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
12752            srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc  == 1)" ),
12753            srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
12754            srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
12755            srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
12756            srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
12757            srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
12758            srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
12759            srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
12760            srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
12761            srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
12762            srec( ReferenceIDStruct, req_cond="ncp.ret_info_mask_id == 1" ),
12763            srec( NSAttributeStruct, req_cond="ncp.ret_info_mask_ns_attr == 1" ),
12764            srec( DStreamActual, req_cond="ncp.ret_info_mask_actual == 1" ),
12765            srec( DStreamLogical, req_cond="ncp.ret_info_mask_logical == 1" ),
12766            srec( LastUpdatedInSecondsStruct, req_cond="ncp.ext_info_update == 1" ),
12767            srec( DOSNameStruct, req_cond="ncp.ext_info_dos_name == 1" ),
12768            srec( FlushTimeStruct, req_cond="ncp.ext_info_flush == 1" ),
12769            srec( ParentBaseIDStruct, req_cond="ncp.ext_info_parental == 1" ),
12770            srec( MacFinderInfoStruct, req_cond="ncp.ext_info_mac_finder == 1" ),
12771            srec( SiblingCountStruct, req_cond="ncp.ext_info_sibling == 1" ),
12772            srec( EffectiveRightsStruct, req_cond="ncp.ext_info_effective == 1" ),
12773            srec( MacTimeStruct, req_cond="ncp.ext_info_mac_date == 1" ),
12774            srec( LastAccessedTimeStruct, req_cond="ncp.ext_info_access == 1" ),
12775            srec( FileNameStruct, req_cond="ncp.ret_info_mask_fname == 1" ),
12776    ])
12777    pkt.ReqCondSizeVariable()
12778    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
12779                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
12780                         0x9804, 0x9b03, 0x9c03, 0xa901, 0xbf00, 0xfd00, 0xff16])
12781    # 2222/5704, 87/04
12782    pkt = NCP(0x5704, "Rename Or Move a File or Subdirectory", 'file', has_length=0)
12783    pkt.Request((28, 536), [
12784            rec( 8, 1, NameSpace  ),
12785            rec( 9, 1, RenameFlag ),
12786            rec( 10, 2, SearchAttributesLow ),
12787            rec( 12, 1, VolumeNumber ),
12788            rec( 13, 4, DirectoryBase ),
12789            rec( 17, 1, HandleFlag ),
12790            rec( 18, 1, PathCount, var="x" ),
12791            rec( 19, 1, VolumeNumber ),
12792            rec( 20, 4, DirectoryBase ),
12793            rec( 24, 1, HandleFlag ),
12794            rec( 25, 1, PathCount, var="y" ),
12795            rec( 26, (1, 255), Path, repeat="x", info_str=(Path, "Rename or Move: %s", "/%s") ),
12796            rec( -1, (1,255), DestPath, repeat="y" ),
12797    ])
12798    pkt.Reply(8)
12799    pkt.CompletionCodes([0x0000, 0x0102, 0x8000, 0x8101, 0x8401, 0x8501,
12800                         0x8701, 0x8d00, 0x8e00, 0x8f00, 0x9001, 0x9100, 0x9200, 0x9600,
12801                         0x9804, 0x9a00, 0x9b03, 0x9c03, 0x9e00, 0xa901, 0xbf00, 0xfd00, 0xff16])
12802    # 2222/5705, 87/05
12803    pkt = NCP(0x5705, "Scan File or Subdirectory for Trustees", 'file', has_length=0)
12804    pkt.Request((24, 278), [
12805            rec( 8, 1, NameSpace  ),
12806            rec( 9, 1, Reserved ),
12807            rec( 10, 2, SearchAttributesLow ),
12808            rec( 12, 4, SequenceNumber ),
12809            rec( 16, 1, VolumeNumber ),
12810            rec( 17, 4, DirectoryBase ),
12811            rec( 21, 1, HandleFlag ),
12812            rec( 22, 1, PathCount, var="x" ),
12813            rec( 23, (1, 255), Path, repeat="x", info_str=(Path, "Scan Trustees for: %s", "/%s") ),
12814    ])
12815    pkt.Reply(20, [
12816            rec( 8, 4, SequenceNumber ),
12817            rec( 12, 2, ObjectIDCount, var="x" ),
12818            rec( 14, 6, TrusteeStruct, repeat="x" ),
12819    ])
12820    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
12821                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
12822                         0x9804, 0x9b03, 0x9c04, 0xa901, 0xbf00, 0xfd00, 0xff16])
12823    # 2222/5706, 87/06
12824    pkt = NCP(0x5706, "Obtain File or SubDirectory Information", 'file', has_length=0)
12825    pkt.Request((24,278), [
12826            rec( 10, 1, SrcNameSpace ),
12827            rec( 11, 1, DestNameSpace ),
12828            rec( 12, 2, SearchAttributesLow ),
12829            rec( 14, 2, ReturnInfoMask, ENC_LITTLE_ENDIAN ),
12830            rec( 16, 2, ExtendedInfo ),
12831            rec( 18, 1, VolumeNumber ),
12832            rec( 19, 4, DirectoryBase ),
12833            rec( 23, 1, HandleFlag ),
12834            rec( 24, 1, PathCount, var="x" ),
12835            rec( 25, (1,255), Path, repeat="x", info_str=(Path, "Obtain Info for: %s", "/%s")),
12836    ])
12837    pkt.Reply(NO_LENGTH_CHECK, [
12838        srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
12839        srec( PadDSSpaceAllocate, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
12840        srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
12841        srec( PadAttributes, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
12842        srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
12843        srec( PadDataStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
12844        srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
12845        srec( PadTotalStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
12846        srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
12847        srec( PadCreationInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
12848        srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
12849        srec( PadModifyInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
12850        srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
12851        srec( PadArchiveInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
12852        srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
12853        srec( PadRightsInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
12854        srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
12855        srec( PadDirEntry, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
12856        srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
12857        srec( PadEAInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
12858        srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
12859        srec( PadNSInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
12860        srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc  == 1)" ),
12861        srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
12862        srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
12863        srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
12864        srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
12865        srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
12866        srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
12867        srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
12868        srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
12869        srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
12870        srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
12871        srec( ReferenceIDStruct, req_cond="ncp.ret_info_mask_id == 1" ),
12872        srec( NSAttributeStruct, req_cond="ncp.ret_info_mask_ns_attr == 1" ),
12873        rec( -1, 4, DataStreamsCount, var="x" , req_cond="ncp.ret_info_mask_actual == 1"  ),
12874        srec( DStreamActual, repeat = "x" , req_cond="ncp.ret_info_mask_actual == 1" ),
12875        rec( -1, 4, DataStreamsCount, var="y", req_cond="ncp.ret_info_mask_logical == 1" ),
12876        srec( DStreamLogical, repeat="y" , req_cond="ncp.ret_info_mask_logical == 1" ),
12877        srec( LastUpdatedInSecondsStruct, req_cond="ncp.ext_info_update == 1" ),
12878        srec( DOSNameStruct, req_cond="ncp.ext_info_dos_name == 1" ),
12879        srec( FlushTimeStruct, req_cond="ncp.ext_info_flush == 1" ),
12880        srec( ParentBaseIDStruct, req_cond="ncp.ext_info_parental == 1" ),
12881        srec( MacFinderInfoStruct, req_cond="ncp.ext_info_mac_finder == 1" ),
12882        srec( SiblingCountStruct, req_cond="ncp.ext_info_sibling == 1" ),
12883        srec( EffectiveRightsStruct, req_cond="ncp.ext_info_effective == 1" ),
12884        srec( MacTimeStruct, req_cond="ncp.ext_info_mac_date == 1" ),
12885        srec( LastAccessedTimeStruct, req_cond="ncp.ext_info_access == 1" ),
12886        srec( FileSize64bitStruct, req_cond="ncp.ext_info_64_bit_fs == 1" ),
12887        srec( FileNameStruct, req_cond="ncp.ret_info_mask_fname == 1" ),
12888    ])
12889    pkt.ReqCondSizeVariable()
12890    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
12891                         0x8700, 0x8900, 0x8d00, 0x8f00, 0x9001, 0x9600,
12892                         0x9802, 0x9b03, 0x9c03, 0xa802, 0xa901, 0xbf00, 0xfd00, 0xff16])
12893    # 2222/5707, 87/07
12894    pkt = NCP(0x5707, "Modify File or Subdirectory DOS Information", 'file', has_length=0)
12895    pkt.Request((62,316), [
12896            rec( 8, 1, NameSpace ),
12897            rec( 9, 1, Reserved ),
12898            rec( 10, 2, SearchAttributesLow ),
12899            rec( 12, 2, ModifyDOSInfoMask ),
12900            rec( 14, 2, Reserved2 ),
12901            rec( 16, 2, AttributesDef16 ),
12902            rec( 18, 1, FileMode ),
12903            rec( 19, 1, FileExtendedAttributes ),
12904            rec( 20, 2, CreationDate ),
12905            rec( 22, 2, CreationTime ),
12906            rec( 24, 4, CreatorID, ENC_BIG_ENDIAN ),
12907            rec( 28, 2, ModifiedDate ),
12908            rec( 30, 2, ModifiedTime ),
12909            rec( 32, 4, ModifierID, ENC_BIG_ENDIAN ),
12910            rec( 36, 2, ArchivedDate ),
12911            rec( 38, 2, ArchivedTime ),
12912            rec( 40, 4, ArchiverID, ENC_BIG_ENDIAN ),
12913            rec( 44, 2, LastAccessedDate ),
12914            rec( 46, 2, InheritedRightsMask ),
12915            rec( 48, 2, InheritanceRevokeMask ),
12916            rec( 50, 4, MaxSpace ),
12917            rec( 54, 1, VolumeNumber ),
12918            rec( 55, 4, DirectoryBase ),
12919            rec( 59, 1, HandleFlag ),
12920            rec( 60, 1, PathCount, var="x" ),
12921            rec( 61, (1,255), Path, repeat="x", info_str=(Path, "Modify DOS Information for: %s", "/%s") ),
12922    ])
12923    pkt.Reply(8)
12924    pkt.CompletionCodes([0x0000, 0x0102, 0x8000, 0x8101, 0x8401, 0x8501,
12925                         0x8701, 0x8c01, 0x8d00, 0x8e00, 0x8f00, 0x9001, 0x9600,
12926                         0x9804, 0x9b03, 0x9c03, 0xa901, 0xbf00, 0xfd00, 0xff16])
12927    # 2222/5708, 87/08
12928    pkt = NCP(0x5708, "Delete a File or Subdirectory", 'file', has_length=0)
12929    pkt.Request((20,274), [
12930            rec( 8, 1, NameSpace ),
12931            rec( 9, 1, Reserved ),
12932            rec( 10, 2, SearchAttributesLow ),
12933            rec( 12, 1, VolumeNumber ),
12934            rec( 13, 4, DirectoryBase ),
12935            rec( 17, 1, HandleFlag ),
12936            rec( 18, 1, PathCount, var="x" ),
12937            rec( 19, (1,255), Path, repeat="x", info_str=(Path, "Delete a File or Subdirectory: %s", "/%s") ),
12938    ])
12939    pkt.Reply(8)
12940    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
12941                         0x8701, 0x8900, 0x8a00, 0x8d00, 0x8e00, 0x8f00, 0x9001, 0x9600,
12942                         0x9804, 0x9b03, 0x9c03, 0xa901, 0xbf00, 0xfd00, 0xff16])
12943    # 2222/5709, 87/09
12944    pkt = NCP(0x5709, "Set Short Directory Handle", 'file', has_length=0)
12945    pkt.Request((20,274), [
12946            rec( 8, 1, NameSpace ),
12947            rec( 9, 1, DataStream ),
12948            rec( 10, 1, DestDirHandle ),
12949            rec( 11, 1, Reserved ),
12950            rec( 12, 1, VolumeNumber ),
12951            rec( 13, 4, DirectoryBase ),
12952            rec( 17, 1, HandleFlag ),
12953            rec( 18, 1, PathCount, var="x" ),
12954            rec( 19, (1,255), Path, repeat="x", info_str=(Path, "Set Short Directory Handle to: %s", "/%s") ),
12955    ])
12956    pkt.Reply(8)
12957    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
12958                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
12959                         0x9804, 0x9b03, 0x9c03, 0xa901, 0xbf00, 0xfd00, 0xff16])
12960    # 2222/570A, 87/10
12961    pkt = NCP(0x570A, "Add Trustee Set to File or Subdirectory", 'file', has_length=0)
12962    pkt.Request((31,285), [
12963            rec( 8, 1, NameSpace ),
12964            rec( 9, 1, Reserved ),
12965            rec( 10, 2, SearchAttributesLow ),
12966            rec( 12, 2, AccessRightsMaskWord ),
12967            rec( 14, 2, ObjectIDCount, var="y" ),
12968            rec( 16, 1, VolumeNumber ),
12969            rec( 17, 4, DirectoryBase ),
12970            rec( 21, 1, HandleFlag ),
12971            rec( 22, 1, PathCount, var="x" ),
12972            rec( 23, (1,255), Path, repeat="x", info_str=(Path, "Add Trustee Set to: %s", "/%s") ),
12973            rec( -1, 7, TrusteeStruct, repeat="y" ),
12974    ])
12975    pkt.Reply(8)
12976    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
12977                         0x8701, 0x8c01, 0x8d00, 0x8f00, 0x9001, 0x9600,
12978                         0x9804, 0x9b03, 0x9c03, 0xa802, 0xa901, 0xbf00, 0xfc01, 0xfd00, 0xff16])
12979    # 2222/570B, 87/11
12980    pkt = NCP(0x570B, "Delete Trustee Set from File or SubDirectory", 'file', has_length=0)
12981    pkt.Request((27,281), [
12982            rec( 8, 1, NameSpace ),
12983            rec( 9, 1, Reserved ),
12984            rec( 10, 2, ObjectIDCount, var="y" ),
12985            rec( 12, 1, VolumeNumber ),
12986            rec( 13, 4, DirectoryBase ),
12987            rec( 17, 1, HandleFlag ),
12988            rec( 18, 1, PathCount, var="x" ),
12989            rec( 19, (1,255), Path, repeat="x", info_str=(Path, "Delete Trustee Set from: %s", "/%s") ),
12990            rec( -1, 7, TrusteeStruct, repeat="y" ),
12991    ])
12992    pkt.Reply(8)
12993    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
12994                         0x8701, 0x8c01, 0x8d00, 0x8f00, 0x9001, 0x9600,
12995                         0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
12996    # 2222/570C, 87/12
12997    pkt = NCP(0x570C, "Allocate Short Directory Handle", 'file', has_length=0)
12998    pkt.Request((20,274), [
12999            rec( 8, 1, NameSpace ),
13000            rec( 9, 1, Reserved ),
13001            rec( 10, 2, AllocateMode ),
13002            rec( 12, 1, VolumeNumber ),
13003            rec( 13, 4, DirectoryBase ),
13004            rec( 17, 1, HandleFlag ),
13005            rec( 18, 1, PathCount, var="x" ),
13006            rec( 19, (1,255), Path, repeat="x", info_str=(Path, "Allocate Short Directory Handle to: %s", "/%s") ),
13007    ])
13008    pkt.Reply(NO_LENGTH_CHECK, [
13009    srec( ReplyLevel2Struct, req_cond="ncp.alloc_reply_lvl2 == TRUE" ),
13010            srec( ReplyLevel1Struct, req_cond="ncp.alloc_reply_lvl2 == FALSE" ),
13011    ])
13012    pkt.ReqCondSizeVariable()
13013    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
13014                         0x8701, 0x8900, 0x8d00, 0x8f00, 0x9001, 0x9600,
13015                         0x9804, 0x9b03, 0x9c03, 0x9d00, 0xa901, 0xbf00, 0xfd00, 0xff16])
13016    # 2222/5710, 87/16
13017    pkt = NCP(0x5710, "Scan Salvageable Files", 'file', has_length=0)
13018    pkt.Request((26,280), [
13019            rec( 8, 1, NameSpace ),
13020            rec( 9, 1, DataStream ),
13021            rec( 10, 2, ReturnInfoMask ),
13022            rec( 12, 2, ExtendedInfo ),
13023            rec( 14, 4, SequenceNumber ),
13024            rec( 18, 1, VolumeNumber ),
13025            rec( 19, 4, DirectoryBase ),
13026            rec( 23, 1, HandleFlag ),
13027            rec( 24, 1, PathCount, var="x" ),
13028            rec( 25, (1,255), Path, repeat="x", info_str=(Path, "Scan for Deleted Files in: %s", "/%s") ),
13029    ])
13030    pkt.Reply(NO_LENGTH_CHECK, [
13031            rec( 8, 4, SequenceNumber ),
13032            rec( 12, 2, DeletedTime ),
13033            rec( 14, 2, DeletedDate ),
13034            rec( 16, 4, DeletedID, ENC_BIG_ENDIAN ),
13035            rec( 20, 4, VolumeID ),
13036            rec( 24, 4, DirectoryBase ),
13037            srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
13038            srec( PadDSSpaceAllocate, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
13039            srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
13040            srec( PadAttributes, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
13041            srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
13042            srec( PadDataStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
13043            srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
13044            srec( PadTotalStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
13045            srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
13046            srec( PadCreationInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
13047            srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
13048            srec( PadModifyInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
13049            srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
13050            srec( PadArchiveInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
13051            srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
13052            srec( PadRightsInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
13053            srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
13054            srec( PadDirEntry, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
13055            srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
13056            srec( PadEAInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
13057            srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
13058            srec( PadNSInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
13059            srec( FileNameStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_fname == 1)" ),
13060            srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc  == 1)" ),
13061            srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
13062            srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
13063            srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
13064            srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
13065            srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
13066            srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
13067            srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
13068            srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
13069            srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
13070            srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
13071            srec( FileNameStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_fname == 1)" ),
13072    ])
13073    pkt.ReqCondSizeVariable()
13074    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
13075                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
13076                         0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
13077    # 2222/5711, 87/17
13078    pkt = NCP(0x5711, "Recover Salvageable File", 'file', has_length=0)
13079    pkt.Request((23,277), [
13080            rec( 8, 1, NameSpace ),
13081            rec( 9, 1, Reserved ),
13082            rec( 10, 4, SequenceNumber ),
13083            rec( 14, 4, VolumeID ),
13084            rec( 18, 4, DirectoryBase ),
13085            rec( 22, (1,255), FileName, info_str=(FileName, "Recover Deleted File: %s", ", %s") ),
13086    ])
13087    pkt.Reply(8)
13088    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
13089                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
13090                         0x9804, 0x9b03, 0x9c03, 0xa802, 0xbf00, 0xfe02, 0xfd00, 0xff16])
13091    # 2222/5712, 87/18
13092    pkt = NCP(0x5712, "Purge Salvageable Files", 'file', has_length=0)
13093    pkt.Request(22, [
13094            rec( 8, 1, NameSpace ),
13095            rec( 9, 1, Reserved ),
13096            rec( 10, 4, SequenceNumber ),
13097            rec( 14, 4, VolumeID ),
13098            rec( 18, 4, DirectoryBase ),
13099    ])
13100    pkt.Reply(8)
13101    pkt.CompletionCodes([0x0000, 0x010a, 0x8000, 0x8101, 0x8401, 0x8501,
13102                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
13103                         0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
13104    # 2222/5713, 87/19
13105    pkt = NCP(0x5713, "Get Name Space Information", 'file', has_length=0)
13106    pkt.Request(18, [
13107            rec( 8, 1, SrcNameSpace ),
13108            rec( 9, 1, DestNameSpace ),
13109            rec( 10, 1, Reserved ),
13110            rec( 11, 1, VolumeNumber ),
13111            rec( 12, 4, DirectoryBase ),
13112            rec( 16, 2, NamesSpaceInfoMask ),
13113    ])
13114    pkt.Reply(NO_LENGTH_CHECK, [
13115        srec( FileNameStruct, req_cond="ncp.ns_info_mask_modify == TRUE" ),
13116        srec( FileAttributesStruct, req_cond="ncp.ns_info_mask_fatt == TRUE" ),
13117        srec( CreationDateStruct, req_cond="ncp.ns_info_mask_cdate == TRUE" ),
13118        srec( CreationTimeStruct, req_cond="ncp.ns_info_mask_ctime == TRUE" ),
13119        srec( OwnerIDStruct, req_cond="ncp.ns_info_mask_owner == TRUE" ),
13120        srec( ArchiveDateStruct, req_cond="ncp.ns_info_mask_adate == TRUE" ),
13121        srec( ArchiveTimeStruct, req_cond="ncp.ns_info_mask_atime == TRUE" ),
13122        srec( ArchiveIdStruct, req_cond="ncp.ns_info_mask_aid == TRUE" ),
13123        srec( UpdateDateStruct, req_cond="ncp.ns_info_mask_udate == TRUE" ),
13124        srec( UpdateTimeStruct, req_cond="ncp.ns_info_mask_utime == TRUE" ),
13125        srec( UpdateIDStruct, req_cond="ncp.ns_info_mask_uid == TRUE" ),
13126        srec( LastAccessStruct, req_cond="ncp.ns_info_mask_acc_date == TRUE" ),
13127        srec( RightsInfoStruct, req_cond="ncp.ns_info_mask_max_acc_mask == TRUE" ),
13128    ])
13129    pkt.ReqCondSizeVariable()
13130    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
13131                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
13132                         0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
13133    # 2222/5714, 87/20
13134    pkt = NCP(0x5714, "Search for File or Subdirectory Set", 'file', has_length=0)
13135    pkt.Request((27, 27), [
13136            rec( 8, 1, NameSpace  ),
13137            rec( 9, 1, DataStream ),
13138            rec( 10, 2, SearchAttributesLow ),
13139            rec( 12, 2, ReturnInfoMask ),
13140            rec( 14, 2, ExtendedInfo ),
13141            rec( 16, 2, ReturnInfoCount ),
13142            rec( 18, 9, SeachSequenceStruct ),
13143#            rec( 27, (1,255), SearchPattern ),
13144    ])
13145# The reply packet is dissected in packet-ncp2222.inc
13146    pkt.Reply(NO_LENGTH_CHECK, [
13147    ])
13148    pkt.ReqCondSizeVariable()
13149    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
13150                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
13151                         0x9804, 0x9b03, 0x9c03, 0xa901, 0xbf00, 0xfd00, 0xff16])
13152    # 2222/5715, 87/21
13153    pkt = NCP(0x5715, "Get Path String from Short Directory Handle", 'file', has_length=0)
13154    pkt.Request(10, [
13155            rec( 8, 1, NameSpace ),
13156            rec( 9, 1, DirHandle ),
13157    ])
13158    pkt.Reply((9,263), [
13159            rec( 8, (1,255), Path ),
13160    ])
13161    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
13162                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
13163                         0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
13164    # 2222/5716, 87/22
13165    pkt = NCP(0x5716, "Generate Directory Base and Volume Number", 'file', has_length=0)
13166    pkt.Request((20,274), [
13167            rec( 8, 1, SrcNameSpace ),
13168            rec( 9, 1, DestNameSpace ),
13169            rec( 10, 2, dstNSIndicator ),
13170            rec( 12, 1, VolumeNumber ),
13171            rec( 13, 4, DirectoryBase ),
13172            rec( 17, 1, HandleFlag ),
13173            rec( 18, 1, PathCount, var="x" ),
13174            rec( 19, (1,255), Path, repeat="x", info_str=(Path, "Get Volume and Directory Base from: %s", "/%s") ),
13175    ])
13176    pkt.Reply(17, [
13177            rec( 8, 4, DirectoryBase ),
13178            rec( 12, 4, DOSDirectoryBase ),
13179            rec( 16, 1, VolumeNumber ),
13180    ])
13181    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
13182                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
13183                         0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
13184    # 2222/5717, 87/23
13185    pkt = NCP(0x5717, "Query Name Space Information Format", 'file', has_length=0)
13186    pkt.Request(10, [
13187            rec( 8, 1, NameSpace ),
13188            rec( 9, 1, VolumeNumber ),
13189    ])
13190    pkt.Reply(58, [
13191            rec( 8, 4, FixedBitMask ),
13192            rec( 12, 4, VariableBitMask ),
13193            rec( 16, 4, HugeBitMask ),
13194            rec( 20, 2, FixedBitsDefined ),
13195            rec( 22, 2, VariableBitsDefined ),
13196            rec( 24, 2, HugeBitsDefined ),
13197            rec( 26, 32, FieldsLenTable ),
13198    ])
13199    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
13200                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
13201                         0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
13202    # 2222/5718, 87/24
13203    pkt = NCP(0x5718, "Get Name Spaces Loaded List from Volume Number", 'file', has_length=0)
13204    pkt.Request(11, [
13205            rec( 8, 2, Reserved2 ),
13206            rec( 10, 1, VolumeNumber, info_str=(VolumeNumber, "Get Name Spaces Loaded List from Vol: %d", "/%d") ),
13207    ])
13208    pkt.Reply(11, [
13209            rec( 8, 2, NumberOfNSLoaded, var="x" ),
13210            rec( 10, 1, NameSpace, repeat="x" ),
13211    ])
13212    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
13213                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
13214                         0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
13215    # 2222/5719, 87/25
13216    pkt = NCP(0x5719, "Set Name Space Information", 'file', has_length=0)
13217    pkt.Request(531, [
13218            rec( 8, 1, SrcNameSpace ),
13219            rec( 9, 1, DestNameSpace ),
13220            rec( 10, 1, VolumeNumber ),
13221            rec( 11, 4, DirectoryBase ),
13222            rec( 15, 2, NamesSpaceInfoMask ),
13223            rec( 17, 2, Reserved2 ),
13224            rec( 19, 512, NSSpecificInfo ),
13225    ])
13226    pkt.Reply(8)
13227    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
13228                         0x8701, 0x8b00, 0x8d00, 0x8f00, 0x9001,
13229                         0x9600, 0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00,
13230                         0xff16])
13231    # 2222/571A, 87/26
13232    pkt = NCP(0x571A, "Get Huge Name Space Information", 'file', has_length=0)
13233    pkt.Request(34, [
13234            rec( 8, 1, NameSpace ),
13235            rec( 9, 1, VolumeNumber ),
13236            rec( 10, 4, DirectoryBase ),
13237            rec( 14, 4, HugeBitMask ),
13238            rec( 18, 16, HugeStateInfo ),
13239    ])
13240    pkt.Reply((25,279), [
13241            rec( 8, 16, NextHugeStateInfo ),
13242            rec( 24, (1,255), HugeData ),
13243    ])
13244    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
13245                         0x8701, 0x8b00, 0x8d00, 0x8f00, 0x9001,
13246                         0x9600, 0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00,
13247                         0xff16])
13248    # 2222/571B, 87/27
13249    pkt = NCP(0x571B, "Set Huge Name Space Information", 'file', has_length=0)
13250    pkt.Request((35,289), [
13251            rec( 8, 1, NameSpace ),
13252            rec( 9, 1, VolumeNumber ),
13253            rec( 10, 4, DirectoryBase ),
13254            rec( 14, 4, HugeBitMask ),
13255            rec( 18, 16, HugeStateInfo ),
13256            rec( 34, (1,255), HugeData ),
13257    ])
13258    pkt.Reply(28, [
13259            rec( 8, 16, NextHugeStateInfo ),
13260            rec( 24, 4, HugeDataUsed ),
13261    ])
13262    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
13263                         0x8701, 0x8b00, 0x8d00, 0x8f00, 0x9001,
13264                         0x9600, 0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00,
13265                         0xff16])
13266    # 2222/571C, 87/28
13267    pkt = NCP(0x571C, "Get Full Path String", 'file', has_length=0)
13268    pkt.Request((28,282), [
13269            rec( 8, 1, SrcNameSpace ),
13270            rec( 9, 1, DestNameSpace ),
13271            rec( 10, 2, PathCookieFlags ),
13272            rec( 12, 4, Cookie1 ),
13273            rec( 16, 4, Cookie2 ),
13274            rec( 20, 1, VolumeNumber ),
13275            rec( 21, 4, DirectoryBase ),
13276            rec( 25, 1, HandleFlag ),
13277            rec( 26, 1, PathCount, var="x" ),
13278            rec( 27, (1,255), Path, repeat="x", info_str=(Path, "Get Full Path from: %s", "/%s") ),
13279    ])
13280    pkt.Reply((23,277), [
13281            rec( 8, 2, PathCookieFlags ),
13282            rec( 10, 4, Cookie1 ),
13283            rec( 14, 4, Cookie2 ),
13284            rec( 18, 2, PathComponentSize ),
13285            rec( 20, 2, PathComponentCount, var='x' ),
13286            rec( 22, (1,255), Path, repeat='x' ),
13287    ])
13288    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
13289                         0x8701, 0x8b00, 0x8d00, 0x8f00, 0x9001,
13290                         0x9600, 0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00,
13291                         0xff16])
13292    # 2222/571D, 87/29
13293    pkt = NCP(0x571D, "Get Effective Directory Rights", 'file', has_length=0)
13294    pkt.Request((24, 278), [
13295            rec( 8, 1, NameSpace  ),
13296            rec( 9, 1, DestNameSpace ),
13297            rec( 10, 2, SearchAttributesLow ),
13298            rec( 12, 2, ReturnInfoMask ),
13299            rec( 14, 2, ExtendedInfo ),
13300            rec( 16, 1, VolumeNumber ),
13301            rec( 17, 4, DirectoryBase ),
13302            rec( 21, 1, HandleFlag ),
13303            rec( 22, 1, PathCount, var="x" ),
13304            rec( 23, (1,255), Path, repeat="x", info_str=(Path, "Get Effective Rights for: %s", "/%s") ),
13305    ])
13306    pkt.Reply(NO_LENGTH_CHECK, [
13307            rec( 8, 2, EffectiveRights ),
13308            srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
13309            srec( PadDSSpaceAllocate, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
13310            srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
13311            srec( PadAttributes, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
13312            srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
13313            srec( PadDataStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
13314            srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
13315            srec( PadTotalStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
13316            srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
13317            srec( PadCreationInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
13318            srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
13319            srec( PadModifyInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
13320            srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
13321            srec( PadArchiveInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
13322            srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
13323            srec( PadRightsInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
13324            srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
13325            srec( PadDirEntry, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
13326            srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
13327            srec( PadEAInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
13328            srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
13329            srec( PadNSInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
13330            srec( FileNameStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_fname == 1)" ),
13331            srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc  == 1)" ),
13332            srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
13333            srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
13334            srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
13335            srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
13336            srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
13337            srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
13338            srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
13339            srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
13340            srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
13341            srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
13342            srec( FileNameStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_fname == 1)" ),
13343    ])
13344    pkt.ReqCondSizeVariable()
13345    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
13346                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
13347                         0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
13348    # 2222/571E, 87/30
13349    pkt = NCP(0x571E, "Open/Create File or Subdirectory", 'file', has_length=0)
13350    pkt.Request((34, 288), [
13351            rec( 8, 1, NameSpace  ),
13352            rec( 9, 1, DataStream ),
13353            rec( 10, 1, OpenCreateMode ),
13354            rec( 11, 1, Reserved ),
13355            rec( 12, 2, SearchAttributesLow ),
13356            rec( 14, 2, Reserved2 ),
13357            rec( 16, 2, ReturnInfoMask ),
13358            rec( 18, 2, ExtendedInfo ),
13359            rec( 20, 4, AttributesDef32 ),
13360            rec( 24, 2, DesiredAccessRights ),
13361            rec( 26, 1, VolumeNumber ),
13362            rec( 27, 4, DirectoryBase ),
13363            rec( 31, 1, HandleFlag ),
13364            rec( 32, 1, PathCount, var="x" ),
13365            rec( 33, (1,255), Path, repeat="x", info_str=(Path, "Open or Create File: %s", "/%s") ),
13366    ])
13367    pkt.Reply(NO_LENGTH_CHECK, [
13368            rec( 8, 4, FileHandle, ENC_BIG_ENDIAN ),
13369            rec( 12, 1, OpenCreateAction ),
13370            rec( 13, 1, Reserved ),
13371            srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
13372            srec( PadDSSpaceAllocate, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
13373            srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
13374            srec( PadAttributes, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
13375            srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
13376            srec( PadDataStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
13377            srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
13378            srec( PadTotalStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
13379            srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
13380            srec( PadCreationInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
13381            srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
13382            srec( PadModifyInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
13383            srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
13384            srec( PadArchiveInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
13385            srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
13386            srec( PadRightsInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
13387            srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
13388            srec( PadDirEntry, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
13389            srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
13390            srec( PadEAInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
13391            srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
13392            srec( PadNSInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
13393            srec( FileNameStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_fname == 1)" ),
13394            srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc  == 1)" ),
13395            srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
13396            srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
13397            srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
13398            srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
13399            srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
13400            srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
13401            srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
13402            srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
13403            srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
13404            srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
13405            srec( FileNameStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_fname == 1)" ),
13406    ])
13407    pkt.ReqCondSizeVariable()
13408    pkt.CompletionCodes([0x0000, 0x0102, 0x8000, 0x8101, 0x8401, 0x8501,
13409                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
13410                         0x9804, 0x9b03, 0x9c03, 0xbe00, 0xbf00, 0xfd00, 0xff16])
13411    pkt.MakeExpert("file_rights")
13412    # 2222/571F, 87/31
13413    pkt = NCP(0x571F, "Get File Information", 'file', has_length=0)
13414    pkt.Request(15, [
13415            rec( 8, 6, FileHandle, info_str=(FileHandle, "Get File Information - 0x%s", ", %s")  ),
13416            rec( 14, 1, HandleInfoLevel ),
13417    ])
13418    pkt.Reply(NO_LENGTH_CHECK, [
13419            rec( 8, 4, VolumeNumberLong ),
13420            rec( 12, 4, DirectoryBase ),
13421            srec(HandleInfoLevel0, req_cond="ncp.handle_info_level==0x00" ),
13422            srec(HandleInfoLevel1, req_cond="ncp.handle_info_level==0x01" ),
13423            srec(HandleInfoLevel2, req_cond="ncp.handle_info_level==0x02" ),
13424            srec(HandleInfoLevel3, req_cond="ncp.handle_info_level==0x03" ),
13425            srec(HandleInfoLevel4, req_cond="ncp.handle_info_level==0x04" ),
13426            srec(HandleInfoLevel5, req_cond="ncp.handle_info_level==0x05" ),
13427    ])
13428    pkt.ReqCondSizeVariable()
13429    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
13430                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
13431                         0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
13432    # 2222/5720, 87/32
13433    pkt = NCP(0x5720, "Open/Create File or Subdirectory with Callback", 'file', has_length=0)
13434    pkt.Request((30, 284), [
13435            rec( 8, 1, NameSpace  ),
13436            rec( 9, 1, OpenCreateMode ),
13437            rec( 10, 2, SearchAttributesLow ),
13438            rec( 12, 2, ReturnInfoMask ),
13439            rec( 14, 2, ExtendedInfo ),
13440            rec( 16, 4, AttributesDef32 ),
13441            rec( 20, 2, DesiredAccessRights ),
13442            rec( 22, 1, VolumeNumber ),
13443            rec( 23, 4, DirectoryBase ),
13444            rec( 27, 1, HandleFlag ),
13445            rec( 28, 1, PathCount, var="x" ),
13446            rec( 29, (1,255), Path, repeat="x", info_str=(Path, "Open or Create with Op-Lock: %s", "/%s") ),
13447    ])
13448    pkt.Reply( NO_LENGTH_CHECK, [
13449            rec( 8, 4, FileHandle, ENC_BIG_ENDIAN ),
13450            rec( 12, 1, OpenCreateAction ),
13451            rec( 13, 1, OCRetFlags ),
13452            srec( DSSpaceAllocateStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
13453            srec( PadDSSpaceAllocate, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
13454            srec( AttributesStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
13455            srec( PadAttributes, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
13456            srec( DataStreamSizeStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
13457            srec( PadDataStreamSize, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
13458            srec( TotalStreamSizeStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
13459            srec( PadTotalStreamSize, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
13460            srec( CreationInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
13461            srec( PadCreationInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
13462            srec( ModifyInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
13463            srec( PadModifyInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
13464            srec( ArchiveInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
13465            srec( PadArchiveInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
13466            srec( RightsInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
13467            srec( PadRightsInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
13468            srec( DirEntryStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
13469            srec( PadDirEntry, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
13470            srec( EAInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
13471            srec( PadEAInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
13472            srec( NSInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
13473            srec( PadNSInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
13474            srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc  == 1)" ),
13475            srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
13476            srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
13477            srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
13478            srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
13479            srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
13480            srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
13481            srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
13482            srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
13483            srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
13484            srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
13485            srec( ReferenceIDStruct, req_cond="ncp.ret_info_mask_id == 1" ),
13486            srec( NSAttributeStruct, req_cond="ncp.ret_info_mask_ns_attr == 1" ),
13487            rec( -1, 4, DataStreamsCount, var="x" , req_cond="ncp.ret_info_mask_actual == 1"  ),
13488            srec( DStreamActual, repeat = "x" , req_cond="ncp.ret_info_mask_actual == 1" ),
13489            rec( -1, 4, DataStreamsCount, var="y", req_cond="ncp.ret_info_mask_logical == 1" ),
13490            srec( DStreamLogical, repeat="y" , req_cond="ncp.ret_info_mask_logical == 1" ),
13491            srec( LastUpdatedInSecondsStruct, req_cond="ncp.ext_info_update == 1" ),
13492            srec( DOSNameStruct, req_cond="ncp.ext_info_dos_name == 1" ),
13493            srec( FlushTimeStruct, req_cond="ncp.ext_info_flush == 1" ),
13494            srec( ParentBaseIDStruct, req_cond="ncp.ext_info_parental == 1" ),
13495            srec( MacFinderInfoStruct, req_cond="ncp.ext_info_mac_finder == 1" ),
13496            srec( SiblingCountStruct, req_cond="ncp.ext_info_sibling == 1" ),
13497            srec( EffectiveRightsStruct, req_cond="ncp.ext_info_effective == 1" ),
13498            srec( MacTimeStruct, req_cond="ncp.ext_info_mac_date == 1" ),
13499            srec( LastAccessedTimeStruct, req_cond="ncp.ext_info_access == 1" ),
13500            srec( FileNameStruct, req_cond="ncp.ret_info_mask_fname == 1" ),
13501    ])
13502    pkt.ReqCondSizeVariable()
13503    pkt.CompletionCodes([0x0000, 0x0102, 0x7f00, 0x8000, 0x8101, 0x8401, 0x8501,
13504                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
13505                         0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
13506    pkt.MakeExpert("file_rights")
13507    # 2222/5721, 87/33
13508    pkt = NCP(0x5721, "Open/Create File or Subdirectory II with Callback", 'file', has_length=0)
13509    pkt.Request((34, 288), [
13510            rec( 8, 1, NameSpace  ),
13511            rec( 9, 1, DataStream ),
13512            rec( 10, 1, OpenCreateMode ),
13513            rec( 11, 1, Reserved ),
13514            rec( 12, 2, SearchAttributesLow ),
13515            rec( 14, 2, Reserved2 ),
13516            rec( 16, 2, ReturnInfoMask ),
13517            rec( 18, 2, ExtendedInfo ),
13518            rec( 20, 4, AttributesDef32 ),
13519            rec( 24, 2, DesiredAccessRights ),
13520            rec( 26, 1, VolumeNumber ),
13521            rec( 27, 4, DirectoryBase ),
13522            rec( 31, 1, HandleFlag ),
13523            rec( 32, 1, PathCount, var="x" ),
13524            rec( 33, (1,255), Path, repeat="x", info_str=(Path, "Open or Create II with Op-Lock: %s", "/%s") ),
13525    ])
13526    pkt.Reply(NO_LENGTH_CHECK, [
13527            rec( 8, 4, FileHandle ),
13528            rec( 12, 1, OpenCreateAction ),
13529            rec( 13, 1, OCRetFlags ),
13530            srec( DSSpaceAllocateStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
13531            srec( PadDSSpaceAllocate, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
13532            srec( AttributesStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
13533            srec( PadAttributes, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
13534            srec( DataStreamSizeStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
13535            srec( PadDataStreamSize, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
13536            srec( TotalStreamSizeStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
13537            srec( PadTotalStreamSize, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
13538            srec( CreationInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
13539            srec( PadCreationInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
13540            srec( ModifyInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
13541            srec( PadModifyInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
13542            srec( ArchiveInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
13543            srec( PadArchiveInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
13544            srec( RightsInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
13545            srec( PadRightsInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
13546            srec( DirEntryStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
13547            srec( PadDirEntry, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
13548            srec( EAInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
13549            srec( PadEAInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
13550            srec( NSInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
13551            srec( PadNSInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
13552            srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc  == 1)" ),
13553            srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
13554            srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
13555            srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
13556            srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
13557            srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
13558            srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
13559            srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
13560            srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
13561            srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
13562            srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
13563            srec( ReferenceIDStruct, req_cond="ncp.ret_info_mask_id == 1" ),
13564            srec( NSAttributeStruct, req_cond="ncp.ret_info_mask_ns_attr == 1" ),
13565            rec( -1, 4, DataStreamsCount, var="x" , req_cond="ncp.ret_info_mask_actual == 1"  ),
13566            srec( DStreamActual, repeat = "x" , req_cond="ncp.ret_info_mask_actual == 1" ),
13567            rec( -1, 4, DataStreamsCount, var="y", req_cond="ncp.ret_info_mask_logical == 1" ),
13568            srec( DStreamLogical, repeat="y" , req_cond="ncp.ret_info_mask_logical == 1" ),
13569            srec( LastUpdatedInSecondsStruct, req_cond="ncp.ext_info_update == 1" ),
13570            srec( DOSNameStruct, req_cond="ncp.ext_info_dos_name == 1" ),
13571            srec( FlushTimeStruct, req_cond="ncp.ext_info_flush == 1" ),
13572            srec( ParentBaseIDStruct, req_cond="ncp.ext_info_parental == 1" ),
13573            srec( MacFinderInfoStruct, req_cond="ncp.ext_info_mac_finder == 1" ),
13574            srec( SiblingCountStruct, req_cond="ncp.ext_info_sibling == 1" ),
13575            srec( EffectiveRightsStruct, req_cond="ncp.ext_info_effective == 1" ),
13576            srec( MacTimeStruct, req_cond="ncp.ext_info_mac_date == 1" ),
13577            srec( LastAccessedTimeStruct, req_cond="ncp.ext_info_access == 1" ),
13578            srec( FileNameStruct, req_cond="ncp.ret_info_mask_fname == 1" ),
13579    ])
13580    pkt.ReqCondSizeVariable()
13581    pkt.CompletionCodes([0x0000, 0x0102, 0x8000, 0x8101, 0x8401, 0x8501,
13582                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
13583                         0x9804, 0x9b03, 0x9c03, 0xbe00, 0xbf00, 0xfd00, 0xff16])
13584    pkt.MakeExpert("file_rights")
13585    # 2222/5722, 87/34
13586    pkt = NCP(0x5722, "Open CallBack Control (Op-Lock)", 'file', has_length=0)
13587    pkt.Request(13, [
13588            rec( 10, 4, CCFileHandle, ENC_BIG_ENDIAN ),
13589            rec( 14, 1, CCFunction ),
13590    ])
13591    pkt.Reply(8)
13592    pkt.CompletionCodes([0x0000, 0x8000, 0x8800, 0xff16])
13593    pkt.MakeExpert("ncp5722_request")
13594    # 2222/5723, 87/35
13595    pkt = NCP(0x5723, "Modify DOS Attributes on a File or Subdirectory", 'file', has_length=0)
13596    pkt.Request((28, 282), [
13597            rec( 8, 1, NameSpace  ),
13598            rec( 9, 1, Flags ),
13599            rec( 10, 2, SearchAttributesLow ),
13600            rec( 12, 2, ReturnInfoMask ),
13601            rec( 14, 2, ExtendedInfo ),
13602            rec( 16, 4, AttributesDef32 ),
13603            rec( 20, 1, VolumeNumber ),
13604            rec( 21, 4, DirectoryBase ),
13605            rec( 25, 1, HandleFlag ),
13606            rec( 26, 1, PathCount, var="x" ),
13607            rec( 27, (1,255), Path, repeat="x", info_str=(Path, "Modify DOS Attributes for: %s", "/%s") ),
13608    ])
13609    pkt.Reply(24, [
13610            rec( 8, 4, ItemsChecked ),
13611            rec( 12, 4, ItemsChanged ),
13612            rec( 16, 4, AttributeValidFlag ),
13613            rec( 20, 4, AttributesDef32 ),
13614    ])
13615    pkt.CompletionCodes([0x0000, 0x0102, 0x8000, 0x8101, 0x8401, 0x8501,
13616                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
13617                         0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
13618    # 2222/5724, 87/36
13619    pkt = NCP(0x5724, "Log File", 'sync', has_length=0)
13620    pkt.Request((28, 282), [
13621            rec( 8, 1, NameSpace  ),
13622            rec( 9, 1, Reserved ),
13623            rec( 10, 2, Reserved2 ),
13624            rec( 12, 1, LogFileFlagLow ),
13625            rec( 13, 1, LogFileFlagHigh ),
13626            rec( 14, 2, Reserved2 ),
13627            rec( 16, 4, WaitTime ),
13628            rec( 20, 1, VolumeNumber ),
13629            rec( 21, 4, DirectoryBase ),
13630            rec( 25, 1, HandleFlag ),
13631            rec( 26, 1, PathCount, var="x" ),
13632            rec( 27, (1,255), Path, repeat="x", info_str=(Path, "Lock File: %s", "/%s") ),
13633    ])
13634    pkt.Reply(8)
13635    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
13636                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
13637                         0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
13638    # 2222/5725, 87/37
13639    pkt = NCP(0x5725, "Release File", 'sync', has_length=0)
13640    pkt.Request((20, 274), [
13641            rec( 8, 1, NameSpace  ),
13642            rec( 9, 1, Reserved ),
13643            rec( 10, 2, Reserved2 ),
13644            rec( 12, 1, VolumeNumber ),
13645            rec( 13, 4, DirectoryBase ),
13646            rec( 17, 1, HandleFlag ),
13647            rec( 18, 1, PathCount, var="x" ),
13648            rec( 19, (1,255), Path, repeat="x", info_str=(Path, "Release Lock on: %s", "/%s") ),
13649    ])
13650    pkt.Reply(8)
13651    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
13652                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
13653                         0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
13654    # 2222/5726, 87/38
13655    pkt = NCP(0x5726, "Clear File", 'sync', has_length=0)
13656    pkt.Request((20, 274), [
13657            rec( 8, 1, NameSpace  ),
13658            rec( 9, 1, Reserved ),
13659            rec( 10, 2, Reserved2 ),
13660            rec( 12, 1, VolumeNumber ),
13661            rec( 13, 4, DirectoryBase ),
13662            rec( 17, 1, HandleFlag ),
13663            rec( 18, 1, PathCount, var="x" ),
13664            rec( 19, (1,255), Path, repeat="x", info_str=(Path, "Clear File: %s", "/%s") ),
13665    ])
13666    pkt.Reply(8)
13667    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
13668                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
13669                         0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
13670    # 2222/5727, 87/39
13671    pkt = NCP(0x5727, "Get Directory Disk Space Restriction", 'file', has_length=0)
13672    pkt.Request((19, 273), [
13673            rec( 8, 1, NameSpace  ),
13674            rec( 9, 2, Reserved2 ),
13675            rec( 11, 1, VolumeNumber ),
13676            rec( 12, 4, DirectoryBase ),
13677            rec( 16, 1, HandleFlag ),
13678            rec( 17, 1, PathCount, var="x" ),
13679            rec( 18, (1,255), Path, repeat="x", info_str=(Path, "Get Disk Space Restriction for: %s", "/%s") ),
13680    ])
13681    pkt.Reply(18, [
13682            rec( 8, 1, NumberOfEntries, var="x" ),
13683            rec( 9, 9, SpaceStruct, repeat="x" ),
13684    ])
13685    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
13686                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
13687                         0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00,
13688                         0xff16])
13689    # 2222/5728, 87/40
13690    pkt = NCP(0x5728, "Search for File or Subdirectory Set (Extended Errors)", 'file', has_length=0)
13691    pkt.Request((28, 282), [
13692            rec( 8, 1, NameSpace  ),
13693            rec( 9, 1, DataStream ),
13694            rec( 10, 2, SearchAttributesLow ),
13695            rec( 12, 2, ReturnInfoMask ),
13696            rec( 14, 2, ExtendedInfo ),
13697            rec( 16, 2, ReturnInfoCount ),
13698            rec( 18, 9, SeachSequenceStruct ),
13699            rec( 27, (1,255), SearchPattern, info_str=(SearchPattern, "Search for: %s", ", %s") ),
13700    ])
13701    pkt.Reply(NO_LENGTH_CHECK, [
13702            rec( 8, 9, SeachSequenceStruct ),
13703            rec( 17, 1, MoreFlag ),
13704            rec( 18, 2, InfoCount ),
13705            srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
13706            srec( PadDSSpaceAllocate, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
13707            srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
13708            srec( PadAttributes, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
13709            srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
13710            srec( PadDataStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
13711            srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
13712            srec( PadTotalStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
13713            srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
13714            srec( PadCreationInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
13715            srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
13716            srec( PadModifyInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
13717            srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
13718            srec( PadArchiveInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
13719            srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
13720            srec( PadRightsInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
13721            srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
13722            srec( PadDirEntry, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
13723            srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
13724            srec( PadEAInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
13725            srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
13726            srec( PadNSInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
13727            srec( FileNameStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_fname == 1)" ),
13728            srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc  == 1)" ),
13729            srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
13730            srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
13731            srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
13732            srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
13733            srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
13734            srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
13735            srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
13736            srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
13737            srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
13738            srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
13739            srec( FileNameStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_fname == 1)" ),
13740    ])
13741    pkt.ReqCondSizeVariable()
13742    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
13743                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
13744                         0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
13745    # 2222/5729, 87/41
13746    pkt = NCP(0x5729, "Scan Salvageable Files", 'file', has_length=0)
13747    pkt.Request((24,278), [
13748            rec( 8, 1, NameSpace ),
13749            rec( 9, 1, Reserved ),
13750            rec( 10, 2, CtrlFlags, ENC_LITTLE_ENDIAN ),
13751            rec( 12, 4, SequenceNumber ),
13752            rec( 16, 1, VolumeNumber ),
13753            rec( 17, 4, DirectoryBase ),
13754            rec( 21, 1, HandleFlag ),
13755            rec( 22, 1, PathCount, var="x" ),
13756            rec( 23, (1,255), Path, repeat="x", info_str=(Path, "Scan Deleted Files: %s", "/%s") ),
13757    ])
13758    pkt.Reply(NO_LENGTH_CHECK, [
13759            rec( 8, 4, SequenceNumber ),
13760            rec( 12, 4, DirectoryBase ),
13761            rec( 16, 4, ScanItems, var="x" ),
13762            srec(ScanInfoFileName, req_cond="ncp.ctrl_flags==0x0001", repeat="x" ),
13763            srec(ScanInfoFileNoName, req_cond="ncp.ctrl_flags==0x0000", repeat="x" ),
13764    ])
13765    pkt.ReqCondSizeVariable()
13766    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
13767                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
13768                         0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
13769    # 2222/572A, 87/42
13770    pkt = NCP(0x572A, "Purge Salvageable File List", 'file', has_length=0)
13771    pkt.Request(28, [
13772            rec( 8, 1, NameSpace ),
13773            rec( 9, 1, Reserved ),
13774            rec( 10, 2, PurgeFlags ),
13775            rec( 12, 4, VolumeNumberLong ),
13776            rec( 16, 4, DirectoryBase ),
13777            rec( 20, 4, PurgeCount, var="x" ),
13778            rec( 24, 4, PurgeList, repeat="x" ),
13779    ])
13780    pkt.Reply(16, [
13781            rec( 8, 4, PurgeCount, var="x" ),
13782            rec( 12, 4, PurgeCcode, repeat="x" ),
13783    ])
13784    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
13785                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
13786                         0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
13787    # 2222/572B, 87/43
13788    pkt = NCP(0x572B, "Revoke File Handle Rights", 'file', has_length=0)
13789    pkt.Request(17, [
13790            rec( 8, 3, Reserved3 ),
13791            rec( 11, 1, RevQueryFlag ),
13792            rec( 12, 4, FileHandle ),
13793            rec( 16, 1, RemoveOpenRights ),
13794    ])
13795    pkt.Reply(13, [
13796            rec( 8, 4, FileHandle ),
13797            rec( 12, 1, OpenRights ),
13798    ])
13799    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
13800                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
13801                         0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
13802    # 2222/572C, 87/44
13803    pkt = NCP(0x572C, "Update File Handle Rights", 'file', has_length=0)
13804    pkt.Request(24, [
13805            rec( 8, 2, Reserved2 ),
13806            rec( 10, 1, VolumeNumber ),
13807            rec( 11, 1, NameSpace ),
13808            rec( 12, 4, DirectoryNumber ),
13809            rec( 16, 2, AccessRightsMaskWord ),
13810            rec( 18, 2, NewAccessRights ),
13811            rec( 20, 4, FileHandle, ENC_BIG_ENDIAN ),
13812    ])
13813    pkt.Reply(16, [
13814            rec( 8, 4, FileHandle, ENC_BIG_ENDIAN ),
13815            rec( 12, 4, EffectiveRights, ENC_LITTLE_ENDIAN ),
13816    ])
13817    pkt.CompletionCodes([0x0000, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
13818                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
13819                         0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff16])
13820    pkt.MakeExpert("ncp572c")
13821    # 2222/5740, 87/64
13822    pkt = NCP(0x5740, "Read from File", 'file', has_length=0)
13823    pkt.Request(22, [
13824    rec( 8, 4, FileHandle, ENC_BIG_ENDIAN ),
13825    rec( 12, 8, StartOffset64bit, ENC_BIG_ENDIAN ),
13826    rec( 20, 2, NumBytes, ENC_BIG_ENDIAN ),
13827])
13828    pkt.Reply(10, [
13829    rec( 8, 2, NumBytes, ENC_BIG_ENDIAN),
13830])
13831    pkt.CompletionCodes([0x0000, 0x8300, 0x8800, 0x9300, 0x9500, 0xa201, 0xfd00, 0xff1b])
13832    # 2222/5741, 87/65
13833    pkt = NCP(0x5741, "Write to File", 'file', has_length=0)
13834    pkt.Request(22, [
13835    rec( 8, 4, FileHandle, ENC_BIG_ENDIAN ),
13836    rec( 12, 8, StartOffset64bit, ENC_BIG_ENDIAN ),
13837    rec( 20, 2, NumBytes, ENC_BIG_ENDIAN ),
13838])
13839    pkt.Reply(8)
13840    pkt.CompletionCodes([0x0000, 0x0102, 0x8300, 0x8800, 0x9400, 0x9500, 0xa201, 0xfd00, 0xff1b])
13841    # 2222/5742, 87/66
13842    pkt = NCP(0x5742, "Get Current Size of File", 'file', has_length=0)
13843    pkt.Request(12, [
13844    rec( 8, 4, FileHandle, ENC_BIG_ENDIAN ),
13845])
13846    pkt.Reply(16, [
13847    rec( 8, 8, FileSize64bit),
13848])
13849    pkt.CompletionCodes([0x0000, 0x7f00, 0x8800, 0x9600, 0xfd02, 0xff01])
13850    # 2222/5743, 87/67
13851    pkt = NCP(0x5743, "Log Physical Record", 'file', has_length=0)
13852    pkt.Request(36, [
13853    rec( 8, 4, LockFlag, ENC_BIG_ENDIAN ),
13854    rec(12, 4, FileHandle, ENC_BIG_ENDIAN ),
13855    rec(16, 8, StartOffset64bit, ENC_BIG_ENDIAN ),
13856    rec(24, 8, Length64bit, ENC_BIG_ENDIAN ),
13857    rec(32, 4, LockTimeout, ENC_BIG_ENDIAN),
13858])
13859    pkt.Reply(8)
13860    pkt.CompletionCodes([0x0000, 0x7f00, 0x8800, 0x9600, 0xfb08, 0xfd02, 0xff01])
13861    # 2222/5744, 87/68
13862    pkt = NCP(0x5744, "Release Physical Record", 'file', has_length=0)
13863    pkt.Request(28, [
13864    rec(8, 4, FileHandle, ENC_BIG_ENDIAN ),
13865    rec(12, 8, StartOffset64bit, ENC_BIG_ENDIAN ),
13866    rec(20, 8, Length64bit, ENC_BIG_ENDIAN ),
13867])
13868    pkt.Reply(8)
13869    pkt.CompletionCodes([0x0000, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
13870                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
13871                         0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff1a])
13872    # 2222/5745, 87/69
13873    pkt = NCP(0x5745, "Clear Physical Record", 'file', has_length=0)
13874    pkt.Request(28, [
13875    rec(8, 4, FileHandle, ENC_BIG_ENDIAN ),
13876    rec(12, 8, StartOffset64bit, ENC_BIG_ENDIAN ),
13877    rec(20, 8, Length64bit, ENC_BIG_ENDIAN ),
13878])
13879    pkt.Reply(8)
13880    pkt.CompletionCodes([0x0000, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
13881                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
13882                         0x9804, 0x9b03, 0x9c03, 0xbf00, 0xfd00, 0xff1a])
13883    # 2222/5746, 87/70
13884    pkt = NCP(0x5746, "Copy from One File to Another (64 Bit offset capable)", 'file', has_length=0)
13885    pkt.Request(44, [
13886    rec(8, 6, SourceFileHandle, ENC_BIG_ENDIAN ),
13887    rec(14, 6, TargetFileHandle, ENC_BIG_ENDIAN ),
13888    rec(20, 8, SourceFileOffset, ENC_BIG_ENDIAN ),
13889    rec(28, 8, TargetFileOffset64bit, ENC_BIG_ENDIAN ),
13890    rec(36, 8, BytesToCopy64bit, ENC_BIG_ENDIAN ),
13891])
13892    pkt.Reply(16, [
13893            rec( 8, 8, BytesActuallyTransferred64bit, ENC_BIG_ENDIAN ),
13894    ])
13895    pkt.CompletionCodes([0x0000, 0x0104, 0x8301, 0x8800, 0x9300, 0x9400,
13896                         0x9500, 0x9600, 0xa201])
13897    # 2222/5747, 87/71
13898    pkt = NCP(0x5747, "Get Sparse File Data Block Bit Map", 'file', has_length=0)
13899    pkt.Request(23, [
13900    rec(8, 6, SourceFileHandle, ENC_BIG_ENDIAN ),
13901    rec(14, 8, SourceFileOffset, ENC_BIG_ENDIAN ),
13902    rec(22, 1, ExtentListFormat, ENC_BIG_ENDIAN ),
13903])
13904    pkt.Reply(NO_LENGTH_CHECK, [
13905            rec( 8, 1, ExtentListFormat ),
13906            rec( 9, 1, RetExtentListCount, var="x" ),
13907            rec( 10, 8, EndingOffset ),
13908            srec(zFileMap_Allocation, req_cond="ncp.ext_lst_format==0", repeat="x" ),
13909            srec(zFileMap_Logical, req_cond="ncp.ext_lst_format==1", repeat="x" ),
13910            srec(zFileMap_Physical, req_cond="ncp.ext_lst_format==2", repeat="x" ),
13911    ])
13912    pkt.ReqCondSizeVariable()
13913    pkt.CompletionCodes([0x0000, 0x8800, 0xff00])
13914	    # 2222/5748, 87/72
13915    pkt = NCP(0x5748, "Read a File", 'file', has_length=0)
13916    pkt.Request(24, [
13917    rec( 8, 4, FileHandle, ENC_BIG_ENDIAN ),
13918    rec( 12, 8, StartOffset64bit, ENC_BIG_ENDIAN ),
13919    rec( 20, 4, NumBytesLong, ENC_BIG_ENDIAN ),
13920])
13921    pkt.Reply(NO_LENGTH_CHECK, [
13922    rec( 8, 4, NumBytesLong, ENC_BIG_ENDIAN),
13923	rec( 12, PROTO_LENGTH_UNKNOWN, Data64),
13924	#decoded in packet-ncp2222.inc
13925	# rec( NumBytesLong, 4, BytesActuallyTransferred64bit, ENC_BIG_ENDIAN),
13926	])
13927    pkt.CompletionCodes([0x0000, 0x8300, 0x8800, 0x9300, 0x9500, 0xa201, 0xfd00, 0xff1b])
13928
13929	    # 2222/5749, 87/73
13930    pkt = NCP(0x5749, "Write to a File", 'file', has_length=0)
13931    pkt.Request(24, [
13932    rec( 8, 4, FileHandle, ENC_BIG_ENDIAN ),
13933    rec( 12, 8, StartOffset64bit, ENC_BIG_ENDIAN ),
13934    rec( 20, 4, NumBytesLong, ENC_BIG_ENDIAN ),
13935])
13936    pkt.Reply(8)
13937    pkt.CompletionCodes([0x0000, 0x0102, 0x8300, 0x8800, 0x9400, 0x9500, 0xa201, 0xfd00, 0xff1b])
13938
13939    # 2222/5801, 8801
13940    pkt = NCP(0x5801, "Query Volume Audit Status", "auditing", has_length=0)
13941    pkt.Request(12, [
13942            rec( 8, 4, ConnectionNumber ),
13943    ])
13944    pkt.Reply(40, [
13945            rec(8, 32, NWAuditStatus ),
13946    ])
13947    pkt.CompletionCodes([0x0000, 0x0106, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
13948                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
13949                         0x9804, 0x9b03, 0x9c03, 0xa600, 0xa700, 0xa801, 0xbe00, 0xfd00, 0xff16])
13950    # 2222/5802, 8802
13951    pkt = NCP(0x5802, "Add User Audit Property", "auditing", has_length=0)
13952    pkt.Request(25, [
13953            rec(8, 4, AuditIDType ),
13954            rec(12, 4, AuditID ),
13955            rec(16, 4, AuditHandle ),
13956            rec(20, 4, ObjectID ),
13957            rec(24, 1, AuditFlag ),
13958    ])
13959    pkt.Reply(8)
13960    pkt.CompletionCodes([0x0000, 0x0106, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
13961                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
13962                         0x9804, 0x9b03, 0x9c03, 0xa600, 0xa700, 0xa801, 0xbe00, 0xfd00, 0xff16])
13963    # 2222/5803, 8803
13964    pkt = NCP(0x5803, "Add Auditor Access", "auditing", has_length=0)
13965    pkt.Request(8)
13966    pkt.Reply(8)
13967    pkt.CompletionCodes([0x0000, 0x0106, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
13968                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
13969                         0x9804, 0x9b03, 0x9c03, 0xa600, 0xa700, 0xa801, 0xbe00, 0xde00, 0xfd00, 0xff16])
13970    # 2222/5804, 8804
13971    pkt = NCP(0x5804, "Change Auditor Volume Password", "auditing", has_length=0)
13972    pkt.Request(8)
13973    pkt.Reply(8)
13974    pkt.CompletionCodes([0x0000, 0x0106, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
13975                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
13976                         0x9804, 0x9b03, 0x9c03, 0xa600, 0xa700, 0xa801, 0xbe00, 0xfd00, 0xff16])
13977    # 2222/5805, 8805
13978    pkt = NCP(0x5805, "Check Auditor Access", "auditing", has_length=0)
13979    pkt.Request(8)
13980    pkt.Reply(8)
13981    pkt.CompletionCodes([0x0000, 0x0106, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
13982                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
13983                         0x9804, 0x9b03, 0x9c03, 0xa600, 0xa700, 0xa801, 0xbe00, 0xfd00, 0xff16])
13984    # 2222/5806, 8806
13985    pkt = NCP(0x5806, "Delete User Audit Property", "auditing", has_length=0)
13986    pkt.Request(8)
13987    pkt.Reply(8)
13988    pkt.CompletionCodes([0x0000, 0x0106, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
13989                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
13990                         0x9804, 0x9b03, 0x9c03, 0xa600, 0xa700, 0xa801, 0xbe00, 0xfd00, 0xff21])
13991    # 2222/5807, 8807
13992    pkt = NCP(0x5807, "Disable Auditing On A Volume", "auditing", has_length=0)
13993    pkt.Request(8)
13994    pkt.Reply(8)
13995    pkt.CompletionCodes([0x0000, 0x0106, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
13996                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
13997                         0x9804, 0x9b03, 0x9c03, 0xa600, 0xa700, 0xa801, 0xbe00, 0xfd00, 0xff16])
13998    # 2222/5808, 8808
13999    pkt = NCP(0x5808, "Enable Auditing On A Volume", "auditing", has_length=0)
14000    pkt.Request(8)
14001    pkt.Reply(8)
14002    pkt.CompletionCodes([0x0000, 0x0106, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
14003                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
14004                         0x9804, 0x9b03, 0x9c03, 0xa600, 0xa700, 0xa801, 0xbe00, 0xde00, 0xfd00, 0xff16])
14005    # 2222/5809, 8809
14006    pkt = NCP(0x5809, "Query User Being Audited", "auditing", has_length=0)
14007    pkt.Request(8)
14008    pkt.Reply(8)
14009    pkt.CompletionCodes([0x0000, 0x0106, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
14010                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
14011                         0x9804, 0x9b03, 0x9c03, 0xa600, 0xa700, 0xa801, 0xbe00, 0xfd00, 0xff16])
14012    # 2222/580A, 88,10
14013    pkt = NCP(0x580A, "Read Audit Bit Map", "auditing", has_length=0)
14014    pkt.Request(8)
14015    pkt.Reply(8)
14016    pkt.CompletionCodes([0x0000, 0x0106, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
14017                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
14018                         0x9804, 0x9b03, 0x9c03, 0xa600, 0xa700, 0xa801, 0xbe00, 0xfd00, 0xff16])
14019    # 2222/580B, 88,11
14020    pkt = NCP(0x580B, "Read Audit File Configuration Header", "auditing", has_length=0)
14021    pkt.Request(8)
14022    pkt.Reply(8)
14023    pkt.CompletionCodes([0x0000, 0x0106, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
14024                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
14025                         0x9804, 0x9b03, 0x9c03, 0xa600, 0xa700, 0xa801, 0xbe00, 0xfd00, 0xff16])
14026    # 2222/580D, 88,13
14027    pkt = NCP(0x580D, "Remove Auditor Access", "auditing", has_length=0)
14028    pkt.Request(8)
14029    pkt.Reply(8)
14030    pkt.CompletionCodes([0x0000, 0x0106, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
14031                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
14032                         0x9804, 0x9b03, 0x9c03, 0xa600, 0xa700, 0xa801, 0xbe00, 0xfd00, 0xff16])
14033    # 2222/580E, 88,14
14034    pkt = NCP(0x580E, "Reset Audit File", "auditing", has_length=0)
14035    pkt.Request(8)
14036    pkt.Reply(8)
14037    pkt.CompletionCodes([0x0000, 0x0106, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
14038                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
14039                         0x9804, 0x9b03, 0x9c03, 0xa600, 0xa700, 0xa801, 0xbe00, 0xfd00, 0xff16])
14040
14041    # 2222/580F, 88,15
14042    pkt = NCP(0x580F, "Auditing NCP", "auditing", has_length=0)
14043    pkt.Request(8)
14044    pkt.Reply(8)
14045    pkt.CompletionCodes([0x0000, 0x0106, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
14046                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
14047                         0x9804, 0x9b03, 0x9c03, 0xa600, 0xa700, 0xa801, 0xbe00, 0xfb00, 0xfd00, 0xff16])
14048    # 2222/5810, 88,16
14049    pkt = NCP(0x5810, "Write Audit Bit Map", "auditing", has_length=0)
14050    pkt.Request(8)
14051    pkt.Reply(8)
14052    pkt.CompletionCodes([0x0000, 0x0106, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
14053                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
14054                         0x9804, 0x9b03, 0x9c03, 0xa600, 0xa700, 0xa801, 0xbe00, 0xfd00, 0xff16])
14055    # 2222/5811, 88,17
14056    pkt = NCP(0x5811, "Write Audit File Configuration Header", "auditing", has_length=0)
14057    pkt.Request(8)
14058    pkt.Reply(8)
14059    pkt.CompletionCodes([0x0000, 0x0106, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
14060                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
14061                         0x9804, 0x9b03, 0x9c03, 0xa600, 0xa700, 0xa801, 0xbe00, 0xfd00, 0xff16])
14062    # 2222/5812, 88,18
14063    pkt = NCP(0x5812, "Change Auditor Volume Password2", "auditing", has_length=0)
14064    pkt.Request(8)
14065    pkt.Reply(8)
14066    pkt.CompletionCodes([0x0000, 0x0106, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
14067                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
14068                         0x9804, 0x9b03, 0x9c03, 0xa600, 0xa700, 0xa801, 0xbe00, 0xfd00, 0xff16])
14069    # 2222/5813, 88,19
14070    pkt = NCP(0x5813, "Return Audit Flags", "auditing", has_length=0)
14071    pkt.Request(8)
14072    pkt.Reply(8)
14073    pkt.CompletionCodes([0x0000, 0x0106, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
14074                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
14075                         0x9804, 0x9b03, 0x9c03, 0xa600, 0xa700, 0xa801, 0xbe00, 0xfd00, 0xff16])
14076    # 2222/5814, 88,20
14077    pkt = NCP(0x5814, "Close Old Audit File", "auditing", has_length=0)
14078    pkt.Request(8)
14079    pkt.Reply(8)
14080    pkt.CompletionCodes([0x0000, 0x0106, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
14081                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
14082                         0x9804, 0x9b03, 0x9c03, 0xa600, 0xa700, 0xa801, 0xbe00, 0xfd00, 0xff16])
14083    # 2222/5816, 88,22
14084    pkt = NCP(0x5816, "Check Level Two Access", "auditing", has_length=0)
14085    pkt.Request(8)
14086    pkt.Reply(8)
14087    pkt.CompletionCodes([0x0000, 0x0106, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
14088                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
14089                         0x9804, 0x9b03, 0x9c03, 0xa600, 0xa700, 0xa801, 0xbe00, 0xde00, 0xfd00, 0xff16])
14090    # 2222/5817, 88,23
14091    pkt = NCP(0x5817, "Return Old Audit File List", "auditing", has_length=0)
14092    pkt.Request(8)
14093    pkt.Reply(8)
14094    pkt.CompletionCodes([0x0000, 0x0106, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
14095                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
14096                         0x9804, 0x9b03, 0x9c03, 0xa600, 0xa700, 0xa801, 0xbe00, 0xfd00, 0xff16])
14097    # 2222/5818, 88,24
14098    pkt = NCP(0x5818, "Init Audit File Reads", "auditing", has_length=0)
14099    pkt.Request(8)
14100    pkt.Reply(8)
14101    pkt.CompletionCodes([0x0000, 0x0106, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
14102                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
14103                         0x9804, 0x9b03, 0x9c03, 0xa600, 0xa700, 0xa801, 0xbe00, 0xfd00, 0xff16])
14104    # 2222/5819, 88,25
14105    pkt = NCP(0x5819, "Read Auditing File", "auditing", has_length=0)
14106    pkt.Request(8)
14107    pkt.Reply(8)
14108    pkt.CompletionCodes([0x0000, 0x0106, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
14109                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
14110                         0x9804, 0x9b03, 0x9c03, 0xa600, 0xa700, 0xa801, 0xbe00, 0xfd00, 0xff16])
14111    # 2222/581A, 88,26
14112    pkt = NCP(0x581A, "Delete Old Audit File", "auditing", has_length=0)
14113    pkt.Request(8)
14114    pkt.Reply(8)
14115    pkt.CompletionCodes([0x0000, 0x0106, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
14116                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
14117                         0x9804, 0x9b03, 0x9c03, 0xa600, 0xa700, 0xa801, 0xbe00, 0xfd00, 0xff16])
14118    # 2222/581E, 88,30
14119    pkt = NCP(0x581E, "Restart Volume auditing", "auditing", has_length=0)
14120    pkt.Request(8)
14121    pkt.Reply(8)
14122    pkt.CompletionCodes([0x0000, 0x0106, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
14123                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
14124                         0x9804, 0x9b03, 0x9c03, 0xa600, 0xa700, 0xa801, 0xbe00, 0xfd00, 0xff16])
14125    # 2222/581F, 88,31
14126    pkt = NCP(0x581F, "Set Volume Password", "auditing", has_length=0)
14127    pkt.Request(8)
14128    pkt.Reply(8)
14129    pkt.CompletionCodes([0x0000, 0x0106, 0x7300, 0x8000, 0x8101, 0x8401, 0x8501,
14130                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
14131                         0x9804, 0x9b03, 0x9c03, 0xa600, 0xa700, 0xa801, 0xbe00, 0xfd00, 0xff16])
14132    # 2222/5901, 89,01
14133    pkt = NCP(0x5901, "Open/Create File or Subdirectory", "enhanced", has_length=0)
14134    pkt.Request((37,290), [
14135            rec( 8, 1, NameSpace  ),
14136            rec( 9, 1, OpenCreateMode ),
14137            rec( 10, 2, SearchAttributesLow ),
14138            rec( 12, 2, ReturnInfoMask ),
14139            rec( 14, 2, ExtendedInfo ),
14140            rec( 16, 4, AttributesDef32 ),
14141            rec( 20, 2, DesiredAccessRights ),
14142            rec( 22, 4, DirectoryBase ),
14143            rec( 26, 1, VolumeNumber ),
14144            rec( 27, 1, HandleFlag ),
14145            rec( 28, 1, DataTypeFlag ),
14146            rec( 29, 5, Reserved5 ),
14147            rec( 34, 1, PathCount, var="x" ),
14148            rec( 35, (2,255), Path16, repeat="x", info_str=(Path16, "Open or Create File or Subdirectory: %s", "/%s") ),
14149    ])
14150    pkt.Reply( NO_LENGTH_CHECK, [
14151            rec( 8, 4, FileHandle, ENC_BIG_ENDIAN ),
14152            rec( 12, 1, OpenCreateAction ),
14153            rec( 13, 1, Reserved ),
14154            srec( DSSpaceAllocateStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
14155            srec( PadDSSpaceAllocate, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
14156            srec( AttributesStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
14157            srec( PadAttributes, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
14158            srec( DataStreamSizeStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
14159            srec( PadDataStreamSize, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
14160            srec( TotalStreamSizeStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
14161            srec( PadTotalStreamSize, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
14162            srec( CreationInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
14163            srec( PadCreationInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
14164            srec( ModifyInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
14165            srec( PadModifyInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
14166            srec( ArchiveInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
14167            srec( PadArchiveInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
14168            srec( RightsInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
14169            srec( PadRightsInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
14170            srec( DirEntryStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
14171            srec( PadDirEntry, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
14172            srec( EAInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
14173            srec( PadEAInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
14174            srec( NSInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
14175            srec( PadNSInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
14176            srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc  == 1)" ),
14177            srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
14178            srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
14179            srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
14180            srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
14181            srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
14182            srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
14183            srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
14184            srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
14185            srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
14186            srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
14187            srec( ReferenceIDStruct, req_cond="ncp.ret_info_mask_id == 1" ),
14188            srec( NSAttributeStruct, req_cond="ncp.ret_info_mask_ns_attr == 1" ),
14189            rec( -1, 4, DataStreamsCount, var="x" , req_cond="ncp.ret_info_mask_actual == 1"  ),
14190            srec( DStreamActual, repeat = "x" , req_cond="ncp.ret_info_mask_actual == 1" ),
14191            rec( -1, 4, DataStreamsCount, var="y", req_cond="ncp.ret_info_mask_logical == 1" ),
14192            srec( DStreamLogical, repeat="y" , req_cond="ncp.ret_info_mask_logical == 1" ),
14193            srec( LastUpdatedInSecondsStruct, req_cond="ncp.ext_info_update == 1" ),
14194            srec( DOSName16Struct, req_cond="ncp.ext_info_dos_name == 1" ),
14195            srec( FlushTimeStruct, req_cond="ncp.ext_info_flush == 1" ),
14196            srec( ParentBaseIDStruct, req_cond="ncp.ext_info_parental == 1" ),
14197            srec( MacFinderInfoStruct, req_cond="ncp.ext_info_mac_finder == 1" ),
14198            srec( SiblingCountStruct, req_cond="ncp.ext_info_sibling == 1" ),
14199            srec( EffectiveRightsStruct, req_cond="ncp.ext_info_effective == 1" ),
14200            srec( MacTimeStruct, req_cond="ncp.ext_info_mac_date == 1" ),
14201            srec( LastAccessedTimeStruct, req_cond="ncp.ext_info_access == 1" ),
14202            srec( FileSize64bitStruct, req_cond="ncp.ext_info_64_bit_fs == 1" ),
14203            srec( FileName16Struct, req_cond="ncp.ret_info_mask_fname == 1" ),
14204    ])
14205    pkt.ReqCondSizeVariable()
14206    pkt.CompletionCodes([0x0000, 0x0102, 0x7f00, 0x8000, 0x8101, 0x8401, 0x8501,
14207                                            0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
14208                                            0x9804, 0x9900, 0x9b03, 0x9c03, 0xa901, 0xa500, 0xaa00, 0xbf00, 0xfd00, 0xff16])
14209    pkt.MakeExpert("file_rights")
14210    # 2222/5902, 89/02
14211    pkt = NCP(0x5902, "Initialize Search", 'enhanced', has_length=0)
14212    pkt.Request( (25,278), [
14213            rec( 8, 1, NameSpace  ),
14214            rec( 9, 1, Reserved ),
14215            rec( 10, 4, DirectoryBase ),
14216            rec( 14, 1, VolumeNumber ),
14217            rec( 15, 1, HandleFlag ),
14218    rec( 16, 1, DataTypeFlag ),
14219    rec( 17, 5, Reserved5 ),
14220            rec( 22, 1, PathCount, var="x" ),
14221            rec( 23, (2,255), Path16, repeat="x", info_str=(Path16, "Set Search Pointer to: %s", "/%s") ),
14222    ])
14223    pkt.Reply(17, [
14224            rec( 8, 1, VolumeNumber ),
14225            rec( 9, 4, DirectoryNumber ),
14226            rec( 13, 4, DirectoryEntryNumber ),
14227    ])
14228    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
14229                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
14230                         0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
14231    # 2222/5903, 89/03
14232    pkt = NCP(0x5903, "Search for File or Subdirectory", 'enhanced', has_length=0)
14233    pkt.Request(26, [
14234            rec( 8, 1, NameSpace  ),
14235            rec( 9, 1, DataStream ),
14236            rec( 10, 2, SearchAttributesLow ),
14237            rec( 12, 2, ReturnInfoMask ),
14238            rec( 14, 2, ExtendedInfo ),
14239            rec( 16, 9, SeachSequenceStruct ),
14240            rec( 25, 1, DataTypeFlag ),
14241            # next field is dissected in packet-ncp2222.inc
14242            #rec( 26, (2,255), SearchPattern16, info_str=(SearchPattern16, "Search for: %s", "/%s") ),
14243    ])
14244    pkt.Reply( NO_LENGTH_CHECK, [
14245            rec( 8, 9, SeachSequenceStruct ),
14246            rec( 17, 1, Reserved ),
14247            srec( DSSpaceAllocateStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
14248            srec( PadDSSpaceAllocate, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
14249            srec( AttributesStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
14250            srec( PadAttributes, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
14251            srec( DataStreamSizeStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
14252            srec( PadDataStreamSize, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
14253            srec( TotalStreamSizeStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
14254            srec( PadTotalStreamSize, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
14255            srec( CreationInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
14256            srec( PadCreationInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
14257            srec( ModifyInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
14258            srec( PadModifyInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
14259            srec( ArchiveInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
14260            srec( PadArchiveInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
14261            srec( RightsInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
14262            srec( PadRightsInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
14263            srec( DirEntryStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
14264            srec( PadDirEntry, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
14265            srec( EAInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
14266            srec( PadEAInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
14267            srec( NSInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
14268            srec( PadNSInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
14269            srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc  == 1)" ),
14270            srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
14271            srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
14272            srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
14273            srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
14274            srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
14275            srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
14276            srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
14277            srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
14278            srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
14279            srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
14280            srec( ReferenceIDStruct, req_cond="ncp.ret_info_mask_id == 1" ),
14281            srec( NSAttributeStruct, req_cond="ncp.ret_info_mask_ns_attr == 1" ),
14282            rec( -1, 4, DataStreamsCount, var="x" , req_cond="ncp.ret_info_mask_actual == 1"  ),
14283            srec( DStreamActual, repeat = "x" , req_cond="ncp.ret_info_mask_actual == 1" ),
14284            rec( -1, 4, DataStreamsCount, var="y", req_cond="ncp.ret_info_mask_logical == 1" ),
14285            srec( DStreamLogical, repeat="y" , req_cond="ncp.ret_info_mask_logical == 1" ),
14286            srec( LastUpdatedInSecondsStruct, req_cond="ncp.ext_info_update == 1" ),
14287            srec( DOSName16Struct, req_cond="ncp.ext_info_dos_name == 1" ),
14288            srec( FlushTimeStruct, req_cond="ncp.ext_info_flush == 1" ),
14289            srec( ParentBaseIDStruct, req_cond="ncp.ext_info_parental == 1" ),
14290            srec( MacFinderInfoStruct, req_cond="ncp.ext_info_mac_finder == 1" ),
14291            srec( SiblingCountStruct, req_cond="ncp.ext_info_sibling == 1" ),
14292            srec( EffectiveRightsStruct, req_cond="ncp.ext_info_effective == 1" ),
14293            srec( MacTimeStruct, req_cond="ncp.ext_info_mac_date == 1" ),
14294            srec( LastAccessedTimeStruct, req_cond="ncp.ext_info_access == 1" ),
14295            srec( FileSize64bitStruct, req_cond="ncp.ext_info_64_bit_fs == 1" ),
14296            srec( FileName16Struct, req_cond="ncp.ret_info_mask_fname == 1" ),
14297    ])
14298    pkt.ReqCondSizeVariable()
14299    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
14300                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
14301                         0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
14302    # 2222/5904, 89/04
14303    pkt = NCP(0x5904, "Rename Or Move a File or Subdirectory", 'enhanced', has_length=0)
14304    pkt.Request((42, 548), [
14305            rec( 8, 1, NameSpace  ),
14306            rec( 9, 1, RenameFlag ),
14307            rec( 10, 2, SearchAttributesLow ),
14308    rec( 12, 12, SrcEnhNWHandlePathS1 ),
14309            rec( 24, 1, PathCount, var="x" ),
14310            rec( 25, 12, DstEnhNWHandlePathS1 ),
14311            rec( 37, 1, PathCount, var="y" ),
14312            rec( 38, (2, 255), Path16, repeat="x", info_str=(Path16, "Rename or Move: %s", "/%s") ),
14313            rec( -1, (2,255), DestPath16, repeat="y" ),
14314    ])
14315    pkt.Reply(8)
14316    pkt.CompletionCodes([0x0000, 0x0102, 0x8000, 0x8101, 0x8401, 0x8501,
14317                         0x8701, 0x8d00, 0x8e00, 0x8f00, 0x9001, 0x9200, 0x9600,
14318                         0x9804, 0x9a00, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
14319    # 2222/5905, 89/05
14320    pkt = NCP(0x5905, "Scan File or Subdirectory for Trustees", 'enhanced', has_length=0)
14321    pkt.Request((31, 284), [
14322            rec( 8, 1, NameSpace  ),
14323            rec( 9, 1, MaxReplyObjectIDCount ),
14324            rec( 10, 2, SearchAttributesLow ),
14325            rec( 12, 4, SequenceNumber ),
14326            rec( 16, 4, DirectoryBase ),
14327            rec( 20, 1, VolumeNumber ),
14328            rec( 21, 1, HandleFlag ),
14329    rec( 22, 1, DataTypeFlag ),
14330    rec( 23, 5, Reserved5 ),
14331            rec( 28, 1, PathCount, var="x" ),
14332            rec( 29, (2, 255), Path16, repeat="x", info_str=(Path16, "Scan Trustees for: %s", "/%s") ),
14333    ])
14334    pkt.Reply(20, [
14335            rec( 8, 4, SequenceNumber ),
14336            rec( 12, 2, ObjectIDCount, var="x" ),
14337            rec( 14, 6, TrusteeStruct, repeat="x" ),
14338    ])
14339    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
14340                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
14341                         0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
14342    # 2222/5906, 89/06
14343    pkt = NCP(0x5906, "Obtain File or SubDirectory Information", 'enhanced', has_length=0)
14344    pkt.Request((22), [
14345            rec( 8, 1, SrcNameSpace ),
14346            rec( 9, 1, DestNameSpace ),
14347            rec( 10, 2, SearchAttributesLow ),
14348            rec( 12, 2, ReturnInfoMask, ENC_LITTLE_ENDIAN ),
14349            rec( 14, 2, ExtendedInfo ),
14350            rec( 16, 4, DirectoryBase ),
14351            rec( 20, 1, VolumeNumber ),
14352            rec( 21, 1, HandleFlag ),
14353    #
14354    # Move to packet-ncp2222.inc
14355    # The datatype flag indicates if the path is represented as ASCII or UTF8
14356    # ASCII has a 1 byte count field whereas UTF8 has a two byte count field.
14357    #
14358    #rec( 22, 1, DataTypeFlag ),
14359    #rec( 23, 5, Reserved5 ),
14360            #rec( 28, 1, PathCount, var="x" ),
14361            #rec( 29, (2,255), Path16, repeat="x", info_str=(Path16, "Obtain Info for: %s", "/%s")),
14362    ])
14363    pkt.Reply(NO_LENGTH_CHECK, [
14364        srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
14365        srec( PadDSSpaceAllocate, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
14366        srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
14367        srec( PadAttributes, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
14368        srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
14369        srec( PadDataStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
14370        srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
14371        srec( PadTotalStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
14372        srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
14373        srec( PadCreationInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
14374        srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
14375        srec( PadModifyInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
14376        srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
14377        srec( PadArchiveInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
14378        srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
14379        srec( PadRightsInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
14380        srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
14381        srec( PadDirEntry, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
14382        srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
14383        srec( PadEAInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
14384        srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
14385        srec( PadNSInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
14386        srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc  == 1)" ),
14387        srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
14388        srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
14389        srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
14390        srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
14391        srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
14392        srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
14393        srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
14394        srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
14395        srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
14396        srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
14397        srec( ReferenceIDStruct, req_cond="ncp.ret_info_mask_id == 1" ),
14398        srec( NSAttributeStruct, req_cond="ncp.ret_info_mask_ns_attr == 1" ),
14399        rec( -1, 4, DataStreamsCount, var="x" , req_cond="ncp.ret_info_mask_actual == 1"  ),
14400        srec( DStreamActual, repeat = "x" , req_cond="ncp.ret_info_mask_actual == 1" ),
14401        rec( -1, 4, DataStreamsCount, var="y", req_cond="ncp.ret_info_mask_logical == 1" ),
14402        srec( DStreamLogical, repeat="y" , req_cond="ncp.ret_info_mask_logical == 1" ),
14403        srec( LastUpdatedInSecondsStruct, req_cond="ncp.ext_info_update == 1" ),
14404        srec( FlushTimeStruct, req_cond="ncp.ext_info_flush == 1" ),
14405        srec( ParentBaseIDStruct, req_cond="ncp.ext_info_parental == 1" ),
14406        srec( MacFinderInfoStruct, req_cond="ncp.ext_info_mac_finder == 1" ),
14407        srec( SiblingCountStruct, req_cond="ncp.ext_info_sibling == 1" ),
14408        srec( EffectiveRightsStruct, req_cond="ncp.ext_info_effective == 1" ),
14409        srec( MacTimeStruct, req_cond="ncp.ext_info_mac_date == 1" ),
14410        srec( LastAccessedTimeStruct, req_cond="ncp.ext_info_access == 1" ),
14411        srec( DOSName16Struct, req_cond="ncp.ext_info_dos_name == 1" ),
14412        srec( FileSize64bitStruct, req_cond="ncp.ext_info_64_bit_fs == 1" ),
14413        srec( FileName16Struct, req_cond="ncp.ret_info_mask_fname == 1" ),
14414    ])
14415    pkt.ReqCondSizeVariable()
14416    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
14417                         0x8700, 0x8900, 0x8d00, 0x8f00, 0x9001, 0x9600,
14418                         0x9804, 0x9b03, 0x9c03, 0xa802, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
14419    # 2222/5907, 89/07
14420    pkt = NCP(0x5907, "Modify File or Subdirectory DOS Information", 'enhanced', has_length=0)
14421    pkt.Request((69,322), [
14422            rec( 8, 1, NameSpace ),
14423            rec( 9, 1, Reserved ),
14424            rec( 10, 2, SearchAttributesLow ),
14425            rec( 12, 2, ModifyDOSInfoMask ),
14426            rec( 14, 2, Reserved2 ),
14427            rec( 16, 2, AttributesDef16 ),
14428            rec( 18, 1, FileMode ),
14429            rec( 19, 1, FileExtendedAttributes ),
14430            rec( 20, 2, CreationDate ),
14431            rec( 22, 2, CreationTime ),
14432            rec( 24, 4, CreatorID, ENC_BIG_ENDIAN ),
14433            rec( 28, 2, ModifiedDate ),
14434            rec( 30, 2, ModifiedTime ),
14435            rec( 32, 4, ModifierID, ENC_BIG_ENDIAN ),
14436            rec( 36, 2, ArchivedDate ),
14437            rec( 38, 2, ArchivedTime ),
14438            rec( 40, 4, ArchiverID, ENC_BIG_ENDIAN ),
14439            rec( 44, 2, LastAccessedDate ),
14440            rec( 46, 2, InheritedRightsMask ),
14441            rec( 48, 2, InheritanceRevokeMask ),
14442            rec( 50, 4, MaxSpace ),
14443            rec( 54, 4, DirectoryBase ),
14444            rec( 58, 1, VolumeNumber ),
14445            rec( 59, 1, HandleFlag ),
14446    rec( 60, 1, DataTypeFlag ),
14447    rec( 61, 5, Reserved5 ),
14448            rec( 66, 1, PathCount, var="x" ),
14449            rec( 67, (2,255), Path16, repeat="x", info_str=(Path16, "Modify DOS Information for: %s", "/%s") ),
14450    ])
14451    pkt.Reply(8)
14452    pkt.CompletionCodes([0x0000, 0x0102, 0x7902, 0x8000, 0x8101, 0x8401, 0x8501,
14453                         0x8701, 0x8c01, 0x8d00, 0x8e00, 0x8f00, 0x9001, 0x9600,
14454                         0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
14455    # 2222/5908, 89/08
14456    pkt = NCP(0x5908, "Delete a File or Subdirectory", 'enhanced', has_length=0)
14457    pkt.Request((27,280), [
14458            rec( 8, 1, NameSpace ),
14459            rec( 9, 1, Reserved ),
14460            rec( 10, 2, SearchAttributesLow ),
14461            rec( 12, 4, DirectoryBase ),
14462            rec( 16, 1, VolumeNumber ),
14463            rec( 17, 1, HandleFlag ),
14464    rec( 18, 1, DataTypeFlag ),
14465    rec( 19, 5, Reserved5 ),
14466            rec( 24, 1, PathCount, var="x" ),
14467            rec( 25, (2,255), Path16, repeat="x", info_str=(Path16, "Delete a File or Subdirectory: %s", "/%s") ),
14468    ])
14469    pkt.Reply(8)
14470    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
14471                         0x8701, 0x8900, 0x8a00, 0x8d00, 0x8e00, 0x8f00, 0x9001, 0x9600,
14472                         0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
14473    # 2222/5909, 89/09
14474    pkt = NCP(0x5909, "Set Short Directory Handle", 'enhanced', has_length=0)
14475    pkt.Request((27,280), [
14476            rec( 8, 1, NameSpace ),
14477            rec( 9, 1, DataStream ),
14478            rec( 10, 1, DestDirHandle ),
14479            rec( 11, 1, Reserved ),
14480            rec( 12, 4, DirectoryBase ),
14481            rec( 16, 1, VolumeNumber ),
14482            rec( 17, 1, HandleFlag ),
14483    rec( 18, 1, DataTypeFlag ),
14484    rec( 19, 5, Reserved5 ),
14485            rec( 24, 1, PathCount, var="x" ),
14486            rec( 25, (2,255), Path16, repeat="x", info_str=(Path16, "Set Short Directory Handle to: %s", "/%s") ),
14487    ])
14488    pkt.Reply(8)
14489    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
14490                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
14491                         0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
14492    # 2222/590A, 89/10
14493    pkt = NCP(0x590A, "Add Trustee Set to File or Subdirectory", 'enhanced', has_length=0)
14494    pkt.Request((37,290), [
14495            rec( 8, 1, NameSpace ),
14496            rec( 9, 1, Reserved ),
14497            rec( 10, 2, SearchAttributesLow ),
14498            rec( 12, 2, AccessRightsMaskWord ),
14499            rec( 14, 2, ObjectIDCount, var="y" ),
14500            rec( -1, 6, TrusteeStruct, repeat="y" ),
14501            rec( -1, 4, DirectoryBase ),
14502            rec( -1, 1, VolumeNumber ),
14503            rec( -1, 1, HandleFlag ),
14504    rec( -1, 1, DataTypeFlag ),
14505    rec( -1, 5, Reserved5 ),
14506            rec( -1, 1, PathCount, var="x" ),
14507            rec( -1, (2,255), Path16, repeat="x", info_str=(Path16, "Add Trustee Set to: %s", "/%s") ),
14508    ])
14509    pkt.Reply(8)
14510    pkt.CompletionCodes([0x0000, 0x0102, 0x8000, 0x8101, 0x8401, 0x8501,
14511                         0x8701, 0x8c01, 0x8d00, 0x8f00, 0x9001, 0x9600,
14512                         0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfc01, 0xfd00, 0xff16])
14513    # 2222/590B, 89/11
14514    pkt = NCP(0x590B, "Delete Trustee Set from File or SubDirectory", 'enhanced', has_length=0)
14515    pkt.Request((34,287), [
14516            rec( 8, 1, NameSpace ),
14517            rec( 9, 1, Reserved ),
14518            rec( 10, 2, ObjectIDCount, var="y" ),
14519            rec( 12, 7, TrusteeStruct, repeat="y" ),
14520            rec( 19, 4, DirectoryBase ),
14521            rec( 23, 1, VolumeNumber ),
14522            rec( 24, 1, HandleFlag ),
14523    rec( 25, 1, DataTypeFlag ),
14524    rec( 26, 5, Reserved5 ),
14525            rec( 31, 1, PathCount, var="x" ),
14526            rec( 32, (2,255), Path16, repeat="x", info_str=(Path16, "Delete Trustee Set from: %s", "/%s") ),
14527    ])
14528    pkt.Reply(8)
14529    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
14530                         0x8701, 0x8c01, 0x8d00, 0x8f00, 0x9001, 0x9600,
14531                         0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
14532    # 2222/590C, 89/12
14533    pkt = NCP(0x590C, "Allocate Short Directory Handle", 'enhanced', has_length=0)
14534    pkt.Request((27,280), [
14535            rec( 8, 1, NameSpace ),
14536            rec( 9, 1, DestNameSpace ),
14537            rec( 10, 2, AllocateMode ),
14538            rec( 12, 4, DirectoryBase ),
14539            rec( 16, 1, VolumeNumber ),
14540            rec( 17, 1, HandleFlag ),
14541    rec( 18, 1, DataTypeFlag ),
14542    rec( 19, 5, Reserved5 ),
14543            rec( 24, 1, PathCount, var="x" ),
14544            rec( 25, (2,255), Path16, repeat="x", info_str=(Path16, "Allocate Short Directory Handle to: %s", "/%s") ),
14545    ])
14546    pkt.Reply(NO_LENGTH_CHECK, [
14547    srec( ReplyLevel2Struct, req_cond="ncp.alloc_reply_lvl2 == TRUE" ),
14548            srec( ReplyLevel1Struct, req_cond="ncp.alloc_reply_lvl2 == FALSE" ),
14549    ])
14550    pkt.ReqCondSizeVariable()
14551    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
14552                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
14553                         0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
14554# 2222/5910, 89/16
14555    pkt = NCP(0x5910, "Scan Salvageable Files", 'enhanced', has_length=0)
14556    pkt.Request((33,286), [
14557            rec( 8, 1, NameSpace ),
14558            rec( 9, 1, DataStream ),
14559            rec( 10, 2, ReturnInfoMask ),
14560            rec( 12, 2, ExtendedInfo ),
14561            rec( 14, 4, SequenceNumber ),
14562            rec( 18, 4, DirectoryBase ),
14563            rec( 22, 1, VolumeNumber ),
14564            rec( 23, 1, HandleFlag ),
14565    rec( 24, 1, DataTypeFlag ),
14566    rec( 25, 5, Reserved5 ),
14567            rec( 30, 1, PathCount, var="x" ),
14568            rec( 31, (2,255), Path16, repeat="x", info_str=(Path16, "Scan for Deleted Files in: %s", "/%s") ),
14569    ])
14570    pkt.Reply(NO_LENGTH_CHECK, [
14571            rec( 8, 4, SequenceNumber ),
14572            rec( 12, 2, DeletedTime ),
14573            rec( 14, 2, DeletedDate ),
14574            rec( 16, 4, DeletedID, ENC_BIG_ENDIAN ),
14575            rec( 20, 4, VolumeID ),
14576            rec( 24, 4, DirectoryBase ),
14577            srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
14578            srec( PadDSSpaceAllocate, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
14579            srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
14580            srec( PadAttributes, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
14581            srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
14582            srec( PadDataStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
14583            srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
14584            srec( PadTotalStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
14585            srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
14586            srec( PadCreationInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
14587            srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
14588            srec( PadModifyInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
14589            srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
14590            srec( PadArchiveInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
14591            srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
14592            srec( PadRightsInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
14593            srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
14594            srec( PadDirEntry, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
14595            srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
14596            srec( PadEAInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
14597            srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
14598            srec( PadNSInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
14599            srec( FileName16Struct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_fname == 1)" ),
14600            srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc  == 1)" ),
14601            srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
14602            srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
14603            srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
14604            srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
14605            srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
14606            srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
14607            srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
14608            srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
14609            srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
14610            srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
14611            srec( ReferenceIDStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_id == 1)" ),
14612            srec( NSAttributeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns_attr == 1)" ),
14613            rec( -1, 4, DataStreamsCount, var="x" , req_cond="ncp.ret_info_mask_actual == 1"  ),
14614            srec( DStreamActual, repeat = "x" , req_cond="ncp.ret_info_mask_actual == 1" ),
14615            rec( -1, 4, DataStreamsCount, var="y", req_cond="ncp.ret_info_mask_logical == 1" ),
14616            srec( DStreamLogical, repeat="y" , req_cond="ncp.ret_info_mask_logical == 1" ),
14617            srec( LastUpdatedInSecondsStruct, req_cond="ncp.ext_info_update == 1" ),
14618            srec( FlushTimeStruct, req_cond="ncp.ext_info_flush == 1" ),
14619            srec( ParentBaseIDStruct, req_cond="ncp.ext_info_parental == 1" ),
14620            srec( MacFinderInfoStruct, req_cond="ncp.ext_info_mac_finder == 1" ),
14621            srec( SiblingCountStruct, req_cond="ncp.ext_info_sibling == 1" ),
14622            srec( EffectiveRightsStruct, req_cond="ncp.ext_info_effective == 1" ),
14623            srec( MacTimeStruct, req_cond="ncp.ext_info_mac_date == 1" ),
14624            srec( LastAccessedTimeStruct, req_cond="ncp.ext_info_access == 1" ),
14625            srec( DOSName16Struct, req_cond="ncp.ext_info_dos_name == 1" ),
14626            srec( FileSize64bitStruct, req_cond="ncp.ext_info_64_bit_fs == 1" ),
14627            srec( FileName16Struct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_fname == 1)" ),
14628    ])
14629    pkt.ReqCondSizeVariable()
14630    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
14631                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
14632                         0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
14633    # 2222/5911, 89/17
14634    pkt = NCP(0x5911, "Recover Salvageable File", 'enhanced', has_length=0)
14635    pkt.Request((24,278), [
14636            rec( 8, 1, NameSpace ),
14637            rec( 9, 1, Reserved ),
14638            rec( 10, 4, SequenceNumber ),
14639            rec( 14, 4, VolumeID ),
14640            rec( 18, 4, DirectoryBase ),
14641    rec( 22, 1, DataTypeFlag ),
14642            rec( 23, (1,255), FileName16, info_str=(FileName16, "Recover Deleted File: %s", ", %s") ),
14643    ])
14644    pkt.Reply(8)
14645    pkt.CompletionCodes([0x0000, 0x0102, 0x8000, 0x8101, 0x8401, 0x8501,
14646                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
14647                         0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
14648    # 2222/5913, 89/19
14649    pkt = NCP(0x5913, "Get Name Space Information", 'enhanced', has_length=0)
14650    pkt.Request(18, [
14651            rec( 8, 1, SrcNameSpace ),
14652            rec( 9, 1, DestNameSpace ),
14653            rec( 10, 1, DataTypeFlag ),
14654            rec( 11, 1, VolumeNumber ),
14655            rec( 12, 4, DirectoryBase ),
14656            rec( 16, 2, NamesSpaceInfoMask ),
14657    ])
14658    pkt.Reply(NO_LENGTH_CHECK, [
14659        srec( FileName16Struct, req_cond="ncp.ns_info_mask_modify == TRUE" ),
14660        srec( FileAttributesStruct, req_cond="ncp.ns_info_mask_fatt == TRUE" ),
14661        srec( CreationDateStruct, req_cond="ncp.ns_info_mask_cdate == TRUE" ),
14662        srec( CreationTimeStruct, req_cond="ncp.ns_info_mask_ctime == TRUE" ),
14663        srec( OwnerIDStruct, req_cond="ncp.ns_info_mask_owner == TRUE" ),
14664        srec( ArchiveDateStruct, req_cond="ncp.ns_info_mask_adate == TRUE" ),
14665        srec( ArchiveTimeStruct, req_cond="ncp.ns_info_mask_atime == TRUE" ),
14666        srec( ArchiveIdStruct, req_cond="ncp.ns_info_mask_aid == TRUE" ),
14667        srec( UpdateDateStruct, req_cond="ncp.ns_info_mask_udate == TRUE" ),
14668        srec( UpdateTimeStruct, req_cond="ncp.ns_info_mask_utime == TRUE" ),
14669        srec( UpdateIDStruct, req_cond="ncp.ns_info_mask_uid == TRUE" ),
14670        srec( LastAccessStruct, req_cond="ncp.ns_info_mask_acc_date == TRUE" ),
14671        srec( RightsInfoStruct, req_cond="ncp.ns_info_mask_max_acc_mask == TRUE" ),
14672    ])
14673    pkt.ReqCondSizeVariable()
14674    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
14675                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
14676                         0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
14677    # 2222/5914, 89/20
14678    pkt = NCP(0x5914, "Search for File or Subdirectory Set", 'enhanced', has_length=0)
14679    pkt.Request((28, 28), [
14680            rec( 8, 1, NameSpace  ),
14681            rec( 9, 1, DataStream ),
14682            rec( 10, 2, SearchAttributesLow ),
14683            rec( 12, 2, ReturnInfoMask ),
14684            rec( 14, 2, ExtendedInfo ),
14685            rec( 16, 2, ReturnInfoCount ),
14686            rec( 18, 9, SeachSequenceStruct ),
14687            rec( 27, 1, DataTypeFlag ),
14688            # next field is dissected in packet-ncp2222.inc
14689            #rec( 28, (2,255), SearchPattern16 ),
14690    ])
14691# The reply packet is dissected in packet-ncp2222.inc
14692    pkt.Reply(NO_LENGTH_CHECK, [
14693    ])
14694    pkt.ReqCondSizeVariable()
14695    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
14696                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
14697                         0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
14698    # 2222/5916, 89/22
14699    pkt = NCP(0x5916, "Generate Directory Base and Volume Number", 'enhanced', has_length=0)
14700    pkt.Request((27,280), [
14701            rec( 8, 1, SrcNameSpace ),
14702            rec( 9, 1, DestNameSpace ),
14703            rec( 10, 2, dstNSIndicator ),
14704            rec( 12, 4, DirectoryBase ),
14705            rec( 16, 1, VolumeNumber ),
14706            rec( 17, 1, HandleFlag ),
14707    rec( 18, 1, DataTypeFlag ),
14708    rec( 19, 5, Reserved5 ),
14709            rec( 24, 1, PathCount, var="x" ),
14710            rec( 25, (2,255), Path16, repeat="x", info_str=(Path16, "Get Volume and Directory Base from: %s", "/%s") ),
14711    ])
14712    pkt.Reply(17, [
14713            rec( 8, 4, DirectoryBase ),
14714            rec( 12, 4, DOSDirectoryBase ),
14715            rec( 16, 1, VolumeNumber ),
14716    ])
14717    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
14718                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
14719                         0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
14720    # 2222/5919, 89/25
14721    pkt = NCP(0x5919, "Set Name Space Information", 'enhanced', has_length=0)
14722    pkt.Request(530, [
14723            rec( 8, 1, SrcNameSpace ),
14724            rec( 9, 1, DestNameSpace ),
14725            rec( 10, 1, VolumeNumber ),
14726            rec( 11, 4, DirectoryBase ),
14727            rec( 15, 2, NamesSpaceInfoMask ),
14728    rec( 17, 1, DataTypeFlag ),
14729            rec( 18, 512, NSSpecificInfo ),
14730    ])
14731    pkt.Reply(8)
14732    pkt.CompletionCodes([0x0000, 0x0102, 0x8000, 0x8101, 0x8401, 0x8501,
14733                         0x8701, 0x8b00, 0x8d00, 0x8f00, 0x9001,
14734                         0x9600, 0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00,
14735                         0xff16])
14736    # 2222/591C, 89/28
14737    pkt = NCP(0x591C, "Get Full Path String", 'enhanced', has_length=0)
14738    pkt.Request((35,288), [
14739            rec( 8, 1, SrcNameSpace ),
14740            rec( 9, 1, DestNameSpace ),
14741            rec( 10, 2, PathCookieFlags ),
14742            rec( 12, 4, Cookie1 ),
14743            rec( 16, 4, Cookie2 ),
14744            rec( 20, 4, DirectoryBase ),
14745            rec( 24, 1, VolumeNumber ),
14746            rec( 25, 1, HandleFlag ),
14747    rec( 26, 1, DataTypeFlag ),
14748    rec( 27, 5, Reserved5 ),
14749            rec( 32, 1, PathCount, var="x" ),
14750            rec( 33, (2,255), Path16, repeat="x", info_str=(Path16, "Get Full Path from: %s", "/%s") ),
14751    ])
14752    pkt.Reply((24,277), [
14753            rec( 8, 2, PathCookieFlags ),
14754            rec( 10, 4, Cookie1 ),
14755            rec( 14, 4, Cookie2 ),
14756            rec( 18, 2, PathComponentSize ),
14757            rec( 20, 2, PathComponentCount, var='x' ),
14758            rec( 22, (2,255), Path16, repeat='x' ),
14759    ])
14760    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
14761                         0x8701, 0x8b00, 0x8d00, 0x8f00, 0x9001,
14762                         0x9600, 0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00,
14763                         0xff16])
14764    # 2222/591D, 89/29
14765    pkt = NCP(0x591D, "Get Effective Directory Rights", 'enhanced', has_length=0)
14766    pkt.Request((31, 284), [
14767            rec( 8, 1, NameSpace  ),
14768            rec( 9, 1, DestNameSpace ),
14769            rec( 10, 2, SearchAttributesLow ),
14770            rec( 12, 2, ReturnInfoMask ),
14771            rec( 14, 2, ExtendedInfo ),
14772            rec( 16, 4, DirectoryBase ),
14773            rec( 20, 1, VolumeNumber ),
14774            rec( 21, 1, HandleFlag ),
14775    rec( 22, 1, DataTypeFlag ),
14776    rec( 23, 5, Reserved5 ),
14777            rec( 28, 1, PathCount, var="x" ),
14778            rec( 29, (2,255), Path16, repeat="x", info_str=(Path16, "Get Effective Rights for: %s", "/%s") ),
14779    ])
14780    pkt.Reply(NO_LENGTH_CHECK, [
14781            rec( 8, 2, EffectiveRights, ENC_LITTLE_ENDIAN ),
14782            srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
14783            srec( PadDSSpaceAllocate, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
14784            srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
14785            srec( PadAttributes, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
14786            srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
14787            srec( PadDataStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
14788            srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
14789            srec( PadTotalStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
14790            srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
14791            srec( PadCreationInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
14792            srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
14793            srec( PadModifyInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
14794            srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
14795            srec( PadArchiveInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
14796            srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
14797            srec( PadRightsInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
14798            srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
14799            srec( PadDirEntry, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
14800            srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
14801            srec( PadEAInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
14802            srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
14803            srec( PadNSInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
14804            srec( FileName16Struct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_fname == 1)" ),
14805            srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc  == 1)" ),
14806            srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
14807            srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
14808            srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
14809            srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
14810            srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
14811            srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
14812            srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
14813            srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
14814            srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
14815            srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
14816            srec( FileSize64bitStruct, req_cond="(ncp.ext_info_64_bit_fs == 1) && (ncp.ret_info_mask_fname == 1)" ),
14817            srec( FileName16Struct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_fname == 1)" ),
14818    ])
14819    pkt.ReqCondSizeVariable()
14820    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
14821                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
14822                         0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
14823    # 2222/591E, 89/30
14824    pkt = NCP(0x591E, "Open/Create File or Subdirectory", 'enhanced', has_length=0)
14825    pkt.Request((41, 294), [
14826            rec( 8, 1, NameSpace  ),
14827            rec( 9, 1, DataStream ),
14828            rec( 10, 1, OpenCreateMode ),
14829            rec( 11, 1, Reserved ),
14830            rec( 12, 2, SearchAttributesLow ),
14831            rec( 14, 2, Reserved2 ),
14832            rec( 16, 2, ReturnInfoMask ),
14833            rec( 18, 2, ExtendedInfo ),
14834            rec( 20, 4, AttributesDef32 ),
14835            rec( 24, 2, DesiredAccessRights ),
14836            rec( 26, 4, DirectoryBase ),
14837            rec( 30, 1, VolumeNumber ),
14838            rec( 31, 1, HandleFlag ),
14839    rec( 32, 1, DataTypeFlag ),
14840    rec( 33, 5, Reserved5 ),
14841            rec( 38, 1, PathCount, var="x" ),
14842            rec( 39, (2,255), Path16, repeat="x", info_str=(Path16, "Open or Create File: %s", "/%s") ),
14843    ])
14844    pkt.Reply(NO_LENGTH_CHECK, [
14845            rec( 8, 4, FileHandle, ENC_BIG_ENDIAN ),
14846            rec( 12, 1, OpenCreateAction ),
14847            rec( 13, 1, Reserved ),
14848            srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
14849            srec( PadDSSpaceAllocate, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
14850            srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
14851            srec( PadAttributes, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
14852            srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
14853            srec( PadDataStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
14854            srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
14855            srec( PadTotalStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
14856            srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
14857            srec( PadCreationInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
14858            srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
14859            srec( PadModifyInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
14860            srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
14861            srec( PadArchiveInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
14862            srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
14863            srec( PadRightsInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
14864            srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
14865            srec( PadDirEntry, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
14866            srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
14867            srec( PadEAInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
14868            srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
14869            srec( PadNSInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
14870            srec( FileName16Struct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_fname == 1)" ),
14871            srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc  == 1)" ),
14872            srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
14873            srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
14874            srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
14875            srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
14876            srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
14877            srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
14878            srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
14879            srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
14880            srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
14881            srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
14882            srec( FileSize64bitStruct, req_cond="(ncp.ext_info_64_bit_fs == 1) && (ncp.ret_info_mask_fname == 1)" ),
14883            srec( FileName16Struct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_fname == 1)" ),
14884    ])
14885    pkt.ReqCondSizeVariable()
14886    pkt.CompletionCodes([0x0000, 0x0102, 0x8000, 0x8101, 0x8401, 0x8501,
14887                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
14888                         0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
14889    pkt.MakeExpert("file_rights")
14890    # 2222/5920, 89/32
14891    pkt = NCP(0x5920, "Open/Create File or Subdirectory with Callback", 'enhanced', has_length=0)
14892    pkt.Request((37, 290), [
14893            rec( 8, 1, NameSpace  ),
14894            rec( 9, 1, OpenCreateMode ),
14895            rec( 10, 2, SearchAttributesLow ),
14896            rec( 12, 2, ReturnInfoMask ),
14897            rec( 14, 2, ExtendedInfo ),
14898            rec( 16, 4, AttributesDef32 ),
14899            rec( 20, 2, DesiredAccessRights ),
14900            rec( 22, 4, DirectoryBase ),
14901            rec( 26, 1, VolumeNumber ),
14902            rec( 27, 1, HandleFlag ),
14903    rec( 28, 1, DataTypeFlag ),
14904    rec( 29, 5, Reserved5 ),
14905            rec( 34, 1, PathCount, var="x" ),
14906            rec( 35, (2,255), Path16, repeat="x", info_str=(Path16, "Open or Create with Op-Lock: %s", "/%s") ),
14907    ])
14908    pkt.Reply( NO_LENGTH_CHECK, [
14909            rec( 8, 4, FileHandle, ENC_BIG_ENDIAN ),
14910            rec( 12, 1, OpenCreateAction ),
14911            rec( 13, 1, OCRetFlags ),
14912            srec( DSSpaceAllocateStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
14913            srec( PadDSSpaceAllocate, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
14914            srec( AttributesStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
14915            srec( PadAttributes, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
14916            srec( DataStreamSizeStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
14917            srec( PadDataStreamSize, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
14918            srec( TotalStreamSizeStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
14919            srec( PadTotalStreamSize, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
14920            srec( CreationInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
14921            srec( PadCreationInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
14922            srec( ModifyInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
14923            srec( PadModifyInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
14924            srec( ArchiveInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
14925            srec( PadArchiveInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
14926            srec( RightsInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
14927            srec( PadRightsInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
14928            srec( DirEntryStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
14929            srec( PadDirEntry, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
14930            srec( EAInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
14931            srec( PadEAInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
14932            srec( NSInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
14933            srec( PadNSInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
14934            srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc  == 1)" ),
14935            srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
14936            srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
14937            srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
14938            srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
14939            srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
14940            srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
14941            srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
14942            srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
14943            srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
14944            srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
14945            srec( ReferenceIDStruct, req_cond="ncp.ret_info_mask_id == 1" ),
14946            srec( NSAttributeStruct, req_cond="ncp.ret_info_mask_ns_attr == 1" ),
14947            rec( -1, 4, DataStreamsCount, var="x" , req_cond="ncp.ret_info_mask_actual == 1"  ),
14948            srec( DStreamActual, repeat = "x" , req_cond="ncp.ret_info_mask_actual == 1" ),
14949            rec( -1, 4, DataStreamsCount, var="y", req_cond="ncp.ret_info_mask_logical == 1" ),
14950            srec( DStreamLogical, repeat="y" , req_cond="ncp.ret_info_mask_logical == 1" ),
14951            srec( LastUpdatedInSecondsStruct, req_cond="ncp.ext_info_update == 1" ),
14952            srec( DOSName16Struct, req_cond="ncp.ext_info_dos_name == 1" ),
14953            srec( FlushTimeStruct, req_cond="ncp.ext_info_flush == 1" ),
14954            srec( ParentBaseIDStruct, req_cond="ncp.ext_info_parental == 1" ),
14955            srec( MacFinderInfoStruct, req_cond="ncp.ext_info_mac_finder == 1" ),
14956            srec( SiblingCountStruct, req_cond="ncp.ext_info_sibling == 1" ),
14957            srec( EffectiveRightsStruct, req_cond="ncp.ext_info_effective == 1" ),
14958            srec( MacTimeStruct, req_cond="ncp.ext_info_mac_date == 1" ),
14959            srec( LastAccessedTimeStruct, req_cond="ncp.ext_info_access == 1" ),
14960            srec( FileSize64bitStruct, req_cond="ncp.ext_info_64_bit_fs == 1" ),
14961            srec( FileName16Struct, req_cond="ncp.ret_info_mask_fname == 1" ),
14962    ])
14963    pkt.ReqCondSizeVariable()
14964    pkt.CompletionCodes([0x0000, 0x0102, 0x7f00, 0x8000, 0x8101, 0x8401, 0x8501,
14965                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9400, 0x9600,
14966                         0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
14967    pkt.MakeExpert("file_rights")
14968    # 2222/5921, 89/33
14969    pkt = NCP(0x5921, "Open/Create File or Subdirectory II with Callback", 'enhanced', has_length=0)
14970    pkt.Request((41, 294), [
14971            rec( 8, 1, NameSpace  ),
14972            rec( 9, 1, DataStream ),
14973            rec( 10, 1, OpenCreateMode ),
14974            rec( 11, 1, Reserved ),
14975            rec( 12, 2, SearchAttributesLow ),
14976            rec( 14, 2, Reserved2 ),
14977            rec( 16, 2, ReturnInfoMask ),
14978            rec( 18, 2, ExtendedInfo ),
14979            rec( 20, 4, AttributesDef32 ),
14980            rec( 24, 2, DesiredAccessRights ),
14981            rec( 26, 4, DirectoryBase ),
14982            rec( 30, 1, VolumeNumber ),
14983            rec( 31, 1, HandleFlag ),
14984    rec( 32, 1, DataTypeFlag ),
14985    rec( 33, 5, Reserved5 ),
14986            rec( 38, 1, PathCount, var="x" ),
14987            rec( 39, (2,255), Path16, repeat="x", info_str=(Path16, "Open or Create II with Op-Lock: %s", "/%s") ),
14988    ])
14989    pkt.Reply( NO_LENGTH_CHECK, [
14990            rec( 8, 4, FileHandle ),
14991            rec( 12, 1, OpenCreateAction ),
14992            rec( 13, 1, OCRetFlags ),
14993            srec( DSSpaceAllocateStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
14994            srec( PadDSSpaceAllocate, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
14995            srec( AttributesStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
14996            srec( PadAttributes, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
14997            srec( DataStreamSizeStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
14998            srec( PadDataStreamSize, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
14999            srec( TotalStreamSizeStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
15000            srec( PadTotalStreamSize, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
15001            srec( CreationInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
15002            srec( PadCreationInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
15003            srec( ModifyInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
15004            srec( PadModifyInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
15005            srec( ArchiveInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
15006            srec( PadArchiveInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
15007            srec( RightsInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
15008            srec( PadRightsInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
15009            srec( DirEntryStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
15010            srec( PadDirEntry, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
15011            srec( EAInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
15012            srec( PadEAInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
15013            srec( NSInfoStruct, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
15014            srec( PadNSInfo, req_cond="(ncp.ret_info_mask != 0x0000) && (ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
15015            srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc  == 1)" ),
15016            srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
15017            srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
15018            srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
15019            srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
15020            srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
15021            srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
15022            srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
15023            srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
15024            srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
15025            srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
15026            srec( ReferenceIDStruct, req_cond="ncp.ret_info_mask_id == 1" ),
15027            srec( NSAttributeStruct, req_cond="ncp.ret_info_mask_ns_attr == 1" ),
15028            rec( -1, 4, DataStreamsCount, var="x" , req_cond="ncp.ret_info_mask_actual == 1"  ),
15029            srec( DStreamActual, repeat = "x" , req_cond="ncp.ret_info_mask_actual == 1" ),
15030            rec( -1, 4, DataStreamsCount, var="y", req_cond="ncp.ret_info_mask_logical == 1" ),
15031            srec( DStreamLogical, repeat="y" , req_cond="ncp.ret_info_mask_logical == 1" ),
15032            srec( LastUpdatedInSecondsStruct, req_cond="ncp.ext_info_update == 1" ),
15033            srec( DOSName16Struct, req_cond="ncp.ext_info_dos_name == 1" ),
15034            srec( FlushTimeStruct, req_cond="ncp.ext_info_flush == 1" ),
15035            srec( ParentBaseIDStruct, req_cond="ncp.ext_info_parental == 1" ),
15036            srec( MacFinderInfoStruct, req_cond="ncp.ext_info_mac_finder == 1" ),
15037            srec( SiblingCountStruct, req_cond="ncp.ext_info_sibling == 1" ),
15038            srec( EffectiveRightsStruct, req_cond="ncp.ext_info_effective == 1" ),
15039            srec( MacTimeStruct, req_cond="ncp.ext_info_mac_date == 1" ),
15040            srec( LastAccessedTimeStruct, req_cond="ncp.ext_info_access == 1" ),
15041            srec( FileSize64bitStruct, req_cond="ncp.ext_info_64_bit_fs == 1" ),
15042            srec( FileName16Struct, req_cond="ncp.ret_info_mask_fname == 1" ),
15043    ])
15044    pkt.ReqCondSizeVariable()
15045    pkt.CompletionCodes([0x0000, 0x0102, 0x8000, 0x8101, 0x8401, 0x8501,
15046                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
15047                         0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
15048    pkt.MakeExpert("file_rights")
15049    # 2222/5923, 89/35
15050    pkt = NCP(0x5923, "Modify DOS Attributes on a File or Subdirectory", 'enhanced', has_length=0)
15051    pkt.Request((35, 288), [
15052            rec( 8, 1, NameSpace  ),
15053            rec( 9, 1, Flags ),
15054            rec( 10, 2, SearchAttributesLow ),
15055            rec( 12, 2, ReturnInfoMask ),
15056            rec( 14, 2, ExtendedInfo ),
15057            rec( 16, 4, AttributesDef32 ),
15058            rec( 20, 4, DirectoryBase ),
15059            rec( 24, 1, VolumeNumber ),
15060            rec( 25, 1, HandleFlag ),
15061    rec( 26, 1, DataTypeFlag ),
15062    rec( 27, 5, Reserved5 ),
15063            rec( 32, 1, PathCount, var="x" ),
15064            rec( 33, (2,255), Path16, repeat="x", info_str=(Path16, "Modify DOS Attributes for: %s", "/%s") ),
15065    ])
15066    pkt.Reply(24, [
15067            rec( 8, 4, ItemsChecked ),
15068            rec( 12, 4, ItemsChanged ),
15069            rec( 16, 4, AttributeValidFlag ),
15070            rec( 20, 4, AttributesDef32 ),
15071    ])
15072    pkt.CompletionCodes([0x0000, 0x0102, 0x8000, 0x8101, 0x8401, 0x8501,
15073                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
15074                         0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
15075    # 2222/5927, 89/39
15076    pkt = NCP(0x5927, "Get Directory Disk Space Restriction", 'enhanced', has_length=0)
15077    pkt.Request((26, 279), [
15078            rec( 8, 1, NameSpace  ),
15079            rec( 9, 2, Reserved2 ),
15080            rec( 11, 4, DirectoryBase ),
15081            rec( 15, 1, VolumeNumber ),
15082            rec( 16, 1, HandleFlag ),
15083            rec( 17, 1, DataTypeFlag ),
15084            rec( 18, 5, Reserved5 ),
15085            rec( 23, 1, PathCount, var="x" ),
15086            rec( 24, (2,255), Path16, repeat="x", info_str=(Path16, "Get Disk Space Restriction for: %s", "/%s") ),
15087    ])
15088    pkt.Reply(18, [
15089            rec( 8, 1, NumberOfEntries, var="x" ),
15090            rec( 9, 9, SpaceStruct, repeat="x" ),
15091    ])
15092    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
15093                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
15094                         0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00,
15095                         0xff16])
15096    # 2222/5928, 89/40
15097    pkt = NCP(0x5928, "Search for File or Subdirectory Set (Extended Errors)", 'enhanced', has_length=0)
15098    pkt.Request((30, 283), [
15099            rec( 8, 1, NameSpace  ),
15100            rec( 9, 1, DataStream ),
15101            rec( 10, 2, SearchAttributesLow ),
15102            rec( 12, 2, ReturnInfoMask ),
15103            rec( 14, 2, ExtendedInfo ),
15104            rec( 16, 2, ReturnInfoCount ),
15105            rec( 18, 9, SeachSequenceStruct ),
15106    rec( 27, 1, DataTypeFlag ),
15107            rec( 28, (2,255), SearchPattern16, info_str=(SearchPattern16, "Search for: %s", ", %s") ),
15108    ])
15109    pkt.Reply(NO_LENGTH_CHECK, [
15110            rec( 8, 9, SeachSequenceStruct ),
15111            rec( 17, 1, MoreFlag ),
15112            rec( 18, 2, InfoCount ),
15113            srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 1)" ),
15114            srec( PadDSSpaceAllocate, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_alloc == 0)" ),
15115            srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 1)" ),
15116            srec( PadAttributes, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_attr == 0)" ),
15117            srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 1)" ),
15118            srec( PadDataStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_size == 0)" ),
15119            srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 1)" ),
15120            srec( PadTotalStreamSize, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_tspace == 0)" ),
15121            srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 1)" ),
15122            srec( PadCreationInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_create == 0)" ),
15123            srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 1)" ),
15124            srec( PadModifyInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_mod == 0)" ),
15125            srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 1)" ),
15126            srec( PadArchiveInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_arch == 0)" ),
15127            srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 1)" ),
15128            srec( PadRightsInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_rights == 0)" ),
15129            srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 1)" ),
15130            srec( PadDirEntry, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_dir == 0)" ),
15131            srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 1)" ),
15132            srec( PadEAInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_eattr == 0)" ),
15133            srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 1)" ),
15134            srec( PadNSInfo, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_ns == 0)" ),
15135            srec( FileName16Struct, req_cond="(ncp.ext_info_newstyle == 0) && (ncp.ret_info_mask_fname == 1)" ),
15136            srec( DSSpaceAllocateStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_alloc  == 1)" ),
15137            srec( AttributesStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_attr == 1)" ),
15138            srec( DataStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_size == 1)" ),
15139            srec( TotalStreamSizeStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_tspace == 1)" ),
15140            srec( CreationInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_create == 1)" ),
15141            srec( ModifyInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_mod == 1)" ),
15142            srec( ArchiveInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_arch == 1)" ),
15143            srec( RightsInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_rights == 1)" ),
15144            srec( DirEntryStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_dir == 1)" ),
15145            srec( EAInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_eattr == 1)" ),
15146            srec( NSInfoStruct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_ns == 1)" ),
15147            srec( FileSize64bitStruct, req_cond="(ncp.ext_info_64_bit_fs == 1) && (ncp.ret_info_mask_fname == 1)" ),
15148            srec( FileName16Struct, req_cond="(ncp.ext_info_newstyle == 1) && (ncp.ret_info_mask_fname == 1)" ),
15149    ])
15150    pkt.ReqCondSizeVariable()
15151    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
15152                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
15153                         0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
15154    # 2222/5929, 89/41
15155    pkt = NCP(0x5929, "Get Directory Disk Space Restriction 64 Bit Aware", 'enhanced', has_length=0)
15156    pkt.Request((26, 279), [
15157            rec( 8, 1, NameSpace  ),
15158            rec( 9, 1, Reserved ),
15159            rec( 10, 1, InfoLevelNumber),
15160            rec( 11, 4, DirectoryBase ),
15161            rec( 15, 1, VolumeNumber ),
15162            rec( 16, 1, HandleFlag ),
15163    rec( 17, 1, DataTypeFlag ),
15164    rec( 18, 5, Reserved5 ),
15165            rec( 23, 1, PathCount, var="x" ),
15166            rec( 24, (2,255), Path16, repeat="x", info_str=(Path16, "Get Disk Space Restriction for: %s", "/%s") ),
15167    ])
15168    pkt.Reply(NO_LENGTH_CHECK, [
15169            rec( -1, 8, MaxSpace64, req_cond = "(ncp.info_level_num == 0)" ),
15170            rec( -1, 8, MinSpaceLeft64, req_cond = "(ncp.info_level_num == 0)" ),
15171            rec( -1, 1, NumberOfEntries, var="x", req_cond = "(ncp.info_level_num == 1)" ),
15172            srec( DirDiskSpaceRest64bit, repeat="x", req_cond = "(ncp.info_level_num == 1)" ),
15173    ])
15174    pkt.ReqCondSizeVariable()
15175    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
15176                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
15177                         0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00,
15178                         0xff16])
15179    # 2222/5932, 89/50
15180    pkt = NCP(0x5932, "Get Object Effective Rights", "enhanced", has_length=0)
15181    pkt.Request(25, [
15182rec( 8, 1, NameSpace ),
15183rec( 9, 4, ObjectID ),
15184            rec( 13, 4, DirectoryBase ),
15185            rec( 17, 1, VolumeNumber ),
15186            rec( 18, 1, HandleFlag ),
15187    rec( 19, 1, DataTypeFlag ),
15188    rec( 20, 5, Reserved5 ),
15189])
15190    pkt.Reply( 10, [
15191            rec( 8, 2, TrusteeRights ),
15192    ])
15193    pkt.CompletionCodes([0x0000, 0x7e01, 0x9b00, 0x9c03, 0xa901, 0xaa00])
15194    # 2222/5934, 89/52
15195    pkt = NCP(0x5934, "Write Extended Attribute", 'enhanced', has_length=0 )
15196    pkt.Request((36,98), [
15197            rec( 8, 2, EAFlags ),
15198            rec( 10, 4, EAHandleOrNetWareHandleOrVolume ),
15199            rec( 14, 4, ReservedOrDirectoryNumber ),
15200            rec( 18, 4, TtlWriteDataSize ),
15201            rec( 22, 4, FileOffset ),
15202            rec( 26, 4, EAAccessFlag ),
15203            rec( 30, 1, DataTypeFlag ),
15204            rec( 31, 2, EAValueLength, var='x' ),
15205            rec( 33, (2,64), EAKey, info_str=(EAKey, "Write Extended Attribute: %s", ", %s") ),
15206            rec( -1, 1, EAValueRep, repeat='x' ),
15207    ])
15208    pkt.Reply(20, [
15209            rec( 8, 4, EAErrorCodes ),
15210            rec( 12, 4, EABytesWritten ),
15211            rec( 16, 4, NewEAHandle ),
15212    ])
15213    pkt.CompletionCodes([0x0000, 0xc800, 0xc900, 0xcb00, 0xce00, 0xcf00, 0xd101,
15214                         0xd203, 0xa901, 0xaa00, 0xd301, 0xd402])
15215    # 2222/5935, 89/53
15216    pkt = NCP(0x5935, "Read Extended Attribute", 'enhanced', has_length=0 )
15217    pkt.Request((31,541), [
15218            rec( 8, 2, EAFlags ),
15219            rec( 10, 4, EAHandleOrNetWareHandleOrVolume ),
15220            rec( 14, 4, ReservedOrDirectoryNumber ),
15221            rec( 18, 4, FileOffset ),
15222            rec( 22, 4, InspectSize ),
15223            rec( 26, 1, DataTypeFlag ),
15224            rec( 27, 2, MaxReadDataReplySize ),
15225            rec( 29, (2,512), EAKey, info_str=(EAKey, "Read Extended Attribute: %s", ", %s") ),
15226    ])
15227    pkt.Reply((26,536), [
15228            rec( 8, 4, EAErrorCodes ),
15229            rec( 12, 4, TtlValuesLength ),
15230            rec( 16, 4, NewEAHandle ),
15231            rec( 20, 4, EAAccessFlag ),
15232            rec( 24, (2,512), EAValue ),
15233    ])
15234    pkt.CompletionCodes([0x0000, 0xa901, 0xaa00, 0xc900, 0xce00, 0xcf00, 0xd101,
15235                         0xd301])
15236    # 2222/5936, 89/54
15237    pkt = NCP(0x5936, "Enumerate Extended Attribute", 'enhanced', has_length=0 )
15238    pkt.Request((27,537), [
15239            rec( 8, 2, EAFlags ),
15240            rec( 10, 4, EAHandleOrNetWareHandleOrVolume ),
15241            rec( 14, 4, ReservedOrDirectoryNumber ),
15242            rec( 18, 4, InspectSize ),
15243            rec( 22, 2, SequenceNumber ),
15244    rec( 24, 1, DataTypeFlag ),
15245            rec( 25, (2,512), EAKey, info_str=(EAKey, "Enumerate Extended Attribute: %s", ", %s") ),
15246    ])
15247    pkt.Reply(28, [
15248            rec( 8, 4, EAErrorCodes ),
15249            rec( 12, 4, TtlEAs ),
15250            rec( 16, 4, TtlEAsDataSize ),
15251            rec( 20, 4, TtlEAsKeySize ),
15252            rec( 24, 4, NewEAHandle ),
15253    ])
15254    pkt.CompletionCodes([0x0000, 0x8800, 0xa901, 0xaa00, 0xc900, 0xce00, 0xcf00, 0xd101,
15255                         0xd301])
15256    # 2222/5947, 89/71
15257    pkt = NCP(0x5947, "Scan Volume Trustee Object Paths", 'enhanced', has_length=0)
15258    pkt.Request(21, [
15259            rec( 8, 4, VolumeID  ),
15260            rec( 12, 4, ObjectID ),
15261            rec( 16, 4, SequenceNumber ),
15262            rec( 20, 1, DataTypeFlag ),
15263    ])
15264    pkt.Reply((20,273), [
15265            rec( 8, 4, SequenceNumber ),
15266            rec( 12, 4, ObjectID ),
15267            rec( 16, 1, TrusteeAccessMask ),
15268            rec( 17, 1, PathCount, var="x" ),
15269            rec( 18, (2,255), Path16, repeat="x" ),
15270    ])
15271    pkt.CompletionCodes([0x0000, 0x8000, 0x8101, 0x8401, 0x8501,
15272                         0x8701, 0x8d00, 0x8f00, 0x9001, 0x9600,
15273                         0x9804, 0x9b03, 0x9c03, 0xa901, 0xaa00, 0xbf00, 0xfd00, 0xff16])
15274    # 2222/5A01, 90/00
15275    pkt = NCP(0x5A00, "Parse Tree", 'file')
15276    pkt.Request(46, [
15277            rec( 10, 4, InfoMask ),
15278            rec( 14, 4, Reserved4 ),
15279            rec( 18, 4, Reserved4 ),
15280            rec( 22, 4, limbCount ),
15281            rec( 26, 4, limbFlags ),
15282            rec( 30, 4, VolumeNumberLong ),
15283            rec( 34, 4, DirectoryBase ),
15284            rec( 38, 4, limbScanNum ),
15285            rec( 42, 4, NameSpace ),
15286    ])
15287    pkt.Reply(32, [
15288            rec( 8, 4, limbCount ),
15289            rec( 12, 4, ItemsCount ),
15290            rec( 16, 4, nextLimbScanNum ),
15291            rec( 20, 4, CompletionCode ),
15292            rec( 24, 1, FolderFlag ),
15293            rec( 25, 3, Reserved ),
15294            rec( 28, 4, DirectoryBase ),
15295    ])
15296    pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
15297                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
15298                         0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
15299    # 2222/5A0A, 90/10
15300    pkt = NCP(0x5A0A, "Get Reference Count from Dir Entry Number", 'file')
15301    pkt.Request(19, [
15302            rec( 10, 4, VolumeNumberLong ),
15303            rec( 14, 4, DirectoryBase ),
15304            rec( 18, 1, NameSpace ),
15305    ])
15306    pkt.Reply(12, [
15307            rec( 8, 4, ReferenceCount ),
15308    ])
15309    pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
15310                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
15311                         0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
15312    # 2222/5A0B, 90/11
15313    pkt = NCP(0x5A0B, "Get Reference Count from Dir Handle", 'file')
15314    pkt.Request(14, [
15315            rec( 10, 4, DirHandle ),
15316    ])
15317    pkt.Reply(12, [
15318            rec( 8, 4, ReferenceCount ),
15319    ])
15320    pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
15321                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
15322                         0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
15323    # 2222/5A0C, 90/12
15324    pkt = NCP(0x5A0C, "Set Compressed File Size", 'file')
15325    pkt.Request(20, [
15326            rec( 10, 6, FileHandle ),
15327            rec( 16, 4, SuggestedFileSize ),
15328    ])
15329    pkt.Reply(16, [
15330            rec( 8, 4, OldFileSize ),
15331            rec( 12, 4, NewFileSize ),
15332    ])
15333    pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
15334                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
15335                         0x9804, 0x9b03, 0x9c03, 0xfd00, 0xff16])
15336    # 2222/5A80, 90/128
15337    pkt = NCP(0x5A80, "Move File Data To Data Migration", 'migration')
15338    pkt.Request(27, [
15339            rec( 10, 4, VolumeNumberLong ),
15340            rec( 14, 4, DirectoryEntryNumber ),
15341            rec( 18, 1, NameSpace ),
15342            rec( 19, 3, Reserved ),
15343            rec( 22, 4, SupportModuleID ),
15344            rec( 26, 1, DMFlags ),
15345    ])
15346    pkt.Reply(8)
15347    pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
15348                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
15349                         0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
15350    # 2222/5A81, 90/129
15351    pkt = NCP(0x5A81, "Data Migration File Information", 'migration')
15352    pkt.Request(19, [
15353            rec( 10, 4, VolumeNumberLong ),
15354            rec( 14, 4, DirectoryEntryNumber ),
15355            rec( 18, 1, NameSpace ),
15356    ])
15357    pkt.Reply(24, [
15358            rec( 8, 4, SupportModuleID ),
15359            rec( 12, 4, RestoreTime ),
15360            rec( 16, 4, DMInfoEntries, var="x" ),
15361            rec( 20, 4, DataSize, repeat="x" ),
15362    ])
15363    pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
15364                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
15365                         0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
15366    # 2222/5A82, 90/130
15367    pkt = NCP(0x5A82, "Volume Data Migration Status", 'migration')
15368    pkt.Request(18, [
15369            rec( 10, 4, VolumeNumberLong ),
15370            rec( 14, 4, SupportModuleID ),
15371    ])
15372    pkt.Reply(32, [
15373            rec( 8, 4, NumOfFilesMigrated ),
15374            rec( 12, 4, TtlMigratedSize ),
15375            rec( 16, 4, SpaceUsed ),
15376            rec( 20, 4, LimboUsed ),
15377            rec( 24, 4, SpaceMigrated ),
15378            rec( 28, 4, FileLimbo ),
15379    ])
15380    pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
15381                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
15382                         0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
15383    # 2222/5A83, 90/131
15384    pkt = NCP(0x5A83, "Migrator Status Info", 'migration')
15385    pkt.Request(10)
15386    pkt.Reply(20, [
15387            rec( 8, 1, DMPresentFlag ),
15388            rec( 9, 3, Reserved3 ),
15389            rec( 12, 4, DMmajorVersion ),
15390            rec( 16, 4, DMminorVersion ),
15391    ])
15392    pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
15393                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
15394                         0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
15395    # 2222/5A84, 90/132
15396    pkt = NCP(0x5A84, "Data Migration Support Module Information", 'migration')
15397    pkt.Request(18, [
15398            rec( 10, 1, DMInfoLevel ),
15399            rec( 11, 3, Reserved3),
15400            rec( 14, 4, SupportModuleID ),
15401    ])
15402    pkt.Reply(NO_LENGTH_CHECK, [
15403            srec( DMInfoLevel0, req_cond="ncp.dm_info_level == 0x00" ),
15404            srec( DMInfoLevel1, req_cond="ncp.dm_info_level == 0x01" ),
15405            srec( DMInfoLevel2, req_cond="ncp.dm_info_level == 0x02" ),
15406    ])
15407    pkt.ReqCondSizeVariable()
15408    pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
15409                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
15410                         0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
15411    # 2222/5A85, 90/133
15412    pkt = NCP(0x5A85, "Move File Data From Data Migration", 'migration')
15413    pkt.Request(19, [
15414            rec( 10, 4, VolumeNumberLong ),
15415            rec( 14, 4, DirectoryEntryNumber ),
15416            rec( 18, 1, NameSpace ),
15417    ])
15418    pkt.Reply(8)
15419    pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
15420                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
15421                         0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
15422    # 2222/5A86, 90/134
15423    pkt = NCP(0x5A86, "Get/Set Default Read-Write Support Module ID", 'migration')
15424    pkt.Request(18, [
15425            rec( 10, 1, GetSetFlag ),
15426            rec( 11, 3, Reserved3 ),
15427            rec( 14, 4, SupportModuleID ),
15428    ])
15429    pkt.Reply(12, [
15430            rec( 8, 4, SupportModuleID ),
15431    ])
15432    pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
15433                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
15434                         0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
15435    # 2222/5A87, 90/135
15436    pkt = NCP(0x5A87, "Data Migration Support Module Capacity Request", 'migration')
15437    pkt.Request(22, [
15438            rec( 10, 4, SupportModuleID ),
15439            rec( 14, 4, VolumeNumberLong ),
15440            rec( 18, 4, DirectoryBase ),
15441    ])
15442    pkt.Reply(20, [
15443            rec( 8, 4, BlockSizeInSectors ),
15444            rec( 12, 4, TotalBlocks ),
15445            rec( 16, 4, UsedBlocks ),
15446    ])
15447    pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
15448                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
15449                         0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
15450    # 2222/5A88, 90/136
15451    pkt = NCP(0x5A88, "RTDM Request", 'migration')
15452    pkt.Request(15, [
15453            rec( 10, 4, Verb ),
15454            rec( 14, 1, VerbData ),
15455    ])
15456    pkt.Reply(8)
15457    pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
15458                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
15459                         0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
15460# 2222/5A96, 90/150
15461    pkt = NCP(0x5A96, "File Migration Request", 'file')
15462    pkt.Request(22, [
15463            rec( 10, 4, VolumeNumberLong ),
15464    rec( 14, 4, DirectoryBase ),
15465    rec( 18, 4, FileMigrationState ),
15466    ])
15467    pkt.Reply(8)
15468    pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
15469                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600,
15470                         0x9804, 0x9b03, 0x9c03, 0xa800, 0xfb00, 0xff16])
15471# 2222/5C, 91
15472    pkt = NCP(0x5B, "NMAS Graded Authentication", 'nmas')
15473    #Need info on this packet structure
15474    pkt.Request(7)
15475    pkt.Reply(8)
15476    pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
15477                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600, 0xfb0b,
15478                         0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
15479    # SecretStore data is dissected by packet-ncp-sss.c
15480# 2222/5C01, 9201
15481    pkt = NCP(0x5C01, "SecretStore Services (Ping Server)", 'sss', 0)
15482    pkt.Request(8)
15483    pkt.Reply(8)
15484    pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
15485                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600, 0xfb0b,
15486                         0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
15487    # 2222/5C02, 9202
15488    pkt = NCP(0x5C02, "SecretStore Services (Fragment)", 'sss', 0)
15489    pkt.Request(8)
15490    pkt.Reply(8)
15491    pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
15492                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600, 0xfb0b,
15493                         0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
15494    # 2222/5C03, 9203
15495    pkt = NCP(0x5C03, "SecretStore Services (Write App Secrets)", 'sss', 0)
15496    pkt.Request(8)
15497    pkt.Reply(8)
15498    pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
15499                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600, 0xfb0b,
15500                         0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
15501    # 2222/5C04, 9204
15502    pkt = NCP(0x5C04, "SecretStore Services (Add Secret ID)", 'sss', 0)
15503    pkt.Request(8)
15504    pkt.Reply(8)
15505    pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
15506                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600, 0xfb0b,
15507                         0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
15508    # 2222/5C05, 9205
15509    pkt = NCP(0x5C05, "SecretStore Services (Remove Secret ID)", 'sss', 0)
15510    pkt.Request(8)
15511    pkt.Reply(8)
15512    pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
15513                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600, 0xfb0b,
15514                         0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
15515    # 2222/5C06, 9206
15516    pkt = NCP(0x5C06, "SecretStore Services (Remove SecretStore)", 'sss', 0)
15517    pkt.Request(8)
15518    pkt.Reply(8)
15519    pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
15520                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600, 0xfb0b,
15521                         0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
15522    # 2222/5C07, 9207
15523    pkt = NCP(0x5C07, "SecretStore Services (Enumerate Secret IDs)", 'sss', 0)
15524    pkt.Request(8)
15525    pkt.Reply(8)
15526    pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
15527                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600, 0xfb0b,
15528                         0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
15529    # 2222/5C08, 9208
15530    pkt = NCP(0x5C08, "SecretStore Services (Unlock Store)", 'sss', 0)
15531    pkt.Request(8)
15532    pkt.Reply(8)
15533    pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
15534                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600, 0xfb0b,
15535                         0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
15536    # 2222/5C09, 9209
15537    pkt = NCP(0x5C09, "SecretStore Services (Set Master Password)", 'sss', 0)
15538    pkt.Request(8)
15539    pkt.Reply(8)
15540    pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
15541                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600, 0xfb0b,
15542                         0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
15543    # 2222/5C0a, 9210
15544    pkt = NCP(0x5C0a, "SecretStore Services (Get Service Information)", 'sss', 0)
15545    pkt.Request(8)
15546    pkt.Reply(8)
15547    pkt.CompletionCodes([0x0000, 0x7e01, 0x8000, 0x8101, 0x8401, 0x8501,
15548                         0x8701, 0x8800, 0x8d00, 0x8f00, 0x9001, 0x9600, 0xfb0b,
15549                         0x9804, 0x9b03, 0x9c03, 0xa800, 0xfd00, 0xff16])
15550# NMAS packets are dissected in packet-ncp-nmas.c
15551    # 2222/5E, 9401
15552    pkt = NCP(0x5E01, "NMAS Communications Packet (Ping)", 'nmas', 0)
15553    pkt.Request(8)
15554    pkt.Reply(8)
15555    pkt.CompletionCodes([0x0000, 0xfb09, 0xff08])
15556    # 2222/5E, 9402
15557    pkt = NCP(0x5E02, "NMAS Communications Packet (Fragment)", 'nmas', 0)
15558    pkt.Request(8)
15559    pkt.Reply(8)
15560    pkt.CompletionCodes([0x0000, 0xfb09, 0xff08])
15561    # 2222/5E, 9403
15562    pkt = NCP(0x5E03, "NMAS Communications Packet (Abort)", 'nmas', 0)
15563    pkt.Request(8)
15564    pkt.Reply(8)
15565    pkt.CompletionCodes([0x0000, 0xfb09, 0xff08])
15566    # 2222/61, 97
15567    pkt = NCP(0x61, "Get Big Packet NCP Max Packet Size", 'connection')
15568    pkt.Request(10, [
15569            rec( 7, 2, ProposedMaxSize, ENC_BIG_ENDIAN, info_str=(ProposedMaxSize, "Get Big Max Packet Size - %d", ", %d") ),
15570            rec( 9, 1, SecurityFlag ),
15571    ])
15572    pkt.Reply(13, [
15573            rec( 8, 2, AcceptedMaxSize, ENC_BIG_ENDIAN ),
15574            rec( 10, 2, EchoSocket, ENC_BIG_ENDIAN ),
15575            rec( 12, 1, SecurityFlag ),
15576    ])
15577    pkt.CompletionCodes([0x0000])
15578    # 2222/62, 98
15579    pkt = NCP(0x62, "Negotiate NDS connection buffer size", 'connection')
15580    pkt.Request(15, [
15581            rec( 7, 8, ProposedMaxSize64, ENC_BIG_ENDIAN, Info_str=(ProposedMaxSize, "Negotiate NDS connection - %d", ", %d")),
15582    ])
15583    pkt.Reply(18, [
15584            rec( 8, 8, AcceptedMaxSize64, ENC_BIG_ENDIAN ),
15585            rec( 16, 2, EchoSocket, ENC_BIG_ENDIAN ),
15586    ])
15587    pkt.CompletionCodes([0x0000])
15588    # 2222/63, 99
15589    pkt = NCP(0x63, "Undocumented Packet Burst", 'pburst')
15590    pkt.Request(7)
15591    pkt.Reply(8)
15592    pkt.CompletionCodes([0x0000])
15593    # 2222/64, 100
15594    pkt = NCP(0x64, "Undocumented Packet Burst", 'pburst')
15595    pkt.Request(7)
15596    pkt.Reply(8)
15597    pkt.CompletionCodes([0x0000])
15598    # 2222/65, 101
15599    pkt = NCP(0x65, "Packet Burst Connection Request", 'pburst')
15600    pkt.Request(25, [
15601            rec( 7, 4, LocalConnectionID, ENC_BIG_ENDIAN ),
15602            rec( 11, 4, LocalMaxPacketSize, ENC_BIG_ENDIAN ),
15603            rec( 15, 2, LocalTargetSocket, ENC_BIG_ENDIAN ),
15604            rec( 17, 4, LocalMaxSendSize, ENC_BIG_ENDIAN ),
15605            rec( 21, 4, LocalMaxRecvSize, ENC_BIG_ENDIAN ),
15606    ])
15607    pkt.Reply(16, [
15608            rec( 8, 4, RemoteTargetID, ENC_BIG_ENDIAN ),
15609            rec( 12, 4, RemoteMaxPacketSize, ENC_BIG_ENDIAN ),
15610    ])
15611    pkt.CompletionCodes([0x0000])
15612    # 2222/66, 102
15613    pkt = NCP(0x66, "Undocumented Packet Burst", 'pburst')
15614    pkt.Request(7)
15615    pkt.Reply(8)
15616    pkt.CompletionCodes([0x0000])
15617    # 2222/67, 103
15618    pkt = NCP(0x67, "Undocumented Packet Burst", 'pburst')
15619    pkt.Request(7)
15620    pkt.Reply(8)
15621    pkt.CompletionCodes([0x0000])
15622    # 2222/6801, 104/01
15623    pkt = NCP(0x6801, "Ping for NDS NCP", "nds", has_length=0)
15624    pkt.Request(8)
15625    pkt.Reply(8)
15626    pkt.ReqCondSizeVariable()
15627    pkt.CompletionCodes([0x0000, 0x8100, 0xfb04, 0xfe0c])
15628    # 2222/6802, 104/02
15629    #
15630    # XXX - if FraggerHandle is not 0xffffffff, this is not the
15631    # first fragment, so we can only dissect this by reassembling;
15632    # the fields after "Fragment Handle" are bogus for non-0xffffffff
15633    # fragments, so we shouldn't dissect them. This is all handled in packet-ncp2222.inc.
15634    #
15635    pkt = NCP(0x6802, "Send NDS Fragmented Request/Reply", "nds", has_length=0)
15636    pkt.Request(8)
15637    pkt.Reply(8)
15638    pkt.ReqCondSizeVariable()
15639    pkt.CompletionCodes([0x0000, 0xac00, 0xfd01])
15640    # 2222/6803, 104/03
15641    pkt = NCP(0x6803, "Fragment Close", "nds", has_length=0)
15642    pkt.Request(12, [
15643            rec( 8, 4, FraggerHandle ),
15644    ])
15645    pkt.Reply(8)
15646    pkt.CompletionCodes([0x0000, 0xff00])
15647    # 2222/6804, 104/04
15648    pkt = NCP(0x6804, "Return Bindery Context", "nds", has_length=0)
15649    pkt.Request(8)
15650    pkt.Reply((9, 263), [
15651            rec( 8, (1,255), binderyContext ),
15652    ])
15653    pkt.CompletionCodes([0x0000, 0xfe0c, 0xff00])
15654    # 2222/6805, 104/05
15655    pkt = NCP(0x6805, "Monitor NDS Connection", "nds", has_length=0)
15656    pkt.Request(8)
15657    pkt.Reply(8)
15658    pkt.CompletionCodes([0x0000, 0x7700, 0xfb00, 0xfe0c, 0xff00])
15659    # 2222/6806, 104/06
15660    pkt = NCP(0x6806, "Return NDS Statistics", "nds", has_length=0)
15661    pkt.Request(10, [
15662            rec( 8, 2, NDSRequestFlags ),
15663    ])
15664    pkt.Reply(8)
15665    #Need to investigate how to decode Statistics Return Value
15666    pkt.CompletionCodes([0x0000, 0xfb00, 0xfe0c, 0xff00])
15667    # 2222/6807, 104/07
15668    pkt = NCP(0x6807, "Clear NDS Statistics", "nds", has_length=0)
15669    pkt.Request(8)
15670    pkt.Reply(8)
15671    pkt.CompletionCodes([0x0000, 0xfb00, 0xfe0c, 0xff00])
15672    # 2222/6808, 104/08
15673    pkt = NCP(0x6808, "Reload NDS Software", "nds", has_length=0)
15674    pkt.Request(8)
15675    pkt.Reply(12, [
15676            rec( 8, 4, NDSStatus ),
15677    ])
15678    pkt.CompletionCodes([0x0000, 0xfb00, 0xfe0c, 0xff00])
15679    # 2222/68C8, 104/200
15680    pkt = NCP(0x68C8, "Query Container Audit Status", "auditing", has_length=0)
15681    pkt.Request(12, [
15682            rec( 8, 4, ConnectionNumber ),
15683    ])
15684    pkt.Reply(40, [
15685            rec(8, 32, NWAuditStatus ),
15686    ])
15687    pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
15688    # 2222/68CA, 104/202
15689    pkt = NCP(0x68CA, "Add Auditor Access", "auditing", has_length=0)
15690    pkt.Request(8)
15691    pkt.Reply(8)
15692    pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
15693    # 2222/68CB, 104/203
15694    pkt = NCP(0x68CB, "Change Auditor Container Password", "auditing", has_length=0)
15695    pkt.Request(8)
15696    pkt.Reply(8)
15697    pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
15698    # 2222/68CC, 104/204
15699    pkt = NCP(0x68CC, "Check Auditor Access", "auditing", has_length=0)
15700    pkt.Request(8)
15701    pkt.Reply(8)
15702    pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
15703    # 2222/68CE, 104/206
15704    pkt = NCP(0x680CE, "Disable Container Auditing", "auditing", has_length=0)
15705    pkt.Request(8)
15706    pkt.Reply(8)
15707    pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
15708    # 2222/68CF, 104/207
15709    pkt = NCP(0x68CF, "Enable Container Auditing", "auditing", has_length=0)
15710    pkt.Request(8)
15711    pkt.Reply(8)
15712    pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
15713    # 2222/68D1, 104/209
15714    pkt = NCP(0x68D1, "Read Audit File Header", "auditing", has_length=0)
15715    pkt.Request(8)
15716    pkt.Reply(8)
15717    pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
15718    # 2222/68D3, 104/211
15719    pkt = NCP(0x68D3, "Remove Auditor Access", "auditing", has_length=0)
15720    pkt.Request(8)
15721    pkt.Reply(8)
15722    pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
15723    # 2222/68D4, 104/212
15724    pkt = NCP(0x68D4, "Reset Audit File", "auditing", has_length=0)
15725    pkt.Request(8)
15726    pkt.Reply(8)
15727    pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
15728    # 2222/68D6, 104/214
15729    pkt = NCP(0x68D6, "Write Audit File Configuration Header", "auditing", has_length=0)
15730    pkt.Request(8)
15731    pkt.Reply(8)
15732    pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
15733    # 2222/68D7, 104/215
15734    pkt = NCP(0x68D7, "Change Auditor Container Password2", "auditing", has_length=0)
15735    pkt.Request(8)
15736    pkt.Reply(8)
15737    pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
15738    # 2222/68D8, 104/216
15739    pkt = NCP(0x68D8, "Return Audit Flags", "auditing", has_length=0)
15740    pkt.Request(8)
15741    pkt.Reply(8)
15742    pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
15743    # 2222/68D9, 104/217
15744    pkt = NCP(0x68D9, "Close Old Audit File", "auditing", has_length=0)
15745    pkt.Request(8)
15746    pkt.Reply(8)
15747    pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
15748    # 2222/68DB, 104/219
15749    pkt = NCP(0x68DB, "Check Level Two Access", "auditing", has_length=0)
15750    pkt.Request(8)
15751    pkt.Reply(8)
15752    pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
15753    # 2222/68DC, 104/220
15754    pkt = NCP(0x68DC, "Check Object Audited", "auditing", has_length=0)
15755    pkt.Request(8)
15756    pkt.Reply(8)
15757    pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
15758    # 2222/68DD, 104/221
15759    pkt = NCP(0x68DD, "Change Object Audited", "auditing", has_length=0)
15760    pkt.Request(8)
15761    pkt.Reply(8)
15762    pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
15763    # 2222/68DE, 104/222
15764    pkt = NCP(0x68DE, "Return Old Audit File List", "auditing", has_length=0)
15765    pkt.Request(8)
15766    pkt.Reply(8)
15767    pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
15768    # 2222/68DF, 104/223
15769    pkt = NCP(0x68DF, "Init Audit File Reads", "auditing", has_length=0)
15770    pkt.Request(8)
15771    pkt.Reply(8)
15772    pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
15773    # 2222/68E0, 104/224
15774    pkt = NCP(0x68E0, "Read Auditing File", "auditing", has_length=0)
15775    pkt.Request(8)
15776    pkt.Reply(8)
15777    pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
15778    # 2222/68E1, 104/225
15779    pkt = NCP(0x68E1, "Delete Old Audit File", "auditing", has_length=0)
15780    pkt.Request(8)
15781    pkt.Reply(8)
15782    pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
15783    # 2222/68E5, 104/229
15784    pkt = NCP(0x68E5, "Set Audit Password", "auditing", has_length=0)
15785    pkt.Request(8)
15786    pkt.Reply(8)
15787    pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
15788    # 2222/68E7, 104/231
15789    pkt = NCP(0x68E7, "External Audit Append To File", "auditing", has_length=0)
15790    pkt.Request(8)
15791    pkt.Reply(8)
15792    pkt.CompletionCodes([0x0000, 0xa700, 0xfb00, 0xfe0c, 0xff00])
15793    # 2222/69, 105
15794    pkt = NCP(0x69, "Log File", 'sync')
15795    pkt.Request( (12, 267), [
15796            rec( 7, 1, DirHandle ),
15797            rec( 8, 1, LockFlag ),
15798            rec( 9, 2, TimeoutLimit ),
15799            rec( 11, (1, 256), FilePath, info_str=(FilePath, "Log File: %s", "/%s") ),
15800    ])
15801    pkt.Reply(8)
15802    pkt.CompletionCodes([0x0000, 0x7f00, 0x8200, 0x9600, 0xfe0d, 0xff01])
15803    # 2222/6A, 106
15804    pkt = NCP(0x6A, "Lock File Set", 'sync')
15805    pkt.Request( 9, [
15806            rec( 7, 2, TimeoutLimit ),
15807    ])
15808    pkt.Reply(8)
15809    pkt.CompletionCodes([0x0000, 0x7f00, 0x8200, 0x9600, 0xfe0d, 0xff01])
15810    # 2222/6B, 107
15811    pkt = NCP(0x6B, "Log Logical Record", 'sync')
15812    pkt.Request( (11, 266), [
15813            rec( 7, 1, LockFlag ),
15814            rec( 8, 2, TimeoutLimit ),
15815            rec( 10, (1, 256), SynchName, info_str=(SynchName, "Log Logical Record: %s", ", %s") ),
15816    ])
15817    pkt.Reply(8)
15818    pkt.CompletionCodes([0x0000, 0x7f00, 0x9600, 0xfe0d, 0xff01])
15819    # 2222/6C, 108
15820    pkt = NCP(0x6C, "Log Logical Record", 'sync')
15821    pkt.Request( 10, [
15822            rec( 7, 1, LockFlag ),
15823            rec( 8, 2, TimeoutLimit ),
15824    ])
15825    pkt.Reply(8)
15826    pkt.CompletionCodes([0x0000, 0x7f00, 0x9600, 0xfe0d, 0xff01])
15827    # 2222/6D, 109
15828    pkt = NCP(0x6D, "Log Physical Record", 'sync')
15829    pkt.Request(24, [
15830            rec( 7, 1, LockFlag ),
15831            rec( 8, 6, FileHandle ),
15832            rec( 14, 4, LockAreasStartOffset ),
15833            rec( 18, 4, LockAreaLen ),
15834            rec( 22, 2, LockTimeout ),
15835    ])
15836    pkt.Reply(8)
15837    pkt.CompletionCodes([0x0000, 0x7f00, 0x8200, 0x8800, 0x9600, 0xfd02, 0xfe04, 0xff01])
15838    # 2222/6E, 110
15839    pkt = NCP(0x6E, "Lock Physical Record Set", 'sync')
15840    pkt.Request(10, [
15841            rec( 7, 1, LockFlag ),
15842            rec( 8, 2, LockTimeout ),
15843    ])
15844    pkt.Reply(8)
15845    pkt.CompletionCodes([0x0000, 0x7f00, 0x8200, 0x8800, 0x9600, 0xfd02, 0xfe04, 0xff01])
15846    # 2222/6F00, 111/00
15847    pkt = NCP(0x6F00, "Open/Create a Semaphore", 'sync', has_length=0)
15848    pkt.Request((10,521), [
15849            rec( 8, 1, InitialSemaphoreValue ),
15850            rec( 9, (1, 512), SemaphoreName, info_str=(SemaphoreName, "Open/Create Semaphore: %s", ", %s") ),
15851    ])
15852    pkt.Reply(13, [
15853              rec( 8, 4, SemaphoreHandle ),
15854              rec( 12, 1, SemaphoreOpenCount ),
15855    ])
15856    pkt.CompletionCodes([0x0000, 0x9600, 0xff01])
15857    # 2222/6F01, 111/01
15858    pkt = NCP(0x6F01, "Examine Semaphore", 'sync', has_length=0)
15859    pkt.Request(12, [
15860            rec( 8, 4, SemaphoreHandle ),
15861    ])
15862    pkt.Reply(10, [
15863              rec( 8, 1, SemaphoreValue ),
15864              rec( 9, 1, SemaphoreOpenCount ),
15865    ])
15866    pkt.CompletionCodes([0x0000, 0x9600, 0xff01])
15867    # 2222/6F02, 111/02
15868    pkt = NCP(0x6F02, "Wait On (P) Semaphore", 'sync', has_length=0)
15869    pkt.Request(14, [
15870            rec( 8, 4, SemaphoreHandle ),
15871            rec( 12, 2, LockTimeout ),
15872    ])
15873    pkt.Reply(8)
15874    pkt.CompletionCodes([0x0000, 0x9600, 0xfe04, 0xff01])
15875    # 2222/6F03, 111/03
15876    pkt = NCP(0x6F03, "Signal (V) Semaphore", 'sync', has_length=0)
15877    pkt.Request(12, [
15878            rec( 8, 4, SemaphoreHandle ),
15879    ])
15880    pkt.Reply(8)
15881    pkt.CompletionCodes([0x0000, 0x9600, 0xfe04, 0xff01])
15882    # 2222/6F04, 111/04
15883    pkt = NCP(0x6F04, "Close Semaphore", 'sync', has_length=0)
15884    pkt.Request(12, [
15885            rec( 8, 4, SemaphoreHandle ),
15886    ])
15887    pkt.Reply(10, [
15888            rec( 8, 1, SemaphoreOpenCount ),
15889            rec( 9, 1, SemaphoreShareCount ),
15890    ])
15891    pkt.CompletionCodes([0x0000, 0x9600, 0xfe04, 0xff01])
15892    ## 2222/1125
15893    pkt = NCP(0x70, "Clear and Get Waiting Lock Completion", 'sync')
15894    pkt.Request(7)
15895    pkt.Reply(8)
15896    pkt.CompletionCodes([0x0000, 0x9b00, 0x9c03, 0xff1a])
15897    # 2222/7201, 114/01
15898    pkt = NCP(0x7201, "Timesync Get Time", 'tsync')
15899    pkt.Request(10)
15900    pkt.Reply(32,[
15901            rec( 8, 12, theTimeStruct ),
15902            rec(20, 8, eventOffset ),
15903            rec(28, 4, eventTime ),
15904    ])
15905    pkt.CompletionCodes([0x0000, 0x7e00, 0xfb06, 0xff00])
15906    # 2222/7202, 114/02
15907    pkt = NCP(0x7202, "Timesync Exchange Time", 'tsync')
15908    pkt.Request((63,112), [
15909            rec( 10, 4, protocolFlags ),
15910            rec( 14, 4, nodeFlags ),
15911            rec( 18, 8, sourceOriginateTime ),
15912            rec( 26, 8, targetReceiveTime ),
15913            rec( 34, 8, targetTransmitTime ),
15914            rec( 42, 8, sourceReturnTime ),
15915            rec( 50, 8, eventOffset ),
15916            rec( 58, 4, eventTime ),
15917            rec( 62, (1,50), ServerNameLen, info_str=(ServerNameLen, "Timesync Exchange Time: %s", ", %s") ),
15918    ])
15919    pkt.Reply((64,113), [
15920            rec( 8, 3, Reserved3 ),
15921            rec( 11, 4, protocolFlags ),
15922            rec( 15, 4, nodeFlags ),
15923            rec( 19, 8, sourceOriginateTime ),
15924            rec( 27, 8, targetReceiveTime ),
15925            rec( 35, 8, targetTransmitTime ),
15926            rec( 43, 8, sourceReturnTime ),
15927            rec( 51, 8, eventOffset ),
15928            rec( 59, 4, eventTime ),
15929            rec( 63, (1,50), ServerNameLen ),
15930    ])
15931    pkt.CompletionCodes([0x0000, 0x7e00, 0xfb06, 0xff00])
15932    # 2222/7205, 114/05
15933    pkt = NCP(0x7205, "Timesync Get Server List", 'tsync')
15934    pkt.Request(14, [
15935            rec( 10, 4, StartNumber ),
15936    ])
15937    pkt.Reply(66, [
15938            rec( 8, 4, nameType ),
15939            rec( 12, 48, ServerName ),
15940            rec( 60, 4, serverListFlags ),
15941            rec( 64, 2, startNumberFlag ),
15942    ])
15943    pkt.CompletionCodes([0x0000, 0x7e00, 0xfb06, 0xff00])
15944    # 2222/7206, 114/06
15945    pkt = NCP(0x7206, "Timesync Set Server List", 'tsync')
15946    pkt.Request(14, [
15947            rec( 10, 4, StartNumber ),
15948    ])
15949    pkt.Reply(66, [
15950            rec( 8, 4, nameType ),
15951            rec( 12, 48, ServerName ),
15952            rec( 60, 4, serverListFlags ),
15953            rec( 64, 2, startNumberFlag ),
15954    ])
15955    pkt.CompletionCodes([0x0000, 0x7e00, 0xfb06, 0xff00])
15956    # 2222/720C, 114/12
15957    pkt = NCP(0x720C, "Timesync Get Version", 'tsync')
15958    pkt.Request(10)
15959    pkt.Reply(12, [
15960            rec( 8, 4, version ),
15961    ])
15962    pkt.CompletionCodes([0x0000, 0x7e00, 0xfb06, 0xff00])
15963    # 2222/7B01, 123/01
15964    pkt = NCP(0x7B01, "Get Cache Information", 'stats')
15965    pkt.Request(10)
15966    pkt.Reply(288, [
15967            rec(8, 4, CurrentServerTime, ENC_LITTLE_ENDIAN),
15968            rec(12, 1, VConsoleVersion ),
15969            rec(13, 1, VConsoleRevision ),
15970            rec(14, 2, Reserved2 ),
15971            rec(16, 104, Counters ),
15972            rec(120, 40, ExtraCacheCntrs ),
15973            rec(160, 40, MemoryCounters ),
15974            rec(200, 48, TrendCounters ),
15975            rec(248, 40, CacheInfo ),
15976    ])
15977    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xff00])
15978    # 2222/7B02, 123/02
15979    pkt = NCP(0x7B02, "Get File Server Information", 'stats')
15980    pkt.Request(10)
15981    pkt.Reply(150, [
15982            rec(8, 4, CurrentServerTime ),
15983            rec(12, 1, VConsoleVersion ),
15984            rec(13, 1, VConsoleRevision ),
15985            rec(14, 2, Reserved2 ),
15986            rec(16, 4, NCPStaInUseCnt ),
15987            rec(20, 4, NCPPeakStaInUse ),
15988            rec(24, 4, NumOfNCPReqs ),
15989            rec(28, 4, ServerUtilization ),
15990            rec(32, 96, ServerInfo ),
15991            rec(128, 22, FileServerCounters ),
15992    ])
15993    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
15994    # 2222/7B03, 123/03
15995    pkt = NCP(0x7B03, "NetWare File System Information", 'stats')
15996    pkt.Request(11, [
15997            rec(10, 1, FileSystemID ),
15998    ])
15999    pkt.Reply(68, [
16000            rec(8, 4, CurrentServerTime ),
16001            rec(12, 1, VConsoleVersion ),
16002            rec(13, 1, VConsoleRevision ),
16003            rec(14, 2, Reserved2 ),
16004            rec(16, 52, FileSystemInfo ),
16005    ])
16006    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16007    # 2222/7B04, 123/04
16008    pkt = NCP(0x7B04, "User Information", 'stats')
16009    pkt.Request(14, [
16010            rec(10, 4, ConnectionNumber, ENC_LITTLE_ENDIAN ),
16011    ])
16012    pkt.Reply((85, 132), [
16013            rec(8, 4, CurrentServerTime ),
16014            rec(12, 1, VConsoleVersion ),
16015            rec(13, 1, VConsoleRevision ),
16016            rec(14, 2, Reserved2 ),
16017            rec(16, 68, UserInformation ),
16018            rec(84, (1, 48), UserName ),
16019    ])
16020    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16021    # 2222/7B05, 123/05
16022    pkt = NCP(0x7B05, "Packet Burst Information", 'stats')
16023    pkt.Request(10)
16024    pkt.Reply(216, [
16025            rec(8, 4, CurrentServerTime ),
16026            rec(12, 1, VConsoleVersion ),
16027            rec(13, 1, VConsoleRevision ),
16028            rec(14, 2, Reserved2 ),
16029            rec(16, 200, PacketBurstInformation ),
16030    ])
16031    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16032    # 2222/7B06, 123/06
16033    pkt = NCP(0x7B06, "IPX SPX Information", 'stats')
16034    pkt.Request(10)
16035    pkt.Reply(94, [
16036            rec(8, 4, CurrentServerTime ),
16037            rec(12, 1, VConsoleVersion ),
16038            rec(13, 1, VConsoleRevision ),
16039            rec(14, 2, Reserved2 ),
16040            rec(16, 34, IPXInformation ),
16041            rec(50, 44, SPXInformation ),
16042    ])
16043    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16044    # 2222/7B07, 123/07
16045    pkt = NCP(0x7B07, "Garbage Collection Information", 'stats')
16046    pkt.Request(10)
16047    pkt.Reply(40, [
16048            rec(8, 4, CurrentServerTime ),
16049            rec(12, 1, VConsoleVersion ),
16050            rec(13, 1, VConsoleRevision ),
16051            rec(14, 2, Reserved2 ),
16052            rec(16, 4, FailedAllocReqCnt ),
16053            rec(20, 4, NumberOfAllocs ),
16054            rec(24, 4, NoMoreMemAvlCnt ),
16055            rec(28, 4, NumOfGarbageColl ),
16056            rec(32, 4, FoundSomeMem ),
16057            rec(36, 4, NumOfChecks ),
16058    ])
16059    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16060    # 2222/7B08, 123/08
16061    pkt = NCP(0x7B08, "CPU Information", 'stats')
16062    pkt.Request(14, [
16063            rec(10, 4, CPUNumber ),
16064    ])
16065    pkt.Reply(51, [
16066            rec(8, 4, CurrentServerTime ),
16067            rec(12, 1, VConsoleVersion ),
16068            rec(13, 1, VConsoleRevision ),
16069            rec(14, 2, Reserved2 ),
16070            rec(16, 4, NumberOfCPUs ),
16071            rec(20, 31, CPUInformation ),
16072    ])
16073    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16074    # 2222/7B09, 123/09
16075    pkt = NCP(0x7B09, "Volume Switch Information", 'stats')
16076    pkt.Request(14, [
16077            rec(10, 4, StartNumber )
16078    ])
16079    pkt.Reply(28, [
16080            rec(8, 4, CurrentServerTime ),
16081            rec(12, 1, VConsoleVersion ),
16082            rec(13, 1, VConsoleRevision ),
16083            rec(14, 2, Reserved2 ),
16084            rec(16, 4, TotalLFSCounters ),
16085            rec(20, 4, CurrentLFSCounters, var="x"),
16086            rec(24, 4, LFSCounters, repeat="x"),
16087    ])
16088    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16089    # 2222/7B0A, 123/10
16090    pkt = NCP(0x7B0A, "Get NLM Loaded List", 'stats')
16091    pkt.Request(14, [
16092            rec(10, 4, StartNumber )
16093    ])
16094    pkt.Reply(28, [
16095            rec(8, 4, CurrentServerTime ),
16096            rec(12, 1, VConsoleVersion ),
16097            rec(13, 1, VConsoleRevision ),
16098            rec(14, 2, Reserved2 ),
16099            rec(16, 4, NLMcount ),
16100            rec(20, 4, NLMsInList, var="x" ),
16101            rec(24, 4, NLMNumbers, repeat="x" ),
16102    ])
16103    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16104    # 2222/7B0B, 123/11
16105    pkt = NCP(0x7B0B, "NLM Information", 'stats')
16106    pkt.Request(14, [
16107            rec(10, 4, NLMNumber ),
16108    ])
16109    pkt.Reply(NO_LENGTH_CHECK, [
16110            rec(8, 4, CurrentServerTime ),
16111            rec(12, 1, VConsoleVersion ),
16112            rec(13, 1, VConsoleRevision ),
16113            rec(14, 2, Reserved2 ),
16114            rec(16, 60, NLMInformation ),
16115    # The remainder of this dissection is manually decoded in packet-ncp2222.inc
16116            #rec(-1, (1,255), FileName ),
16117            #rec(-1, (1,255), Name ),
16118            #rec(-1, (1,255), Copyright ),
16119    ])
16120    pkt.ReqCondSizeVariable()
16121    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16122    # 2222/7B0C, 123/12
16123    pkt = NCP(0x7B0C, "Get Directory Cache Information", 'stats')
16124    pkt.Request(10)
16125    pkt.Reply(72, [
16126            rec(8, 4, CurrentServerTime ),
16127            rec(12, 1, VConsoleVersion ),
16128            rec(13, 1, VConsoleRevision ),
16129            rec(14, 2, Reserved2 ),
16130            rec(16, 56, DirCacheInfo ),
16131    ])
16132    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16133    # 2222/7B0D, 123/13
16134    pkt = NCP(0x7B0D, "Get Operating System Version Information", 'stats')
16135    pkt.Request(10)
16136    pkt.Reply(70, [
16137            rec(8, 4, CurrentServerTime ),
16138            rec(12, 1, VConsoleVersion ),
16139            rec(13, 1, VConsoleRevision ),
16140            rec(14, 2, Reserved2 ),
16141            rec(16, 1, OSMajorVersion ),
16142            rec(17, 1, OSMinorVersion ),
16143            rec(18, 1, OSRevision ),
16144            rec(19, 1, AccountVersion ),
16145            rec(20, 1, VAPVersion ),
16146            rec(21, 1, QueueingVersion ),
16147            rec(22, 1, SecurityRestrictionVersion ),
16148            rec(23, 1, InternetBridgeVersion ),
16149            rec(24, 4, MaxNumOfVol ),
16150            rec(28, 4, MaxNumOfConn ),
16151            rec(32, 4, MaxNumOfUsers ),
16152            rec(36, 4, MaxNumOfNmeSps ),
16153            rec(40, 4, MaxNumOfLANS ),
16154            rec(44, 4, MaxNumOfMedias ),
16155            rec(48, 4, MaxNumOfStacks ),
16156            rec(52, 4, MaxDirDepth ),
16157            rec(56, 4, MaxDataStreams ),
16158            rec(60, 4, MaxNumOfSpoolPr ),
16159            rec(64, 4, ServerSerialNumber ),
16160            rec(68, 2, ServerAppNumber ),
16161    ])
16162    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16163    # 2222/7B0E, 123/14
16164    pkt = NCP(0x7B0E, "Get Active Connection List by Type", 'stats')
16165    pkt.Request(15, [
16166            rec(10, 4, StartConnNumber ),
16167            rec(14, 1, ConnectionType ),
16168    ])
16169    pkt.Reply(528, [
16170            rec(8, 4, CurrentServerTime ),
16171            rec(12, 1, VConsoleVersion ),
16172            rec(13, 1, VConsoleRevision ),
16173            rec(14, 2, Reserved2 ),
16174            rec(16, 512, ActiveConnBitList ),
16175    ])
16176    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfd01, 0xff00])
16177    # 2222/7B0F, 123/15
16178    pkt = NCP(0x7B0F, "Get NLM Resource Tag List", 'stats')
16179    pkt.Request(18, [
16180            rec(10, 4, NLMNumber ),
16181            rec(14, 4, NLMStartNumber ),
16182    ])
16183    pkt.Reply(37, [
16184            rec(8, 4, CurrentServerTime ),
16185            rec(12, 1, VConsoleVersion ),
16186            rec(13, 1, VConsoleRevision ),
16187            rec(14, 2, Reserved2 ),
16188            rec(16, 4, TtlNumOfRTags ),
16189            rec(20, 4, CurNumOfRTags ),
16190            rec(24, 13, RTagStructure ),
16191    ])
16192    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16193    # 2222/7B10, 123/16
16194    pkt = NCP(0x7B10, "Enumerate Connection Information from Connection List", 'stats')
16195    pkt.Request(22, [
16196            rec(10, 1, EnumInfoMask),
16197            rec(11, 3, Reserved3),
16198            rec(14, 4, itemsInList, var="x"),
16199            rec(18, 4, connList, repeat="x"),
16200    ])
16201    pkt.Reply(NO_LENGTH_CHECK, [
16202            rec(8, 4, CurrentServerTime ),
16203            rec(12, 1, VConsoleVersion ),
16204            rec(13, 1, VConsoleRevision ),
16205            rec(14, 2, Reserved2 ),
16206            rec(16, 4, ItemsInPacket ),
16207            srec(netAddr, req_cond="ncp.enum_info_transport==TRUE"),
16208            srec(timeInfo, req_cond="ncp.enum_info_time==TRUE"),
16209            srec(nameInfo, req_cond="ncp.enum_info_name==TRUE"),
16210            srec(lockInfo, req_cond="ncp.enum_info_lock==TRUE"),
16211            srec(printInfo, req_cond="ncp.enum_info_print==TRUE"),
16212            srec(statsInfo, req_cond="ncp.enum_info_stats==TRUE"),
16213            srec(acctngInfo, req_cond="ncp.enum_info_account==TRUE"),
16214            srec(authInfo, req_cond="ncp.enum_info_auth==TRUE"),
16215    ])
16216    pkt.ReqCondSizeVariable()
16217    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16218    # 2222/7B11, 123/17
16219    pkt = NCP(0x7B11, "Enumerate NCP Service Network Addresses", 'stats')
16220    pkt.Request(14, [
16221            rec(10, 4, SearchNumber ),
16222    ])
16223    pkt.Reply(36, [
16224            rec(8, 4, CurrentServerTime ),
16225            rec(12, 1, VConsoleVersion ),
16226            rec(13, 1, VConsoleRevision ),
16227            rec(14, 2, ServerInfoFlags ),
16228    rec(16, 16, GUID ),
16229    rec(32, 4, NextSearchNum ),
16230    # The following two items are dissected in packet-ncp2222.inc
16231    #rec(36, 4, ItemsInPacket, var="x"),
16232    #rec(40, 20, NCPNetworkAddress, repeat="x" ),
16233    ])
16234    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb01, 0xff00])
16235    # 2222/7B14, 123/20
16236    pkt = NCP(0x7B14, "Active LAN Board List", 'stats')
16237    pkt.Request(14, [
16238            rec(10, 4, StartNumber ),
16239    ])
16240    pkt.Reply(28, [
16241            rec(8, 4, CurrentServerTime ),
16242            rec(12, 1, VConsoleVersion ),
16243            rec(13, 1, VConsoleRevision ),
16244            rec(14, 2, Reserved2 ),
16245            rec(16, 4, MaxNumOfLANS ),
16246            rec(20, 4, ItemsInPacket, var="x"),
16247            rec(24, 4, BoardNumbers, repeat="x"),
16248    ])
16249    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16250    # 2222/7B15, 123/21
16251    pkt = NCP(0x7B15, "LAN Configuration Information", 'stats')
16252    pkt.Request(14, [
16253            rec(10, 4, BoardNumber ),
16254    ])
16255    pkt.Reply(152, [
16256            rec(8, 4, CurrentServerTime ),
16257            rec(12, 1, VConsoleVersion ),
16258            rec(13, 1, VConsoleRevision ),
16259            rec(14, 2, Reserved2 ),
16260            rec(16,136, LANConfigInfo ),
16261    ])
16262    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16263    # 2222/7B16, 123/22
16264    pkt = NCP(0x7B16, "LAN Common Counters Information", 'stats')
16265    pkt.Request(18, [
16266            rec(10, 4, BoardNumber ),
16267            rec(14, 4, BlockNumber ),
16268    ])
16269    pkt.Reply(86, [
16270            rec(8, 4, CurrentServerTime ),
16271            rec(12, 1, VConsoleVersion ),
16272            rec(13, 1, VConsoleRevision ),
16273            rec(14, 1, StatMajorVersion ),
16274            rec(15, 1, StatMinorVersion ),
16275            rec(16, 4, TotalCommonCnts ),
16276            rec(20, 4, TotalCntBlocks ),
16277            rec(24, 4, CustomCounters ),
16278            rec(28, 4, NextCntBlock ),
16279            rec(32, 54, CommonLanStruc ),
16280    ])
16281    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16282    # 2222/7B17, 123/23
16283    pkt = NCP(0x7B17, "LAN Custom Counters Information", 'stats')
16284    pkt.Request(18, [
16285            rec(10, 4, BoardNumber ),
16286            rec(14, 4, StartNumber ),
16287    ])
16288    pkt.Reply(25, [
16289            rec(8, 4, CurrentServerTime ),
16290            rec(12, 1, VConsoleVersion ),
16291            rec(13, 1, VConsoleRevision ),
16292            rec(14, 2, Reserved2 ),
16293            rec(16, 4, NumOfCCinPkt, var="x"),
16294            rec(20, 5, CustomCntsInfo, repeat="x"),
16295    ])
16296    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16297    # 2222/7B18, 123/24
16298    pkt = NCP(0x7B18, "LAN Name Information", 'stats')
16299    pkt.Request(14, [
16300            rec(10, 4, BoardNumber ),
16301    ])
16302    pkt.Reply(NO_LENGTH_CHECK, [
16303            rec(8, 4, CurrentServerTime ),
16304            rec(12, 1, VConsoleVersion ),
16305            rec(13, 1, VConsoleRevision ),
16306            rec(14, 2, Reserved2 ),
16307    rec(16, PROTO_LENGTH_UNKNOWN, DriverBoardName ),
16308    rec(-1, PROTO_LENGTH_UNKNOWN, DriverShortName ),
16309    rec(-1, PROTO_LENGTH_UNKNOWN, DriverLogicalName ),
16310    ])
16311    pkt.ReqCondSizeVariable()
16312    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16313    # 2222/7B19, 123/25
16314    pkt = NCP(0x7B19, "LSL Information", 'stats')
16315    pkt.Request(10)
16316    pkt.Reply(90, [
16317            rec(8, 4, CurrentServerTime ),
16318            rec(12, 1, VConsoleVersion ),
16319            rec(13, 1, VConsoleRevision ),
16320            rec(14, 2, Reserved2 ),
16321            rec(16, 74, LSLInformation ),
16322    ])
16323    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16324    # 2222/7B1A, 123/26
16325    pkt = NCP(0x7B1A, "LSL Logical Board Statistics", 'stats')
16326    pkt.Request(14, [
16327            rec(10, 4, BoardNumber ),
16328    ])
16329    pkt.Reply(28, [
16330            rec(8, 4, CurrentServerTime ),
16331            rec(12, 1, VConsoleVersion ),
16332            rec(13, 1, VConsoleRevision ),
16333            rec(14, 2, Reserved2 ),
16334            rec(16, 4, LogTtlTxPkts ),
16335            rec(20, 4, LogTtlRxPkts ),
16336            rec(24, 4, UnclaimedPkts ),
16337    ])
16338    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16339    # 2222/7B1B, 123/27
16340    pkt = NCP(0x7B1B, "MLID Board Information", 'stats')
16341    pkt.Request(14, [
16342            rec(10, 4, BoardNumber ),
16343    ])
16344    pkt.Reply(44, [
16345            rec(8, 4, CurrentServerTime ),
16346            rec(12, 1, VConsoleVersion ),
16347            rec(13, 1, VConsoleRevision ),
16348            rec(14, 1, Reserved ),
16349            rec(15, 1, NumberOfProtocols ),
16350            rec(16, 28, MLIDBoardInfo ),
16351    ])
16352    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16353    # 2222/7B1E, 123/30
16354    pkt = NCP(0x7B1E, "Get Media Manager Object Information", 'stats')
16355    pkt.Request(14, [
16356            rec(10, 4, ObjectNumber ),
16357    ])
16358    pkt.Reply(212, [
16359            rec(8, 4, CurrentServerTime ),
16360            rec(12, 1, VConsoleVersion ),
16361            rec(13, 1, VConsoleRevision ),
16362            rec(14, 2, Reserved2 ),
16363            rec(16, 196, GenericInfoDef ),
16364    ])
16365    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16366    # 2222/7B1F, 123/31
16367    pkt = NCP(0x7B1F, "Get Media Manager Objects List", 'stats')
16368    pkt.Request(15, [
16369            rec(10, 4, StartNumber ),
16370            rec(14, 1, MediaObjectType ),
16371    ])
16372    pkt.Reply(28, [
16373            rec(8, 4, CurrentServerTime ),
16374            rec(12, 1, VConsoleVersion ),
16375            rec(13, 1, VConsoleRevision ),
16376            rec(14, 2, Reserved2 ),
16377            rec(16, 4, nextStartingNumber ),
16378            rec(20, 4, ObjectCount, var="x"),
16379            rec(24, 4, ObjectID, repeat="x"),
16380    ])
16381    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16382    # 2222/7B20, 123/32
16383    pkt = NCP(0x7B20, "Get Media Manager Object Childrens List", 'stats')
16384    pkt.Request(22, [
16385            rec(10, 4, StartNumber ),
16386            rec(14, 1, MediaObjectType ),
16387            rec(15, 3, Reserved3 ),
16388            rec(18, 4, ParentObjectNumber ),
16389    ])
16390    pkt.Reply(28, [
16391            rec(8, 4, CurrentServerTime ),
16392            rec(12, 1, VConsoleVersion ),
16393            rec(13, 1, VConsoleRevision ),
16394            rec(14, 2, Reserved2 ),
16395            rec(16, 4, nextStartingNumber ),
16396            rec(20, 4, ObjectCount, var="x" ),
16397            rec(24, 4, ObjectID, repeat="x" ),
16398    ])
16399    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16400    # 2222/7B21, 123/33
16401    pkt = NCP(0x7B21, "Get Volume Segment List", 'stats')
16402    pkt.Request(14, [
16403            rec(10, 4, VolumeNumberLong ),
16404    ])
16405    pkt.Reply(32, [
16406            rec(8, 4, CurrentServerTime ),
16407            rec(12, 1, VConsoleVersion ),
16408            rec(13, 1, VConsoleRevision ),
16409            rec(14, 2, Reserved2 ),
16410            rec(16, 4, NumOfSegments, var="x" ),
16411            rec(20, 12, Segments, repeat="x" ),
16412    ])
16413    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0x9801, 0xfb06, 0xff00])
16414    # 2222/7B22, 123/34
16415    pkt = NCP(0x7B22, "Get Volume Information by Level", 'stats')
16416    pkt.Request(15, [
16417            rec(10, 4, VolumeNumberLong ),
16418            rec(14, 1, InfoLevelNumber ),
16419    ])
16420    pkt.Reply(NO_LENGTH_CHECK, [
16421            rec(8, 4, CurrentServerTime ),
16422            rec(12, 1, VConsoleVersion ),
16423            rec(13, 1, VConsoleRevision ),
16424            rec(14, 2, Reserved2 ),
16425            rec(16, 1, InfoLevelNumber ),
16426            rec(17, 3, Reserved3 ),
16427            srec(VolInfoStructure, req_cond="ncp.info_level_num==0x01"),
16428            srec(VolInfo2Struct, req_cond="ncp.info_level_num==0x02"),
16429    ])
16430    pkt.ReqCondSizeVariable()
16431    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16432    # 2222/7B23, 123/35
16433    pkt = NCP(0x7B23, "Get Volume Information by Level 64 Bit Aware", 'stats')
16434    pkt.Request(22, [
16435            rec(10, 4, InpInfotype ),
16436            rec(14, 4, Inpld ),
16437			rec(18, 4, VolInfoReturnInfoMask),
16438    ])
16439    pkt.Reply(NO_LENGTH_CHECK, [
16440            rec(8, 4, CurrentServerTime ),
16441            rec(12, 1, VConsoleVersion ),
16442            rec(13, 1, VConsoleRevision ),
16443            rec(14, 2, Reserved2 ),
16444            rec(16, 4, VolInfoReturnInfoMask),
16445            srec(VolInfoStructure64, req_cond="ncp.vinfo_info64==0x00000001"),
16446            rec( -1, (1,255), VolumeNameLen, req_cond="ncp.vinfo_volname==0x00000002" ),
16447    ])
16448    pkt.ReqCondSizeVariable()
16449    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16450    # 2222/7B28, 123/40
16451    pkt = NCP(0x7B28, "Active Protocol Stacks", 'stats')
16452    pkt.Request(14, [
16453            rec(10, 4, StartNumber ),
16454    ])
16455    pkt.Reply(48, [
16456            rec(8, 4, CurrentServerTime ),
16457            rec(12, 1, VConsoleVersion ),
16458            rec(13, 1, VConsoleRevision ),
16459            rec(14, 2, Reserved2 ),
16460            rec(16, 4, MaxNumOfLANS ),
16461            rec(20, 4, StackCount, var="x" ),
16462            rec(24, 4, nextStartingNumber ),
16463            rec(28, 20, StackInfo, repeat="x" ),
16464    ])
16465    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16466    # 2222/7B29, 123/41
16467    pkt = NCP(0x7B29, "Get Protocol Stack Configuration Information", 'stats')
16468    pkt.Request(14, [
16469            rec(10, 4, StackNumber ),
16470    ])
16471    pkt.Reply((37,164), [
16472            rec(8, 4, CurrentServerTime ),
16473            rec(12, 1, VConsoleVersion ),
16474            rec(13, 1, VConsoleRevision ),
16475            rec(14, 2, Reserved2 ),
16476            rec(16, 1, ConfigMajorVN ),
16477            rec(17, 1, ConfigMinorVN ),
16478            rec(18, 1, StackMajorVN ),
16479            rec(19, 1, StackMinorVN ),
16480            rec(20, 16, ShortStkName ),
16481            rec(36, (1,128), StackFullNameStr ),
16482    ])
16483    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16484    # 2222/7B2A, 123/42
16485    pkt = NCP(0x7B2A, "Get Protocol Stack Statistics Information", 'stats')
16486    pkt.Request(14, [
16487            rec(10, 4, StackNumber ),
16488    ])
16489    pkt.Reply(38, [
16490            rec(8, 4, CurrentServerTime ),
16491            rec(12, 1, VConsoleVersion ),
16492            rec(13, 1, VConsoleRevision ),
16493            rec(14, 2, Reserved2 ),
16494            rec(16, 1, StatMajorVersion ),
16495            rec(17, 1, StatMinorVersion ),
16496            rec(18, 2, ComCnts ),
16497            rec(20, 4, CounterMask ),
16498            rec(24, 4, TotalTxPkts ),
16499            rec(28, 4, TotalRxPkts ),
16500            rec(32, 4, IgnoredRxPkts ),
16501            rec(36, 2, CustomCnts ),
16502    ])
16503    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16504    # 2222/7B2B, 123/43
16505    pkt = NCP(0x7B2B, "Get Protocol Stack Custom Information", 'stats')
16506    pkt.Request(18, [
16507            rec(10, 4, StackNumber ),
16508            rec(14, 4, StartNumber ),
16509    ])
16510    pkt.Reply(25, [
16511            rec(8, 4, CurrentServerTime ),
16512            rec(12, 1, VConsoleVersion ),
16513            rec(13, 1, VConsoleRevision ),
16514            rec(14, 2, Reserved2 ),
16515            rec(16, 4, CustomCount, var="x" ),
16516            rec(20, 5, CustomCntsInfo, repeat="x" ),
16517    ])
16518    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16519    # 2222/7B2C, 123/44
16520    pkt = NCP(0x7B2C, "Get Protocol Stack Numbers by Media Number", 'stats')
16521    pkt.Request(14, [
16522            rec(10, 4, MediaNumber ),
16523    ])
16524    pkt.Reply(24, [
16525            rec(8, 4, CurrentServerTime ),
16526            rec(12, 1, VConsoleVersion ),
16527            rec(13, 1, VConsoleRevision ),
16528            rec(14, 2, Reserved2 ),
16529            rec(16, 4, StackCount, var="x" ),
16530            rec(20, 4, StackNumber, repeat="x" ),
16531    ])
16532    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16533    # 2222/7B2D, 123/45
16534    pkt = NCP(0x7B2D, "Get Protocol Stack Numbers by LAN Board Number", 'stats')
16535    pkt.Request(14, [
16536            rec(10, 4, BoardNumber ),
16537    ])
16538    pkt.Reply(24, [
16539            rec(8, 4, CurrentServerTime ),
16540            rec(12, 1, VConsoleVersion ),
16541            rec(13, 1, VConsoleRevision ),
16542            rec(14, 2, Reserved2 ),
16543            rec(16, 4, StackCount, var="x" ),
16544            rec(20, 4, StackNumber, repeat="x" ),
16545    ])
16546    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16547    # 2222/7B2E, 123/46
16548    pkt = NCP(0x7B2E, "Get Media Name by Media Number", 'stats')
16549    pkt.Request(14, [
16550            rec(10, 4, MediaNumber ),
16551    ])
16552    pkt.Reply((17,144), [
16553            rec(8, 4, CurrentServerTime ),
16554            rec(12, 1, VConsoleVersion ),
16555            rec(13, 1, VConsoleRevision ),
16556            rec(14, 2, Reserved2 ),
16557            rec(16, (1,128), MediaName ),
16558    ])
16559    pkt.CompletionCodes([0x0000, 0x7900, 0x7e01, 0xfb06, 0xff00])
16560    # 2222/7B2F, 123/47
16561    pkt = NCP(0x7B2F, "Get Loaded Media Number", 'stats')
16562    pkt.Request(10)
16563    pkt.Reply(28, [
16564            rec(8, 4, CurrentServerTime ),
16565            rec(12, 1, VConsoleVersion ),
16566            rec(13, 1, VConsoleRevision ),
16567            rec(14, 2, Reserved2 ),
16568            rec(16, 4, MaxNumOfMedias ),
16569            rec(20, 4, MediaListCount, var="x" ),
16570            rec(24, 4, MediaList, repeat="x" ),
16571    ])
16572    pkt.CompletionCodes([0x0000, 0x7e01, 0xfb06, 0xff00])
16573    # 2222/7B32, 123/50
16574    pkt = NCP(0x7B32, "Get General Router and SAP Information", 'stats')
16575    pkt.Request(10)
16576    pkt.Reply(37, [
16577            rec(8, 4, CurrentServerTime ),
16578            rec(12, 1, VConsoleVersion ),
16579            rec(13, 1, VConsoleRevision ),
16580            rec(14, 2, Reserved2 ),
16581            rec(16, 2, RIPSocketNumber ),
16582            rec(18, 2, Reserved2 ),
16583            rec(20, 1, RouterDownFlag ),
16584            rec(21, 3, Reserved3 ),
16585            rec(24, 1, TrackOnFlag ),
16586            rec(25, 3, Reserved3 ),
16587            rec(28, 1, ExtRouterActiveFlag ),
16588            rec(29, 3, Reserved3 ),
16589            rec(32, 2, SAPSocketNumber ),
16590            rec(34, 2, Reserved2 ),
16591            rec(36, 1, RpyNearestSrvFlag ),
16592    ])
16593    pkt.CompletionCodes([0x0000, 0x7e01, 0xfb06, 0xff00])
16594    # 2222/7B33, 123/51
16595    pkt = NCP(0x7B33, "Get Network Router Information", 'stats')
16596    pkt.Request(14, [
16597            rec(10, 4, NetworkNumber ),
16598    ])
16599    pkt.Reply(26, [
16600            rec(8, 4, CurrentServerTime ),
16601            rec(12, 1, VConsoleVersion ),
16602            rec(13, 1, VConsoleRevision ),
16603            rec(14, 2, Reserved2 ),
16604            rec(16, 10, KnownRoutes ),
16605    ])
16606    pkt.CompletionCodes([0x0000, 0x0108, 0x7e01, 0xfb06, 0xff00])
16607    # 2222/7B34, 123/52
16608    pkt = NCP(0x7B34, "Get Network Routers Information", 'stats')
16609    pkt.Request(18, [
16610            rec(10, 4, NetworkNumber),
16611            rec(14, 4, StartNumber ),
16612    ])
16613    pkt.Reply(34, [
16614            rec(8, 4, CurrentServerTime ),
16615            rec(12, 1, VConsoleVersion ),
16616            rec(13, 1, VConsoleRevision ),
16617            rec(14, 2, Reserved2 ),
16618            rec(16, 4, NumOfEntries, var="x" ),
16619            rec(20, 14, RoutersInfo, repeat="x" ),
16620    ])
16621    pkt.CompletionCodes([0x0000, 0x0108, 0x7e01, 0xfb06, 0xff00])
16622    # 2222/7B35, 123/53
16623    pkt = NCP(0x7B35, "Get Known Networks Information", 'stats')
16624    pkt.Request(14, [
16625            rec(10, 4, StartNumber ),
16626    ])
16627    pkt.Reply(30, [
16628            rec(8, 4, CurrentServerTime ),
16629            rec(12, 1, VConsoleVersion ),
16630            rec(13, 1, VConsoleRevision ),
16631            rec(14, 2, Reserved2 ),
16632            rec(16, 4, NumOfEntries, var="x" ),
16633            rec(20, 10, KnownRoutes, repeat="x" ),
16634    ])
16635    pkt.CompletionCodes([0x0000, 0x7e01, 0xfb06, 0xff00])
16636    # 2222/7B36, 123/54
16637    pkt = NCP(0x7B36, "Get Server Information", 'stats')
16638    pkt.Request((15,64), [
16639            rec(10, 2, ServerType ),
16640            rec(12, 2, Reserved2 ),
16641            rec(14, (1,50), ServerNameLen, info_str=(ServerNameLen, "Get Server Information: %s", ", %s") ),
16642    ])
16643    pkt.Reply(30, [
16644            rec(8, 4, CurrentServerTime ),
16645            rec(12, 1, VConsoleVersion ),
16646            rec(13, 1, VConsoleRevision ),
16647            rec(14, 2, Reserved2 ),
16648            rec(16, 12, ServerAddress ),
16649            rec(28, 2, HopsToNet ),
16650    ])
16651    pkt.CompletionCodes([0x0000, 0x7e01, 0xfb06, 0xff00])
16652    # 2222/7B37, 123/55
16653    pkt = NCP(0x7B37, "Get Server Sources Information", 'stats')
16654    pkt.Request((19,68), [
16655            rec(10, 4, StartNumber ),
16656            rec(14, 2, ServerType ),
16657            rec(16, 2, Reserved2 ),
16658            rec(18, (1,50), ServerNameLen, info_str=(ServerNameLen, "Get Server Sources Info: %s", ", %s") ),
16659    ])
16660    pkt.Reply(32, [
16661            rec(8, 4, CurrentServerTime ),
16662            rec(12, 1, VConsoleVersion ),
16663            rec(13, 1, VConsoleRevision ),
16664            rec(14, 2, Reserved2 ),
16665            rec(16, 4, NumOfEntries, var="x" ),
16666            rec(20, 12, ServersSrcInfo, repeat="x" ),
16667    ])
16668    pkt.CompletionCodes([0x0000, 0x0108, 0x7e01, 0xfb06, 0xff00])
16669    # 2222/7B38, 123/56
16670    pkt = NCP(0x7B38, "Get Known Servers Information", 'stats')
16671    pkt.Request(16, [
16672            rec(10, 4, StartNumber ),
16673            rec(14, 2, ServerType ),
16674    ])
16675    pkt.Reply(35, [
16676            rec(8, 4, CurrentServerTime ),
16677            rec(12, 1, VConsoleVersion ),
16678            rec(13, 1, VConsoleRevision ),
16679            rec(14, 2, Reserved2 ),
16680            rec(16, 4, NumOfEntries, var="x" ),
16681            rec(20, 15, KnownServStruc, repeat="x" ),
16682    ])
16683    pkt.CompletionCodes([0x0000, 0x0108, 0x7e01, 0xfb06, 0xff00])
16684    # 2222/7B3C, 123/60
16685    pkt = NCP(0x7B3C, "Get Server Set Commands Information", 'stats')
16686    pkt.Request(14, [
16687            rec(10, 4, StartNumber ),
16688    ])
16689    pkt.Reply(NO_LENGTH_CHECK, [
16690            rec(8, 4, CurrentServerTime ),
16691            rec(12, 1, VConsoleVersion ),
16692            rec(13, 1, VConsoleRevision ),
16693            rec(14, 2, Reserved2 ),
16694            rec(16, 4, TtlNumOfSetCmds ),
16695            rec(20, 4, nextStartingNumber ),
16696            rec(24, 1, SetCmdType ),
16697            rec(25, 3, Reserved3 ),
16698            rec(28, 1, SetCmdCategory ),
16699            rec(29, 3, Reserved3 ),
16700            rec(32, 1, SetCmdFlags ),
16701            rec(33, 3, Reserved3 ),
16702            rec(36, PROTO_LENGTH_UNKNOWN, SetCmdName ),
16703            rec(-1, 4, SetCmdValueNum ),
16704    ])
16705    pkt.ReqCondSizeVariable()
16706    pkt.CompletionCodes([0x0000, 0x7e01, 0xfb06, 0xff00])
16707    # 2222/7B3D, 123/61
16708    pkt = NCP(0x7B3D, "Get Server Set Categories", 'stats')
16709    pkt.Request(14, [
16710            rec(10, 4, StartNumber ),
16711    ])
16712    pkt.Reply(NO_LENGTH_CHECK, [
16713            rec(8, 4, CurrentServerTime ),
16714            rec(12, 1, VConsoleVersion ),
16715            rec(13, 1, VConsoleRevision ),
16716            rec(14, 2, Reserved2 ),
16717            rec(16, 4, NumberOfSetCategories ),
16718            rec(20, 4, nextStartingNumber ),
16719            rec(24, PROTO_LENGTH_UNKNOWN, CategoryName ),
16720    ])
16721    pkt.CompletionCodes([0x0000, 0x7e01, 0xfb06, 0xff00])
16722    # 2222/7B3E, 123/62
16723    pkt = NCP(0x7B3E, "Get Server Set Commands Information By Name", 'stats')
16724    pkt.Request(NO_LENGTH_CHECK, [
16725            rec(10, PROTO_LENGTH_UNKNOWN, SetParmName, info_str=(SetParmName, "Get Server Set Command Info for: %s", ", %s") ),
16726    ])
16727    pkt.Reply(NO_LENGTH_CHECK, [
16728            rec(8, 4, CurrentServerTime ),
16729            rec(12, 1, VConsoleVersion ),
16730            rec(13, 1, VConsoleRevision ),
16731            rec(14, 2, Reserved2 ),
16732    rec(16, 4, TtlNumOfSetCmds ),
16733    rec(20, 4, nextStartingNumber ),
16734    rec(24, 1, SetCmdType ),
16735    rec(25, 3, Reserved3 ),
16736    rec(28, 1, SetCmdCategory ),
16737    rec(29, 3, Reserved3 ),
16738    rec(32, 1, SetCmdFlags ),
16739    rec(33, 3, Reserved3 ),
16740    rec(36, PROTO_LENGTH_UNKNOWN, SetCmdName ),
16741    # The value of the set command is decoded in packet-ncp2222.inc
16742    ])
16743    pkt.ReqCondSizeVariable()
16744    pkt.CompletionCodes([0x0000, 0x7e01, 0xc600, 0xfb06, 0xff22])
16745    # 2222/7B46, 123/70
16746    pkt = NCP(0x7B46, "Get Current Compressing File", 'stats')
16747    pkt.Request(14, [
16748            rec(10, 4, VolumeNumberLong ),
16749    ])
16750    pkt.Reply(56, [
16751            rec(8, 4, ParentID ),
16752            rec(12, 4, DirectoryEntryNumber ),
16753            rec(16, 4, compressionStage ),
16754            rec(20, 4, ttlIntermediateBlks ),
16755            rec(24, 4, ttlCompBlks ),
16756            rec(28, 4, curIntermediateBlks ),
16757            rec(32, 4, curCompBlks ),
16758            rec(36, 4, curInitialBlks ),
16759            rec(40, 4, fileFlags ),
16760            rec(44, 4, projectedCompSize ),
16761            rec(48, 4, originalSize ),
16762            rec(52, 4, compressVolume ),
16763    ])
16764    pkt.CompletionCodes([0x0000, 0x7e00, 0x7901, 0x9801, 0xfb06, 0xff00])
16765    # 2222/7B47, 123/71
16766    pkt = NCP(0x7B47, "Get Current DeCompressing File Info List", 'stats')
16767    pkt.Request(14, [
16768            rec(10, 4, VolumeNumberLong ),
16769    ])
16770    pkt.Reply(24, [
16771            #rec(8, 4, FileListCount ),
16772            rec(8, 16, FileInfoStruct ),
16773    ])
16774    pkt.CompletionCodes([0x0000, 0x7e00, 0x9801, 0xfb06, 0xff00])
16775    # 2222/7B48, 123/72
16776    pkt = NCP(0x7B48, "Get Compression and Decompression Time and Counts", 'stats')
16777    pkt.Request(14, [
16778            rec(10, 4, VolumeNumberLong ),
16779    ])
16780    pkt.Reply(64, [
16781            rec(8, 56, CompDeCompStat ),
16782    ])
16783    pkt.CompletionCodes([0x0000, 0x7e00, 0x9801, 0xfb06, 0xff00])
16784    # 2222/7BF9, 123/249
16785    pkt = NCP(0x7BF9, "Set Alert Notification", 'stats')
16786    pkt.Request(10)
16787    pkt.Reply(8)
16788    pkt.CompletionCodes([0x0000, 0x7e00, 0xfb06, 0xff00])
16789    # 2222/7BFB, 123/251
16790    pkt = NCP(0x7BFB, "Get Item Configuration Information", 'stats')
16791    pkt.Request(10)
16792    pkt.Reply(8)
16793    pkt.CompletionCodes([0x0000, 0x7e00, 0xfb06, 0xff00])
16794    # 2222/7BFC, 123/252
16795    pkt = NCP(0x7BFC, "Get Subject Item ID List", 'stats')
16796    pkt.Request(10)
16797    pkt.Reply(8)
16798    pkt.CompletionCodes([0x0000, 0x7e00, 0xfb06, 0xff00])
16799    # 2222/7BFD, 123/253
16800    pkt = NCP(0x7BFD, "Get Subject Item List Count", 'stats')
16801    pkt.Request(10)
16802    pkt.Reply(8)
16803    pkt.CompletionCodes([0x0000, 0x7e00, 0xfb06, 0xff00])
16804    # 2222/7BFE, 123/254
16805    pkt = NCP(0x7BFE, "Get Subject ID List", 'stats')
16806    pkt.Request(10)
16807    pkt.Reply(8)
16808    pkt.CompletionCodes([0x0000, 0x7e00, 0xfb06, 0xff00])
16809    # 2222/7BFF, 123/255
16810    pkt = NCP(0x7BFF, "Get Number of NetMan Subjects", 'stats')
16811    pkt.Request(10)
16812    pkt.Reply(8)
16813    pkt.CompletionCodes([0x0000, 0x7e00, 0xfb06, 0xff00])
16814    # 2222/8301, 131/01
16815    pkt = NCP(0x8301, "RPC Load an NLM", 'remote')
16816    pkt.Request(NO_LENGTH_CHECK, [
16817            rec(10, 4, NLMLoadOptions ),
16818            rec(14, 16, Reserved16 ),
16819            rec(30, PROTO_LENGTH_UNKNOWN, PathAndName, info_str=(PathAndName, "RPC Load NLM: %s", ", %s") ),
16820    ])
16821    pkt.Reply(12, [
16822            rec(8, 4, RPCccode ),
16823    ])
16824    pkt.CompletionCodes([0x0000, 0x7c00, 0x7e00, 0xfb07, 0xff00])
16825    # 2222/8302, 131/02
16826    pkt = NCP(0x8302, "RPC Unload an NLM", 'remote')
16827    pkt.Request(NO_LENGTH_CHECK, [
16828            rec(10, 20, Reserved20 ),
16829            rec(30, PROTO_LENGTH_UNKNOWN, NLMName, info_str=(NLMName, "RPC Unload NLM: %s", ", %s") ),
16830    ])
16831    pkt.Reply(12, [
16832            rec(8, 4, RPCccode ),
16833    ])
16834    pkt.CompletionCodes([0x0000, 0x7c00, 0x7e00, 0xfb07, 0xff00])
16835    # 2222/8303, 131/03
16836    pkt = NCP(0x8303, "RPC Mount Volume", 'remote')
16837    pkt.Request(NO_LENGTH_CHECK, [
16838            rec(10, 20, Reserved20 ),
16839            rec(30, PROTO_LENGTH_UNKNOWN, VolumeNameStringz, info_str=(VolumeNameStringz, "RPC Mount Volume: %s", ", %s") ),
16840    ])
16841    pkt.Reply(32, [
16842            rec(8, 4, RPCccode),
16843            rec(12, 16, Reserved16 ),
16844            rec(28, 4, VolumeNumberLong ),
16845    ])
16846    pkt.CompletionCodes([0x0000, 0x7e00, 0xfb07, 0xff00])
16847    # 2222/8304, 131/04
16848    pkt = NCP(0x8304, "RPC Dismount Volume", 'remote')
16849    pkt.Request(NO_LENGTH_CHECK, [
16850            rec(10, 20, Reserved20 ),
16851            rec(30, PROTO_LENGTH_UNKNOWN, VolumeNameStringz, info_str=(VolumeNameStringz, "RPC Dismount Volume: %s", ", %s") ),
16852    ])
16853    pkt.Reply(12, [
16854            rec(8, 4, RPCccode ),
16855    ])
16856    pkt.CompletionCodes([0x0000, 0x7e00, 0xfb07, 0xff00])
16857    # 2222/8305, 131/05
16858    pkt = NCP(0x8305, "RPC Add Name Space To Volume", 'remote')
16859    pkt.Request(NO_LENGTH_CHECK, [
16860            rec(10, 20, Reserved20 ),
16861            rec(30, PROTO_LENGTH_UNKNOWN, AddNameSpaceAndVol, info_str=(AddNameSpaceAndVol, "RPC Add Name Space to Volume: %s", ", %s") ),
16862    ])
16863    pkt.Reply(12, [
16864            rec(8, 4, RPCccode ),
16865    ])
16866    pkt.CompletionCodes([0x0000, 0x7e00, 0xfb07, 0xff00])
16867    # 2222/8306, 131/06
16868    pkt = NCP(0x8306, "RPC Set Command Value", 'remote')
16869    pkt.Request(NO_LENGTH_CHECK, [
16870            rec(10, 1, SetCmdType ),
16871            rec(11, 3, Reserved3 ),
16872            rec(14, 4, SetCmdValueNum ),
16873            rec(18, 12, Reserved12 ),
16874            rec(30, PROTO_LENGTH_UNKNOWN, SetCmdName, info_str=(SetCmdName, "RPC Set Command Value: %s", ", %s") ),
16875            #
16876            # XXX - optional string, if SetCmdType is 0
16877            #
16878    ])
16879    pkt.Reply(12, [
16880            rec(8, 4, RPCccode ),
16881    ])
16882    pkt.CompletionCodes([0x0000, 0x7e00, 0xfb07, 0xff00])
16883    # 2222/8307, 131/07
16884    pkt = NCP(0x8307, "RPC Execute NCF File", 'remote')
16885    pkt.Request(NO_LENGTH_CHECK, [
16886            rec(10, 20, Reserved20 ),
16887            rec(30, PROTO_LENGTH_UNKNOWN, PathAndName, info_str=(PathAndName, "RPC Execute NCF File: %s", ", %s") ),
16888    ])
16889    pkt.Reply(12, [
16890            rec(8, 4, RPCccode ),
16891    ])
16892    pkt.CompletionCodes([0x0000, 0x7e00, 0xfb07, 0xff00])
16893if __name__ == '__main__':
16894#       import profile
16895#       filename = "ncp.pstats"
16896#       profile.run("main()", filename)
16897#
16898#       import pstats
16899#       sys.stdout = msg
16900#       p = pstats.Stats(filename)
16901#
16902#       print "Stats sorted by cumulative time"
16903#       p.strip_dirs().sort_stats('cumulative').print_stats()
16904#
16905#       print "Function callees"
16906#       p.print_callees()
16907    main()
16908
16909#
16910# Editor modelines  -  https://www.wireshark.org/tools/modelines.html
16911#
16912# Local variables:
16913# c-basic-offset: 4
16914# indent-tabs-mode: nil
16915# End:
16916#
16917# vi: set shiftwidth=4 expandtab:
16918# :indentSize=4:noTabs=true:
16919#
16920