Liking cljdoc? Tell your friends :D

clj-ebpf.dsl.jump

Jump and control flow operations for BPF programs.

Provides:

  • Conditional jumps (jeq, jne, jgt, jge, etc.)
  • Unconditional jumps (ja)
  • Function calls (call)
  • Program exit (exit)
Jump and control flow operations for BPF programs.

Provides:
- Conditional jumps (jeq, jne, jgt, jge, etc.)
- Unconditional jumps (ja)
- Function calls (call)
- Program exit (exit)
raw docstring

callclj

(call helper-id)

Call a BPF helper function.

r0 = bpf_helper(r1, r2, r3, r4, r5)

Arguments:

  • helper-id: BPF helper function ID (e.g., 1 for map_lookup_elem)
Call a BPF helper function.

r0 = bpf_helper(r1, r2, r3, r4, r5)

Arguments:
- helper-id: BPF helper function ID (e.g., 1 for map_lookup_elem)
sourceraw docstring

exit-insnclj

(exit-insn)

Exit the BPF program.

return r0

The value in r0 is returned to the caller.

Exit the BPF program.

return r0

The value in r0 is returned to the caller.
sourceraw docstring

jaclj

(ja offset)

Unconditional jump.

goto +offset

Arguments:

  • offset: Jump offset (in instructions)
Unconditional jump.

goto +offset

Arguments:
- offset: Jump offset (in instructions)
sourceraw docstring

ja-labelclj

(ja-label label-name)

Unconditional jump to label.

Unconditional jump to label.
sourceraw docstring

jeqclj

(jeq dst src-or-imm offset)

Jump if equal.

if (dst == src/imm) goto +offset

Jump if equal.

if (dst == src/imm) goto +offset
sourceraw docstring

jeq-labelclj

(jeq-label dst src-or-imm label-name)

Jump if equal to label.

if (dst == src/imm) goto label

Jump if equal to label.

if (dst == src/imm) goto label
sourceraw docstring

jgeclj

(jge dst src-or-imm offset)

Jump if greater than or equal (unsigned).

if (dst >= src/imm) goto +offset

Jump if greater than or equal (unsigned).

if (dst >= src/imm) goto +offset
sourceraw docstring

jgtclj

(jgt dst src-or-imm offset)

Jump if greater than (unsigned).

if (dst > src/imm) goto +offset

Jump if greater than (unsigned).

if (dst > src/imm) goto +offset
sourceraw docstring

jleclj

(jle dst src-or-imm offset)

Jump if less than or equal (unsigned).

if (dst <= src/imm) goto +offset

Jump if less than or equal (unsigned).

if (dst <= src/imm) goto +offset
sourceraw docstring

jltclj

(jlt dst src-or-imm offset)

Jump if less than (unsigned).

if (dst < src/imm) goto +offset

Jump if less than (unsigned).

if (dst < src/imm) goto +offset
sourceraw docstring

jmp-immclj

(jmp-imm op dst imm offset)

Conditional jump with immediate comparison.

if (dst OP imm) goto +offset

Arguments:

  • op: Jump operation (:jeq, :jne, :jgt, etc.)
  • dst: Register to compare
  • imm: Immediate value to compare against
  • offset: Jump offset (in instructions, not bytes)
Conditional jump with immediate comparison.

if (dst OP imm) goto +offset

Arguments:
- op: Jump operation (:jeq, :jne, :jgt, etc.)
- dst: Register to compare
- imm: Immediate value to compare against
- offset: Jump offset (in instructions, not bytes)
sourceraw docstring

jmp-opsclj

Map of jump operation keywords to BPF opcodes

Map of jump operation keywords to BPF opcodes
sourceraw docstring

jmp-regclj

(jmp-reg op dst src offset)

Conditional jump with register comparison.

if (dst OP src) goto +offset

Arguments:

  • op: Jump operation (:jeq, :jne, :jgt, etc.)
  • dst: Register to compare
  • src: Register to compare against
  • offset: Jump offset (in instructions)
Conditional jump with register comparison.

if (dst OP src) goto +offset

Arguments:
- op: Jump operation (:jeq, :jne, :jgt, etc.)
- dst: Register to compare
- src: Register to compare against
- offset: Jump offset (in instructions)
sourceraw docstring

jmp32-immclj

(jmp32-imm op dst imm offset)

32-bit conditional jump with immediate comparison.

if ((u32)dst OP imm) goto +offset

32-bit conditional jump with immediate comparison.

if ((u32)dst OP imm) goto +offset
sourceraw docstring

jmp32-regclj

(jmp32-reg op dst src offset)

32-bit conditional jump with register comparison.

if ((u32)dst OP (u32)src) goto +offset

32-bit conditional jump with register comparison.

if ((u32)dst OP (u32)src) goto +offset
sourceraw docstring

jneclj

(jne dst src-or-imm offset)

Jump if not equal.

if (dst != src/imm) goto +offset

Jump if not equal.

if (dst != src/imm) goto +offset
sourceraw docstring

jne-labelclj

(jne-label dst src-or-imm label-name)

Jump if not equal to label.

Jump if not equal to label.
sourceraw docstring

jsetclj

(jset dst src-or-imm offset)

Jump if bitwise AND is non-zero.

if (dst & src/imm) goto +offset

Jump if bitwise AND is non-zero.

if (dst & src/imm) goto +offset
sourceraw docstring

jsgeclj

(jsge dst src-or-imm offset)

Jump if greater than or equal (signed).

if ((s64)dst >= (s64)src/imm) goto +offset

Jump if greater than or equal (signed).

if ((s64)dst >= (s64)src/imm) goto +offset
sourceraw docstring

jsgtclj

(jsgt dst src-or-imm offset)

Jump if greater than (signed).

if ((s64)dst > (s64)src/imm) goto +offset

Jump if greater than (signed).

if ((s64)dst > (s64)src/imm) goto +offset
sourceraw docstring

jsleclj

(jsle dst src-or-imm offset)

Jump if less than or equal (signed).

if ((s64)dst <= (s64)src/imm) goto +offset

Jump if less than or equal (signed).

if ((s64)dst <= (s64)src/imm) goto +offset
sourceraw docstring

jsltclj

(jslt dst src-or-imm offset)

Jump if less than (signed).

if ((s64)dst < (s64)src/imm) goto +offset

Jump if less than (signed).

if ((s64)dst < (s64)src/imm) goto +offset
sourceraw docstring

labelclj

(label name)

Create a label marker for the assembler.

Labels are resolved during assembly to compute jump offsets.

Create a label marker for the assembler.

Labels are resolved during assembly to compute jump offsets.
sourceraw docstring

label-refclj

(label-ref name)

Create a reference to a label.

Used as the offset argument in jump instructions.

Create a reference to a label.

Used as the offset argument in jump instructions.
sourceraw docstring

label-ref?clj

(label-ref? v)

Check if a value is a label reference.

Check if a value is a label reference.
sourceraw docstring

label?clj

(label? insn)

Check if an instruction is a label.

Check if an instruction is a label.
sourceraw docstring

tail-callclj

(tail-call)

Generate a tail call to another BPF program.

This is essentially: bpf_tail_call(ctx, prog_array, index) Helper ID 12 = bpf_tail_call

Generate a tail call to another BPF program.

This is essentially: bpf_tail_call(ctx, prog_array, index)
Helper ID 12 = bpf_tail_call
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close