Skip to main content

Crate ms_even6

Crate ms_even6 

Source
Expand description

MS-EVEN6 — the EventLog Remoting Protocol v6, the Vista-era replacement for MS-EVEN. Speaks over MS-RPCE (SMB named pipe \pipe\eventlog, interface UUID F6BEAFF7-1E19-4FBB-9F8F-B89E2018337C v1.0). Lets a remote caller open a channel by name, register an XPath query against it, pull matching event records, and read the payload as BinXml (MS-EVEN6 §2.2.17) — the same wire form the local Vista+ EventLog service hands to EvtRender.

Status: pre-alpha / 0.1.0-dev. The wire encoders for the core opnums exist and round-trip against hand-crafted golden bytes; the BinXml decoder recognises the commonly-used token subset (element open/close, attribute, value UTF-16LE, template reference, EOF) and produces a structured Event. Full spec conformance and live-DC iteration are deferred to a later revision.

§Layout

  • transport — a small Transport trait so the client can be driven by dcerpc’s SmbPipe (real DC) or a byte-scripted mock (tests). The dcerpc adapter is todo for 0.2.0 — it needs async plumbing that the sync-facing API doesn’t offer yet.
  • opnums — opnum wire encoders/decoders (EvtRpcOpenLogHandle, RegisterLogQuery, QueryNext, Close).
  • binxml — the BinXml token-stream decoder (channel, provider, event id, record id, time_created, and a rendered XML string).
  • gaps — record-id gap detection over a set of pulled events.

The public API on this crate (EvenClient, open_log_handle, register_log_query, query_next, decode_binxml, detect_gaps) is sync — the transport trait is sync too. A DC-real caller wraps their SmbPipe (async) via a tokio::runtime::Handle::block_on shim; see examples/ (TBD) for the pattern.

Re-exports§

pub use binxml::decode_binxml;
pub use binxml::Event;
pub use gaps::detect_gaps;
pub use gaps::RecordIdGap;
pub use transport::Transport;

Modules§

binxml
BinXml decoder — MS-EVEN6 §2.2.17. Consumes the token stream that EvtRpcQueryNext returns per record and produces a structured Event.
gaps
Record-id gap detection. EventRecordID is monotonically increasing per channel; any break means the caller lost coverage (log wraparound, service restart, clear, or a competing consumer). Given a pulled batch of events this returns each contiguous [missing_start, missing_end] inclusive range.
opnums
MS-EVEN6 opnum encoders/decoders (§3.1.4). NDR marshaling via ms_ndr.
transport
Transport trait — one call(opnum, stub) -> Result<Vec<u8>> method the client uses to move NDR stubs to/from the remote. Sync so crate::EvenClient’s API stays sync; a live-DC driver wraps its async dcerpc::transport::SmbPipe behind block_on.

Structs§

ContextHandle
A remote MS-EVEN6 CONTEXT_HANDLE (20 bytes: attributes u32 + 16-byte UUID). Returned by EvtRpcOpenLogHandle; passed back to Read/Clear/QueryChannel calls.
EvenClient
The high-level MS-EVEN6 client.
QueryHandle
The handle a caller keeps for pulling records after RegisterLogQuery.
Syntax
A DCE/RPC abstract syntax (UUID + interface version) — the tiny local stand-in for dcerpc::Syntax while the dcerpc integration is deferred. Wire byte layout matches DCE (little-endian UUID, u16 major, u16 minor).

Enums§

EvenError
Only way anything in this crate fails.

Functions§

even6_syntax
The MS-EVEN6 interface: UUID F6BEAFF7-1E19-4FBB-9F8F-B89E2018337C, v1.0.

Type Aliases§

Result