### ms-wkst.idl
"""
RPC definitions for the following interfaces:
- wkssvc (v1.0): 6BFFD098-A112-3610-9833-46C3F87E345A
This file is auto-generated by midl-to-scapy, do not modify.
"""

from enum import IntEnum
import uuid

from scapy.fields import StrFixedLenField
from scapy.layers.dcerpc import (
    NDRPacket,
    DceRpcOp,
    NDRConfPacketListField,
    NDRConfStrLenField,
    NDRConfVarStrLenField,
    NDRConfVarStrLenFieldUtf16,
    NDRConfVarStrNullField,
    NDRConfVarStrNullFieldUtf16,
    NDRFullPointerField,
    NDRInt3264EnumField,
    NDRIntField,
    NDRPacketField,
    NDRShortField,
    NDRSignedIntField,
    NDRSignedLongField,
    NDRUnionField,
    register_dcerpc_interface,
)


class LPWKSTA_INFO_100(NDRPacket):
    ALIGNMENT = (4, 8)
    fields_desc = [
        NDRIntField("wki100_platform_id", 0),
        NDRFullPointerField(
            NDRConfVarStrNullFieldUtf16("wki100_computername", ""), deferred=True
        ),
        NDRFullPointerField(
            NDRConfVarStrNullFieldUtf16("wki100_langroup", ""), deferred=True
        ),
        NDRIntField("wki100_ver_major", 0),
        NDRIntField("wki100_ver_minor", 0),
    ]


class LPWKSTA_INFO_101(NDRPacket):
    ALIGNMENT = (4, 8)
    fields_desc = [
        NDRIntField("wki101_platform_id", 0),
        NDRFullPointerField(
            NDRConfVarStrNullFieldUtf16("wki101_computername", ""), deferred=True
        ),
        NDRFullPointerField(
            NDRConfVarStrNullFieldUtf16("wki101_langroup", ""), deferred=True
        ),
        NDRIntField("wki101_ver_major", 0),
        NDRIntField("wki101_ver_minor", 0),
        NDRFullPointerField(
            NDRConfVarStrNullFieldUtf16("wki101_lanroot", ""), deferred=True
        ),
    ]


class LPWKSTA_INFO_102(NDRPacket):
    ALIGNMENT = (4, 8)
    fields_desc = [
        NDRIntField("wki102_platform_id", 0),
        NDRFullPointerField(
            NDRConfVarStrNullFieldUtf16("wki102_computername", ""), deferred=True
        ),
        NDRFullPointerField(
            NDRConfVarStrNullFieldUtf16("wki102_langroup", ""), deferred=True
        ),
        NDRIntField("wki102_ver_major", 0),
        NDRIntField("wki102_ver_minor", 0),
        NDRFullPointerField(
            NDRConfVarStrNullFieldUtf16("wki102_lanroot", ""), deferred=True
        ),
        NDRIntField("wki102_logged_on_users", 0),
    ]


class LPWKSTA_INFO_502(NDRPacket):
    ALIGNMENT = (4, 4)
    fields_desc = [
        NDRIntField("wki502_char_wait", 0),
        NDRIntField("wki502_collection_time", 0),
        NDRIntField("wki502_maximum_collection_count", 0),
        NDRIntField("wki502_keep_conn", 0),
        NDRIntField("wki502_max_cmds", 0),
        NDRIntField("wki502_sess_timeout", 0),
        NDRIntField("wki502_siz_char_buf", 0),
        NDRIntField("wki502_max_threads", 0),
        NDRIntField("wki502_lock_quota", 0),
        NDRIntField("wki502_lock_increment", 0),
        NDRIntField("wki502_lock_maximum", 0),
        NDRIntField("wki502_pipe_increment", 0),
        NDRIntField("wki502_pipe_maximum", 0),
        NDRIntField("wki502_cache_file_timeout", 0),
        NDRIntField("wki502_dormant_file_limit", 0),
        NDRIntField("wki502_read_ahead_throughput", 0),
        NDRIntField("wki502_num_mailslot_buffers", 0),
        NDRIntField("wki502_num_srv_announce_buffers", 0),
        NDRIntField("wki502_max_illegal_datagram_events", 0),
        NDRIntField("wki502_illegal_datagram_event_reset_frequency", 0),
        NDRSignedIntField("wki502_log_election_packets", 0),
        NDRSignedIntField("wki502_use_opportunistic_locking", 0),
        NDRSignedIntField("wki502_use_unlock_behind", 0),
        NDRSignedIntField("wki502_use_close_behind", 0),
        NDRSignedIntField("wki502_buf_named_pipes", 0),
        NDRSignedIntField("wki502_use_lock_read_unlock", 0),
        NDRSignedIntField("wki502_utilize_nt_caching", 0),
        NDRSignedIntField("wki502_use_raw_read", 0),
        NDRSignedIntField("wki502_use_raw_write", 0),
        NDRSignedIntField("wki502_use_write_raw_data", 0),
        NDRSignedIntField("wki502_use_encryption", 0),
        NDRSignedIntField("wki502_buf_files_deny_write", 0),
        NDRSignedIntField("wki502_buf_read_only_files", 0),
        NDRSignedIntField("wki502_force_core_create_mode", 0),
        NDRSignedIntField("wki502_use_512_byte_max_transfer", 0),
    ]


class LPWKSTA_INFO_1013(NDRPacket):
    ALIGNMENT = (4, 4)
    fields_desc = [NDRIntField("wki1013_keep_conn", 0)]


class LPWKSTA_INFO_1018(NDRPacket):
    ALIGNMENT = (4, 4)
    fields_desc = [NDRIntField("wki1018_sess_timeout", 0)]


class LPWKSTA_INFO_1046(NDRPacket):
    ALIGNMENT = (4, 4)
    fields_desc = [NDRIntField("wki1046_dormant_file_limit", 0)]


class NetrWkstaGetInfo_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("ServerName", "")),
        NDRIntField("Level", 0),
    ]


class NetrWkstaGetInfo_Response(NDRPacket):
    fields_desc = [
        NDRUnionField(
            [
                (
                    NDRFullPointerField(
                        NDRPacketField(
                            "WkstaInfo", LPWKSTA_INFO_100(), LPWKSTA_INFO_100
                        )
                    ),
                    (
                        (lambda pkt: getattr(pkt, "Level", None) == 100),
                        (lambda _, val: val.tag == 100),
                    ),
                ),
                (
                    NDRFullPointerField(
                        NDRPacketField(
                            "WkstaInfo", LPWKSTA_INFO_101(), LPWKSTA_INFO_101
                        )
                    ),
                    (
                        (lambda pkt: getattr(pkt, "Level", None) == 101),
                        (lambda _, val: val.tag == 101),
                    ),
                ),
                (
                    NDRFullPointerField(
                        NDRPacketField(
                            "WkstaInfo", LPWKSTA_INFO_102(), LPWKSTA_INFO_102
                        )
                    ),
                    (
                        (lambda pkt: getattr(pkt, "Level", None) == 102),
                        (lambda _, val: val.tag == 102),
                    ),
                ),
                (
                    NDRFullPointerField(
                        NDRPacketField(
                            "WkstaInfo", LPWKSTA_INFO_502(), LPWKSTA_INFO_502
                        )
                    ),
                    (
                        (lambda pkt: getattr(pkt, "Level", None) == 502),
                        (lambda _, val: val.tag == 502),
                    ),
                ),
                (
                    NDRFullPointerField(
                        NDRPacketField(
                            "WkstaInfo", LPWKSTA_INFO_1013(), LPWKSTA_INFO_1013
                        )
                    ),
                    (
                        (lambda pkt: getattr(pkt, "Level", None) == 1013),
                        (lambda _, val: val.tag == 1013),
                    ),
                ),
                (
                    NDRFullPointerField(
                        NDRPacketField(
                            "WkstaInfo", LPWKSTA_INFO_1018(), LPWKSTA_INFO_1018
                        )
                    ),
                    (
                        (lambda pkt: getattr(pkt, "Level", None) == 1018),
                        (lambda _, val: val.tag == 1018),
                    ),
                ),
                (
                    NDRFullPointerField(
                        NDRPacketField(
                            "WkstaInfo", LPWKSTA_INFO_1046(), LPWKSTA_INFO_1046
                        )
                    ),
                    (
                        (lambda pkt: getattr(pkt, "Level", None) == 1046),
                        (lambda _, val: val.tag == 1046),
                    ),
                ),
            ],
            StrFixedLenField("WkstaInfo", "", length=0),
            align=(4, 8),
            switch_fmt=("L", "L"),
        ),
        NDRIntField("status", 0),
    ]


class NetrWkstaSetInfo_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("ServerName", "")),
        NDRIntField("Level", 0),
        NDRUnionField(
            [
                (
                    NDRFullPointerField(
                        NDRPacketField(
                            "WkstaInfo", LPWKSTA_INFO_100(), LPWKSTA_INFO_100
                        )
                    ),
                    (
                        (lambda pkt: getattr(pkt, "Level", None) == 100),
                        (lambda _, val: val.tag == 100),
                    ),
                ),
                (
                    NDRFullPointerField(
                        NDRPacketField(
                            "WkstaInfo", LPWKSTA_INFO_101(), LPWKSTA_INFO_101
                        )
                    ),
                    (
                        (lambda pkt: getattr(pkt, "Level", None) == 101),
                        (lambda _, val: val.tag == 101),
                    ),
                ),
                (
                    NDRFullPointerField(
                        NDRPacketField(
                            "WkstaInfo", LPWKSTA_INFO_102(), LPWKSTA_INFO_102
                        )
                    ),
                    (
                        (lambda pkt: getattr(pkt, "Level", None) == 102),
                        (lambda _, val: val.tag == 102),
                    ),
                ),
                (
                    NDRFullPointerField(
                        NDRPacketField(
                            "WkstaInfo", LPWKSTA_INFO_502(), LPWKSTA_INFO_502
                        )
                    ),
                    (
                        (lambda pkt: getattr(pkt, "Level", None) == 502),
                        (lambda _, val: val.tag == 502),
                    ),
                ),
                (
                    NDRFullPointerField(
                        NDRPacketField(
                            "WkstaInfo", LPWKSTA_INFO_1013(), LPWKSTA_INFO_1013
                        )
                    ),
                    (
                        (lambda pkt: getattr(pkt, "Level", None) == 1013),
                        (lambda _, val: val.tag == 1013),
                    ),
                ),
                (
                    NDRFullPointerField(
                        NDRPacketField(
                            "WkstaInfo", LPWKSTA_INFO_1018(), LPWKSTA_INFO_1018
                        )
                    ),
                    (
                        (lambda pkt: getattr(pkt, "Level", None) == 1018),
                        (lambda _, val: val.tag == 1018),
                    ),
                ),
                (
                    NDRFullPointerField(
                        NDRPacketField(
                            "WkstaInfo", LPWKSTA_INFO_1046(), LPWKSTA_INFO_1046
                        )
                    ),
                    (
                        (lambda pkt: getattr(pkt, "Level", None) == 1046),
                        (lambda _, val: val.tag == 1046),
                    ),
                ),
            ],
            StrFixedLenField("WkstaInfo", "", length=0),
            align=(4, 8),
            switch_fmt=("L", "L"),
        ),
        NDRFullPointerField(NDRIntField("ErrorParameter", 0)),
    ]


class NetrWkstaSetInfo_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRIntField("ErrorParameter", 0)),
        NDRIntField("status", 0),
    ]


class LPWKSTA_USER_INFO_0(NDRPacket):
    ALIGNMENT = (4, 8)
    fields_desc = [
        NDRFullPointerField(
            NDRConfVarStrNullFieldUtf16("wkui0_username", ""), deferred=True
        )
    ]


class LPWKSTA_USER_INFO_0_CONTAINER(NDRPacket):
    ALIGNMENT = (4, 8)
    fields_desc = [
        NDRIntField("EntriesRead", None, size_of="Buffer"),
        NDRFullPointerField(
            NDRConfPacketListField(
                "Buffer",
                [LPWKSTA_USER_INFO_0()],
                LPWKSTA_USER_INFO_0,
                size_is=lambda pkt: pkt.EntriesRead,
            ),
            deferred=True,
        ),
    ]


class LPWKSTA_USER_INFO_1(NDRPacket):
    ALIGNMENT = (4, 8)
    fields_desc = [
        NDRFullPointerField(
            NDRConfVarStrNullFieldUtf16("wkui1_username", ""), deferred=True
        ),
        NDRFullPointerField(
            NDRConfVarStrNullFieldUtf16("wkui1_logon_domain", ""), deferred=True
        ),
        NDRFullPointerField(
            NDRConfVarStrNullFieldUtf16("wkui1_oth_domains", ""), deferred=True
        ),
        NDRFullPointerField(
            NDRConfVarStrNullFieldUtf16("wkui1_logon_server", ""), deferred=True
        ),
    ]


class LPWKSTA_USER_INFO_1_CONTAINER(NDRPacket):
    ALIGNMENT = (4, 8)
    fields_desc = [
        NDRIntField("EntriesRead", None, size_of="Buffer"),
        NDRFullPointerField(
            NDRConfPacketListField(
                "Buffer",
                [LPWKSTA_USER_INFO_1()],
                LPWKSTA_USER_INFO_1,
                size_is=lambda pkt: pkt.EntriesRead,
            ),
            deferred=True,
        ),
    ]


class LPWKSTA_USER_ENUM_STRUCT(NDRPacket):
    ALIGNMENT = (4, 8)
    fields_desc = [
        NDRIntField("Level", 0),
        NDRUnionField(
            [
                (
                    NDRFullPointerField(
                        NDRPacketField(
                            "WkstaUserInfo",
                            LPWKSTA_USER_INFO_0_CONTAINER(),
                            LPWKSTA_USER_INFO_0_CONTAINER,
                        ),
                        deferred=True,
                    ),
                    (
                        (lambda pkt: getattr(pkt, "Level", None) == 0),
                        (lambda _, val: val.tag == 0),
                    ),
                ),
                (
                    NDRFullPointerField(
                        NDRPacketField(
                            "WkstaUserInfo",
                            LPWKSTA_USER_INFO_1_CONTAINER(),
                            LPWKSTA_USER_INFO_1_CONTAINER,
                        ),
                        deferred=True,
                    ),
                    (
                        (lambda pkt: getattr(pkt, "Level", None) == 1),
                        (lambda _, val: val.tag == 1),
                    ),
                ),
            ],
            StrFixedLenField("WkstaUserInfo", "", length=0),
            align=(4, 8),
            switch_fmt=("L", "L"),
        ),
    ]


class NetrWkstaUserEnum_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("ServerName", "")),
        NDRPacketField(
            "UserInfo", LPWKSTA_USER_ENUM_STRUCT(), LPWKSTA_USER_ENUM_STRUCT
        ),
        NDRIntField("PreferredMaximumLength", 0),
        NDRFullPointerField(NDRIntField("ResumeHandle", 0)),
    ]


class NetrWkstaUserEnum_Response(NDRPacket):
    fields_desc = [
        NDRPacketField(
            "UserInfo", LPWKSTA_USER_ENUM_STRUCT(), LPWKSTA_USER_ENUM_STRUCT
        ),
        NDRIntField("TotalEntries", 0),
        NDRFullPointerField(NDRIntField("ResumeHandle", 0)),
        NDRIntField("status", 0),
    ]


class LPWKSTA_TRANSPORT_INFO_0(NDRPacket):
    ALIGNMENT = (4, 8)
    fields_desc = [
        NDRIntField("wkti0_quality_of_service", 0),
        NDRIntField("wkti0_number_of_vcs", 0),
        NDRFullPointerField(
            NDRConfVarStrNullFieldUtf16("wkti0_transport_name", ""), deferred=True
        ),
        NDRFullPointerField(
            NDRConfVarStrNullFieldUtf16("wkti0_transport_address", ""), deferred=True
        ),
        NDRIntField("wkti0_wan_ish", 0),
    ]


class LPWKSTA_TRANSPORT_INFO_0_CONTAINER(NDRPacket):
    ALIGNMENT = (4, 8)
    fields_desc = [
        NDRIntField("EntriesRead", None, size_of="Buffer"),
        NDRFullPointerField(
            NDRConfPacketListField(
                "Buffer",
                [LPWKSTA_TRANSPORT_INFO_0()],
                LPWKSTA_TRANSPORT_INFO_0,
                size_is=lambda pkt: pkt.EntriesRead,
            ),
            deferred=True,
        ),
    ]


class LPWKSTA_TRANSPORT_ENUM_STRUCT(NDRPacket):
    ALIGNMENT = (4, 8)
    fields_desc = [
        NDRIntField("Level", 0),
        NDRUnionField(
            [
                (
                    NDRFullPointerField(
                        NDRPacketField(
                            "WkstaTransportInfo",
                            LPWKSTA_TRANSPORT_INFO_0_CONTAINER(),
                            LPWKSTA_TRANSPORT_INFO_0_CONTAINER,
                        ),
                        deferred=True,
                    ),
                    (
                        (lambda pkt: getattr(pkt, "Level", None) == 0),
                        (lambda _, val: val.tag == 0),
                    ),
                )
            ],
            StrFixedLenField("WkstaTransportInfo", "", length=0),
            align=(4, 8),
            switch_fmt=("L", "L"),
        ),
    ]


class NetrWkstaTransportEnum_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("ServerName", "")),
        NDRPacketField(
            "TransportInfo",
            LPWKSTA_TRANSPORT_ENUM_STRUCT(),
            LPWKSTA_TRANSPORT_ENUM_STRUCT,
        ),
        NDRIntField("PreferredMaximumLength", 0),
        NDRFullPointerField(NDRIntField("ResumeHandle", 0)),
    ]


class NetrWkstaTransportEnum_Response(NDRPacket):
    fields_desc = [
        NDRPacketField(
            "TransportInfo",
            LPWKSTA_TRANSPORT_ENUM_STRUCT(),
            LPWKSTA_TRANSPORT_ENUM_STRUCT,
        ),
        NDRIntField("TotalEntries", 0),
        NDRFullPointerField(NDRIntField("ResumeHandle", 0)),
        NDRIntField("status", 0),
    ]


class NetrWkstaTransportAdd_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("ServerName", "")),
        NDRIntField("Level", 0),
        NDRPacketField(
            "TransportInfo", LPWKSTA_TRANSPORT_INFO_0(), LPWKSTA_TRANSPORT_INFO_0
        ),
        NDRFullPointerField(NDRIntField("ErrorParameter", 0)),
    ]


class NetrWkstaTransportAdd_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRIntField("ErrorParameter", 0)),
        NDRIntField("status", 0),
    ]


class NetrWkstaTransportDel_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("ServerName", "")),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("TransportName", "")),
        NDRIntField("ForceLevel", 0),
    ]


class NetrWkstaTransportDel_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class LPUSE_INFO_0(NDRPacket):
    ALIGNMENT = (4, 8)
    fields_desc = [
        NDRFullPointerField(
            NDRConfVarStrNullFieldUtf16("ui0_local", ""), deferred=True
        ),
        NDRFullPointerField(
            NDRConfVarStrNullFieldUtf16("ui0_remote", ""), deferred=True
        ),
    ]


class LPUSE_INFO_1(NDRPacket):
    ALIGNMENT = (4, 8)
    fields_desc = [
        NDRFullPointerField(
            NDRConfVarStrNullFieldUtf16("ui1_local", ""), deferred=True
        ),
        NDRFullPointerField(
            NDRConfVarStrNullFieldUtf16("ui1_remote", ""), deferred=True
        ),
        NDRFullPointerField(
            NDRConfVarStrNullFieldUtf16("ui1_password", ""), deferred=True
        ),
        NDRIntField("ui1_status", 0),
        NDRIntField("ui1_asg_type", 0),
        NDRIntField("ui1_refcount", 0),
        NDRIntField("ui1_usecount", 0),
    ]


class USE_INFO_1(NDRPacket):
    ALIGNMENT = (4, 8)
    fields_desc = [
        NDRFullPointerField(
            NDRConfVarStrNullFieldUtf16("ui1_local", ""), deferred=True
        ),
        NDRFullPointerField(
            NDRConfVarStrNullFieldUtf16("ui1_remote", ""), deferred=True
        ),
        NDRFullPointerField(
            NDRConfVarStrNullFieldUtf16("ui1_password", ""), deferred=True
        ),
        NDRIntField("ui1_status", 0),
        NDRIntField("ui1_asg_type", 0),
        NDRIntField("ui1_refcount", 0),
        NDRIntField("ui1_usecount", 0),
    ]


class LPUSE_INFO_2(NDRPacket):
    ALIGNMENT = (4, 8)
    fields_desc = [
        NDRPacketField("ui2_useinfo", USE_INFO_1(), USE_INFO_1),
        NDRFullPointerField(
            NDRConfVarStrNullFieldUtf16("ui2_username", ""), deferred=True
        ),
        NDRFullPointerField(
            NDRConfVarStrNullFieldUtf16("ui2_domainname", ""), deferred=True
        ),
    ]


class USE_INFO_2(NDRPacket):
    ALIGNMENT = (4, 8)
    fields_desc = [
        NDRPacketField("ui2_useinfo", USE_INFO_1(), USE_INFO_1),
        NDRFullPointerField(
            NDRConfVarStrNullFieldUtf16("ui2_username", ""), deferred=True
        ),
        NDRFullPointerField(
            NDRConfVarStrNullFieldUtf16("ui2_domainname", ""), deferred=True
        ),
    ]


class LPUSE_INFO_3(NDRPacket):
    ALIGNMENT = (4, 8)
    fields_desc = [
        NDRPacketField("ui3_ui2", USE_INFO_2(), USE_INFO_2),
        NDRIntField("ui3_flags", 0),
    ]


class NetrUseAdd_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("ServerName", "")),
        NDRIntField("Level", 0),
        NDRUnionField(
            [
                (
                    NDRFullPointerField(
                        NDRPacketField("InfoStruct", LPUSE_INFO_0(), LPUSE_INFO_0)
                    ),
                    (
                        (lambda pkt: getattr(pkt, "Level", None) == 0),
                        (lambda _, val: val.tag == 0),
                    ),
                ),
                (
                    NDRFullPointerField(
                        NDRPacketField("InfoStruct", LPUSE_INFO_1(), LPUSE_INFO_1)
                    ),
                    (
                        (lambda pkt: getattr(pkt, "Level", None) == 1),
                        (lambda _, val: val.tag == 1),
                    ),
                ),
                (
                    NDRFullPointerField(
                        NDRPacketField("InfoStruct", LPUSE_INFO_2(), LPUSE_INFO_2)
                    ),
                    (
                        (lambda pkt: getattr(pkt, "Level", None) == 2),
                        (lambda _, val: val.tag == 2),
                    ),
                ),
                (
                    NDRFullPointerField(
                        NDRPacketField("InfoStruct", LPUSE_INFO_3(), LPUSE_INFO_3)
                    ),
                    (
                        (lambda pkt: getattr(pkt, "Level", None) == 3),
                        (lambda _, val: val.tag == 3),
                    ),
                ),
            ],
            StrFixedLenField("InfoStruct", "", length=0),
            align=(4, 8),
            switch_fmt=("L", "L"),
        ),
        NDRFullPointerField(NDRIntField("ErrorParameter", 0)),
    ]


class NetrUseAdd_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRIntField("ErrorParameter", 0)),
        NDRIntField("status", 0),
    ]


class NetrUseGetInfo_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("ServerName", "")),
        NDRConfVarStrNullFieldUtf16("UseName", ""),
        NDRIntField("Level", 0),
    ]


class NetrUseGetInfo_Response(NDRPacket):
    fields_desc = [
        NDRUnionField(
            [
                (
                    NDRFullPointerField(
                        NDRPacketField("InfoStruct", LPUSE_INFO_0(), LPUSE_INFO_0)
                    ),
                    (
                        (lambda pkt: getattr(pkt, "Level", None) == 0),
                        (lambda _, val: val.tag == 0),
                    ),
                ),
                (
                    NDRFullPointerField(
                        NDRPacketField("InfoStruct", LPUSE_INFO_1(), LPUSE_INFO_1)
                    ),
                    (
                        (lambda pkt: getattr(pkt, "Level", None) == 1),
                        (lambda _, val: val.tag == 1),
                    ),
                ),
                (
                    NDRFullPointerField(
                        NDRPacketField("InfoStruct", LPUSE_INFO_2(), LPUSE_INFO_2)
                    ),
                    (
                        (lambda pkt: getattr(pkt, "Level", None) == 2),
                        (lambda _, val: val.tag == 2),
                    ),
                ),
                (
                    NDRFullPointerField(
                        NDRPacketField("InfoStruct", LPUSE_INFO_3(), LPUSE_INFO_3)
                    ),
                    (
                        (lambda pkt: getattr(pkt, "Level", None) == 3),
                        (lambda _, val: val.tag == 3),
                    ),
                ),
            ],
            StrFixedLenField("InfoStruct", "", length=0),
            align=(4, 8),
            switch_fmt=("L", "L"),
        ),
        NDRIntField("status", 0),
    ]


class NetrUseDel_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("ServerName", "")),
        NDRConfVarStrNullFieldUtf16("UseName", ""),
        NDRIntField("ForceLevel", 0),
    ]


class NetrUseDel_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class LPUSE_INFO_0_CONTAINER(NDRPacket):
    ALIGNMENT = (4, 8)
    fields_desc = [
        NDRIntField("EntriesRead", 0),
        NDRFullPointerField(
            NDRPacketField("Buffer", LPUSE_INFO_0(), LPUSE_INFO_0), deferred=True
        ),
    ]


class LPUSE_INFO_1_CONTAINER(NDRPacket):
    ALIGNMENT = (4, 8)
    fields_desc = [
        NDRIntField("EntriesRead", 0),
        NDRFullPointerField(
            NDRPacketField("Buffer", LPUSE_INFO_1(), LPUSE_INFO_1), deferred=True
        ),
    ]


class LPUSE_INFO_2_CONTAINER(NDRPacket):
    ALIGNMENT = (4, 8)
    fields_desc = [
        NDRIntField("EntriesRead", 0),
        NDRFullPointerField(
            NDRPacketField("Buffer", LPUSE_INFO_2(), LPUSE_INFO_2), deferred=True
        ),
    ]


class LPUSE_ENUM_STRUCT(NDRPacket):
    ALIGNMENT = (4, 8)
    fields_desc = [
        NDRIntField("Level", 0),
        NDRUnionField(
            [
                (
                    NDRFullPointerField(
                        NDRPacketField(
                            "UseInfo", LPUSE_INFO_0_CONTAINER(), LPUSE_INFO_0_CONTAINER
                        ),
                        deferred=True,
                    ),
                    (
                        (lambda pkt: getattr(pkt, "Level", None) == 0),
                        (lambda _, val: val.tag == 0),
                    ),
                ),
                (
                    NDRFullPointerField(
                        NDRPacketField(
                            "UseInfo", LPUSE_INFO_1_CONTAINER(), LPUSE_INFO_1_CONTAINER
                        ),
                        deferred=True,
                    ),
                    (
                        (lambda pkt: getattr(pkt, "Level", None) == 1),
                        (lambda _, val: val.tag == 1),
                    ),
                ),
                (
                    NDRFullPointerField(
                        NDRPacketField(
                            "UseInfo", LPUSE_INFO_2_CONTAINER(), LPUSE_INFO_2_CONTAINER
                        ),
                        deferred=True,
                    ),
                    (
                        (lambda pkt: getattr(pkt, "Level", None) == 2),
                        (lambda _, val: val.tag == 2),
                    ),
                ),
            ],
            StrFixedLenField("UseInfo", "", length=0),
            align=(4, 8),
            switch_fmt=("L", "L"),
        ),
    ]


class NetrUseEnum_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("ServerName", "")),
        NDRPacketField("InfoStruct", LPUSE_ENUM_STRUCT(), LPUSE_ENUM_STRUCT),
        NDRIntField("PreferredMaximumLength", 0),
        NDRFullPointerField(NDRIntField("ResumeHandle", 0)),
    ]


class NetrUseEnum_Response(NDRPacket):
    fields_desc = [
        NDRPacketField("InfoStruct", LPUSE_ENUM_STRUCT(), LPUSE_ENUM_STRUCT),
        NDRIntField("TotalEntries", 0),
        NDRFullPointerField(NDRIntField("ResumeHandle", 0)),
        NDRIntField("status", 0),
    ]


class LARGE_INTEGER(NDRPacket):
    ALIGNMENT = (8, 8)
    fields_desc = [NDRSignedLongField("QuadPart", 0)]


class LPSTAT_WORKSTATION_0(NDRPacket):
    ALIGNMENT = (8, 8)
    fields_desc = [
        NDRPacketField("StatisticsStartTime", LARGE_INTEGER(), LARGE_INTEGER),
        NDRPacketField("BytesReceived", LARGE_INTEGER(), LARGE_INTEGER),
        NDRPacketField("SmbsReceived", LARGE_INTEGER(), LARGE_INTEGER),
        NDRPacketField("PagingReadBytesRequested", LARGE_INTEGER(), LARGE_INTEGER),
        NDRPacketField("NonPagingReadBytesRequested", LARGE_INTEGER(), LARGE_INTEGER),
        NDRPacketField("CacheReadBytesRequested", LARGE_INTEGER(), LARGE_INTEGER),
        NDRPacketField("NetworkReadBytesRequested", LARGE_INTEGER(), LARGE_INTEGER),
        NDRPacketField("BytesTransmitted", LARGE_INTEGER(), LARGE_INTEGER),
        NDRPacketField("SmbsTransmitted", LARGE_INTEGER(), LARGE_INTEGER),
        NDRPacketField("PagingWriteBytesRequested", LARGE_INTEGER(), LARGE_INTEGER),
        NDRPacketField("NonPagingWriteBytesRequested", LARGE_INTEGER(), LARGE_INTEGER),
        NDRPacketField("CacheWriteBytesRequested", LARGE_INTEGER(), LARGE_INTEGER),
        NDRPacketField("NetworkWriteBytesRequested", LARGE_INTEGER(), LARGE_INTEGER),
        NDRIntField("InitiallyFailedOperations", 0),
        NDRIntField("FailedCompletionOperations", 0),
        NDRIntField("ReadOperations", 0),
        NDRIntField("RandomReadOperations", 0),
        NDRIntField("ReadSmbs", 0),
        NDRIntField("LargeReadSmbs", 0),
        NDRIntField("SmallReadSmbs", 0),
        NDRIntField("WriteOperations", 0),
        NDRIntField("RandomWriteOperations", 0),
        NDRIntField("WriteSmbs", 0),
        NDRIntField("LargeWriteSmbs", 0),
        NDRIntField("SmallWriteSmbs", 0),
        NDRIntField("RawReadsDenied", 0),
        NDRIntField("RawWritesDenied", 0),
        NDRIntField("NetworkErrors", 0),
        NDRIntField("Sessions", 0),
        NDRIntField("FailedSessions", 0),
        NDRIntField("Reconnects", 0),
        NDRIntField("CoreConnects", 0),
        NDRIntField("Lanman20Connects", 0),
        NDRIntField("Lanman21Connects", 0),
        NDRIntField("LanmanNtConnects", 0),
        NDRIntField("ServerDisconnects", 0),
        NDRIntField("HungSessions", 0),
        NDRIntField("UseCount", 0),
        NDRIntField("FailedUseCount", 0),
        NDRIntField("CurrentCommands", 0),
    ]


class NetrWorkstationStatisticsGet_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("ServerName", "")),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("ServiceName", "")),
        NDRIntField("Level", 0),
        NDRIntField("Options", 0),
    ]


class NetrWorkstationStatisticsGet_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField("Buffer", LPSTAT_WORKSTATION_0(), LPSTAT_WORKSTATION_0)
        ),
        NDRIntField("status", 0),
    ]


class PNETSETUP_JOIN_STATUS(IntEnum):
    NetSetupUnknownStatus = 0
    NetSetupUnjoined = 1
    NetSetupWorkgroupName = 2
    NetSetupDomainName = 3


class NetrGetJoinInformation_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("ServerName", "")),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("NameBuffer", "")),
    ]


class NetrGetJoinInformation_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("NameBuffer", "")),
        NDRInt3264EnumField("BufferType", 0, PNETSETUP_JOIN_STATUS),
        NDRIntField("status", 0),
    ]


class PJOINPR_ENCRYPTED_USER_PASSWORD(NDRPacket):
    fields_desc = [StrFixedLenField("Buffer", "", length=((8 + (256 * 2)) + 8))]


class NetrJoinDomain2_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("ServerName", "")),
        NDRConfVarStrNullFieldUtf16("DomainNameParam", ""),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("MachineAccountOU", "")),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("AccountName", "")),
        NDRFullPointerField(
            NDRPacketField(
                "Password",
                PJOINPR_ENCRYPTED_USER_PASSWORD(),
                PJOINPR_ENCRYPTED_USER_PASSWORD,
            )
        ),
        NDRIntField("Options", 0),
    ]


class NetrJoinDomain2_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class NetrUnjoinDomain2_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("ServerName", "")),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("AccountName", "")),
        NDRFullPointerField(
            NDRPacketField(
                "Password",
                PJOINPR_ENCRYPTED_USER_PASSWORD(),
                PJOINPR_ENCRYPTED_USER_PASSWORD,
            )
        ),
        NDRIntField("Options", 0),
    ]


class NetrUnjoinDomain2_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class NetrRenameMachineInDomain2_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("ServerName", "")),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("MachineName", "")),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("AccountName", "")),
        NDRFullPointerField(
            NDRPacketField(
                "Password",
                PJOINPR_ENCRYPTED_USER_PASSWORD(),
                PJOINPR_ENCRYPTED_USER_PASSWORD,
            )
        ),
        NDRIntField("Options", 0),
    ]


class NetrRenameMachineInDomain2_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class NETSETUP_NAME_TYPE(IntEnum):
    NetSetupUnknown = 0
    NetSetupMachine = 1
    NetSetupWorkgroup = 2
    NetSetupDomain = 3
    NetSetupNonExistentDomain = 4
    NetSetupDnsMachine = 5


class NetrValidateName2_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("ServerName", "")),
        NDRConfVarStrNullFieldUtf16("NameToValidate", ""),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("AccountName", "")),
        NDRFullPointerField(
            NDRPacketField(
                "Password",
                PJOINPR_ENCRYPTED_USER_PASSWORD(),
                PJOINPR_ENCRYPTED_USER_PASSWORD,
            )
        ),
        NDRInt3264EnumField("NameType", 0, NETSETUP_NAME_TYPE),
    ]


class NetrValidateName2_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class NetrGetJoinableOUs2_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("ServerName", "")),
        NDRConfVarStrNullFieldUtf16("DomainNameParam", ""),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("AccountName", "")),
        NDRFullPointerField(
            NDRPacketField(
                "Password",
                PJOINPR_ENCRYPTED_USER_PASSWORD(),
                PJOINPR_ENCRYPTED_USER_PASSWORD,
            )
        ),
        NDRIntField("OUCount", 0),
    ]


class NetrGetJoinableOUs2_Response(NDRPacket):
    fields_desc = [
        NDRIntField("OUCount", None, size_of="OUs"),
        NDRConfVarStrLenFieldUtf16("OUs", "", size_is=lambda pkt: pkt.OUCount),
        NDRIntField("status", 0),
    ]


class NetrAddAlternateComputerName_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("ServerName", "")),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("AlternateName", "")),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("DomainAccount", "")),
        NDRFullPointerField(
            NDRPacketField(
                "EncryptedPassword",
                PJOINPR_ENCRYPTED_USER_PASSWORD(),
                PJOINPR_ENCRYPTED_USER_PASSWORD,
            )
        ),
        NDRIntField("Reserved", 0),
    ]


class NetrAddAlternateComputerName_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class NetrRemoveAlternateComputerName_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("ServerName", "")),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("AlternateName", "")),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("DomainAccount", "")),
        NDRFullPointerField(
            NDRPacketField(
                "EncryptedPassword",
                PJOINPR_ENCRYPTED_USER_PASSWORD(),
                PJOINPR_ENCRYPTED_USER_PASSWORD,
            )
        ),
        NDRIntField("Reserved", 0),
    ]


class NetrRemoveAlternateComputerName_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class NetrSetPrimaryComputerName_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("ServerName", "")),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("PrimaryName", "")),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("DomainAccount", "")),
        NDRFullPointerField(
            NDRPacketField(
                "EncryptedPassword",
                PJOINPR_ENCRYPTED_USER_PASSWORD(),
                PJOINPR_ENCRYPTED_USER_PASSWORD,
            )
        ),
        NDRIntField("Reserved", 0),
    ]


class NetrSetPrimaryComputerName_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class NET_COMPUTER_NAME_TYPE(IntEnum):
    NetPrimaryComputerName = 0
    NetAlternateComputerNames = 1
    NetAllComputerNames = 2
    NetComputerNameTypeMax = 3


class PUNICODE_STRING(NDRPacket):
    ALIGNMENT = (4, 8)
    fields_desc = [
        NDRShortField("Length", None, size_of="Buffer", adjust=lambda _, x: (x * 2)),
        NDRShortField(
            "MaximumLength", None, size_of="Buffer", adjust=lambda _, x: (x * 2)
        ),
        NDRFullPointerField(
            NDRConfVarStrLenFieldUtf16(
                "Buffer",
                "",
                size_is=lambda pkt: (pkt.MaximumLength // 2),
                length_is=lambda pkt: (pkt.Length // 2),
            ),
            deferred=True,
        ),
    ]


class PNET_COMPUTER_NAME_ARRAY(NDRPacket):
    ALIGNMENT = (4, 8)
    fields_desc = [
        NDRIntField("EntryCount", None, size_of="ComputerNames"),
        NDRFullPointerField(
            NDRConfPacketListField(
                "ComputerNames",
                [PUNICODE_STRING()],
                PUNICODE_STRING,
                size_is=lambda pkt: pkt.EntryCount,
            ),
            deferred=True,
        ),
    ]


class NetrEnumerateComputerNames_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("ServerName", "")),
        NDRInt3264EnumField("NameType", 0, NET_COMPUTER_NAME_TYPE),
        NDRIntField("Reserved", 0),
    ]


class NetrEnumerateComputerNames_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField(
                "ComputerNames", PNET_COMPUTER_NAME_ARRAY(), PNET_COMPUTER_NAME_ARRAY
            )
        ),
        NDRIntField("status", 0),
    ]


class PJOINPR_ENCRYPTED_USER_PASSWORD_AES(NDRPacket):
    ALIGNMENT = (4, 8)
    fields_desc = [
        StrFixedLenField("AuthData", "", length=64),
        StrFixedLenField("Salt", "", length=16),
        NDRIntField("cbCipher", None, size_of="Cipher"),
        NDRFullPointerField(
            NDRConfStrLenField("Cipher", "", size_is=lambda pkt: pkt.cbCipher),
            deferred=True,
        ),
    ]


class NetrJoinDomain3_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("ServerName", "")),
        NDRConfVarStrNullFieldUtf16("DomainNameParam", ""),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("MachineAccountOU", "")),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("AccountName", "")),
        NDRFullPointerField(
            NDRPacketField(
                "Password",
                PJOINPR_ENCRYPTED_USER_PASSWORD_AES(),
                PJOINPR_ENCRYPTED_USER_PASSWORD_AES,
            )
        ),
        NDRIntField("Options", 0),
    ]


class NetrJoinDomain3_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class NetrUnjoinDomain3_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("ServerName", "")),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("AccountName", "")),
        NDRFullPointerField(
            NDRPacketField(
                "Password",
                PJOINPR_ENCRYPTED_USER_PASSWORD_AES(),
                PJOINPR_ENCRYPTED_USER_PASSWORD_AES,
            )
        ),
        NDRIntField("Options", 0),
    ]


class NetrUnjoinDomain3_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class NetrRenameMachineInDomain3_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("ServerName", "")),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("MachineName", "")),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("AccountName", "")),
        NDRFullPointerField(
            NDRPacketField(
                "Password",
                PJOINPR_ENCRYPTED_USER_PASSWORD(),
                PJOINPR_ENCRYPTED_USER_PASSWORD,
            )
        ),
        NDRIntField("Options", 0),
    ]


class NetrRenameMachineInDomain3_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class NetrValidateName3_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("ServerName", "")),
        NDRConfVarStrNullFieldUtf16("NameToValidate", ""),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("AccountName", "")),
        NDRFullPointerField(
            NDRPacketField(
                "Password",
                PJOINPR_ENCRYPTED_USER_PASSWORD_AES(),
                PJOINPR_ENCRYPTED_USER_PASSWORD_AES,
            )
        ),
        NDRInt3264EnumField("NameType", 0, NETSETUP_NAME_TYPE),
    ]


class NetrValidateName3_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class NetrAddAlternateComputerName2_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("ServerName", "")),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("AlternateName", "")),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("DomainAccount", "")),
        NDRFullPointerField(
            NDRPacketField(
                "EncryptedPassword",
                PJOINPR_ENCRYPTED_USER_PASSWORD_AES(),
                PJOINPR_ENCRYPTED_USER_PASSWORD_AES,
            )
        ),
        NDRIntField("Reserved", 0),
    ]


class NetrAddAlternateComputerName2_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class NetrRemoveAlternateComputerName2_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("ServerName", "")),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("AlternateName", "")),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("DomainAccount", "")),
        NDRFullPointerField(
            NDRPacketField(
                "EncryptedPassword",
                PJOINPR_ENCRYPTED_USER_PASSWORD_AES(),
                PJOINPR_ENCRYPTED_USER_PASSWORD_AES,
            )
        ),
        NDRIntField("Reserved", 0),
    ]


class NetrRemoveAlternateComputerName2_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class NetrSetPrimaryComputerName2_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("ServerName", "")),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("PrimaryName", "")),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("DomainAccount", "")),
        NDRFullPointerField(
            NDRPacketField(
                "EncryptedPassword",
                PJOINPR_ENCRYPTED_USER_PASSWORD(),
                PJOINPR_ENCRYPTED_USER_PASSWORD,
            )
        ),
        NDRIntField("Reserved", 0),
    ]


class NetrSetPrimaryComputerName2_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


WKSSVC_OPNUMS = {
    0: DceRpcOp(NetrWkstaGetInfo_Request, NetrWkstaGetInfo_Response),
    1: DceRpcOp(NetrWkstaSetInfo_Request, NetrWkstaSetInfo_Response),
    2: DceRpcOp(NetrWkstaUserEnum_Request, NetrWkstaUserEnum_Response),
    # 3: Opnum3NotUsedOnWire,
    # 4: Opnum4NotUsedOnWire,
    5: DceRpcOp(NetrWkstaTransportEnum_Request, NetrWkstaTransportEnum_Response),
    6: DceRpcOp(NetrWkstaTransportAdd_Request, NetrWkstaTransportAdd_Response),
    7: DceRpcOp(NetrWkstaTransportDel_Request, NetrWkstaTransportDel_Response),
    8: DceRpcOp(NetrUseAdd_Request, NetrUseAdd_Response),
    9: DceRpcOp(NetrUseGetInfo_Request, NetrUseGetInfo_Response),
    10: DceRpcOp(NetrUseDel_Request, NetrUseDel_Response),
    11: DceRpcOp(NetrUseEnum_Request, NetrUseEnum_Response),
    # 12: Opnum12NotUsedOnWire,
    13: DceRpcOp(
        NetrWorkstationStatisticsGet_Request, NetrWorkstationStatisticsGet_Response
    ),
    # 14: Opnum14NotUsedOnWire,
    # 15: Opnum15NotUsedOnWire,
    # 16: Opnum16NotUsedOnWire,
    # 17: Opnum17NotUsedOnWire,
    # 18: Opnum18NotUsedOnWire,
    # 19: Opnum19NotUsedOnWire,
    20: DceRpcOp(NetrGetJoinInformation_Request, NetrGetJoinInformation_Response),
    # 21: Opnum21NotUsedOnWire,
    22: DceRpcOp(NetrJoinDomain2_Request, NetrJoinDomain2_Response),
    23: DceRpcOp(NetrUnjoinDomain2_Request, NetrUnjoinDomain2_Response),
    24: DceRpcOp(
        NetrRenameMachineInDomain2_Request, NetrRenameMachineInDomain2_Response
    ),
    25: DceRpcOp(NetrValidateName2_Request, NetrValidateName2_Response),
    26: DceRpcOp(NetrGetJoinableOUs2_Request, NetrGetJoinableOUs2_Response),
    27: DceRpcOp(
        NetrAddAlternateComputerName_Request, NetrAddAlternateComputerName_Response
    ),
    28: DceRpcOp(
        NetrRemoveAlternateComputerName_Request,
        NetrRemoveAlternateComputerName_Response,
    ),
    29: DceRpcOp(
        NetrSetPrimaryComputerName_Request, NetrSetPrimaryComputerName_Response
    ),
    30: DceRpcOp(
        NetrEnumerateComputerNames_Request, NetrEnumerateComputerNames_Response
    ),
    31: DceRpcOp(NetrJoinDomain3_Request, NetrJoinDomain3_Response),
    32: DceRpcOp(NetrUnjoinDomain3_Request, NetrUnjoinDomain3_Response),
    33: DceRpcOp(
        NetrRenameMachineInDomain3_Request, NetrRenameMachineInDomain3_Response
    ),
    34: DceRpcOp(NetrValidateName3_Request, NetrValidateName3_Response),
    35: DceRpcOp(
        NetrAddAlternateComputerName2_Request, NetrAddAlternateComputerName2_Response
    ),
    36: DceRpcOp(
        NetrRemoveAlternateComputerName2_Request,
        NetrRemoveAlternateComputerName2_Response,
    ),
    37: DceRpcOp(
        NetrSetPrimaryComputerName2_Request, NetrSetPrimaryComputerName2_Response
    ),
}
register_dcerpc_interface(
    name="wkssvc",
    uuid=uuid.UUID("6BFFD098-A112-3610-9833-46C3F87E345A"),
    version="1.0",
    opnums=WKSSVC_OPNUMS,
)
