From 7925eea97dfbe30b87217c6db9c6326f4eb66324 Mon Sep 17 00:00:00 2001 From: Vadim Kochan Date: Sun, 18 Dec 2016 11:52:47 +0200 Subject: trafgen: proto: Add proto field only setters/getters Add proto_field_xxx functions to set/get value via specified proto_field only. It is good to have such API in case if application needs to set/get value for some custom proto_field instance. Signed-off-by: Vadim Kochan Signed-off-by: Tobias Klauser --- trafgen_proto.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'trafgen_proto.h') diff --git a/trafgen_proto.h b/trafgen_proto.h index 927fcb1..d4427e6 100644 --- a/trafgen_proto.h +++ b/trafgen_proto.h @@ -147,4 +147,14 @@ extern void proto_hdr_field_func_add(struct proto_hdr *hdr, uint32_t fid, extern struct proto_field *proto_hdr_field_by_id(struct proto_hdr *hdr, uint32_t fid); + +extern void proto_field_set_u8(struct proto_field *field, uint8_t val); +extern uint8_t proto_field_get_u8(struct proto_field *field); +extern void proto_field_set_u16(struct proto_field *field, uint16_t val); +extern uint16_t proto_field_get_u16(struct proto_field *field); +extern void proto_field_set_u32(struct proto_field *field, uint32_t val); +extern uint32_t proto_field_get_u32(struct proto_field *field); +extern void proto_field_set_be16(struct proto_field *field, uint16_t val); +extern void proto_field_set_be32(struct proto_field *field, uint32_t val); + #endif /* TRAFGEN_PROTO_H */ -- cgit v1.2.3-54-g00ecf