summaryrefslogtreecommitdiff
path: root/trafgen_proto.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2016-08-09 16:39:13 +0200
committerTobias Klauser <tklauser@distanz.ch>2016-08-09 16:39:13 +0200
commit66cf8073cb31cebf4532afec9b18556aff8088fb (patch)
tree9a115e013af449417261c5f12df1bf7cd1944dd7 /trafgen_proto.c
parent4e47fd021a6945aa626eaef4446c5b547d8c2a85 (diff)
trafgen: proto: Make bytes pointer const in proto field set functions
Make the __proto_field_set_bytes() take a const uint8_t *bytes pointer and also changed all callers accordingly. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'trafgen_proto.c')
-rw-r--r--trafgen_proto.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/trafgen_proto.c b/trafgen_proto.c
index 8baacbe..4219794 100644
--- a/trafgen_proto.c
+++ b/trafgen_proto.c
@@ -171,7 +171,8 @@ set_proto:
}
static void __proto_field_set_bytes(struct proto_hdr *hdr, uint32_t fid,
- uint8_t *bytes, bool is_default, bool is_be)
+ const uint8_t *bytes, bool is_default,
+ bool is_be)
{
struct proto_field *field;
uint8_t *payload, *p8;
@@ -224,7 +225,8 @@ static void __proto_field_set_bytes(struct proto_hdr *hdr, uint32_t fid,
field->is_set = true;
}
-void proto_field_set_bytes(struct proto_hdr *hdr, uint32_t fid, uint8_t *bytes)
+void proto_field_set_bytes(struct proto_hdr *hdr, uint32_t fid,
+ const uint8_t *bytes)
{
__proto_field_set_bytes(hdr, fid, bytes, false, false);
}
@@ -273,7 +275,8 @@ uint32_t proto_field_get_u32(struct proto_hdr *hdr, uint32_t fid)
return field_unmask_and_unshift(field, be32_to_cpu(val));
}
-void proto_field_set_default_bytes(struct proto_hdr *hdr, uint32_t fid, uint8_t *bytes)
+void proto_field_set_default_bytes(struct proto_hdr *hdr, uint32_t fid,
+ const uint8_t *bytes)
{
__proto_field_set_bytes(hdr, fid, bytes, true, false);
}