diff options
author | Florian Westphal <fw@strlen.de> | 2020-12-07 12:36:53 +0100 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2020-12-09 18:33:53 +0100 |
commit | e63f067f597d1129b3fff91d2404701de90226d1 (patch) | |
tree | 60beba6e04f050b5fafaa437b3e54808adf68bd7 | |
parent | bd0d2f4038ba1ac9db4653a4f632553db83db3b0 (diff) |
proto: reduce size of proto_desc structure
This will need an additional field. We can compress state
here to avoid further size increase.
Signed-off-by: Florian Westphal <fw@strlen.de>
-rw-r--r-- | include/proto.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/include/proto.h b/include/proto.h index 6ef332c3..667650d6 100644 --- a/include/proto.h +++ b/include/proto.h @@ -39,8 +39,8 @@ struct proto_hdr_template { const struct datatype *dtype; uint16_t offset; uint16_t len; - enum byteorder byteorder; - enum nft_meta_keys meta_key; + enum byteorder byteorder:8; + enum nft_meta_keys meta_key:8; }; #define PROTO_HDR_TEMPLATE(__token, __dtype, __byteorder, __offset, __len)\ @@ -101,11 +101,11 @@ enum proto_desc_id { */ struct proto_desc { const char *name; - enum proto_desc_id id; - enum proto_bases base; - enum nft_payload_csum_types checksum_type; - unsigned int checksum_key; - unsigned int protocol_key; + enum proto_desc_id id:8; + enum proto_bases base:8; + enum nft_payload_csum_types checksum_type:8; + uint16_t checksum_key; + uint16_t protocol_key; unsigned int length; struct { unsigned int num; |