def SeccompAction.to_u32

bend-osdev-bpf@0.1.0.0 · seccomp.bend:108

import bend-osdev-bpf@0.1.0.0/seccomp.bend as Seccomp
import Base

108# the SECCOMP_RET_* value of an action, with the low 16 bits of its data
109def SeccompAction.to_u32(a: SeccompAction) -> U32:
110  match a:
111    case SeccompKillProcess{}:
112      2147483648
113    case SeccompKillThread{}:
114      0
115    case SeccompTrap{d}:
116      U32.or(196608, U32.and(65535, d))
117    case SeccompErrno{d}:
118      U32.or(327680, U32.and(65535, d))
119    case SeccompUserNotif{}:
120      2143289344
121    case SeccompTrace{d}:
122      U32.or(2146435072, U32.and(65535, d))
123    case SeccompLog{}:
124      2147221504
125    case SeccompAllow{}:
126      2147418112

Uses (4)

Used by (8)