interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / native / argus / argus_contain.h

50 lines · 2296 bytes Raw Blame History
1/* SPDX-License-Identifier: Apache-2.0
2 * Copyright 2026 Drake Stapleton (AIEN / aien-dev)
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef ARGUS_CONTAIN_H
18#define ARGUS_CONTAIN_H
19
20#include "argus_abi.h"
21
22/* Bounded, caller-owned containment state. No allocation, clocks, authority, or I/O. */
23typedef struct ArgusContain ArgusContain;
24
25size_t argus_contain_footprint(void);
26int argus_contain_init(ArgusContain **state, void *memory, size_t bytes);
27
28/* Observe a validated event after core ingestion. Findings are codes 17-21. */
29int argus_contain_observe(ArgusContain *state, const ArgusCore *core,
30 const ArgusEvent *event, ArgusFinding *findings,
31 size_t finding_cap, size_t *finding_count);
32
33/* Convert eligible detector findings to requests and kind-90 events. The caller
34 * ingests returned events directly into the core, then hands requests to AEGIS. */
35int argus_contain_propose(ArgusContain *state, const ArgusCore *core,
36 const ArgusFinding *findings, size_t finding_count,
37 const ArgusEvent *trigger_event,
38 ArgusContainmentRequest *requests, size_t request_cap,
39 ArgusEvent *proposed_events, size_t event_cap,
40 size_t *proposal_count);
41
42void argus_contain_health(const ArgusContain *state, ArgusContainHealth *out);
43void argus_contain_state_digest(const ArgusContain *state,
44 uint8_t out[ARGUS_DIGEST_LEN]);
45
46/* Pending-table overflow is reported once per lifetime. Drain the resulting
47 * CRITICAL telemetry-loss event after propose; ARGUS_ERR_STATE means none waits. */
48int argus_contain_take_overflow_event(ArgusContain *state, ArgusEvent *out);
49
50#endif