summaryrefslogtreecommitdiff
path: root/src/lib/protobuf.c
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2023-03-14 12:50:22 +0100
committerSander Vrijders <sander@ouroboros.rocks>2023-03-18 17:12:26 +0100
commitee196e9a00475a029018181f8d6a00106ee462ce (patch)
tree8cb703ebaed3f8b5d7b71bf263710f9ed5edb6a1 /src/lib/protobuf.c
parent975a3ad0c761f5603a5026a56d825ba0ccb591c9 (diff)
downloadouroboros-ee196e9a00475a029018181f8d6a00106ee462ce.tar.gz
ouroboros-ee196e9a00475a029018181f8d6a00106ee462ce.zip
lib: Split flow_alloc from flow_join
Better to keep these separate during IRMd revision. Moves the qosspec default out of the protobuf message parsing. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/lib/protobuf.c')
-rw-r--r--src/lib/protobuf.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/lib/protobuf.c b/src/lib/protobuf.c
index 0855305f..830efd40 100644
--- a/src/lib/protobuf.c
+++ b/src/lib/protobuf.c
@@ -301,26 +301,25 @@ struct ipcp_config ipcp_config_msg_to_s(const ipcp_config_msg_t * msg)
qosspec_msg_t * qos_spec_s_to_msg(const struct qos_spec * s)
{
- struct qos_spec spec;
qosspec_msg_t * msg;
+ assert(s != NULL);
+
msg = malloc(sizeof(*msg));
if (msg == NULL)
return NULL;
qosspec_msg__init(msg);
- spec = (s == NULL ? qos_raw : *s);
-
- msg->delay = spec.delay;
- msg->bandwidth = spec.bandwidth;
- msg->availability = spec.availability;
- msg->loss = spec.loss;
- msg->ber = spec.ber;
- msg->in_order = spec.in_order;
- msg->max_gap = spec.max_gap;
- msg->cypher_s = spec.cypher_s;
- msg->timeout = spec.timeout;
+ msg->delay = s->delay;
+ msg->bandwidth = s->bandwidth;
+ msg->availability = s->availability;
+ msg->loss = s->loss;
+ msg->ber = s->ber;
+ msg->in_order = s->in_order;
+ msg->max_gap = s->max_gap;
+ msg->cypher_s = s->cypher_s;
+ msg->timeout = s->timeout;
return msg;
}