Python BPF Assembler
Project description
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, on older distributions), you can install them from Homebrew. Note that you might have to add Homebrew’s version to the front of the PATH, e.g. PATH="$(brew --prefix)/opt/flex/bin:$(brew --prefix)/opt/bison/bin:$PATH".
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
Built Distributions
File details
Details for the file bpf_asm-0.1.4.tar.gz
.
File metadata
- Download URL: bpf_asm-0.1.4.tar.gz
- Upload date:
- Size: 24.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e8d2f6c577c8aaf5c1d9d6cbd572c22c4d638b2824beff610d2a083df139816 |
|
MD5 | 12ad4aa14088c60d7074d67e416aeaff |
|
BLAKE2b-256 | 3c148b5dbbcf0118cb8f41af221696abe4be44bf90bae9a00e0586d0f5f83b34 |
File details
Details for the file bpf_asm-0.1.4-cp313-cp313-win_amd64.whl
.
File metadata
- Download URL: bpf_asm-0.1.4-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 52.9 kB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab9f042ba30f65dd4cc97cbec68a6de37e4eb3bc9bc7de22ac00d7f1f4c753b4 |
|
MD5 | d82aae92a9b6146046664f0fee61b95b |
|
BLAKE2b-256 | 2e13bd3214e2293bd2f7f9fa7fd1514938b5e21f8f5b1f5217ecb2780193d97d |
File details
Details for the file bpf_asm-0.1.4-cp313-cp313-win32.whl
.
File metadata
- Download URL: bpf_asm-0.1.4-cp313-cp313-win32.whl
- Upload date:
- Size: 48.0 kB
- Tags: CPython 3.13, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed2d727b46c7491db73deeb90882d76c50417ba2e351af422f85dda29c46a83b |
|
MD5 | 889305e07c734a12ca9fdbd3b7e2a4fc |
|
BLAKE2b-256 | 6b60138b8d4df2d405d1255cbc2c3f8e0272f28aea0fc677921c0087144969a9 |
File details
Details for the file bpf_asm-0.1.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: bpf_asm-0.1.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 64.5 kB
- Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a8622ae4009f876badfc8152bc09d278bd6ecfdf675311b719410d1047534c5 |
|
MD5 | 75e2dd7165c28f4fc0c3f236d6e345ab |
|
BLAKE2b-256 | 56b59d9f08c6b55ace56b363361c391c9a418dc53961e01fdc6762ea98f3b83e |
File details
Details for the file bpf_asm-0.1.4-cp313-cp313-macosx_10_13_universal2.whl
.
File metadata
- Download URL: bpf_asm-0.1.4-cp313-cp313-macosx_10_13_universal2.whl
- Upload date:
- Size: 94.1 kB
- Tags: CPython 3.13, macOS 10.13+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1fe6f7192f5d6fc8313b0b1d18e358831993a92c034650fd7da362e5e57b034 |
|
MD5 | cc0642a0fce0b40a3673cb1414fda70d |
|
BLAKE2b-256 | 3f697de622adb0739e5dbc525217dc5604929e7bfd1a1f9e8a3fc48dbeb2886a |
File details
Details for the file bpf_asm-0.1.4-cp312-cp312-win_amd64.whl
.
File metadata
- Download URL: bpf_asm-0.1.4-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 54.2 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3080cb3a10fd9992d5292f812c75c83761c98b3c7f7c8a69d832f2f20e085aa |
|
MD5 | a4f3fe67e40f9949c699fc115ce6f255 |
|
BLAKE2b-256 | b1d2ef28df89fa177b9a39117f412b4efd66425b699b4574efed5aa305e37ffb |
File details
Details for the file bpf_asm-0.1.4-cp312-cp312-win32.whl
.
File metadata
- Download URL: bpf_asm-0.1.4-cp312-cp312-win32.whl
- Upload date:
- Size: 48.6 kB
- Tags: CPython 3.12, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 281e9cdb0e26122c6192b02a7f69366eb551e1fa9b9432c7199dd66cafb84a9b |
|
MD5 | c9c8cba8e5fd665605420cf4fc68b8b5 |
|
BLAKE2b-256 | 500fc6e767707b1c970ed6991f70903152e5bbc876d1a36e1b5b03381f9f742f |
File details
Details for the file bpf_asm-0.1.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: bpf_asm-0.1.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 66.1 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55e4eac1ca35e9232d861ec3d5204ad92c20ba3fa696d8fbecffa01fd4dac958 |
|
MD5 | 8b727be79c0cad287bdd3dd3a6794b66 |
|
BLAKE2b-256 | a6cb4e05a319d78b82270323afabf7b398d3f8a2d06e25fb65ac37fb4ecbee82 |
File details
Details for the file bpf_asm-0.1.4-cp312-cp312-macosx_10_13_universal2.whl
.
File metadata
- Download URL: bpf_asm-0.1.4-cp312-cp312-macosx_10_13_universal2.whl
- Upload date:
- Size: 95.3 kB
- Tags: CPython 3.12, macOS 10.13+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e82b227c85c10b31b5d672c8f6153a4217407d78b3a0a3f4cc51954b488f22e8 |
|
MD5 | 69b7674ed20d42eb0e68833ff5425384 |
|
BLAKE2b-256 | b6675aa9f1d7b57f18667d43c026f5b4cdef75bd137e074198a99f32f0e66e60 |
File details
Details for the file bpf_asm-0.1.4-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: bpf_asm-0.1.4-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 54.0 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a09269ccef3fde8139d4984fc6f244612831a0b76873667d249834182bc11af |
|
MD5 | 9e2b20ff64ca541e6ea1070deacd659f |
|
BLAKE2b-256 | 6dce5fc9b09625eb2493d8f26287cabaaf59c145a81e5e9503da1d1462f422c6 |
File details
Details for the file bpf_asm-0.1.4-cp311-cp311-win32.whl
.
File metadata
- Download URL: bpf_asm-0.1.4-cp311-cp311-win32.whl
- Upload date:
- Size: 49.4 kB
- Tags: CPython 3.11, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a64c6125371e1e89541b57cbde6337382d07a6e3547d99e14d3a4572ea8757f |
|
MD5 | 8e894f985866eb06fbf7cc1e1358cfc5 |
|
BLAKE2b-256 | c85ad3329c14be9220917145dd8f37d090efe1f5de79983fddfe55106db356c5 |
File details
Details for the file bpf_asm-0.1.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: bpf_asm-0.1.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 65.9 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3f23e593dbb7d23e9d6dfc64f3ba74a8d76228f0e2329839fc610e10a5cc856 |
|
MD5 | 24bd6d2b861e1ed27cd6726c5461b366 |
|
BLAKE2b-256 | 93a86bedaf2cbb19878871ecea51920efc591de9a57d452d17b8613ce82d41cc |
File details
Details for the file bpf_asm-0.1.4-cp311-cp311-macosx_10_9_universal2.whl
.
File metadata
- Download URL: bpf_asm-0.1.4-cp311-cp311-macosx_10_9_universal2.whl
- Upload date:
- Size: 95.4 kB
- Tags: CPython 3.11, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d90b402fc2100f99ac1c6045c2871f6e7191797a66b395a723a7112fef5a57c9 |
|
MD5 | 348d2cbb7f1d870f337d376b765d2fb9 |
|
BLAKE2b-256 | 5978d53db2abddfa9b9006e44f0210a7e07087f0e407ae8e934da6db11cf04c9 |
File details
Details for the file bpf_asm-0.1.4-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: bpf_asm-0.1.4-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 53.8 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9089c173ec3ae0dd40e58d5ae02a293a771907cf8b54a81b26d031463fc63c6a |
|
MD5 | 9f9af7ee5bfffde992d3fafa35ec2c8c |
|
BLAKE2b-256 | a4a27735e4cbc8ebe42a364bd0a1cb85e32a9483064ffa844e2c35667ac59c57 |
File details
Details for the file bpf_asm-0.1.4-cp310-cp310-win32.whl
.
File metadata
- Download URL: bpf_asm-0.1.4-cp310-cp310-win32.whl
- Upload date:
- Size: 49.5 kB
- Tags: CPython 3.10, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f845574e203f2dcaca2fff6fbe4a5d140f5b1469cf4f4809612aca3aeca3f6ec |
|
MD5 | 893cb1edd053693a3dd40931d1f831a6 |
|
BLAKE2b-256 | c1638f523c1c552d6f54baf65910b7190af36dedace5f31bee30fbefd79bec95 |
File details
Details for the file bpf_asm-0.1.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: bpf_asm-0.1.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 66.1 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 558714496acb3bd9e49ec340962e9a8154e67c32f21a3e0a9e4702eae4e82b13 |
|
MD5 | b29c8d856797818817212814895489c5 |
|
BLAKE2b-256 | 8cddcae2d72b3d59df966fb2f13de46ae86c0473716d702ecfa3259774fc47fb |
File details
Details for the file bpf_asm-0.1.4-cp310-cp310-macosx_10_9_universal2.whl
.
File metadata
- Download URL: bpf_asm-0.1.4-cp310-cp310-macosx_10_9_universal2.whl
- Upload date:
- Size: 96.1 kB
- Tags: CPython 3.10, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e56137fa8e37488f4a3c3b00c16f337e007b8d6bd149deb3d79b5315e91b60ac |
|
MD5 | fcbd345995a606ebd6b582474317e2e1 |
|
BLAKE2b-256 | 188749646576e45ef8fcad157a522143cff34410e2913b0558e8aefcaa7a6bde |
File details
Details for the file bpf_asm-0.1.4-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: bpf_asm-0.1.4-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 53.9 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ee26d5c9cc6a425a2d54cbb6cb9cb8f525272f913bb5e91525ff30b4b9d2ea5 |
|
MD5 | fcfdfbd8df4f8c9a7183477bf7894f85 |
|
BLAKE2b-256 | 37a6482f6d7ddb6cdc487a690a6534bed69df9feb111b692752accf623ed058a |
File details
Details for the file bpf_asm-0.1.4-cp39-cp39-win32.whl
.
File metadata
- Download URL: bpf_asm-0.1.4-cp39-cp39-win32.whl
- Upload date:
- Size: 49.5 kB
- Tags: CPython 3.9, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e523b6c5864d66e85ce9bb514c21a8f34b7153b0c5c19db942a85127c88ce0c |
|
MD5 | 55dd742d31576b051e02f78815e9ca24 |
|
BLAKE2b-256 | 8d28be75db431d3cdedfffd62c0bda503d72019469c7b12311ce6d25418ac989 |
File details
Details for the file bpf_asm-0.1.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: bpf_asm-0.1.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 66.1 kB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fa933e203c80385047f00deee0f0425c7163fd70c590cd3c980256931dee84f |
|
MD5 | 1b715658110757649c5eb819aa46b101 |
|
BLAKE2b-256 | c3165d529bd33c978daa0f3c87b47d074228f105e7fd9027b7305dcfc33efbbb |
File details
Details for the file bpf_asm-0.1.4-cp39-cp39-macosx_10_9_universal2.whl
.
File metadata
- Download URL: bpf_asm-0.1.4-cp39-cp39-macosx_10_9_universal2.whl
- Upload date:
- Size: 96.1 kB
- Tags: CPython 3.9, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 000126f561e690b8bab4c288e02b11ab3b3606eb47ea55f947c5c94d75a8ce10 |
|
MD5 | 448cf5153d408813b02bfe0032f4966d |
|
BLAKE2b-256 | 2b7ab74644c9ca14d4f000776c076f1fc031b01ae156e5217889be4b841ada8f |
File details
Details for the file bpf_asm-0.1.4-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: bpf_asm-0.1.4-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 54.0 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e33490805640fc5e74b4f62c1ccd04af77ce9e5cd71829ab5e281b1af224e98 |
|
MD5 | cdb81893dbd0980e02c9a36bead43a57 |
|
BLAKE2b-256 | b32d32df66c4098680ce0119693a97e3e3b82b3492753f57694dafa569d2a41d |
File details
Details for the file bpf_asm-0.1.4-cp38-cp38-win32.whl
.
File metadata
- Download URL: bpf_asm-0.1.4-cp38-cp38-win32.whl
- Upload date:
- Size: 49.6 kB
- Tags: CPython 3.8, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 415538d8322c27beb219674804bfc0fdc6ac9d7474353eb178c42f44d3dd0a7f |
|
MD5 | 07d02fa80fd68c407fc348dc02137668 |
|
BLAKE2b-256 | 8c0176ba925dcf8880d41910218c413e0b77bca2362e373565f59763d6dbdc47 |
File details
Details for the file bpf_asm-0.1.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: bpf_asm-0.1.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 66.3 kB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac84bf2d5165fa300e3e74936a083eabab4122454368a6fc6acaa6c3bcebde7c |
|
MD5 | 6759fd09f5ac6f62fbbb853620ce684d |
|
BLAKE2b-256 | f916729d92add4697b24624f45fe3c66269c2a0e0abe5578d2afe79a9264f134 |
File details
Details for the file bpf_asm-0.1.4-cp38-cp38-macosx_10_9_universal2.whl
.
File metadata
- Download URL: bpf_asm-0.1.4-cp38-cp38-macosx_10_9_universal2.whl
- Upload date:
- Size: 96.4 kB
- Tags: CPython 3.8, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fad5ef419916e8d83d6fb0fddf20ab27e36c3960673839aaed2a367c7145bac6 |
|
MD5 | 2dfbfb81689ea861e6c55e9cc83b4880 |
|
BLAKE2b-256 | f96afd84ab941f5b0566a44075c1cbb266956c436ee8284901bfec7f57cf6297 |
File details
Details for the file bpf_asm-0.1.4-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: bpf_asm-0.1.4-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 55.0 kB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e606d7567fe21f92e85cb1e7909cb00c3bf3427b496e5d03742667467b499576 |
|
MD5 | f543eb474fb1306faacd6dae8db32f26 |
|
BLAKE2b-256 | b9b74b6a27155de75f0950054927df329e1041dad314b34cd2ff4ee92be931da |
File details
Details for the file bpf_asm-0.1.4-cp37-cp37m-win32.whl
.
File metadata
- Download URL: bpf_asm-0.1.4-cp37-cp37m-win32.whl
- Upload date:
- Size: 50.0 kB
- Tags: CPython 3.7m, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1bf85aac1399ed8e10545312b842f4f92be1c75098f514277a7bb2883d13b38 |
|
MD5 | c13bd161ba598933fb93f27f45316416 |
|
BLAKE2b-256 | 5635d37c7e10b279e51d57add8155d6bb53fa02a6d5b6560075f89ace0535548 |
File details
Details for the file bpf_asm-0.1.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: bpf_asm-0.1.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 65.4 kB
- Tags: CPython 3.7m, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e3af7524a4bc3a27c0243ed4e522e41c80ad10f6dd658d00ca71b74ab82e2ec |
|
MD5 | 1b6257a875b4d5b3a7879c0e027352b4 |
|
BLAKE2b-256 | f0054974f09ac617f2bacee7d41e6a313791b8df2f378681db5a086b8604e084 |