diff options
author | Vadim Kochan <vadim4j@gmail.com> | 2017-05-14 08:52:08 +0300 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2017-05-15 10:32:12 +0200 |
commit | b463e1f265628f97967a01ce0a2cf18afe7b7aa3 (patch) | |
tree | 66436f3bcfb429593e4ab8155b5e431027da2763 /trafgen_proto.c | |
parent | 5ca91a807a81db233e1b4443ea227bb1d0a7868f (diff) |
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 <vadim4j@gmail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'trafgen_proto.c')
-rw-r--r-- | trafgen_proto.c | 5 |
1 files changed, 5 insertions, 0 deletions
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; |