Skip to main content

Python BPF Assembler

Project description

PyPI Build & Test Docs

Python BPF Assembler.

Based on the BPF assembler in Linux sources.

Installations

Wheels are available. To build from source you need a relatively recent Flex & Bison. (On Windows you can use winflexbison, on macOS, and sometimes on Linux, you can install them from homebrew).

Usage

import bpf_asm


ASM = """\
    ldh [12]
    jeq #0x800, accept, drop
accept:
    ret #65536
drop:
    ret #0
"""

print(bpf_asm.assemble(ASM))

Or use the pybpf_asm script. See pybpf_asm --help for usage.

License

GPL-2.0-only.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bpf_asm-0.1.2.tar.gz (22.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

bpf_asm-0.1.2-cp311-cp311-win_amd64.whl (49.2 kB view details)

Uploaded CPython 3.11Windows x86-64

bpf_asm-0.1.2-cp311-cp311-win32.whl (45.2 kB view details)

Uploaded CPython 3.11Windows x86

bpf_asm-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (60.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

bpf_asm-0.1.2-cp311-cp311-macosx_10_9_x86_64.whl (52.3 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

bpf_asm-0.1.2-cp310-cp310-win_amd64.whl (49.0 kB view details)

Uploaded CPython 3.10Windows x86-64

bpf_asm-0.1.2-cp310-cp310-win32.whl (45.0 kB view details)

Uploaded CPython 3.10Windows x86

bpf_asm-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (60.9 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

bpf_asm-0.1.2-cp310-cp310-macosx_10_9_x86_64.whl (52.2 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

bpf_asm-0.1.2-cp39-cp39-win_amd64.whl (49.8 kB view details)

Uploaded CPython 3.9Windows x86-64

bpf_asm-0.1.2-cp39-cp39-win32.whl (45.7 kB view details)

Uploaded CPython 3.9Windows x86

bpf_asm-0.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (62.0 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

bpf_asm-0.1.2-cp39-cp39-macosx_10_9_x86_64.whl (52.9 kB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

bpf_asm-0.1.2-cp38-cp38-win_amd64.whl (49.8 kB view details)

Uploaded CPython 3.8Windows x86-64

bpf_asm-0.1.2-cp38-cp38-win32.whl (45.8 kB view details)

Uploaded CPython 3.8Windows x86

bpf_asm-0.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (62.2 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

bpf_asm-0.1.2-cp38-cp38-macosx_10_9_x86_64.whl (52.8 kB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

bpf_asm-0.1.2-cp37-cp37m-win_amd64.whl (49.6 kB view details)

Uploaded CPython 3.7mWindows x86-64

bpf_asm-0.1.2-cp37-cp37m-win32.whl (45.5 kB view details)

Uploaded CPython 3.7mWindows x86

bpf_asm-0.1.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (61.2 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

bpf_asm-0.1.2-cp37-cp37m-macosx_10_9_x86_64.whl (52.2 kB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

bpf_asm-0.1.2-cp36-cp36m-win_amd64.whl (49.6 kB view details)

Uploaded CPython 3.6mWindows x86-64

bpf_asm-0.1.2-cp36-cp36m-win32.whl (45.5 kB view details)

Uploaded CPython 3.6mWindows x86

bpf_asm-0.1.2-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (61.0 kB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.17+ x86-64

bpf_asm-0.1.2-cp36-cp36m-macosx_10_9_x86_64.whl (52.1 kB view details)

Uploaded CPython 3.6mmacOS 10.9+ x86-64

File details

Details for the file bpf_asm-0.1.2.tar.gz.

File metadata

  • Download URL: bpf_asm-0.1.2.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for bpf_asm-0.1.2.tar.gz
Algorithm Hash digest
SHA256 aca7d1a7bf6d438d7c0f7eeb60bcaafd0757fc9d822ba4d76aedc65a55823490
MD5 333fc3181499c69e0f6d212e55535bcf
BLAKE2b-256 0886b1f6a65c7e2f5f8d8f8327eec04e47ce2d1de9072f8499038529ff8f6cae

See more details on using hashes here.

File details

Details for the file bpf_asm-0.1.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: bpf_asm-0.1.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 49.2 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for bpf_asm-0.1.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4589b86c2a288151c6498eb152ab744e09c6978818ceddf775fae67b2138af03
MD5 18b653a487c8b2a52b344a73b250ba9f
BLAKE2b-256 ce942cba87918468348ebc9903de76bb9b544e2729af9da6be8f45e39de19183

See more details on using hashes here.

File details

Details for the file bpf_asm-0.1.2-cp311-cp311-win32.whl.

File metadata

  • Download URL: bpf_asm-0.1.2-cp311-cp311-win32.whl
  • Upload date:
  • Size: 45.2 kB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for bpf_asm-0.1.2-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 3c99a729caac70b491cc970a246e1c1f0854ebf3ce9ab8cfe918cb736838d774
MD5 36a6a7b5dd2253a643b56b5362b0de35
BLAKE2b-256 52ec6cbd88c685043c3c8a5355ccf7cf9c42cb8aa7be637d87493dd3d54d9fd7

See more details on using hashes here.

File details

Details for the file bpf_asm-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bpf_asm-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a80438e16522cedc545348b51c8aec623534405172bb922643571c38ffcbd457
MD5 227edd5c44470cf7196a2330d5392921
BLAKE2b-256 a295ebb3f14aab6cb6fce9ca75232d953a96ac162190cdc73b041ebeef1d6315

See more details on using hashes here.

File details

Details for the file bpf_asm-0.1.2-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for bpf_asm-0.1.2-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 9c0e64383ba54d546c9f8d4cfef9bbff1085c49854d4c8d66e3cd796e38f294c
MD5 9c5c2d29a9362c585e8363b552857167
BLAKE2b-256 2efd3a37158f38c9d639f9304bdba03a61aad659c430ba7f870cfcf4dec9bb0e

See more details on using hashes here.

File details

Details for the file bpf_asm-0.1.2-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: bpf_asm-0.1.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 49.0 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for bpf_asm-0.1.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 25befe0a55bd4d312c91f136cf1825c38701605e8a2f91d56a39e11753d9d2cd
MD5 a2b9ba069b8ff5b730e1e8da5131ff49
BLAKE2b-256 311ffd7ed7ad91b4424fefbfc7d91357751a1a678735e7ba13503e7fbf4e8d21

See more details on using hashes here.

File details

Details for the file bpf_asm-0.1.2-cp310-cp310-win32.whl.

File metadata

  • Download URL: bpf_asm-0.1.2-cp310-cp310-win32.whl
  • Upload date:
  • Size: 45.0 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for bpf_asm-0.1.2-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 233741bd160c473c3887a104251cecd20f1eb96f28226196378c7084f87a69a7
MD5 95df6a9e4f72361d16cded6f057d61ed
BLAKE2b-256 680b64682ff63f9fccb677b9dd879c2354f1cca3e841de9ae97e3931f82b8383

See more details on using hashes here.

File details

Details for the file bpf_asm-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bpf_asm-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e44b7c742844fbdaaec18168155bfb701181918beda90c6fe59e9d58c07c21e6
MD5 c6ff28a4b2d520a55935febd4253b611
BLAKE2b-256 a4e47e854f7a6ed4636c3713384cfcb461b7895842f0c700d0f907adbb72998e

See more details on using hashes here.

File details

Details for the file bpf_asm-0.1.2-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for bpf_asm-0.1.2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8628b9c431641aaceebc82723d0ffba1eeb392fc170b0f43f40e1467d193b5e6
MD5 905e76b935f148220491968617755311
BLAKE2b-256 a39c965974250f7a3daaa2bc1b763c659d1dd3eaf5a350fa77c2453e491175c4

See more details on using hashes here.

File details

Details for the file bpf_asm-0.1.2-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: bpf_asm-0.1.2-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 49.8 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for bpf_asm-0.1.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 42848b9fbd7382ac12cb4a39418ba02b5f227364e82de4ea5bae70408b36452a
MD5 5b07c54ae79c40ce99e9eaebfb2441fd
BLAKE2b-256 ada9b5cfa43c1d3de61c274be439c2fe903bb4efb386b68850dccdaa6b36f198

See more details on using hashes here.

File details

Details for the file bpf_asm-0.1.2-cp39-cp39-win32.whl.

File metadata

  • Download URL: bpf_asm-0.1.2-cp39-cp39-win32.whl
  • Upload date:
  • Size: 45.7 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for bpf_asm-0.1.2-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 f4d9b57133a3776a0827f47b6896f55dc9c92037997f44c415b24198f32953f4
MD5 041d343f7321d7e039b020fa07c7d2f7
BLAKE2b-256 c1527c0c4f659376f844f2a6c74a7c48436d028e50ca33b299d7ca4a15439fc5

See more details on using hashes here.

File details

Details for the file bpf_asm-0.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bpf_asm-0.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0c8476550f2e25c188b05e9ab08e78da5379e87ffe1061f9cd345d31e83a2064
MD5 10ff567b4286d3d2be8bcf4d2c4942b3
BLAKE2b-256 441f8502e847ac7ab3f9e17013afe8dd0d45e289edad78b291b81594739e81a9

See more details on using hashes here.

File details

Details for the file bpf_asm-0.1.2-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for bpf_asm-0.1.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5c2c92b98999af0bb9e3e5cfa168f99916503a955ed9c8b30e725037ab23d173
MD5 e6845ba83da9359fc5436b57b2e851ec
BLAKE2b-256 37dd12417b001a6d23ba47df8ec8e2c223bc4bd999fca61e4ee2157a3f25f9e1

See more details on using hashes here.

File details

Details for the file bpf_asm-0.1.2-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: bpf_asm-0.1.2-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 49.8 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for bpf_asm-0.1.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 69cbfd54d01e34bd405f23cca0a0305df0f25c00a445629864fcebaa09f123f1
MD5 f9670b7b41e257ff9b761cb03db455ac
BLAKE2b-256 f72a7eac2985b59c700c444e58bf1b720a57dee18c931e533a9b495691b1c5e0

See more details on using hashes here.

File details

Details for the file bpf_asm-0.1.2-cp38-cp38-win32.whl.

File metadata

  • Download URL: bpf_asm-0.1.2-cp38-cp38-win32.whl
  • Upload date:
  • Size: 45.8 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for bpf_asm-0.1.2-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 13448891f6c3688cd92a916fbbcbdff8742947cf1f8b2a16906835dbf52b6dba
MD5 5e30dac6acd68123a47e498ee6a9d91b
BLAKE2b-256 9b52681cd35519f60ff0f82e8b27fc9fb79a37728bf21fc3d0258f332d99b476

See more details on using hashes here.

File details

Details for the file bpf_asm-0.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bpf_asm-0.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b5b70f88a715ff0e1d25238771aa9ab1581b7994e92b2fce32f5f070101110d7
MD5 ca5baf175b5cb102f4f193741c35e9db
BLAKE2b-256 589928b371468b2b3ca4250036dc71efb8b832fdca03ed5478bc8495b329cdc6

See more details on using hashes here.

File details

Details for the file bpf_asm-0.1.2-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for bpf_asm-0.1.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 09462a75ff74f6eb27f50977181d614d37bfc16f155587885cf6a4b163e41124
MD5 6f8048bd000fb17f7accb18403f5f4d5
BLAKE2b-256 f1329b44b63313bd3744c823131009db1e23e4fbe4bc40f196a9062b6d2203a9

See more details on using hashes here.

File details

Details for the file bpf_asm-0.1.2-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: bpf_asm-0.1.2-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 49.6 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for bpf_asm-0.1.2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 c925e2c5050e57c8032fbcaf54a9ed296c635edf7546cd6bbd91872f5a22dd2e
MD5 e248d25a4e6582c09a3127991e7f5e8a
BLAKE2b-256 d255fea99e666031dd20f52cad85d9bd1276e6152b0af5d6c4f8295688c4c309

See more details on using hashes here.

File details

Details for the file bpf_asm-0.1.2-cp37-cp37m-win32.whl.

File metadata

  • Download URL: bpf_asm-0.1.2-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 45.5 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for bpf_asm-0.1.2-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 c728bf223dee81bd69183d0fb4bc345786eb533145df63a59a3de46aa1f7bbb2
MD5 5c2557f892830e0251ebeae2f02bacec
BLAKE2b-256 07e34a4b0caed7b12640e274057a455ed799226c6e951b88c2dd934f280694cc

See more details on using hashes here.

File details

Details for the file bpf_asm-0.1.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bpf_asm-0.1.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2326462b03bc5d9404e1ef97068443fafa6c616b7fea530c021bd9144647870b
MD5 b163459c9441a5f1f55d465f4f32d984
BLAKE2b-256 db58c12cb6e8acb015268f7748f2e344861ff544e7a8c6e433899bd716f11743

See more details on using hashes here.

File details

Details for the file bpf_asm-0.1.2-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for bpf_asm-0.1.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 eb95e079f6457747079d55727ea463cd033b2701f639b88a0c1e5128cedd898c
MD5 b05478b61d1465c44e6a797a8b2617de
BLAKE2b-256 204e90e9b0276e266d7f03fab24f84b6f665b26e6047cae0b5b2e53334d1b8c7

See more details on using hashes here.

File details

Details for the file bpf_asm-0.1.2-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: bpf_asm-0.1.2-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 49.6 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for bpf_asm-0.1.2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 3bdbad28558c0025e41fc9030cc6c8f17a8db1261f10589c478716099d2c5ed0
MD5 286fa616a650c3002e6fa28b9a20f960
BLAKE2b-256 5286055d4093ea4ec49a453e3dc404733ba4c5e67fb574244a9a416750342eb9

See more details on using hashes here.

File details

Details for the file bpf_asm-0.1.2-cp36-cp36m-win32.whl.

File metadata

  • Download URL: bpf_asm-0.1.2-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 45.5 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for bpf_asm-0.1.2-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 c8f4c3574142a14dd2d60bfb7ac00a364f18be0ea4b0f62450c10b8d1e3cc984
MD5 00ba2b854fee96d73015eb9fa1a6ad96
BLAKE2b-256 2830a722114e820bad080aadd3b7ead25febe87851f4d2b71c88f6ca36998da4

See more details on using hashes here.

File details

Details for the file bpf_asm-0.1.2-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bpf_asm-0.1.2-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ea2218846eef03db492e196c291ad455481649dd4c720f5f92936d9f53279be1
MD5 0ae9e09abdec4a89c8c5a5a00ec3751c
BLAKE2b-256 f7217576c7eb3993c5272cc72e94f6c36dbef0517bc96b7f7564114473048930

See more details on using hashes here.

File details

Details for the file bpf_asm-0.1.2-cp36-cp36m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for bpf_asm-0.1.2-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f7598306fd5886560f713a42fe252e69c9cf5f458fdfa3f6c0e7df99118d033b
MD5 1bd6b28f72ec886e6d8b59eecc7eed82
BLAKE2b-256 f3d0aa16d45c4aeabb981fc6375d8708223bef697bcfbf29d7a483d65641f138

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page