### ms-oxabref.idl
"""
RPC definitions for the following interfaces:
- rfri (v1.0): 1544f5e0-613c-11d1-93df-00c04fd7bd09
This file is auto-generated by midl-to-scapy, do not modify.
"""

import uuid


from scapy.layers.dcerpc import (
    NDRPacket,
    DceRpcOp,
    NDRConfVarStrLenField,
    NDRConfVarStrNullField,
    NDRFullPointerField,
    NDRIntField,
    register_dcerpc_interface,
)


class RfrGetNewDSA_Request(NDRPacket):
    fields_desc = [
        NDRIntField("ulFlags", 0),
        NDRConfVarStrNullField("pUserDN", ""),
        NDRFullPointerField(
            NDRFullPointerField(NDRConfVarStrNullField("ppszUnused", ""))
        ),
        NDRFullPointerField(
            NDRFullPointerField(NDRConfVarStrNullField("ppszServer", ""))
        ),
    ]


class RfrGetNewDSA_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRFullPointerField(NDRConfVarStrNullField("ppszUnused", ""))
        ),
        NDRFullPointerField(
            NDRFullPointerField(NDRConfVarStrNullField("ppszServer", ""))
        ),
        NDRIntField("status", 0),
    ]


class RfrGetFQDNFromServerDN_Request(NDRPacket):
    fields_desc = [
        NDRIntField("ulFlags", 0),
        NDRIntField("cbMailboxServerDN", None, size_of="szMailboxServerDN"),
        NDRConfVarStrLenField(
            "szMailboxServerDN", "", size_is=lambda pkt: pkt.cbMailboxServerDN
        ),
    ]


class RfrGetFQDNFromServerDN_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullField("ppszServerFQDN", "")),
        NDRIntField("status", 0),
    ]


RFRI_OPNUMS = {
    0: DceRpcOp(RfrGetNewDSA_Request, RfrGetNewDSA_Response),
    1: DceRpcOp(RfrGetFQDNFromServerDN_Request, RfrGetFQDNFromServerDN_Response),
}
register_dcerpc_interface(
    name="rfri",
    uuid=uuid.UUID("1544f5e0-613c-11d1-93df-00c04fd7bd09"),
    version="1.0",
    opnums=RFRI_OPNUMS,
)
