1# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2# SPDX-License-Identifier: Apache-2.0
3
4HARNESS_ENTRY = harness
5HARNESS_FILE = MQTTAgent_ResumeSession_harness
6
7# This should be a unique identifier for this proof, and will appear on the
8# Litani dashboard. It can be human-readable and contain spaces if you wish.
9PROOF_UID = MQTTAgent_ResumeSession
10
11# MQTT_AGENT_MAX_OUTSTANDING_ACKS set the maximum number of acknowledgments
12# that can be outstanding at any one time. A small number 2 will be enough
13# for proving the memory safety and making the proofs run faster.
14MQTT_AGENT_MAX_OUTSTANDING_ACKS=2
15
16# Bound for loop unwinding for the loops trying to read and write into the
17# outstanding acks array. The size of the array is determined by
18# MQTT_AGENT_MAX_OUTSTANDING_ACKS. The max bound will be one more than
19# array size for the proofs.
20MAX_BOUND_FOR_PENDING_ACK_LOOPS=$(shell expr $(MQTT_AGENT_MAX_OUTSTANDING_ACKS) + 1 )
21
22# The maximum value for packet identifier for the packets to be filled in the
23# pending acks array. Chosen a small value 5 to increase the probability of
24# finding a matching packet for query from MQTT_PublishToResend API.
25MAX_PACKET_ID=5
26
27DEFINES += -DMQTT_AGENT_MAX_OUTSTANDING_ACKS=$(MQTT_AGENT_MAX_OUTSTANDING_ACKS)
28DEFINES += -DMAX_PACKET_ID=$(MAX_PACKET_ID)
29
30INCLUDES +=
31
32REMOVE_FUNCTION_BODY +=
33
34UNWINDSET += __CPROVER_file_local_core_mqtt_agent_c_getAwaitingOperation.0:$(MAX_BOUND_FOR_PENDING_ACK_LOOPS)
35UNWINDSET += __CPROVER_file_local_core_mqtt_agent_c_clearPendingAcknowledgments.0:$(MAX_BOUND_FOR_PENDING_ACK_LOOPS)
36UNWINDSET += __CPROVER_file_local_core_mqtt_agent_c_resendPublishes.0:$(MAX_BOUND_FOR_PENDING_ACK_LOOPS)
37UNWINDSET += addPendingAcks.0:$(MAX_BOUND_FOR_PENDING_ACK_LOOPS)
38
39PROOF_SOURCES += $(PROOFDIR)/$(HARNESS_FILE).c
40PROOF_SOURCES += $(SRCDIR)/test/cbmc/sources/mqtt_agent_cbmc_state.c
41PROOF_SOURCES += $(SRCDIR)/test/cbmc/stubs/network_interface_stubs.c
42PROOF_SOURCES += $(SRCDIR)/test/cbmc/stubs/incoming_publish_callback_stub.c
43PROOF_SOURCES += $(SRCDIR)/test/cbmc/stubs/get_time_stub.c
44PROOF_SOURCES += $(SRCDIR)/test/cbmc/stubs/agent_command_pool_stubs.c
45PROOF_SOURCES += $(SRCDIR)/test/cbmc/stubs/agent_message_stubs.c
46PROOF_SOURCES += $(SRCDIR)/test/cbmc/stubs/core_mqtt_stubs.c
47
48PROJECT_SOURCES += $(SRCDIR)/source/core_mqtt_agent.c
49
50include ../Makefile.common
51