### ms-com.idl
"""
RPC definitions for the following interfaces:
- ITransactionStream (v0.0): 97199110-DB2E-11d1-A251-0000F805CA53
This file is auto-generated by midl-to-scapy, do not modify.
"""

import uuid


from scapy.layers.dcerpc import (
    NDRPacket,
    DceRpcOp,
    NDRConfStrLenField,
    NDRIntField,
    register_com_interface,
)


class GetSeqAndTxViaExport_Request(NDRPacket):
    fields_desc = [
        NDRIntField("ulKnownSeq", 0),
        NDRIntField("ulcbWhereabouts", None, size_of="rgbWhereabouts"),
        NDRConfStrLenField(
            "rgbWhereabouts", "", size_is=lambda pkt: pkt.ulcbWhereabouts
        ),
    ]


class GetSeqAndTxViaExport_Response(NDRPacket):
    fields_desc = [
        NDRIntField("pulCurrentSeq", 0),
        NDRIntField("pulcbExportCookie", None, size_of="prgbExportCookie"),
        NDRConfStrLenField(
            "prgbExportCookie", "", size_is=lambda pkt: pkt.pulcbExportCookie
        ),
        NDRIntField("status", 0),
    ]


class GetSeqAndTxViaTransmitter_Request(NDRPacket):
    fields_desc = [NDRIntField("ulKnownSeq", 0)]


class GetSeqAndTxViaTransmitter_Response(NDRPacket):
    fields_desc = [
        NDRIntField("pulCurrentSeq", 0),
        NDRIntField("pulcbTransmitterBuffer", None, size_of="prgbTransmitterBuffer"),
        NDRConfStrLenField(
            "prgbTransmitterBuffer", "", size_is=lambda pkt: pkt.pulcbTransmitterBuffer
        ),
        NDRIntField("status", 0),
    ]


class GetTxViaExport_Request(NDRPacket):
    fields_desc = [
        NDRIntField("ulRequestSeq", 0),
        NDRIntField("ulcbWhereabouts", None, size_of="rgbWhereabouts"),
        NDRConfStrLenField(
            "rgbWhereabouts", "", size_is=lambda pkt: pkt.ulcbWhereabouts
        ),
    ]


class GetTxViaExport_Response(NDRPacket):
    fields_desc = [
        NDRIntField("pulcbExportCookie", None, size_of="prgbExportCookie"),
        NDRConfStrLenField(
            "prgbExportCookie", "", size_is=lambda pkt: pkt.pulcbExportCookie
        ),
        NDRIntField("status", 0),
    ]


class GetTxViaTransmitter_Request(NDRPacket):
    fields_desc = [NDRIntField("ulRequestSeq", 0)]


class GetTxViaTransmitter_Response(NDRPacket):
    fields_desc = [
        NDRIntField("pulcbTransmitterBuffer", None, size_of="prgbTransmitterBuffer"),
        NDRConfStrLenField(
            "prgbTransmitterBuffer", "", size_is=lambda pkt: pkt.pulcbTransmitterBuffer
        ),
        NDRIntField("status", 0),
    ]


ITRANSACTIONSTREAM_OPNUMS = {
    0: DceRpcOp(GetSeqAndTxViaExport_Request, GetSeqAndTxViaExport_Response),
    1: DceRpcOp(GetSeqAndTxViaTransmitter_Request, GetSeqAndTxViaTransmitter_Response),
    2: DceRpcOp(GetTxViaExport_Request, GetTxViaExport_Response),
    3: DceRpcOp(GetTxViaTransmitter_Request, GetTxViaTransmitter_Response),
}
register_com_interface(
    name="ITransactionStream",
    uuid=uuid.UUID("97199110-DB2E-11d1-A251-0000F805CA53"),
    opnums=ITRANSACTIONSTREAM_OPNUMS,
)
