STRUCT DPKG_EXTRACT(9)
π struct dpkg_extract(9) π
okay so bestie, welcome to the Kernel API Manual β this is the page for struct dpkg_extract, and it's literally just a structure for defining a single extraction. one extraction. that's the whole vibe. let's get into it π
β¨ NAME β¨
struct dpkg_extract β a structure for defining a single extraction π«Ά
πΈ SYNOPSIS πΈ
struct dpkg_extract {
enum dpkg_extract_type type;
union {
struct {
enum net_prot prot;
enum dpkg_extract_from_hdr_type type;
u32 field;
u8 size;
u8 offset;
u8 hdr_index;
} from_hdr;
struct {
u8 size;
u8 offset;
} from_data;
struct {
u8 size;
u8 offset;
} from_parse;
} extract;
u8 num_of_byte_masks;
struct dpkg_mask masks[DPKG_NUM_OF_MASKS];
};
like, look at her. nested structs in a union in a struct. main character energy fr fr π
π¦ Members π¦
okay so here's the cast of characters, no cap:
typeβ this one decides how the union down below gets read. it's giving "choose your fighter":DPKG_EXTRACT_FROM_HDR: selectsfrom_hdrπDPKG_EXTRACT_FROM_DATA: selectsfrom_dataπDPKG_EXTRACT_FROM_PARSE: selectsfrom_parseπ
extractβ selects the extraction method, iconic behaviorextract.from_hdrβ used whentype = DPKG_EXTRACT_FROM_HDRextract.from_hdr.protβ any of the supported headersextract.from_hdr.typeβ defines the type of header extraction, and it's a whole little menu:DPKG_FROM_HDR: usesize&offsetbelowDPKG_FROM_FIELD: usefield,sizeandoffsetbelowDPKG_FULL_FIELD: usefieldbelow
extract.from_hdr.fieldβ one of the supported fields (NH_FLD_)extract.from_hdr.sizeβ size in bytesextract.from_hdr.offsetβ byte offsetextract.from_hdr.hdr_indexβ clear for cases not listed below; used for protocols that may have more than a single header,0indicates an outer header. supported protocols (possible values):NET_PROT_VLAN(0,HDR_INDEX_LAST);NET_PROT_MPLS(0,1,HDR_INDEX_LAST);NET_PROT_IP(0,HDR_INDEX_LAST);NET_PROT_IPv4(0,HDR_INDEX_LAST);NET_PROT_IPv6(0,HDR_INDEX_LAST); β ngl this one is doing the most but we respect her πextract.from_dataβ used whentype = DPKG_EXTRACT_FROM_DATAextract.from_data.sizeβ size in bytesextract.from_data.offsetβ byte offsetextract.from_parseβ used whentype = DPKG_EXTRACT_FROM_PARSEextract.from_parse.sizeβ size in bytesextract.from_parse.offsetβ byte offsetnum_of_byte_masksβ defines the number of valid entries in the array below; this is also the number of bytes to be used as masks β¨masksβ masks parameters
lowkey reminder bestie:from_hdr,from_dataandfrom_parseall live in the sameunionβ only one of them is the moment at a time, andtypeis what tells you which one π
π SEE ALSO π
the whole squad, go say hi:
- Kernel file
./drivers/net/ethernet/freescale/dpaa2/dpkg.h DPKG_NUM_OF_MASKS(9),DPKG_MAX_NUM_OF_EXTRACTS(9),enum dpkg_extract_from_hdr_type(9),enum dpkg_extract_type(9),struct dpkg_mask(9),struct dpkg_profile_cfg(9)
and that's the page, bestie! π this lil gem lives in the kernel docs under ./drivers/net/ethernet/freesca... (yes the source line is literally truncated like that, we stan a mysterious queen) and it's dated October 2026. slay, go extract some packets ππ§β
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms