From b463e1f265628f97967a01ce0a2cf18afe7b7aa3 Mon Sep 17 00:00:00 2001 From: Vadim Kochan Date: Sun, 14 May 2017 08:52:08 +0300 Subject: trafgen: parser: Use proto_field_set_xxx where it is possible Use proto_field_set_xxx(field, ...) instead of proto_hdr_field_set_xxx(hdr, fid, ...) to be more generic and do not depend on 'hdr' variable. Signed-off-by: Vadim Kochan Signed-off-by: Tobias Klauser --- trafgen_proto.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'trafgen_proto.c') diff --git a/trafgen_proto.c b/trafgen_proto.c index 5fd9e1c..b802a3a 100644 --- a/trafgen_proto.c +++ b/trafgen_proto.c @@ -477,6 +477,11 @@ void proto_field_set_be32(struct proto_field *field, uint32_t val) __proto_field_set_bytes(field, (uint8_t *)&val, false, true); } +void proto_field_set_bytes(struct proto_field *field, const uint8_t *bytes) +{ + __proto_field_set_bytes(field, bytes, false, false); +} + void protos_init(const char *dev) { ctx.dev = dev; -- cgit v1.2.3-54-g00ecf