Peios Learn
Documentation

Peios

Peios Peios Kernel Universal Directory Project

Developer Tools

Trail Acta Provium clackatoo CAF GCSL Pekit

Applications

Framewright

Standards and Conventions

Standards and Conventions Peios Specifications
Peios Kernel

NTFE

Single-page view · as markdown

NTFE

Peios Kernel / Userspace interfaces / Native interfaces / NTFE

Use these articles to understand ntfe in the Peios kernel.

  • Event records and status semantics
  • Generated device ABI
  • Device operations and errors

Event records and status semantics

Peios Kernel / Userspace interfaces / Native interfaces / NTFE

One event #

An event is the decision and enough of the snapshot to find the packet it was about: sequence number, CLOCK_REALTIME nanoseconds, the seat and layer, the verdict and — when it was a reject — its kind, flags (BACKSTOP, FAIL_CLOSED, REJECT_DEGRADED, REJUDGED for a Flow evaluation that replaced a stale sentence, IDENTITY_UNRESOLVED for one whose endpoint could not be attributed), direction, address family, protocol, flow state, interface index, ports, ethertype, both addresses, the stack-view length, the effect counts the evaluation yielded packed eight bits each (tags, counts, reports, prompts, saturating), and the attributing rule's path — the winning rule, or backstop, or fail-closed — in a 96-byte field (PEIOS_NTFE_EV_ATTR_LEN), so a longer path is cut to 95 bytes, at a byte rather than a character boundary, and NUL-terminated. A Flow event also carries both endpoints' identities as the judgment read them (The identity facts): the kind, the process GUID, pid and comm, the user SID and the service SID — binary SIDs, so the viewer, not the kernel, turns them into names.

The path is relative to the layer key: no-inbound/ssh, not Machine\System\Network\Rules\Packet\no-inbound\ssh.

Status #

PEIOS_NTFE_IOC_STATUS fills struct peios_ntfe_status: the ABI version (check it before trusting the rest — the ABI is experimental and versioned, currently 5), the generation, whether any layer is enforcing, the ring's confessed drops, and the engine counters. The counters are plain 64-bit atomics rather than per-CPU — legibility over throughput while the engine is young, to be revisited with a compiled evaluator.

GroupCounters
Seatsseen_ingress, seen_egress, seen_local_in, seen_local_out, deferred (ingress traversals left for the IP seat), fallback_judged (ingress traversals the Packet layer judged there)
Evaluationjudged, permissive, parse_errors, fail_closed
Verdictsverdict_pass, verdict_drop, verdict_reject, reject_degraded
Effects yieldedfx_tags, fx_counts, fx_reports, fx_prompts
Ingestionlast_ingest_error, last_ingest_t_ns, reporting_level, changes_noted and changes_walked (Ingestion and generations, in force), contexts (interfaces in the network context table)
The storestag_writes, tag_untracked, tag_refused, count_writes, count_key_absent, count_refused, reports_emitted, counter_cells
The Flow layerflow_judged (evaluations, sentences written), flow_cached (packets answered by a current sentence), flow_rejudged (stale by generation), flow_expired (stale by time edge), flow_uncached (flows with no extension to hold a sentence, evaluated per packet)
Refusalsrefusals_emitted (answers built and sent), refusals_bypassed (own refusals waved through a seat), teardowns_emitted (far-end resets for refused established TCP flows)
The identity factsidentity_unresolved (endpoints that could not be attributed at resolution: a socket with no KACS state, an inet socket nobody stamped, a loopback sender the inbound seat could not see)

Two invariants a reader can check: judged equals the number of evaluations against a live forest at any layer (Flow evaluations included, so judged − flow_judged is the per-packet count), and permissive counts layer evaluations that found no forest — at generation 0, every one.

PEIOS_NTFE_IOC_COUNTERS is the counter dump described in The stores: the caller supplies a buffer of struct peios_ntfe_counter_rec, the kernel fills as many as fit and reports both how many it wrote and how many cells exist, so a short buffer is visible. PEIOS_NTFE_IOC_FLOWS is the flows dump described in The Flow layer, with the same short-buffer contract over struct peios_ntfe_flow_rec.

Confessions, collected #

Everything NTFE declines to do is counted somewhere in the status, and the viewer shows every one of them. A reader should never have to infer a refusal from a missing effect:

  • a REJECT it could not send → reject_degraded, and the event's flag;
  • an evaluation it could not finish → fail_closed, and an event;
  • a frame it could not describe → parse_errors;
  • a tag it could not write → tag_untracked or tag_refused;
  • a count it could not land → count_key_absent or count_refused;
  • a sentence it could not keep → flow_uncached;
  • an endpoint it could not attribute → identity_unresolved, and the event's flag;
  • a packet it did not judge because a sentence answered → flow_cached;
  • a refusal it did not judge because it was its own → refusals_bypassed;
  • a generation it could not accept → last_ingest_error, and the log;
  • an event it could not keep → events_dropped.

Event fields #

  • attributed is the winning rule's path relative to its layer key, UTF-8, NUL-terminated, truncated to PEIOS_NTFE_EV_ATTR_LEN − 1 bytes (95), which may split a multi-byte character. Two reserved values: backstop (nothing yielded) and fail-closed (evaluation failed).
  • effects packs the effect counts the evaluation yielded — tags | counts << 8 | reports << 16 | prompts << 24, each saturating at 255. What the stores then applied is in the status confessions, not in the event.
  • reject_kind is meaningful only when verdict is PEIOS_NTFE_EV_VERDICT_REJECT; a degraded reject (flags & PEIOS_NTFE_EV_F_REJECT_DEGRADED) still carries the kind the rule chose.
  • PEIOS_NTFE_EV_F_REJUDGED marks a Flow-layer evaluation that replaced a stale sentence (policy change or time edge). A packet answered by a current sentence produces no event at all.
  • layer 2 is Flow; seat 4 is LOCAL_OUT. A Flow event's direction is the endpoint judged: the originator's side for a normal flow, each seat's own for a loopback flow's two judgments.
  • Addresses: the first 4 bytes when addr_family is 4, all 16 when 6, undefined when 0. Ports are 0 when the fact was absent — check protocol.
  • flow_state 0 means the fact was absent (the ingress seat), not that the flow was untracked; untracked is 5.
  • The identity fields (ABI 4) are set on Flow events only and zero elsewhere. local_kind / remote_kind are PEIOS_NTFE_EV_LOCAL_*: ABSENT (0) for a non-Flow event, and for remote whenever the other end is not local; remote is filled only on a loopback flow. For a PROGRAM end, *_guid, *_pid and *_comm are the process facts at the socket's stamp, *_user the token's user SID and *_service its per-service SID, both binary and self-sized (byte 1 is the sub-authority count; all zero = absent — a user program has no service SID). *_unresolved says the end could not be attributed and was reported as the kernel's or as absent.

Counter records #

  • name is the stream name (a rule's COUNT(Name)), NUL-terminated; hash is its FNV-1a identity as the kernel keys tables.
  • keyspec says which of src_addr, dst_addr, ifindex are meaningful for this cell's key; the others are zero. family is 4, 6, or 0 when no address fact is keyed.
  • window_secs[i] / window_value[i] for i < n_windows are the table's windows and this cell's current value in each; total is cumulative since the cell was created (or migrated — see The stores); last_secs is CLOCK_REALTIME seconds of the last write, for staleness.
  • The dump lists every table's cells consecutively; group by (name, keyspec) to reconstruct tables.

Flow records #

  • id is conntrack's own id for the entry (nf_ct_get_id()), stable for the flow's life and the key to use across dumps.
  • src_addr/dst_addr, the ports and the ICMP fields are the original-direction tuple — the originator first. For ICMP, src_port carries the echo id and icmp_type/icmp_code the type and code; dst_port is 0.
  • direction, ifindex and loopback are meaningful only when judged is 1: they were recorded at the Flow layer's first judgment. A flow with judged == 0 has had no Flow judgment recorded: every packet of it that reached the flow dispatch (The Flow layer) found no Flow forest (a permissive generation) or failed closed, or none did — or it has no extension at all, and so nowhere to record one (flow_uncached; its sentences and identities read empty too).
  • The sentences are parallel arrays indexed by slot (UAPI records hold scalars only): slot 0 is the flow's sentence; slot 1 is only ever filled for a loopback flow (its inbound endpoint). A slot with sentence_generation == 0 is empty. sentence_expires_at 0 means never. sentence_rule_hash is FNV-1a-64 (offset 0xcbf29ce484222325, prime 0x100000001b3) of the whole attributing path relative to the layer key, however long — not of the event's truncated attributed. backstop hashes like any other path; fail-closed is never a sentence's, since a failed evaluation is not cached.
  • packets/bytes are conntrack's accounting, original then reply; NTFE turns conntrack accounting on at init (net.netfilter.nf_conntrack_acct).
  • timeout_secs is the entry's remaining lifetime as conntrack sees it; start_secs is CLOCK_REALTIME seconds when conntrack created it.
  • tag_hash/tag_value hold up to PEIOS_NTFE_FLOW_MAX_TAGS (8) present tags by name hash and value; n_tags is the flow's total, so a value above 8 means some are not listed.
  • The identities (ABI 4) are per sentence slot, recorded at the flow's first judgment and fixed: owner_kind[slot] is PEIOS_NTFE_EV_LOCAL_* (ABSENT = not resolved; ABSENT with owner_unresolved[slot] set = judged but unattributed, such as a loopback sender the outbound seat never recorded); the per-slot arrays are flattened at a fixed stride — owner_guid 16 bytes per slot, owner_comm 16, owner_user 68, owner_service 32 — so slot 1's user SID starts at byte 68. Slot 1 is filled only for a loopback flow.

Listener records #

  • One record per socket prepared to receive: TCP in LISTEN, and UDP / UDP-Lite bound to a port (connected when it also has a peer and so receives from one address only). addr all zero is the wildcard; ifindex is SO_BINDTODEVICE, 0 for any; reuseport marks a member of a SO_REUSEPORT group, of which each member is listed. v6only says an AF_INET6 socket refuses v4-mapped traffic — a v6 socket without it answers on both families.
  • The owner fields are those of the flow record's slot, for the socket's current stamp: owner_kind is PROGRAM or KERNEL (a socket nobody stamped reads KERNEL with owner_unresolved set).
  • The walk is the root namespace's tables only, copied out between hash buckets: a best-effort list of a set that changes under it.

Generated device ABI

Peios Kernel / Userspace interfaces / Native interfaces / NTFE

Every name, value, offset and size in this appendix is generated from include/uapi/pkm/ntfe.h by tools/docs/peios-reference/generators/gen-ntfe-abi.py, with struct layouts measured by compiling a probe against the real header. Regenerate it whenever the ABI changes; do not edit it by hand. The names here are the ones a program actually compiles against.

What a compiler cannot measure -- the device's read and poll semantics, what each ioctl expects, the error vocabulary, and the bounds that are not in the header -- is in the notes appendix, NTFE ABI Notes, which this generator does not touch.

Ioctl requests #

Request numbers on /dev/peios-ntfe, packed as <linux/ioctl.h> packs them (direction, argument size, type 'N', number).

ConstantValueDefinition
PEIOS_NTFE_IOC_STATUS0x81704E01_IOR(PEIOS_NTFE_IOC_TYPE, PEIOS_NTFE_IOC_STATUS_NR, struct peios_ntfe_status)
PEIOS_NTFE_IOC_COUNTERS0xC0184E02_IOWR(PEIOS_NTFE_IOC_TYPE, PEIOS_NTFE_IOC_COUNTERS_NR, struct peios_ntfe_counters_query)
PEIOS_NTFE_IOC_FLOWS0xC0184E03_IOWR(PEIOS_NTFE_IOC_TYPE, PEIOS_NTFE_IOC_FLOWS_NR, struct peios_ntfe_flows_query)
PEIOS_NTFE_IOC_LISTENERS0xC0184E04_IOWR(PEIOS_NTFE_IOC_TYPE, PEIOS_NTFE_IOC_LISTENERS_NR, struct peios_ntfe_listeners_query)

Structure layouts #

Offsets and sizes are measured, not declared.

struct peios_ntfe_event #

Total size 456 bytes.

OffsetSizeTypeField
08__u64seq
88__u64t_ns
161__u8seat
171__u8layer
181__u8verdict
191__u8flags
201__u8direction
211__u8addr_family
221__u8protocol
231__u8flow_state
244__u32ifindex
282__u16src_port
302__u16dst_port
322__u16ether_type
341__u8reject_kind
351__u8_pad0
3616__u8[16]src_addr
5216__u8[16]dst_addr
684__u32length
724__u32effects
7696__u8[PEIOS_NTFE_EV_ATTR_LEN]attributed
1724__u32_pad1
1761__u8local_kind
1771__u8remote_kind
1781__u8local_unresolved
1791__u8remote_unresolved
1804__s32local_pid
1844__s32remote_pid
18816__u8[PEIOS_NTFE_GUID_LEN]local_guid
20416__u8[PEIOS_NTFE_GUID_LEN]remote_guid
22016__u8[PEIOS_NTFE_COMM_LEN]local_comm
23616__u8[PEIOS_NTFE_COMM_LEN]remote_comm
25268__u8[PEIOS_NTFE_SID_LEN]local_user
32068__u8[PEIOS_NTFE_SID_LEN]remote_user
38832__u8[PEIOS_NTFE_SERVICE_SID_LEN]local_service
42032__u8[PEIOS_NTFE_SERVICE_SID_LEN]remote_service
4524__u32_pad2

struct peios_ntfe_status #

Total size 368 bytes.

OffsetSizeTypeField
08__u64abi
88__u64generation
168__u64enforcing
248__u64events_dropped
328__u64seen_ingress
408__u64seen_egress
488__u64seen_local_in
568__u64deferred
648__u64fallback_judged
728__u64parse_errors
808__u64judged
888__u64permissive
968__u64fail_closed
1048__u64verdict_pass
1128__u64verdict_drop
1208__u64verdict_reject
1288__u64reject_degraded
1368__u64fx_tags
1448__u64fx_counts
1528__u64fx_reports
1608__u64fx_prompts
1688__u64last_ingest_error
1768__u64last_ingest_t_ns
1848__u64tag_writes
1928__u64tag_untracked
2008__u64tag_refused
2088__u64count_writes
2168__u64count_key_absent
2248__u64count_refused
2328__u64reports_emitted
2408__u64counter_cells
2488__u64reporting_level
2568__u64seen_local_out
2648__u64flow_judged
2728__u64flow_cached
2808__u64flow_rejudged
2888__u64flow_expired
2968__u64flow_uncached
3048__u64refusals_emitted
3128__u64refusals_bypassed
3208__u64teardowns_emitted
3288__u64identity_unresolved
3368__u64changes_noted
3448__u64changes_walked
3528__u64contexts
3608__u64[1]_reserved

struct peios_ntfe_counter_rec #

Total size 232 bytes.

OffsetSizeTypeField
064__u8[PEIOS_NTFE_COUNTER_NAME_LEN]name
648__u64hash
721__u8keyspec
731__u8family
742__u8[2]_pad0
764__s32ifindex
8016__u8[16]src_addr
9616__u8[16]dst_addr
1128__u64total
1208__u64last_secs
1284__u32n_windows
1324__u32_pad1
13632__u32[PEIOS_NTFE_COUNTER_MAX_WINDOWS]window_secs
16864__u64[PEIOS_NTFE_COUNTER_MAX_WINDOWS]window_value

struct peios_ntfe_counters_query #

Total size 24 bytes.

OffsetSizeTypeField
08__u64buf
84__u32buf_len
124__u32count
164__u32total
204__u32_pad0

struct peios_ntfe_flow_rec #

Total size 568 bytes.

OffsetSizeTypeField
04__u32id
41__u8family
51__u8protocol
61__u8direction
71__u8loopback
81__u8seen_reply
91__u8assured
101__u8related
111__u8judged
124__s32ifindex
164__u32timeout_secs
2016__u8[16]src_addr
3616__u8[16]dst_addr
522__u16src_port
542__u16dst_port
561__u8icmp_type
571__u8icmp_code
581__u8n_tags
595__u8[5]_pad0
648__u64start_secs
7216__u64[2]packets
8816__u64[2]bytes
10416__u64[PEIOS_NTFE_FLOW_SENTENCES]sentence_generation
12016__s64[PEIOS_NTFE_FLOW_SENTENCES]sentence_expires_at
13616__u64[PEIOS_NTFE_FLOW_SENTENCES]sentence_rule_hash
1522__u8[PEIOS_NTFE_FLOW_SENTENCES]sentence_verdict
1542__u8[PEIOS_NTFE_FLOW_SENTENCES]sentence_reject_kind
1564__u8[4]_pad1
16064__u64[PEIOS_NTFE_FLOW_MAX_TAGS]tag_hash
22464__u64[PEIOS_NTFE_FLOW_MAX_TAGS]tag_value
2882__u8[PEIOS_NTFE_FLOW_SENTENCES]owner_kind
2902__u8[PEIOS_NTFE_FLOW_SENTENCES]owner_unresolved
2924__u8[4]_pad2
2968__s32[PEIOS_NTFE_FLOW_SENTENCES]owner_pid
30432__u8[32]owner_guid
33632__u8[32]owner_comm
368136__u8[136]owner_user
50464__u8[64]owner_service

struct peios_ntfe_flows_query #

Total size 24 bytes.

OffsetSizeTypeField
08__u64buf
84__u32buf_len
124__u32count
164__u32total
204__u32_pad0

struct peios_ntfe_listener_rec #

Total size 168 bytes.

OffsetSizeTypeField
01__u8family
11__u8protocol
21__u8reuseport
31__u8connected
41__u8v6only
51__u8owner_kind
61__u8owner_unresolved
71__u8_pad0
82__u16port
102__u16_pad1
124__s32ifindex
1616__u8[16]addr
324__s32owner_pid
3616__u8[PEIOS_NTFE_GUID_LEN]owner_guid
5216__u8[PEIOS_NTFE_COMM_LEN]owner_comm
6868__u8[PEIOS_NTFE_SID_LEN]owner_user
13632__u8[PEIOS_NTFE_SERVICE_SID_LEN]owner_service

struct peios_ntfe_listeners_query #

Total size 24 bytes.

OffsetSizeTypeField
08__u64buf
84__u32buf_len
124__u32count
164__u32total
204__u32_pad0

Constants #

Grouped as the header groups them.

NTFE — the Network Traffic Filtering Engine: the verdict event stream and engine status.

The engine (net/ntfe) judges every traversal at its standing seats and appends one event per evaluation to a bounded ring. /dev/peios-ntfe (mode 0600; any number of openers, one reader of the stream at a time) drains it: read() returns whole events only — never a partial record — and blocks when the ring is empty unless O_NONBLOCK; poll() raises POLLIN when events are waiting. A slow reader loses the OLDEST events, and the loss is confessed in peios_ntfe_status.events_dropped (the honesty rule: drops are counted, never silent).

Events are emitted for real evaluations (a published forest judged the traversal) and for fail-closed drops; permissive traversals (a layer with no forest — all of them at generation 0) emit nothing, because there is no decision to attribute. Status tells that story instead: generation 0 means "not enforcing", loudly.

This ABI is EXPERIMENTAL while NTFE grows: no stability promise until the design ships (PEI-598). Check abi before trusting the rest.

ConstantValue
PEIOS_NTFE_ABI_VERSION5

Which standing seat judged the traversal.

ConstantValue
PEIOS_NTFE_EV_SEAT_INGRESS1
PEIOS_NTFE_EV_SEAT_EGRESS2
PEIOS_NTFE_EV_SEAT_LOCAL_IN3
PEIOS_NTFE_EV_SEAT_LOCAL_OUT4

Which rules layer.

ConstantValue
PEIOS_NTFE_EV_LAYER_PACKET0
PEIOS_NTFE_EV_LAYER_RAWPACKET1
PEIOS_NTFE_EV_LAYER_FLOW2

The verdict, in strictness order.

ConstantValue
PEIOS_NTFE_EV_VERDICT_PASS0
PEIOS_NTFE_EV_VERDICT_REJECT1
PEIOS_NTFE_EV_VERDICT_DROP2

The story a REJECT told (meaningful iff verdict == REJECT).

ConstantValueNotes
PEIOS_NTFE_EV_REJECT_REFUSED0RST / port-unreachable
PEIOS_NTFE_EV_REJECT_PROHIBITED1admin-prohibited

Traversal direction.

ConstantValue
PEIOS_NTFE_EV_DIR_IN0
PEIOS_NTFE_EV_DIR_OUT1

Flow state as the snapshot carried it (0 = the fact was absent).

ConstantValue
PEIOS_NTFE_EV_FLOW_ABSENT0
PEIOS_NTFE_EV_FLOW_NEW1
PEIOS_NTFE_EV_FLOW_ESTABLISHED2
PEIOS_NTFE_EV_FLOW_RELATED3
PEIOS_NTFE_EV_FLOW_INVALID4
PEIOS_NTFE_EV_FLOW_UNTRACKED5

Event flags.

ConstantValueNotes
PEIOS_NTFE_EV_F_BACKSTOP0x01nothing yielded; DROP
PEIOS_NTFE_EV_F_FAIL_CLOSED0x02evaluation failed; DROP
PEIOS_NTFE_EV_F_REJECT_DEGRADED0x04REJECT emitted as DROP
PEIOS_NTFE_EV_F_REJUDGED0x08Flow: a stale sentence re-judged
PEIOS_NTFE_EV_F_IDENTITY_UNRESOLVED0x10Flow: an endpoint could not be attributed

What stood at an endpoint: the Flow layer's Local / Remote facts (ABI 4).

ConstantValueNotes
PEIOS_NTFE_EV_LOCAL_ABSENT0not a Flow event / not local
PEIOS_NTFE_EV_LOCAL_PROGRAM1a process's socket
PEIOS_NTFE_EV_LOCAL_KERNEL2the stack itself
PEIOS_NTFE_EV_LOCAL_SHARED3inbound multicast / broadcast
PEIOS_NTFE_EV_LOCAL_NONE4nothing receives it
PEIOS_NTFE_EV_ATTR_LEN96

A SID's binary form: revision, sub-authority count, a 48-bit authority, up to 15 sub-authorities. Self-sized by its count byte; all zero = absent.

ConstantValue
PEIOS_NTFE_SID_LEN68

A per-service SID (S-1-5-80 + five sub-authorities) is exactly this.

ConstantValue
PEIOS_NTFE_SERVICE_SID_LEN32
PEIOS_NTFE_COMM_LEN16
PEIOS_NTFE_GUID_LEN16

One counter cell, as the counters dump reports it: the stream and key- spec of its table, the key it holds (only the facts the key-spec names are meaningful; the rest are zero), the cumulative total, and the value of every window the table answers.

ConstantValue
PEIOS_NTFE_COUNTER_NAME_LEN64
PEIOS_NTFE_COUNTER_MAX_WINDOWS8

Key-spec bits.

ConstantValue
PEIOS_NTFE_KEY_SRC_ADDR0x01
PEIOS_NTFE_KEY_DST_ADDR0x02
PEIOS_NTFE_KEY_INTERFACE0x04

One live flow, as the flows dump reports it (ABI 3): conntrack's view of the flow (original-direction tuple, state, remaining lifetime, accounting), NTFE's extension (start time, the interface and direction at first judgment, the sentences, the tags). Tags are reported by hash; the policy names them.

ConstantValue
PEIOS_NTFE_FLOW_MAX_TAGS8
PEIOS_NTFE_FLOW_SENTENCES2

The listeners dump: fills buf with as many records as fit; count is how many were written, total how many sockets the walk saw.

ConstantValue
PEIOS_NTFE_IOC_TYPE0x0000004E
PEIOS_NTFE_IOC_STATUS_NR0x00000001
PEIOS_NTFE_IOC_COUNTERS_NR0x00000002
PEIOS_NTFE_IOC_FLOWS_NR0x00000003
PEIOS_NTFE_IOC_LISTENERS_NR0x00000004

Device operations and errors

Peios Kernel / Userspace interfaces / Native interfaces / NTFE

NTFE ABI Reference is generated from include/uapi/pkm/ntfe.h and holds only what a compiler can measure. This appendix holds the rest.

Stability #

The ABI is experimental while NTFE grows (PEI-598): no stability promise until the design ships. peios_ntfe_status.abi carries PEIOS_NTFE_ABI_VERSION; a consumer checks it before trusting any other field or record layout. Version 2 (the machinery slice) added the event's reject_kind, the store confessions and counter_cells and reporting_level in the status, and the counters ioctl. Version 3 (the Flow layer) added the LOCAL_OUT seat and Flow layer ids, the REJUDGED event flag, the Flow and refusal counters in the status, and the flows ioctl. Version 4 (the identity facts) added the endpoints' identities to the event and the flow record, the IDENTITY_UNRESOLVED event flag and the identity_unresolved counter (in a reserved slot, so the status kept its size). Version 5 renamed the device and every symbol from pnp to ntfe, let more than one file hold the device open, and added changes_noted, changes_walked and contexts to the status: the first took one of the two reserved words version 4 left, the other two are new, so the status grew by two words and keeps one reserved. pnpd and the kernel ship together on the experimental edition, so the check is a guard, not a negotiation.

/dev/peios-ntfe #

A misc device, created mode 0600 and owned by uid 0. Those Unix fields do not grant native access: KACS checks an open() using the opener's token and the node's security descriptor (File Descriptor Storage). On devtmpfs that descriptor is inherited from the seeded root's, which grants GENERIC_ALL to SYSTEM alone, so the device is SYSTEM's unless trusted userspace sets another.

OperationSemanticsErrors
open()Any number of openers.—
read(buf, len)Returns whole struct peios_ntfe_event records only — never a partial one — up to 64 per call, oldest first, consuming them. Blocks on an empty ring unless O_NONBLOCK.EINVAL — len smaller than one record; EBUSY — another open file is the stream's reader; EAGAIN — empty and non-blocking; EINTR; ENOMEM; EFAULT — the records it took are lost (below)
poll()POLLIN | POLLRDNORM when at least one event waits.—
ioctl(PEIOS_NTFE_IOC_STATUS, struct peios_ntfe_status *)Fills the status snapshot. Cumulative counters since boot.EFAULT
ioctl(PEIOS_NTFE_IOC_COUNTERS, struct peios_ntfe_counters_query *)buf/buf_len describe a user buffer of struct peios_ntfe_counter_rec; on return count is how many were written and total how many cells exist. A short buffer is not an error — the two numbers disagree. Best-effort snapshot: cells may change between records.EFAULT; ENOMEM
ioctl(PEIOS_NTFE_IOC_FLOWS, struct peios_ntfe_flows_query *)Same contract over struct peios_ntfe_flow_rec: count written, total live flows the walk saw. Records are copied out between hash buckets, so the dump is a best-effort picture of a table that changes under it.EFAULT; ENOMEM
ioctl(PEIOS_NTFE_IOC_LISTENERS, struct peios_ntfe_listeners_query *)Same contract over struct peios_ntfe_listener_rec: every TCP socket in the listening state and every bound UDP / UDP-Lite socket of the root network namespace, with the identity KACS stamped on it (The identity facts). total is how many the walk saw. A hash bucket holding more sockets than one copy-out batch is walked again from where the batch filled, so with room for every record count equals total.EFAULT; ENOMEM
other ioctls—ENOTTY

Sequence numbers are monotonic per boot. A gap between consecutive records read is the number of events the ring overwrote while the reader was away, plus any a faulting read() consumed; events_dropped in the status is the running total of the overwrites. A read() that fails with EFAULT has already taken its records off the ring: they are lost, and counted nowhere but in that gap.

Bounds not in the header #

BoundValue
Event ring4096 records, overwrite-oldest
Records per read()64
Counter cells per table4096 (PEIOS_NTFE_COUNTER_MAX_KEYS, kernel-internal)
Distinct tags per flow64 (PEIOS_NTFE_TAG_MAX_PER_FLOW, kernel-internal)
Rule depth / rules per layer12 (roots are depth 0: 13 levels) / 4096 (ingestion)
Longest counter window86 400 s
Sentences per flow2 (slot 1 only for loopback flows)
Flow records batched per copy-out32 (kernel-internal)
Listener records batched per copy-out32 (kernel-internal)

Peios Learn — documentation for Peios software.

Built with Trail.